libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libtool litter


From: Alexandre Oliva
Subject: Re: libtool litter
Date: 11 May 2001 23:20:50 -0300
User-agent: Gnus/5.090002 (Oort Gnus v0.02) XEmacs/21.1 (Cuyahoga Valley)

On May 11, 2001, "John David Anglin" <address@hidden> wrote:

> With the current cvs source for the branch, I find that libtool is leaving
> an incredible amount of litter in /usr/tmp.

This is probably a shell bug.  Some shells won't clean up temporary
files created for here-documents when they terminate by `exec'ing some
other program.  This problem had been fixed in ltconfig a long time
ago, but it seems that the problems in ltmain.sh were introduced
afterwards.  I suppose this patch should fix it.  It should only
affect modes install and run, so only `make install' should behave
differently.  If you still have a build tree, could you please verify
that this patch fixes the problem?  You may want to apply the patch in
existing libtool scripts in the build tree, instead of in ltmain.sh,
to avoid reconfiguring or failing to get them updated.

Other libtool maintainers, is this ok to install in MLB
(s/ltmain.sh/ltmain.in/)?  1.4 branch too, if applicable?

Index: ltmain.sh
===================================================================
RCS file: /cvs/gcc/egcs/ltmain.sh,v
retrieving revision 1.14
diff -u -p -r1.14 ltmain.sh
--- ltmain.sh 2001/04/20 09:26:56 1.14
+++ ltmain.sh 2001/05/12 02:15:52
@@ -246,6 +246,11 @@ if test -n "$prevopt"; then
   exit 1
 fi
 
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
 if test -z "$show_help"; then
 
   # Infer the operation mode.
@@ -4866,11 +4871,10 @@ relink_command=\"$relink_command\""
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       test -n "$run" && current_libdirs=" -n$current_libdirs"
-      exec $SHELL $0 --finish$current_libdirs
-      exit 1
+      exec_cmd='$SHELL $0 --finish$current_libdirs'
+    else
+      exit 0
     fi
-
-    exit 0
     ;;
 
   # libtool finish mode
@@ -5072,12 +5076,9 @@ relink_command=\"$relink_command\""
       if test "${save_LANG+set}" = set; then
        LANG="$save_LANG"; export LANG
       fi
-
-      # Now actually exec the command.
-      eval "exec \$cmd$args"
 
-      $echo "$modename: cannot exec \$cmd$args"
-      exit 1
+      # Now prepare to actually exec the command.
+      exec_cmd='\$cmd$args'
     else
       # Display what would be done.
       if test -n "$shlibpath_var"; then
@@ -5254,10 +5255,17 @@ relink_command=\"$relink_command\""
     ;;
   esac
 
-  $echo "$modename: invalid operation mode \`$mode'" 1>&2
-  $echo "$generic_help" 1>&2
-  exit 1
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit 1
+  fi
 fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit 1
+fi
 
 # We need to display help for each of the modes.
 case $mode in
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  address@hidden, redhat.com}
CS PhD student at IC-Unicamp        address@hidden, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

reply via email to

[Prev in Thread] Current Thread [Next in Thread]