1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
4 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # Check that we have a working $echo.
27 if test "X$1" = X--no-reexec; then
28 # Discard the --no-reexec flag, and continue.
30 elif test "X$1" = X--fallback-echo; then
31 # Avoid inline document here, it may be left over
33 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
34 # Yippee, $echo works!
37 # Restart under the correct shell, and then maybe $echo will work.
38 exec $SHELL "$0" --no-reexec ${1+"$@"}
41 if test "X$1" = X--fallback-echo; then
42 # used as fallback echo
50 # The name of this program.
51 progname=`$echo "$0" | sed 's%^.*/%%'`
58 TIMESTAMP=" (1.731 2000/07/10 09:42:21)"
61 help="Try \`$progname --help' for more information."
62 magic="%%%MAGIC variable%%%"
67 # Sed substitution that helps us do robust quoting. It backslashifies
68 # metacharacters that are still active within double-quoted strings.
70 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 NL2SP='tr \015\012 \040\040'
75 # Only set LANG and LC_ALL to C if already set.
76 # These must not be set unconditionally because not all systems understand
77 # e.g. LANG=C (notably SCO).
78 # We save the old values to restore during execute mode.
79 if test "${LC_ALL+set}" = set; then
80 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
82 if test "${LANG+set}" = set; then
83 save_LANG="$LANG"; LANG=C; export LANG
86 if test "$LTCONFIG_VERSION" != "$VERSION"; then
87 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
88 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
92 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
93 echo "$modename: not configured to build any kind of library" 1>&2
94 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
107 lo2o="s/\\.lo\$/.${objext}/"
108 o2lo="s/\\.${objext}\$/.lo/"
110 # Parse our command line options once, thoroughly.
117 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
121 # If the previous option needs an argument, assign it.
122 if test -n "$prev"; then
125 eval "$prev=\"\$$prev \$arg\""
137 # Have we seen a non-optional argument yet?
144 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
149 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
154 echo "$progname: enabling shell trace mode"
164 if test "$build_libtool_libs" = yes; then
165 echo "enable shared libraries"
167 echo "disable shared libraries"
169 if test "$build_old_libs" = yes; then
170 echo "enable static libraries"
172 echo "disable static libraries"
177 --finish) mode="finish" ;;
179 --mode) prevopt="--mode" prev=mode ;;
180 --mode=*) mode="$optarg" ;;
192 $echo "$modename: unrecognized option \`$arg'" 1>&2
204 if test -n "$prevopt"; then
205 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
210 if test -z "$show_help"; then
212 # Infer the operation mode.
213 if test -z "$mode"; then
215 *cc | *++ | gcc* | *-gcc*)
227 *db | *dbx | *strace | *truss)
237 # If we have no mode, but dlfiles were specified, then do execute mode.
238 test -n "$execute_dlfiles" && mode=execute
240 # Just use the default operation mode.
241 if test -z "$mode"; then
242 if test -n "$nonopt"; then
243 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
245 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
252 # Only execute mode is allowed to have -dlopen flags.
253 if test -n "$execute_dlfiles" && test "$mode" != execute; then
254 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
259 # Change the help message to a mode-specific one.
261 help="Try \`$modename --help --mode=$mode' for more information."
263 # These modes are in order of execution frequency so that they run quickly.
265 # libtool compile mode
267 modename="$modename: compile"
268 # Get the compilation command and the source file.
281 # Aesthetically quote the previous argument.
283 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
286 # Double-quote args containing other shell metacharacters.
287 # Many Bourne shells cannot handle close brackets correctly
288 # in scan sets, so we specify it separately.
289 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
294 # Add the previous argument to base_compile.
295 if test -z "$base_compile"; then
296 base_compile="$lastarg"
298 base_compile="$base_compile $lastarg"
304 # Accept any command-line options.
307 if test "$user_target" != "no"; then
308 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
335 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
337 IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
341 # Double-quote args containing other shell metacharacters.
342 # Many Bourne shells cannot handle close brackets correctly
343 # in scan sets, so we specify it separately.
345 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
349 lastarg="$lastarg $arg"
352 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
354 # Add the arguments to base_compile.
355 if test -z "$base_compile"; then
356 base_compile="$lastarg"
358 base_compile="$base_compile $lastarg"
364 case "$user_target" in
366 # The next one is the -o target name
371 # We got the output file
378 # Accept the current argument as the source file.
382 # Aesthetically quote the previous argument.
384 # Backslashify any backslashes, double quotes, and dollar signs.
385 # These are the only characters that are still specially
386 # interpreted inside of double-quoted scrings.
387 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
389 # Double-quote args containing other shell metacharacters.
390 # Many Bourne shells cannot handle close brackets correctly
391 # in scan sets, so we specify it separately.
393 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
394 lastarg="\"$lastarg\""
398 # Add the previous argument to base_compile.
399 if test -z "$base_compile"; then
400 base_compile="$lastarg"
402 base_compile="$base_compile $lastarg"
406 case "$user_target" in
410 # Get the name of the library object.
411 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
414 $echo "$modename: you must specify a target with \`-o'" 1>&2
419 # Recognize several different file suffixes.
420 # If the user specifies -o file.o, it is replaced with file.lo
435 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
438 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
440 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
445 if test -z "$base_compile"; then
446 $echo "$modename: you must specify a compilation command" 1>&2
451 # Delete any leftover library objects.
452 if test "$build_old_libs" = yes; then
453 removelist="$obj $libobj"
459 trap "$run $rm $removelist; exit 1" 1 2 15
461 # On Cygwin there's no "real" PIC flag so we must build both object types
463 cygwin* | mingw* | os2*)
467 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
468 # non-PIC code in shared libraries is not supported
472 # Calculate the filename of the output object if compiler does
473 # not support -o with -c
474 if test "$compiler_c_o" = no; then
475 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
476 lockfile="$output_obj.lock"
477 removelist="$removelist $output_obj $lockfile"
478 trap "$run $rm $removelist; exit 1" 1 2 15
484 # Lock this critical section if it is needed
485 # We use this script file to make the link, it avoids creating a new file
486 if test "$need_locks" = yes; then
487 until ln "$0" "$lockfile" 2>/dev/null; do
488 $show "Waiting for $lockfile to be removed"
491 elif test "$need_locks" = warn; then
492 if test -f "$lockfile"; then
494 *** ERROR, $lockfile exists and contains:
495 `cat $lockfile 2>/dev/null`
497 This indicates that another process is trying to use the same
498 temporary object file, and libtool could not work around it because
499 your compiler does not support \`-c' and \`-o' together. If you
500 repeat this compilation, it may succeed, by chance, but you had better
501 avoid parallel builds (make -j) in this platform, or get a better
507 echo $srcfile > "$lockfile"
510 if test -n "$fix_srcfile_path"; then
511 eval srcfile=\"$fix_srcfile_path\"
514 # Only build a PIC object if we are building libtool libraries.
515 if test "$build_libtool_libs" = yes; then
516 # Without this assignment, base_compile gets emptied.
517 fbsd_hideous_sh_bug=$base_compile
519 if test "$pic_mode" != no; then
520 # All platforms use -DPIC, to notify preprocessed assembler code.
521 command="$base_compile $srcfile $pic_flag -DPIC"
523 # Don't build PIC code
524 command="$base_compile $srcfile"
526 if test "$build_old_libs" = yes; then
528 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
529 if test "X$dir" = "X$libobj"; then
534 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
536 if test -d "$dir"; then
543 if test $status -ne 0 && test ! -d $dir; then
548 if test "$compiler_o_lo" = yes; then
550 command="$command -o $output_obj"
551 elif test "$compiler_c_o" = yes; then
553 command="$command -o $output_obj"
556 $run $rm "$output_obj"
558 if $run eval "$command"; then :
560 test -n "$output_obj" && $run $rm $removelist
564 if test "$need_locks" = warn &&
565 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
567 *** ERROR, $lockfile contains:
568 `cat $lockfile 2>/dev/null`
570 but it should contain:
573 This indicates that another process is trying to use the same
574 temporary object file, and libtool could not work around it because
575 your compiler does not support \`-c' and \`-o' together. If you
576 repeat this compilation, it may succeed, by chance, but you had better
577 avoid parallel builds (make -j) in this platform, or get a better
584 # Just move the object if needed, then go on to compile the next one
585 if test x"$output_obj" != x"$libobj"; then
586 $show "$mv $output_obj $libobj"
587 if $run $mv $output_obj $libobj; then :
595 # If we have no pic_flag, then copy the object into place and finish.
596 if (test -z "$pic_flag" || test "$pic_mode" != default) &&
597 test "$build_old_libs" = yes; then
598 # Rename the .lo from within objdir to obj
599 if test -f $obj; then
604 $show "$mv $libobj $obj"
605 if $run $mv $libobj $obj; then :
612 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
613 if test "X$xdir" = "X$obj"; then
618 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
619 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
620 # Now arrange that obj and lo_libobj become the same file
621 $show "(cd $xdir && $LN_S $baseobj $libobj)"
622 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
631 # Allow error messages only from the first compilation.
632 suppress_output=' >/dev/null 2>&1'
635 # Only build a position-dependent object if we build old libraries.
636 if test "$build_old_libs" = yes; then
637 if test "$pic_mode" != yes; then
638 # Don't build PIC code
639 command="$base_compile $srcfile"
641 # All platforms use -DPIC, to notify preprocessed assembler code.
642 command="$base_compile $srcfile $pic_flag -DPIC"
644 if test "$compiler_c_o" = yes; then
645 command="$command -o $obj"
649 # Suppress compiler output if we already did a PIC compilation.
650 command="$command$suppress_output"
651 $run $rm "$output_obj"
653 if $run eval "$command"; then :
659 if test "$need_locks" = warn &&
660 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
662 *** ERROR, $lockfile contains:
663 `cat $lockfile 2>/dev/null`
665 but it should contain:
668 This indicates that another process is trying to use the same
669 temporary object file, and libtool could not work around it because
670 your compiler does not support \`-c' and \`-o' together. If you
671 repeat this compilation, it may succeed, by chance, but you had better
672 avoid parallel builds (make -j) in this platform, or get a better
679 # Just move the object if needed
680 if test x"$output_obj" != x"$obj"; then
681 $show "$mv $output_obj $obj"
682 if $run $mv $output_obj $obj; then :
690 # Create an invalid libtool object if no PIC, so that we do not
691 # accidentally link it into a program.
692 if test "$build_libtool_libs" != yes; then
693 $show "echo timestamp > $libobj"
694 $run eval "echo timestamp > \$libobj" || exit $?
696 # Move the .lo from within objdir
697 $show "$mv $libobj $lo_libobj"
698 if $run $mv $libobj $lo_libobj; then :
707 # Unlock the critical section if it was locked
708 if test "$need_locks" != no; then
717 modename="$modename: link"
719 *-*-cygwin* | *-*-mingw* | *-*-os2*)
720 # It is impossible to link a dll without this setting, and
721 # we shouldn't force the makefile maintainer to figure out
722 # which system we are compiling for in order to pass an extra
723 # flag for every libtool invokation.
726 # FIXME: Unfortunately, there are problems with the above when trying
727 # to make a dll which has undefined symbols, in which case not
728 # even a static library is built. For now, we need to specify
729 # -no-undefined on the libtool link line when we can be certain
730 # that all symbols are satisfied, otherwise we get a static library.
737 libtool_args="$nonopt"
738 compile_command="$nonopt"
739 finalize_command="$nonopt"
752 lib_search_path=`pwd`
760 export_symbols_regex=
767 prefer_static_libs=no
779 # We need to know -static, to get the right output filenames.
783 -all-static | -static)
784 if test "X$arg" = "X-all-static"; then
785 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
786 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
788 if test -n "$link_static_flag"; then
789 dlopen_self=$dlopen_self_static
792 if test -z "$pic_flag" && test -n "$link_static_flag"; then
793 dlopen_self=$dlopen_self_static
796 build_libtool_libs=no
798 prefer_static_libs=yes
804 # See if our shared archives depend on static archives.
805 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
807 # Go through the arguments, transforming them on the way.
808 while test $# -gt 0; do
812 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
813 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
817 libtool_args="$libtool_args $qarg"
819 # If the previous option needs an argument, assign it.
820 if test -n "$prev"; then
823 compile_command="$compile_command @OUTPUT@"
824 finalize_command="$finalize_command @OUTPUT@"
830 if test "$preload" = no; then
831 # Add the symbol object into the linking commands.
832 compile_command="$compile_command @SYMFILE@"
833 finalize_command="$finalize_command @SYMFILE@"
837 *.la | *.lo) ;; # We handle these cases below.
839 if test "$dlself" = no; then
847 if test "$prev" = dlprefiles; then
849 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
859 if test "$prev" = dlfiles; then
860 dlfiles="$dlfiles $arg"
862 dlprefiles="$dlprefiles $arg"
870 export_symbols="$arg"
871 if test ! -f "$arg"; then
872 $echo "$modename: symbol file \`$arg' does not exist"
879 export_symbols_regex="$arg"
889 # We need an absolute path.
891 [\\/]* | [A-Za-z]:[\\/]*) ;;
893 $echo "$modename: only absolute run-paths are allowed" 1>&2
897 if test "$prev" = rpath; then
900 *) rpath="$rpath $arg" ;;
905 *) xrpath="$xrpath $arg" ;;
912 compiler_flags="$compiler_flags $qarg"
914 compile_command="$compile_command $qarg"
915 finalize_command="$finalize_command $qarg"
919 linker_flags="$linker_flags $qarg"
920 compiler_flags="$compiler_flags $wl$qarg"
922 compile_command="$compile_command $wl$qarg"
923 finalize_command="$finalize_command $wl$qarg"
927 eval "$prev=\"\$arg\""
938 if test -n "$link_static_flag"; then
939 compile_command="$compile_command $link_static_flag"
940 finalize_command="$finalize_command $link_static_flag"
946 # FIXME: remove this flag sometime in the future.
947 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
971 -export-symbols | -export-symbols-regex)
972 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
973 $echo "$modename: not more than one -exported-symbols argument allowed"
976 if test "X$arg" = "X-export-symbols"; then
985 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
986 # We need an absolute path.
988 [\\/]* | [A-Za-z]:[\\/]*) ;;
990 absdir=`cd "$dir" && pwd`
991 if test -z "$absdir"; then
992 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1001 deplibs="$deplibs -L$dir"
1002 lib_search_path="$lib_search_path $dir"
1006 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1007 case ":$dllsearchpath:" in
1009 *) dllsearchpath="$dllsearchpath:$dir";;
1017 if test "$arg" = "-lc"; then
1019 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1020 # These systems don't actually have c library (as such)
1024 elif test "$arg" = "-lm"; then
1026 *-*-cygwin* | *-*-beos*)
1027 # These systems don't actually have math library (as such)
1032 deplibs="$deplibs $arg"
1048 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1049 # The PATH hackery in wrapper scripts is required on Windows
1050 # in order for the loader to find any dlls it needs.
1051 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1052 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1056 # rhapsody is a little odd...
1057 deplibs="$deplibs -framework System"
1089 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1090 # We need an absolute path.
1092 [\\/]* | [A-Za-z]:[\\/]*) ;;
1094 $echo "$modename: only absolute run-paths are allowed" 1>&2
1100 *) xrpath="$xrpath $dir" ;;
1106 # If we have no pic_flag, then this is the same as -all-static.
1107 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1108 compile_command="$compile_command $link_static_flag"
1109 finalize_command="$finalize_command $link_static_flag"
1125 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1127 IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1128 for flag in $args; do
1131 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1136 compiler_flags="$compiler_flags $flag"
1139 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1143 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1145 IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1146 for flag in $args; do
1149 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1154 compiler_flags="$compiler_flags $wl$flag"
1155 linker_flags="$linker_flags $flag"
1158 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1171 # Some other compiler flag.
1173 # Unknown arguments in both finalize_command and compile_command need
1174 # to be aesthetically quoted because they are evaled later.
1175 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1177 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1184 # A standard object.
1190 if test "$prev" = dlfiles; then
1191 # This file was specified with -dlopen.
1192 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1193 dlfiles="$dlfiles $arg"
1197 # If libtool objects are unsupported, then we need to preload.
1202 if test "$prev" = dlprefiles; then
1203 # Preload the old-style object.
1204 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1207 libobjs="$libobjs $arg"
1213 deplibs="$deplibs $arg"
1214 old_deplibs="$old_deplibs $arg"
1219 # A libtool-controlled library.
1221 if test "$prev" = dlfiles; then
1222 # This library was specified with -dlopen.
1223 dlfiles="$dlfiles $arg"
1225 elif test "$prev" = dlprefiles; then
1226 # The library was specified with -dlpreopen.
1227 dlprefiles="$dlprefiles $arg"
1230 deplibs="$deplibs $arg"
1235 # Some other compiler argument.
1237 # Unknown arguments in both finalize_command and compile_command need
1238 # to be aesthetically quoted because they are evaled later.
1239 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1241 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1248 # Now actually substitute the argument into the commands.
1249 if test -n "$arg"; then
1250 compile_command="$compile_command $arg"
1251 finalize_command="$finalize_command $arg"
1255 if test -n "$prev"; then
1256 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1261 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1262 eval arg=\"$export_dynamic_flag_spec\"
1263 compile_command="$compile_command $arg"
1264 finalize_command="$finalize_command $arg"
1268 # calculate the name of the file, without its directory
1269 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1270 libobjs_save="$libobjs"
1272 if test -n "$shlibpath_var"; then
1273 # get the directories listed in $shlibpath_var
1274 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1278 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1279 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1281 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1282 if test "X$output_objdir" = "X$output"; then
1283 output_objdir="$objdir"
1285 output_objdir="$output_objdir/$objdir"
1287 # Create the object directory.
1288 if test ! -d $output_objdir; then
1289 $show "$mkdir $output_objdir"
1290 $run $mkdir $output_objdir
1292 if test $status -ne 0 && test ! -d $output_objdir; then
1297 # Determine the type of output
1300 $echo "$modename: you must specify an output file" 1>&2
1304 *.$libext) linkmode=oldlib ;;
1305 *.lo | *.$objext) linkmode=obj ;;
1306 *.la) linkmode=lib ;;
1307 *) linkmode=prog ;; # Anything else should be a program.
1312 # Find all interdependent deplibs by searching for libraries
1313 # that are linked more than once (e.g. -la -lb -la)
1314 for deplib in $deplibs; do
1316 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1318 libs="$libs $deplib"
1323 need_relink=no # whether we're linking any uninstalled libtool libraries
1324 uninst_deplibs= # uninstalled libtool libraries
1325 uninst_path= # paths that contain uninstalled libtool libraries
1329 for file in $dlfiles $dlprefiles; do
1333 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1345 passes="conv scan dlopen dlpreopen link"
1350 for pass in $passes; do
1351 if test "$linkmode,$pass" = "lib,link" ||
1352 test "$linkmode,$pass" = "prog,scan"; then
1356 if test $linkmode = prog; then
1358 dlopen) libs="$dlfiles" ;;
1359 dlpreopen) libs="$dlprefiles" ;;
1360 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1363 if test $pass = dlopen; then
1364 # Collect dlpreopened libraries
1365 save_deplibs="$deplibs"
1368 for deplib in $libs; do
1373 if test $linkmode != lib && test $linkmode != prog; then
1374 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1377 if test $pass = conv; then
1378 deplibs="$deplib $deplibs"
1381 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1382 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1383 # Search the libtool library
1384 lib="$searchdir/lib${name}.la"
1385 if test -f "$lib"; then
1390 if test "$found" != yes; then
1391 if test "$linkmode,$pass" = "prog,link"; then
1392 compile_deplibs="$deplib $compile_deplibs"
1393 finalize_deplibs="$deplib $finalize_deplibs"
1395 deplibs="$deplib $deplibs"
1396 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1404 deplibs="$deplib $deplibs"
1405 test $pass = conv && continue
1406 newdependency_libs="$deplib $newdependency_libs"
1407 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1410 if test $pass = conv; then
1411 deplibs="$deplib $deplibs"
1414 if test $pass = scan; then
1415 deplibs="$deplib $deplibs"
1416 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1418 compile_deplibs="$deplib $compile_deplibs"
1419 finalize_deplibs="$deplib $finalize_deplibs"
1423 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1429 if test $pass = link; then
1430 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1431 # Make sure the xrpath contains only unique directories.
1434 *) xrpath="$xrpath $dir" ;;
1437 deplibs="$deplib $deplibs"
1440 *.la) lib="$deplib" ;;
1442 if test $pass = conv; then
1443 deplibs="$deplib $deplibs"
1448 if test "$deplibs_check_method" != pass_all; then
1450 echo "*** Warning: This library needs some functionality provided by $deplib."
1451 echo "*** I have the capability to make that library automatically link in when"
1452 echo "*** you link to this library. But I can only do this if you have a"
1453 echo "*** shared version of the library, which you do not appear to have."
1456 echo "*** Warning: Linking the shared library $output against the"
1457 echo "*** static library $deplib is not portable!"
1458 deplibs="$deplib $deplibs"
1463 if test $pass != link; then
1464 deplibs="$deplib $deplibs"
1466 compile_deplibs="$deplib $compile_deplibs"
1467 finalize_deplibs="$deplib $finalize_deplibs"
1474 if test $pass = conv; then
1475 deplibs="$deplib $deplibs"
1476 elif test $linkmode = prog; then
1477 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1478 # If there is no dlopen support or we're linking statically,
1479 # we need to preload.
1480 newdlprefiles="$newdlprefiles $deplib"
1481 compile_deplibs="$deplib $compile_deplibs"
1482 finalize_deplibs="$deplib $finalize_deplibs"
1484 newdlfiles="$newdlfiles $deplib"
1494 if test $found = yes || test -f "$lib"; then :
1496 $echo "$modename: cannot find the library \`$lib'" 1>&2
1500 # Check to see that this really is a libtool archive.
1501 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1503 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1507 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1508 test "X$ladir" = "X$lib" && ladir="."
1516 # If the library was installed with an old release of libtool,
1517 # it will not redefine variable installed.
1522 */* | *\\*) . $lib ;;
1526 if test "$linkmode,$pass" = "lib,link" ||
1527 test "$linkmode,$pass" = "prog,scan" ||
1528 { test $linkmode != prog && test $linkmode != lib; }; then
1529 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1530 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1533 if test $pass = conv; then
1534 # only check for convenience libraries
1535 deplibs="$lib $deplibs"
1536 if test -z "$libdir"; then
1537 if test -z "$old_library"; then
1538 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1541 # It is a libtool convenience library, so add in its objects.
1542 convenience="$convenience $ladir/$objdir/$old_library"
1543 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1545 for deplib in $dependency_libs; do
1546 deplibs="$deplib $deplibs"
1547 case "$tmp_libs " in
1548 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1550 tmp_libs="$tmp_libs $deplib"
1552 elif test $linkmode != prog && test $linkmode != lib; then
1553 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1559 # Get the name of the library we link against.
1561 for l in $old_library $library_names; do
1564 if test -z "$linklib"; then
1565 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1569 # This library was specified with -dlopen.
1570 if test $pass = dlopen; then
1571 if test -z "$libdir"; then
1572 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1575 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1576 # If there is no dlname, no dlopen support or we're linking statically,
1577 # we need to preload.
1578 dlprefiles="$dlprefiles $lib"
1580 newdlfiles="$newdlfiles $lib"
1585 # We need an absolute path.
1587 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1589 abs_ladir=`cd "$ladir" && pwd`
1590 if test -z "$abs_ladir"; then
1591 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1592 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1597 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1599 # Find the relevant object directory and library name.
1600 if test "X$installed" = Xyes; then
1601 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1602 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1611 dir="$ladir/$objdir"
1612 absdir="$abs_ladir/$objdir"
1613 # Remove this search path later
1614 uninst_path="$uninst_path $abs_ladir"
1616 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1618 # This library was specified with -dlpreopen.
1619 if test $pass = dlpreopen; then
1620 if test -z "$libdir"; then
1621 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1624 # Prefer using a static library (so that no silly _DYNAMIC symbols
1625 # are required to link).
1626 if test -n "$old_library"; then
1627 newdlprefiles="$newdlprefiles $dir/$old_library"
1629 newdlprefiles="$newdlprefiles $dir/$linklib"
1633 if test -z "$libdir"; then
1634 # link the convenience library
1635 if test $linkmode = lib; then
1636 deplibs="$dir/$old_library $deplibs"
1637 elif test "$linkmode,$pass" = "prog,link"; then
1638 compile_deplibs="$dir/$old_library $compile_deplibs"
1639 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1641 deplibs="$lib $deplibs" # used for prog,scan pass
1646 if test $linkmode = prog && test $pass != link; then
1647 newlib_search_path="$newlib_search_path $ladir"
1648 deplibs="$lib $deplibs"
1651 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1652 test "$build_libtool_libs" = no; then
1657 for deplib in $dependency_libs; do
1659 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1661 # Need to link against all dependency_libs?
1662 if test $linkalldeplibs = yes; then
1663 deplibs="$deplib $deplibs"
1665 # Need to hardcode shared library paths
1666 # or/and link against static libraries
1667 newdependency_libs="$deplib $newdependency_libs"
1669 case "$tmp_libs " in
1670 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1672 tmp_libs="$tmp_libs $deplib"
1677 if test "$linkmode,$pass" = "prog,link"; then
1678 if test -n "$library_names" &&
1679 { test "$hardcode_into_libs" != all || test "$alldeplibs" != yes; } &&
1680 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1681 # We need to hardcode the library path
1682 if test -n "$shlibpath_var"; then
1683 # Make sure the rpath contains only unique directories.
1684 case "$temp_rpath " in
1687 *) temp_rpath="$temp_rpath $dir" ;;
1691 # Hardcode the library path.
1692 # Skip directories that are in the system default run-time
1694 case " $sys_lib_dlsearch_path " in
1697 case "$compile_rpath " in
1699 *) compile_rpath="$compile_rpath $absdir"
1704 case " $sys_lib_dlsearch_path " in
1707 case "$finalize_rpath " in
1709 *) finalize_rpath="$finalize_rpath $libdir"
1715 if test "$alldeplibs" = yes &&
1716 { test "$deplibs_check_method" = pass_all ||
1717 { test "$build_libtool_libs" = yes &&
1718 test -n "$library_names"; }; }; then
1719 # We only need to search for static libraries
1724 link_static=no # Whether the deplib will be linked statically
1725 if test -n "$library_names" &&
1726 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1727 if test "$installed" = no; then
1728 uninst_deplibs="$uninst_deplibs $lib"
1731 # This is a shared library
1732 if test $linkmode = lib && test "$hardcode_into_libs" = all; then
1733 # Hardcode the library path.
1734 # Skip directories that are in the system default run-time
1736 case " $sys_lib_dlsearch_path " in
1739 case "$compile_rpath " in
1741 *) compile_rpath="$compile_rpath $absdir"
1745 case " $sys_lib_dlsearch_path " in
1748 case "$finalize_rpath " in
1750 *) finalize_rpath="$finalize_rpath $libdir"
1756 if test -n "$old_archive_from_expsyms_cmds"; then
1757 # figure out the soname
1758 set dummy $library_names
1761 libname=`eval \\$echo \"$libname_spec\"`
1762 if test -n "$soname_spec"; then
1763 eval soname=\"$soname_spec\"
1768 # Make a new name for the extract_expsyms_cmds to use
1769 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1771 # If the library has no export list, then create one now
1772 if test -f "$output_objdir/$soname-def"; then :
1774 $show "extracting exported symbol list from \`$soname'"
1775 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
1776 eval cmds=\"$extract_expsyms_cmds\"
1777 for cmd in $cmds; do
1780 $run eval "$cmd" || exit $?
1786 if test -f "$output_objdir/$newlib"; then :; else
1787 $show "generating import library for \`$soname'"
1788 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
1789 eval cmds=\"$old_archive_from_expsyms_cmds\"
1790 for cmd in $cmds; do
1793 $run eval "$cmd" || exit $?
1797 # make sure the library variables are pointing to the new library
1802 if test $linkmode = prog || test "$mode" != relink; then
1807 case "$hardcode_action" in
1808 immediate | unsupported)
1809 if test "$hardcode_direct" = no; then
1811 elif test "$hardcode_minus_L" = no; then
1813 *-*-sunos*) add_shlibpath="$dir" ;;
1817 elif test "$hardcode_shlibpath_var" = no; then
1818 add_shlibpath="$dir"
1825 if test "$hardcode_direct" = yes; then
1827 elif test "$hardcode_minus_L" = yes; then
1830 elif test "$hardcode_shlibpath_var" = yes; then
1831 add_shlibpath="$dir"
1840 if test "$lib_linked" != yes; then
1841 $echo "$modename: configuration error: unsupported hardcode properties"
1845 if test -n "$add_shlibpath"; then
1846 case ":$compile_shlibpath:" in
1847 *":$add_shlibpath:"*) ;;
1848 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
1851 if test $linkmode = prog; then
1852 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
1853 test -n "$add" && compile_deplibs="$add $compile_deplibs"
1855 test -n "$add_dir" && deplibs="$add_dir $deplibs"
1856 test -n "$add" && deplibs="$add $deplibs"
1857 if test "$hardcode_direct" != yes && \
1858 test "$hardcode_minus_L" != yes && \
1859 test "$hardcode_shlibpath_var" = yes; then
1860 case ":$finalize_shlibpath:" in
1862 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1868 if test $linkmode = prog || test "$mode" = relink; then
1872 # Finalize command for both is simple: just hardcode it.
1873 if test "$hardcode_direct" = yes; then
1874 add="$libdir/$linklib"
1875 elif test "$hardcode_minus_L" = yes; then
1878 elif test "$hardcode_shlibpath_var" = yes; then
1879 case ":$finalize_shlibpath:" in
1881 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1885 # We cannot seem to hardcode it, guess we'll fake it.
1890 if test $linkmode = prog; then
1891 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
1892 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
1894 test -n "$add_dir" && deplibs="$add_dir $deplibs"
1895 test -n "$add" && deplibs="$add deplibs"
1898 elif test $linkmode = prog; then
1899 # Here we assume that one of hardcode_direct or hardcode_minus_L
1900 # is not unsupported. This is valid on all known static and
1902 if test "$hardcode_direct" != unsupported; then
1903 test -n "$old_library" && linklib="$old_library"
1904 compile_deplibs="$dir/$linklib $compile_deplibs"
1905 finalize_deplibs="$dir/$linklib $finalize_deplibs"
1907 compile_deplibs="-l$name -L$dir $compile_deplibs"
1908 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
1910 elif test "$build_libtool_libs" = yes; then
1911 # Not a shared library
1912 if test "$deplibs_check_method" != pass_all; then
1913 # We're trying link a shared library against a static one
1914 # but the system doesn't support it.
1915 # Just print a warning and add the library to dependency_libs so
1916 # that the program can be linked against the static library.
1918 echo "*** Warning: This library needs some functionality provided by $lib."
1919 echo "*** I have the capability to make that library automatically link in when"
1920 echo "*** you link to this library. But I can only do this if you have a"
1921 echo "*** shared version of the library, which you do not appear to have."
1923 convenience="$convenience $dir/$old_library"
1924 old_convenience="$old_convenience $dir/$old_library"
1925 deplibs="$dir/$old_library $deplibs"
1930 if test $linkmode = lib; then
1931 if test -n "$dependency_libs" &&
1932 { test "$hardcode_into_libs" = no || test $build_old_libs = yes ||
1933 test $link_static = yes; }; then
1934 # Extract -R from dependency_libs
1936 for libdir in $dependency_libs; do
1938 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1940 *" $temp_xrpath "*) ;;
1941 *) xrpath="$xrpath $temp_xrpath";;
1943 *) temp_deplibs="$temp_deplibs $libdir";;
1946 dependency_libs="$temp_deplibs"
1949 newlib_search_path="$newlib_search_path $absdir"
1950 # Link against this library
1951 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
1952 # ... and its dependency_libs
1954 for deplib in $dependency_libs; do
1955 newdependency_libs="$deplib $newdependency_libs"
1956 case "$tmp_libs " in
1957 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1959 tmp_libs="$tmp_libs $deplib"
1962 if test $link_all_deplibs != no; then
1963 # Add the search paths of all dependency libraries
1964 for deplib in $dependency_libs; do
1966 -L*) path="$deplib" ;;
1968 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
1969 test "X$dir" = "X$deplib" && dir="."
1970 # We need an absolute path.
1972 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1974 absdir=`cd "$dir" && pwd`
1975 if test -z "$absdir"; then
1976 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1981 if grep "^installed=no" $deplib > /dev/null; then
1982 path="-L$absdir/$objdir"
1984 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
1985 if test -z "$libdir"; then
1986 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
1989 if test "$absdir" != "$libdir"; then
1990 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
1997 case " $deplibs " in
1999 *) deplibs="$deplibs $path" ;;
2005 dependency_libs="$newdependency_libs"
2006 if test $pass = dlpreopen; then
2007 # Link the dlpreopened libraries before other libraries
2008 for deplib in $save_deplibs; do
2009 deplibs="$deplib $deplibs"
2012 if test $pass != dlopen; then
2013 if test $pass != conv; then
2014 # Make sure lib_search_path contains only unique directories.
2016 for dir in $newlib_search_path; do
2017 case "$lib_search_path " in
2019 *) lib_search_path="$lib_search_path $dir" ;;
2025 if test "$linkmode,$pass" != "prog,link"; then
2028 vars="compile_deplibs finalize_deplibs"
2030 for var in $vars dependency_libs; do
2031 # Make sure that $var contains only unique libraries
2032 # and add them in reverse order
2033 eval tmp_libs=\"\$$var\"
2035 for deplib in $tmp_libs; do
2037 -L*) new_libs="$deplib $new_libs" ;;
2039 case " $specialdeplibs " in
2040 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2042 case " $new_libs " in
2044 *) new_libs="$deplib $new_libs" ;;
2052 for deplib in $new_libs; do
2055 case " $tmp_libs " in
2057 *) tmp_libs="$tmp_libs $deplib" ;;
2060 *) tmp_libs="$tmp_libs $deplib" ;;
2063 eval $var=\"$tmp_libs\"
2067 if test $linkmode = prog; then
2068 dlfiles="$newdlfiles"
2069 dlprefiles="$newdlprefiles"
2074 if test -n "$deplibs"; then
2075 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2078 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2079 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2082 if test -n "$rpath"; then
2083 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2086 if test -n "$xrpath"; then
2087 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2090 if test -n "$vinfo"; then
2091 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2094 if test -n "$release"; then
2095 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2098 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2099 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2102 # Now set the variables for building old libraries.
2103 build_libtool_libs=no
2105 objs="$objs$old_deplibs"
2109 # Make sure we only generate libraries of the form `libNAME.la'.
2110 case "$outputname" in
2112 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2113 eval libname=\"$libname_spec\"
2116 if test "$module" = no; then
2117 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2121 if test "$need_lib_prefix" != no; then
2122 # Add the "lib" prefix for modules if required
2123 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2124 eval libname=\"$libname_spec\"
2126 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2131 if test -n "$objs"; then
2132 if test "$deplibs_check_method" != pass_all; then
2133 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2137 echo "*** Warning: Linking the shared library $output against the non-libtool"
2138 echo "*** objects $objs is not portable!"
2139 libobjs="$libobjs $objs"
2143 if test "$dlself" != no; then
2144 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2148 if test $# -gt 2; then
2149 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2154 if test -z "$rpath"; then
2155 if test "$build_libtool_libs" = yes; then
2156 # Building a libtool convenience library.
2158 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2159 build_libtool_libs=convenience
2163 if test -n "$vinfo"; then
2164 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2167 if test -n "$release"; then
2168 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2172 # Parse the version information argument.
2173 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
2174 set dummy $vinfo 0 0 0
2177 if test -n "$8"; then
2178 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2187 # Check that each of the things are valid numbers.
2189 0 | [1-9] | [1-9][0-9]*) ;;
2191 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2192 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2198 0 | [1-9] | [1-9][0-9]*) ;;
2200 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2201 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2207 0 | [1-9] | [1-9][0-9]*) ;;
2209 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2210 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2215 if test $age -gt $current; then
2216 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2217 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2221 # Calculate the version variables.
2225 case "$version_type" in
2229 major=`expr $current - $age + 1`
2230 versuffix="$major.$revision"
2231 verstring="sgi$major.$revision"
2233 # Add in all the interfaces that we are compatible with.
2235 while test $loop != 0; do
2236 iface=`expr $revision - $loop`
2237 loop=`expr $loop - 1`
2238 verstring="sgi$major.$iface:$verstring"
2243 major=.`expr $current - $age`
2244 versuffix="$major.$age.$revision"
2248 major=`expr $current - $age`
2249 versuffix=".$current.$age.$revision"
2250 verstring="$current.$age.$revision"
2252 # Add in all the interfaces that we are compatible with.
2254 while test $loop != 0; do
2255 iface=`expr $current - $loop`
2256 loop=`expr $loop - 1`
2257 verstring="$verstring:${iface}.0"
2260 # Make executables depend on our current version.
2261 verstring="$verstring:${current}.0"
2266 versuffix=".$current.$revision"
2271 versuffix=".$current.$revision";
2276 versuffix=".$current";
2280 # Like Linux, but with '-' rather than '.', since we only
2281 # want one extension on Windows 95.
2282 major=`expr $current - $age`
2283 versuffix="-$major-$age-$revision"
2287 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2288 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2293 # Clear the version info if we defaulted, and they specified a release.
2294 if test -z "$vinfo" && test -n "$release"; then
2297 if test "$need_version" = no; then
2304 # Remove version info from name if versioning should be avoided
2305 if test "$avoid_version" = yes && test "$need_version" = no; then
2311 # Check to see if the archive will have undefined symbols.
2312 if test "$allow_undefined" = yes; then
2313 if test "$allow_undefined_flag" = unsupported; then
2314 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2315 build_libtool_libs=no
2319 # Don't allow undefined symbols.
2320 allow_undefined_flag="$no_undefined_flag"
2324 if test "$mode" != relink; then
2325 # Remove our outputs.
2326 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2327 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2330 # Now set the variables for building old libraries.
2331 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2332 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2334 # Transform .lo files to .o files.
2335 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2338 # Eliminate all temporary directories.
2339 for path in $uninst_path; do
2340 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2341 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2342 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2345 if test -n "$xrpath"; then
2346 # If the user specified any rpath flags, then add them.
2348 for libdir in $xrpath; do
2349 temp_xrpath="$temp_xrpath -R$libdir"
2350 case "$finalize_rpath " in
2352 *) finalize_rpath="$finalize_rpath $libdir" ;;
2355 if test "$hardcode_into_libs" = no || test $build_old_libs = yes; then
2356 dependency_libs="$temp_xrpath $dependency_libs"
2360 # Make sure dlfiles contains only unique files that won't be dlpreopened
2361 old_dlfiles="$dlfiles"
2363 for lib in $old_dlfiles; do
2364 case " $dlprefiles $dlfiles " in
2366 *) dlfiles="$dlfiles $lib" ;;
2370 # Make sure dlprefiles contains only unique files
2371 old_dlprefiles="$dlprefiles"
2373 for lib in $old_dlprefiles; do
2374 case "$dlprefiles " in
2376 *) dlprefiles="$dlprefiles $lib" ;;
2380 if test "$build_libtool_libs" = yes; then
2381 if test -n "$rpath"; then
2383 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
2384 # these systems don't actually have a c library (as such)!
2387 # Add libc to deplibs on all other systems.
2388 deplibs="$deplibs -lc"
2393 # Transform deplibs into only deplibs that can be linked in shared.
2395 libname_save=$libname
2396 release_save=$release
2397 versuffix_save=$versuffix
2399 # I'm not sure if I'm treating the release correctly. I think
2400 # release should show up in the -l (ie -lgmp5) so we don't want to
2401 # add it in twice. Is that correct?
2407 case "$deplibs_check_method" in
2409 # Don't check for shared/static. Everything works.
2410 # This might be a little naive. We might want to check
2411 # whether the library exists or not. But this is on
2412 # osf3 & osf4 and I'm not really sure... Just
2413 # implementing what was already the behaviour.
2417 # This code stresses the "libraries are programs" paradigm to its
2418 # limits. Maybe even breaks it. We compile a program, linking it
2419 # against the deplibs as a proxy for the library. Then we can check
2420 # whether they linked in statically or dynamically with ldd.
2422 cat > conftest.c <<EOF
2423 int main() { return 0; }
2426 $CC -o conftest conftest.c $deplibs
2427 if test $? -eq 0 ; then
2428 ldd_output=`ldd conftest`
2429 for i in $deplibs; do
2430 name="`expr $i : '-l\(.*\)'`"
2431 # If $name is empty we are operating on a -L argument.
2432 if test "$name" != "" ; then
2433 libname=`eval \\$echo \"$libname_spec\"`
2434 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2435 set dummy $deplib_matches
2437 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2438 newdeplibs="$newdeplibs $i"
2442 echo "*** Warning: This library needs some functionality provided by $i."
2443 echo "*** I have the capability to make that library automatically link in when"
2444 echo "*** you link to this library. But I can only do this if you have a"
2445 echo "*** shared version of the library, which you do not appear to have."
2448 newdeplibs="$newdeplibs $i"
2452 # Error occured in the first compile. Let's try to salvage the situation:
2453 # Compile a seperate program for each library.
2454 for i in $deplibs; do
2455 name="`expr $i : '-l\(.*\)'`"
2456 # If $name is empty we are operating on a -L argument.
2457 if test "$name" != "" ; then
2459 $CC -o conftest conftest.c $i
2461 if test $? -eq 0 ; then
2462 ldd_output=`ldd conftest`
2463 libname=`eval \\$echo \"$libname_spec\"`
2464 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2465 set dummy $deplib_matches
2467 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2468 newdeplibs="$newdeplibs $i"
2472 echo "*** Warning: This library needs some functionality provided by $i."
2473 echo "*** I have the capability to make that library automatically link in when"
2474 echo "*** you link to this library. But I can only do this if you have a"
2475 echo "*** shared version of the library, which you do not appear to have."
2480 echo "*** Warning! Library $i is needed by this library but I was not able to"
2481 echo "*** make it link in! You will probably need to install it or some"
2482 echo "*** library that it depends on before this library will be fully"
2483 echo "*** functional. Installing it before continuing would be even better."
2486 newdeplibs="$newdeplibs $i"
2492 set dummy $deplibs_check_method
2493 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2494 for a_deplib in $deplibs; do
2495 name="`expr $a_deplib : '-l\(.*\)'`"
2496 # If $name is empty we are operating on a -L argument.
2497 if test "$name" != "" ; then
2498 libname=`eval \\$echo \"$libname_spec\"`
2499 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2500 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2501 for potent_lib in $potential_libs; do
2502 # Follow soft links.
2503 if ls -lLd "$potent_lib" 2>/dev/null \
2504 | grep " -> " >/dev/null; then
2507 # The statement above tries to avoid entering an
2508 # endless loop below, in case of cyclic links.
2509 # We might still enter an endless loop, since a link
2510 # loop can be closed while we follow links,
2512 potlib="$potent_lib"
2513 while test -h "$potlib" 2>/dev/null; do
2514 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2515 case "$potliblink" in
2516 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2517 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2520 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2522 | egrep "$file_magic_regex" > /dev/null; then
2523 newdeplibs="$newdeplibs $a_deplib"
2529 if test -n "$a_deplib" ; then
2532 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2533 echo "*** I have the capability to make that library automatically link in when"
2534 echo "*** you link to this library. But I can only do this if you have a"
2535 echo "*** shared version of the library, which you do not appear to have."
2538 # Add a -L argument.
2539 newdeplibs="$newdeplibs $a_deplib"
2541 done # Gone through all deplibs.
2545 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2546 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2547 grep . >/dev/null; then
2549 if test "X$deplibs_check_method" = "Xnone"; then
2550 echo "*** Warning: inter-library dependencies are not supported in this platform."
2552 echo "*** Warning: inter-library dependencies are not known to be supported."
2554 echo "*** All declared inter-library dependencies are being dropped."
2559 versuffix=$versuffix_save
2561 release=$release_save
2562 libname=$libname_save
2565 if test "$droppeddeps" = yes; then
2566 if test "$module" = yes; then
2568 echo "*** Warning: libtool could not satisfy all declared inter-library"
2569 echo "*** dependencies of module $libname. Therefore, libtool will create"
2570 echo "*** a static module, that should work as long as the dlopening"
2571 echo "*** application is linked with the -dlopen flag."
2572 if test -z "$global_symbol_pipe"; then
2574 echo "*** However, this would only work if libtool was able to extract symbol"
2575 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2576 echo "*** not find such a program. So, this module is probably useless."
2577 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2579 if test "$build_old_libs" = no; then
2580 oldlibs="$output_objdir/$libname.$libext"
2581 build_libtool_libs=module
2584 build_libtool_libs=no
2587 echo "*** The inter-library dependencies that have been dropped here will be"
2588 echo "*** automatically added whenever a program is linked with this library"
2589 echo "*** or is declared to -dlopen it."
2592 # Done checking deplibs!
2596 # All the library-specific variables (install_libdir is set above).
2601 # Test again, we may have decided not to build it any more
2602 if test "$build_libtool_libs" = yes; then
2603 if test "$hardcode_into_libs" != no; then
2604 # Hardcode the library paths
2607 rpath="$finalize_rpath"
2608 test "$mode" != relink && rpath="$compile_rpath$rpath"
2609 for libdir in $rpath; do
2610 if test -n "$hardcode_libdir_flag_spec"; then
2611 if test -n "$hardcode_libdir_separator"; then
2612 if test -z "$hardcode_libdirs"; then
2613 hardcode_libdirs="$libdir"
2615 # Just accumulate the unique libdirs.
2616 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2617 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2620 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2625 eval flag=\"$hardcode_libdir_flag_spec\"
2626 dep_rpath="$dep_rpath $flag"
2628 elif test -n "$runpath_var"; then
2629 case "$perm_rpath " in
2631 *) perm_rpath="$perm_rpath $libdir" ;;
2635 # Substitute the hardcoded libdirs into the rpath.
2636 if test -n "$hardcode_libdir_separator" &&
2637 test -n "$hardcode_libdirs"; then
2638 libdir="$hardcode_libdirs"
2639 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
2641 if test -n "$runpath_var" && test -n "$perm_rpath"; then
2642 # We should set the runpath_var.
2644 for dir in $perm_rpath; do
2647 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2649 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
2652 shlibpath="$finalize_shlibpath"
2653 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
2654 if test -n "$shlibpath"; then
2655 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2658 # Get the real and link names of the library.
2659 eval library_names=\"$library_names_spec\"
2660 set dummy $library_names
2664 if test -n "$soname_spec"; then
2665 eval soname=\"$soname_spec\"
2670 lib="$output_objdir/$realname"
2673 linknames="$linknames $link"
2676 # Ensure that we have .o objects for linkers which dislike .lo
2677 # (e.g. aix) in case we are running --disable-static
2678 for obj in $libobjs; do
2679 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2680 if test "X$xdir" = "X$obj"; then
2685 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2686 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2687 if test ! -f $xdir/$oldobj; then
2688 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2689 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2693 # Use standard objects if they are pic
2694 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2696 # Prepare the list of exported symbols
2697 if test -z "$export_symbols"; then
2698 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2699 $show "generating symbol list for \`$libname.la'"
2700 export_symbols="$output_objdir/$libname.exp"
2701 $run $rm $export_symbols
2702 eval cmds=\"$export_symbols_cmds\"
2703 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2704 for cmd in $cmds; do
2707 $run eval "$cmd" || exit $?
2710 if test -n "$export_symbols_regex"; then
2711 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2712 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2713 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2714 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2719 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2720 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2723 if test -n "$convenience"; then
2724 if test -n "$whole_archive_flag_spec"; then
2725 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2727 gentop="$output_objdir/${outputname}x"
2728 $show "${rm}r $gentop"
2729 $run ${rm}r "$gentop"
2730 $show "mkdir $gentop"
2731 $run mkdir "$gentop"
2733 if test $status -ne 0 && test ! -d "$gentop"; then
2736 generated="$generated $gentop"
2738 for xlib in $convenience; do
2739 # Extract the objects.
2741 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2742 *) xabs=`pwd`"/$xlib" ;;
2744 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2745 xdir="$gentop/$xlib"
2747 $show "${rm}r $xdir"
2752 if test $status -ne 0 && test ! -d "$xdir"; then
2755 $show "(cd $xdir && $AR x $xabs)"
2756 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2758 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2763 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2764 eval flag=\"$thread_safe_flag_spec\"
2765 linker_flags="$linker_flags $flag"
2768 # Make a backup of the uninstalled library when relinking
2769 if test "$mode" = relink && test "$hardcode_into_libs" = all; then
2770 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2773 # Do each of the archive commands.
2774 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2775 eval cmds=\"$archive_expsym_cmds\"
2777 eval cmds=\"$archive_cmds\"
2779 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2780 for cmd in $cmds; do
2783 $run eval "$cmd" || exit $?
2787 # Restore the uninstalled library and exit
2788 if test "$mode" = relink && test "$hardcode_into_libs" = all; then
2789 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
2793 # Create links to the real library.
2794 for linkname in $linknames; do
2795 if test "$realname" != "$linkname"; then
2796 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2797 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2801 # If -module or -export-dynamic was specified, set the dlname.
2802 if test "$module" = yes || test "$export_dynamic" = yes; then
2803 # On all known operating systems, these are identical.
2810 if test -n "$deplibs"; then
2811 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2814 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2815 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2818 if test -n "$rpath"; then
2819 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2822 if test -n "$xrpath"; then
2823 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2826 if test -n "$vinfo"; then
2827 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2830 if test -n "$release"; then
2831 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2836 if test -n "$objs$old_deplibs"; then
2837 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2841 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2849 # Delete the old objects.
2850 $run $rm $obj $libobj
2852 # Objects from convenience libraries. This assumes
2853 # single-version convenience libraries. Whenever we create
2854 # different ones for PIC/non-PIC, this we'll have to duplicate
2858 # reload_cmds runs $LD directly, so let us get rid of
2859 # -Wl from whole_archive_flag_spec
2862 if test -n "$convenience"; then
2863 if test -n "$whole_archive_flag_spec"; then
2864 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2866 gentop="$output_objdir/${obj}x"
2867 $show "${rm}r $gentop"
2868 $run ${rm}r "$gentop"
2869 $show "mkdir $gentop"
2870 $run mkdir "$gentop"
2872 if test $status -ne 0 && test ! -d "$gentop"; then
2875 generated="$generated $gentop"
2877 for xlib in $convenience; do
2878 # Extract the objects.
2880 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2881 *) xabs=`pwd`"/$xlib" ;;
2883 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2884 xdir="$gentop/$xlib"
2886 $show "${rm}r $xdir"
2891 if test $status -ne 0 && test ! -d "$xdir"; then
2894 $show "(cd $xdir && $AR x $xabs)"
2895 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2897 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2902 # Create the old-style object.
2903 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
2906 eval cmds=\"$reload_cmds\"
2907 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2908 for cmd in $cmds; do
2911 $run eval "$cmd" || exit $?
2915 # Exit if we aren't doing a library object file.
2916 if test -z "$libobj"; then
2917 if test -n "$gentop"; then
2918 $show "${rm}r $gentop"
2925 if test "$build_libtool_libs" != yes; then
2926 if test -n "$gentop"; then
2927 $show "${rm}r $gentop"
2931 # Create an invalid libtool object if no PIC, so that we don't
2932 # accidentally link it into a program.
2933 $show "echo timestamp > $libobj"
2934 $run eval "echo timestamp > $libobj" || exit $?
2938 if test -n "$pic_flag" || test "$pic_mode" != default; then
2939 # Only do commands if we really have different PIC objects.
2940 reload_objs="$libobjs $reload_conv_objs"
2942 eval cmds=\"$reload_cmds\"
2943 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2944 for cmd in $cmds; do
2947 $run eval "$cmd" || exit $?
2951 # Just create a symlink.
2954 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
2955 if test "X$xdir" = "X$libobj"; then
2960 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
2961 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2962 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
2963 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
2966 if test -n "$gentop"; then
2967 $show "${rm}r $gentop"
2975 if test -n "$vinfo"; then
2976 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2979 if test -n "$release"; then
2980 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2983 if test "$preload" = yes; then
2984 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
2985 test "$dlopen_self_static" = unknown; then
2986 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2990 compile_command="$compile_command $compile_deplibs"
2991 finalize_command="$finalize_command $finalize_deplibs"
2993 if test -n "$rpath$xrpath"; then
2994 # If the user specified any rpath flags, then add them.
2995 for libdir in $rpath $xrpath; do
2996 # This is the magic to use -rpath.
2997 case "$finalize_rpath " in
2999 *) finalize_rpath="$finalize_rpath $libdir" ;;
3004 # Now hardcode the library paths
3007 for libdir in $compile_rpath $finalize_rpath; do
3008 if test -n "$hardcode_libdir_flag_spec"; then
3009 if test -n "$hardcode_libdir_separator"; then
3010 if test -z "$hardcode_libdirs"; then
3011 hardcode_libdirs="$libdir"
3013 # Just accumulate the unique libdirs.
3014 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
3015 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3018 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3023 eval flag=\"$hardcode_libdir_flag_spec\"
3024 rpath="$rpath $flag"
3026 elif test -n "$runpath_var"; then
3027 case "$perm_rpath " in
3029 *) perm_rpath="$perm_rpath $libdir" ;;
3033 *-*-cygwin* | *-*-mingw* | *-*-os2*)
3034 case ":$dllsearchpath:" in
3036 *) dllsearchpath="$dllsearchpath:$libdir";;
3041 # Substitute the hardcoded libdirs into the rpath.
3042 if test -n "$hardcode_libdir_separator" &&
3043 test -n "$hardcode_libdirs"; then
3044 libdir="$hardcode_libdirs"
3045 eval rpath=\" $hardcode_libdir_flag_spec\"
3047 compile_rpath="$rpath"
3051 for libdir in $finalize_rpath; do
3052 if test -n "$hardcode_libdir_flag_spec"; then
3053 if test -n "$hardcode_libdir_separator"; then
3054 if test -z "$hardcode_libdirs"; then
3055 hardcode_libdirs="$libdir"
3057 # Just accumulate the unique libdirs.
3058 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
3059 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3062 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3067 eval flag=\"$hardcode_libdir_flag_spec\"
3068 rpath="$rpath $flag"
3070 elif test -n "$runpath_var"; then
3071 case "$finalize_perm_rpath " in
3073 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3077 # Substitute the hardcoded libdirs into the rpath.
3078 if test -n "$hardcode_libdir_separator" &&
3079 test -n "$hardcode_libdirs"; then
3080 libdir="$hardcode_libdirs"
3081 eval rpath=\" $hardcode_libdir_flag_spec\"
3083 finalize_rpath="$rpath"
3085 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3086 # Transform all the library objects into standard objects.
3087 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3088 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3092 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3093 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3094 dlsyms="${outputname}S.c"
3096 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3100 if test -n "$dlsyms"; then
3104 # Discover the nlist of each of the dlfiles.
3105 nlist="$output_objdir/${outputname}.nm"
3107 $show "$rm $nlist ${nlist}S ${nlist}T"
3108 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3110 # Parse the name list into a source file.
3111 $show "creating $output_objdir/$dlsyms"
3113 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3114 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3115 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3121 /* Prevent the only kind of declaration conflicts we can make. */
3122 #define lt_preloaded_symbols some_other_symbol
3124 /* External symbol declarations for the compiler. */\
3127 if test "$dlself" = yes; then
3128 $show "generating symbol list for \`$output'"
3130 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3132 # Add our own program objects to the symbol list.
3133 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3134 for arg in $progfiles; do
3135 $show "extracting global C symbols from \`$arg'"
3136 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3139 if test -n "$exclude_expsyms"; then
3140 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3141 $run eval '$mv "$nlist"T "$nlist"'
3144 if test -n "$export_symbols_regex"; then
3145 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3146 $run eval '$mv "$nlist"T "$nlist"'
3149 # Prepare the list of exported symbols
3150 if test -z "$export_symbols"; then
3151 export_symbols="$output_objdir/$output.exp"
3152 $run $rm $export_symbols
3153 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3155 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3156 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3157 $run eval 'mv "$nlist"T "$nlist"'
3161 for arg in $dlprefiles; do
3162 $show "extracting global C symbols from \`$arg'"
3163 name=`echo "$arg" | sed -e 's%^.*/%%'`
3164 $run eval 'echo ": $name " >> "$nlist"'
3165 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3168 if test -z "$run"; then
3169 # Make sure we have at least an empty file.
3170 test -f "$nlist" || : > "$nlist"
3172 if test -n "$exclude_expsyms"; then
3173 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3174 $mv "$nlist"T "$nlist"
3177 # Try sorting and uniquifying the output.
3178 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3181 grep -v "^: " < "$nlist" > "$nlist"S
3184 if test -f "$nlist"S; then
3185 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3187 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3190 $echo >> "$output_objdir/$dlsyms" "\
3192 #undef lt_preloaded_symbols
3194 #if defined (__STDC__) && __STDC__
3195 # define lt_ptr_t void *
3197 # define lt_ptr_t char *
3201 /* The mapping between symbol names and symbols. */
3206 lt_preloaded_symbols[] =
3210 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3211 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3212 < "$nlist" >> "$output_objdir/$dlsyms"
3214 $echo >> "$output_objdir/$dlsyms" "\
3218 /* This works around a problem in FreeBSD linker */
3219 #ifdef FREEBSD_WORKAROUND
3220 static const void *lt_preloaded_setup() {
3221 return lt_preloaded_symbols;
3231 pic_flag_for_symtable=
3233 # compiling the symbol table file with pic_flag works around
3234 # a FreeBSD bug that causes programs to crash when -lm is
3235 # linked before any other PIC object. But we must not use
3236 # pic_flag when linking with -static. The problem exists in
3237 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3238 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3239 case "$compile_command " in
3241 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3244 case "$compile_command " in
3246 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3250 # Now compile the dynamic symbol file.
3251 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3252 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3254 # Clean up the generated files.
3255 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3256 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3258 # Transform the symbol file into the correct name.
3259 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3260 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3263 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3268 # We keep going just in case the user didn't refer to
3269 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3270 # really was required.
3272 # Nullify the symbol file.
3273 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3274 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3277 if test $need_relink = no || test "$build_libtool_libs" != yes; then
3278 # Replace the output file specification.
3279 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3280 link_command="$compile_command$compile_rpath"
3282 # We have no uninstalled library dependencies, so finalize right now.
3283 $show "$link_command"
3284 $run eval "$link_command"
3287 # Delete the generated files.
3288 if test -n "$dlsyms"; then
3289 $show "$rm $output_objdir/${outputname}S.${objext}"
3290 $run $rm "$output_objdir/${outputname}S.${objext}"
3296 if test -n "$shlibpath_var"; then
3297 # We should set the shlibpath_var
3299 for dir in $temp_rpath; do
3301 [\\/]* | [A-Za-z]:[\\/]*)
3306 # Relative path: add a thisdir entry.
3307 rpath="$rpath\$thisdir/$dir:"
3314 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3315 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3317 if test -n "$finalize_shlibpath"; then
3318 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3323 if test -n "$runpath_var"; then
3324 if test -n "$perm_rpath"; then
3325 # We should set the runpath_var.
3327 for dir in $perm_rpath; do
3330 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3332 if test -n "$finalize_perm_rpath"; then
3333 # We should set the runpath_var.
3335 for dir in $finalize_perm_rpath; do
3338 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3342 if test "$no_install" = yes; then
3343 # We don't need to create a wrapper script.
3344 link_command="$compile_var$compile_command$compile_rpath"
3345 # Replace the output file specification.
3346 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3347 # Delete the old output file.
3349 # Link the executable and exit
3350 $show "$link_command"
3351 $run eval "$link_command" || exit $?
3355 if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
3356 # Fast installation is not supported
3357 link_command="$compile_var$compile_command$compile_rpath"
3358 relink_command="$finalize_var$finalize_command$finalize_rpath"
3360 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3361 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3363 if test "$fast_install" != no; then
3364 link_command="$finalize_var$compile_command$finalize_rpath"
3365 if test "$fast_install" = yes; then
3366 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3368 # fast_install is set to needless
3372 link_command="$compile_var$compile_command$compile_rpath"
3373 relink_command="$finalize_var$finalize_command$finalize_rpath"
3377 # Replace the output file specification.
3378 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3380 # Delete the old output files.
3381 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3383 $show "$link_command"
3384 $run eval "$link_command" || exit $?
3386 # Now create the wrapper script.
3387 $show "creating $output"
3389 # Quote the relink command for shipping.
3390 if test -n "$relink_command"; then
3391 # Preserve any variables that may affect compiler behavior
3392 for var in $variables_saved_for_relink; do
3393 eval var_value=\$$var
3394 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3395 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3397 relink_command="cd `pwd`; $relink_command"
3398 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3401 # Quote $echo for shipping.
3402 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3404 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3405 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3407 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3409 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3412 # Only actually do things if our run command is non-null.
3413 if test -z "$run"; then
3414 # win32 will think the script is a binary if it has
3415 # a .exe suffix, so we strip it off here.
3417 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3420 trap "$rm $output; exit 1" 1 2 15
3425 # $output - temporary wrapper script for $objdir/$outputname
3426 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3428 # The $output program cannot be directly executed until all the libtool
3429 # libraries that it depends on are installed.
3431 # This wrapper script should never be moved out of the build directory.
3432 # If it is, it will not operate correctly.
3434 # Sed substitution that helps us do robust quoting. It backslashifies
3435 # metacharacters that are still active within double-quoted strings.
3436 Xsed='sed -e 1s/^X//'
3437 sed_quote_subst='$sed_quote_subst'
3439 # The HP-UX ksh and POSIX shell print the target directory to stdout
3441 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3443 relink_command=\"$relink_command\"
3445 # This environment variable determines our operation mode.
3446 if test \"\$libtool_install_magic\" = \"$magic\"; then
3447 # install mode needs the following variable:
3448 uninst_deplibs='$uninst_deplibs'
3450 # When we are sourced in execute mode, \$file and \$echo are already set.
3451 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3454 # Make sure echo works.
3455 if test \"X\$1\" = X--no-reexec; then
3456 # Discard the --no-reexec flag, and continue.
3458 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3459 # Yippee, \$echo works!
3462 # Restart under the correct shell, and then maybe \$echo will work.
3463 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3469 # Find the directory that this script lives in.
3470 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3471 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3473 # Follow symbolic links until we get to the real thisdir.
3474 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3475 while test -n \"\$file\"; do
3476 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3478 # If there was a directory component, then change thisdir.
3479 if test \"x\$destdir\" != \"x\$file\"; then
3480 case \"\$destdir\" in
3481 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3482 *) thisdir=\"\$thisdir/\$destdir\" ;;
3486 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3487 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3490 # Try to get the absolute directory name.
3491 absdir=\`cd \"\$thisdir\" && pwd\`
3492 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3495 if test "$fast_install" = yes; then
3497 program=lt-'$outputname'
3498 progdir=\"\$thisdir/$objdir\"
3500 if test ! -f \"\$progdir/\$program\" || \\
3501 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3502 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3504 file=\"\$\$-\$program\"
3506 if test ! -d \"\$progdir\"; then
3507 $mkdir \"\$progdir\"
3509 $rm \"\$progdir/\$file\"
3514 # relink executable if necessary
3515 if test -n \"\$relink_command\"; then
3516 if (eval \$relink_command); then :
3518 $rm \"\$progdir/\$file\"
3523 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3524 { $rm \"\$progdir/\$program\";
3525 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3526 $rm \"\$progdir/\$file\"
3530 program='$outputname'
3531 progdir=\"\$thisdir/$objdir\"
3537 if test -f \"\$progdir/\$program\"; then"
3539 # Export our shlibpath_var if we have one.
3540 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3542 # Add our own library path to $shlibpath_var
3543 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3545 # Some systems cannot cope with colon-terminated $shlibpath_var
3546 # The second colon is a workaround for a bug in BeOS R4 sed
3547 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3549 export $shlibpath_var
3553 # fixup the dll searchpath if we need to.
3554 if test -n "$dllsearchpath"; then
3556 # Add the dll search path components to the executable PATH
3557 PATH=$dllsearchpath:\$PATH
3562 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3563 # Run the actual program with our arguments.
3566 # win32 systems need to use the prog path for dll
3570 exec \$progdir/\$program \${1+\"\$@\"}
3574 # Backslashes separate directories on plain windows
3575 *-*-mingw | *-*-os2*)
3577 exec \$progdir\\\\\$program \${1+\"\$@\"}
3583 # Export the path to the program.
3584 PATH=\"\$progdir:\$PATH\"
3587 exec \$program \${1+\"\$@\"}
3592 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3596 # The program doesn't exist.
3597 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3598 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3599 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3610 # See if we need to build an old-fashioned archive.
3611 for oldlib in $oldlibs; do
3613 if test "$build_libtool_libs" = convenience; then
3614 oldobjs="$libobjs_save"
3615 addlibs="$convenience"
3616 build_libtool_libs=no
3618 if test "$build_libtool_libs" = module; then
3619 oldobjs="$libobjs_save"
3620 build_libtool_libs=no
3622 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3624 addlibs="$old_convenience"
3627 if test -n "$addlibs"; then
3628 gentop="$output_objdir/${outputname}x"
3629 $show "${rm}r $gentop"
3630 $run ${rm}r "$gentop"
3631 $show "mkdir $gentop"
3632 $run mkdir "$gentop"
3634 if test $status -ne 0 && test ! -d "$gentop"; then
3637 generated="$generated $gentop"
3639 # Add in members from convenience archives.
3640 for xlib in $addlibs; do
3641 # Extract the objects.
3643 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3644 *) xabs=`pwd`"/$xlib" ;;
3646 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3647 xdir="$gentop/$xlib"
3649 $show "${rm}r $xdir"
3654 if test $status -ne 0 && test ! -d "$xdir"; then
3657 $show "(cd $xdir && $AR x $xabs)"
3658 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3660 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3664 # Do each command in the archive commands.
3665 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3666 eval cmds=\"$old_archive_from_new_cmds\"
3668 # Ensure that we have .o objects in place in case we decided
3669 # not to build a shared library, and have fallen back to building
3670 # static libs even though --disable-static was passed!
3671 for oldobj in $oldobjs; do
3672 if test ! -f $oldobj; then
3673 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3674 if test "X$xdir" = "X$oldobj"; then
3679 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3680 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3681 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3682 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3686 eval cmds=\"$old_archive_cmds\"
3688 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3689 for cmd in $cmds; do
3692 $run eval "$cmd" || exit $?
3697 if test -n "$generated"; then
3698 $show "${rm}r$generated"
3699 $run ${rm}r$generated
3702 # Now create the libtool archive.
3706 test "$build_old_libs" = yes && old_library="$libname.$libext"
3707 $show "creating $output"
3709 # Preserve any variables that may affect compiler behavior
3710 for var in $variables_saved_for_relink; do
3711 eval var_value=\$$var
3712 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3713 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3715 # Quote the link command for shipping.
3716 relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
3717 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3719 # Only create the output if not a dry run.
3720 if test -z "$run"; then
3721 for installed in no yes; do
3722 if test "$installed" = yes; then
3723 if test -z "$install_libdir"; then
3726 output="$output_objdir/$outputname"i
3727 # Replace all uninstalled libtool libraries with the installed ones
3729 for deplib in $dependency_libs; do
3732 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3733 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3734 if test -z "$libdir"; then
3735 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3738 newdependency_libs="$newdependency_libs $libdir/$name"
3740 *) newdependency_libs="$newdependency_libs $deplib" ;;
3743 dependency_libs="$newdependency_libs"
3745 for lib in $dlfiles; do
3746 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3747 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3748 if test -z "$libdir"; then
3749 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3752 newdlfiles="$newdlfiles $libdir/$name"
3754 dlfiles="$newdlfiles"
3756 for lib in $dlprefiles; do
3757 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3758 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3759 if test -z "$libdir"; then
3760 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3763 newdlprefiles="$newdlprefiles $libdir/$name"
3765 dlprefiles="$newdlprefiles"
3769 # $outputname - a libtool library file
3770 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3772 # Please DO NOT delete this file!
3773 # It is necessary for linking the library.
3775 # The name that we can dlopen(3).
3778 # Names of this library.
3779 library_names='$library_names'
3781 # The name of the static archive.
3782 old_library='$old_library'
3784 # Libraries that this one depends upon.
3785 dependency_libs='$dependency_libs'
3787 # Version information for $libname.
3792 # Is this an already installed library?
3793 installed=$installed
3795 # Files to dlopen/dlpreopen
3797 dlpreopen='$dlprefiles'
3799 # Directory that this library needs to be installed in:
3800 libdir='$install_libdir'"
3801 if test $hardcode_into_libs = all &&
3802 test "$installed" = no && test $need_relink = yes; then
3804 relink_command=\"$relink_command\""
3809 # Do a symbolic link so that the libtool archive can be found in
3810 # LD_LIBRARY_PATH before the program is installed.
3811 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3812 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
3818 # libtool install mode
3820 modename="$modename: install"
3822 # There may be an optional sh(1) argument at the beginning of
3823 # install_prog (especially on Windows NT).
3824 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3825 # Aesthetically quote it.
3826 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3828 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3832 install_prog="$arg "
3840 # The real first argument should be the name of the installation program.
3841 # Aesthetically quote it.
3842 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3844 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3848 install_prog="$install_prog$arg"
3850 # We need to accept at least all the BSD install flags.
3860 if test -n "$dest"; then
3861 files="$files $dest"
3879 # If the previous option needed an argument, then skip it.
3880 if test -n "$prev"; then
3889 # Aesthetically quote the argument.
3890 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3892 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3896 install_prog="$install_prog $arg"
3899 if test -z "$install_prog"; then
3900 $echo "$modename: you must specify an install program" 1>&2
3905 if test -n "$prev"; then
3906 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3911 if test -z "$files"; then
3912 if test -z "$dest"; then
3913 $echo "$modename: no file or destination specified" 1>&2
3915 $echo "$modename: you must specify a destination" 1>&2
3921 # Strip any trailing slash from the destination.
3922 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3924 # Check to see that the destination is a directory.
3925 test -d "$dest" && isdir=yes
3926 if test "$isdir" = yes; then
3930 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3931 test "X$destdir" = "X$dest" && destdir=.
3932 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3934 # Not a directory, so check to see that there is only one file specified.
3936 if test $# -gt 2; then
3937 $echo "$modename: \`$dest' is not a directory" 1>&2
3943 [\\/]* | [A-Za-z]:[\\/]*) ;;
3945 for file in $files; do
3949 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3958 # This variable tells wrapper scripts just to set variables rather
3959 # than running their programs.
3960 libtool_install_magic="$magic"
3965 for file in $files; do
3967 # Do each installation.
3970 # Do the static libraries later.
3971 staticlibs="$staticlibs $file"
3975 # Check to see that this really is a libtool archive.
3976 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3978 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3986 # If there is no directory component, then add one.
3988 */* | *\\*) . $file ;;
3992 # Add the libdir to current_libdirs if it is the destination.
3993 if test "X$destdir" = "X$libdir"; then
3994 case "$current_libdirs " in
3996 *) current_libdirs="$current_libdirs $libdir" ;;
3999 # Note the libdir as a future libdir.
4000 case "$future_libdirs " in
4002 *) future_libdirs="$future_libdirs $libdir" ;;
4006 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4007 test "X$dir" = "X$file/" && dir=
4010 if test "$hardcode_into_libs" = all && test -n "$relink_command"; then
4011 $echo "$modename: warning: relinking \`$file'" 1>&2
4012 $show "$relink_command"
4013 if $run eval "$relink_command"; then :
4015 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4020 # See the names of the shared library.
4021 set dummy $library_names
4022 if test -n "$2"; then
4028 test "$hardcode_into_libs" = all && test -n "$relink_command" && srcname="$realname"T
4030 # Install the shared library and build the symlinks.
4031 $show "$install_prog $dir/$srcname $destdir/$realname"
4032 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4033 if test -n "$stripme" && test -n "$striplib"; then
4034 $show "$striplib $destdir/$realname"
4035 $run eval "$striplib $destdir/$realname" || exit $?
4038 if test $# -gt 0; then
4039 # Delete the old symlinks, and create new ones.
4042 if test "$linkname" != "$realname"; then
4043 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4044 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4049 # Do each command in the postinstall commands.
4050 lib="$destdir/$realname"
4051 eval cmds=\"$postinstall_cmds\"
4052 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4053 for cmd in $cmds; do
4056 $run eval "$cmd" || exit $?
4061 # Install the pseudo-library for information purposes.
4062 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4063 instname="$dir/$name"i
4064 $show "$install_prog $instname $destdir/$name"
4065 $run eval "$install_prog $instname $destdir/$name" || exit $?
4067 # Maybe install the static library, too.
4068 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4072 # Install (i.e. copy) a libtool object.
4074 # Figure out destination file name, if it wasn't already specified.
4075 if test -n "$destname"; then
4076 destfile="$destdir/$destname"
4078 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4079 destfile="$destdir/$destfile"
4082 # Deduce the name of the destination old-style object file.
4085 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4088 staticdest="$destfile"
4092 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4098 # Install the libtool object if requested.
4099 if test -n "$destfile"; then
4100 $show "$install_prog $file $destfile"
4101 $run eval "$install_prog $file $destfile" || exit $?
4104 # Install the old object if enabled.
4105 if test "$build_old_libs" = yes; then
4106 # Deduce the name of the old-style object file.
4107 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4109 $show "$install_prog $staticobj $staticdest"
4110 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4116 # Figure out destination file name, if it wasn't already specified.
4117 if test -n "$destname"; then
4118 destfile="$destdir/$destname"
4120 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4121 destfile="$destdir/$destfile"
4124 # Do a test to see if this is really a libtool program.
4125 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4129 # If there is no directory component, then add one.
4131 */* | *\\*) . $file ;;
4135 # Check the variables that should have been set.
4136 if test -z "$uninst_deplibs"; then
4137 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4142 for lib in $uninst_deplibs; do
4143 # Check to see that each library is installed.
4145 if test -f "$lib"; then
4146 # If there is no directory component, then add one.
4148 */* | *\\*) . $lib ;;
4152 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4153 if test -n "$libdir" && test ! -f "$libfile"; then
4154 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4160 # If there is no directory component, then add one.
4162 */* | *\\*) . $file ;;
4167 if test "$fast_install" = no && test -n "$relink_command"; then
4168 if test "$finalize" = yes && test -z "$run"; then
4170 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4171 tmpdir="$tmpdir/libtool-$$"
4172 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4174 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4177 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4178 outputname="$tmpdir/$file"
4179 # Replace the output file specification.
4180 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4182 $show "$relink_command"
4183 if $run eval "$relink_command"; then :
4185 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4191 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4194 # Install the binary that we compiled earlier.
4195 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4199 $show "$install_prog$stripme $file $destfile"
4200 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4201 test -n "$outputname" && ${rm}r "$tmpdir"
4206 for file in $staticlibs; do
4207 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4209 # Set up the ranlib parameters.
4210 oldlib="$destdir/$name"
4212 $show "$install_prog $file $oldlib"
4213 $run eval "$install_prog \$file \$oldlib" || exit $?
4215 if test -n "$stripme" && test -n "$striplib"; then
4216 $show "$old_striplib $oldlib"
4217 $run eval "$old_striplib $oldlib" || exit $?
4220 # Do each command in the postinstall commands.
4221 eval cmds=\"$old_postinstall_cmds\"
4222 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4223 for cmd in $cmds; do
4226 $run eval "$cmd" || exit $?
4231 if test -n "$future_libdirs"; then
4232 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4235 if test -n "$current_libdirs"; then
4236 # Maybe just do a dry run.
4237 test -n "$run" && current_libdirs=" -n$current_libdirs"
4238 exec $SHELL $0 --finish$current_libdirs
4245 # libtool finish mode
4247 modename="$modename: finish"
4251 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4254 libdirs="$libdirs $dir"
4257 for libdir in $libdirs; do
4258 if test -n "$finish_cmds"; then
4259 # Do each command in the finish commands.
4260 eval cmds=\"$finish_cmds\"
4261 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4262 for cmd in $cmds; do
4265 $run eval "$cmd" || admincmds="$admincmds
4270 if test -n "$finish_eval"; then
4271 # Do the single finish_eval.
4272 eval cmds=\"$finish_eval\"
4273 $run eval "$cmds" || admincmds="$admincmds
4279 # Exit here if they wanted silent mode.
4280 test "$show" = : && exit 0
4282 echo "----------------------------------------------------------------------"
4283 echo "Libraries have been installed in:"
4284 for libdir in $libdirs; do
4288 echo "If you ever happen to want to link against installed libraries"
4289 echo "in a given directory, LIBDIR, you must either use libtool, and"
4290 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
4291 echo "flag during linking and do at least one of the following:"
4292 if test -n "$shlibpath_var"; then
4293 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4294 echo " during execution"
4296 if test -n "$runpath_var"; then
4297 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4298 echo " during linking"
4300 if test -n "$hardcode_libdir_flag_spec"; then
4302 eval flag=\"$hardcode_libdir_flag_spec\"
4304 echo " - use the \`$flag' linker flag"
4306 if test -n "$admincmds"; then
4307 echo " - have your system administrator run these commands:$admincmds"
4309 if test -f /etc/ld.so.conf; then
4310 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4313 echo "See any operating system documentation about shared libraries for"
4314 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4315 echo "----------------------------------------------------------------------"
4319 # libtool execute mode
4321 modename="$modename: execute"
4323 # The first argument is the command name.
4325 if test -z "$cmd"; then
4326 $echo "$modename: you must specify a COMMAND" 1>&2
4331 # Handle -dlopen flags immediately.
4332 for file in $execute_dlfiles; do
4333 if test ! -f "$file"; then
4334 $echo "$modename: \`$file' is not a file" 1>&2
4342 # Check to see that this really is a libtool archive.
4343 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4345 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4350 # Read the libtool library.
4354 # If there is no directory component, then add one.
4356 */* | *\\*) . $file ;;
4360 # Skip this library if it cannot be dlopened.
4361 if test -z "$dlname"; then
4362 # Warn if it was a shared library.
4363 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4367 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4368 test "X$dir" = "X$file" && dir=.
4370 if test -f "$dir/$objdir/$dlname"; then
4373 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4379 # Just add the directory containing the .lo file.
4380 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4381 test "X$dir" = "X$file" && dir=.
4385 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4390 # Get the absolute pathname.
4391 absdir=`cd "$dir" && pwd`
4392 test -n "$absdir" && dir="$absdir"
4394 # Now add the directory to shlibpath_var.
4395 if eval "test -z \"\$$shlibpath_var\""; then
4396 eval "$shlibpath_var=\"\$dir\""
4398 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4402 # This variable tells wrapper scripts just to set shlibpath_var
4403 # rather than running their programs.
4404 libtool_execute_magic="$magic"
4406 # Check if any of the arguments is a wrapper script.
4413 # Do a test to see if this is really a libtool program.
4414 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4415 # If there is no directory component, then add one.
4417 */* | *\\*) . $file ;;
4421 # Transform arg to wrapped name.
4422 file="$progdir/$program"
4426 # Quote arguments (to preserve shell metacharacters).
4427 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4428 args="$args \"$file\""
4431 if test -z "$run"; then
4432 if test -n "$shlibpath_var"; then
4433 # Export the shlibpath_var.
4434 eval "export $shlibpath_var"
4437 # Restore saved enviroment variables
4438 if test "${save_LC_ALL+set}" = set; then
4439 LC_ALL="$save_LC_ALL"; export LC_ALL
4441 if test "${save_LANG+set}" = set; then
4442 LANG="$save_LANG"; export LANG
4445 # Now actually exec the command.
4446 eval "exec \$cmd$args"
4448 $echo "$modename: cannot exec \$cmd$args"
4451 # Display what would be done.
4452 if test -n "$shlibpath_var"; then
4453 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4454 $echo "export $shlibpath_var"
4461 # libtool clean and uninstall mode
4463 modename="$modename: $mode"
4467 # This variable tells wrapper scripts just to set variables rather
4468 # than running their programs.
4469 libtool_install_magic="$magic"
4474 -*) rm="$rm $arg" ;;
4475 *) files="$files $arg" ;;
4479 if test -z "$rm"; then
4480 $echo "$modename: you must specify an RM program" 1>&2
4485 for file in $files; do
4486 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4487 if test "X$dir" = "X$file"; then
4491 objdir="$dir/$objdir"
4493 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4494 test $mode = uninstall && objdir="$dir"
4500 # Possibly a libtool archive, so verify it.
4501 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4504 # Delete the libtool libraries and symlinks.
4505 for n in $library_names; do
4506 rmfiles="$rmfiles $objdir/$n"
4508 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4509 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4511 if test $mode = uninstall; then
4512 if test -n "$library_names"; then
4513 # Do each command in the postuninstall commands.
4514 eval cmds=\"$postuninstall_cmds\"
4515 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4516 for cmd in $cmds; do
4524 if test -n "$old_library"; then
4525 # Do each command in the old_postuninstall commands.
4526 eval cmds=\"$old_postuninstall_cmds\"
4527 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4528 for cmd in $cmds; do
4535 # FIXME: should reinstall the best remaining shared library.
4541 if test "$build_old_libs" = yes; then
4542 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4543 rmfiles="$rmfiles $dir/$oldobj"
4548 # Do a test to see if this is a libtool program.
4549 if test $mode = clean &&
4550 (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4554 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4555 if test "$fast_install" = yes && test -n "$relink_command"; then
4556 rmfiles="$rmfiles $objdir/lt-$name"
4561 $show "$rm $rmfiles"
4568 $echo "$modename: you must specify a MODE" 1>&2
4569 $echo "$generic_help" 1>&2
4574 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4575 $echo "$generic_help" 1>&2
4577 fi # test -z "$show_help"
4579 # We need to display help for each of the modes.
4582 "Usage: $modename [OPTION]... [MODE-ARG]...
4584 Provide generalized library-building support services.
4586 --config show all configuration variables
4587 --debug enable verbose shell tracing
4588 -n, --dry-run display commands without modifying any files
4589 --features display basic configuration information and exit
4590 --finish same as \`--mode=finish'
4591 --help display this help message and exit
4592 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4593 --quiet same as \`--silent'
4594 --silent don't print informational messages
4595 --version print version information
4597 MODE must be one of the following:
4599 clean remove files from the build directory
4600 compile compile a source file into a libtool object
4601 execute automatically set library path, then run a program
4602 finish complete the installation of libtool libraries
4603 install install libraries or executables
4604 link create a library or an executable
4605 uninstall remove libraries from an installed directory
4607 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4608 a more detailed description of MODE."
4614 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4616 Remove files from the build directory.
4618 RM is the name of the program to use to delete files associated with each FILE
4619 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4622 If FILE is a libtool library, object or program, all the files associated
4623 with it are deleted. Otherwise, only FILE itself is deleted using RM."
4628 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4630 Compile a source file into a libtool library object.
4632 This mode accepts the following additional options:
4634 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4635 -static always build a \`.o' file suitable for static linking
4637 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4638 from the given SOURCEFILE.
4640 The output file name is determined by removing the directory component from
4641 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4642 library object suffix, \`.lo'."
4647 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4649 Automatically set library path, then run a program.
4651 This mode accepts the following additional options:
4653 -dlopen FILE add the directory containing FILE to the library path
4655 This mode sets the library path environment variable according to \`-dlopen'
4658 If any of the ARGS are libtool executable wrappers, then they are translated
4659 into their corresponding uninstalled binary, and any of their required library
4660 directories are added to the library path.
4662 Then, COMMAND is executed, with ARGS as arguments."
4667 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4669 Complete the installation of libtool libraries.
4671 Each LIBDIR is a directory that contains libtool libraries.
4673 The commands that this mode executes may require superuser privileges. Use
4674 the \`--dry-run' option if you just want to see what would be executed."
4679 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4681 Install executables or libraries.
4683 INSTALL-COMMAND is the installation command. The first component should be
4684 either the \`install' or \`cp' program.
4686 The rest of the components are interpreted as arguments to that command (only
4687 BSD-compatible install options are recognized)."
4692 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4694 Link object files or libraries together to form another library, or to
4695 create an executable program.
4697 LINK-COMMAND is a command using the C compiler that you would use to create
4698 a program from several object files.
4700 The following components of LINK-COMMAND are treated specially:
4702 -all-static do not do any dynamic linking at all
4703 -avoid-version do not add a version suffix if possible
4704 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4705 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4706 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4707 -export-symbols SYMFILE
4708 try to export only the symbols listed in SYMFILE
4709 -export-symbols-regex REGEX
4710 try to export only the symbols matching REGEX
4711 -LLIBDIR search LIBDIR for required installed libraries
4712 -lNAME OUTPUT-FILE requires the installed library libNAME
4713 -module build a library that can dlopened
4714 -no-fast-install disable the fast-install mode
4715 -no-install link a not-installable executable
4716 -no-undefined declare that a library does not refer to external symbols
4717 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4718 -release RELEASE specify package release information
4719 -rpath LIBDIR the created library will eventually be installed in LIBDIR
4720 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4721 -static do not do any dynamic linking of libtool libraries
4722 -version-info CURRENT[:REVISION[:AGE]]
4723 specify library version info [each variable defaults to 0]
4725 All other options (arguments beginning with \`-') are ignored.
4727 Every other argument is treated as a filename. Files ending in \`.la' are
4728 treated as uninstalled libtool libraries, other files are standard or library
4731 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4732 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4733 required, except when creating a convenience library.
4735 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4736 using \`ar' and \`ranlib', or on Windows using \`lib'.
4738 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4739 is created, otherwise an executable program is created."
4744 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4746 Remove libraries from an installation directory.
4748 RM is the name of the program to use to delete files associated with each FILE
4749 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4752 If FILE is a libtool library, all the files associated with it are deleted.
4753 Otherwise, only FILE itself is deleted using RM."
4757 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4764 $echo "Try \`$modename --help' for more information about other modes."