diff options
author | Andreas Jaeger <aj@suse.de> | 2001-05-12 21:30:30 +0000 |
---|---|---|
committer | Bruce Korb <bkorb@gnu.org> | 2001-05-12 21:30:30 +0000 |
commit | c0d07b8ac31ed8193bf3b7d6285277767f629612 (patch) | |
tree | faf1f39b2fb58aa3b7c3a42f2a0743e77b8d1606 | |
parent | 8863577ed1d4e6b43333e8ba9e5e527a743448e2 (diff) | |
download | libtool-c0d07b8ac31ed8193bf3b7d6285277767f629612.tar.gz |
move execute script to a template & move an A-G macro to ltmain.tpl
-rw-r--r-- | exe/lt_exe.tpl | 17 | ||||
-rw-r--r-- | exe/lt_execute.def | 139 | ||||
-rw-r--r-- | exe/ltmain.tpl | 16 |
3 files changed, 16 insertions, 156 deletions
diff --git a/exe/lt_exe.tpl b/exe/lt_exe.tpl index 784c029a..8fe746c5 100644 --- a/exe/lt_exe.tpl +++ b/exe/lt_exe.tpl @@ -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 + ;; diff --git a/exe/lt_execute.def b/exe/lt_execute.def index 614ec35b..00b61410 100644 --- a/exe/lt_execute.def +++ b/exe/lt_execute.def @@ -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_; }; /* diff --git a/exe/ltmain.tpl b/exe/ltmain.tpl index aad81cbf..a82ff615 100644 --- a/exe/ltmain.tpl +++ b/exe/ltmain.tpl @@ -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) |