diff options
Diffstat (limited to 'glib/ltmain.sh')
-rw-r--r-- | glib/ltmain.sh | 111 |
1 files changed, 59 insertions, 52 deletions
diff --git a/glib/ltmain.sh b/glib/ltmain.sh index 9b8e94784b..0e884205b8 100644 --- a/glib/ltmain.sh +++ b/glib/ltmain.sh @@ -30,7 +30,7 @@ modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.1 +VERSION=1.2 default_mode= help="Try \`$progname --help' for more information." @@ -386,6 +386,7 @@ if test -z "$show_help"; then prev= prevarg= release= + postfix= rpath= perm_rpath= temp_rpath= @@ -437,6 +438,11 @@ if test -z "$show_help"; then prev= continue ;; + postfix) + postfix="-$arg" + prev= + continue + ;; rpath) rpath="$rpath $arg" prev= @@ -481,7 +487,7 @@ if test -z "$show_help"; then if test "$export_dynamic" != yes; then export_dynamic=yes if test -n "$export_dynamic_flag_spec"; then - arg=`eval \\$echo "$export_dynamic_flag_spec"` + eval arg=\"$export_dynamic_flag_spec\" else arg= fi @@ -520,6 +526,11 @@ if test -z "$show_help"; then continue ;; + -postfix) + prev=postfix + continue + ;; + -rpath) prev=rpath continue @@ -682,7 +693,7 @@ if test -z "$show_help"; then fi if test -n "$libdir"; then - flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"` + eval flag=\"$hardcode_libdir_flag_spec\" compile_command="$compile_command $flag" finalize_command="$finalize_command $flag" @@ -842,8 +853,8 @@ if test -z "$show_help"; then ;; esac - name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - libname=`eval \\$echo \"$libname_spec\"` + name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`$postfix + eval libname=\"$libname_spec\" # All the library-specific variables (install_libdir is set above). library_names= @@ -1006,13 +1017,13 @@ if test -z "$show_help"; then if test "$build_libtool_libs" = yes; then # Get the real and link names of the library. - library_names=`eval \\$echo \"$library_names_spec\"` + eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then - soname=`eval \\$echo \"$soname_spec\"` + eval soname=\"$soname_spec\" else soname="$realname" fi @@ -1027,7 +1038,7 @@ if test -z "$show_help"; then test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'` # Do each of the archive commands. - cmds=`eval \\$echo \"$archive_cmds\"` + eval cmds=\"$archive_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1104,7 +1115,7 @@ if test -z "$show_help"; then reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'` output="$obj" - cmds=`eval \\$echo \"$reload_cmds\"` + eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1128,7 +1139,7 @@ if test -z "$show_help"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs" output="$libobj" - cmds=`eval \\$echo \"$reload_cmds\"` + eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1177,7 +1188,7 @@ if test -z "$show_help"; then fi if test -n "$libdir"; then - flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"` + eval flag=\"$hardcode_libdir_flag_spec\" compile_command="$compile_command $flag" finalize_command="$finalize_command $flag" @@ -1254,8 +1265,8 @@ if test -z "$show_help"; then case "$dlsyms" in "") ;; *.c) - $echo > "$objdir/$dlsyms" \ -"/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */ + $echo > "$objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */ #ifdef __cplusplus @@ -1266,17 +1277,17 @@ extern \"C\" { #define dld_preloaded_symbol_count some_other_symbol #define dld_preloaded_symbols some_other_symbol -/* External symbol declarations for the compiler. */" +/* External symbol declarations for the compiler. */\ +" if test -f "$nlist"; then sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms" else echo '/* NONE */' >> "$objdir/$dlsyms" -EOF fi - $echo >> "$objdir/$dlsyms" \ -" + $echo >> "$objdir/$dlsyms" "\ + #undef dld_preloaded_symbol_count #undef dld_preloaded_symbols @@ -1295,19 +1306,21 @@ struct { __ptr_t address; } dld_preloaded_symbols[] = -{" +{\ +" if test -f "$nlist"; then sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms" fi - $echo >> "$objdir/$dlsyms" \ -" {0, (__ptr_t) 0} + $echo >> "$objdir/$dlsyms" "\ + {0, (__ptr_t) 0} }; #ifdef __cplusplus } -#endif" +#endif\ +" ;; *) @@ -1427,8 +1440,8 @@ dld_preloaded_symbols[] = $rm $output trap "$rm $output; exit 1" 1 2 15 - $echo > $output \ -"#! /bin/sh + $echo > $output "\ +#! /bin/sh # $output - temporary wrapper script for $objdir/$output # Generated by ltmain.sh - GNU $PACKAGE $VERSION @@ -1459,10 +1472,9 @@ else else echo=\"$qecho\" file=\"\$0\" - fi -" - $echo >> $output \ + fi\ " + $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` @@ -1496,8 +1508,8 @@ else # Export our shlibpath_var if we have one. if test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output \ -" # Add our own library path to $shlibpath_var + $echo >> $output "\ + # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var @@ -1507,24 +1519,17 @@ else " fi - echo >> $output \ -" if test \"\$libtool_execute_magic\" != \"$magic\"; then + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. - args= - for arg - do - # Quote arguments (to preserve shell metacharacters). - arg=\`\$echo \"X\$arg\" | \$Xsed -e \"\$sed_quote_subst\"\` - args=\"\$args \\\"\$arg\\\"\" - done # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH - eval \"exec \$program \$args\" + exec \$program \${1+\"\$@\"} - \$echo \"\$0: cannot exec \$program \$args\" + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else @@ -1534,7 +1539,8 @@ else echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi -fi" +fi\ +" chmod +x $output fi exit 0 @@ -1548,9 +1554,9 @@ fi" # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=`eval \\$echo \"$old_archive_from_new_cmds\"` + eval cmds=\"$old_archive_from_new_cmds\" else - cmds=`eval \\$echo \"$old_archive_cmds\"` + eval cmds=\"$old_archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do @@ -1571,8 +1577,8 @@ fi" # Only create the output if not a dry run. if test -z "$run"; then - echo > $output \ -"# $output - a libtool library file + $echo > $output "\ +# $output - a libtool library file # Generated by ltmain.sh - GNU $PACKAGE $VERSION # The name that we can dlopen(3). @@ -1593,7 +1599,8 @@ age=$age revision=$revision # Directory that this library needs to be installed in: -libdir='$install_libdir'" +libdir='$install_libdir'\ +" fi # Do a symbolic link so that the libtool archive can be found in @@ -1835,7 +1842,7 @@ libdir='$install_libdir'" # Do each command in the postinstall commands. lib="$destdir/$realname" - cmds=`eval \\$echo \"$postinstall_cmds\"` + eval cmds=\"$postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -1972,7 +1979,7 @@ libdir='$install_libdir'" $run eval "$install_prog \$file \$oldlib" || exit $? # Do each command in the postinstall commands. - cmds=`eval \\$echo \"$old_postinstall_cmds\"` + eval cmds=\"$old_postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -2010,7 +2017,7 @@ libdir='$install_libdir'" for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. - cmds=`eval \\$echo \"$finish_cmds\"` + eval cmds=\"$finish_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -2021,7 +2028,7 @@ libdir='$install_libdir'" fi if test -n "$finish_eval"; then # Do the single finish_eval. - cmds=`eval \\$echo \"$finish_eval\"` + eval cmds=\"$finish_eval\" $run eval "$cmds" fi done @@ -2047,7 +2054,7 @@ libdir='$install_libdir'" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR - flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"` + eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi @@ -2238,7 +2245,7 @@ libdir='$install_libdir'" if test -n "$library_names"; then # Do each command in the postuninstall commands. - cmds=`eval \\$echo \"$postuninstall_cmds\"` + eval cmds=\"$postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" @@ -2250,7 +2257,7 @@ libdir='$install_libdir'" if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - cmds=`eval \\$echo \"$old_postuninstall_cmds\"` + eval cmds=\"$old_postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS=';' for cmd in $cmds; do IFS="$save_ifs" |