1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # This file is distributed with OpenLDAP Software, which contains a
28 # configuration script generated by Autoconf, and is distributable
29 # under the same distributions terms as OpenLDAP inself.
30 # See the OpenLDAP COPYRIGHT and LICENSE file for details.
32 # Check that we have a working $echo.
33 if test "X$1" = X--no-reexec; then
34 # Discard the --no-reexec flag, and continue.
36 elif test "X$1" = X--fallback-echo; then
37 # Avoid inline document here, it may be left over
39 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
40 # Yippee, $echo works!
43 # Restart under the correct shell, and then maybe $echo will work.
44 exec $SHELL "$0" --no-reexec ${1+"$@"}
47 if test "X$1" = X--fallback-echo; then
48 # used as fallback echo
56 # The name of this program.
57 progname=`$echo "$0" | sed 's%^.*/%%'`
64 TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)"
67 help="Try \`$progname --help' for more information."
68 magic="%%%MAGIC variable%%%"
73 # Sed substitution that helps us do robust quoting. It backslashifies
74 # metacharacters that are still active within double-quoted strings.
76 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
78 NL2SP='tr \015\012 \040\040'
81 # Only set LANG and LC_ALL to C if already set.
82 # These must not be set unconditionally because not all systems understand
83 # e.g. LANG=C (notably SCO).
84 # We save the old values to restore during execute mode.
85 if test "${LC_ALL+set}" = set; then
86 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
88 if test "${LANG+set}" = set; then
89 save_LANG="$LANG"; LANG=C; export LANG
92 # Make sure IFS has a sensible default
95 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
96 echo "$modename: not configured to build any kind of library" 1>&2
97 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
110 lo2o="s/\\.lo\$/.${objext}/"
111 o2lo="s/\\.${objext}\$/.lo/"
113 # Parse our command line options once, thoroughly.
120 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
124 # If the previous option needs an argument, assign it.
125 if test -n "$prev"; then
128 execute_dlfiles="$execute_dlfiles $arg"
140 # Have we seen a non-optional argument yet?
147 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
152 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
157 echo "$progname: enabling shell trace mode"
167 if test "$build_libtool_libs" = yes; then
168 echo "enable shared libraries"
170 echo "disable shared libraries"
172 if test "$build_old_libs" = yes; then
173 echo "enable static libraries"
175 echo "disable static libraries"
180 --finish) mode="finish" ;;
182 --mode) prevopt="--mode" prev=mode ;;
183 --mode=*) mode="$optarg" ;;
195 $echo "$modename: unrecognized option \`$arg'" 1>&2
207 if test -n "$prevopt"; then
208 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
213 # If this variable is set in any of the actions, the command in it
214 # will be execed at the end. This prevents here-documents from being
215 # left over by shells.
218 if test -z "$show_help"; then
220 # Infer the operation mode.
221 if test -z "$mode"; then
223 *cc | *++ | gcc* | *-gcc*)
235 *db | *dbx | *strace | *truss)
245 # If we have no mode, but dlfiles were specified, then do execute mode.
246 test -n "$execute_dlfiles" && mode=execute
248 # Just use the default operation mode.
249 if test -z "$mode"; then
250 if test -n "$nonopt"; then
251 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
253 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
260 # Only execute mode is allowed to have -dlopen flags.
261 if test -n "$execute_dlfiles" && test "$mode" != execute; then
262 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
267 # Change the help message to a mode-specific one.
269 help="Try \`$modename --help --mode=$mode' for more information."
271 # These modes are in order of execution frequency so that they run quickly.
273 # libtool compile mode
275 modename="$modename: compile"
276 # Get the compilation command and the source file.
289 # Aesthetically quote the previous argument.
291 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
294 # Double-quote args containing other shell metacharacters.
295 # Many Bourne shells cannot handle close brackets correctly
296 # in scan sets, so we specify it separately.
297 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
302 # Add the previous argument to base_compile.
303 if test -z "$base_compile"; then
304 base_compile="$lastarg"
306 base_compile="$base_compile $lastarg"
312 # Accept any command-line options.
315 if test "$user_target" != "no"; then
316 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
343 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
345 save_ifs="$IFS"; IFS=','
349 # Double-quote args containing other shell metacharacters.
350 # Many Bourne shells cannot handle close brackets correctly
351 # in scan sets, so we specify it separately.
353 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
357 lastarg="$lastarg $arg"
360 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
362 # Add the arguments to base_compile.
363 if test -z "$base_compile"; then
364 base_compile="$lastarg"
366 base_compile="$base_compile $lastarg"
374 # The next one is the -o target name
379 # We got the output file
386 # Accept the current argument as the source file.
390 # Aesthetically quote the previous argument.
392 # Backslashify any backslashes, double quotes, and dollar signs.
393 # These are the only characters that are still specially
394 # interpreted inside of double-quoted scrings.
395 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
397 # Double-quote args containing other shell metacharacters.
398 # Many Bourne shells cannot handle close brackets correctly
399 # in scan sets, so we specify it separately.
401 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
402 lastarg="\"$lastarg\""
406 # Add the previous argument to base_compile.
407 if test -z "$base_compile"; then
408 base_compile="$lastarg"
410 base_compile="$base_compile $lastarg"
418 # Get the name of the library object.
419 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
422 $echo "$modename: you must specify a target with \`-o'" 1>&2
427 # Recognize several different file suffixes.
428 # If the user specifies -o file.o, it is replaced with file.lo
443 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
446 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
448 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
453 if test -z "$base_compile"; then
454 $echo "$modename: you must specify a compilation command" 1>&2
459 # Delete any leftover library objects.
460 if test "$build_old_libs" = yes; then
461 removelist="$obj $libobj"
467 trap "$run $rm $removelist; exit 1" 1 2 15
469 # On Cygwin there's no "real" PIC flag so we must build both object types
471 cygwin* | mingw* | pw32* | os2*)
475 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
476 # non-PIC code in shared libraries is not supported
480 # Calculate the filename of the output object if compiler does
481 # not support -o with -c
482 if test "$compiler_c_o" = no; then
483 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
484 lockfile="$output_obj.lock"
485 removelist="$removelist $output_obj $lockfile"
486 trap "$run $rm $removelist; exit 1" 1 2 15
492 # Lock this critical section if it is needed
493 # We use this script file to make the link, it avoids creating a new file
494 if test "$need_locks" = yes; then
495 until $run ln "$0" "$lockfile" 2>/dev/null; do
496 $show "Waiting for $lockfile to be removed"
499 elif test "$need_locks" = warn; then
500 if test -f "$lockfile"; then
502 *** ERROR, $lockfile exists and contains:
503 `cat $lockfile 2>/dev/null`
505 This indicates that another process is trying to use the same
506 temporary object file, and libtool could not work around it because
507 your compiler does not support \`-c' and \`-o' together. If you
508 repeat this compilation, it may succeed, by chance, but you had better
509 avoid parallel builds (make -j) in this platform, or get a better
515 echo $srcfile > "$lockfile"
518 if test -n "$fix_srcfile_path"; then
519 eval srcfile=\"$fix_srcfile_path\"
522 # Only build a PIC object if we are building libtool libraries.
523 if test "$build_libtool_libs" = yes; then
524 # Without this assignment, base_compile gets emptied.
525 fbsd_hideous_sh_bug=$base_compile
527 if test "$pic_mode" != no; then
528 # All platforms use -DPIC, to notify preprocessed assembler code.
529 command="$base_compile $srcfile $pic_flag -DPIC"
531 # Don't build PIC code
532 command="$base_compile $srcfile"
534 if test "$build_old_libs" = yes; then
536 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
537 if test "X$dir" = "X$libobj"; then
542 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
544 if test -d "$dir"; then
551 if test $status -ne 0 && test ! -d $dir; then
556 if test "$compiler_o_lo" = yes; then
558 command="$command -o $output_obj"
559 elif test "$compiler_c_o" = yes; then
561 command="$command -o $output_obj"
564 $run $rm "$output_obj"
566 if $run eval "$command"; then :
568 test -n "$output_obj" && $run $rm $removelist
572 if test "$need_locks" = warn &&
573 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
575 *** ERROR, $lockfile contains:
576 `cat $lockfile 2>/dev/null`
578 but it should contain:
581 This indicates that another process is trying to use the same
582 temporary object file, and libtool could not work around it because
583 your compiler does not support \`-c' and \`-o' together. If you
584 repeat this compilation, it may succeed, by chance, but you had better
585 avoid parallel builds (make -j) in this platform, or get a better
592 # Just move the object if needed, then go on to compile the next one
593 if test x"$output_obj" != x"$libobj"; then
594 $show "$mv $output_obj $libobj"
595 if $run $mv $output_obj $libobj; then :
603 # If we have no pic_flag, then copy the object into place and finish.
604 if (test -z "$pic_flag" || test "$pic_mode" != default) &&
605 test "$build_old_libs" = yes; then
606 # Rename the .lo from within objdir to obj
607 if test -f $obj; then
612 $show "$mv $libobj $obj"
613 if $run $mv $libobj $obj; then :
620 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
621 if test "X$xdir" = "X$obj"; then
626 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
627 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
628 # Now arrange that obj and lo_libobj become the same file
629 $show "(cd $xdir && $LN_S $baseobj $libobj)"
630 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
631 # Unlock the critical section if it was locked
632 if test "$need_locks" != no; then
643 # Allow error messages only from the first compilation.
644 suppress_output=' >/dev/null 2>&1'
647 # Only build a position-dependent object if we build old libraries.
648 if test "$build_old_libs" = yes; then
649 if test "$pic_mode" != yes; then
650 # Don't build PIC code
651 command="$base_compile $srcfile"
653 # All platforms use -DPIC, to notify preprocessed assembler code.
654 command="$base_compile $srcfile $pic_flag -DPIC"
656 if test "$compiler_c_o" = yes; then
657 command="$command -o $obj"
661 # Suppress compiler output if we already did a PIC compilation.
662 command="$command$suppress_output"
663 $run $rm "$output_obj"
665 if $run eval "$command"; then :
671 if test "$need_locks" = warn &&
672 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
674 *** ERROR, $lockfile contains:
675 `cat $lockfile 2>/dev/null`
677 but it should contain:
680 This indicates that another process is trying to use the same
681 temporary object file, and libtool could not work around it because
682 your compiler does not support \`-c' and \`-o' together. If you
683 repeat this compilation, it may succeed, by chance, but you had better
684 avoid parallel builds (make -j) in this platform, or get a better
691 # Just move the object if needed
692 if test x"$output_obj" != x"$obj"; then
693 $show "$mv $output_obj $obj"
694 if $run $mv $output_obj $obj; then :
702 # Create an invalid libtool object if no PIC, so that we do not
703 # accidentally link it into a program.
704 if test "$build_libtool_libs" != yes; then
705 $show "echo timestamp > $libobj"
706 $run eval "echo timestamp > \$libobj" || exit $?
708 # Move the .lo from within objdir
709 $show "$mv $libobj $lo_libobj"
710 if $run $mv $libobj $lo_libobj; then :
719 # Unlock the critical section if it was locked
720 if test "$need_locks" != no; then
729 modename="$modename: link"
731 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
732 # It is impossible to link a dll without this setting, and
733 # we shouldn't force the makefile maintainer to figure out
734 # which system we are compiling for in order to pass an extra
735 # flag for every libtool invokation.
738 # FIXME: Unfortunately, there are problems with the above when trying
739 # to make a dll which has undefined symbols, in which case not
740 # even a static library is built. For now, we need to specify
741 # -no-undefined on the libtool link line when we can be certain
742 # that all symbols are satisfied, otherwise we get a static library.
749 libtool_args="$nonopt"
750 compile_command="$nonopt"
751 finalize_command="$nonopt"
764 lib_search_path=`pwd`
772 export_symbols_regex=
779 prefer_static_libs=no
791 # We need to know -static, to get the right output filenames.
795 -all-static | -static)
796 if test "X$arg" = "X-all-static"; then
797 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
798 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
800 if test -n "$link_static_flag"; then
801 dlopen_self=$dlopen_self_static
804 if test -z "$pic_flag" && test -n "$link_static_flag"; then
805 dlopen_self=$dlopen_self_static
808 build_libtool_libs=no
810 prefer_static_libs=yes
816 # See if our shared archives depend on static archives.
817 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
819 # Go through the arguments, transforming them on the way.
820 while test $# -gt 0; do
824 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
825 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
829 libtool_args="$libtool_args $qarg"
831 # If the previous option needs an argument, assign it.
832 if test -n "$prev"; then
835 compile_command="$compile_command @OUTPUT@"
836 finalize_command="$finalize_command @OUTPUT@"
842 if test "$preload" = no; then
843 # Add the symbol object into the linking commands.
844 compile_command="$compile_command @SYMFILE@"
845 finalize_command="$finalize_command @SYMFILE@"
849 *.la | *.lo) ;; # We handle these cases below.
851 if test "$dlself" = no; then
859 if test "$prev" = dlprefiles; then
861 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
871 if test "$prev" = dlfiles; then
872 dlfiles="$dlfiles $arg"
874 dlprefiles="$dlprefiles $arg"
882 export_symbols="$arg"
883 if test ! -f "$arg"; then
884 $echo "$modename: symbol file \`$arg' does not exist"
891 export_symbols_regex="$arg"
901 # We need an absolute path.
903 [\\/]* | [A-Za-z]:[\\/]*) ;;
905 $echo "$modename: only absolute run-paths are allowed" 1>&2
909 if test "$prev" = rpath; then
912 *) rpath="$rpath $arg" ;;
917 *) xrpath="$xrpath $arg" ;;
924 compiler_flags="$compiler_flags $qarg"
926 compile_command="$compile_command $qarg"
927 finalize_command="$finalize_command $qarg"
931 linker_flags="$linker_flags $qarg"
932 compiler_flags="$compiler_flags $wl$qarg"
934 compile_command="$compile_command $wl$qarg"
935 finalize_command="$finalize_command $wl$qarg"
939 eval "$prev=\"\$arg\""
950 if test -n "$link_static_flag"; then
951 compile_command="$compile_command $link_static_flag"
952 finalize_command="$finalize_command $link_static_flag"
958 # FIXME: remove this flag sometime in the future.
959 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
983 -export-symbols | -export-symbols-regex)
984 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
985 $echo "$modename: more than one -exported-symbols argument is not allowed"
988 if test "X$arg" = "X-export-symbols"; then
996 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
997 # so, if we see these flags be careful not to treat them like -L
999 case $with_gcc/$host in
1001 compile_command="$compile_command $arg"
1002 finalize_command="$finalize_command $arg"
1009 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1010 # We need an absolute path.
1012 [\\/]* | [A-Za-z]:[\\/]*) ;;
1014 absdir=`cd "$dir" && pwd`
1015 if test -z "$absdir"; then
1016 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1025 deplibs="$deplibs -L$dir"
1026 lib_search_path="$lib_search_path $dir"
1030 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1031 case :$dllsearchpath: in
1033 *) dllsearchpath="$dllsearchpath:$dir";;
1041 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1043 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1044 # These systems don't actually have a C or math library (as such)
1047 *-*-mingw* | *-*-os2*)
1048 # These systems don't actually have a C library (as such)
1049 test "X$arg" = "X-lc" && continue
1052 # Do not include libc due to us having libc/libc_r.
1053 test "X$arg" = "X-lc" && continue
1056 elif test "X$arg" = "X-lc_r"; then
1059 # Do not include libc_r directly, use -pthread flag.
1064 deplibs="$deplibs $arg"
1080 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1081 # The PATH hackery in wrapper scripts is required on Windows
1082 # in order for the loader to find any dlls it needs.
1083 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1084 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1087 *) no_install=yes ;;
1115 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1116 # We need an absolute path.
1118 [\\/]* | [A-Za-z]:[\\/]*) ;;
1120 $echo "$modename: only absolute run-paths are allowed" 1>&2
1126 *) xrpath="$xrpath $dir" ;;
1132 # The effects of -static are defined in a previous loop.
1133 # We used to do the same as -all-static on platforms that
1134 # didn't have a PIC flag, but the assumption that the effects
1135 # would be equivalent was wrong. It would break on at least
1136 # Digital Unix and AIX.
1151 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1153 save_ifs="$IFS"; IFS=','
1154 for flag in $args; do
1157 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1162 compiler_flags="$compiler_flags $flag"
1165 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1169 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1171 save_ifs="$IFS"; IFS=','
1172 for flag in $args; do
1175 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1180 compiler_flags="$compiler_flags $wl$flag"
1181 linker_flags="$linker_flags $flag"
1184 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1197 # Some other compiler flag.
1199 # Unknown arguments in both finalize_command and compile_command need
1200 # to be aesthetically quoted because they are evaled later.
1201 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1203 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1210 # A library or standard object.
1211 if test "$prev" = dlfiles; then
1212 # This file was specified with -dlopen.
1213 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1214 dlfiles="$dlfiles $arg"
1218 # If libtool objects are unsupported, then we need to preload.
1223 if test "$prev" = dlprefiles; then
1224 # Preload the old-style object.
1225 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1229 *.lo) libobjs="$libobjs $arg" ;;
1230 *) objs="$objs $arg" ;;
1237 deplibs="$deplibs $arg"
1238 old_deplibs="$old_deplibs $arg"
1243 # A libtool-controlled library.
1245 if test "$prev" = dlfiles; then
1246 # This library was specified with -dlopen.
1247 dlfiles="$dlfiles $arg"
1249 elif test "$prev" = dlprefiles; then
1250 # The library was specified with -dlpreopen.
1251 dlprefiles="$dlprefiles $arg"
1254 deplibs="$deplibs $arg"
1259 # Some other compiler argument.
1261 # Unknown arguments in both finalize_command and compile_command need
1262 # to be aesthetically quoted because they are evaled later.
1263 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1265 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1272 # Now actually substitute the argument into the commands.
1273 if test -n "$arg"; then
1274 compile_command="$compile_command $arg"
1275 finalize_command="$finalize_command $arg"
1277 done # argument parsing loop
1279 if test -n "$prev"; then
1280 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1285 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1286 eval arg=\"$export_dynamic_flag_spec\"
1287 compile_command="$compile_command $arg"
1288 finalize_command="$finalize_command $arg"
1291 # calculate the name of the file, without its directory
1292 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1293 libobjs_save="$libobjs"
1295 if test -n "$shlibpath_var"; then
1296 # get the directories listed in $shlibpath_var
1297 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1301 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1302 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1304 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1305 if test "X$output_objdir" = "X$output"; then
1306 output_objdir="$objdir"
1308 output_objdir="$output_objdir/$objdir"
1310 # Create the object directory.
1311 if test ! -d $output_objdir; then
1312 $show "$mkdir $output_objdir"
1313 $run $mkdir $output_objdir
1315 if test $status -ne 0 && test ! -d $output_objdir; then
1320 # Determine the type of output
1323 $echo "$modename: you must specify an output file" 1>&2
1327 *.$libext) linkmode=oldlib ;;
1328 *.lo | *.$objext) linkmode=obj ;;
1329 *.la) linkmode=lib ;;
1330 *) linkmode=prog ;; # Anything else should be a program.
1335 # Find all interdependent deplibs by searching for libraries
1336 # that are linked more than once (e.g. -la -lb -la)
1337 for deplib in $deplibs; do
1339 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1341 libs="$libs $deplib"
1346 need_relink=no # whether we're linking any uninstalled libtool libraries
1347 notinst_deplibs= # not-installed libtool libraries
1348 notinst_path= # paths that contain not-installed libtool libraries
1352 for file in $dlfiles $dlprefiles; do
1356 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1368 passes="conv scan dlopen dlpreopen link"
1373 for pass in $passes; do
1374 if test $linkmode = prog; then
1375 # Determine which files to process
1379 save_deplibs="$deplibs" # Collect dlpreopened libraries
1382 dlpreopen) libs="$dlprefiles" ;;
1383 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1386 for deplib in $libs; do
1391 if test $linkmode = oldlib && test $linkmode = obj; then
1392 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1395 if test $pass = conv; then
1396 deplibs="$deplib $deplibs"
1399 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1400 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1401 # Search the libtool library
1402 lib="$searchdir/lib${name}.la"
1403 if test -f "$lib"; then
1408 if test "$found" != yes; then
1409 # deplib doesn't seem to be a libtool library
1410 if test "$linkmode,$pass" = "prog,link"; then
1411 compile_deplibs="$deplib $compile_deplibs"
1412 finalize_deplibs="$deplib $finalize_deplibs"
1414 deplibs="$deplib $deplibs"
1415 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1423 deplibs="$deplib $deplibs"
1424 test $pass = conv && continue
1425 newdependency_libs="$deplib $newdependency_libs"
1426 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1429 if test $pass = conv; then
1430 deplibs="$deplib $deplibs"
1433 if test $pass = scan; then
1434 deplibs="$deplib $deplibs"
1435 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1437 compile_deplibs="$deplib $compile_deplibs"
1438 finalize_deplibs="$deplib $finalize_deplibs"
1442 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1448 if test $pass = link; then
1449 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1450 # Make sure the xrpath contains only unique directories.
1453 *) xrpath="$xrpath $dir" ;;
1456 deplibs="$deplib $deplibs"
1459 *.la) lib="$deplib" ;;
1461 if test $pass = conv; then
1462 deplibs="$deplib $deplibs"
1467 if test "$deplibs_check_method" != pass_all; then
1469 echo "*** Warning: This library needs some functionality provided by $deplib."
1470 echo "*** I have the capability to make that library automatically link in when"
1471 echo "*** you link to this library. But I can only do this if you have a"
1472 echo "*** shared version of the library, which you do not appear to have."
1475 echo "*** Warning: Linking the shared library $output against the"
1476 echo "*** static library $deplib is not portable!"
1477 deplibs="$deplib $deplibs"
1482 if test $pass != link; then
1483 deplibs="$deplib $deplibs"
1485 compile_deplibs="$deplib $compile_deplibs"
1486 finalize_deplibs="$deplib $finalize_deplibs"
1493 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1494 # If there is no dlopen support or we're linking statically,
1495 # we need to preload.
1496 newdlprefiles="$newdlprefiles $deplib"
1497 compile_deplibs="$deplib $compile_deplibs"
1498 finalize_deplibs="$deplib $finalize_deplibs"
1500 newdlfiles="$newdlfiles $deplib"
1509 if test $found = yes || test -f "$lib"; then :
1511 $echo "$modename: cannot find the library \`$lib'" 1>&2
1515 # Check to see that this really is a libtool archive.
1516 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1518 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1522 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1523 test "X$ladir" = "X$lib" && ladir="."
1531 # If the library was installed with an old release of libtool,
1532 # it will not redefine variable installed.
1537 */* | *\\*) . $lib ;;
1541 if test "$linkmode,$pass" = "lib,link" ||
1542 test "$linkmode,$pass" = "prog,scan" ||
1543 { test $linkmode = oldlib && test $linkmode = obj; }; then
1544 # Add dl[pre]opened files of deplib
1545 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1546 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1549 if test $pass = conv; then
1550 # Only check for convenience libraries
1551 deplibs="$lib $deplibs"
1552 if test -z "$libdir"; then
1553 if test -z "$old_library"; then
1554 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1557 # It is a libtool convenience library, so add in its objects.
1558 convenience="$convenience $ladir/$objdir/$old_library"
1559 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1561 for deplib in $dependency_libs; do
1562 deplibs="$deplib $deplibs"
1563 case "$tmp_libs " in
1564 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1566 tmp_libs="$tmp_libs $deplib"
1568 elif test $linkmode != prog && test $linkmode != lib; then
1569 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1575 # Get the name of the library we link against.
1577 for l in $old_library $library_names; do
1580 if test -z "$linklib"; then
1581 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1585 # This library was specified with -dlopen.
1586 if test $pass = dlopen; then
1587 if test -z "$libdir"; then
1588 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1591 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1592 # If there is no dlname, no dlopen support or we're linking
1593 # statically, we need to preload.
1594 dlprefiles="$dlprefiles $lib"
1596 newdlfiles="$newdlfiles $lib"
1601 # We need an absolute path.
1603 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1605 abs_ladir=`cd "$ladir" && pwd`
1606 if test -z "$abs_ladir"; then
1607 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1608 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1613 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1615 # Find the relevant object directory and library name.
1616 if test "X$installed" = Xyes; then
1617 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1618 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1627 dir="$ladir/$objdir"
1628 absdir="$abs_ladir/$objdir"
1629 # Remove this search path later
1630 notinst_path="$notinst_path $abs_ladir"
1631 fi # $installed = yes
1632 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1634 # This library was specified with -dlpreopen.
1635 if test $pass = dlpreopen; then
1636 if test -z "$libdir"; then
1637 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1640 # Prefer using a static library (so that no silly _DYNAMIC symbols
1641 # are required to link).
1642 if test -n "$old_library"; then
1643 newdlprefiles="$newdlprefiles $dir/$old_library"
1644 # Otherwise, use the dlname, so that lt_dlopen finds it.
1645 elif test -n "$dlname"; then
1646 newdlprefiles="$newdlprefiles $dir/$dlname"
1648 newdlprefiles="$newdlprefiles $dir/$linklib"
1650 fi # $pass = dlpreopen
1652 if test -z "$libdir"; then
1653 # Link the convenience library
1654 if test $linkmode = lib; then
1655 deplibs="$dir/$old_library $deplibs"
1656 elif test "$linkmode,$pass" = "prog,link"; then
1657 compile_deplibs="$dir/$old_library $compile_deplibs"
1658 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1660 deplibs="$lib $deplibs"
1665 if test $linkmode = prog && test $pass != link; then
1666 newlib_search_path="$newlib_search_path $ladir"
1667 deplibs="$lib $deplibs"
1670 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1671 test "$build_libtool_libs" = no; then
1676 for deplib in $dependency_libs; do
1678 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1680 # Need to link against all dependency_libs?
1681 if test $linkalldeplibs = yes; then
1682 deplibs="$deplib $deplibs"
1684 # Need to hardcode shared library paths
1685 # or/and link against static libraries
1686 newdependency_libs="$deplib $newdependency_libs"
1688 case "$tmp_libs " in
1689 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1691 tmp_libs="$tmp_libs $deplib"
1694 fi # $linkmode = prog...
1696 link_static=no # Whether the deplib will be linked statically
1697 if test -n "$library_names" &&
1698 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1699 # Link against this shared library
1701 if test "$linkmode,$pass" = "prog,link" ||
1702 { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1703 # Hardcode the library path.
1704 # Skip directories that are in the system default run-time
1706 case " $sys_lib_dlsearch_path " in
1709 case "$compile_rpath " in
1711 *) compile_rpath="$compile_rpath $absdir"
1715 case " $sys_lib_dlsearch_path " in
1718 case "$finalize_rpath " in
1720 *) finalize_rpath="$finalize_rpath $libdir"
1724 if test $linkmode = prog; then
1725 # We need to hardcode the library path
1726 if test -n "$shlibpath_var"; then
1727 # Make sure the rpath contains only unique directories.
1728 case "$temp_rpath " in
1731 *) temp_rpath="$temp_rpath $dir" ;;
1735 fi # $linkmode,$pass = prog,link...
1737 if test "$alldeplibs" = yes &&
1738 { test "$deplibs_check_method" = pass_all ||
1739 { test "$build_libtool_libs" = yes &&
1740 test -n "$library_names"; }; }; then
1741 # We only need to search for static libraries
1745 if test "$installed" = no; then
1746 notinst_deplibs="$notinst_deplibs $lib"
1750 if test -n "$old_archive_from_expsyms_cmds"; then
1751 # figure out the soname
1752 set dummy $library_names
1755 libname=`eval \\$echo \"$libname_spec\"`
1756 # use dlname if we got it. it's perfectly good, no?
1757 if test -n "$dlname"; then
1759 elif test -n "$soname_spec"; then
1763 major=`expr $current - $age`
1767 eval soname=\"$soname_spec\"
1772 # Make a new name for the extract_expsyms_cmds to use
1774 soname=`echo $soroot | sed -e 's/^.*\///'`
1775 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1777 # If the library has no export list, then create one now
1778 if test -f "$output_objdir/$soname-def"; then :
1780 $show "extracting exported symbol list from \`$soname'"
1781 save_ifs="$IFS"; IFS='~'
1782 eval cmds=\"$extract_expsyms_cmds\"
1783 for cmd in $cmds; do
1786 $run eval "$cmd" || exit $?
1792 if test -f "$output_objdir/$newlib"; then :; else
1793 $show "generating import library for \`$soname'"
1794 save_ifs="$IFS"; IFS='~'
1795 eval cmds=\"$old_archive_from_expsyms_cmds\"
1796 for cmd in $cmds; do
1799 $run eval "$cmd" || exit $?
1803 # make sure the library variables are pointing to the new library
1806 fi # test -n $old_archive_from_expsyms_cmds
1808 if test $linkmode = prog || test "$mode" != relink; then
1813 case $hardcode_action in
1814 immediate | unsupported)
1815 if test "$hardcode_direct" = no; then
1817 elif test "$hardcode_minus_L" = no; then
1819 *-*-sunos*) add_shlibpath="$dir" ;;
1823 elif test "$hardcode_shlibpath_var" = no; then
1824 add_shlibpath="$dir"
1831 if test "$hardcode_direct" = yes; then
1833 elif test "$hardcode_minus_L" = yes; then
1836 elif test "$hardcode_shlibpath_var" = yes; then
1837 add_shlibpath="$dir"
1846 if test "$lib_linked" != yes; then
1847 $echo "$modename: configuration error: unsupported hardcode properties"
1851 if test -n "$add_shlibpath"; then
1852 case :$compile_shlibpath: in
1853 *":$add_shlibpath:"*) ;;
1854 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
1857 if test $linkmode = prog; then
1858 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
1859 test -n "$add" && compile_deplibs="$add $compile_deplibs"
1861 test -n "$add_dir" && deplibs="$add_dir $deplibs"
1862 test -n "$add" && deplibs="$add $deplibs"
1863 if test "$hardcode_direct" != yes && \
1864 test "$hardcode_minus_L" != yes && \
1865 test "$hardcode_shlibpath_var" = yes; then
1866 case :$finalize_shlibpath: in
1868 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1874 if test $linkmode = prog || test "$mode" = relink; then
1878 # Finalize command for both is simple: just hardcode it.
1879 if test "$hardcode_direct" = yes; then
1880 add="$libdir/$linklib"
1881 elif test "$hardcode_minus_L" = yes; then
1884 elif test "$hardcode_shlibpath_var" = yes; then
1885 case :$finalize_shlibpath: in
1887 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1891 # We cannot seem to hardcode it, guess we'll fake it.
1896 if test $linkmode = prog; then
1897 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
1898 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
1900 test -n "$add_dir" && deplibs="$add_dir $deplibs"
1901 test -n "$add" && deplibs="$add $deplibs"
1904 elif test $linkmode = prog; then
1905 if test "$alldeplibs" = yes &&
1906 { test "$deplibs_check_method" = pass_all ||
1907 { test "$build_libtool_libs" = yes &&
1908 test -n "$library_names"; }; }; then
1909 # We only need to search for static libraries
1913 # Try to link the static library
1914 # Here we assume that one of hardcode_direct or hardcode_minus_L
1915 # is not unsupported. This is valid on all known static and
1917 if test "$hardcode_direct" != unsupported; then
1918 test -n "$old_library" && linklib="$old_library"
1919 compile_deplibs="$dir/$linklib $compile_deplibs"
1920 finalize_deplibs="$dir/$linklib $finalize_deplibs"
1922 compile_deplibs="-l$name -L$dir $compile_deplibs"
1923 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
1925 elif test "$build_libtool_libs" = yes; then
1926 # Not a shared library
1927 if test "$deplibs_check_method" != pass_all; then
1928 # We're trying link a shared library against a static one
1929 # but the system doesn't support it.
1931 # Just print a warning and add the library to dependency_libs so
1932 # that the program can be linked against the static library.
1934 echo "*** Warning: This library needs some functionality provided by $lib."
1935 echo "*** I have the capability to make that library automatically link in when"
1936 echo "*** you link to this library. But I can only do this if you have a"
1937 echo "*** shared version of the library, which you do not appear to have."
1938 if test "$module" = yes; then
1939 echo "*** Therefore, libtool will create a static module, that should work "
1940 echo "*** as long as the dlopening application is linked with the -dlopen flag."
1941 if test -z "$global_symbol_pipe"; then
1943 echo "*** However, this would only work if libtool was able to extract symbol"
1944 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1945 echo "*** not find such a program. So, this module is probably useless."
1946 echo "*** \`nm' from GNU binutils and a full rebuild may help."
1948 if test "$build_old_libs" = no; then
1949 build_libtool_libs=module
1952 build_libtool_libs=no
1956 convenience="$convenience $dir/$old_library"
1957 old_convenience="$old_convenience $dir/$old_library"
1958 deplibs="$dir/$old_library $deplibs"
1961 fi # link shared/static library?
1963 if test $linkmode = lib; then
1964 if test -n "$dependency_libs" &&
1965 { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
1966 test $link_static = yes; }; then
1967 # Extract -R from dependency_libs
1969 for libdir in $dependency_libs; do
1971 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1973 *" $temp_xrpath "*) ;;
1974 *) xrpath="$xrpath $temp_xrpath";;
1976 *) temp_deplibs="$temp_deplibs $libdir";;
1979 dependency_libs="$temp_deplibs"
1982 newlib_search_path="$newlib_search_path $absdir"
1983 # Link against this library
1984 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
1985 # ... and its dependency_libs
1987 for deplib in $dependency_libs; do
1988 newdependency_libs="$deplib $newdependency_libs"
1989 case "$tmp_libs " in
1990 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1992 tmp_libs="$tmp_libs $deplib"
1995 if test $link_all_deplibs != no; then
1996 # Add the search paths of all dependency libraries
1997 for deplib in $dependency_libs; do
1999 -L*) path="$deplib" ;;
2001 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2002 test "X$dir" = "X$deplib" && dir="."
2003 # We need an absolute path.
2005 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2007 absdir=`cd "$dir" && pwd`
2008 if test -z "$absdir"; then
2009 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2014 if grep "^installed=no" $deplib > /dev/null; then
2015 path="-L$absdir/$objdir"
2017 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2018 if test -z "$libdir"; then
2019 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2022 if test "$absdir" != "$libdir"; then
2023 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2030 case " $deplibs " in
2032 *) deplibs="$deplibs $path" ;;
2035 fi # link_all_deplibs != no
2037 done # for deplib in $libs
2038 if test $pass = dlpreopen; then
2039 # Link the dlpreopened libraries before other libraries
2040 for deplib in $save_deplibs; do
2041 deplibs="$deplib $deplibs"
2044 if test $pass != dlopen; then
2045 test $pass != scan && dependency_libs="$newdependency_libs"
2046 if test $pass != conv; then
2047 # Make sure lib_search_path contains only unique directories.
2049 for dir in $newlib_search_path; do
2050 case "$lib_search_path " in
2052 *) lib_search_path="$lib_search_path $dir" ;;
2058 if test "$linkmode,$pass" != "prog,link"; then
2061 vars="compile_deplibs finalize_deplibs"
2063 for var in $vars dependency_libs; do
2064 # Add libraries to $var in reverse order
2065 eval tmp_libs=\"\$$var\"
2067 for deplib in $tmp_libs; do
2069 -L*) new_libs="$deplib $new_libs" ;;
2071 case " $specialdeplibs " in
2072 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2074 case " $new_libs " in
2076 *) new_libs="$deplib $new_libs" ;;
2084 for deplib in $new_libs; do
2087 case " $tmp_libs " in
2089 *) tmp_libs="$tmp_libs $deplib" ;;
2092 *) tmp_libs="$tmp_libs $deplib" ;;
2095 eval $var=\"$tmp_libs\"
2098 if test "$pass" = "conv" &&
2099 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2100 libs="$deplibs" # reset libs
2104 if test $linkmode = prog; then
2105 dlfiles="$newdlfiles"
2106 dlprefiles="$newdlprefiles"
2111 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2112 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2115 if test -n "$rpath"; then
2116 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2119 if test -n "$xrpath"; then
2120 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2123 if test -n "$vinfo"; then
2124 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2127 if test -n "$release"; then
2128 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2131 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2132 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2135 # Now set the variables for building old libraries.
2136 build_libtool_libs=no
2138 objs="$objs$old_deplibs"
2142 # Make sure we only generate libraries of the form `libNAME.la'.
2145 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2146 eval libname=\"$libname_spec\"
2149 if test "$module" = no; then
2150 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2154 if test "$need_lib_prefix" != no; then
2155 # Add the "lib" prefix for modules if required
2156 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2157 eval libname=\"$libname_spec\"
2159 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2164 if test -n "$objs"; then
2165 if test "$deplibs_check_method" != pass_all; then
2166 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2170 echo "*** Warning: Linking the shared library $output against the non-libtool"
2171 echo "*** objects $objs is not portable!"
2172 libobjs="$libobjs $objs"
2176 if test "$dlself" != no; then
2177 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2181 if test $# -gt 2; then
2182 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2187 if test -z "$rpath"; then
2188 if test "$build_libtool_libs" = yes; then
2189 # Building a libtool convenience library.
2191 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2192 build_libtool_libs=convenience
2196 if test -n "$vinfo"; then
2197 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2200 if test -n "$release"; then
2201 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2205 # Parse the version information argument.
2206 save_ifs="$IFS"; IFS=':'
2207 set dummy $vinfo 0 0 0
2210 if test -n "$8"; then
2211 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2220 # Check that each of the things are valid numbers.
2222 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2224 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2225 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2231 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2233 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2234 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2240 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2242 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2243 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2248 if test $age -gt $current; then
2249 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2250 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2254 # Calculate the version variables.
2258 case $version_type in
2262 # Like Linux, but with the current version available in
2263 # verstring for coding it into the library header
2264 major=.`expr $current - $age`
2265 versuffix="$major.$age.$revision"
2266 # Darwin ld doesn't like 0 for these options...
2267 minor_current=`expr $current + 1`
2268 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2273 versuffix=".$current.$revision";
2278 versuffix=".$current";
2282 major=`expr $current - $age + 1`
2283 verstring="sgi$major.$revision"
2285 # Add in all the interfaces that we are compatible with.
2287 while test $loop != 0; do
2288 iface=`expr $revision - $loop`
2289 loop=`expr $loop - 1`
2290 verstring="sgi$major.$iface:$verstring"
2293 # Before this point, $major must not contain `.'.
2295 versuffix="$major.$revision"
2299 major=.`expr $current - $age`
2300 versuffix="$major.$age.$revision"
2304 major=`expr $current - $age`
2305 versuffix=".$current.$age.$revision"
2306 verstring="$current.$age.$revision"
2308 # Add in all the interfaces that we are compatible with.
2310 while test $loop != 0; do
2311 iface=`expr $current - $loop`
2312 loop=`expr $loop - 1`
2313 verstring="$verstring:${iface}.0"
2316 # Make executables depend on our current version.
2317 verstring="$verstring:${current}.0"
2322 versuffix=".$current.$revision"
2326 # Use '-' rather than '.', since we only want one
2327 # extension on DOS 8.3 filesystems.
2328 major=`expr $current - $age`
2333 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2334 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2339 # Clear the version info if we defaulted, and they specified a release.
2340 if test -z "$vinfo" && test -n "$release"; then
2343 case $version_type in
2345 # we can't check for "0.0" in archive_cmds due to quoting
2346 # problems, so we reset it completely
2353 if test "$need_version" = no; then
2360 # Remove version info from name if versioning should be avoided
2361 if test "$avoid_version" = yes && test "$need_version" = no; then
2367 # Check to see if the archive will have undefined symbols.
2368 if test "$allow_undefined" = yes; then
2369 if test "$allow_undefined_flag" = unsupported; then
2370 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2371 build_libtool_libs=no
2375 # Don't allow undefined symbols.
2376 allow_undefined_flag="$no_undefined_flag"
2380 if test "$mode" != relink; then
2381 # Remove our outputs.
2382 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2383 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2386 # Now set the variables for building old libraries.
2387 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2388 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2390 # Transform .lo files to .o files.
2391 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2394 # Eliminate all temporary directories.
2395 for path in $notinst_path; do
2396 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2397 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2398 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2401 if test -n "$xrpath"; then
2402 # If the user specified any rpath flags, then add them.
2404 for libdir in $xrpath; do
2405 temp_xrpath="$temp_xrpath -R$libdir"
2406 case "$finalize_rpath " in
2408 *) finalize_rpath="$finalize_rpath $libdir" ;;
2411 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2412 dependency_libs="$temp_xrpath $dependency_libs"
2416 # Make sure dlfiles contains only unique files that won't be dlpreopened
2417 old_dlfiles="$dlfiles"
2419 for lib in $old_dlfiles; do
2420 case " $dlprefiles $dlfiles " in
2422 *) dlfiles="$dlfiles $lib" ;;
2426 # Make sure dlprefiles contains only unique files
2427 old_dlprefiles="$dlprefiles"
2429 for lib in $old_dlprefiles; do
2430 case "$dlprefiles " in
2432 *) dlprefiles="$dlprefiles $lib" ;;
2436 if test "$build_libtool_libs" = yes; then
2437 if test -n "$rpath"; then
2439 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2440 # these systems don't actually have a c library (as such)!
2442 *-*-rhapsody* | *-*-darwin1.[012])
2443 # Rhapsody C library is in the System framework
2444 deplibs="$deplibs -framework System"
2447 # Don't link with libc until the a.out ld.so is fixed.
2450 # Do not include libc due to us having libc/libc_r.
2453 # Add libc to deplibs on all other systems if necessary.
2454 if test $build_libtool_need_lc = "yes"; then
2455 deplibs="$deplibs -lc"
2461 # Transform deplibs into only deplibs that can be linked in shared.
2463 libname_save=$libname
2464 release_save=$release
2465 versuffix_save=$versuffix
2467 # I'm not sure if I'm treating the release correctly. I think
2468 # release should show up in the -l (ie -lgmp5) so we don't want to
2469 # add it in twice. Is that correct?
2475 case $deplibs_check_method in
2477 # Don't check for shared/static. Everything works.
2478 # This might be a little naive. We might want to check
2479 # whether the library exists or not. But this is on
2480 # osf3 & osf4 and I'm not really sure... Just
2481 # implementing what was already the behaviour.
2485 # This code stresses the "libraries are programs" paradigm to its
2486 # limits. Maybe even breaks it. We compile a program, linking it
2487 # against the deplibs as a proxy for the library. Then we can check
2488 # whether they linked in statically or dynamically with ldd.
2490 cat > conftest.c <<EOF
2491 int main() { return 0; }
2494 $CC -o conftest conftest.c $deplibs
2495 if test $? -eq 0 ; then
2496 ldd_output=`ldd conftest`
2497 for i in $deplibs; do
2498 name="`expr $i : '-l\(.*\)'`"
2499 # If $name is empty we are operating on a -L argument.
2500 if test -n "$name" && test "$name" != "0"; then
2501 libname=`eval \\$echo \"$libname_spec\"`
2502 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2503 set dummy $deplib_matches
2505 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2506 newdeplibs="$newdeplibs $i"
2510 echo "*** Warning: This library needs some functionality provided by $i."
2511 echo "*** I have the capability to make that library automatically link in when"
2512 echo "*** you link to this library. But I can only do this if you have a"
2513 echo "*** shared version of the library, which you do not appear to have."
2516 newdeplibs="$newdeplibs $i"
2520 # Error occured in the first compile. Let's try to salvage the situation:
2521 # Compile a seperate program for each library.
2522 for i in $deplibs; do
2523 name="`expr $i : '-l\(.*\)'`"
2524 # If $name is empty we are operating on a -L argument.
2525 if test -n "$name" && test "$name" != "0"; then
2527 $CC -o conftest conftest.c $i
2529 if test $? -eq 0 ; then
2530 ldd_output=`ldd conftest`
2531 libname=`eval \\$echo \"$libname_spec\"`
2532 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2533 set dummy $deplib_matches
2535 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2536 newdeplibs="$newdeplibs $i"
2540 echo "*** Warning: This library needs some functionality provided by $i."
2541 echo "*** I have the capability to make that library automatically link in when"
2542 echo "*** you link to this library. But I can only do this if you have a"
2543 echo "*** shared version of the library, which you do not appear to have."
2548 echo "*** Warning! Library $i is needed by this library but I was not able to"
2549 echo "*** make it link in! You will probably need to install it or some"
2550 echo "*** library that it depends on before this library will be fully"
2551 echo "*** functional. Installing it before continuing would be even better."
2554 newdeplibs="$newdeplibs $i"
2560 set dummy $deplibs_check_method
2561 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2562 for a_deplib in $deplibs; do
2563 name="`expr $a_deplib : '-l\(.*\)'`"
2564 # If $name is empty we are operating on a -L argument.
2565 if test -n "$name" && test "$name" != "0"; then
2566 libname=`eval \\$echo \"$libname_spec\"`
2567 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2568 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2569 for potent_lib in $potential_libs; do
2570 # Follow soft links.
2571 if ls -lLd "$potent_lib" 2>/dev/null \
2572 | grep " -> " >/dev/null; then
2575 # The statement above tries to avoid entering an
2576 # endless loop below, in case of cyclic links.
2577 # We might still enter an endless loop, since a link
2578 # loop can be closed while we follow links,
2580 potlib="$potent_lib"
2581 while test -h "$potlib" 2>/dev/null; do
2582 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2584 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2585 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2588 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2590 | egrep "$file_magic_regex" > /dev/null; then
2591 newdeplibs="$newdeplibs $a_deplib"
2597 if test -n "$a_deplib" ; then
2600 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2601 echo "*** I have the capability to make that library automatically link in when"
2602 echo "*** you link to this library. But I can only do this if you have a"
2603 echo "*** shared version of the library, which you do not appear to have."
2606 # Add a -L argument.
2607 newdeplibs="$newdeplibs $a_deplib"
2609 done # Gone through all deplibs.
2612 set dummy $deplibs_check_method
2613 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2614 for a_deplib in $deplibs; do
2615 name="`expr $a_deplib : '-l\(.*\)'`"
2616 # If $name is empty we are operating on a -L argument.
2617 if test -n "$name" && test "$name" != "0"; then
2618 libname=`eval \\$echo \"$libname_spec\"`
2619 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2620 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2621 for potent_lib in $potential_libs; do
2622 if eval echo \"$potent_lib\" 2>/dev/null \
2624 | egrep "$match_pattern_regex" > /dev/null; then
2625 newdeplibs="$newdeplibs $a_deplib"
2631 if test -n "$a_deplib" ; then
2634 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2635 echo "*** I have the capability to make that library automatically link in when"
2636 echo "*** you link to this library. But I can only do this if you have a"
2637 echo "*** shared version of the library, which you do not appear to have."
2640 # Add a -L argument.
2641 newdeplibs="$newdeplibs $a_deplib"
2643 done # Gone through all deplibs.
2647 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2648 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2649 grep . >/dev/null; then
2651 if test "X$deplibs_check_method" = "Xnone"; then
2652 echo "*** Warning: inter-library dependencies are not supported in this platform."
2654 echo "*** Warning: inter-library dependencies are not known to be supported."
2656 echo "*** All declared inter-library dependencies are being dropped."
2661 versuffix=$versuffix_save
2663 release=$release_save
2664 libname=$libname_save
2668 *-*-rhapsody* | *-*-darwin1.[012])
2669 # On Rhapsody replace the C library is the System framework
2670 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2674 if test "$droppeddeps" = yes; then
2675 if test "$module" = yes; then
2677 echo "*** Warning: libtool could not satisfy all declared inter-library"
2678 echo "*** dependencies of module $libname. Therefore, libtool will create"
2679 echo "*** a static module, that should work as long as the dlopening"
2680 echo "*** application is linked with the -dlopen flag."
2681 if test -z "$global_symbol_pipe"; then
2683 echo "*** However, this would only work if libtool was able to extract symbol"
2684 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2685 echo "*** not find such a program. So, this module is probably useless."
2686 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2688 if test "$build_old_libs" = no; then
2689 oldlibs="$output_objdir/$libname.$libext"
2690 build_libtool_libs=module
2693 build_libtool_libs=no
2696 echo "*** The inter-library dependencies that have been dropped here will be"
2697 echo "*** automatically added whenever a program is linked with this library"
2698 echo "*** or is declared to -dlopen it."
2700 if test $allow_undefined = no; then
2702 echo "*** Since this library must not contain undefined symbols,"
2703 echo "*** because either the platform does not support them or"
2704 echo "*** it was explicitly requested with -no-undefined,"
2705 echo "*** libtool will only create a static version of it."
2706 if test "$build_old_libs" = no; then
2707 oldlibs="$output_objdir/$libname.$libext"
2708 build_libtool_libs=module
2711 build_libtool_libs=no
2716 # Done checking deplibs!
2720 # All the library-specific variables (install_libdir is set above).
2725 # Test again, we may have decided not to build it any more
2726 if test "$build_libtool_libs" = yes; then
2727 if test $hardcode_into_libs = yes; then
2728 # Hardcode the library paths
2731 rpath="$finalize_rpath"
2732 test "$mode" != relink && rpath="$compile_rpath$rpath"
2733 for libdir in $rpath; do
2734 if test -n "$hardcode_libdir_flag_spec"; then
2735 if test -n "$hardcode_libdir_separator"; then
2736 if test -z "$hardcode_libdirs"; then
2737 hardcode_libdirs="$libdir"
2739 # Just accumulate the unique libdirs.
2740 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
2741 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2744 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2749 eval flag=\"$hardcode_libdir_flag_spec\"
2750 dep_rpath="$dep_rpath $flag"
2752 elif test -n "$runpath_var"; then
2753 case "$perm_rpath " in
2755 *) perm_rpath="$perm_rpath $libdir" ;;
2759 # Substitute the hardcoded libdirs into the rpath.
2760 if test -n "$hardcode_libdir_separator" &&
2761 test -n "$hardcode_libdirs"; then
2762 libdir="$hardcode_libdirs"
2763 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
2765 if test -n "$runpath_var" && test -n "$perm_rpath"; then
2766 # We should set the runpath_var.
2768 for dir in $perm_rpath; do
2771 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2773 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
2776 shlibpath="$finalize_shlibpath"
2777 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
2778 if test -n "$shlibpath"; then
2779 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2782 # Get the real and link names of the library.
2783 eval library_names=\"$library_names_spec\"
2784 set dummy $library_names
2788 if test -n "$soname_spec"; then
2789 eval soname=\"$soname_spec\"
2793 test -z "$dlname" && dlname=$soname
2795 lib="$output_objdir/$realname"
2798 linknames="$linknames $link"
2801 # Ensure that we have .o objects for linkers which dislike .lo
2802 # (e.g. aix) in case we are running --disable-static
2803 for obj in $libobjs; do
2804 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2805 if test "X$xdir" = "X$obj"; then
2810 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2811 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2812 if test ! -f $xdir/$oldobj; then
2813 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2814 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2818 # Use standard objects if they are pic
2819 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2821 # Prepare the list of exported symbols
2822 if test -z "$export_symbols"; then
2823 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2824 $show "generating symbol list for \`$libname.la'"
2825 export_symbols="$output_objdir/$libname.exp"
2826 $run $rm $export_symbols
2827 eval cmds=\"$export_symbols_cmds\"
2828 save_ifs="$IFS"; IFS='~'
2829 for cmd in $cmds; do
2832 $run eval "$cmd" || exit $?
2835 if test -n "$export_symbols_regex"; then
2836 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2837 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2838 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2839 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2844 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2845 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2848 if test -n "$convenience"; then
2849 if test -n "$whole_archive_flag_spec"; then
2850 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2852 gentop="$output_objdir/${outputname}x"
2853 $show "${rm}r $gentop"
2854 $run ${rm}r "$gentop"
2855 $show "mkdir $gentop"
2856 $run mkdir "$gentop"
2858 if test $status -ne 0 && test ! -d "$gentop"; then
2861 generated="$generated $gentop"
2863 for xlib in $convenience; do
2864 # Extract the objects.
2866 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2867 *) xabs=`pwd`"/$xlib" ;;
2869 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2870 xdir="$gentop/$xlib"
2872 $show "${rm}r $xdir"
2877 if test $status -ne 0 && test ! -d "$xdir"; then
2880 $show "(cd $xdir && $AR x $xabs)"
2881 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2883 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2888 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2889 eval flag=\"$thread_safe_flag_spec\"
2890 linker_flags="$linker_flags $flag"
2893 # Make a backup of the uninstalled library when relinking
2894 if test "$mode" = relink; then
2895 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2898 # Do each of the archive commands.
2899 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2900 eval cmds=\"$archive_expsym_cmds\"
2902 eval cmds=\"$archive_cmds\"
2904 save_ifs="$IFS"; IFS='~'
2905 for cmd in $cmds; do
2908 $run eval "$cmd" || exit $?
2912 # Restore the uninstalled library and exit
2913 if test "$mode" = relink; then
2914 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
2918 # Create links to the real library.
2919 for linkname in $linknames; do
2920 if test "$realname" != "$linkname"; then
2921 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2922 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2926 # If -module or -export-dynamic was specified, set the dlname.
2927 if test "$module" = yes || test "$export_dynamic" = yes; then
2928 # On all known operating systems, these are identical.
2935 if test -n "$deplibs"; then
2936 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2939 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2940 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2943 if test -n "$rpath"; then
2944 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2947 if test -n "$xrpath"; then
2948 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2951 if test -n "$vinfo"; then
2952 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2955 if test -n "$release"; then
2956 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2961 if test -n "$objs$old_deplibs"; then
2962 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2966 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2974 # Delete the old objects.
2975 $run $rm $obj $libobj
2977 # Objects from convenience libraries. This assumes
2978 # single-version convenience libraries. Whenever we create
2979 # different ones for PIC/non-PIC, this we'll have to duplicate
2983 # reload_cmds runs $LD directly, so let us get rid of
2984 # -Wl from whole_archive_flag_spec
2987 if test -n "$convenience"; then
2988 if test -n "$whole_archive_flag_spec"; then
2989 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2991 gentop="$output_objdir/${obj}x"
2992 $show "${rm}r $gentop"
2993 $run ${rm}r "$gentop"
2994 $show "mkdir $gentop"
2995 $run mkdir "$gentop"
2997 if test $status -ne 0 && test ! -d "$gentop"; then
3000 generated="$generated $gentop"
3002 for xlib in $convenience; do
3003 # Extract the objects.
3005 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3006 *) xabs=`pwd`"/$xlib" ;;
3008 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3009 xdir="$gentop/$xlib"
3011 $show "${rm}r $xdir"
3016 if test $status -ne 0 && test ! -d "$xdir"; then
3019 $show "(cd $xdir && $AR x $xabs)"
3020 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3022 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3027 # Create the old-style object.
3028 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
3031 eval cmds=\"$reload_cmds\"
3032 save_ifs="$IFS"; IFS='~'
3033 for cmd in $cmds; do
3036 $run eval "$cmd" || exit $?
3040 # Exit if we aren't doing a library object file.
3041 if test -z "$libobj"; then
3042 if test -n "$gentop"; then
3043 $show "${rm}r $gentop"
3050 if test "$build_libtool_libs" != yes; then
3051 if test -n "$gentop"; then
3052 $show "${rm}r $gentop"
3056 # Create an invalid libtool object if no PIC, so that we don't
3057 # accidentally link it into a program.
3058 $show "echo timestamp > $libobj"
3059 $run eval "echo timestamp > $libobj" || exit $?
3063 if test -n "$pic_flag" || test "$pic_mode" != default; then
3064 # Only do commands if we really have different PIC objects.
3065 reload_objs="$libobjs $reload_conv_objs"
3067 eval cmds=\"$reload_cmds\"
3068 save_ifs="$IFS"; IFS='~'
3069 for cmd in $cmds; do
3072 $run eval "$cmd" || exit $?
3076 # Just create a symlink.
3079 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3080 if test "X$xdir" = "X$libobj"; then
3085 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3086 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3087 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3088 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3091 if test -n "$gentop"; then
3092 $show "${rm}r $gentop"
3101 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3103 if test -n "$vinfo"; then
3104 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3107 if test -n "$release"; then
3108 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3111 if test "$preload" = yes; then
3112 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3113 test "$dlopen_self_static" = unknown; then
3114 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3119 *-*-rhapsody* | *-*-darwin1.[012])
3120 # On Rhapsody replace the C library is the System framework
3121 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3122 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3126 compile_command="$compile_command $compile_deplibs"
3127 finalize_command="$finalize_command $finalize_deplibs"
3129 if test -n "$rpath$xrpath"; then
3130 # If the user specified any rpath flags, then add them.
3131 for libdir in $rpath $xrpath; do
3132 # This is the magic to use -rpath.
3133 case "$finalize_rpath " in
3135 *) finalize_rpath="$finalize_rpath $libdir" ;;
3140 # Now hardcode the library paths
3143 for libdir in $compile_rpath $finalize_rpath; do
3144 if test -n "$hardcode_libdir_flag_spec"; then
3145 if test -n "$hardcode_libdir_separator"; then
3146 if test -z "$hardcode_libdirs"; then
3147 hardcode_libdirs="$libdir"
3149 # Just accumulate the unique libdirs.
3150 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3151 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3154 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3159 eval flag=\"$hardcode_libdir_flag_spec\"
3160 rpath="$rpath $flag"
3162 elif test -n "$runpath_var"; then
3163 case "$perm_rpath " in
3165 *) perm_rpath="$perm_rpath $libdir" ;;
3169 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3170 case :$dllsearchpath: in
3172 *) dllsearchpath="$dllsearchpath:$libdir";;
3177 # Substitute the hardcoded libdirs into the rpath.
3178 if test -n "$hardcode_libdir_separator" &&
3179 test -n "$hardcode_libdirs"; then
3180 libdir="$hardcode_libdirs"
3181 eval rpath=\" $hardcode_libdir_flag_spec\"
3183 compile_rpath="$rpath"
3187 for libdir in $finalize_rpath; do
3188 if test -n "$hardcode_libdir_flag_spec"; then
3189 if test -n "$hardcode_libdir_separator"; then
3190 if test -z "$hardcode_libdirs"; then
3191 hardcode_libdirs="$libdir"
3193 # Just accumulate the unique libdirs.
3194 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3195 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3198 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3203 eval flag=\"$hardcode_libdir_flag_spec\"
3204 rpath="$rpath $flag"
3206 elif test -n "$runpath_var"; then
3207 case "$finalize_perm_rpath " in
3209 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3213 # Substitute the hardcoded libdirs into the rpath.
3214 if test -n "$hardcode_libdir_separator" &&
3215 test -n "$hardcode_libdirs"; then
3216 libdir="$hardcode_libdirs"
3217 eval rpath=\" $hardcode_libdir_flag_spec\"
3219 finalize_rpath="$rpath"
3221 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3222 # Transform all the library objects into standard objects.
3223 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3224 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3228 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3229 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3230 dlsyms="${outputname}S.c"
3232 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3236 if test -n "$dlsyms"; then
3240 # Discover the nlist of each of the dlfiles.
3241 nlist="$output_objdir/${outputname}.nm"
3243 $show "$rm $nlist ${nlist}S ${nlist}T"
3244 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3246 # Parse the name list into a source file.
3247 $show "creating $output_objdir/$dlsyms"
3249 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3250 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3251 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3257 /* Prevent the only kind of declaration conflicts we can make. */
3258 #define lt_preloaded_symbols some_other_symbol
3260 /* External symbol declarations for the compiler. */\
3263 if test "$dlself" = yes; then
3264 $show "generating symbol list for \`$output'"
3266 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3268 # Add our own program objects to the symbol list.
3269 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3270 for arg in $progfiles; do
3271 $show "extracting global C symbols from \`$arg'"
3272 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3275 if test -n "$exclude_expsyms"; then
3276 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3277 $run eval '$mv "$nlist"T "$nlist"'
3280 if test -n "$export_symbols_regex"; then
3281 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3282 $run eval '$mv "$nlist"T "$nlist"'
3285 # Prepare the list of exported symbols
3286 if test -z "$export_symbols"; then
3287 export_symbols="$output_objdir/$output.exp"
3288 $run $rm $export_symbols
3289 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3291 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3292 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3293 $run eval 'mv "$nlist"T "$nlist"'
3297 for arg in $dlprefiles; do
3298 $show "extracting global C symbols from \`$arg'"
3299 name=`echo "$arg" | sed -e 's%^.*/%%'`
3300 $run eval 'echo ": $name " >> "$nlist"'
3301 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3304 if test -z "$run"; then
3305 # Make sure we have at least an empty file.
3306 test -f "$nlist" || : > "$nlist"
3308 if test -n "$exclude_expsyms"; then
3309 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3310 $mv "$nlist"T "$nlist"
3313 # Try sorting and uniquifying the output.
3314 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3317 grep -v "^: " < "$nlist" > "$nlist"S
3320 if test -f "$nlist"S; then
3321 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3323 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3326 $echo >> "$output_objdir/$dlsyms" "\
3328 #undef lt_preloaded_symbols
3330 #if defined (__STDC__) && __STDC__
3331 # define lt_ptr void *
3333 # define lt_ptr char *
3337 /* The mapping between symbol names and symbols. */
3342 lt_preloaded_symbols[] =
3346 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3348 $echo >> "$output_objdir/$dlsyms" "\
3352 /* This works around a problem in FreeBSD linker */
3353 #ifdef FREEBSD_WORKAROUND
3354 static const void *lt_preloaded_setup() {
3355 return lt_preloaded_symbols;
3365 pic_flag_for_symtable=
3367 # compiling the symbol table file with pic_flag works around
3368 # a FreeBSD bug that causes programs to crash when -lm is
3369 # linked before any other PIC object. But we must not use
3370 # pic_flag when linking with -static. The problem exists in
3371 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3372 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3373 case "$compile_command " in
3375 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3378 case "$compile_command " in
3380 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3384 # Now compile the dynamic symbol file.
3385 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3386 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3388 # Clean up the generated files.
3389 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3390 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3392 # Transform the symbol file into the correct name.
3393 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3394 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3397 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3402 # We keep going just in case the user didn't refer to
3403 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3404 # really was required.
3406 # Nullify the symbol file.
3407 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3408 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3411 if test $need_relink = no || test "$build_libtool_libs" != yes; then
3412 # Replace the output file specification.
3413 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3414 link_command="$compile_command$compile_rpath"
3416 # We have no uninstalled library dependencies, so finalize right now.
3417 $show "$link_command"
3418 $run eval "$link_command"
3421 # Delete the generated files.
3422 if test -n "$dlsyms"; then
3423 $show "$rm $output_objdir/${outputname}S.${objext}"
3424 $run $rm "$output_objdir/${outputname}S.${objext}"
3430 if test -n "$shlibpath_var"; then
3431 # We should set the shlibpath_var
3433 for dir in $temp_rpath; do
3435 [\\/]* | [A-Za-z]:[\\/]*)
3440 # Relative path: add a thisdir entry.
3441 rpath="$rpath\$thisdir/$dir:"
3448 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3449 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3451 if test -n "$finalize_shlibpath"; then
3452 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3457 if test -n "$runpath_var"; then
3458 if test -n "$perm_rpath"; then
3459 # We should set the runpath_var.
3461 for dir in $perm_rpath; do
3464 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3466 if test -n "$finalize_perm_rpath"; then
3467 # We should set the runpath_var.
3469 for dir in $finalize_perm_rpath; do
3472 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3476 if test "$no_install" = yes; then
3477 # We don't need to create a wrapper script.
3478 link_command="$compile_var$compile_command$compile_rpath"
3479 # Replace the output file specification.
3480 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3481 # Delete the old output file.
3483 # Link the executable and exit
3484 $show "$link_command"
3485 $run eval "$link_command" || exit $?
3489 if test "$hardcode_action" = relink; then
3490 # Fast installation is not supported
3491 link_command="$compile_var$compile_command$compile_rpath"
3492 relink_command="$finalize_var$finalize_command$finalize_rpath"
3494 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3495 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3497 if test "$fast_install" != no; then
3498 link_command="$finalize_var$compile_command$finalize_rpath"
3499 if test "$fast_install" = yes; then
3500 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3502 # fast_install is set to needless
3506 link_command="$compile_var$compile_command$compile_rpath"
3507 relink_command="$finalize_var$finalize_command$finalize_rpath"
3511 # Replace the output file specification.
3512 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3514 # Delete the old output files.
3515 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3517 $show "$link_command"
3518 $run eval "$link_command" || exit $?
3520 # Now create the wrapper script.
3521 $show "creating $output"
3523 # Quote the relink command for shipping.
3524 if test -n "$relink_command"; then
3525 # Preserve any variables that may affect compiler behavior
3526 for var in $variables_saved_for_relink; do
3527 if eval test -z \"\${$var+set}\"; then
3528 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3529 elif eval var_value=\$$var; test -z "$var_value"; then
3530 relink_command="$var=; export $var; $relink_command"
3532 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3533 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3536 relink_command="cd `pwd`; $relink_command"
3537 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3540 # Quote $echo for shipping.
3541 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3543 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3544 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3546 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3548 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3551 # Only actually do things if our run command is non-null.
3552 if test -z "$run"; then
3553 # win32 will think the script is a binary if it has
3554 # a .exe suffix, so we strip it off here.
3556 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3558 # test for cygwin because mv fails w/o .exe extensions
3560 *cygwin*) exeext=.exe ;;
3564 trap "$rm $output; exit 1" 1 2 15
3569 # $output - temporary wrapper script for $objdir/$outputname
3570 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3572 # The $output program cannot be directly executed until all the libtool
3573 # libraries that it depends on are installed.
3575 # This wrapper script should never be moved out of the build directory.
3576 # If it is, it will not operate correctly.
3578 # Sed substitution that helps us do robust quoting. It backslashifies
3579 # metacharacters that are still active within double-quoted strings.
3580 Xsed='sed -e 1s/^X//'
3581 sed_quote_subst='$sed_quote_subst'
3583 # The HP-UX ksh and POSIX shell print the target directory to stdout
3585 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3587 relink_command=\"$relink_command\"
3589 # This environment variable determines our operation mode.
3590 if test \"\$libtool_install_magic\" = \"$magic\"; then
3591 # install mode needs the following variable:
3592 notinst_deplibs='$notinst_deplibs'
3594 # When we are sourced in execute mode, \$file and \$echo are already set.
3595 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3598 # Make sure echo works.
3599 if test \"X\$1\" = X--no-reexec; then
3600 # Discard the --no-reexec flag, and continue.
3602 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3603 # Yippee, \$echo works!
3606 # Restart under the correct shell, and then maybe \$echo will work.
3607 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3613 # Find the directory that this script lives in.
3614 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3615 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3617 # Follow symbolic links until we get to the real thisdir.
3618 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3619 while test -n \"\$file\"; do
3620 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3622 # If there was a directory component, then change thisdir.
3623 if test \"x\$destdir\" != \"x\$file\"; then
3624 case \"\$destdir\" in
3625 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3626 *) thisdir=\"\$thisdir/\$destdir\" ;;
3630 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3631 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3634 # Try to get the absolute directory name.
3635 absdir=\`cd \"\$thisdir\" && pwd\`
3636 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3639 if test "$fast_install" = yes; then
3641 program=lt-'$outputname'$exeext
3642 progdir=\"\$thisdir/$objdir\"
3644 if test ! -f \"\$progdir/\$program\" || \\
3645 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3646 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3648 file=\"\$\$-\$program\"
3650 if test ! -d \"\$progdir\"; then
3651 $mkdir \"\$progdir\"
3653 $rm \"\$progdir/\$file\"
3658 # relink executable if necessary
3659 if test -n \"\$relink_command\"; then
3660 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3662 $echo \"\$relink_command_output\" >&2
3663 $rm \"\$progdir/\$file\"
3668 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3669 { $rm \"\$progdir/\$program\";
3670 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3671 $rm \"\$progdir/\$file\"
3675 program='$outputname'
3676 progdir=\"\$thisdir/$objdir\"
3682 if test -f \"\$progdir/\$program\"; then"
3684 # Export our shlibpath_var if we have one.
3685 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3687 # Add our own library path to $shlibpath_var
3688 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3690 # Some systems cannot cope with colon-terminated $shlibpath_var
3691 # The second colon is a workaround for a bug in BeOS R4 sed
3692 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3694 export $shlibpath_var
3698 # fixup the dll searchpath if we need to.
3699 if test -n "$dllsearchpath"; then
3701 # Add the dll search path components to the executable PATH
3702 PATH=$dllsearchpath:\$PATH
3707 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3708 # Run the actual program with our arguments.
3711 # win32 systems need to use the prog path for dll
3713 *-*-cygwin* | *-*-pw32*)
3715 exec \$progdir/\$program \${1+\"\$@\"}
3719 # Backslashes separate directories on plain windows
3720 *-*-mingw | *-*-os2*)
3722 exec \$progdir\\\\\$program \${1+\"\$@\"}
3728 # Export the path to the program.
3729 PATH=\"\$progdir:\$PATH\"
3732 exec \$program \${1+\"\$@\"}
3737 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3741 # The program doesn't exist.
3742 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3743 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3744 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3755 # See if we need to build an old-fashioned archive.
3756 for oldlib in $oldlibs; do
3758 if test "$build_libtool_libs" = convenience; then
3759 oldobjs="$libobjs_save"
3760 addlibs="$convenience"
3761 build_libtool_libs=no
3763 if test "$build_libtool_libs" = module; then
3764 oldobjs="$libobjs_save"
3765 build_libtool_libs=no
3767 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3769 addlibs="$old_convenience"
3772 if test -n "$addlibs"; then
3773 gentop="$output_objdir/${outputname}x"
3774 $show "${rm}r $gentop"
3775 $run ${rm}r "$gentop"
3776 $show "mkdir $gentop"
3777 $run mkdir "$gentop"
3779 if test $status -ne 0 && test ! -d "$gentop"; then
3782 generated="$generated $gentop"
3784 # Add in members from convenience archives.
3785 for xlib in $addlibs; do
3786 # Extract the objects.
3788 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3789 *) xabs=`pwd`"/$xlib" ;;
3791 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3792 xdir="$gentop/$xlib"
3794 $show "${rm}r $xdir"
3799 if test $status -ne 0 && test ! -d "$xdir"; then
3802 $show "(cd $xdir && $AR x $xabs)"
3803 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3805 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3809 # Do each command in the archive commands.
3810 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3811 eval cmds=\"$old_archive_from_new_cmds\"
3813 # Ensure that we have .o objects in place in case we decided
3814 # not to build a shared library, and have fallen back to building
3815 # static libs even though --disable-static was passed!
3816 for oldobj in $oldobjs; do
3817 if test ! -f $oldobj; then
3818 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3819 if test "X$xdir" = "X$oldobj"; then
3824 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3825 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3826 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3827 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3831 eval cmds=\"$old_archive_cmds\"
3833 save_ifs="$IFS"; IFS='~'
3834 for cmd in $cmds; do
3837 $run eval "$cmd" || exit $?
3842 if test -n "$generated"; then
3843 $show "${rm}r$generated"
3844 $run ${rm}r$generated
3847 # Now create the libtool archive.
3851 test "$build_old_libs" = yes && old_library="$libname.$libext"
3852 $show "creating $output"
3854 # Preserve any variables that may affect compiler behavior
3855 for var in $variables_saved_for_relink; do
3856 if eval test -z \"\${$var+set}\"; then
3857 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3858 elif eval var_value=\$$var; test -z "$var_value"; then
3859 relink_command="$var=; export $var; $relink_command"
3861 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3862 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3865 # Quote the link command for shipping.
3866 relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
3867 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3869 # Only create the output if not a dry run.
3870 if test -z "$run"; then
3871 for installed in no yes; do
3872 if test "$installed" = yes; then
3873 if test -z "$install_libdir"; then
3876 output="$output_objdir/$outputname"i
3877 # Replace all uninstalled libtool libraries with the installed ones
3879 for deplib in $dependency_libs; do
3882 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3883 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3884 if test -z "$libdir"; then
3885 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3888 newdependency_libs="$newdependency_libs $libdir/$name"
3890 *) newdependency_libs="$newdependency_libs $deplib" ;;
3893 dependency_libs="$newdependency_libs"
3895 for lib in $dlfiles; do
3896 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3897 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3898 if test -z "$libdir"; then
3899 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3902 newdlfiles="$newdlfiles $libdir/$name"
3904 dlfiles="$newdlfiles"
3906 for lib in $dlprefiles; do
3907 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3908 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3909 if test -z "$libdir"; then
3910 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3913 newdlprefiles="$newdlprefiles $libdir/$name"
3915 dlprefiles="$newdlprefiles"
3918 # place dlname in correct position for cygwin
3920 case $host,$output,$installed,$module,$dlname in
3921 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3924 # $outputname - a libtool library file
3925 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3927 # Please DO NOT delete this file!
3928 # It is necessary for linking the library.
3930 # The name that we can dlopen(3).
3933 # Names of this library.
3934 library_names='$library_names'
3936 # The name of the static archive.
3937 old_library='$old_library'
3939 # Libraries that this one depends upon.
3940 dependency_libs='$dependency_libs'
3942 # Version information for $libname.
3947 # Is this an already installed library?
3948 installed=$installed
3950 # Files to dlopen/dlpreopen
3952 dlpreopen='$dlprefiles'
3954 # Directory that this library needs to be installed in:
3955 libdir='$install_libdir'"
3956 if test "$installed" = no && test $need_relink = yes; then
3958 relink_command=\"$relink_command\""
3963 # Do a symbolic link so that the libtool archive can be found in
3964 # LD_LIBRARY_PATH before the program is installed.
3965 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3966 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
3972 # libtool install mode
3974 modename="$modename: install"
3976 # There may be an optional sh(1) argument at the beginning of
3977 # install_prog (especially on Windows NT).
3978 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
3979 # Allow the use of GNU shtool's install command.
3980 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
3981 # Aesthetically quote it.
3982 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3984 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3988 install_prog="$arg "
3996 # The real first argument should be the name of the installation program.
3997 # Aesthetically quote it.
3998 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4000 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4004 install_prog="$install_prog$arg"
4006 # We need to accept at least all the BSD install flags.
4016 if test -n "$dest"; then
4017 files="$files $dest"
4035 # If the previous option needed an argument, then skip it.
4036 if test -n "$prev"; then
4045 # Aesthetically quote the argument.
4046 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4048 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4052 install_prog="$install_prog $arg"
4055 if test -z "$install_prog"; then
4056 $echo "$modename: you must specify an install program" 1>&2
4061 if test -n "$prev"; then
4062 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4067 if test -z "$files"; then
4068 if test -z "$dest"; then
4069 $echo "$modename: no file or destination specified" 1>&2
4071 $echo "$modename: you must specify a destination" 1>&2
4077 # Strip any trailing slash from the destination.
4078 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4080 # Check to see that the destination is a directory.
4081 test -d "$dest" && isdir=yes
4082 if test "$isdir" = yes; then
4086 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4087 test "X$destdir" = "X$dest" && destdir=.
4088 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4090 # Not a directory, so check to see that there is only one file specified.
4092 if test $# -gt 2; then
4093 $echo "$modename: \`$dest' is not a directory" 1>&2
4099 [\\/]* | [A-Za-z]:[\\/]*) ;;
4101 for file in $files; do
4105 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4114 # This variable tells wrapper scripts just to set variables rather
4115 # than running their programs.
4116 libtool_install_magic="$magic"
4121 for file in $files; do
4123 # Do each installation.
4126 # Do the static libraries later.
4127 staticlibs="$staticlibs $file"
4131 # Check to see that this really is a libtool archive.
4132 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4134 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4142 # If there is no directory component, then add one.
4144 */* | *\\*) . $file ;;
4148 # Add the libdir to current_libdirs if it is the destination.
4149 if test "X$destdir" = "X$libdir"; then
4150 case "$current_libdirs " in
4152 *) current_libdirs="$current_libdirs $libdir" ;;
4155 # Note the libdir as a future libdir.
4156 case "$future_libdirs " in
4158 *) future_libdirs="$future_libdirs $libdir" ;;
4162 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4163 test "X$dir" = "X$file/" && dir=
4166 if test -n "$relink_command"; then
4167 $echo "$modename: warning: relinking \`$file'" 1>&2
4168 $show "$relink_command"
4169 if $run eval "$relink_command"; then :
4171 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4176 # See the names of the shared library.
4177 set dummy $library_names
4178 if test -n "$2"; then
4184 test -n "$relink_command" && srcname="$realname"T
4186 # Install the shared library and build the symlinks.
4187 $show "$install_prog $dir/$srcname $destdir/$realname"
4188 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4189 if test -n "$stripme" && test -n "$striplib"; then
4190 $show "$striplib $destdir/$realname"
4191 $run eval "$striplib $destdir/$realname" || exit $?
4194 if test $# -gt 0; then
4195 # Delete the old symlinks, and create new ones.
4198 if test "$linkname" != "$realname"; then
4199 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4200 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4205 # Do each command in the postinstall commands.
4206 lib="$destdir/$realname"
4207 eval cmds=\"$postinstall_cmds\"
4208 save_ifs="$IFS"; IFS='~'
4209 for cmd in $cmds; do
4212 $run eval "$cmd" || exit $?
4217 # Install the pseudo-library for information purposes.
4218 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4219 instname="$dir/$name"i
4220 $show "$install_prog $instname $destdir/$name"
4221 $run eval "$install_prog $instname $destdir/$name" || exit $?
4223 # Maybe install the static library, too.
4224 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4228 # Install (i.e. copy) a libtool object.
4230 # Figure out destination file name, if it wasn't already specified.
4231 if test -n "$destname"; then
4232 destfile="$destdir/$destname"
4234 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4235 destfile="$destdir/$destfile"
4238 # Deduce the name of the destination old-style object file.
4241 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4244 staticdest="$destfile"
4248 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4254 # Install the libtool object if requested.
4255 if test -n "$destfile"; then
4256 $show "$install_prog $file $destfile"
4257 $run eval "$install_prog $file $destfile" || exit $?
4260 # Install the old object if enabled.
4261 if test "$build_old_libs" = yes; then
4262 # Deduce the name of the old-style object file.
4263 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4265 $show "$install_prog $staticobj $staticdest"
4266 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4272 # Figure out destination file name, if it wasn't already specified.
4273 if test -n "$destname"; then
4274 destfile="$destdir/$destname"
4276 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4277 destfile="$destdir/$destfile"
4280 # Do a test to see if this is really a libtool program.
4281 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4285 # If there is no directory component, then add one.
4287 */* | *\\*) . $file ;;
4291 # Check the variables that should have been set.
4292 if test -z "$notinst_deplibs"; then
4293 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4298 for lib in $notinst_deplibs; do
4299 # Check to see that each library is installed.
4301 if test -f "$lib"; then
4302 # If there is no directory component, then add one.
4304 */* | *\\*) . $lib ;;
4308 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4309 if test -n "$libdir" && test ! -f "$libfile"; then
4310 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4316 # If there is no directory component, then add one.
4318 */* | *\\*) . $file ;;
4323 if test "$fast_install" = no && test -n "$relink_command"; then
4324 if test "$finalize" = yes && test -z "$run"; then
4326 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4327 tmpdir="$tmpdir/libtool-$$"
4328 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4330 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4333 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4334 outputname="$tmpdir/$file"
4335 # Replace the output file specification.
4336 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4338 $show "$relink_command"
4339 if $run eval "$relink_command"; then :
4341 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4347 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4350 # Install the binary that we compiled earlier.
4351 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4355 # remove .exe since cygwin /usr/bin/install will append another
4357 case $install_prog,$host in
4358 /usr/bin/install*,*cygwin*)
4359 case $file:$destfile in
4364 destfile=$destfile.exe
4367 destfile=`echo $destfile | sed -e 's,.exe$,,'`
4372 $show "$install_prog$stripme $file $destfile"
4373 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4374 test -n "$outputname" && ${rm}r "$tmpdir"
4379 for file in $staticlibs; do
4380 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4382 # Set up the ranlib parameters.
4383 oldlib="$destdir/$name"
4385 $show "$install_prog $file $oldlib"
4386 $run eval "$install_prog \$file \$oldlib" || exit $?
4388 if test -n "$stripme" && test -n "$striplib"; then
4389 $show "$old_striplib $oldlib"
4390 $run eval "$old_striplib $oldlib" || exit $?
4393 # Do each command in the postinstall commands.
4394 eval cmds=\"$old_postinstall_cmds\"
4395 save_ifs="$IFS"; IFS='~'
4396 for cmd in $cmds; do
4399 $run eval "$cmd" || exit $?
4404 if test -n "$future_libdirs"; then
4405 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4408 if test -n "$current_libdirs"; then
4409 # Maybe just do a dry run.
4410 test -n "$run" && current_libdirs=" -n$current_libdirs"
4411 exec_cmd='$SHELL $0 --finish$current_libdirs'
4417 # libtool finish mode
4419 modename="$modename: finish"
4423 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4426 libdirs="$libdirs $dir"
4429 for libdir in $libdirs; do
4430 if test -n "$finish_cmds"; then
4431 # Do each command in the finish commands.
4432 eval cmds=\"$finish_cmds\"
4433 save_ifs="$IFS"; IFS='~'
4434 for cmd in $cmds; do
4437 $run eval "$cmd" || admincmds="$admincmds
4442 if test -n "$finish_eval"; then
4443 # Do the single finish_eval.
4444 eval cmds=\"$finish_eval\"
4445 $run eval "$cmds" || admincmds="$admincmds
4451 # Exit here if they wanted silent mode.
4452 test "$show" = ":" && exit 0
4454 echo "----------------------------------------------------------------------"
4455 echo "Libraries have been installed in:"
4456 for libdir in $libdirs; do
4460 echo "If you ever happen to want to link against installed libraries"
4461 echo "in a given directory, LIBDIR, you must either use libtool, and"
4462 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4463 echo "flag during linking and do at least one of the following:"
4464 if test -n "$shlibpath_var"; then
4465 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4466 echo " during execution"
4468 if test -n "$runpath_var"; then
4469 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4470 echo " during linking"
4472 if test -n "$hardcode_libdir_flag_spec"; then
4474 eval flag=\"$hardcode_libdir_flag_spec\"
4476 echo " - use the \`$flag' linker flag"
4478 if test -n "$admincmds"; then
4479 echo " - have your system administrator run these commands:$admincmds"
4481 if test -f /etc/ld.so.conf; then
4482 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4485 echo "See any operating system documentation about shared libraries for"
4486 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4487 echo "----------------------------------------------------------------------"
4491 # libtool execute mode
4493 modename="$modename: execute"
4495 # The first argument is the command name.
4497 if test -z "$cmd"; then
4498 $echo "$modename: you must specify a COMMAND" 1>&2
4503 # Handle -dlopen flags immediately.
4504 for file in $execute_dlfiles; do
4505 if test ! -f "$file"; then
4506 $echo "$modename: \`$file' is not a file" 1>&2
4514 # Check to see that this really is a libtool archive.
4515 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4517 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4522 # Read the libtool library.
4526 # If there is no directory component, then add one.
4528 */* | *\\*) . $file ;;
4532 # Skip this library if it cannot be dlopened.
4533 if test -z "$dlname"; then
4534 # Warn if it was a shared library.
4535 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4539 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4540 test "X$dir" = "X$file" && dir=.
4542 if test -f "$dir/$objdir/$dlname"; then
4545 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4551 # Just add the directory containing the .lo file.
4552 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4553 test "X$dir" = "X$file" && dir=.
4557 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4562 # Get the absolute pathname.
4563 absdir=`cd "$dir" && pwd`
4564 test -n "$absdir" && dir="$absdir"
4566 # Now add the directory to shlibpath_var.
4567 if eval "test -z \"\$$shlibpath_var\""; then
4568 eval "$shlibpath_var=\"\$dir\""
4570 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4574 # This variable tells wrapper scripts just to set shlibpath_var
4575 # rather than running their programs.
4576 libtool_execute_magic="$magic"
4578 # Check if any of the arguments is a wrapper script.
4585 # Do a test to see if this is really a libtool program.
4586 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4587 # If there is no directory component, then add one.
4589 */* | *\\*) . $file ;;
4593 # Transform arg to wrapped name.
4594 file="$progdir/$program"
4598 # Quote arguments (to preserve shell metacharacters).
4599 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4600 args="$args \"$file\""
4603 if test -z "$run"; then
4604 if test -n "$shlibpath_var"; then
4605 # Export the shlibpath_var.
4606 eval "export $shlibpath_var"
4609 # Restore saved enviroment variables
4610 if test "${save_LC_ALL+set}" = set; then
4611 LC_ALL="$save_LC_ALL"; export LC_ALL
4613 if test "${save_LANG+set}" = set; then
4614 LANG="$save_LANG"; export LANG
4617 # Now prepare to actually exec the command.
4618 exec_cmd='"$cmd"$args'
4620 # Display what would be done.
4621 if test -n "$shlibpath_var"; then
4622 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4623 $echo "export $shlibpath_var"
4630 # libtool clean and uninstall mode
4632 modename="$modename: $mode"
4638 # This variable tells wrapper scripts just to set variables rather
4639 # than running their programs.
4640 libtool_install_magic="$magic"
4645 -f) rm="$rm $arg"; rmforce=yes ;;
4646 -*) rm="$rm $arg" ;;
4647 *) files="$files $arg" ;;
4651 if test -z "$rm"; then
4652 $echo "$modename: you must specify an RM program" 1>&2
4659 for file in $files; do
4660 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4661 if test "X$dir" = "X$file"; then
4665 objdir="$dir/$objdir"
4667 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4668 test $mode = uninstall && objdir="$dir"
4670 # Remember objdir for removal later, being careful to avoid duplicates
4671 if test $mode = clean; then
4674 *) rmdirs="$rmdirs $objdir" ;;
4678 # Don't error if the file doesn't exist and rm -f was used.
4679 if (test -L "$file") >/dev/null 2>&1 \
4680 || (test -h "$file") >/dev/null 2>&1 \
4681 || test -f "$file"; then
4683 elif test -d "$file"; then
4686 elif test "$rmforce" = yes; then
4694 # Possibly a libtool archive, so verify it.
4695 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4698 # Delete the libtool libraries and symlinks.
4699 for n in $library_names; do
4700 rmfiles="$rmfiles $objdir/$n"
4702 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4703 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4705 if test $mode = uninstall; then
4706 if test -n "$library_names"; then
4707 # Do each command in the postuninstall commands.
4708 eval cmds=\"$postuninstall_cmds\"
4709 save_ifs="$IFS"; IFS='~'
4710 for cmd in $cmds; do
4714 if test $? != 0 && test "$rmforce" != yes; then
4721 if test -n "$old_library"; then
4722 # Do each command in the old_postuninstall commands.
4723 eval cmds=\"$old_postuninstall_cmds\"
4724 save_ifs="$IFS"; IFS='~'
4725 for cmd in $cmds; do
4729 if test $? != 0 && test "$rmforce" != yes; then
4735 # FIXME: should reinstall the best remaining shared library.
4741 if test "$build_old_libs" = yes; then
4742 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4743 rmfiles="$rmfiles $dir/$oldobj"
4748 # Do a test to see if this is a libtool program.
4749 if test $mode = clean &&
4750 (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4754 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4755 if test "$fast_install" = yes && test -n "$relink_command"; then
4756 rmfiles="$rmfiles $objdir/lt-$name"
4761 $show "$rm $rmfiles"
4762 $run $rm $rmfiles || exit_status=1
4765 # Try to remove the ${objdir}s in the directories where we deleted files
4766 for dir in $rmdirs; do
4767 if test -d "$dir"; then
4769 $run rmdir $dir >/dev/null 2>&1
4777 $echo "$modename: you must specify a MODE" 1>&2
4778 $echo "$generic_help" 1>&2
4783 if test -z "$exec_cmd"; then
4784 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4785 $echo "$generic_help" 1>&2
4788 fi # test -z "$show_help"
4790 if test -n "$exec_cmd"; then
4795 # We need to display help for each of the modes.
4798 "Usage: $modename [OPTION]... [MODE-ARG]...
4800 Provide generalized library-building support services.
4802 --config show all configuration variables
4803 --debug enable verbose shell tracing
4804 -n, --dry-run display commands without modifying any files
4805 --features display basic configuration information and exit
4806 --finish same as \`--mode=finish'
4807 --help display this help message and exit
4808 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4809 --quiet same as \`--silent'
4810 --silent don't print informational messages
4811 --version print version information
4813 MODE must be one of the following:
4815 clean remove files from the build directory
4816 compile compile a source file into a libtool object
4817 execute automatically set library path, then run a program
4818 finish complete the installation of libtool libraries
4819 install install libraries or executables
4820 link create a library or an executable
4821 uninstall remove libraries from an installed directory
4823 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4824 a more detailed description of MODE."
4830 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4832 Remove files from the build directory.
4834 RM is the name of the program to use to delete files associated with each FILE
4835 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4838 If FILE is a libtool library, object or program, all the files associated
4839 with it are deleted. Otherwise, only FILE itself is deleted using RM."
4844 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4846 Compile a source file into a libtool library object.
4848 This mode accepts the following additional options:
4850 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4851 -prefer-pic try to building PIC objects only
4852 -prefer-non-pic try to building non-PIC objects only
4853 -static always build a \`.o' file suitable for static linking
4855 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4856 from the given SOURCEFILE.
4858 The output file name is determined by removing the directory component from
4859 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4860 library object suffix, \`.lo'."
4865 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4867 Automatically set library path, then run a program.
4869 This mode accepts the following additional options:
4871 -dlopen FILE add the directory containing FILE to the library path
4873 This mode sets the library path environment variable according to \`-dlopen'
4876 If any of the ARGS are libtool executable wrappers, then they are translated
4877 into their corresponding uninstalled binary, and any of their required library
4878 directories are added to the library path.
4880 Then, COMMAND is executed, with ARGS as arguments."
4885 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4887 Complete the installation of libtool libraries.
4889 Each LIBDIR is a directory that contains libtool libraries.
4891 The commands that this mode executes may require superuser privileges. Use
4892 the \`--dry-run' option if you just want to see what would be executed."
4897 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4899 Install executables or libraries.
4901 INSTALL-COMMAND is the installation command. The first component should be
4902 either the \`install' or \`cp' program.
4904 The rest of the components are interpreted as arguments to that command (only
4905 BSD-compatible install options are recognized)."
4910 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4912 Link object files or libraries together to form another library, or to
4913 create an executable program.
4915 LINK-COMMAND is a command using the C compiler that you would use to create
4916 a program from several object files.
4918 The following components of LINK-COMMAND are treated specially:
4920 -all-static do not do any dynamic linking at all
4921 -avoid-version do not add a version suffix if possible
4922 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4923 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4924 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4925 -export-symbols SYMFILE
4926 try to export only the symbols listed in SYMFILE
4927 -export-symbols-regex REGEX
4928 try to export only the symbols matching REGEX
4929 -LLIBDIR search LIBDIR for required installed libraries
4930 -lNAME OUTPUT-FILE requires the installed library libNAME
4931 -module build a library that can dlopened
4932 -no-fast-install disable the fast-install mode
4933 -no-install link a not-installable executable
4934 -no-undefined declare that a library does not refer to external symbols
4935 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4936 -release RELEASE specify package release information
4937 -rpath LIBDIR the created library will eventually be installed in LIBDIR
4938 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4939 -static do not do any dynamic linking of libtool libraries
4940 -version-info CURRENT[:REVISION[:AGE]]
4941 specify library version info [each variable defaults to 0]
4943 All other options (arguments beginning with \`-') are ignored.
4945 Every other argument is treated as a filename. Files ending in \`.la' are
4946 treated as uninstalled libtool libraries, other files are standard or library
4949 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4950 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4951 required, except when creating a convenience library.
4953 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4954 using \`ar' and \`ranlib', or on Windows using \`lib'.
4956 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4957 is created, otherwise an executable program is created."
4962 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4964 Remove libraries from an installation directory.
4966 RM is the name of the program to use to delete files associated with each FILE
4967 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4970 If FILE is a libtool library, all the files associated with it are deleted.
4971 Otherwise, only FILE itself is deleted using RM."
4975 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4982 $echo "Try \`$modename --help' for more information about other modes."