Subject: Re: libtool changing basename(argv[0])

From: Lucas De Marchi <[email-masked]>
Date: Fri, 23 Dec 2011 02:12:34 -0200

On Fri, Dec 23, 2011 at 1:51 AM, Lucas De Marchi
<[email-masked]> wrote:
> Hey all,
>
> In one of my projects I rely on basename(argv[0]) to know what to do
> in the application (because it can be called from compat symlinks).
> With libtool 2.4.2 I'm having an issue that basename(argv[0]) returns
> lt-progname instead of just progname. Another developer has libtool
> 2.4 and does not have this problem.
>
> Is this a regression from 2.4? Googling shows me some similar problem
> but with older versions (~ 2009)

Checking the source code.... the following change fixes the problem
for me, but I'm not sure if it's the right fix.

thanks
Lucas De Marchi
From 1413338157e3cca1529b9bef2cf023a5c0d0944b Mon Sep 17 00:00:00 2001
From: Lucas De Marchi <[email-masked]>
Date: Fri, 23 Dec 2011 02:13:30 -0200
Subject: [PATCH] Do not change argv[0] to lt-progname

Signed-off-by: Lucas De Marchi <[email-masked]>
---
 build-aux/ltmain.m4sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 922e957..f11125b 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -3281,7 +3281,7 @@ func_exec_program ()
 
 	if test yes = "$fast_install"; then
 	  $ECHO "\
-  program=lt-'$outputname'$exeext
+  program='$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
 
   if test ! -f \"\$progdir/\$program\" ||
-- 
1.7.8