]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
move execute script to a template & move an A-G macro to ltmain.tpl
authorAndreas Jaeger <aj@suse.de>
Sat, 12 May 2001 21:30:30 +0000 (21:30 +0000)
committerBruce Korb <bkorb@gnu.org>
Sat, 12 May 2001 21:30:30 +0000 (21:30 +0000)
exe/lt_exe.tpl
exe/lt_execute.def
exe/ltmain.tpl

index 784c029a2534235ca1ce7b71c8e5be81d4b786b3..8fe746c5d803c870c749a11e2f813be7f29b52a7 100644 (file)
@@ -1,16 +1,8 @@
 [= AutoGen5 Template =]
-[=
-
-DEFINE test-or-exit =]
-if ([=test=]) > /dev/null 2>&1 ; then [=
-    invert ":\nelse "
-=]  $echo "$modename: [=msg=]" 1>&2
-  $echo "$help"
-  exit 1
-fi[=
-
-ENDDEF
-=]    # The first argument is the command name.
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
     cmd="$nonopt"
     [= test-or-exit test = 'test -z "$cmd"'
        msg  = "you must specify a COMMAND" =]
@@ -137,3 +129,4 @@ ENDDEF
       $echo "$cmd$args"
       exit 0
     fi
+    ;;
index 614ec35b774f7c9f456117c38b9f5033c1eaf944..00b614105d5f59ea208ceb50b9b04911ef3e1aca 100644 (file)
@@ -15,145 +15,6 @@ If any of the <cmd-arg> are libtool executable wrappers, then they are
 translated into their corresponding uninstalled binary, and any of their
 required library directories are added to the library path.\n
 Then, <command> is executed, with  `<cmd-arg>...' as arguments.\n";
-
-  text = << _END_EXECUTE_STRING_
-    # The first argument is the command name.
-    cmd="$nonopt"
-    if test -z "$cmd"; then
-      $echo "$modename: you must specify a COMMAND" 1>&2
-      $echo "$help"
-      exit 1
-    fi
-
-    # Handle -dlopen flags immediately.
-    for file in $execute_dlfiles; do
-      if test ! -f "$file"; then
-       $echo "$modename: \`$file' is not a file" 1>&2
-       $echo "$help" 1>&2
-       exit 1
-      fi
-
-      dir=
-      case $file in
-      *.la)
-       # Check to see that this really is a libtool archive.
-       if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-       else
-         $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-         $echo "$help" 1>&2
-         exit 1
-       fi
-
-       # Read the libtool library.
-       dlname=
-       library_names=
-
-       # If there is no directory component, then add one.
-       case $file in
-       */* | *\\*) . $file ;;
-       *) . ./$file ;;
-       esac
-
-       # Skip this library if it cannot be dlopened.
-       if test -z "$dlname"; then
-         # Warn if it was a shared library.
-         test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
-         continue
-       fi
-
-       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-       test "X$dir" = "X$file" && dir=.
-
-       if test -f "$dir/$objdir/$dlname"; then
-         dir="$dir/$objdir"
-       else
-         $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-         exit 1
-       fi
-       ;;
-
-      *.lo)
-       # Just add the directory containing the .lo file.
-       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-       test "X$dir" = "X$file" && dir=.
-       ;;
-
-      *)
-       $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
-       continue
-       ;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-       eval "$shlibpath_var=\"\$dir\""
-      else
-       eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -*) ;;
-      *)
-       # Do a test to see if this is really a libtool program.
-       if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-         # If there is no directory component, then add one.
-         case $file in
-         */* | *\\*) . $file ;;
-         *) . ./$file ;;
-         esac
-
-         # Transform arg to wrapped name.
-         file="$progdir/$program"
-       fi
-       ;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
-      args="$args \"$file\""
-    done
-
-    if test -z "$run"; then
-      if test -n "$shlibpath_var"; then
-       # Export the shlibpath_var.
-       eval "export $shlibpath_var"
-      fi
-
-      # Restore saved enviroment variables
-      if test "${save_LC_ALL+set}" = set; then
-       LC_ALL="$save_LC_ALL"; export LC_ALL
-      fi
-      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
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-       eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
-       $echo "export $shlibpath_var"
-      fi
-      $echo "$cmd$args"
-      exit 0
-    fi
-_END_EXECUTE_STRING_;
 };
 
 /*
index aad81cbfa812aafdc7c9b70abadfd5abf8db4f94..a82ff6150274c96ae8787c4a32a5a8812e30b445 100644 (file)
@@ -1,5 +1,15 @@
 [= AutoGen5 Template in=ltmain.in =]
-[=( dne "# " "# " )=]
+[=( dne "# " "# " )=][=
+
+DEFINE test-or-exit =]
+if ([=test=]) > /dev/null 2>&1 ; then
+[=    invert "  :\nelse"=]
+  $echo "$modename: [=msg=]" 1>&2
+  $echo "$help"
+  exit 1
+fi[=
+
+ENDDEF  =]
 #
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
@@ -314,11 +324,7 @@ if test -z "$show_help"; then
     ;;
 
   # libtool execute mode
-  execute)
-    modename="$modename: execute"
-
 [= include "lt_exe.tpl" =]
-    ;;
 
   # libtool clean and uninstall mode
   clean | uninstall)