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 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec
; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo
; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo
; then
43 # used as fallback echo
51 # The name of this program.
52 progname
=`$echo "$0" | sed 's%^.*/%%'`
59 TIMESTAMP
=" (1.920 2001/04/24 23:26:18)"
62 help="Try \`$progname --help' for more information."
63 magic
="%%%MAGIC variable%%%"
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
71 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
73 NL2SP
='tr \015\012 \040\040'
76 # Only set LANG and LC_ALL to C if already set.
77 # These must not be set unconditionally because not all systems understand
78 # e.g. LANG=C (notably SCO).
79 # We save the old values to restore during execute mode.
80 if test "${LC_ALL+set}" = set; then
81 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
83 if test "${LANG+set}" = set; then
84 save_LANG
="$LANG"; LANG
=C
; export LANG
87 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
88 echo "$modename: not configured to build any kind of library" 1>&2
89 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
102 lo2o
="s/\\.lo\$/.${objext}/"
103 o2lo
="s/\\.${objext}\$/.lo/"
105 # Parse our command line options once, thoroughly.
112 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
116 # If the previous option needs an argument, assign it.
117 if test -n "$prev"; then
120 execute_dlfiles
="$execute_dlfiles $arg"
132 # Have we seen a non-optional argument yet?
139 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
144 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
149 echo "$progname: enabling shell trace mode"
159 if test "$build_libtool_libs" = yes; then
160 echo "enable shared libraries"
162 echo "disable shared libraries"
164 if test "$build_old_libs" = yes; then
165 echo "enable static libraries"
167 echo "disable static libraries"
172 --finish) mode
="finish" ;;
174 --mode) prevopt
="--mode" prev
=mode
;;
175 --mode=*) mode
="$optarg" ;;
187 $echo "$modename: unrecognized option \`$arg'" 1>&2
199 if test -n "$prevopt"; then
200 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
205 if test -z "$show_help"; then
207 # Infer the operation mode.
208 if test -z "$mode"; then
210 *cc |
*++ | gcc
* |
*-gcc*)
222 *db |
*dbx |
*strace |
*truss
)
232 # If we have no mode, but dlfiles were specified, then do execute mode.
233 test -n "$execute_dlfiles" && mode
=execute
235 # Just use the default operation mode.
236 if test -z "$mode"; then
237 if test -n "$nonopt"; then
238 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
240 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
247 # Only execute mode is allowed to have -dlopen flags.
248 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
249 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
254 # Change the help message to a mode-specific one.
256 help="Try \`$modename --help --mode=$mode' for more information."
258 # These modes are in order of execution frequency so that they run quickly.
260 # libtool compile mode
262 modename
="$modename: compile"
263 # Get the compilation command and the source file.
276 # Aesthetically quote the previous argument.
278 lastarg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
281 # Double-quote args containing other shell metacharacters.
282 # Many Bourne shells cannot handle close brackets correctly
283 # in scan sets, so we specify it separately.
284 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
289 # Add the previous argument to base_compile.
290 if test -z "$base_compile"; then
291 base_compile
="$lastarg"
293 base_compile
="$base_compile $lastarg"
299 # Accept any command-line options.
302 if test "$user_target" != "no"; then
303 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
330 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
332 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
336 # Double-quote args containing other shell metacharacters.
337 # Many Bourne shells cannot handle close brackets correctly
338 # in scan sets, so we specify it separately.
340 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
344 lastarg
="$lastarg $arg"
347 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
349 # Add the arguments to base_compile.
350 if test -z "$base_compile"; then
351 base_compile
="$lastarg"
353 base_compile
="$base_compile $lastarg"
361 # The next one is the -o target name
366 # We got the output file
373 # Accept the current argument as the source file.
377 # Aesthetically quote the previous argument.
379 # Backslashify any backslashes, double quotes, and dollar signs.
380 # These are the only characters that are still specially
381 # interpreted inside of double-quoted scrings.
382 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
384 # Double-quote args containing other shell metacharacters.
385 # Many Bourne shells cannot handle close brackets correctly
386 # in scan sets, so we specify it separately.
388 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
389 lastarg
="\"$lastarg\""
393 # Add the previous argument to base_compile.
394 if test -z "$base_compile"; then
395 base_compile
="$lastarg"
397 base_compile
="$base_compile $lastarg"
405 # Get the name of the library object.
406 libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
409 $echo "$modename: you must specify a target with \`-o'" 1>&2
414 # Recognize several different file suffixes.
415 # If the user specifies -o file.o, it is replaced with file.lo
430 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
433 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
435 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
440 if test -z "$base_compile"; then
441 $echo "$modename: you must specify a compilation command" 1>&2
446 # Delete any leftover library objects.
447 if test "$build_old_libs" = yes; then
448 removelist
="$obj $libobj"
454 trap "$run $rm $removelist; exit 1" 1 2 15
456 # On Cygwin there's no "real" PIC flag so we must build both object types
458 cygwin
* | mingw
* | pw32
* | os2
*)
462 if test $pic_mode = no
&& test "$deplibs_check_method" != pass_all
; then
463 # non-PIC code in shared libraries is not supported
467 # Calculate the filename of the output object if compiler does
468 # not support -o with -c
469 if test "$compiler_c_o" = no
; then
470 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
471 lockfile
="$output_obj.lock"
472 removelist
="$removelist $output_obj $lockfile"
473 trap "$run $rm $removelist; exit 1" 1 2 15
479 # Lock this critical section if it is needed
480 # We use this script file to make the link, it avoids creating a new file
481 if test "$need_locks" = yes; then
482 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
483 $show "Waiting for $lockfile to be removed"
486 elif test "$need_locks" = warn
; then
487 if test -f "$lockfile"; then
489 *** ERROR, $lockfile exists and contains:
490 `cat $lockfile 2>/dev/null`
492 This indicates that another process is trying to use the same
493 temporary object file, and libtool could not work around it because
494 your compiler does not support \`-c' and \`-o' together. If you
495 repeat this compilation, it may succeed, by chance, but you had better
496 avoid parallel builds (make -j) in this platform, or get a better
502 echo $srcfile > "$lockfile"
505 if test -n "$fix_srcfile_path"; then
506 eval srcfile
=\"$fix_srcfile_path\"
509 # Only build a PIC object if we are building libtool libraries.
510 if test "$build_libtool_libs" = yes; then
511 # Without this assignment, base_compile gets emptied.
512 fbsd_hideous_sh_bug
=$base_compile
514 if test "$pic_mode" != no
; then
515 # All platforms use -DPIC, to notify preprocessed assembler code.
516 command="$base_compile $srcfile $pic_flag -DPIC"
518 # Don't build PIC code
519 command="$base_compile $srcfile"
521 if test "$build_old_libs" = yes; then
523 dir
=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
524 if test "X$dir" = "X$libobj"; then
529 libobj
="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
531 if test -d "$dir"; then
538 if test $status -ne 0 && test ! -d $dir; then
543 if test "$compiler_o_lo" = yes; then
545 command="$command -o $output_obj"
546 elif test "$compiler_c_o" = yes; then
548 command="$command -o $output_obj"
551 $run $rm "$output_obj"
553 if $run eval "$command"; then :
555 test -n "$output_obj" && $run $rm $removelist
559 if test "$need_locks" = warn
&&
560 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
562 *** ERROR, $lockfile contains:
563 `cat $lockfile 2>/dev/null`
565 but it should contain:
568 This indicates that another process is trying to use the same
569 temporary object file, and libtool could not work around it because
570 your compiler does not support \`-c' and \`-o' together. If you
571 repeat this compilation, it may succeed, by chance, but you had better
572 avoid parallel builds (make -j) in this platform, or get a better
579 # Just move the object if needed, then go on to compile the next one
580 if test x
"$output_obj" != x
"$libobj"; then
581 $show "$mv $output_obj $libobj"
582 if $run $mv $output_obj $libobj; then :
590 # If we have no pic_flag, then copy the object into place and finish.
591 if (test -z "$pic_flag" ||
test "$pic_mode" != default
) &&
592 test "$build_old_libs" = yes; then
593 # Rename the .lo from within objdir to obj
594 if test -f $obj; then
599 $show "$mv $libobj $obj"
600 if $run $mv $libobj $obj; then :
607 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
608 if test "X$xdir" = "X$obj"; then
613 baseobj
=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
614 libobj
=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
615 # Now arrange that obj and lo_libobj become the same file
616 $show "(cd $xdir && $LN_S $baseobj $libobj)"
617 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
626 # Allow error messages only from the first compilation.
627 suppress_output
=' >/dev/null 2>&1'
630 # Only build a position-dependent object if we build old libraries.
631 if test "$build_old_libs" = yes; then
632 if test "$pic_mode" != yes; then
633 # Don't build PIC code
634 command="$base_compile $srcfile"
636 # All platforms use -DPIC, to notify preprocessed assembler code.
637 command="$base_compile $srcfile $pic_flag -DPIC"
639 if test "$compiler_c_o" = yes; then
640 command="$command -o $obj"
644 # Suppress compiler output if we already did a PIC compilation.
645 command="$command$suppress_output"
646 $run $rm "$output_obj"
648 if $run eval "$command"; then :
654 if test "$need_locks" = warn
&&
655 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
657 *** ERROR, $lockfile contains:
658 `cat $lockfile 2>/dev/null`
660 but it should contain:
663 This indicates that another process is trying to use the same
664 temporary object file, and libtool could not work around it because
665 your compiler does not support \`-c' and \`-o' together. If you
666 repeat this compilation, it may succeed, by chance, but you had better
667 avoid parallel builds (make -j) in this platform, or get a better
674 # Just move the object if needed
675 if test x
"$output_obj" != x
"$obj"; then
676 $show "$mv $output_obj $obj"
677 if $run $mv $output_obj $obj; then :
685 # Create an invalid libtool object if no PIC, so that we do not
686 # accidentally link it into a program.
687 if test "$build_libtool_libs" != yes; then
688 $show "echo timestamp > $libobj"
689 $run eval "echo timestamp > \$libobj" ||
exit $?
691 # Move the .lo from within objdir
692 $show "$mv $libobj $lo_libobj"
693 if $run $mv $libobj $lo_libobj; then :
702 # Unlock the critical section if it was locked
703 if test "$need_locks" != no
; then
712 modename
="$modename: link"
714 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
715 # It is impossible to link a dll without this setting, and
716 # we shouldn't force the makefile maintainer to figure out
717 # which system we are compiling for in order to pass an extra
718 # flag for every libtool invokation.
721 # FIXME: Unfortunately, there are problems with the above when trying
722 # to make a dll which has undefined symbols, in which case not
723 # even a static library is built. For now, we need to specify
724 # -no-undefined on the libtool link line when we can be certain
725 # that all symbols are satisfied, otherwise we get a static library.
735 libtool_args
="$nonopt"
736 compile_command
="$nonopt"
737 finalize_command
="$nonopt"
750 lib_search_path
=`pwd`
758 export_symbols_regex
=
765 prefer_static_libs
=no
777 # We need to know -static, to get the right output filenames.
781 -all-static |
-static)
782 if test "X$arg" = "X-all-static"; then
783 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
784 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
786 if test -n "$link_static_flag"; then
787 dlopen_self
=$dlopen_self_static
790 if test -z "$pic_flag" && test -n "$link_static_flag"; then
791 dlopen_self
=$dlopen_self_static
794 build_libtool_libs
=no
796 prefer_static_libs
=yes
802 # See if our shared archives depend on static archives.
803 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
805 # Go through the arguments, transforming them on the way.
806 while test $# -gt 0; do
810 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
811 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
815 libtool_args
="$libtool_args $qarg"
817 # If the previous option needs an argument, assign it.
818 if test -n "$prev"; then
821 compile_command
="$compile_command @OUTPUT@"
822 finalize_command
="$finalize_command @OUTPUT@"
828 if test "$preload" = no
; then
829 # Add the symbol object into the linking commands.
830 compile_command
="$compile_command @SYMFILE@"
831 finalize_command
="$finalize_command @SYMFILE@"
835 *.la |
*.lo
) ;; # We handle these cases below.
837 if test "$dlself" = no
; then
845 if test "$prev" = dlprefiles
; then
847 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
857 if test "$prev" = dlfiles
; then
858 dlfiles
="$dlfiles $arg"
860 dlprefiles
="$dlprefiles $arg"
868 export_symbols
="$arg"
869 if test ! -f "$arg"; then
870 $echo "$modename: symbol file \`$arg' does not exist"
877 export_symbols_regex
="$arg"
887 # We need an absolute path.
889 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
891 $echo "$modename: only absolute run-paths are allowed" 1>&2
895 if test "$prev" = rpath
; then
898 *) rpath
="$rpath $arg" ;;
903 *) xrpath
="$xrpath $arg" ;;
910 compiler_flags
="$compiler_flags $qarg"
912 compile_command
="$compile_command $qarg"
913 finalize_command
="$finalize_command $qarg"
917 linker_flags
="$linker_flags $qarg"
918 compiler_flags
="$compiler_flags $wl$qarg"
920 compile_command
="$compile_command $wl$qarg"
921 finalize_command
="$finalize_command $wl$qarg"
925 eval "$prev=\"\$arg\""
936 if test -n "$link_static_flag"; then
937 compile_command
="$compile_command $link_static_flag"
938 finalize_command
="$finalize_command $link_static_flag"
944 # FIXME: remove this flag sometime in the future.
945 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
970 -export-symbols |
-export-symbols-regex)
971 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
972 $echo "$modename: more than one -exported-symbols argument is not allowed"
975 if test "X$arg" = "X-export-symbols"; then
983 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
984 # so, if we see these flags be careful not to treat them like -L
986 case $with_gcc/$host in
988 compile_command
="$compile_command $arg"
989 finalize_command
="$finalize_command $arg"
996 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
997 # We need an absolute path.
999 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1001 absdir
=`cd "$dir" && pwd`
1002 if test -z "$absdir"; then
1003 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1012 deplibs
="$deplibs -L$dir"
1013 lib_search_path
="$lib_search_path $dir"
1017 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1018 case :$dllsearchpath: in
1020 *) dllsearchpath
="$dllsearchpath:$dir";;
1028 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1030 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1031 # These systems don't actually have a C or math library (as such)
1034 *-*-mingw* |
*-*-os2*)
1035 # These systems don't actually have a C library (as such)
1036 test "X$arg" = "X-lc" && continue
1040 deplibs
="$deplibs $arg"
1056 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1057 # The PATH hackery in wrapper scripts is required on Windows
1058 # in order for the loader to find any dlls it needs.
1059 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1060 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1063 *) no_install
=yes ;;
1091 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1092 # We need an absolute path.
1094 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1096 $echo "$modename: only absolute run-paths are allowed" 1>&2
1102 *) xrpath
="$xrpath $dir" ;;
1108 # The effects of -static are defined in a previous loop.
1109 # We used to do the same as -all-static on platforms that
1110 # didn't have a PIC flag, but the assumption that the effects
1111 # would be equivalent was wrong. It would break on at least
1112 # Digital Unix and AIX.
1127 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1129 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1130 for flag
in $args; do
1133 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1138 compiler_flags
="$compiler_flags $flag"
1141 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1145 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1147 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1148 for flag
in $args; do
1151 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1156 compiler_flags
="$compiler_flags $wl$flag"
1157 linker_flags
="$linker_flags $flag"
1160 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1173 # Some other compiler flag.
1175 # Unknown arguments in both finalize_command and compile_command need
1176 # to be aesthetically quoted because they are evaled later.
1177 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1179 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1186 # A library or standard object.
1187 if test "$prev" = dlfiles
; then
1188 # This file was specified with -dlopen.
1189 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1190 dlfiles
="$dlfiles $arg"
1194 # If libtool objects are unsupported, then we need to preload.
1199 if test "$prev" = dlprefiles
; then
1200 # Preload the old-style object.
1201 dlprefiles
="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1205 *.lo
) libobjs
="$libobjs $arg" ;;
1206 *) objs
="$objs $arg" ;;
1213 deplibs
="$deplibs $arg"
1214 old_deplibs
="$old_deplibs $arg"
1219 # A libtool-controlled library.
1221 if test "$prev" = dlfiles
; then
1222 # This library was specified with -dlopen.
1223 dlfiles
="$dlfiles $arg"
1225 elif test "$prev" = dlprefiles
; then
1226 # The library was specified with -dlpreopen.
1227 dlprefiles
="$dlprefiles $arg"
1230 deplibs
="$deplibs $arg"
1235 # Some other compiler argument.
1237 # Unknown arguments in both finalize_command and compile_command need
1238 # to be aesthetically quoted because they are evaled later.
1239 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1241 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1248 # Now actually substitute the argument into the commands.
1249 if test -n "$arg"; then
1250 compile_command
="$compile_command $arg"
1251 finalize_command
="$finalize_command $arg"
1253 done # argument parsing loop
1255 if test -n "$prev"; then
1256 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1261 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1262 eval arg
=\"$export_dynamic_flag_spec\"
1263 compile_command
="$compile_command $arg"
1264 finalize_command
="$finalize_command $arg"
1267 # calculate the name of the file, without its directory
1268 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1269 libobjs_save
="$libobjs"
1271 if test -n "$shlibpath_var"; then
1272 # get the directories listed in $shlibpath_var
1273 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1277 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1278 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1280 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1281 if test "X$output_objdir" = "X$output"; then
1282 output_objdir
="$objdir"
1284 output_objdir
="$output_objdir/$objdir"
1286 # Create the object directory.
1287 if test ! -d $output_objdir; then
1288 $show "$mkdir $output_objdir"
1289 $run $mkdir $output_objdir
1291 if test $status -ne 0 && test ! -d $output_objdir; then
1296 # Determine the type of output
1299 $echo "$modename: you must specify an output file" 1>&2
1303 *.
$libext) linkmode
=oldlib
;;
1304 *.lo |
*.
$objext) linkmode
=obj
;;
1305 *.la
) linkmode
=lib
;;
1306 *) linkmode
=prog
;; # Anything else should be a program.
1311 # Find all interdependent deplibs by searching for libraries
1312 # that are linked more than once (e.g. -la -lb -la)
1313 for deplib
in $deplibs; do
1315 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1317 libs
="$libs $deplib"
1322 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1323 notinst_deplibs
= # not-installed libtool libraries
1324 notinst_path
= # paths that contain not-installed libtool libraries
1328 for file in $dlfiles $dlprefiles; do
1332 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1344 passes
="conv scan dlopen dlpreopen link"
1349 for pass
in $passes; do
1350 if test $linkmode = prog
; then
1351 # Determine which files to process
1355 save_deplibs
="$deplibs" # Collect dlpreopened libraries
1358 dlpreopen
) libs
="$dlprefiles" ;;
1359 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1362 for deplib
in $libs; do
1367 if test $linkmode = oldlib
&& test $linkmode = obj
; then
1368 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1371 if test $pass = conv
; then
1372 deplibs
="$deplib $deplibs"
1375 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1376 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1377 # Search the libtool library
1378 lib
="$searchdir/lib${name}.la"
1379 if test -f "$lib"; then
1384 if test "$found" != yes; then
1385 # deplib doesn't seem to be a libtool library
1386 if test "$linkmode,$pass" = "prog,link"; then
1387 compile_deplibs
="$deplib $compile_deplibs"
1388 finalize_deplibs
="$deplib $finalize_deplibs"
1390 deplibs
="$deplib $deplibs"
1391 test $linkmode = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1399 deplibs
="$deplib $deplibs"
1400 test $pass = conv
&& continue
1401 newdependency_libs
="$deplib $newdependency_libs"
1402 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1405 if test $pass = conv
; then
1406 deplibs
="$deplib $deplibs"
1409 if test $pass = scan
; then
1410 deplibs
="$deplib $deplibs"
1411 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1413 compile_deplibs
="$deplib $compile_deplibs"
1414 finalize_deplibs
="$deplib $finalize_deplibs"
1418 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1424 if test $pass = link
; then
1425 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1426 # Make sure the xrpath contains only unique directories.
1429 *) xrpath
="$xrpath $dir" ;;
1432 deplibs
="$deplib $deplibs"
1435 *.la
) lib
="$deplib" ;;
1437 if test $pass = conv
; then
1438 deplibs
="$deplib $deplibs"
1443 if test "$deplibs_check_method" != pass_all
; then
1445 echo "*** Warning: This library needs some functionality provided by $deplib."
1446 echo "*** I have the capability to make that library automatically link in when"
1447 echo "*** you link to this library. But I can only do this if you have a"
1448 echo "*** shared version of the library, which you do not appear to have."
1451 echo "*** Warning: Linking the shared library $output against the"
1452 echo "*** static library $deplib is not portable!"
1453 deplibs
="$deplib $deplibs"
1458 if test $pass != link
; then
1459 deplibs
="$deplib $deplibs"
1461 compile_deplibs
="$deplib $compile_deplibs"
1462 finalize_deplibs
="$deplib $finalize_deplibs"
1469 if test $pass = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1470 # If there is no dlopen support or we're linking statically,
1471 # we need to preload.
1472 newdlprefiles
="$newdlprefiles $deplib"
1473 compile_deplibs
="$deplib $compile_deplibs"
1474 finalize_deplibs
="$deplib $finalize_deplibs"
1476 newdlfiles
="$newdlfiles $deplib"
1485 if test $found = yes ||
test -f "$lib"; then :
1487 $echo "$modename: cannot find the library \`$lib'" 1>&2
1491 # Check to see that this really is a libtool archive.
1492 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1494 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1498 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1499 test "X$ladir" = "X$lib" && ladir
="."
1507 # If the library was installed with an old release of libtool,
1508 # it will not redefine variable installed.
1513 */* |
*\\*) .
$lib ;;
1517 if test "$linkmode,$pass" = "lib,link" ||
1518 test "$linkmode,$pass" = "prog,scan" ||
1519 { test $linkmode = oldlib
&& test $linkmode = obj
; }; then
1520 # Add dl[pre]opened files of deplib
1521 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
1522 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
1525 if test $pass = conv
; then
1526 # Only check for convenience libraries
1527 deplibs
="$lib $deplibs"
1528 if test -z "$libdir"; then
1529 if test -z "$old_library"; then
1530 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1533 # It is a libtool convenience library, so add in its objects.
1534 convenience
="$convenience $ladir/$objdir/$old_library"
1535 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1537 for deplib
in $dependency_libs; do
1538 deplibs
="$deplib $deplibs"
1539 case "$tmp_libs " in
1540 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1542 tmp_libs
="$tmp_libs $deplib"
1544 elif test $linkmode != prog
&& test $linkmode != lib
; then
1545 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1551 # Get the name of the library we link against.
1553 for l
in $old_library $library_names; do
1556 if test -z "$linklib"; then
1557 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1561 # This library was specified with -dlopen.
1562 if test $pass = dlopen
; then
1563 if test -z "$libdir"; then
1564 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1567 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1568 # If there is no dlname, no dlopen support or we're linking
1569 # statically, we need to preload.
1570 dlprefiles
="$dlprefiles $lib"
1572 newdlfiles
="$newdlfiles $lib"
1577 # We need an absolute path.
1579 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1581 abs_ladir
=`cd "$ladir" && pwd`
1582 if test -z "$abs_ladir"; then
1583 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1584 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1589 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1591 # Find the relevant object directory and library name.
1592 if test "X$installed" = Xyes
; then
1593 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1594 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1603 dir
="$ladir/$objdir"
1604 absdir
="$abs_ladir/$objdir"
1605 # Remove this search path later
1606 notinst_path
="$notinst_path $abs_ladir"
1607 fi # $installed = yes
1608 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1610 # This library was specified with -dlpreopen.
1611 if test $pass = dlpreopen
; then
1612 if test -z "$libdir"; then
1613 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1616 # Prefer using a static library (so that no silly _DYNAMIC symbols
1617 # are required to link).
1618 if test -n "$old_library"; then
1619 newdlprefiles
="$newdlprefiles $dir/$old_library"
1620 # Otherwise, use the dlname, so that lt_dlopen finds it.
1621 elif test -n "$dlname"; then
1622 newdlprefiles
="$newdlprefiles $dir/$dlname"
1624 newdlprefiles
="$newdlprefiles $dir/$linklib"
1626 fi # $pass = dlpreopen
1628 if test -z "$libdir"; then
1629 # Link the convenience library
1630 if test $linkmode = lib
; then
1631 deplibs
="$dir/$old_library $deplibs"
1632 elif test "$linkmode,$pass" = "prog,link"; then
1633 compile_deplibs
="$dir/$old_library $compile_deplibs"
1634 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
1636 deplibs
="$lib $deplibs"
1641 if test $linkmode = prog
&& test $pass != link
; then
1642 newlib_search_path
="$newlib_search_path $ladir"
1643 deplibs
="$lib $deplibs"
1646 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
1647 test "$build_libtool_libs" = no
; then
1652 for deplib
in $dependency_libs; do
1654 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1656 # Need to link against all dependency_libs?
1657 if test $linkalldeplibs = yes; then
1658 deplibs
="$deplib $deplibs"
1660 # Need to hardcode shared library paths
1661 # or/and link against static libraries
1662 newdependency_libs
="$deplib $newdependency_libs"
1664 case "$tmp_libs " in
1665 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1667 tmp_libs
="$tmp_libs $deplib"
1670 fi # $linkmode = prog...
1672 link_static
=no
# Whether the deplib will be linked statically
1673 if test -n "$library_names" &&
1674 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
1675 # Link against this shared library
1677 if test "$linkmode,$pass" = "prog,link" ||
1678 { test $linkmode = lib
&& test $hardcode_into_libs = yes; }; then
1679 # Hardcode the library path.
1680 # Skip directories that are in the system default run-time
1682 case " $sys_lib_dlsearch_path " in
1685 case "$compile_rpath " in
1687 *) compile_rpath
="$compile_rpath $absdir"
1691 case " $sys_lib_dlsearch_path " in
1694 case "$finalize_rpath " in
1696 *) finalize_rpath
="$finalize_rpath $libdir"
1700 if test $linkmode = prog
; then
1701 # We need to hardcode the library path
1702 if test -n "$shlibpath_var"; then
1703 # Make sure the rpath contains only unique directories.
1704 case "$temp_rpath " in
1707 *) temp_rpath
="$temp_rpath $dir" ;;
1711 fi # $linkmode,$pass = prog,link...
1713 if test "$alldeplibs" = yes &&
1714 { test "$deplibs_check_method" = pass_all ||
1715 { test "$build_libtool_libs" = yes &&
1716 test -n "$library_names"; }; }; then
1717 # We only need to search for static libraries
1721 if test "$installed" = no
; then
1722 notinst_deplibs
="$notinst_deplibs $lib"
1726 if test -n "$old_archive_from_expsyms_cmds"; then
1727 # figure out the soname
1728 set dummy
$library_names
1731 libname
=`eval \\$echo \"$libname_spec\"`
1732 # use dlname if we got it. it's perfectly good, no?
1733 if test -n "$dlname"; then
1735 elif test -n "$soname_spec"; then
1739 major
=`expr $current - $age`
1743 eval soname
=\"$soname_spec\"
1748 # Make a new name for the extract_expsyms_cmds to use
1750 soname
=`echo $soroot | sed -e 's/^.*\///'`
1751 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1753 # If the library has no export list, then create one now
1754 if test -f "$output_objdir/$soname-def"; then :
1756 $show "extracting exported symbol list from \`$soname'"
1757 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
1758 eval cmds
=\"$extract_expsyms_cmds\"
1759 for cmd
in $cmds; do
1762 $run eval "$cmd" ||
exit $?
1768 if test -f "$output_objdir/$newlib"; then :; else
1769 $show "generating import library for \`$soname'"
1770 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
1771 eval cmds
=\"$old_archive_from_expsyms_cmds\"
1772 for cmd
in $cmds; do
1775 $run eval "$cmd" ||
exit $?
1779 # make sure the library variables are pointing to the new library
1782 fi # test -n $old_archive_from_expsyms_cmds
1784 if test $linkmode = prog ||
test "$mode" != relink
; then
1789 case $hardcode_action in
1790 immediate | unsupported
)
1791 if test "$hardcode_direct" = no
; then
1793 elif test "$hardcode_minus_L" = no
; then
1795 *-*-sunos*) add_shlibpath
="$dir" ;;
1799 elif test "$hardcode_shlibpath_var" = no
; then
1800 add_shlibpath
="$dir"
1807 if test "$hardcode_direct" = yes; then
1809 elif test "$hardcode_minus_L" = yes; then
1812 elif test "$hardcode_shlibpath_var" = yes; then
1813 add_shlibpath
="$dir"
1822 if test "$lib_linked" != yes; then
1823 $echo "$modename: configuration error: unsupported hardcode properties"
1827 if test -n "$add_shlibpath"; then
1828 case :$compile_shlibpath: in
1829 *":$add_shlibpath:"*) ;;
1830 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
1833 if test $linkmode = prog
; then
1834 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
1835 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
1837 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
1838 test -n "$add" && deplibs
="$add $deplibs"
1839 if test "$hardcode_direct" != yes && \
1840 test "$hardcode_minus_L" != yes && \
1841 test "$hardcode_shlibpath_var" = yes; then
1842 case :$finalize_shlibpath: in
1844 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
1850 if test $linkmode = prog ||
test "$mode" = relink
; then
1854 # Finalize command for both is simple: just hardcode it.
1855 if test "$hardcode_direct" = yes; then
1856 add
="$libdir/$linklib"
1857 elif test "$hardcode_minus_L" = yes; then
1860 elif test "$hardcode_shlibpath_var" = yes; then
1861 case :$finalize_shlibpath: in
1863 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
1867 # We cannot seem to hardcode it, guess we'll fake it.
1872 if test $linkmode = prog
; then
1873 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
1874 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
1876 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
1877 test -n "$add" && deplibs
="$add $deplibs"
1880 elif test $linkmode = prog
; then
1881 if test "$alldeplibs" = yes &&
1882 { test "$deplibs_check_method" = pass_all ||
1883 { test "$build_libtool_libs" = yes &&
1884 test -n "$library_names"; }; }; then
1885 # We only need to search for static libraries
1889 # Try to link the static library
1890 # Here we assume that one of hardcode_direct or hardcode_minus_L
1891 # is not unsupported. This is valid on all known static and
1893 if test "$hardcode_direct" != unsupported
; then
1894 test -n "$old_library" && linklib
="$old_library"
1895 compile_deplibs
="$dir/$linklib $compile_deplibs"
1896 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
1898 compile_deplibs
="-l$name -L$dir $compile_deplibs"
1899 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
1901 elif test "$build_libtool_libs" = yes; then
1902 # Not a shared library
1903 if test "$deplibs_check_method" != pass_all
; then
1904 # We're trying link a shared library against a static one
1905 # but the system doesn't support it.
1907 # Just print a warning and add the library to dependency_libs so
1908 # that the program can be linked against the static library.
1910 echo "*** Warning: This library needs some functionality provided by $lib."
1911 echo "*** I have the capability to make that library automatically link in when"
1912 echo "*** you link to this library. But I can only do this if you have a"
1913 echo "*** shared version of the library, which you do not appear to have."
1914 if test "$module" = yes; then
1915 echo "*** Therefore, libtool will create a static module, that should work "
1916 echo "*** as long as the dlopening application is linked with the -dlopen flag."
1917 if test -z "$global_symbol_pipe"; then
1919 echo "*** However, this would only work if libtool was able to extract symbol"
1920 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1921 echo "*** not find such a program. So, this module is probably useless."
1922 echo "*** \`nm' from GNU binutils and a full rebuild may help."
1924 if test "$build_old_libs" = no
; then
1925 build_libtool_libs
=module
1928 build_libtool_libs
=no
1932 convenience
="$convenience $dir/$old_library"
1933 old_convenience
="$old_convenience $dir/$old_library"
1934 deplibs
="$dir/$old_library $deplibs"
1937 fi # link shared/static library?
1939 if test $linkmode = lib
; then
1940 if test -n "$dependency_libs" &&
1941 { test $hardcode_into_libs != yes ||
test $build_old_libs = yes ||
1942 test $link_static = yes; }; then
1943 # Extract -R from dependency_libs
1945 for libdir
in $dependency_libs; do
1947 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1949 *" $temp_xrpath "*) ;;
1950 *) xrpath
="$xrpath $temp_xrpath";;
1952 *) temp_deplibs
="$temp_deplibs $libdir";;
1955 dependency_libs
="$temp_deplibs"
1958 newlib_search_path
="$newlib_search_path $absdir"
1959 # Link against this library
1960 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
1961 # ... and its dependency_libs
1963 for deplib
in $dependency_libs; do
1964 newdependency_libs
="$deplib $newdependency_libs"
1965 case "$tmp_libs " in
1966 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1968 tmp_libs
="$tmp_libs $deplib"
1971 if test $link_all_deplibs != no
; then
1972 # Add the search paths of all dependency libraries
1973 for deplib
in $dependency_libs; do
1975 -L*) path
="$deplib" ;;
1977 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
1978 test "X$dir" = "X$deplib" && dir
="."
1979 # We need an absolute path.
1981 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
1983 absdir
=`cd "$dir" && pwd`
1984 if test -z "$absdir"; then
1985 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1990 if grep "^installed=no" $deplib > /dev
/null
; then
1991 path
="-L$absdir/$objdir"
1993 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
1994 if test -z "$libdir"; then
1995 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
1998 if test "$absdir" != "$libdir"; then
1999 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2006 case " $deplibs " in
2008 *) deplibs
="$deplibs $path" ;;
2011 fi # link_all_deplibs != no
2013 done # for deplib in $libs
2014 if test $pass = dlpreopen
; then
2015 # Link the dlpreopened libraries before other libraries
2016 for deplib
in $save_deplibs; do
2017 deplibs
="$deplib $deplibs"
2020 if test $pass != dlopen
; then
2021 test $pass != scan
&& dependency_libs
="$newdependency_libs"
2022 if test $pass != conv
; then
2023 # Make sure lib_search_path contains only unique directories.
2025 for dir
in $newlib_search_path; do
2026 case "$lib_search_path " in
2028 *) lib_search_path
="$lib_search_path $dir" ;;
2034 if test "$linkmode,$pass" != "prog,link"; then
2037 vars
="compile_deplibs finalize_deplibs"
2039 for var
in $vars dependency_libs
; do
2040 # Add libraries to $var in reverse order
2041 eval tmp_libs
=\"\$
$var\"
2043 for deplib
in $tmp_libs; do
2045 -L*) new_libs
="$deplib $new_libs" ;;
2047 case " $specialdeplibs " in
2048 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2050 case " $new_libs " in
2052 *) new_libs
="$deplib $new_libs" ;;
2060 for deplib
in $new_libs; do
2063 case " $tmp_libs " in
2065 *) tmp_libs
="$tmp_libs $deplib" ;;
2068 *) tmp_libs
="$tmp_libs $deplib" ;;
2071 eval $var=\"$tmp_libs\"
2074 if test "$pass" = "conv" &&
2075 { test "$linkmode" = "lib" ||
test "$linkmode" = "prog"; }; then
2076 libs
="$deplibs" # reset libs
2080 if test $linkmode = prog
; then
2081 dlfiles
="$newdlfiles"
2082 dlprefiles
="$newdlprefiles"
2087 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2088 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2091 if test -n "$rpath"; then
2092 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2095 if test -n "$xrpath"; then
2096 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2099 if test -n "$vinfo"; then
2100 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2103 if test -n "$release"; then
2104 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2107 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2108 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2111 # Now set the variables for building old libraries.
2112 build_libtool_libs
=no
2114 objs
="$objs$old_deplibs"
2118 # Make sure we only generate libraries of the form `libNAME.la'.
2121 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2122 eval libname
=\"$libname_spec\"
2125 if test "$module" = no
; then
2126 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2130 if test "$need_lib_prefix" != no
; then
2131 # Add the "lib" prefix for modules if required
2132 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2133 eval libname
=\"$libname_spec\"
2135 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2140 if test -n "$objs"; then
2141 if test "$deplibs_check_method" != pass_all
; then
2142 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2146 echo "*** Warning: Linking the shared library $output against the non-libtool"
2147 echo "*** objects $objs is not portable!"
2148 libobjs
="$libobjs $objs"
2152 if test "$dlself" != no
; then
2153 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2157 if test $# -gt 2; then
2158 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2163 if test -z "$rpath"; then
2164 if test "$build_libtool_libs" = yes; then
2165 # Building a libtool convenience library.
2167 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2168 build_libtool_libs
=convenience
2172 if test -n "$vinfo"; then
2173 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2176 if test -n "$release"; then
2177 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2181 # Parse the version information argument.
2182 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
2183 set dummy
$vinfo 0 0 0
2186 if test -n "$8"; then
2187 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2196 # Check that each of the things are valid numbers.
2198 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2200 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2201 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2207 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2209 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2210 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2216 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2218 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2219 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2224 if test $age -gt $current; then
2225 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2226 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2230 # Calculate the version variables.
2234 case $version_type in
2238 # Like Linux, but with the current version available in
2239 # verstring for coding it into the library header
2240 major
=.
`expr $current - $age`
2241 versuffix
="$major.$age.$revision"
2242 # Darwin ld doesn't like 0 for these options...
2243 minor_current
=`expr $current + 1`
2244 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2249 versuffix
=".$current.$revision";
2254 versuffix
=".$current";
2258 major
=`expr $current - $age + 1`
2259 verstring
="sgi$major.$revision"
2261 # Add in all the interfaces that we are compatible with.
2263 while test $loop != 0; do
2264 iface
=`expr $revision - $loop`
2265 loop
=`expr $loop - 1`
2266 verstring
="sgi$major.$iface:$verstring"
2269 # Before this point, $major must not contain `.'.
2271 versuffix
="$major.$revision"
2275 major
=.
`expr $current - $age`
2276 versuffix
="$major.$age.$revision"
2280 major
=`expr $current - $age`
2281 versuffix
=".$current.$age.$revision"
2282 verstring
="$current.$age.$revision"
2284 # Add in all the interfaces that we are compatible with.
2286 while test $loop != 0; do
2287 iface
=`expr $current - $loop`
2288 loop
=`expr $loop - 1`
2289 verstring
="$verstring:${iface}.0"
2292 # Make executables depend on our current version.
2293 verstring
="$verstring:${current}.0"
2298 versuffix
=".$current.$revision"
2302 # Use '-' rather than '.', since we only want one
2303 # extension on DOS 8.3 filesystems.
2304 major
=`expr $current - $age`
2309 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2310 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2315 # Clear the version info if we defaulted, and they specified a release.
2316 if test -z "$vinfo" && test -n "$release"; then
2319 if test "$need_version" = no
; then
2326 # Remove version info from name if versioning should be avoided
2327 if test "$avoid_version" = yes && test "$need_version" = no
; then
2333 # Check to see if the archive will have undefined symbols.
2334 if test "$allow_undefined" = yes; then
2335 if test "$allow_undefined_flag" = unsupported
; then
2336 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2337 build_libtool_libs
=no
2341 # Don't allow undefined symbols.
2342 allow_undefined_flag
="$no_undefined_flag"
2346 if test "$mode" != relink
; then
2347 # Remove our outputs.
2348 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2349 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.
*
2352 # Now set the variables for building old libraries.
2353 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2354 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2356 # Transform .lo files to .o files.
2357 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2360 # Eliminate all temporary directories.
2361 for path
in $notinst_path; do
2362 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2363 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2364 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2367 if test -n "$xrpath"; then
2368 # If the user specified any rpath flags, then add them.
2370 for libdir
in $xrpath; do
2371 temp_xrpath
="$temp_xrpath -R$libdir"
2372 case "$finalize_rpath " in
2374 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2377 if test $hardcode_into_libs != yes ||
test $build_old_libs = yes; then
2378 dependency_libs
="$temp_xrpath $dependency_libs"
2382 # Make sure dlfiles contains only unique files that won't be dlpreopened
2383 old_dlfiles
="$dlfiles"
2385 for lib
in $old_dlfiles; do
2386 case " $dlprefiles $dlfiles " in
2388 *) dlfiles
="$dlfiles $lib" ;;
2392 # Make sure dlprefiles contains only unique files
2393 old_dlprefiles
="$dlprefiles"
2395 for lib
in $old_dlprefiles; do
2396 case "$dlprefiles " in
2398 *) dlprefiles
="$dlprefiles $lib" ;;
2402 if test "$build_libtool_libs" = yes; then
2403 if test -n "$rpath"; then
2405 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
2406 # these systems don't actually have a c library (as such)!
2408 *-*-rhapsody* |
*-*-darwin1.
[012])
2409 # Rhapsody C library is in the System framework
2410 deplibs
="$deplibs -framework System"
2413 # Don't link with libc until the a.out ld.so is fixed.
2416 # Add libc to deplibs on all other systems if necessary.
2417 if test $build_libtool_need_lc = "yes"; then
2418 deplibs
="$deplibs -lc"
2424 # Transform deplibs into only deplibs that can be linked in shared.
2426 libname_save
=$libname
2427 release_save
=$release
2428 versuffix_save
=$versuffix
2430 # I'm not sure if I'm treating the release correctly. I think
2431 # release should show up in the -l (ie -lgmp5) so we don't want to
2432 # add it in twice. Is that correct?
2438 case $deplibs_check_method in
2440 # Don't check for shared/static. Everything works.
2441 # This might be a little naive. We might want to check
2442 # whether the library exists or not. But this is on
2443 # osf3 & osf4 and I'm not really sure... Just
2444 # implementing what was already the behaviour.
2448 # This code stresses the "libraries are programs" paradigm to its
2449 # limits. Maybe even breaks it. We compile a program, linking it
2450 # against the deplibs as a proxy for the library. Then we can check
2451 # whether they linked in statically or dynamically with ldd.
2453 cat > conftest.c
<<EOF
2454 int main() { return 0; }
2457 $CC -o conftest conftest.c
$deplibs
2458 if test $?
-eq 0 ; then
2459 ldd_output
=`ldd conftest`
2460 for i
in $deplibs; do
2461 name
="`expr $i : '-l\(.*\)'`"
2462 # If $name is empty we are operating on a -L argument.
2463 if test -n "$name" && test "$name" != "0"; then
2464 libname
=`eval \\$echo \"$libname_spec\"`
2465 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2466 set dummy
$deplib_matches
2468 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2469 newdeplibs
="$newdeplibs $i"
2473 echo "*** Warning: This library needs some functionality provided by $i."
2474 echo "*** I have the capability to make that library automatically link in when"
2475 echo "*** you link to this library. But I can only do this if you have a"
2476 echo "*** shared version of the library, which you do not appear to have."
2479 newdeplibs
="$newdeplibs $i"
2483 # Error occured in the first compile. Let's try to salvage the situation:
2484 # Compile a seperate program for each library.
2485 for i
in $deplibs; do
2486 name
="`expr $i : '-l\(.*\)'`"
2487 # If $name is empty we are operating on a -L argument.
2488 if test -n "$name" && test "$name" != "0"; then
2490 $CC -o conftest conftest.c
$i
2492 if test $?
-eq 0 ; then
2493 ldd_output
=`ldd conftest`
2494 libname
=`eval \\$echo \"$libname_spec\"`
2495 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2496 set dummy
$deplib_matches
2498 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2499 newdeplibs
="$newdeplibs $i"
2503 echo "*** Warning: This library needs some functionality provided by $i."
2504 echo "*** I have the capability to make that library automatically link in when"
2505 echo "*** you link to this library. But I can only do this if you have a"
2506 echo "*** shared version of the library, which you do not appear to have."
2511 echo "*** Warning! Library $i is needed by this library but I was not able to"
2512 echo "*** make it link in! You will probably need to install it or some"
2513 echo "*** library that it depends on before this library will be fully"
2514 echo "*** functional. Installing it before continuing would be even better."
2517 newdeplibs
="$newdeplibs $i"
2523 set dummy
$deplibs_check_method
2524 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2525 for a_deplib
in $deplibs; do
2526 name
="`expr $a_deplib : '-l\(.*\)'`"
2527 # If $name is empty we are operating on a -L argument.
2528 if test -n "$name" && test "$name" != "0"; then
2529 libname
=`eval \\$echo \"$libname_spec\"`
2530 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2531 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2532 for potent_lib
in $potential_libs; do
2533 # Follow soft links.
2534 if ls -lLd "$potent_lib" 2>/dev
/null \
2535 |
grep " -> " >/dev
/null
; then
2538 # The statement above tries to avoid entering an
2539 # endless loop below, in case of cyclic links.
2540 # We might still enter an endless loop, since a link
2541 # loop can be closed while we follow links,
2543 potlib
="$potent_lib"
2544 while test -h "$potlib" 2>/dev
/null
; do
2545 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2547 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2548 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2551 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
2553 |
egrep "$file_magic_regex" > /dev
/null
; then
2554 newdeplibs
="$newdeplibs $a_deplib"
2560 if test -n "$a_deplib" ; then
2563 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2564 echo "*** I have the capability to make that library automatically link in when"
2565 echo "*** you link to this library. But I can only do this if you have a"
2566 echo "*** shared version of the library, which you do not appear to have."
2569 # Add a -L argument.
2570 newdeplibs
="$newdeplibs $a_deplib"
2572 done # Gone through all deplibs.
2575 set dummy
$deplibs_check_method
2576 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2577 for a_deplib
in $deplibs; do
2578 name
="`expr $a_deplib : '-l\(.*\)'`"
2579 # If $name is empty we are operating on a -L argument.
2580 if test -n "$name" && test "$name" != "0"; then
2581 libname
=`eval \\$echo \"$libname_spec\"`
2582 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2583 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2584 for potent_lib
in $potential_libs; do
2585 if eval echo \"$potent_lib\" 2>/dev
/null \
2587 |
egrep "$match_pattern_regex" > /dev
/null
; then
2588 newdeplibs
="$newdeplibs $a_deplib"
2594 if test -n "$a_deplib" ; then
2597 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2598 echo "*** I have the capability to make that library automatically link in when"
2599 echo "*** you link to this library. But I can only do this if you have a"
2600 echo "*** shared version of the library, which you do not appear to have."
2603 # Add a -L argument.
2604 newdeplibs
="$newdeplibs $a_deplib"
2606 done # Gone through all deplibs.
2610 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
2611 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2612 grep .
>/dev
/null
; then
2614 if test "X$deplibs_check_method" = "Xnone"; then
2615 echo "*** Warning: inter-library dependencies are not supported in this platform."
2617 echo "*** Warning: inter-library dependencies are not known to be supported."
2619 echo "*** All declared inter-library dependencies are being dropped."
2624 versuffix
=$versuffix_save
2626 release
=$release_save
2627 libname
=$libname_save
2631 *-*-rhapsody* |
*-*-darwin1.
[012])
2632 # On Rhapsody replace the C library is the System framework
2633 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2637 if test "$droppeddeps" = yes; then
2638 if test "$module" = yes; then
2640 echo "*** Warning: libtool could not satisfy all declared inter-library"
2641 echo "*** dependencies of module $libname. Therefore, libtool will create"
2642 echo "*** a static module, that should work as long as the dlopening"
2643 echo "*** application is linked with the -dlopen flag."
2644 if test -z "$global_symbol_pipe"; then
2646 echo "*** However, this would only work if libtool was able to extract symbol"
2647 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2648 echo "*** not find such a program. So, this module is probably useless."
2649 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2651 if test "$build_old_libs" = no
; then
2652 oldlibs
="$output_objdir/$libname.$libext"
2653 build_libtool_libs
=module
2656 build_libtool_libs
=no
2659 echo "*** The inter-library dependencies that have been dropped here will be"
2660 echo "*** automatically added whenever a program is linked with this library"
2661 echo "*** or is declared to -dlopen it."
2663 if test $allow_undefined = no
; then
2665 echo "*** Since this library must not contain undefined symbols,"
2666 echo "*** because either the platform does not support them or"
2667 echo "*** it was explicitly requested with -no-undefined,"
2668 echo "*** libtool will only create a static version of it."
2669 if test "$build_old_libs" = no
; then
2670 oldlibs
="$output_objdir/$libname.$libext"
2671 build_libtool_libs
=module
2674 build_libtool_libs
=no
2679 # Done checking deplibs!
2683 # All the library-specific variables (install_libdir is set above).
2688 # Test again, we may have decided not to build it any more
2689 if test "$build_libtool_libs" = yes; then
2690 if test $hardcode_into_libs = yes; then
2691 # Hardcode the library paths
2694 rpath
="$finalize_rpath"
2695 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
2696 for libdir
in $rpath; do
2697 if test -n "$hardcode_libdir_flag_spec"; then
2698 if test -n "$hardcode_libdir_separator"; then
2699 if test -z "$hardcode_libdirs"; then
2700 hardcode_libdirs
="$libdir"
2702 # Just accumulate the unique libdirs.
2703 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
2704 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2707 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2712 eval flag
=\"$hardcode_libdir_flag_spec\"
2713 dep_rpath
="$dep_rpath $flag"
2715 elif test -n "$runpath_var"; then
2716 case "$perm_rpath " in
2718 *) perm_rpath
="$perm_rpath $libdir" ;;
2722 # Substitute the hardcoded libdirs into the rpath.
2723 if test -n "$hardcode_libdir_separator" &&
2724 test -n "$hardcode_libdirs"; then
2725 libdir
="$hardcode_libdirs"
2726 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
2728 if test -n "$runpath_var" && test -n "$perm_rpath"; then
2729 # We should set the runpath_var.
2731 for dir
in $perm_rpath; do
2734 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2736 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
2739 shlibpath
="$finalize_shlibpath"
2740 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
2741 if test -n "$shlibpath"; then
2742 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2745 # Get the real and link names of the library.
2746 eval library_names
=\"$library_names_spec\"
2747 set dummy
$library_names
2751 if test -n "$soname_spec"; then
2752 eval soname
=\"$soname_spec\"
2756 test -z "$dlname" && dlname
=$soname
2758 lib
="$output_objdir/$realname"
2761 linknames
="$linknames $link"
2764 # Ensure that we have .o objects for linkers which dislike .lo
2765 # (e.g. aix) in case we are running --disable-static
2766 for obj
in $libobjs; do
2767 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2768 if test "X$xdir" = "X$obj"; then
2773 baseobj
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2774 oldobj
=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2775 if test ! -f $xdir/$oldobj; then
2776 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2777 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' ||
exit $?
2781 # Use standard objects if they are pic
2782 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2784 # Prepare the list of exported symbols
2785 if test -z "$export_symbols"; then
2786 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
2787 $show "generating symbol list for \`$libname.la'"
2788 export_symbols
="$output_objdir/$libname.exp"
2789 $run $rm $export_symbols
2790 eval cmds
=\"$export_symbols_cmds\"
2791 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2792 for cmd
in $cmds; do
2795 $run eval "$cmd" ||
exit $?
2798 if test -n "$export_symbols_regex"; then
2799 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2800 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2801 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2802 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2807 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2808 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2811 if test -n "$convenience"; then
2812 if test -n "$whole_archive_flag_spec"; then
2813 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
2815 gentop
="$output_objdir/${outputname}x"
2816 $show "${rm}r $gentop"
2817 $run ${rm}r
"$gentop"
2818 $show "mkdir $gentop"
2819 $run mkdir
"$gentop"
2821 if test $status -ne 0 && test ! -d "$gentop"; then
2824 generated
="$generated $gentop"
2826 for xlib
in $convenience; do
2827 # Extract the objects.
2829 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
2830 *) xabs
=`pwd`"/$xlib" ;;
2832 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2833 xdir
="$gentop/$xlib"
2835 $show "${rm}r $xdir"
2840 if test $status -ne 0 && test ! -d "$xdir"; then
2843 $show "(cd $xdir && $AR x $xabs)"
2844 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
2846 libobjs
="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2851 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2852 eval flag
=\"$thread_safe_flag_spec\"
2853 linker_flags
="$linker_flags $flag"
2856 # Make a backup of the uninstalled library when relinking
2857 if test "$mode" = relink
; then
2858 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
2861 # Do each of the archive commands.
2862 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2863 eval cmds
=\"$archive_expsym_cmds\"
2865 eval cmds
=\"$archive_cmds\"
2867 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2868 for cmd
in $cmds; do
2871 $run eval "$cmd" ||
exit $?
2875 # Restore the uninstalled library and exit
2876 if test "$mode" = relink
; then
2877 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
2881 # Create links to the real library.
2882 for linkname
in $linknames; do
2883 if test "$realname" != "$linkname"; then
2884 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2885 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
2889 # If -module or -export-dynamic was specified, set the dlname.
2890 if test "$module" = yes ||
test "$export_dynamic" = yes; then
2891 # On all known operating systems, these are identical.
2898 if test -n "$deplibs"; then
2899 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2902 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2903 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2906 if test -n "$rpath"; then
2907 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2910 if test -n "$xrpath"; then
2911 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2914 if test -n "$vinfo"; then
2915 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2918 if test -n "$release"; then
2919 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2924 if test -n "$objs$old_deplibs"; then
2925 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2929 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
2937 # Delete the old objects.
2938 $run $rm $obj $libobj
2940 # Objects from convenience libraries. This assumes
2941 # single-version convenience libraries. Whenever we create
2942 # different ones for PIC/non-PIC, this we'll have to duplicate
2946 # reload_cmds runs $LD directly, so let us get rid of
2947 # -Wl from whole_archive_flag_spec
2950 if test -n "$convenience"; then
2951 if test -n "$whole_archive_flag_spec"; then
2952 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
2954 gentop
="$output_objdir/${obj}x"
2955 $show "${rm}r $gentop"
2956 $run ${rm}r
"$gentop"
2957 $show "mkdir $gentop"
2958 $run mkdir
"$gentop"
2960 if test $status -ne 0 && test ! -d "$gentop"; then
2963 generated
="$generated $gentop"
2965 for xlib
in $convenience; do
2966 # Extract the objects.
2968 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
2969 *) xabs
=`pwd`"/$xlib" ;;
2971 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2972 xdir
="$gentop/$xlib"
2974 $show "${rm}r $xdir"
2979 if test $status -ne 0 && test ! -d "$xdir"; then
2982 $show "(cd $xdir && $AR x $xabs)"
2983 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
2985 reload_conv_objs
="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2990 # Create the old-style object.
2991 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
2994 eval cmds
=\"$reload_cmds\"
2995 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2996 for cmd
in $cmds; do
2999 $run eval "$cmd" ||
exit $?
3003 # Exit if we aren't doing a library object file.
3004 if test -z "$libobj"; then
3005 if test -n "$gentop"; then
3006 $show "${rm}r $gentop"
3013 if test "$build_libtool_libs" != yes; then
3014 if test -n "$gentop"; then
3015 $show "${rm}r $gentop"
3019 # Create an invalid libtool object if no PIC, so that we don't
3020 # accidentally link it into a program.
3021 $show "echo timestamp > $libobj"
3022 $run eval "echo timestamp > $libobj" ||
exit $?
3026 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3027 # Only do commands if we really have different PIC objects.
3028 reload_objs
="$libobjs $reload_conv_objs"
3030 eval cmds
=\"$reload_cmds\"
3031 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3032 for cmd
in $cmds; do
3035 $run eval "$cmd" ||
exit $?
3039 # Just create a symlink.
3042 xdir
=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3043 if test "X$xdir" = "X$libobj"; then
3048 baseobj
=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3049 oldobj
=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3050 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3051 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' ||
exit $?
3054 if test -n "$gentop"; then
3055 $show "${rm}r $gentop"
3064 *cygwin
*) output
=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3066 if test -n "$vinfo"; then
3067 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3070 if test -n "$release"; then
3071 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3074 if test "$preload" = yes; then
3075 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3076 test "$dlopen_self_static" = unknown
; then
3077 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3082 *-*-rhapsody* |
*-*-darwin1.
[012])
3083 # On Rhapsody replace the C library is the System framework
3084 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3085 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3089 compile_command
="$compile_command $compile_deplibs"
3090 finalize_command
="$finalize_command $finalize_deplibs"
3092 if test -n "$rpath$xrpath"; then
3093 # If the user specified any rpath flags, then add them.
3094 for libdir
in $rpath $xrpath; do
3095 # This is the magic to use -rpath.
3096 case "$finalize_rpath " in
3098 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3103 # Now hardcode the library paths
3106 for libdir
in $compile_rpath $finalize_rpath; do
3107 if test -n "$hardcode_libdir_flag_spec"; then
3108 if test -n "$hardcode_libdir_separator"; then
3109 if test -z "$hardcode_libdirs"; then
3110 hardcode_libdirs
="$libdir"
3112 # Just accumulate the unique libdirs.
3113 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3114 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3117 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3122 eval flag
=\"$hardcode_libdir_flag_spec\"
3123 rpath
="$rpath $flag"
3125 elif test -n "$runpath_var"; then
3126 case "$perm_rpath " in
3128 *) perm_rpath
="$perm_rpath $libdir" ;;
3132 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3133 case :$dllsearchpath: in
3135 *) dllsearchpath
="$dllsearchpath:$libdir";;
3140 # Substitute the hardcoded libdirs into the rpath.
3141 if test -n "$hardcode_libdir_separator" &&
3142 test -n "$hardcode_libdirs"; then
3143 libdir
="$hardcode_libdirs"
3144 eval rpath
=\" $hardcode_libdir_flag_spec\"
3146 compile_rpath
="$rpath"
3150 for libdir
in $finalize_rpath; do
3151 if test -n "$hardcode_libdir_flag_spec"; then
3152 if test -n "$hardcode_libdir_separator"; then
3153 if test -z "$hardcode_libdirs"; then
3154 hardcode_libdirs
="$libdir"
3156 # Just accumulate the unique libdirs.
3157 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3158 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3161 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3166 eval flag
=\"$hardcode_libdir_flag_spec\"
3167 rpath
="$rpath $flag"
3169 elif test -n "$runpath_var"; then
3170 case "$finalize_perm_rpath " in
3172 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
3176 # Substitute the hardcoded libdirs into the rpath.
3177 if test -n "$hardcode_libdir_separator" &&
3178 test -n "$hardcode_libdirs"; then
3179 libdir
="$hardcode_libdirs"
3180 eval rpath
=\" $hardcode_libdir_flag_spec\"
3182 finalize_rpath
="$rpath"
3184 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3185 # Transform all the library objects into standard objects.
3186 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3187 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3191 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3192 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3193 dlsyms
="${outputname}S.c"
3195 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3199 if test -n "$dlsyms"; then
3203 # Discover the nlist of each of the dlfiles.
3204 nlist
="$output_objdir/${outputname}.nm"
3206 $show "$rm $nlist ${nlist}S ${nlist}T"
3207 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3209 # Parse the name list into a source file.
3210 $show "creating $output_objdir/$dlsyms"
3212 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3213 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3214 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3220 /* Prevent the only kind of declaration conflicts we can make. */
3221 #define lt_preloaded_symbols some_other_symbol
3223 /* External symbol declarations for the compiler. */\
3226 if test "$dlself" = yes; then
3227 $show "generating symbol list for \`$output'"
3229 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3231 # Add our own program objects to the symbol list.
3232 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3233 for arg
in $progfiles; do
3234 $show "extracting global C symbols from \`$arg'"
3235 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3238 if test -n "$exclude_expsyms"; then
3239 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3240 $run eval '$mv "$nlist"T "$nlist"'
3243 if test -n "$export_symbols_regex"; then
3244 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3245 $run eval '$mv "$nlist"T "$nlist"'
3248 # Prepare the list of exported symbols
3249 if test -z "$export_symbols"; then
3250 export_symbols
="$output_objdir/$output.exp"
3251 $run $rm $export_symbols
3252 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3254 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3255 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3256 $run eval 'mv "$nlist"T "$nlist"'
3260 for arg
in $dlprefiles; do
3261 $show "extracting global C symbols from \`$arg'"
3262 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3263 $run eval 'echo ": $name " >> "$nlist"'
3264 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3267 if test -z "$run"; then
3268 # Make sure we have at least an empty file.
3269 test -f "$nlist" ||
: > "$nlist"
3271 if test -n "$exclude_expsyms"; then
3272 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3273 $mv "$nlist"T
"$nlist"
3276 # Try sorting and uniquifying the output.
3277 if grep -v "^: " < "$nlist" |
sort +2 |
uniq > "$nlist"S
; then
3280 grep -v "^: " < "$nlist" > "$nlist"S
3283 if test -f "$nlist"S
; then
3284 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3286 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3289 $echo >> "$output_objdir/$dlsyms" "\
3291 #undef lt_preloaded_symbols
3293 #if defined (__STDC__) && __STDC__
3294 # define lt_ptr_t void *
3296 # define lt_ptr_t char *
3300 /* The mapping between symbol names and symbols. */
3305 lt_preloaded_symbols[] =
3309 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3310 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3311 < "$nlist" >> "$output_objdir/$dlsyms"
3313 $echo >> "$output_objdir/$dlsyms" "\
3317 /* This works around a problem in FreeBSD linker */
3318 #ifdef FREEBSD_WORKAROUND
3319 static const void *lt_preloaded_setup() {
3320 return lt_preloaded_symbols;
3330 pic_flag_for_symtable
=
3332 # compiling the symbol table file with pic_flag works around
3333 # a FreeBSD bug that causes programs to crash when -lm is
3334 # linked before any other PIC object. But we must not use
3335 # pic_flag when linking with -static. The problem exists in
3336 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3337 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3338 case "$compile_command " in
3340 *) pic_flag_for_symtable
=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3343 case "$compile_command " in
3345 *) pic_flag_for_symtable
=" $pic_flag -DPIC";;
3349 # Now compile the dynamic symbol file.
3350 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3351 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3353 # Clean up the generated files.
3354 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3355 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3357 # Transform the symbol file into the correct name.
3358 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3359 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3362 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3367 # We keep going just in case the user didn't refer to
3368 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3369 # really was required.
3371 # Nullify the symbol file.
3372 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3373 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3376 if test $need_relink = no ||
test "$build_libtool_libs" != yes; then
3377 # Replace the output file specification.
3378 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3379 link_command
="$compile_command$compile_rpath"
3381 # We have no uninstalled library dependencies, so finalize right now.
3382 $show "$link_command"
3383 $run eval "$link_command"
3386 # Delete the generated files.
3387 if test -n "$dlsyms"; then
3388 $show "$rm $output_objdir/${outputname}S.${objext}"
3389 $run $rm "$output_objdir/${outputname}S.${objext}"
3395 if test -n "$shlibpath_var"; then
3396 # We should set the shlibpath_var
3398 for dir
in $temp_rpath; do
3400 [\\/]* |
[A-Za-z
]:[\\/]*)
3405 # Relative path: add a thisdir entry.
3406 rpath
="$rpath\$thisdir/$dir:"
3413 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3414 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3416 if test -n "$finalize_shlibpath"; then
3417 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3422 if test -n "$runpath_var"; then
3423 if test -n "$perm_rpath"; then
3424 # We should set the runpath_var.
3426 for dir
in $perm_rpath; do
3429 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3431 if test -n "$finalize_perm_rpath"; then
3432 # We should set the runpath_var.
3434 for dir
in $finalize_perm_rpath; do
3437 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3441 if test "$no_install" = yes; then
3442 # We don't need to create a wrapper script.
3443 link_command
="$compile_var$compile_command$compile_rpath"
3444 # Replace the output file specification.
3445 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3446 # Delete the old output file.
3448 # Link the executable and exit
3449 $show "$link_command"
3450 $run eval "$link_command" ||
exit $?
3454 if test "$hardcode_action" = relink
; then
3455 # Fast installation is not supported
3456 link_command
="$compile_var$compile_command$compile_rpath"
3457 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3459 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3460 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3462 if test "$fast_install" != no
; then
3463 link_command
="$finalize_var$compile_command$finalize_rpath"
3464 if test "$fast_install" = yes; then
3465 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3467 # fast_install is set to needless
3471 link_command
="$compile_var$compile_command$compile_rpath"
3472 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3476 # Replace the output file specification.
3477 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3479 # Delete the old output files.
3480 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
3482 $show "$link_command"
3483 $run eval "$link_command" ||
exit $?
3485 # Now create the wrapper script.
3486 $show "creating $output"
3488 # Quote the relink command for shipping.
3489 if test -n "$relink_command"; then
3490 # Preserve any variables that may affect compiler behavior
3491 for var
in $variables_saved_for_relink; do
3492 if eval test -z \"\
${$var+set}\"; then
3493 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3494 elif eval var_value
=\$
$var; test -z "$var_value"; then
3495 relink_command
="$var=; export $var; $relink_command"
3497 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3498 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
3501 relink_command
="cd `pwd`; $relink_command"
3502 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3505 # Quote $echo for shipping.
3506 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3508 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
3509 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
3511 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3513 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3516 # Only actually do things if our run command is non-null.
3517 if test -z "$run"; then
3518 # win32 will think the script is a binary if it has
3519 # a .exe suffix, so we strip it off here.
3521 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
3523 # test for cygwin because mv fails w/o .exe extensions
3525 *cygwin
*) exeext
=.exe
;;
3529 trap "$rm $output; exit 1" 1 2 15
3534 # $output - temporary wrapper script for $objdir/$outputname
3535 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3537 # The $output program cannot be directly executed until all the libtool
3538 # libraries that it depends on are installed.
3540 # This wrapper script should never be moved out of the build directory.
3541 # If it is, it will not operate correctly.
3543 # Sed substitution that helps us do robust quoting. It backslashifies
3544 # metacharacters that are still active within double-quoted strings.
3545 Xsed='sed -e 1s/^X//'
3546 sed_quote_subst='$sed_quote_subst'
3548 # The HP-UX ksh and POSIX shell print the target directory to stdout
3550 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3552 relink_command=\"$relink_command\"
3554 # This environment variable determines our operation mode.
3555 if test \"\$libtool_install_magic\" = \"$magic\"; then
3556 # install mode needs the following variable:
3557 notinst_deplibs='$notinst_deplibs'
3559 # When we are sourced in execute mode, \$file and \$echo are already set.
3560 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3563 # Make sure echo works.
3564 if test \"X\$1\" = X--no-reexec; then
3565 # Discard the --no-reexec flag, and continue.
3567 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3568 # Yippee, \$echo works!
3571 # Restart under the correct shell, and then maybe \$echo will work.
3572 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3578 # Find the directory that this script lives in.
3579 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3580 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3582 # Follow symbolic links until we get to the real thisdir.
3583 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3584 while test -n \"\$file\"; do
3585 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3587 # If there was a directory component, then change thisdir.
3588 if test \"x\$destdir\" != \"x\$file\"; then
3589 case \"\$destdir\" in
3590 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3591 *) thisdir=\"\$thisdir/\$destdir\" ;;
3595 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3596 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3599 # Try to get the absolute directory name.
3600 absdir=\`cd \"\$thisdir\" && pwd\`
3601 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3604 if test "$fast_install" = yes; then
3606 program=lt-'$outputname'$exeext
3607 progdir=\"\$thisdir/$objdir\"
3609 if test ! -f \"\$progdir/\$program\" || \\
3610 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3611 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3613 file=\"\$\$-\$program\"
3615 if test ! -d \"\$progdir\"; then
3616 $mkdir \"\$progdir\"
3618 $rm \"\$progdir/\$file\"
3623 # relink executable if necessary
3624 if test -n \"\$relink_command\"; then
3625 if (eval \$relink_command); then :
3627 $rm \"\$progdir/\$file\"
3632 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3633 { $rm \"\$progdir/\$program\";
3634 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3635 $rm \"\$progdir/\$file\"
3639 program='$outputname'
3640 progdir=\"\$thisdir/$objdir\"
3646 if test -f \"\$progdir/\$program\"; then"
3648 # Export our shlibpath_var if we have one.
3649 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3651 # Add our own library path to $shlibpath_var
3652 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3654 # Some systems cannot cope with colon-terminated $shlibpath_var
3655 # The second colon is a workaround for a bug in BeOS R4 sed
3656 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3658 export $shlibpath_var
3662 # fixup the dll searchpath if we need to.
3663 if test -n "$dllsearchpath"; then
3665 # Add the dll search path components to the executable PATH
3666 PATH=$dllsearchpath:\$PATH
3671 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3672 # Run the actual program with our arguments.
3675 # win32 systems need to use the prog path for dll
3677 *-*-cygwin* |
*-*-pw32*)
3679 exec \$progdir/\$program \${1+\"\$@\"}
3683 # Backslashes separate directories on plain windows
3684 *-*-mingw |
*-*-os2*)
3686 exec \$progdir\\\\\$program \${1+\"\$@\"}
3692 # Export the path to the program.
3693 PATH=\"\$progdir:\$PATH\"
3696 exec \$program \${1+\"\$@\"}
3701 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3705 # The program doesn't exist.
3706 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3707 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3708 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3719 # See if we need to build an old-fashioned archive.
3720 for oldlib
in $oldlibs; do
3722 if test "$build_libtool_libs" = convenience
; then
3723 oldobjs
="$libobjs_save"
3724 addlibs
="$convenience"
3725 build_libtool_libs
=no
3727 if test "$build_libtool_libs" = module
; then
3728 oldobjs
="$libobjs_save"
3729 build_libtool_libs
=no
3731 oldobjs
="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3733 addlibs
="$old_convenience"
3736 if test -n "$addlibs"; then
3737 gentop
="$output_objdir/${outputname}x"
3738 $show "${rm}r $gentop"
3739 $run ${rm}r
"$gentop"
3740 $show "mkdir $gentop"
3741 $run mkdir
"$gentop"
3743 if test $status -ne 0 && test ! -d "$gentop"; then
3746 generated
="$generated $gentop"
3748 # Add in members from convenience archives.
3749 for xlib
in $addlibs; do
3750 # Extract the objects.
3752 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3753 *) xabs
=`pwd`"/$xlib" ;;
3755 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3756 xdir
="$gentop/$xlib"
3758 $show "${rm}r $xdir"
3763 if test $status -ne 0 && test ! -d "$xdir"; then
3766 $show "(cd $xdir && $AR x $xabs)"
3767 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3769 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3773 # Do each command in the archive commands.
3774 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3775 eval cmds
=\"$old_archive_from_new_cmds\"
3777 # Ensure that we have .o objects in place in case we decided
3778 # not to build a shared library, and have fallen back to building
3779 # static libs even though --disable-static was passed!
3780 for oldobj
in $oldobjs; do
3781 if test ! -f $oldobj; then
3782 xdir
=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3783 if test "X$xdir" = "X$oldobj"; then
3788 baseobj
=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3789 obj
=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3790 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3791 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' ||
exit $?
3795 eval cmds
=\"$old_archive_cmds\"
3797 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3798 for cmd
in $cmds; do
3801 $run eval "$cmd" ||
exit $?
3806 if test -n "$generated"; then
3807 $show "${rm}r$generated"
3808 $run ${rm}r
$generated
3811 # Now create the libtool archive.
3815 test "$build_old_libs" = yes && old_library
="$libname.$libext"
3816 $show "creating $output"
3818 # Preserve any variables that may affect compiler behavior
3819 for var
in $variables_saved_for_relink; do
3820 if eval test -z \"\
${$var+set}\"; then
3821 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3822 elif eval var_value
=\$
$var; test -z "$var_value"; then
3823 relink_command
="$var=; export $var; $relink_command"
3825 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3826 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
3829 # Quote the link command for shipping.
3830 relink_command
="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
3831 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3833 # Only create the output if not a dry run.
3834 if test -z "$run"; then
3835 for installed
in no
yes; do
3836 if test "$installed" = yes; then
3837 if test -z "$install_libdir"; then
3840 output
="$output_objdir/$outputname"i
3841 # Replace all uninstalled libtool libraries with the installed ones
3843 for deplib
in $dependency_libs; do
3846 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3847 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3848 if test -z "$libdir"; then
3849 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3852 newdependency_libs
="$newdependency_libs $libdir/$name"
3854 *) newdependency_libs
="$newdependency_libs $deplib" ;;
3857 dependency_libs
="$newdependency_libs"
3859 for lib
in $dlfiles; do
3860 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3861 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3862 if test -z "$libdir"; then
3863 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3866 newdlfiles
="$newdlfiles $libdir/$name"
3868 dlfiles
="$newdlfiles"
3870 for lib
in $dlprefiles; do
3871 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3872 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3873 if test -z "$libdir"; then
3874 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3877 newdlprefiles
="$newdlprefiles $libdir/$name"
3879 dlprefiles
="$newdlprefiles"
3882 # place dlname in correct position for cygwin
3884 case $host,$output,$installed,$module,$dlname in
3885 *cygwin
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
3888 # $outputname - a libtool library file
3889 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3891 # Please DO NOT delete this file!
3892 # It is necessary for linking the library.
3894 # The name that we can dlopen(3).
3897 # Names of this library.
3898 library_names='$library_names'
3900 # The name of the static archive.
3901 old_library='$old_library'
3903 # Libraries that this one depends upon.
3904 dependency_libs='$dependency_libs'
3906 # Version information for $libname.
3911 # Is this an already installed library?
3912 installed=$installed
3914 # Files to dlopen/dlpreopen
3916 dlpreopen='$dlprefiles'
3918 # Directory that this library needs to be installed in:
3919 libdir='$install_libdir'"
3920 if test "$installed" = no
&& test $need_relink = yes; then
3922 relink_command=\"$relink_command\""
3927 # Do a symbolic link so that the libtool archive can be found in
3928 # LD_LIBRARY_PATH before the program is installed.
3929 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3930 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
3936 # libtool install mode
3938 modename
="$modename: install"
3940 # There may be an optional sh(1) argument at the beginning of
3941 # install_prog (especially on Windows NT).
3942 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
3943 # Allow the use of GNU shtool's install command.
3944 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
3945 # Aesthetically quote it.
3946 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3948 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3952 install_prog
="$arg "
3960 # The real first argument should be the name of the installation program.
3961 # Aesthetically quote it.
3962 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3964 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3968 install_prog
="$install_prog$arg"
3970 # We need to accept at least all the BSD install flags.
3980 if test -n "$dest"; then
3981 files
="$files $dest"
3999 # If the previous option needed an argument, then skip it.
4000 if test -n "$prev"; then
4009 # Aesthetically quote the argument.
4010 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4012 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4016 install_prog
="$install_prog $arg"
4019 if test -z "$install_prog"; then
4020 $echo "$modename: you must specify an install program" 1>&2
4025 if test -n "$prev"; then
4026 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4031 if test -z "$files"; then
4032 if test -z "$dest"; then
4033 $echo "$modename: no file or destination specified" 1>&2
4035 $echo "$modename: you must specify a destination" 1>&2
4041 # Strip any trailing slash from the destination.
4042 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4044 # Check to see that the destination is a directory.
4045 test -d "$dest" && isdir
=yes
4046 if test "$isdir" = yes; then
4050 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4051 test "X$destdir" = "X$dest" && destdir
=.
4052 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4054 # Not a directory, so check to see that there is only one file specified.
4056 if test $# -gt 2; then
4057 $echo "$modename: \`$dest' is not a directory" 1>&2
4063 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
4065 for file in $files; do
4069 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4078 # This variable tells wrapper scripts just to set variables rather
4079 # than running their programs.
4080 libtool_install_magic
="$magic"
4085 for file in $files; do
4087 # Do each installation.
4090 # Do the static libraries later.
4091 staticlibs
="$staticlibs $file"
4095 # Check to see that this really is a libtool archive.
4096 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4098 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4106 # If there is no directory component, then add one.
4108 */* |
*\\*) .
$file ;;
4112 # Add the libdir to current_libdirs if it is the destination.
4113 if test "X$destdir" = "X$libdir"; then
4114 case "$current_libdirs " in
4116 *) current_libdirs
="$current_libdirs $libdir" ;;
4119 # Note the libdir as a future libdir.
4120 case "$future_libdirs " in
4122 *) future_libdirs
="$future_libdirs $libdir" ;;
4126 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4127 test "X$dir" = "X$file/" && dir
=
4130 if test -n "$relink_command"; then
4131 $echo "$modename: warning: relinking \`$file'" 1>&2
4132 $show "$relink_command"
4133 if $run eval "$relink_command"; then :
4135 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4140 # See the names of the shared library.
4141 set dummy
$library_names
4142 if test -n "$2"; then
4148 test -n "$relink_command" && srcname
="$realname"T
4150 # Install the shared library and build the symlinks.
4151 $show "$install_prog $dir/$srcname $destdir/$realname"
4152 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
4153 if test -n "$stripme" && test -n "$striplib"; then
4154 $show "$striplib $destdir/$realname"
4155 $run eval "$striplib $destdir/$realname" ||
exit $?
4158 if test $# -gt 0; then
4159 # Delete the old symlinks, and create new ones.
4162 if test "$linkname" != "$realname"; then
4163 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4164 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4169 # Do each command in the postinstall commands.
4170 lib
="$destdir/$realname"
4171 eval cmds
=\"$postinstall_cmds\"
4172 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4173 for cmd
in $cmds; do
4176 $run eval "$cmd" ||
exit $?
4181 # Install the pseudo-library for information purposes.
4182 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4183 instname
="$dir/$name"i
4184 $show "$install_prog $instname $destdir/$name"
4185 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
4187 # Maybe install the static library, too.
4188 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
4192 # Install (i.e. copy) a libtool object.
4194 # Figure out destination file name, if it wasn't already specified.
4195 if test -n "$destname"; then
4196 destfile
="$destdir/$destname"
4198 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4199 destfile
="$destdir/$destfile"
4202 # Deduce the name of the destination old-style object file.
4205 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4208 staticdest
="$destfile"
4212 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4218 # Install the libtool object if requested.
4219 if test -n "$destfile"; then
4220 $show "$install_prog $file $destfile"
4221 $run eval "$install_prog $file $destfile" ||
exit $?
4224 # Install the old object if enabled.
4225 if test "$build_old_libs" = yes; then
4226 # Deduce the name of the old-style object file.
4227 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
4229 $show "$install_prog $staticobj $staticdest"
4230 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
4236 # Figure out destination file name, if it wasn't already specified.
4237 if test -n "$destname"; then
4238 destfile
="$destdir/$destname"
4240 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4241 destfile
="$destdir/$destfile"
4244 # Do a test to see if this is really a libtool program.
4245 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4249 # If there is no directory component, then add one.
4251 */* |
*\\*) .
$file ;;
4255 # Check the variables that should have been set.
4256 if test -z "$notinst_deplibs"; then
4257 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4262 for lib
in $notinst_deplibs; do
4263 # Check to see that each library is installed.
4265 if test -f "$lib"; then
4266 # If there is no directory component, then add one.
4268 */* |
*\\*) .
$lib ;;
4272 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4273 if test -n "$libdir" && test ! -f "$libfile"; then
4274 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4280 # If there is no directory component, then add one.
4282 */* |
*\\*) .
$file ;;
4287 if test "$fast_install" = no
&& test -n "$relink_command"; then
4288 if test "$finalize" = yes && test -z "$run"; then
4290 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
4291 tmpdir
="$tmpdir/libtool-$$"
4292 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4294 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4297 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4298 outputname
="$tmpdir/$file"
4299 # Replace the output file specification.
4300 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4302 $show "$relink_command"
4303 if $run eval "$relink_command"; then :
4305 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4311 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4314 # Install the binary that we compiled earlier.
4315 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4319 # remove .exe since cygwin /usr/bin/install will append another
4321 case $install_prog,$host in
4322 /usr
/bin
/install*,*cygwin
*)
4323 case $file:$destfile in
4328 destfile
=$destfile.exe
4331 destfile
=`echo $destfile | sed -e 's,.exe$,,'`
4336 $show "$install_prog$stripme $file $destfile"
4337 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
4338 test -n "$outputname" && ${rm}r
"$tmpdir"
4343 for file in $staticlibs; do
4344 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4346 # Set up the ranlib parameters.
4347 oldlib
="$destdir/$name"
4349 $show "$install_prog $file $oldlib"
4350 $run eval "$install_prog \$file \$oldlib" ||
exit $?
4352 if test -n "$stripme" && test -n "$striplib"; then
4353 $show "$old_striplib $oldlib"
4354 $run eval "$old_striplib $oldlib" ||
exit $?
4357 # Do each command in the postinstall commands.
4358 eval cmds
=\"$old_postinstall_cmds\"
4359 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4360 for cmd
in $cmds; do
4363 $run eval "$cmd" ||
exit $?
4368 if test -n "$future_libdirs"; then
4369 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4372 if test -n "$current_libdirs"; then
4373 # Maybe just do a dry run.
4374 test -n "$run" && current_libdirs
=" -n$current_libdirs"
4375 exec $SHELL $0 --finish$current_libdirs
4382 # libtool finish mode
4384 modename
="$modename: finish"
4388 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4391 libdirs
="$libdirs $dir"
4394 for libdir
in $libdirs; do
4395 if test -n "$finish_cmds"; then
4396 # Do each command in the finish commands.
4397 eval cmds
=\"$finish_cmds\"
4398 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4399 for cmd
in $cmds; do
4402 $run eval "$cmd" || admincmds
="$admincmds
4407 if test -n "$finish_eval"; then
4408 # Do the single finish_eval.
4409 eval cmds
=\"$finish_eval\"
4410 $run eval "$cmds" || admincmds
="$admincmds
4416 # Exit here if they wanted silent mode.
4417 test "$show" = ":" && exit 0
4419 echo "----------------------------------------------------------------------"
4420 echo "Libraries have been installed in:"
4421 for libdir
in $libdirs; do
4425 echo "If you ever happen to want to link against installed libraries"
4426 echo "in a given directory, LIBDIR, you must either use libtool, and"
4427 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4428 echo "flag during linking and do at least one of the following:"
4429 if test -n "$shlibpath_var"; then
4430 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4431 echo " during execution"
4433 if test -n "$runpath_var"; then
4434 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4435 echo " during linking"
4437 if test -n "$hardcode_libdir_flag_spec"; then
4439 eval flag
=\"$hardcode_libdir_flag_spec\"
4441 echo " - use the \`$flag' linker flag"
4443 if test -n "$admincmds"; then
4444 echo " - have your system administrator run these commands:$admincmds"
4446 if test -f /etc
/ld.so.conf
; then
4447 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4450 echo "See any operating system documentation about shared libraries for"
4451 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4452 echo "----------------------------------------------------------------------"
4456 # libtool execute mode
4458 modename
="$modename: execute"
4460 # The first argument is the command name.
4462 if test -z "$cmd"; then
4463 $echo "$modename: you must specify a COMMAND" 1>&2
4468 # Handle -dlopen flags immediately.
4469 for file in $execute_dlfiles; do
4470 if test ! -f "$file"; then
4471 $echo "$modename: \`$file' is not a file" 1>&2
4479 # Check to see that this really is a libtool archive.
4480 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4482 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4487 # Read the libtool library.
4491 # If there is no directory component, then add one.
4493 */* |
*\\*) .
$file ;;
4497 # Skip this library if it cannot be dlopened.
4498 if test -z "$dlname"; then
4499 # Warn if it was a shared library.
4500 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4504 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4505 test "X$dir" = "X$file" && dir
=.
4507 if test -f "$dir/$objdir/$dlname"; then
4510 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4516 # Just add the directory containing the .lo file.
4517 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4518 test "X$dir" = "X$file" && dir
=.
4522 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4527 # Get the absolute pathname.
4528 absdir
=`cd "$dir" && pwd`
4529 test -n "$absdir" && dir
="$absdir"
4531 # Now add the directory to shlibpath_var.
4532 if eval "test -z \"\$$shlibpath_var\""; then
4533 eval "$shlibpath_var=\"\$dir\""
4535 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4539 # This variable tells wrapper scripts just to set shlibpath_var
4540 # rather than running their programs.
4541 libtool_execute_magic
="$magic"
4543 # Check if any of the arguments is a wrapper script.
4550 # Do a test to see if this is really a libtool program.
4551 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4552 # If there is no directory component, then add one.
4554 */* |
*\\*) .
$file ;;
4558 # Transform arg to wrapped name.
4559 file="$progdir/$program"
4563 # Quote arguments (to preserve shell metacharacters).
4564 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4565 args
="$args \"$file\""
4568 if test -z "$run"; then
4569 if test -n "$shlibpath_var"; then
4570 # Export the shlibpath_var.
4571 eval "export $shlibpath_var"
4574 # Restore saved enviroment variables
4575 if test "${save_LC_ALL+set}" = set; then
4576 LC_ALL
="$save_LC_ALL"; export LC_ALL
4578 if test "${save_LANG+set}" = set; then
4579 LANG
="$save_LANG"; export LANG
4582 # Now actually exec the command.
4583 eval "exec \$cmd$args"
4585 $echo "$modename: cannot exec \$cmd$args"
4588 # Display what would be done.
4589 if test -n "$shlibpath_var"; then
4590 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4591 $echo "export $shlibpath_var"
4598 # libtool clean and uninstall mode
4600 modename
="$modename: $mode"
4606 # This variable tells wrapper scripts just to set variables rather
4607 # than running their programs.
4608 libtool_install_magic
="$magic"
4613 -f) rm="$rm $arg"; rmforce
=yes ;;
4614 -*) rm="$rm $arg" ;;
4615 *) files
="$files $arg" ;;
4619 if test -z "$rm"; then
4620 $echo "$modename: you must specify an RM program" 1>&2
4627 for file in $files; do
4628 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4629 if test "X$dir" = "X$file"; then
4633 objdir
="$dir/$objdir"
4635 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4636 test $mode = uninstall
&& objdir
="$dir"
4638 # Remember objdir for removal later, being careful to avoid duplicates
4639 if test $mode = clean
; then
4642 *) rmdirs
="$rmdirs $objdir" ;;
4646 # Don't error if the file doesn't exist and rm -f was used.
4647 if (test -L "$file") >/dev
/null
2>&1 \
4648 ||
(test -h "$file") >/dev
/null
2>&1 \
4649 ||
test -f "$file"; then
4651 elif test -d "$file"; then
4654 elif test "$rmforce" = yes; then
4662 # Possibly a libtool archive, so verify it.
4663 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4666 # Delete the libtool libraries and symlinks.
4667 for n
in $library_names; do
4668 rmfiles
="$rmfiles $objdir/$n"
4670 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
4671 test $mode = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
4673 if test $mode = uninstall
; then
4674 if test -n "$library_names"; then
4675 # Do each command in the postuninstall commands.
4676 eval cmds
=\"$postuninstall_cmds\"
4677 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4678 for cmd
in $cmds; do
4682 if test $?
!= 0 && test "$rmforce" != yes; then
4689 if test -n "$old_library"; then
4690 # Do each command in the old_postuninstall commands.
4691 eval cmds
=\"$old_postuninstall_cmds\"
4692 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4693 for cmd
in $cmds; do
4697 if test $?
!= 0 && test "$rmforce" != yes; then
4703 # FIXME: should reinstall the best remaining shared library.
4709 if test "$build_old_libs" = yes; then
4710 oldobj
=`$echo "X$name" | $Xsed -e "$lo2o"`
4711 rmfiles
="$rmfiles $dir/$oldobj"
4716 # Do a test to see if this is a libtool program.
4717 if test $mode = clean
&&
4718 (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4722 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4723 if test "$fast_install" = yes && test -n "$relink_command"; then
4724 rmfiles
="$rmfiles $objdir/lt-$name"
4729 $show "$rm $rmfiles"
4730 $run $rm $rmfiles || exit_status
=1
4733 # Try to remove the ${objdir}s in the directories where we deleted files
4734 for dir
in $rmdirs; do
4735 if test -d "$dir"; then
4737 $run rmdir $dir >/dev
/null
2>&1
4745 $echo "$modename: you must specify a MODE" 1>&2
4746 $echo "$generic_help" 1>&2
4751 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4752 $echo "$generic_help" 1>&2
4754 fi # test -z "$show_help"
4756 # We need to display help for each of the modes.
4759 "Usage: $modename [OPTION]... [MODE-ARG]...
4761 Provide generalized library-building support services.
4763 --config show all configuration variables
4764 --debug enable verbose shell tracing
4765 -n, --dry-run display commands without modifying any files
4766 --features display basic configuration information and exit
4767 --finish same as \`--mode=finish'
4768 --help display this help message and exit
4769 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4770 --quiet same as \`--silent'
4771 --silent don't print informational messages
4772 --version print version information
4774 MODE must be one of the following:
4776 clean remove files from the build directory
4777 compile compile a source file into a libtool object
4778 execute automatically set library path, then run a program
4779 finish complete the installation of libtool libraries
4780 install install libraries or executables
4781 link create a library or an executable
4782 uninstall remove libraries from an installed directory
4784 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4785 a more detailed description of MODE."
4791 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4793 Remove files from the build directory.
4795 RM is the name of the program to use to delete files associated with each FILE
4796 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4799 If FILE is a libtool library, object or program, all the files associated
4800 with it are deleted. Otherwise, only FILE itself is deleted using RM."
4805 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4807 Compile a source file into a libtool library object.
4809 This mode accepts the following additional options:
4811 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4812 -prefer-pic try to building PIC objects only
4813 -prefer-non-pic try to building non-PIC objects only
4814 -static always build a \`.o' file suitable for static linking
4816 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4817 from the given SOURCEFILE.
4819 The output file name is determined by removing the directory component from
4820 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4821 library object suffix, \`.lo'."
4826 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4828 Automatically set library path, then run a program.
4830 This mode accepts the following additional options:
4832 -dlopen FILE add the directory containing FILE to the library path
4834 This mode sets the library path environment variable according to \`-dlopen'
4837 If any of the ARGS are libtool executable wrappers, then they are translated
4838 into their corresponding uninstalled binary, and any of their required library
4839 directories are added to the library path.
4841 Then, COMMAND is executed, with ARGS as arguments."
4846 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4848 Complete the installation of libtool libraries.
4850 Each LIBDIR is a directory that contains libtool libraries.
4852 The commands that this mode executes may require superuser privileges. Use
4853 the \`--dry-run' option if you just want to see what would be executed."
4858 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4860 Install executables or libraries.
4862 INSTALL-COMMAND is the installation command. The first component should be
4863 either the \`install' or \`cp' program.
4865 The rest of the components are interpreted as arguments to that command (only
4866 BSD-compatible install options are recognized)."
4871 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4873 Link object files or libraries together to form another library, or to
4874 create an executable program.
4876 LINK-COMMAND is a command using the C compiler that you would use to create
4877 a program from several object files.
4879 The following components of LINK-COMMAND are treated specially:
4881 -all-static do not do any dynamic linking at all
4882 -avoid-version do not add a version suffix if possible
4883 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4884 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4885 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4886 -export-symbols SYMFILE
4887 try to export only the symbols listed in SYMFILE
4888 -export-symbols-regex REGEX
4889 try to export only the symbols matching REGEX
4890 -LLIBDIR search LIBDIR for required installed libraries
4891 -lNAME OUTPUT-FILE requires the installed library libNAME
4892 -module build a library that can dlopened
4893 -no-fast-install disable the fast-install mode
4894 -no-install link a not-installable executable
4895 -no-undefined declare that a library does not refer to external symbols
4896 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4897 -release RELEASE specify package release information
4898 -rpath LIBDIR the created library will eventually be installed in LIBDIR
4899 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4900 -static do not do any dynamic linking of libtool libraries
4901 -version-info CURRENT[:REVISION[:AGE]]
4902 specify library version info [each variable defaults to 0]
4904 All other options (arguments beginning with \`-') are ignored.
4906 Every other argument is treated as a filename. Files ending in \`.la' are
4907 treated as uninstalled libtool libraries, other files are standard or library
4910 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4911 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4912 required, except when creating a convenience library.
4914 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4915 using \`ar' and \`ranlib', or on Windows using \`lib'.
4917 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4918 is created, otherwise an executable program is created."
4923 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4925 Remove libraries from an installation directory.
4927 RM is the name of the program to use to delete files associated with each FILE
4928 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4931 If FILE is a libtool library, all the files associated with it are deleted.
4932 Otherwise, only FILE itself is deleted using RM."
4936 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4943 $echo "Try \`$modename --help' for more information about other modes."