diff options
Diffstat (limited to 'ltmain.sh')
-rwxr-xr-x | ltmain.sh | 95 |
1 files changed, 57 insertions, 38 deletions
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | # libtool (GNU libtool) 2.4 | 2 | # libtool (GNU libtool) 2.4.2 |
3 | # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 | 3 | # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
4 | 4 | ||
5 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, | 5 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, |
6 | # 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 6 | # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
7 | # This is free software; see the source for copying conditions. There is NO | 7 | # This is free software; see the source for copying conditions. There is NO |
8 | # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 8 | # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
9 | 9 | ||
@@ -41,6 +41,7 @@ | |||
41 | # --quiet, --silent don't print informational messages | 41 | # --quiet, --silent don't print informational messages |
42 | # --no-quiet, --no-silent | 42 | # --no-quiet, --no-silent |
43 | # print informational messages (default) | 43 | # print informational messages (default) |
44 | # --no-warn don't display warning messages | ||
44 | # --tag=TAG use configuration variables from tag TAG | 45 | # --tag=TAG use configuration variables from tag TAG |
45 | # -v, --verbose print more informational messages than default | 46 | # -v, --verbose print more informational messages than default |
46 | # --no-verbose don't print the extra informational messages | 47 | # --no-verbose don't print the extra informational messages |
@@ -69,7 +70,7 @@ | |||
69 | # compiler: $LTCC | 70 | # compiler: $LTCC |
70 | # compiler flags: $LTCFLAGS | 71 | # compiler flags: $LTCFLAGS |
71 | # linker: $LD (gnu? $with_gnu_ld) | 72 | # linker: $LD (gnu? $with_gnu_ld) |
72 | # $progname: (GNU libtool) 2.4 Debian-2.4-3 | 73 | # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1 |
73 | # automake: $automake_version | 74 | # automake: $automake_version |
74 | # autoconf: $autoconf_version | 75 | # autoconf: $autoconf_version |
75 | # | 76 | # |
@@ -79,9 +80,9 @@ | |||
79 | 80 | ||
80 | PROGRAM=libtool | 81 | PROGRAM=libtool |
81 | PACKAGE=libtool | 82 | PACKAGE=libtool |
82 | VERSION="2.4 Debian-2.4-3" | 83 | VERSION="2.4.2 Debian-2.4.2-1" |
83 | TIMESTAMP="" | 84 | TIMESTAMP="" |
84 | package_revision=1.3293 | 85 | package_revision=1.3337 |
85 | 86 | ||
86 | # Be Bourne compatible | 87 | # Be Bourne compatible |
87 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then | 88 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then |
@@ -136,15 +137,10 @@ progpath="$0" | |||
136 | 137 | ||
137 | : ${CP="cp -f"} | 138 | : ${CP="cp -f"} |
138 | test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} | 139 | test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} |
139 | : ${EGREP="/bin/grep -E"} | ||
140 | : ${FGREP="/bin/grep -F"} | ||
141 | : ${GREP="/bin/grep"} | ||
142 | : ${LN_S="ln -s"} | ||
143 | : ${MAKE="make"} | 140 | : ${MAKE="make"} |
144 | : ${MKDIR="mkdir"} | 141 | : ${MKDIR="mkdir"} |
145 | : ${MV="mv -f"} | 142 | : ${MV="mv -f"} |
146 | : ${RM="rm -f"} | 143 | : ${RM="rm -f"} |
147 | : ${SED="/bin/sed"} | ||
148 | : ${SHELL="${CONFIG_SHELL-/bin/sh}"} | 144 | : ${SHELL="${CONFIG_SHELL-/bin/sh}"} |
149 | : ${Xsed="$SED -e 1s/^X//"} | 145 | : ${Xsed="$SED -e 1s/^X//"} |
150 | 146 | ||
@@ -387,7 +383,7 @@ case $progpath in | |||
387 | ;; | 383 | ;; |
388 | *) | 384 | *) |
389 | save_IFS="$IFS" | 385 | save_IFS="$IFS" |
390 | IFS=: | 386 | IFS=${PATH_SEPARATOR-:} |
391 | for progdir in $PATH; do | 387 | for progdir in $PATH; do |
392 | IFS="$save_IFS" | 388 | IFS="$save_IFS" |
393 | test -x "$progdir/$progname" && break | 389 | test -x "$progdir/$progname" && break |
@@ -771,8 +767,8 @@ func_help () | |||
771 | s*\$LTCFLAGS*'"$LTCFLAGS"'* | 767 | s*\$LTCFLAGS*'"$LTCFLAGS"'* |
772 | s*\$LD*'"$LD"'* | 768 | s*\$LD*'"$LD"'* |
773 | s/\$with_gnu_ld/'"$with_gnu_ld"'/ | 769 | s/\$with_gnu_ld/'"$with_gnu_ld"'/ |
774 | s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ | 770 | s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ |
775 | s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ | 771 | s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ |
776 | p | 772 | p |
777 | d | 773 | d |
778 | } | 774 | } |
@@ -1052,6 +1048,7 @@ opt_finish=false | |||
1052 | opt_help=false | 1048 | opt_help=false |
1053 | opt_help_all=false | 1049 | opt_help_all=false |
1054 | opt_silent=: | 1050 | opt_silent=: |
1051 | opt_warning=: | ||
1055 | opt_verbose=: | 1052 | opt_verbose=: |
1056 | opt_silent=false | 1053 | opt_silent=false |
1057 | opt_verbose=false | 1054 | opt_verbose=false |
@@ -1120,6 +1117,10 @@ esac | |||
1120 | opt_silent=false | 1117 | opt_silent=false |
1121 | func_append preserve_args " $opt" | 1118 | func_append preserve_args " $opt" |
1122 | ;; | 1119 | ;; |
1120 | --no-warning|--no-warn) | ||
1121 | opt_warning=false | ||
1122 | func_append preserve_args " $opt" | ||
1123 | ;; | ||
1123 | --no-verbose) | 1124 | --no-verbose) |
1124 | opt_verbose=false | 1125 | opt_verbose=false |
1125 | func_append preserve_args " $opt" | 1126 | func_append preserve_args " $opt" |
@@ -2059,7 +2060,7 @@ func_mode_compile () | |||
2059 | *.[cCFSifmso] | \ | 2060 | *.[cCFSifmso] | \ |
2060 | *.ada | *.adb | *.ads | *.asm | \ | 2061 | *.ada | *.adb | *.ads | *.asm | \ |
2061 | *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ | 2062 | *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ |
2062 | *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) | 2063 | *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) |
2063 | func_xform "$libobj" | 2064 | func_xform "$libobj" |
2064 | libobj=$func_xform_result | 2065 | libobj=$func_xform_result |
2065 | ;; | 2066 | ;; |
@@ -3201,11 +3202,13 @@ func_mode_install () | |||
3201 | 3202 | ||
3202 | # Set up the ranlib parameters. | 3203 | # Set up the ranlib parameters. |
3203 | oldlib="$destdir/$name" | 3204 | oldlib="$destdir/$name" |
3205 | func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 | ||
3206 | tool_oldlib=$func_to_tool_file_result | ||
3204 | 3207 | ||
3205 | func_show_eval "$install_prog \$file \$oldlib" 'exit $?' | 3208 | func_show_eval "$install_prog \$file \$oldlib" 'exit $?' |
3206 | 3209 | ||
3207 | if test -n "$stripme" && test -n "$old_striplib"; then | 3210 | if test -n "$stripme" && test -n "$old_striplib"; then |
3208 | func_show_eval "$old_striplib $oldlib" 'exit $?' | 3211 | func_show_eval "$old_striplib $tool_oldlib" 'exit $?' |
3209 | fi | 3212 | fi |
3210 | 3213 | ||
3211 | # Do each command in the postinstall commands. | 3214 | # Do each command in the postinstall commands. |
@@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup() { | |||
3470 | # linked before any other PIC object. But we must not use | 3473 | # linked before any other PIC object. But we must not use |
3471 | # pic_flag when linking with -static. The problem exists in | 3474 | # pic_flag when linking with -static. The problem exists in |
3472 | # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. | 3475 | # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. |
3473 | *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) | 3476 | *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) |
3474 | pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; | 3477 | pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; |
3475 | *-*-hpux*) | 3478 | *-*-hpux*) |
3476 | pic_flag_for_symtable=" $pic_flag" ;; | 3479 | pic_flag_for_symtable=" $pic_flag" ;; |
@@ -3982,14 +3985,17 @@ func_exec_program_core () | |||
3982 | # launches target application with the remaining arguments. | 3985 | # launches target application with the remaining arguments. |
3983 | func_exec_program () | 3986 | func_exec_program () |
3984 | { | 3987 | { |
3985 | for lt_wr_arg | 3988 | case \" \$* \" in |
3986 | do | 3989 | *\\ --lt-*) |
3987 | case \$lt_wr_arg in | 3990 | for lt_wr_arg |
3988 | --lt-*) ;; | 3991 | do |
3989 | *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; | 3992 | case \$lt_wr_arg in |
3990 | esac | 3993 | --lt-*) ;; |
3991 | shift | 3994 | *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; |
3992 | done | 3995 | esac |
3996 | shift | ||
3997 | done ;; | ||
3998 | esac | ||
3993 | func_exec_program_core \${1+\"\$@\"} | 3999 | func_exec_program_core \${1+\"\$@\"} |
3994 | } | 4000 | } |
3995 | 4001 | ||
@@ -5057,9 +5063,15 @@ void lt_dump_script (FILE* f) | |||
5057 | { | 5063 | { |
5058 | EOF | 5064 | EOF |
5059 | func_emit_wrapper yes | | 5065 | func_emit_wrapper yes | |
5060 | $SED -e 's/\([\\"]\)/\\\1/g' \ | 5066 | $SED -n -e ' |
5061 | -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' | 5067 | s/^\(.\{79\}\)\(..*\)/\1\ |
5062 | 5068 | \2/ | |
5069 | h | ||
5070 | s/\([\\"]\)/\\\1/g | ||
5071 | s/$/\\n/ | ||
5072 | s/\([^\n]*\).*/ fputs ("\1", f);/p | ||
5073 | g | ||
5074 | D' | ||
5063 | cat <<"EOF" | 5075 | cat <<"EOF" |
5064 | } | 5076 | } |
5065 | EOF | 5077 | EOF |
@@ -5643,7 +5655,8 @@ func_mode_link () | |||
5643 | continue | 5655 | continue |
5644 | ;; | 5656 | ;; |
5645 | 5657 | ||
5646 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) | 5658 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |
5659 | |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) | ||
5647 | func_append compiler_flags " $arg" | 5660 | func_append compiler_flags " $arg" |
5648 | func_append compile_command " $arg" | 5661 | func_append compile_command " $arg" |
5649 | func_append finalize_command " $arg" | 5662 | func_append finalize_command " $arg" |
@@ -6150,7 +6163,8 @@ func_mode_link () | |||
6150 | lib= | 6163 | lib= |
6151 | found=no | 6164 | found=no |
6152 | case $deplib in | 6165 | case $deplib in |
6153 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) | 6166 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |
6167 | |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) | ||
6154 | if test "$linkmode,$pass" = "prog,link"; then | 6168 | if test "$linkmode,$pass" = "prog,link"; then |
6155 | compile_deplibs="$deplib $compile_deplibs" | 6169 | compile_deplibs="$deplib $compile_deplibs" |
6156 | finalize_deplibs="$deplib $finalize_deplibs" | 6170 | finalize_deplibs="$deplib $finalize_deplibs" |
@@ -6834,7 +6848,7 @@ func_mode_link () | |||
6834 | test "$hardcode_direct_absolute" = no; then | 6848 | test "$hardcode_direct_absolute" = no; then |
6835 | add="$dir/$linklib" | 6849 | add="$dir/$linklib" |
6836 | elif test "$hardcode_minus_L" = yes; then | 6850 | elif test "$hardcode_minus_L" = yes; then |
6837 | add_dir="-L$dir" | 6851 | add_dir="-L$absdir" |
6838 | # Try looking first in the location we're being installed to. | 6852 | # Try looking first in the location we're being installed to. |
6839 | if test -n "$inst_prefix_dir"; then | 6853 | if test -n "$inst_prefix_dir"; then |
6840 | case $libdir in | 6854 | case $libdir in |
@@ -7319,6 +7333,7 @@ func_mode_link () | |||
7319 | # which has an extra 1 added just for fun | 7333 | # which has an extra 1 added just for fun |
7320 | # | 7334 | # |
7321 | case $version_type in | 7335 | case $version_type in |
7336 | # correct linux to gnu/linux during the next big refactor | ||
7322 | darwin|linux|osf|windows|none) | 7337 | darwin|linux|osf|windows|none) |
7323 | func_arith $number_major + $number_minor | 7338 | func_arith $number_major + $number_minor |
7324 | current=$func_arith_result | 7339 | current=$func_arith_result |
@@ -7438,7 +7453,7 @@ func_mode_link () | |||
7438 | versuffix="$major.$revision" | 7453 | versuffix="$major.$revision" |
7439 | ;; | 7454 | ;; |
7440 | 7455 | ||
7441 | linux) | 7456 | linux) # correct to gnu/linux during the next big refactor |
7442 | func_arith $current - $age | 7457 | func_arith $current - $age |
7443 | major=.$func_arith_result | 7458 | major=.$func_arith_result |
7444 | versuffix="$major.$age.$revision" | 7459 | versuffix="$major.$age.$revision" |
@@ -8026,6 +8041,11 @@ EOF | |||
8026 | 8041 | ||
8027 | # Test again, we may have decided not to build it any more | 8042 | # Test again, we may have decided not to build it any more |
8028 | if test "$build_libtool_libs" = yes; then | 8043 | if test "$build_libtool_libs" = yes; then |
8044 | # Remove ${wl} instances when linking with ld. | ||
8045 | # FIXME: should test the right _cmds variable. | ||
8046 | case $archive_cmds in | ||
8047 | *\$LD\ *) wl= ;; | ||
8048 | esac | ||
8029 | if test "$hardcode_into_libs" = yes; then | 8049 | if test "$hardcode_into_libs" = yes; then |
8030 | # Hardcode the library paths | 8050 | # Hardcode the library paths |
8031 | hardcode_libdirs= | 8051 | hardcode_libdirs= |
@@ -8056,7 +8076,7 @@ EOF | |||
8056 | elif test -n "$runpath_var"; then | 8076 | elif test -n "$runpath_var"; then |
8057 | case "$perm_rpath " in | 8077 | case "$perm_rpath " in |
8058 | *" $libdir "*) ;; | 8078 | *" $libdir "*) ;; |
8059 | *) func_apped perm_rpath " $libdir" ;; | 8079 | *) func_append perm_rpath " $libdir" ;; |
8060 | esac | 8080 | esac |
8061 | fi | 8081 | fi |
8062 | done | 8082 | done |
@@ -8064,11 +8084,7 @@ EOF | |||
8064 | if test -n "$hardcode_libdir_separator" && | 8084 | if test -n "$hardcode_libdir_separator" && |
8065 | test -n "$hardcode_libdirs"; then | 8085 | test -n "$hardcode_libdirs"; then |
8066 | libdir="$hardcode_libdirs" | 8086 | libdir="$hardcode_libdirs" |
8067 | if test -n "$hardcode_libdir_flag_spec_ld"; then | 8087 | eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" |
8068 | eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" | ||
8069 | else | ||
8070 | eval dep_rpath=\"$hardcode_libdir_flag_spec\" | ||
8071 | fi | ||
8072 | fi | 8088 | fi |
8073 | if test -n "$runpath_var" && test -n "$perm_rpath"; then | 8089 | if test -n "$runpath_var" && test -n "$perm_rpath"; then |
8074 | # We should set the runpath_var. | 8090 | # We should set the runpath_var. |
@@ -9158,6 +9174,8 @@ EOF | |||
9158 | esac | 9174 | esac |
9159 | done | 9175 | done |
9160 | fi | 9176 | fi |
9177 | func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 | ||
9178 | tool_oldlib=$func_to_tool_file_result | ||
9161 | eval cmds=\"$old_archive_cmds\" | 9179 | eval cmds=\"$old_archive_cmds\" |
9162 | 9180 | ||
9163 | func_len " $cmds" | 9181 | func_len " $cmds" |
@@ -9267,7 +9285,8 @@ EOF | |||
9267 | *.la) | 9285 | *.la) |
9268 | func_basename "$deplib" | 9286 | func_basename "$deplib" |
9269 | name="$func_basename_result" | 9287 | name="$func_basename_result" |
9270 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | 9288 | func_resolve_sysroot "$deplib" |
9289 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` | ||
9271 | test -z "$libdir" && \ | 9290 | test -z "$libdir" && \ |
9272 | func_fatal_error "\`$deplib' is not a valid libtool archive" | 9291 | func_fatal_error "\`$deplib' is not a valid libtool archive" |
9273 | func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" | 9292 | func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" |