3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by (GNU ccunit 1.1)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
8 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 # General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 # As a special exception to the GNU General Public License, if you
25 # distribute this file as part of a program that contains a
26 # configuration script generated by Autoconf, you may include it under
27 # the same distribution terms that you use for the rest of that program.
29 # A sed that does not truncate output.
32 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
33 Xsed="/usr/bin/sed -e s/^X//"
35 # The HP-UX ksh and POSIX shell print the target directory to stdout
37 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
39 # ### BEGIN LIBTOOL CONFIG
41 # Libtool was configured on host susan.mitocities.ne.jp:
43 # Shell to use when invoking shell scripts.
46 # Whether or not to build shared libraries.
47 build_libtool_libs=yes
49 # Whether or not to build static libraries.
52 # Whether or not to add -lc for building shared libraries.
53 build_libtool_need_lc=yes
55 # Whether or not to optimize for fast installation.
60 host=powerpc-apple-darwin6.8
62 # An echo program that does not interpret backslashes.
69 # The default C compiler.
72 # Is the compiler the GNU C compiler?
75 # The linker used to build libraries.
78 # Whether we need hard or soft links.
81 # A BSD-compatible nm program.
84 # A symbol stripping program
87 # Used to examine libraries when file_magic_cmd begins "file"
90 # Used on cygwin: DLL creation program.
93 # Used on cygwin: object dumper.
96 # Used on cygwin: assembler.
99 # The name of the directory that contains temporary libtool files.
102 # How to create reloadable object files.
104 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
106 # How to pass a linker flag through the compiler.
109 # Object file suffix (normally "o").
112 # Old archive suffix (normally "a").
115 # Executable file suffix (normally "").
118 # Additional compiler flags for building library objects.
119 pic_flag=" -fno-common"
122 # Does compiler simultaneously support -c and -o options?
125 # Can we write directly to a .lo ?
128 # Must we lock files when doing compilation ?
131 # Do we need the lib prefix for modules?
134 # Do we need a version for libraries?
137 # Whether dlopen is supported.
138 dlopen_support=unknown
140 # Whether dlopen of programs is supported.
143 # Whether dlopen of statically linked programs is supported.
144 dlopen_self_static=unknown
146 # Compiler flag to prevent dynamic linking.
149 # Compiler flag to turn off builtin functions.
150 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
152 # Compiler flag to allow reflexive dlopens.
153 export_dynamic_flag_spec=""
155 # Compiler flag to generate shared objects directly from archives.
156 whole_archive_flag_spec="-all_load \$convenience"
158 # Compiler flag to generate thread-safe objects.
159 thread_safe_flag_spec=""
161 # Library versioning type.
164 # Format of library name prefix.
165 libname_spec="lib\$name"
167 # List of archive names. First name is the real one, the rest are links.
168 # The last name is the one that the linker finds with -lNAME.
169 library_names_spec="\${libname}\${release}\${versuffix}.\$(test .\$module = .yes && echo so || echo dylib) \${libname}\${release}\${major}.\$(test .\$module = .yes && echo so || echo dylib) \${libname}.\$(test .\$module = .yes && echo so || echo dylib)"
171 # The coded name of the library, if different from the real name.
172 soname_spec="\${libname}\${release}\${major}.\$(test .\$module = .yes && echo so || echo dylib)"
174 # Commands used to build and install an old-style archive.
176 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
177 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
178 old_postuninstall_cmds=""
180 # Create an old-style archive from a shared archive.
181 old_archive_from_new_cmds=""
183 # Create a temporary old-style archive to link instead of a shared archive.
184 old_archive_from_expsyms_cmds=""
186 # Commands used to build and install a shared archive.
187 archive_cmds="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs && \$CC \$(test .\$module = .yes && echo -bundle || echo -dynamiclib) \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs\$linker_flags \$(test .\$module != .yes && echo -install_name \$rpath/\$soname \$verstring)"
188 archive_expsym_cmds=""
190 postuninstall_cmds=""
192 # Commands to strip libraries.
196 # Method to check whether dependent libraries are shared objects.
197 deplibs_check_method="file_magic Mach-O dynamically linked shared library"
199 # Command to use when deplibs_check_method == file_magic.
200 file_magic_cmd="/usr/bin/file -L"
202 # Flag that allows shared libraries with undefined symbols to be built.
203 allow_undefined_flag="-flat_namespace -undefined suppress"
205 # Flag that forces no undefined symbols.
208 # Commands used to finish a libtool library installation in a directory.
211 # Same as above, but a single script fragment to be evaled but not shown.
214 # Take the output of nm and produce a listing of raw symbols and C names.
215 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([BCDEGRST][BCDEGRST]*\\)[ ][ ]*\\(_\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
217 # Transform the output of nm in a proper C declaration
218 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
220 # Transform the output of nm in a C name address pair
221 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
223 # This is the shared library runtime path variable.
226 # This is the shared library path variable.
227 shlibpath_var=DYLD_LIBRARY_PATH
229 # Is shlibpath searched before the hard-coded library search path?
230 shlibpath_overrides_runpath=yes
232 # How to hardcode a shared library path into an executable.
233 hardcode_action=unsupported
235 # Whether we should hardcode library paths into libraries.
236 hardcode_into_libs=no
238 # Flag to hardcode $libdir into a binary during linking.
239 # This must work even if $libdir does not exist.
240 hardcode_libdir_flag_spec=""
242 # Whether we need a single -rpath flag with a separated argument.
243 hardcode_libdir_separator=""
245 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
249 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
253 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
254 # the resulting binary.
255 hardcode_shlibpath_var=no
257 # Variables whose values should be saved in libtool wrapper scripts and
258 # restored at relink time.
259 variables_saved_for_relink="PATH DYLD_LIBRARY_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
261 # Whether libtool must link a program against all its dependency libraries.
262 link_all_deplibs=unknown
264 # Compile-time system search path for libraries
265 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
267 # Run-time system search path for libraries
268 sys_lib_dlsearch_path_spec="/lib /usr/lib"
270 # Fix the shell variable $srcfile for the compiler.
273 # Set to yes if exported symbols are required.
274 always_export_symbols=no
276 # The commands to list exported symbols.
277 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
279 # The commands to extract the exported symbol list from a shared archive.
280 extract_expsyms_cmds=""
282 # Symbols that should not be listed in the preloaded symbols.
283 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
285 # Symbols that must always be exported.
288 # ### END LIBTOOL CONFIG
290 # ltmain.sh - Provide generalized library-building support services.
291 # NOTE: Changing this file will not affect anything until you rerun configure.
293 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
294 # Free Software Foundation, Inc.
295 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
297 # This program is free software; you can redistribute it and/or modify
298 # it under the terms of the GNU General Public License as published by
299 # the Free Software Foundation; either version 2 of the License, or
300 # (at your option) any later version.
302 # This program is distributed in the hope that it will be useful, but
303 # WITHOUT ANY WARRANTY; without even the implied warranty of
304 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
305 # General Public License for more details.
307 # You should have received a copy of the GNU General Public License
308 # along with this program; if not, write to the Free Software
309 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
311 # As a special exception to the GNU General Public License, if you
312 # distribute this file as part of a program that contains a
313 # configuration script generated by Autoconf, you may include it under
314 # the same distribution terms that you use for the rest of that program.
316 # Check that we have a working $echo.
317 if test "X$1" = X--no-reexec; then
318 # Discard the --no-reexec flag, and continue.
320 elif test "X$1" = X--fallback-echo; then
321 # Avoid inline document here, it may be left over
323 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
324 # Yippee, $echo works!
327 # Restart under the correct shell, and then maybe $echo will work.
328 exec $SHELL "$0" --no-reexec ${1+"$@"}
331 if test "X$1" = X--fallback-echo; then
332 # used as fallback echo
340 # The name of this program.
341 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
348 TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)"
351 help="Try \`$progname --help' for more information."
352 magic="%%%MAGIC variable%%%"
357 # Sed substitution that helps us do robust quoting. It backslashifies
358 # metacharacters that are still active within double-quoted strings.
359 Xsed="${SED}"' -e 1s/^X//'
360 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
361 # test EBCDIC or ASCII
362 case `echo A|od -x` in
363 *[Cc]1*) # EBCDIC based system
364 SP2NL="tr '\100' '\n'"
365 NL2SP="tr '\r\n' '\100\100'"
367 *) # Assume ASCII based system
368 SP2NL="tr '\040' '\012'"
369 NL2SP="tr '\015\012' '\040\040'"
374 # Only set LANG and LC_ALL to C if already set.
375 # These must not be set unconditionally because not all systems understand
376 # e.g. LANG=C (notably SCO).
377 # We save the old values to restore during execute mode.
378 if test "${LC_ALL+set}" = set; then
379 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
381 if test "${LANG+set}" = set; then
382 save_LANG="$LANG"; LANG=C; export LANG
385 # Make sure IFS has a sensible default
388 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
389 echo "$modename: not configured to build any kind of library" 1>&2
390 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
403 lo2o="s/\\.lo\$/.${objext}/"
404 o2lo="s/\\.${objext}\$/.lo/"
406 # Parse our command line options once, thoroughly.
413 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
417 # If the previous option needs an argument, assign it.
418 if test -n "$prev"; then
421 execute_dlfiles="$execute_dlfiles $arg"
433 # Have we seen a non-optional argument yet?
440 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
445 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
450 echo "$progname: enabling shell trace mode"
460 if test "$build_libtool_libs" = yes; then
461 echo "enable shared libraries"
463 echo "disable shared libraries"
465 if test "$build_old_libs" = yes; then
466 echo "enable static libraries"
468 echo "disable static libraries"
473 --finish) mode="finish" ;;
475 --mode) prevopt="--mode" prev=mode ;;
476 --mode=*) mode="$optarg" ;;
478 --preserve-dup-deps) duplicate_deps="yes" ;;
490 $echo "$modename: unrecognized option \`$arg'" 1>&2
502 if test -n "$prevopt"; then
503 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
508 # If this variable is set in any of the actions, the command in it
509 # will be execed at the end. This prevents here-documents from being
510 # left over by shells.
513 if test -z "$show_help"; then
515 # Infer the operation mode.
516 if test -z "$mode"; then
518 *cc | *++ | gcc* | *-gcc* | xlc*)
530 *db | *dbx | *strace | *truss)
540 # If we have no mode, but dlfiles were specified, then do execute mode.
541 test -n "$execute_dlfiles" && mode=execute
543 # Just use the default operation mode.
544 if test -z "$mode"; then
545 if test -n "$nonopt"; then
546 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
548 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
555 # Only execute mode is allowed to have -dlopen flags.
556 if test -n "$execute_dlfiles" && test "$mode" != execute; then
557 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
562 # Change the help message to a mode-specific one.
564 help="Try \`$modename --help --mode=$mode' for more information."
566 # These modes are in order of execution frequency so that they run quickly.
568 # libtool compile mode
570 modename="$modename: compile"
571 # Get the compilation command and the source file.
584 # Aesthetically quote the previous argument.
586 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
589 # Double-quote args containing other shell metacharacters.
590 # Many Bourne shells cannot handle close brackets correctly
591 # in scan sets, so we specify it separately.
592 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
597 # Add the previous argument to base_compile.
598 if test -z "$base_compile"; then
599 base_compile="$lastarg"
601 base_compile="$base_compile $lastarg"
607 # Accept any command-line options.
610 if test "$user_target" != "no"; then
611 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
638 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
640 save_ifs="$IFS"; IFS=','
644 # Double-quote args containing other shell metacharacters.
645 # Many Bourne shells cannot handle close brackets correctly
646 # in scan sets, so we specify it separately.
648 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
652 lastarg="$lastarg $arg"
655 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
657 # Add the arguments to base_compile.
658 if test -z "$base_compile"; then
659 base_compile="$lastarg"
661 base_compile="$base_compile $lastarg"
669 # The next one is the -o target name
674 # We got the output file
681 # Accept the current argument as the source file.
685 # Aesthetically quote the previous argument.
687 # Backslashify any backslashes, double quotes, and dollar signs.
688 # These are the only characters that are still specially
689 # interpreted inside of double-quoted scrings.
690 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
692 # Double-quote args containing other shell metacharacters.
693 # Many Bourne shells cannot handle close brackets correctly
694 # in scan sets, so we specify it separately.
696 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
697 lastarg="\"$lastarg\""
701 # Add the previous argument to base_compile.
702 if test -z "$base_compile"; then
703 base_compile="$lastarg"
705 base_compile="$base_compile $lastarg"
713 # Get the name of the library object.
714 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
717 $echo "$modename: you must specify a target with \`-o'" 1>&2
722 # Recognize several different file suffixes.
723 # If the user specifies -o file.o, it is replaced with file.lo
738 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
741 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
743 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
748 if test -z "$base_compile"; then
749 $echo "$modename: you must specify a compilation command" 1>&2
754 # Delete any leftover library objects.
755 if test "$build_old_libs" = yes; then
756 removelist="$obj $libobj"
762 trap "$run $rm $removelist; exit 1" 1 2 15
764 # On Cygwin there's no "real" PIC flag so we must build both object types
766 cygwin* | mingw* | pw32* | os2*)
770 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
771 # non-PIC code in shared libraries is not supported
775 # Calculate the filename of the output object if compiler does
776 # not support -o with -c
777 if test "$compiler_c_o" = no; then
778 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
779 lockfile="$output_obj.lock"
780 removelist="$removelist $output_obj $lockfile"
781 trap "$run $rm $removelist; exit 1" 1 2 15
787 # Lock this critical section if it is needed
788 # We use this script file to make the link, it avoids creating a new file
789 if test "$need_locks" = yes; then
790 until $run ln "$0" "$lockfile" 2>/dev/null; do
791 $show "Waiting for $lockfile to be removed"
794 elif test "$need_locks" = warn; then
795 if test -f "$lockfile"; then
797 *** ERROR, $lockfile exists and contains:
798 `cat $lockfile 2>/dev/null`
800 This indicates that another process is trying to use the same
801 temporary object file, and libtool could not work around it because
802 your compiler does not support \`-c' and \`-o' together. If you
803 repeat this compilation, it may succeed, by chance, but you had better
804 avoid parallel builds (make -j) in this platform, or get a better
810 echo $srcfile > "$lockfile"
813 if test -n "$fix_srcfile_path"; then
814 eval srcfile=\"$fix_srcfile_path\"
817 # Only build a PIC object if we are building libtool libraries.
818 if test "$build_libtool_libs" = yes; then
819 # Without this assignment, base_compile gets emptied.
820 fbsd_hideous_sh_bug=$base_compile
822 if test "$pic_mode" != no; then
823 # All platforms use -DPIC, to notify preprocessed assembler code.
824 command="$base_compile $srcfile $pic_flag -DPIC"
826 # Don't build PIC code
827 command="$base_compile $srcfile"
829 if test "$build_old_libs" = yes; then
831 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
832 if test "X$dir" = "X$libobj"; then
837 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
839 if test -d "$dir"; then
846 if test $status -ne 0 && test ! -d $dir; then
851 if test "$compiler_o_lo" = yes; then
853 command="$command -o $output_obj"
854 elif test "$compiler_c_o" = yes; then
856 command="$command -o $output_obj"
859 $run $rm "$output_obj"
861 if $run eval "$command"; then :
863 test -n "$output_obj" && $run $rm $removelist
867 if test "$need_locks" = warn &&
868 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
870 *** ERROR, $lockfile contains:
871 `cat $lockfile 2>/dev/null`
873 but it should contain:
876 This indicates that another process is trying to use the same
877 temporary object file, and libtool could not work around it because
878 your compiler does not support \`-c' and \`-o' together. If you
879 repeat this compilation, it may succeed, by chance, but you had better
880 avoid parallel builds (make -j) in this platform, or get a better
887 # Just move the object if needed, then go on to compile the next one
888 if test x"$output_obj" != x"$libobj"; then
889 $show "$mv $output_obj $libobj"
890 if $run $mv $output_obj $libobj; then :
898 # If we have no pic_flag, then copy the object into place and finish.
899 if (test -z "$pic_flag" || test "$pic_mode" != default) &&
900 test "$build_old_libs" = yes; then
901 # Rename the .lo from within objdir to obj
902 if test -f $obj; then
907 $show "$mv $libobj $obj"
908 if $run $mv $libobj $obj; then :
915 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
916 if test "X$xdir" = "X$obj"; then
921 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
922 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
923 # Now arrange that obj and lo_libobj become the same file
924 $show "(cd $xdir && $LN_S $baseobj $libobj)"
925 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
926 # Unlock the critical section if it was locked
927 if test "$need_locks" != no; then
938 # Allow error messages only from the first compilation.
939 suppress_output=' >/dev/null 2>&1'
942 # Only build a position-dependent object if we build old libraries.
943 if test "$build_old_libs" = yes; then
944 if test "$pic_mode" != yes; then
945 # Don't build PIC code
946 command="$base_compile $srcfile"
948 # All platforms use -DPIC, to notify preprocessed assembler code.
949 command="$base_compile $srcfile $pic_flag -DPIC"
951 if test "$compiler_c_o" = yes; then
952 command="$command -o $obj"
956 # Suppress compiler output if we already did a PIC compilation.
957 command="$command$suppress_output"
958 $run $rm "$output_obj"
960 if $run eval "$command"; then :
966 if test "$need_locks" = warn &&
967 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
969 *** ERROR, $lockfile contains:
970 `cat $lockfile 2>/dev/null`
972 but it should contain:
975 This indicates that another process is trying to use the same
976 temporary object file, and libtool could not work around it because
977 your compiler does not support \`-c' and \`-o' together. If you
978 repeat this compilation, it may succeed, by chance, but you had better
979 avoid parallel builds (make -j) in this platform, or get a better
986 # Just move the object if needed
987 if test x"$output_obj" != x"$obj"; then
988 $show "$mv $output_obj $obj"
989 if $run $mv $output_obj $obj; then :
997 # Create an invalid libtool object if no PIC, so that we do not
998 # accidentally link it into a program.
999 if test "$build_libtool_libs" != yes; then
1000 $show "echo timestamp > $libobj"
1001 $run eval "echo timestamp > \$libobj" || exit $?
1003 # Move the .lo from within objdir
1004 $show "$mv $libobj $lo_libobj"
1005 if $run $mv $libobj $lo_libobj; then :
1008 $run $rm $removelist
1014 # Unlock the critical section if it was locked
1015 if test "$need_locks" != no; then
1016 $run $rm "$lockfile"
1024 modename="$modename: link"
1026 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1027 # It is impossible to link a dll without this setting, and
1028 # we shouldn't force the makefile maintainer to figure out
1029 # which system we are compiling for in order to pass an extra
1030 # flag for every libtool invokation.
1031 # allow_undefined=no
1033 # FIXME: Unfortunately, there are problems with the above when trying
1034 # to make a dll which has undefined symbols, in which case not
1035 # even a static library is built. For now, we need to specify
1036 # -no-undefined on the libtool link line when we can be certain
1037 # that all symbols are satisfied, otherwise we get a static library.
1044 libtool_args="$nonopt"
1045 compile_command="$nonopt"
1046 finalize_command="$nonopt"
1059 lib_search_path=`pwd`
1067 export_symbols_regex=
1074 prefer_static_libs=no
1086 # We need to know -static, to get the right output filenames.
1090 -all-static | -static)
1091 if test "X$arg" = "X-all-static"; then
1092 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1093 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1095 if test -n "$link_static_flag"; then
1096 dlopen_self=$dlopen_self_static
1099 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1100 dlopen_self=$dlopen_self_static
1103 build_libtool_libs=no
1105 prefer_static_libs=yes
1111 # See if our shared archives depend on static archives.
1112 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1114 # Go through the arguments, transforming them on the way.
1115 while test $# -gt 0; do
1119 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1120 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1124 libtool_args="$libtool_args $qarg"
1126 # If the previous option needs an argument, assign it.
1127 if test -n "$prev"; then
1130 compile_command="$compile_command @OUTPUT@"
1131 finalize_command="$finalize_command @OUTPUT@"
1137 if test "$preload" = no; then
1138 # Add the symbol object into the linking commands.
1139 compile_command="$compile_command @SYMFILE@"
1140 finalize_command="$finalize_command @SYMFILE@"
1144 *.la | *.lo) ;; # We handle these cases below.
1146 if test "$dlself" = no; then
1154 if test "$prev" = dlprefiles; then
1156 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1166 if test "$prev" = dlfiles; then
1167 dlfiles="$dlfiles $arg"
1169 dlprefiles="$dlprefiles $arg"
1177 export_symbols="$arg"
1178 if test ! -f "$arg"; then
1179 $echo "$modename: symbol file \`$arg' does not exist"
1186 export_symbols_regex="$arg"
1196 # We need an absolute path.
1198 [\\/]* | [A-Za-z]:[\\/]*) ;;
1200 $echo "$modename: only absolute run-paths are allowed" 1>&2
1204 if test "$prev" = rpath; then
1207 *) rpath="$rpath $arg" ;;
1212 *) xrpath="$xrpath $arg" ;;
1219 compiler_flags="$compiler_flags $qarg"
1221 compile_command="$compile_command $qarg"
1222 finalize_command="$finalize_command $qarg"
1226 linker_flags="$linker_flags $qarg"
1227 compiler_flags="$compiler_flags $wl$qarg"
1229 compile_command="$compile_command $wl$qarg"
1230 finalize_command="$finalize_command $wl$qarg"
1234 eval "$prev=\"\$arg\""
1245 if test -n "$link_static_flag"; then
1246 compile_command="$compile_command $link_static_flag"
1247 finalize_command="$finalize_command $link_static_flag"
1253 # FIXME: remove this flag sometime in the future.
1254 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1278 -export-symbols | -export-symbols-regex)
1279 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1280 $echo "$modename: more than one -exported-symbols argument is not allowed"
1283 if test "X$arg" = "X-export-symbols"; then
1291 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1292 # so, if we see these flags be careful not to treat them like -L
1294 case $with_gcc/$host in
1295 no/*-*-irix* | no/*-*-nonstopux*)
1296 compile_command="$compile_command $arg"
1297 finalize_command="$finalize_command $arg"
1304 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1305 # We need an absolute path.
1307 [\\/]* | [A-Za-z]:[\\/]*) ;;
1309 absdir=`cd "$dir" && pwd`
1310 if test -z "$absdir"; then
1311 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1320 deplibs="$deplibs -L$dir"
1321 lib_search_path="$lib_search_path $dir"
1325 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1326 case :$dllsearchpath: in
1328 *) dllsearchpath="$dllsearchpath:$dir";;
1336 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1338 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1339 # These systems don't actually have a C or math library (as such)
1342 *-*-mingw* | *-*-os2*)
1343 # These systems don't actually have a C library (as such)
1344 test "X$arg" = "X-lc" && continue
1346 *-*-openbsd* | *-*-freebsd*)
1347 # Do not include libc due to us having libc/libc_r.
1348 test "X$arg" = "X-lc" && continue
1351 elif test "X$arg" = "X-lc_r"; then
1353 *-*-openbsd* | *-*-freebsd*)
1354 # Do not include libc_r directly, use -pthread flag.
1359 deplibs="$deplibs $arg"
1375 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1376 # The PATH hackery in wrapper scripts is required on Windows
1377 # in order for the loader to find any dlls it needs.
1378 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1379 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1382 *) no_install=yes ;;
1410 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1411 # We need an absolute path.
1413 [\\/]* | [A-Za-z]:[\\/]*) ;;
1415 $echo "$modename: only absolute run-paths are allowed" 1>&2
1421 *) xrpath="$xrpath $dir" ;;
1427 # The effects of -static are defined in a previous loop.
1428 # We used to do the same as -all-static on platforms that
1429 # didn't have a PIC flag, but the assumption that the effects
1430 # would be equivalent was wrong. It would break on at least
1431 # Digital Unix and AIX.
1446 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1448 save_ifs="$IFS"; IFS=','
1449 for flag in $args; do
1452 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1457 compiler_flags="$compiler_flags $flag"
1460 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1464 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1466 save_ifs="$IFS"; IFS=','
1467 for flag in $args; do
1470 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1475 compiler_flags="$compiler_flags $wl$flag"
1476 linker_flags="$linker_flags $flag"
1479 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1492 # Some other compiler flag.
1494 # Unknown arguments in both finalize_command and compile_command need
1495 # to be aesthetically quoted because they are evaled later.
1496 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1498 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1505 # A library or standard object.
1506 if test "$prev" = dlfiles; then
1507 # This file was specified with -dlopen.
1508 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1509 dlfiles="$dlfiles $arg"
1513 # If libtool objects are unsupported, then we need to preload.
1518 if test "$prev" = dlprefiles; then
1519 # Preload the old-style object.
1520 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1524 *.lo) libobjs="$libobjs $arg" ;;
1525 *) objs="$objs $arg" ;;
1532 deplibs="$deplibs $arg"
1533 old_deplibs="$old_deplibs $arg"
1538 # A libtool-controlled library.
1540 if test "$prev" = dlfiles; then
1541 # This library was specified with -dlopen.
1542 dlfiles="$dlfiles $arg"
1544 elif test "$prev" = dlprefiles; then
1545 # The library was specified with -dlpreopen.
1546 dlprefiles="$dlprefiles $arg"
1549 deplibs="$deplibs $arg"
1554 # Some other compiler argument.
1556 # Unknown arguments in both finalize_command and compile_command need
1557 # to be aesthetically quoted because they are evaled later.
1558 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1560 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1567 # Now actually substitute the argument into the commands.
1568 if test -n "$arg"; then
1569 compile_command="$compile_command $arg"
1570 finalize_command="$finalize_command $arg"
1572 done # argument parsing loop
1574 if test -n "$prev"; then
1575 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1580 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1581 eval arg=\"$export_dynamic_flag_spec\"
1582 compile_command="$compile_command $arg"
1583 finalize_command="$finalize_command $arg"
1586 # calculate the name of the file, without its directory
1587 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1588 libobjs_save="$libobjs"
1590 if test -n "$shlibpath_var"; then
1591 # get the directories listed in $shlibpath_var
1592 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1596 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1597 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1599 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1600 if test "X$output_objdir" = "X$output"; then
1601 output_objdir="$objdir"
1603 output_objdir="$output_objdir/$objdir"
1605 # Create the object directory.
1606 if test ! -d $output_objdir; then
1607 $show "$mkdir $output_objdir"
1608 $run $mkdir $output_objdir
1610 if test $status -ne 0 && test ! -d $output_objdir; then
1615 # Determine the type of output
1618 $echo "$modename: you must specify an output file" 1>&2
1622 *.$libext) linkmode=oldlib ;;
1623 *.lo | *.$objext) linkmode=obj ;;
1624 *.la) linkmode=lib ;;
1625 *) linkmode=prog ;; # Anything else should be a program.
1630 # Find all interdependent deplibs by searching for libraries
1631 # that are linked more than once (e.g. -la -lb -la)
1632 for deplib in $deplibs; do
1633 if test "X$duplicate_deps" = "Xyes" ; then
1635 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1638 libs="$libs $deplib"
1643 need_relink=no # whether we're linking any uninstalled libtool libraries
1644 notinst_deplibs= # not-installed libtool libraries
1645 notinst_path= # paths that contain not-installed libtool libraries
1649 for file in $dlfiles $dlprefiles; do
1653 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1665 passes="conv scan dlopen dlpreopen link"
1670 for pass in $passes; do
1671 if test $linkmode = prog; then
1672 # Determine which files to process
1676 save_deplibs="$deplibs" # Collect dlpreopened libraries
1679 dlpreopen) libs="$dlprefiles" ;;
1680 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1683 for deplib in $libs; do
1688 if test $linkmode = oldlib && test $linkmode = obj; then
1689 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1692 if test $pass = conv; then
1693 deplibs="$deplib $deplibs"
1696 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1697 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1698 # Search the libtool library
1699 lib="$searchdir/lib${name}.la"
1700 if test -f "$lib"; then
1705 if test "$found" != yes; then
1706 # deplib doesn't seem to be a libtool library
1707 if test "$linkmode,$pass" = "prog,link"; then
1708 compile_deplibs="$deplib $compile_deplibs"
1709 finalize_deplibs="$deplib $finalize_deplibs"
1711 deplibs="$deplib $deplibs"
1712 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1720 deplibs="$deplib $deplibs"
1721 test $pass = conv && continue
1722 newdependency_libs="$deplib $newdependency_libs"
1723 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1726 if test $pass = conv; then
1727 deplibs="$deplib $deplibs"
1730 if test $pass = scan; then
1731 deplibs="$deplib $deplibs"
1732 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1734 compile_deplibs="$deplib $compile_deplibs"
1735 finalize_deplibs="$deplib $finalize_deplibs"
1739 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1745 if test $pass = link; then
1746 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1747 # Make sure the xrpath contains only unique directories.
1750 *) xrpath="$xrpath $dir" ;;
1753 deplibs="$deplib $deplibs"
1756 *.la) lib="$deplib" ;;
1758 if test $pass = conv; then
1759 deplibs="$deplib $deplibs"
1764 if test "$deplibs_check_method" != pass_all; then
1766 echo "*** Warning: Trying to link with static lib archive $deplib."
1767 echo "*** I have the capability to make that library automatically link in when"
1768 echo "*** you link to this library. But I can only do this if you have a"
1769 echo "*** shared version of the library, which you do not appear to have"
1770 echo "*** because the file extensions .$libext of this argument makes me believe"
1771 echo "*** that it is just a static archive that I should not used here."
1774 echo "*** Warning: Linking the shared library $output against the"
1775 echo "*** static library $deplib is not portable!"
1776 deplibs="$deplib $deplibs"
1781 if test $pass != link; then
1782 deplibs="$deplib $deplibs"
1784 compile_deplibs="$deplib $compile_deplibs"
1785 finalize_deplibs="$deplib $finalize_deplibs"
1792 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1793 # If there is no dlopen support or we're linking statically,
1794 # we need to preload.
1795 newdlprefiles="$newdlprefiles $deplib"
1796 compile_deplibs="$deplib $compile_deplibs"
1797 finalize_deplibs="$deplib $finalize_deplibs"
1799 newdlfiles="$newdlfiles $deplib"
1808 if test $found = yes || test -f "$lib"; then :
1810 $echo "$modename: cannot find the library \`$lib'" 1>&2
1814 # Check to see that this really is a libtool archive.
1815 if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1817 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1821 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1822 test "X$ladir" = "X$lib" && ladir="."
1830 # If the library was installed with an old release of libtool,
1831 # it will not redefine variable installed.
1836 */* | *\\*) . $lib ;;
1840 if test "$linkmode,$pass" = "lib,link" ||
1841 test "$linkmode,$pass" = "prog,scan" ||
1842 { test $linkmode = oldlib && test $linkmode = obj; }; then
1843 # Add dl[pre]opened files of deplib
1844 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1845 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1848 if test $pass = conv; then
1849 # Only check for convenience libraries
1850 deplibs="$lib $deplibs"
1851 if test -z "$libdir"; then
1852 if test -z "$old_library"; then
1853 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1856 # It is a libtool convenience library, so add in its objects.
1857 convenience="$convenience $ladir/$objdir/$old_library"
1858 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1860 for deplib in $dependency_libs; do
1861 deplibs="$deplib $deplibs"
1862 if test "X$duplicate_deps" = "Xyes" ; then
1863 case "$tmp_libs " in
1864 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1867 tmp_libs="$tmp_libs $deplib"
1869 elif test $linkmode != prog && test $linkmode != lib; then
1870 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1876 # Get the name of the library we link against.
1878 for l in $old_library $library_names; do
1881 if test -z "$linklib"; then
1882 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1886 # This library was specified with -dlopen.
1887 if test $pass = dlopen; then
1888 if test -z "$libdir"; then
1889 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1892 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1893 # If there is no dlname, no dlopen support or we're linking
1894 # statically, we need to preload.
1895 dlprefiles="$dlprefiles $lib"
1897 newdlfiles="$newdlfiles $lib"
1902 # We need an absolute path.
1904 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1906 abs_ladir=`cd "$ladir" && pwd`
1907 if test -z "$abs_ladir"; then
1908 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1909 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1914 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1916 # Find the relevant object directory and library name.
1917 if test "X$installed" = Xyes; then
1918 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1919 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1928 dir="$ladir/$objdir"
1929 absdir="$abs_ladir/$objdir"
1930 # Remove this search path later
1931 notinst_path="$notinst_path $abs_ladir"
1932 fi # $installed = yes
1933 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1935 # This library was specified with -dlpreopen.
1936 if test $pass = dlpreopen; then
1937 if test -z "$libdir"; then
1938 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1941 # Prefer using a static library (so that no silly _DYNAMIC symbols
1942 # are required to link).
1943 if test -n "$old_library"; then
1944 newdlprefiles="$newdlprefiles $dir/$old_library"
1945 # Otherwise, use the dlname, so that lt_dlopen finds it.
1946 elif test -n "$dlname"; then
1947 newdlprefiles="$newdlprefiles $dir/$dlname"
1949 newdlprefiles="$newdlprefiles $dir/$linklib"
1951 fi # $pass = dlpreopen
1953 if test -z "$libdir"; then
1954 # Link the convenience library
1955 if test $linkmode = lib; then
1956 deplibs="$dir/$old_library $deplibs"
1957 elif test "$linkmode,$pass" = "prog,link"; then
1958 compile_deplibs="$dir/$old_library $compile_deplibs"
1959 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1961 deplibs="$lib $deplibs"
1966 if test $linkmode = prog && test $pass != link; then
1967 newlib_search_path="$newlib_search_path $ladir"
1968 deplibs="$lib $deplibs"
1971 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1972 test "$build_libtool_libs" = no; then
1977 for deplib in $dependency_libs; do
1979 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1981 # Need to link against all dependency_libs?
1982 if test $linkalldeplibs = yes; then
1983 deplibs="$deplib $deplibs"
1985 # Need to hardcode shared library paths
1986 # or/and link against static libraries
1987 newdependency_libs="$deplib $newdependency_libs"
1989 if test "X$duplicate_deps" = "Xyes" ; then
1990 case "$tmp_libs " in
1991 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1994 tmp_libs="$tmp_libs $deplib"
1997 fi # $linkmode = prog...
1999 link_static=no # Whether the deplib will be linked statically
2000 if test -n "$library_names" &&
2001 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2002 # Link against this shared library
2004 if test "$linkmode,$pass" = "prog,link" ||
2005 { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
2006 # Hardcode the library path.
2007 # Skip directories that are in the system default run-time
2009 case " $sys_lib_dlsearch_path " in
2012 case "$compile_rpath " in
2014 *) compile_rpath="$compile_rpath $absdir"
2018 case " $sys_lib_dlsearch_path " in
2021 case "$finalize_rpath " in
2023 *) finalize_rpath="$finalize_rpath $libdir"
2027 if test $linkmode = prog; then
2028 # We need to hardcode the library path
2029 if test -n "$shlibpath_var"; then
2030 # Make sure the rpath contains only unique directories.
2031 case "$temp_rpath " in
2034 *) temp_rpath="$temp_rpath $dir" ;;
2038 fi # $linkmode,$pass = prog,link...
2040 if test "$alldeplibs" = yes &&
2041 { test "$deplibs_check_method" = pass_all ||
2042 { test "$build_libtool_libs" = yes &&
2043 test -n "$library_names"; }; }; then
2044 # We only need to search for static libraries
2048 if test "$installed" = no; then
2049 notinst_deplibs="$notinst_deplibs $lib"
2053 if test -n "$old_archive_from_expsyms_cmds"; then
2054 # figure out the soname
2055 set dummy $library_names
2058 libname=`eval \\$echo \"$libname_spec\"`
2059 # use dlname if we got it. it's perfectly good, no?
2060 if test -n "$dlname"; then
2062 elif test -n "$soname_spec"; then
2066 major=`expr $current - $age`
2070 eval soname=\"$soname_spec\"
2075 # Make a new name for the extract_expsyms_cmds to use
2077 soname=`echo $soroot | ${SED} -e 's/^.*\///'`
2078 newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2080 # If the library has no export list, then create one now
2081 if test -f "$output_objdir/$soname-def"; then :
2083 $show "extracting exported symbol list from \`$soname'"
2084 save_ifs="$IFS"; IFS='~'
2085 eval cmds=\"$extract_expsyms_cmds\"
2086 for cmd in $cmds; do
2089 $run eval "$cmd" || exit $?
2095 if test -f "$output_objdir/$newlib"; then :; else
2096 $show "generating import library for \`$soname'"
2097 save_ifs="$IFS"; IFS='~'
2098 eval cmds=\"$old_archive_from_expsyms_cmds\"
2099 for cmd in $cmds; do
2102 $run eval "$cmd" || exit $?
2106 # make sure the library variables are pointing to the new library
2109 fi # test -n $old_archive_from_expsyms_cmds
2111 if test $linkmode = prog || test "$mode" != relink; then
2116 case $hardcode_action in
2117 immediate | unsupported)
2118 if test "$hardcode_direct" = no; then
2120 elif test "$hardcode_minus_L" = no; then
2122 *-*-sunos*) add_shlibpath="$dir" ;;
2126 elif test "$hardcode_shlibpath_var" = no; then
2127 add_shlibpath="$dir"
2134 if test "$hardcode_direct" = yes; then
2136 elif test "$hardcode_minus_L" = yes; then
2139 elif test "$hardcode_shlibpath_var" = yes; then
2140 add_shlibpath="$dir"
2149 if test "$lib_linked" != yes; then
2150 $echo "$modename: configuration error: unsupported hardcode properties"
2154 if test -n "$add_shlibpath"; then
2155 case :$compile_shlibpath: in
2156 *":$add_shlibpath:"*) ;;
2157 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2160 if test $linkmode = prog; then
2161 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2162 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2164 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2165 test -n "$add" && deplibs="$add $deplibs"
2166 if test "$hardcode_direct" != yes && \
2167 test "$hardcode_minus_L" != yes && \
2168 test "$hardcode_shlibpath_var" = yes; then
2169 case :$finalize_shlibpath: in
2171 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2177 if test $linkmode = prog || test "$mode" = relink; then
2181 # Finalize command for both is simple: just hardcode it.
2182 if test "$hardcode_direct" = yes; then
2183 add="$libdir/$linklib"
2184 elif test "$hardcode_minus_L" = yes; then
2187 elif test "$hardcode_shlibpath_var" = yes; then
2188 case :$finalize_shlibpath: in
2190 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2194 # We cannot seem to hardcode it, guess we'll fake it.
2199 if test $linkmode = prog; then
2200 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2201 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2203 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2204 test -n "$add" && deplibs="$add $deplibs"
2207 elif test $linkmode = prog; then
2208 if test "$alldeplibs" = yes &&
2209 { test "$deplibs_check_method" = pass_all ||
2210 { test "$build_libtool_libs" = yes &&
2211 test -n "$library_names"; }; }; then
2212 # We only need to search for static libraries
2216 # Try to link the static library
2217 # Here we assume that one of hardcode_direct or hardcode_minus_L
2218 # is not unsupported. This is valid on all known static and
2220 if test "$hardcode_direct" != unsupported; then
2221 test -n "$old_library" && linklib="$old_library"
2222 compile_deplibs="$dir/$linklib $compile_deplibs"
2223 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2225 compile_deplibs="-l$name -L$dir $compile_deplibs"
2226 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2228 elif test "$build_libtool_libs" = yes; then
2229 # Not a shared library
2230 if test "$deplibs_check_method" != pass_all; then
2231 # We're trying link a shared library against a static one
2232 # but the system doesn't support it.
2234 # Just print a warning and add the library to dependency_libs so
2235 # that the program can be linked against the static library.
2237 echo "*** Warning: This system can not link to static lib archive $lib."
2238 echo "*** I have the capability to make that library automatically link in when"
2239 echo "*** you link to this library. But I can only do this if you have a"
2240 echo "*** shared version of the library, which you do not appear to have."
2241 if test "$module" = yes; then
2242 echo "*** But as you try to build a module library, libtool will still create "
2243 echo "*** a static module, that should work as long as the dlopening application"
2244 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2245 if test -z "$global_symbol_pipe"; then
2247 echo "*** However, this would only work if libtool was able to extract symbol"
2248 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2249 echo "*** not find such a program. So, this module is probably useless."
2250 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2252 if test "$build_old_libs" = no; then
2253 build_libtool_libs=module
2256 build_libtool_libs=no
2260 convenience="$convenience $dir/$old_library"
2261 old_convenience="$old_convenience $dir/$old_library"
2262 deplibs="$dir/$old_library $deplibs"
2265 fi # link shared/static library?
2267 if test $linkmode = lib; then
2268 if test -n "$dependency_libs" &&
2269 { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2270 test $link_static = yes; }; then
2271 # Extract -R from dependency_libs
2273 for libdir in $dependency_libs; do
2275 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2277 *" $temp_xrpath "*) ;;
2278 *) xrpath="$xrpath $temp_xrpath";;
2280 *) temp_deplibs="$temp_deplibs $libdir";;
2283 dependency_libs="$temp_deplibs"
2286 newlib_search_path="$newlib_search_path $absdir"
2287 # Link against this library
2288 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2289 # ... and its dependency_libs
2291 for deplib in $dependency_libs; do
2292 newdependency_libs="$deplib $newdependency_libs"
2293 if test "X$duplicate_deps" = "Xyes" ; then
2294 case "$tmp_libs " in
2295 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2298 tmp_libs="$tmp_libs $deplib"
2301 if test $link_all_deplibs != no; then
2302 # Add the search paths of all dependency libraries
2303 for deplib in $dependency_libs; do
2305 -L*) path="$deplib" ;;
2307 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2308 test "X$dir" = "X$deplib" && dir="."
2309 # We need an absolute path.
2311 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2313 absdir=`cd "$dir" && pwd`
2314 if test -z "$absdir"; then
2315 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2320 if grep "^installed=no" $deplib > /dev/null; then
2321 path="-L$absdir/$objdir"
2323 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2324 if test -z "$libdir"; then
2325 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2328 if test "$absdir" != "$libdir"; then
2329 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2336 case " $deplibs " in
2338 *) deplibs="$deplibs $path" ;;
2341 fi # link_all_deplibs != no
2343 done # for deplib in $libs
2344 if test $pass = dlpreopen; then
2345 # Link the dlpreopened libraries before other libraries
2346 for deplib in $save_deplibs; do
2347 deplibs="$deplib $deplibs"
2350 if test $pass != dlopen; then
2351 test $pass != scan && dependency_libs="$newdependency_libs"
2352 if test $pass != conv; then
2353 # Make sure lib_search_path contains only unique directories.
2355 for dir in $newlib_search_path; do
2356 case "$lib_search_path " in
2358 *) lib_search_path="$lib_search_path $dir" ;;
2364 if test "$linkmode,$pass" != "prog,link"; then
2367 vars="compile_deplibs finalize_deplibs"
2369 for var in $vars dependency_libs; do
2370 # Add libraries to $var in reverse order
2371 eval tmp_libs=\"\$$var\"
2373 for deplib in $tmp_libs; do
2375 -L*) new_libs="$deplib $new_libs" ;;
2377 case " $specialdeplibs " in
2378 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2380 case " $new_libs " in
2382 *) new_libs="$deplib $new_libs" ;;
2390 for deplib in $new_libs; do
2393 case " $tmp_libs " in
2395 *) tmp_libs="$tmp_libs $deplib" ;;
2398 *) tmp_libs="$tmp_libs $deplib" ;;
2401 eval $var=\"$tmp_libs\"
2404 if test "$pass" = "conv" &&
2405 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2406 libs="$deplibs" # reset libs
2410 if test $linkmode = prog; then
2411 dlfiles="$newdlfiles"
2412 dlprefiles="$newdlprefiles"
2417 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2418 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2421 if test -n "$rpath"; then
2422 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2425 if test -n "$xrpath"; then
2426 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2429 if test -n "$vinfo"; then
2430 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2433 if test -n "$release"; then
2434 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2437 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2438 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2441 # Now set the variables for building old libraries.
2442 build_libtool_libs=no
2444 objs="$objs$old_deplibs"
2448 # Make sure we only generate libraries of the form `libNAME.la'.
2451 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2452 eval libname=\"$libname_spec\"
2455 if test "$module" = no; then
2456 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2460 if test "$need_lib_prefix" != no; then
2461 # Add the "lib" prefix for modules if required
2462 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2463 eval libname=\"$libname_spec\"
2465 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2470 if test -n "$objs"; then
2471 if test "$deplibs_check_method" != pass_all; then
2472 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2476 echo "*** Warning: Linking the shared library $output against the non-libtool"
2477 echo "*** objects $objs is not portable!"
2478 libobjs="$libobjs $objs"
2482 if test "$dlself" != no; then
2483 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2487 if test $# -gt 2; then
2488 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2493 if test -z "$rpath"; then
2494 if test "$build_libtool_libs" = yes; then
2495 # Building a libtool convenience library.
2497 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2498 build_libtool_libs=convenience
2502 if test -n "$vinfo"; then
2503 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2506 if test -n "$release"; then
2507 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2511 # Parse the version information argument.
2512 save_ifs="$IFS"; IFS=':'
2513 set dummy $vinfo 0 0 0
2516 if test -n "$8"; then
2517 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2526 # Check that each of the things are valid numbers.
2528 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2530 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2531 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2537 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2539 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2540 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2546 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2548 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2549 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2554 if test $age -gt $current; then
2555 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2556 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2560 # Calculate the version variables.
2564 case $version_type in
2568 # Like Linux, but with the current version available in
2569 # verstring for coding it into the library header
2570 major=.`expr $current - $age`
2571 versuffix="$major.$age.$revision"
2572 # Darwin ld doesn't like 0 for these options...
2573 minor_current=`expr $current + 1`
2574 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2579 versuffix=".$current.$revision";
2584 versuffix=".$current";
2588 major=`expr $current - $age + 1`
2590 case $version_type in
2591 nonstopux) verstring_prefix=nonstopux ;;
2592 *) verstring_prefix=sgi ;;
2594 verstring="$verstring_prefix$major.$revision"
2596 # Add in all the interfaces that we are compatible with.
2598 while test $loop != 0; do
2599 iface=`expr $revision - $loop`
2600 loop=`expr $loop - 1`
2601 verstring="$verstring_prefix$major.$iface:$verstring"
2604 # Before this point, $major must not contain `.'.
2606 versuffix="$major.$revision"
2610 major=.`expr $current - $age`
2611 versuffix="$major.$age.$revision"
2615 major=.`expr $current - $age`
2616 versuffix=".$current.$age.$revision"
2617 verstring="$current.$age.$revision"
2619 # Add in all the interfaces that we are compatible with.
2621 while test $loop != 0; do
2622 iface=`expr $current - $loop`
2623 loop=`expr $loop - 1`
2624 verstring="$verstring:${iface}.0"
2627 # Make executables depend on our current version.
2628 verstring="$verstring:${current}.0"
2633 versuffix=".$current.$revision"
2637 # Use '-' rather than '.', since we only want one
2638 # extension on DOS 8.3 filesystems.
2639 major=`expr $current - $age`
2644 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2645 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2650 # Clear the version info if we defaulted, and they specified a release.
2651 if test -z "$vinfo" && test -n "$release"; then
2654 case $version_type in
2656 # we can't check for "0.0" in archive_cmds due to quoting
2657 # problems, so we reset it completely
2664 if test "$need_version" = no; then
2671 # Remove version info from name if versioning should be avoided
2672 if test "$avoid_version" = yes && test "$need_version" = no; then
2678 # Check to see if the archive will have undefined symbols.
2679 if test "$allow_undefined" = yes; then
2680 if test "$allow_undefined_flag" = unsupported; then
2681 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2682 build_libtool_libs=no
2686 # Don't allow undefined symbols.
2687 allow_undefined_flag="$no_undefined_flag"
2691 if test "$mode" != relink; then
2692 # Remove our outputs.
2693 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2694 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2697 # Now set the variables for building old libraries.
2698 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2699 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2701 # Transform .lo files to .o files.
2702 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2705 # Eliminate all temporary directories.
2706 for path in $notinst_path; do
2707 lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2708 deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2709 dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2712 if test -n "$xrpath"; then
2713 # If the user specified any rpath flags, then add them.
2715 for libdir in $xrpath; do
2716 temp_xrpath="$temp_xrpath -R$libdir"
2717 case "$finalize_rpath " in
2719 *) finalize_rpath="$finalize_rpath $libdir" ;;
2722 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2723 dependency_libs="$temp_xrpath $dependency_libs"
2727 # Make sure dlfiles contains only unique files that won't be dlpreopened
2728 old_dlfiles="$dlfiles"
2730 for lib in $old_dlfiles; do
2731 case " $dlprefiles $dlfiles " in
2733 *) dlfiles="$dlfiles $lib" ;;
2737 # Make sure dlprefiles contains only unique files
2738 old_dlprefiles="$dlprefiles"
2740 for lib in $old_dlprefiles; do
2741 case "$dlprefiles " in
2743 *) dlprefiles="$dlprefiles $lib" ;;
2747 if test "$build_libtool_libs" = yes; then
2748 if test -n "$rpath"; then
2750 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2751 # these systems don't actually have a c library (as such)!
2753 *-*-rhapsody* | *-*-darwin1.[012])
2754 # Rhapsody C library is in the System framework
2755 deplibs="$deplibs -framework System"
2758 # Don't link with libc until the a.out ld.so is fixed.
2760 *-*-openbsd* | *-*-freebsd*)
2761 # Do not include libc due to us having libc/libc_r.
2764 # Add libc to deplibs on all other systems if necessary.
2765 if test $build_libtool_need_lc = "yes"; then
2766 deplibs="$deplibs -lc"
2772 # Transform deplibs into only deplibs that can be linked in shared.
2774 libname_save=$libname
2775 release_save=$release
2776 versuffix_save=$versuffix
2778 # I'm not sure if I'm treating the release correctly. I think
2779 # release should show up in the -l (ie -lgmp5) so we don't want to
2780 # add it in twice. Is that correct?
2786 case $deplibs_check_method in
2788 # Don't check for shared/static. Everything works.
2789 # This might be a little naive. We might want to check
2790 # whether the library exists or not. But this is on
2791 # osf3 & osf4 and I'm not really sure... Just
2792 # implementing what was already the behaviour.
2796 # This code stresses the "libraries are programs" paradigm to its
2797 # limits. Maybe even breaks it. We compile a program, linking it
2798 # against the deplibs as a proxy for the library. Then we can check
2799 # whether they linked in statically or dynamically with ldd.
2801 cat > conftest.c <<EOF
2802 int main() { return 0; }
2805 $CC -o conftest conftest.c $deplibs
2806 if test $? -eq 0 ; then
2807 ldd_output=`ldd conftest`
2808 for i in $deplibs; do
2809 name="`expr $i : '-l\(.*\)'`"
2810 # If $name is empty we are operating on a -L argument.
2811 if test -n "$name" && test "$name" != "0"; then
2812 libname=`eval \\$echo \"$libname_spec\"`
2813 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2814 set dummy $deplib_matches
2816 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2817 newdeplibs="$newdeplibs $i"
2821 echo "*** Warning: dynamic linker does not accept needed library $i."
2822 echo "*** I have the capability to make that library automatically link in when"
2823 echo "*** you link to this library. But I can only do this if you have a"
2824 echo "*** shared version of the library, which I believe you do not have"
2825 echo "*** because a test_compile did reveal that the linker did not use it for"
2826 echo "*** its dynamic dependency list that programs get resolved with at runtime."
2829 newdeplibs="$newdeplibs $i"
2833 # Error occured in the first compile. Let's try to salvage
2834 # the situation: Compile a separate program for each library.
2835 for i in $deplibs; do
2836 name="`expr $i : '-l\(.*\)'`"
2837 # If $name is empty we are operating on a -L argument.
2838 if test -n "$name" && test "$name" != "0"; then
2840 $CC -o conftest conftest.c $i
2842 if test $? -eq 0 ; then
2843 ldd_output=`ldd conftest`
2844 libname=`eval \\$echo \"$libname_spec\"`
2845 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2846 set dummy $deplib_matches
2848 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2849 newdeplibs="$newdeplibs $i"
2853 echo "*** Warning: dynamic linker does not accept needed library $i."
2854 echo "*** I have the capability to make that library automatically link in when"
2855 echo "*** you link to this library. But I can only do this if you have a"
2856 echo "*** shared version of the library, which you do not appear to have"
2857 echo "*** because a test_compile did reveal that the linker did not use this one"
2858 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2863 echo "*** Warning! Library $i is needed by this library but I was not able to"
2864 echo "*** make it link in! You will probably need to install it or some"
2865 echo "*** library that it depends on before this library will be fully"
2866 echo "*** functional. Installing it before continuing would be even better."
2869 newdeplibs="$newdeplibs $i"
2875 set dummy $deplibs_check_method
2876 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2877 for a_deplib in $deplibs; do
2878 name="`expr $a_deplib : '-l\(.*\)'`"
2879 # If $name is empty we are operating on a -L argument.
2880 if test -n "$name" && test "$name" != "0"; then
2881 libname=`eval \\$echo \"$libname_spec\"`
2882 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2883 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2884 for potent_lib in $potential_libs; do
2885 # Follow soft links.
2886 if ls -lLd "$potent_lib" 2>/dev/null \
2887 | grep " -> " >/dev/null; then
2890 # The statement above tries to avoid entering an
2891 # endless loop below, in case of cyclic links.
2892 # We might still enter an endless loop, since a link
2893 # loop can be closed while we follow links,
2895 potlib="$potent_lib"
2896 while test -h "$potlib" 2>/dev/null; do
2897 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2899 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2900 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2903 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2905 | egrep "$file_magic_regex" > /dev/null; then
2906 newdeplibs="$newdeplibs $a_deplib"
2912 if test -n "$a_deplib" ; then
2915 echo "*** Warning: linker path does not have real file for library $a_deplib."
2916 echo "*** I have the capability to make that library automatically link in when"
2917 echo "*** you link to this library. But I can only do this if you have a"
2918 echo "*** shared version of the library, which you do not appear to have"
2919 echo "*** because I did check the linker path looking for a file starting"
2920 if test -z "$potlib" ; then
2921 echo "*** with $libname but no candidates were found. (...for file magic test)"
2923 echo "*** with $libname and none of the candidates passed a file format test"
2924 echo "*** using a file magic. Last file checked: $potlib"
2928 # Add a -L argument.
2929 newdeplibs="$newdeplibs $a_deplib"
2931 done # Gone through all deplibs.
2934 set dummy $deplibs_check_method
2935 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2936 for a_deplib in $deplibs; do
2937 name="`expr $a_deplib : '-l\(.*\)'`"
2938 # If $name is empty we are operating on a -L argument.
2939 if test -n "$name" && test "$name" != "0"; then
2940 libname=`eval \\$echo \"$libname_spec\"`
2941 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2942 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2943 for potent_lib in $potential_libs; do
2944 potlib="$potent_lib" # see symlink-check below in file_magic test
2945 if eval echo \"$potent_lib\" 2>/dev/null \
2947 | egrep "$match_pattern_regex" > /dev/null; then
2948 newdeplibs="$newdeplibs $a_deplib"
2954 if test -n "$a_deplib" ; then
2957 echo "*** Warning: linker path does not have real file for library $a_deplib."
2958 echo "*** I have the capability to make that library automatically link in when"
2959 echo "*** you link to this library. But I can only do this if you have a"
2960 echo "*** shared version of the library, which you do not appear to have"
2961 echo "*** because I did check the linker path looking for a file starting"
2962 if test -z "$potlib" ; then
2963 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2965 echo "*** with $libname and none of the candidates passed a file format test"
2966 echo "*** using a regex pattern. Last file checked: $potlib"
2970 # Add a -L argument.
2971 newdeplibs="$newdeplibs $a_deplib"
2973 done # Gone through all deplibs.
2977 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2978 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2979 grep . >/dev/null; then
2981 if test "X$deplibs_check_method" = "Xnone"; then
2982 echo "*** Warning: inter-library dependencies are not supported in this platform."
2984 echo "*** Warning: inter-library dependencies are not known to be supported."
2986 echo "*** All declared inter-library dependencies are being dropped."
2991 versuffix=$versuffix_save
2993 release=$release_save
2994 libname=$libname_save
2998 *-*-rhapsody* | *-*-darwin1.[012])
2999 # On Rhapsody replace the C library is the System framework
3000 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3004 if test "$droppeddeps" = yes; then
3005 if test "$module" = yes; then
3007 echo "*** Warning: libtool could not satisfy all declared inter-library"
3008 echo "*** dependencies of module $libname. Therefore, libtool will create"
3009 echo "*** a static module, that should work as long as the dlopening"
3010 echo "*** application is linked with the -dlopen flag."
3011 if test -z "$global_symbol_pipe"; then
3013 echo "*** However, this would only work if libtool was able to extract symbol"
3014 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3015 echo "*** not find such a program. So, this module is probably useless."
3016 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3018 if test "$build_old_libs" = no; then
3019 oldlibs="$output_objdir/$libname.$libext"
3020 build_libtool_libs=module
3023 build_libtool_libs=no
3026 echo "*** The inter-library dependencies that have been dropped here will be"
3027 echo "*** automatically added whenever a program is linked with this library"
3028 echo "*** or is declared to -dlopen it."
3030 if test $allow_undefined = no; then
3032 echo "*** Since this library must not contain undefined symbols,"
3033 echo "*** because either the platform does not support them or"
3034 echo "*** it was explicitly requested with -no-undefined,"
3035 echo "*** libtool will only create a static version of it."
3036 if test "$build_old_libs" = no; then
3037 oldlibs="$output_objdir/$libname.$libext"
3038 build_libtool_libs=module
3041 build_libtool_libs=no
3046 # Done checking deplibs!
3050 # All the library-specific variables (install_libdir is set above).
3055 # Test again, we may have decided not to build it any more
3056 if test "$build_libtool_libs" = yes; then
3057 if test $hardcode_into_libs = yes; then
3058 # Hardcode the library paths
3061 rpath="$finalize_rpath"
3062 test "$mode" != relink && rpath="$compile_rpath$rpath"
3063 for libdir in $rpath; do
3064 if test -n "$hardcode_libdir_flag_spec"; then
3065 if test -n "$hardcode_libdir_separator"; then
3066 if test -z "$hardcode_libdirs"; then
3067 hardcode_libdirs="$libdir"
3069 # Just accumulate the unique libdirs.
3070 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3071 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3074 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3079 eval flag=\"$hardcode_libdir_flag_spec\"
3080 dep_rpath="$dep_rpath $flag"
3082 elif test -n "$runpath_var"; then
3083 case "$perm_rpath " in
3085 *) perm_rpath="$perm_rpath $libdir" ;;
3089 # Substitute the hardcoded libdirs into the rpath.
3090 if test -n "$hardcode_libdir_separator" &&
3091 test -n "$hardcode_libdirs"; then
3092 libdir="$hardcode_libdirs"
3093 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3095 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3096 # We should set the runpath_var.
3098 for dir in $perm_rpath; do
3101 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3103 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3106 shlibpath="$finalize_shlibpath"
3107 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3108 if test -n "$shlibpath"; then
3109 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3112 # Get the real and link names of the library.
3113 eval library_names=\"$library_names_spec\"
3114 set dummy $library_names
3118 if test -n "$soname_spec"; then
3119 eval soname=\"$soname_spec\"
3123 test -z "$dlname" && dlname=$soname
3125 lib="$output_objdir/$realname"
3128 linknames="$linknames $link"
3131 # Ensure that we have .o objects for linkers which dislike .lo
3132 # (e.g. aix) in case we are running --disable-static
3133 for obj in $libobjs; do
3134 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3135 if test "X$xdir" = "X$obj"; then
3140 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3141 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3142 if test ! -f $xdir/$oldobj; then
3143 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3144 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3148 # Use standard objects if they are pic
3149 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3151 # Prepare the list of exported symbols
3152 if test -z "$export_symbols"; then
3153 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3154 $show "generating symbol list for \`$libname.la'"
3155 export_symbols="$output_objdir/$libname.exp"
3156 $run $rm $export_symbols
3157 eval cmds=\"$export_symbols_cmds\"
3158 save_ifs="$IFS"; IFS='~'
3159 for cmd in $cmds; do
3162 $run eval "$cmd" || exit $?
3165 if test -n "$export_symbols_regex"; then
3166 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3167 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3168 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3169 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3174 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3175 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3178 if test -n "$convenience"; then
3179 if test -n "$whole_archive_flag_spec"; then
3180 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3182 gentop="$output_objdir/${outputname}x"
3183 $show "${rm}r $gentop"
3184 $run ${rm}r "$gentop"
3185 $show "mkdir $gentop"
3186 $run mkdir "$gentop"
3188 if test $status -ne 0 && test ! -d "$gentop"; then
3191 generated="$generated $gentop"
3193 for xlib in $convenience; do
3194 # Extract the objects.
3196 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3197 *) xabs=`pwd`"/$xlib" ;;
3199 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3200 xdir="$gentop/$xlib"
3202 $show "${rm}r $xdir"
3207 if test $status -ne 0 && test ! -d "$xdir"; then
3210 $show "(cd $xdir && $AR x $xabs)"
3211 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3213 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3218 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3219 eval flag=\"$thread_safe_flag_spec\"
3220 linker_flags="$linker_flags $flag"
3223 # Make a backup of the uninstalled library when relinking
3224 if test "$mode" = relink; then
3225 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3228 # Do each of the archive commands.
3229 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3230 eval cmds=\"$archive_expsym_cmds\"
3232 save_deplibs="$deplibs"
3233 for conv in $convenience; do
3235 for test_deplib in $deplibs; do
3236 if test "$test_deplib" != "$conv"; then
3237 tmp_deplibs="$tmp_deplibs $test_deplib"
3240 deplibs="$tmp_deplibs"
3242 eval cmds=\"$archive_cmds\"
3243 deplibs="$save_deplibs"
3245 save_ifs="$IFS"; IFS='~'
3246 for cmd in $cmds; do
3249 $run eval "$cmd" || exit $?
3253 # Restore the uninstalled library and exit
3254 if test "$mode" = relink; then
3255 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3259 # Create links to the real library.
3260 for linkname in $linknames; do
3261 if test "$realname" != "$linkname"; then
3262 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3263 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3267 # If -module or -export-dynamic was specified, set the dlname.
3268 if test "$module" = yes || test "$export_dynamic" = yes; then
3269 # On all known operating systems, these are identical.
3276 if test -n "$deplibs"; then
3277 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3280 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3281 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3284 if test -n "$rpath"; then
3285 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3288 if test -n "$xrpath"; then
3289 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3292 if test -n "$vinfo"; then
3293 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3296 if test -n "$release"; then
3297 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3302 if test -n "$objs$old_deplibs"; then
3303 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3307 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3315 # Delete the old objects.
3316 $run $rm $obj $libobj
3318 # Objects from convenience libraries. This assumes
3319 # single-version convenience libraries. Whenever we create
3320 # different ones for PIC/non-PIC, this we'll have to duplicate
3324 # reload_cmds runs $LD directly, so let us get rid of
3325 # -Wl from whole_archive_flag_spec
3328 if test -n "$convenience"; then
3329 if test -n "$whole_archive_flag_spec"; then
3330 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3332 gentop="$output_objdir/${obj}x"
3333 $show "${rm}r $gentop"
3334 $run ${rm}r "$gentop"
3335 $show "mkdir $gentop"
3336 $run mkdir "$gentop"
3338 if test $status -ne 0 && test ! -d "$gentop"; then
3341 generated="$generated $gentop"
3343 for xlib in $convenience; do
3344 # Extract the objects.
3346 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3347 *) xabs=`pwd`"/$xlib" ;;
3349 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3350 xdir="$gentop/$xlib"
3352 $show "${rm}r $xdir"
3357 if test $status -ne 0 && test ! -d "$xdir"; then
3360 $show "(cd $xdir && $AR x $xabs)"
3361 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3363 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3368 # Create the old-style object.
3369 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
3372 eval cmds=\"$reload_cmds\"
3373 save_ifs="$IFS"; IFS='~'
3374 for cmd in $cmds; do
3377 $run eval "$cmd" || exit $?
3381 # Exit if we aren't doing a library object file.
3382 if test -z "$libobj"; then
3383 if test -n "$gentop"; then
3384 $show "${rm}r $gentop"
3391 if test "$build_libtool_libs" != yes; then
3392 if test -n "$gentop"; then
3393 $show "${rm}r $gentop"
3397 # Create an invalid libtool object if no PIC, so that we don't
3398 # accidentally link it into a program.
3399 $show "echo timestamp > $libobj"
3400 $run eval "echo timestamp > $libobj" || exit $?
3404 if test -n "$pic_flag" || test "$pic_mode" != default; then
3405 # Only do commands if we really have different PIC objects.
3406 reload_objs="$libobjs $reload_conv_objs"
3408 eval cmds=\"$reload_cmds\"
3409 save_ifs="$IFS"; IFS='~'
3410 for cmd in $cmds; do
3413 $run eval "$cmd" || exit $?
3417 # Just create a symlink.
3420 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3421 if test "X$xdir" = "X$libobj"; then
3426 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3427 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3428 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3429 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3432 if test -n "$gentop"; then
3433 $show "${rm}r $gentop"
3442 *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3444 if test -n "$vinfo"; then
3445 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3448 if test -n "$release"; then
3449 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3452 if test "$preload" = yes; then
3453 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3454 test "$dlopen_self_static" = unknown; then
3455 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3460 *-*-rhapsody* | *-*-darwin1.[012])
3461 # On Rhapsody replace the C library is the System framework
3462 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3463 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3466 # Don't allow lazy linking, it breaks C++ global constructors
3467 compile_command="$compile_command ${wl}-bind_at_load"
3468 finalize_command="$finalize_command ${wl}-bind_at_load"
3474 compile_command="$compile_command $compile_deplibs"
3475 finalize_command="$finalize_command $finalize_deplibs"
3477 if test -n "$rpath$xrpath"; then
3478 # If the user specified any rpath flags, then add them.
3479 for libdir in $rpath $xrpath; do
3480 # This is the magic to use -rpath.
3481 case "$finalize_rpath " in
3483 *) finalize_rpath="$finalize_rpath $libdir" ;;
3488 # Now hardcode the library paths
3491 for libdir in $compile_rpath $finalize_rpath; do
3492 if test -n "$hardcode_libdir_flag_spec"; then
3493 if test -n "$hardcode_libdir_separator"; then
3494 if test -z "$hardcode_libdirs"; then
3495 hardcode_libdirs="$libdir"
3497 # Just accumulate the unique libdirs.
3498 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3499 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3502 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3507 eval flag=\"$hardcode_libdir_flag_spec\"
3508 rpath="$rpath $flag"
3510 elif test -n "$runpath_var"; then
3511 case "$perm_rpath " in
3513 *) perm_rpath="$perm_rpath $libdir" ;;
3517 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3518 case :$dllsearchpath: in
3520 *) dllsearchpath="$dllsearchpath:$libdir";;
3525 # Substitute the hardcoded libdirs into the rpath.
3526 if test -n "$hardcode_libdir_separator" &&
3527 test -n "$hardcode_libdirs"; then
3528 libdir="$hardcode_libdirs"
3529 eval rpath=\" $hardcode_libdir_flag_spec\"
3531 compile_rpath="$rpath"
3535 for libdir in $finalize_rpath; do
3536 if test -n "$hardcode_libdir_flag_spec"; then
3537 if test -n "$hardcode_libdir_separator"; then
3538 if test -z "$hardcode_libdirs"; then
3539 hardcode_libdirs="$libdir"
3541 # Just accumulate the unique libdirs.
3542 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3543 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3546 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3551 eval flag=\"$hardcode_libdir_flag_spec\"
3552 rpath="$rpath $flag"
3554 elif test -n "$runpath_var"; then
3555 case "$finalize_perm_rpath " in
3557 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3561 # Substitute the hardcoded libdirs into the rpath.
3562 if test -n "$hardcode_libdir_separator" &&
3563 test -n "$hardcode_libdirs"; then
3564 libdir="$hardcode_libdirs"
3565 eval rpath=\" $hardcode_libdir_flag_spec\"
3567 finalize_rpath="$rpath"
3569 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3570 # Transform all the library objects into standard objects.
3571 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3572 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3576 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3577 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3578 dlsyms="${outputname}S.c"
3580 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3584 if test -n "$dlsyms"; then
3588 # Discover the nlist of each of the dlfiles.
3589 nlist="$output_objdir/${outputname}.nm"
3591 $show "$rm $nlist ${nlist}S ${nlist}T"
3592 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3594 # Parse the name list into a source file.
3595 $show "creating $output_objdir/$dlsyms"
3597 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3598 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3599 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3605 /* Prevent the only kind of declaration conflicts we can make. */
3606 #define lt_preloaded_symbols some_other_symbol
3608 /* External symbol declarations for the compiler. */\
3611 if test "$dlself" = yes; then
3612 $show "generating symbol list for \`$output'"
3614 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3616 # Add our own program objects to the symbol list.
3617 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3618 for arg in $progfiles; do
3619 $show "extracting global C symbols from \`$arg'"
3620 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3623 if test -n "$exclude_expsyms"; then
3624 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3625 $run eval '$mv "$nlist"T "$nlist"'
3628 if test -n "$export_symbols_regex"; then
3629 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3630 $run eval '$mv "$nlist"T "$nlist"'
3633 # Prepare the list of exported symbols
3634 if test -z "$export_symbols"; then
3635 export_symbols="$output_objdir/$output.exp"
3636 $run $rm $export_symbols
3637 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3639 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3640 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3641 $run eval 'mv "$nlist"T "$nlist"'
3645 for arg in $dlprefiles; do
3646 $show "extracting global C symbols from \`$arg'"
3647 name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
3648 $run eval 'echo ": $name " >> "$nlist"'
3649 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3652 if test -z "$run"; then
3653 # Make sure we have at least an empty file.
3654 test -f "$nlist" || : > "$nlist"
3656 if test -n "$exclude_expsyms"; then
3657 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3658 $mv "$nlist"T "$nlist"
3661 # Try sorting and uniquifying the output.
3662 if grep -v "^: " < "$nlist" |
3663 if sort -k 3 </dev/null >/dev/null 2>&1; then
3668 uniq > "$nlist"S; then
3671 grep -v "^: " < "$nlist" > "$nlist"S
3674 if test -f "$nlist"S; then
3675 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3677 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3680 $echo >> "$output_objdir/$dlsyms" "\
3682 #undef lt_preloaded_symbols
3684 #if defined (__STDC__) && __STDC__
3685 # define lt_ptr void *
3687 # define lt_ptr char *
3691 /* The mapping between symbol names and symbols. */
3696 lt_preloaded_symbols[] =
3700 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3702 $echo >> "$output_objdir/$dlsyms" "\
3706 /* This works around a problem in FreeBSD linker */
3707 #ifdef FREEBSD_WORKAROUND
3708 static const void *lt_preloaded_setup() {
3709 return lt_preloaded_symbols;
3719 pic_flag_for_symtable=
3721 # compiling the symbol table file with pic_flag works around
3722 # a FreeBSD bug that causes programs to crash when -lm is
3723 # linked before any other PIC object. But we must not use
3724 # pic_flag when linking with -static. The problem exists in
3725 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3726 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3727 case "$compile_command " in
3729 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3732 case "$compile_command " in
3734 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3738 # Now compile the dynamic symbol file.
3739 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3740 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3742 # Clean up the generated files.
3743 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3744 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3746 # Transform the symbol file into the correct name.
3747 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3748 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3751 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3756 # We keep going just in case the user didn't refer to
3757 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3758 # really was required.
3760 # Nullify the symbol file.
3761 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3762 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3765 if test $need_relink = no || test "$build_libtool_libs" != yes; then
3766 # Replace the output file specification.
3767 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3768 link_command="$compile_command$compile_rpath"
3770 # We have no uninstalled library dependencies, so finalize right now.
3771 $show "$link_command"
3772 $run eval "$link_command"
3775 # Delete the generated files.
3776 if test -n "$dlsyms"; then
3777 $show "$rm $output_objdir/${outputname}S.${objext}"
3778 $run $rm "$output_objdir/${outputname}S.${objext}"
3784 if test -n "$shlibpath_var"; then
3785 # We should set the shlibpath_var
3787 for dir in $temp_rpath; do
3789 [\\/]* | [A-Za-z]:[\\/]*)
3794 # Relative path: add a thisdir entry.
3795 rpath="$rpath\$thisdir/$dir:"
3802 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3803 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3805 if test -n "$finalize_shlibpath"; then
3806 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3811 if test -n "$runpath_var"; then
3812 if test -n "$perm_rpath"; then
3813 # We should set the runpath_var.
3815 for dir in $perm_rpath; do
3818 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3820 if test -n "$finalize_perm_rpath"; then
3821 # We should set the runpath_var.
3823 for dir in $finalize_perm_rpath; do
3826 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3830 if test "$no_install" = yes; then
3831 # We don't need to create a wrapper script.
3832 link_command="$compile_var$compile_command$compile_rpath"
3833 # Replace the output file specification.
3834 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3835 # Delete the old output file.
3837 # Link the executable and exit
3838 $show "$link_command"
3839 $run eval "$link_command" || exit $?
3843 if test "$hardcode_action" = relink; then
3844 # Fast installation is not supported
3845 link_command="$compile_var$compile_command$compile_rpath"
3846 relink_command="$finalize_var$finalize_command$finalize_rpath"
3848 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3849 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3851 if test "$fast_install" != no; then
3852 link_command="$finalize_var$compile_command$finalize_rpath"
3853 if test "$fast_install" = yes; then
3854 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3856 # fast_install is set to needless
3860 link_command="$compile_var$compile_command$compile_rpath"
3861 relink_command="$finalize_var$finalize_command$finalize_rpath"
3865 # Replace the output file specification.
3866 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3868 # Delete the old output files.
3869 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3871 $show "$link_command"
3872 $run eval "$link_command" || exit $?
3874 # Now create the wrapper script.
3875 $show "creating $output"
3877 # Quote the relink command for shipping.
3878 if test -n "$relink_command"; then
3879 # Preserve any variables that may affect compiler behavior
3880 for var in $variables_saved_for_relink; do
3881 if eval test -z \"\${$var+set}\"; then
3882 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3883 elif eval var_value=\$$var; test -z "$var_value"; then
3884 relink_command="$var=; export $var; $relink_command"
3886 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3887 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3890 relink_command="(cd `pwd`; $relink_command)"
3891 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3894 # Quote $echo for shipping.
3895 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3897 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3898 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3900 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3902 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3905 # Only actually do things if our run command is non-null.
3906 if test -z "$run"; then
3907 # win32 will think the script is a binary if it has
3908 # a .exe suffix, so we strip it off here.
3910 *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
3912 # test for cygwin because mv fails w/o .exe extensions
3914 *cygwin*) exeext=.exe ;;
3918 trap "$rm $output; exit 1" 1 2 15
3923 # $output - temporary wrapper script for $objdir/$outputname
3924 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3926 # The $output program cannot be directly executed until all the libtool
3927 # libraries that it depends on are installed.
3929 # This wrapper script should never be moved out of the build directory.
3930 # If it is, it will not operate correctly.
3932 # Sed substitution that helps us do robust quoting. It backslashifies
3933 # metacharacters that are still active within double-quoted strings.
3934 Xsed="${SED}"' -e 1s/^X//'
3935 sed_quote_subst='$sed_quote_subst'
3937 # The HP-UX ksh and POSIX shell print the target directory to stdout
3939 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3941 relink_command=\"$relink_command\"
3943 # This environment variable determines our operation mode.
3944 if test \"\$libtool_install_magic\" = \"$magic\"; then
3945 # install mode needs the following variable:
3946 notinst_deplibs='$notinst_deplibs'
3948 # When we are sourced in execute mode, \$file and \$echo are already set.
3949 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3952 # Make sure echo works.
3953 if test \"X\$1\" = X--no-reexec; then
3954 # Discard the --no-reexec flag, and continue.
3956 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3957 # Yippee, \$echo works!
3960 # Restart under the correct shell, and then maybe \$echo will work.
3961 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3967 # Find the directory that this script lives in.
3968 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3969 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3971 # Follow symbolic links until we get to the real thisdir.
3972 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3973 while test -n \"\$file\"; do
3974 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3976 # If there was a directory component, then change thisdir.
3977 if test \"x\$destdir\" != \"x\$file\"; then
3978 case \"\$destdir\" in
3979 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3980 *) thisdir=\"\$thisdir/\$destdir\" ;;
3984 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3985 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3988 # Try to get the absolute directory name.
3989 absdir=\`cd \"\$thisdir\" && pwd\`
3990 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3993 if test "$fast_install" = yes; then
3995 program=lt-'$outputname'$exeext
3996 progdir=\"\$thisdir/$objdir\"
3998 if test ! -f \"\$progdir/\$program\" || \\
3999 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4000 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4002 file=\"\$\$-\$program\"
4004 if test ! -d \"\$progdir\"; then
4005 $mkdir \"\$progdir\"
4007 $rm \"\$progdir/\$file\"
4012 # relink executable if necessary
4013 if test -n \"\$relink_command\"; then
4014 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4016 $echo \"\$relink_command_output\" >&2
4017 $rm \"\$progdir/\$file\"
4022 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4023 { $rm \"\$progdir/\$program\";
4024 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4025 $rm \"\$progdir/\$file\"
4029 program='$outputname'
4030 progdir=\"\$thisdir/$objdir\"
4036 if test -f \"\$progdir/\$program\"; then"
4038 # Export our shlibpath_var if we have one.
4039 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4041 # Add our own library path to $shlibpath_var
4042 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4044 # Some systems cannot cope with colon-terminated $shlibpath_var
4045 # The second colon is a workaround for a bug in BeOS R4 ${SED}
4046 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4048 export $shlibpath_var
4052 # fixup the dll searchpath if we need to.
4053 if test -n "$dllsearchpath"; then
4055 # Add the dll search path components to the executable PATH
4056 PATH=$dllsearchpath:\$PATH
4061 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4062 # Run the actual program with our arguments.
4065 # win32 systems need to use the prog path for dll
4067 *-*-cygwin* | *-*-pw32*)
4069 exec \$progdir/\$program \${1+\"\$@\"}
4073 # Backslashes separate directories on plain windows
4074 *-*-mingw | *-*-os2*)
4076 exec \$progdir\\\\\$program \${1+\"\$@\"}
4082 # Export the path to the program.
4083 PATH=\"\$progdir:\$PATH\"
4086 exec \$program \${1+\"\$@\"}
4091 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4095 # The program doesn't exist.
4096 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4097 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4098 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4109 # See if we need to build an old-fashioned archive.
4110 for oldlib in $oldlibs; do
4112 if test "$build_libtool_libs" = convenience; then
4113 oldobjs="$libobjs_save"
4114 addlibs="$convenience"
4115 build_libtool_libs=no
4117 if test "$build_libtool_libs" = module; then
4118 oldobjs="$libobjs_save"
4119 build_libtool_libs=no
4121 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4123 addlibs="$old_convenience"
4126 if test -n "$addlibs"; then
4127 gentop="$output_objdir/${outputname}x"
4128 $show "${rm}r $gentop"
4129 $run ${rm}r "$gentop"
4130 $show "mkdir $gentop"
4131 $run mkdir "$gentop"
4133 if test $status -ne 0 && test ! -d "$gentop"; then
4136 generated="$generated $gentop"
4138 # Add in members from convenience archives.
4139 for xlib in $addlibs; do
4140 # Extract the objects.
4142 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4143 *) xabs=`pwd`"/$xlib" ;;
4145 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4146 xdir="$gentop/$xlib"
4148 $show "${rm}r $xdir"
4153 if test $status -ne 0 && test ! -d "$xdir"; then
4156 $show "(cd $xdir && $AR x $xabs)"
4157 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4159 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4163 # Do each command in the archive commands.
4164 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4165 eval cmds=\"$old_archive_from_new_cmds\"
4167 # Ensure that we have .o objects in place in case we decided
4168 # not to build a shared library, and have fallen back to building
4169 # static libs even though --disable-static was passed!
4170 for oldobj in $oldobjs; do
4171 if test ! -f $oldobj; then
4172 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4173 if test "X$xdir" = "X$oldobj"; then
4178 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4179 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4180 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4181 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4185 eval cmds=\"$old_archive_cmds\"
4187 save_ifs="$IFS"; IFS='~'
4188 for cmd in $cmds; do
4191 $run eval "$cmd" || exit $?
4196 if test -n "$generated"; then
4197 $show "${rm}r$generated"
4198 $run ${rm}r$generated
4201 # Now create the libtool archive.
4205 test "$build_old_libs" = yes && old_library="$libname.$libext"
4206 $show "creating $output"
4208 # Preserve any variables that may affect compiler behavior
4209 for var in $variables_saved_for_relink; do
4210 if eval test -z \"\${$var+set}\"; then
4211 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4212 elif eval var_value=\$$var; test -z "$var_value"; then
4213 relink_command="$var=; export $var; $relink_command"
4215 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4216 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4219 # Quote the link command for shipping.
4220 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
4221 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4223 # Only create the output if not a dry run.
4224 if test -z "$run"; then
4225 for installed in no yes; do
4226 if test "$installed" = yes; then
4227 if test -z "$install_libdir"; then
4230 output="$output_objdir/$outputname"i
4231 # Replace all uninstalled libtool libraries with the installed ones
4233 for deplib in $dependency_libs; do
4236 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4237 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4238 if test -z "$libdir"; then
4239 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4242 newdependency_libs="$newdependency_libs $libdir/$name"
4244 *) newdependency_libs="$newdependency_libs $deplib" ;;
4247 dependency_libs="$newdependency_libs"
4249 for lib in $dlfiles; do
4250 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4251 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4252 if test -z "$libdir"; then
4253 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4256 newdlfiles="$newdlfiles $libdir/$name"
4258 dlfiles="$newdlfiles"
4260 for lib in $dlprefiles; do
4261 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4262 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4263 if test -z "$libdir"; then
4264 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4267 newdlprefiles="$newdlprefiles $libdir/$name"
4269 dlprefiles="$newdlprefiles"
4272 # place dlname in correct position for cygwin
4274 case $host,$output,$installed,$module,$dlname in
4275 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4278 # $outputname - a libtool library file
4279 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4281 # Please DO NOT delete this file!
4282 # It is necessary for linking the library.
4284 # The name that we can dlopen(3).
4287 # Names of this library.
4288 library_names='$library_names'
4290 # The name of the static archive.
4291 old_library='$old_library'
4293 # Libraries that this one depends upon.
4294 dependency_libs='$dependency_libs'
4296 # Version information for $libname.
4301 # Is this an already installed library?
4302 installed=$installed
4304 # Files to dlopen/dlpreopen
4306 dlpreopen='$dlprefiles'
4308 # Directory that this library needs to be installed in:
4309 libdir='$install_libdir'"
4310 if test "$installed" = no && test $need_relink = yes; then
4312 relink_command=\"$relink_command\""
4317 # Do a symbolic link so that the libtool archive can be found in
4318 # LD_LIBRARY_PATH before the program is installed.
4319 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4320 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4326 # libtool install mode
4328 modename="$modename: install"
4330 # There may be an optional sh(1) argument at the beginning of
4331 # install_prog (especially on Windows NT).
4332 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4333 # Allow the use of GNU shtool's install command.
4334 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4335 # Aesthetically quote it.
4336 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4338 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4342 install_prog="$arg "
4350 # The real first argument should be the name of the installation program.
4351 # Aesthetically quote it.
4352 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4354 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4358 install_prog="$install_prog$arg"
4360 # We need to accept at least all the BSD install flags.
4370 if test -n "$dest"; then
4371 files="$files $dest"
4389 # If the previous option needed an argument, then skip it.
4390 if test -n "$prev"; then
4399 # Aesthetically quote the argument.
4400 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4402 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4406 install_prog="$install_prog $arg"
4409 if test -z "$install_prog"; then
4410 $echo "$modename: you must specify an install program" 1>&2
4415 if test -n "$prev"; then
4416 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4421 if test -z "$files"; then
4422 if test -z "$dest"; then
4423 $echo "$modename: no file or destination specified" 1>&2
4425 $echo "$modename: you must specify a destination" 1>&2
4431 # Strip any trailing slash from the destination.
4432 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4434 # Check to see that the destination is a directory.
4435 test -d "$dest" && isdir=yes
4436 if test "$isdir" = yes; then
4440 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4441 test "X$destdir" = "X$dest" && destdir=.
4442 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4444 # Not a directory, so check to see that there is only one file specified.
4446 if test $# -gt 2; then
4447 $echo "$modename: \`$dest' is not a directory" 1>&2
4453 [\\/]* | [A-Za-z]:[\\/]*) ;;
4455 for file in $files; do
4459 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4468 # This variable tells wrapper scripts just to set variables rather
4469 # than running their programs.
4470 libtool_install_magic="$magic"
4475 for file in $files; do
4477 # Do each installation.
4480 # Do the static libraries later.
4481 staticlibs="$staticlibs $file"
4485 # Check to see that this really is a libtool archive.
4486 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4488 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4496 # If there is no directory component, then add one.
4498 */* | *\\*) . $file ;;
4502 # Add the libdir to current_libdirs if it is the destination.
4503 if test "X$destdir" = "X$libdir"; then
4504 case "$current_libdirs " in
4506 *) current_libdirs="$current_libdirs $libdir" ;;
4509 # Note the libdir as a future libdir.
4510 case "$future_libdirs " in
4512 *) future_libdirs="$future_libdirs $libdir" ;;
4516 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4517 test "X$dir" = "X$file/" && dir=
4520 if test -n "$relink_command"; then
4521 $echo "$modename: warning: relinking \`$file'" 1>&2
4522 $show "$relink_command"
4523 if $run eval "$relink_command"; then :
4525 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4530 # See the names of the shared library.
4531 set dummy $library_names
4532 if test -n "$2"; then
4538 test -n "$relink_command" && srcname="$realname"T
4540 # Install the shared library and build the symlinks.
4541 $show "$install_prog $dir/$srcname $destdir/$realname"
4542 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4543 if test -n "$stripme" && test -n "$striplib"; then
4544 $show "$striplib $destdir/$realname"
4545 $run eval "$striplib $destdir/$realname" || exit $?
4548 if test $# -gt 0; then
4549 # Delete the old symlinks, and create new ones.
4552 if test "$linkname" != "$realname"; then
4553 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4554 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4559 # Do each command in the postinstall commands.
4560 lib="$destdir/$realname"
4561 eval cmds=\"$postinstall_cmds\"
4562 save_ifs="$IFS"; IFS='~'
4563 for cmd in $cmds; do
4566 $run eval "$cmd" || exit $?
4571 # Install the pseudo-library for information purposes.
4572 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4573 instname="$dir/$name"i
4574 $show "$install_prog $instname $destdir/$name"
4575 $run eval "$install_prog $instname $destdir/$name" || exit $?
4577 # Maybe install the static library, too.
4578 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4582 # Install (i.e. copy) a libtool object.
4584 # Figure out destination file name, if it wasn't already specified.
4585 if test -n "$destname"; then
4586 destfile="$destdir/$destname"
4588 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4589 destfile="$destdir/$destfile"
4592 # Deduce the name of the destination old-style object file.
4595 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4598 staticdest="$destfile"
4602 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4608 # Install the libtool object if requested.
4609 if test -n "$destfile"; then
4610 $show "$install_prog $file $destfile"
4611 $run eval "$install_prog $file $destfile" || exit $?
4614 # Install the old object if enabled.
4615 if test "$build_old_libs" = yes; then
4616 # Deduce the name of the old-style object file.
4617 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4619 $show "$install_prog $staticobj $staticdest"
4620 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4626 # Figure out destination file name, if it wasn't already specified.
4627 if test -n "$destname"; then
4628 destfile="$destdir/$destname"
4630 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4631 destfile="$destdir/$destfile"
4634 # Do a test to see if this is really a libtool program.
4637 wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
4643 if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4647 # If there is no directory component, then add one.
4649 */* | *\\*) . $wrapper ;;
4653 # Check the variables that should have been set.
4654 if test -z "$notinst_deplibs"; then
4655 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4660 for lib in $notinst_deplibs; do
4661 # Check to see that each library is installed.
4663 if test -f "$lib"; then
4664 # If there is no directory component, then add one.
4666 */* | *\\*) . $lib ;;
4670 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4671 if test -n "$libdir" && test ! -f "$libfile"; then
4672 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4678 # If there is no directory component, then add one.
4680 */* | *\\*) . $wrapper ;;
4685 if test "$fast_install" = no && test -n "$relink_command"; then
4686 if test "$finalize" = yes && test -z "$run"; then
4688 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4689 tmpdir="$tmpdir/libtool-$$"
4690 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4692 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4695 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4696 outputname="$tmpdir/$file"
4697 # Replace the output file specification.
4698 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4700 $show "$relink_command"
4701 if $run eval "$relink_command"; then :
4703 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4709 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4712 # Install the binary that we compiled earlier.
4713 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4717 # remove .exe since cygwin /usr/bin/install will append another
4719 case $install_prog,$host in
4720 /usr/bin/install*,*cygwin*)
4721 case $file:$destfile in
4726 destfile=$destfile.exe
4729 destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
4734 $show "$install_prog$stripme $file $destfile"
4735 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4736 test -n "$outputname" && ${rm}r "$tmpdir"
4741 for file in $staticlibs; do
4742 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4744 # Set up the ranlib parameters.
4745 oldlib="$destdir/$name"
4747 $show "$install_prog $file $oldlib"
4748 $run eval "$install_prog \$file \$oldlib" || exit $?
4750 if test -n "$stripme" && test -n "$striplib"; then
4751 $show "$old_striplib $oldlib"
4752 $run eval "$old_striplib $oldlib" || exit $?
4755 # Do each command in the postinstall commands.
4756 eval cmds=\"$old_postinstall_cmds\"
4757 save_ifs="$IFS"; IFS='~'
4758 for cmd in $cmds; do
4761 $run eval "$cmd" || exit $?
4766 if test -n "$future_libdirs"; then
4767 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4770 if test -n "$current_libdirs"; then
4771 # Maybe just do a dry run.
4772 test -n "$run" && current_libdirs=" -n$current_libdirs"
4773 exec_cmd='$SHELL $0 --finish$current_libdirs'
4779 # libtool finish mode
4781 modename="$modename: finish"
4785 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4788 libdirs="$libdirs $dir"
4791 for libdir in $libdirs; do
4792 if test -n "$finish_cmds"; then
4793 # Do each command in the finish commands.
4794 eval cmds=\"$finish_cmds\"
4795 save_ifs="$IFS"; IFS='~'
4796 for cmd in $cmds; do
4799 $run eval "$cmd" || admincmds="$admincmds
4804 if test -n "$finish_eval"; then
4805 # Do the single finish_eval.
4806 eval cmds=\"$finish_eval\"
4807 $run eval "$cmds" || admincmds="$admincmds
4813 # Exit here if they wanted silent mode.
4814 test "$show" = ":" && exit 0
4816 echo "----------------------------------------------------------------------"
4817 echo "Libraries have been installed in:"
4818 for libdir in $libdirs; do
4822 echo "If you ever happen to want to link against installed libraries"
4823 echo "in a given directory, LIBDIR, you must either use libtool, and"
4824 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4825 echo "flag during linking and do at least one of the following:"
4826 if test -n "$shlibpath_var"; then
4827 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4828 echo " during execution"
4830 if test -n "$runpath_var"; then
4831 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4832 echo " during linking"
4834 if test -n "$hardcode_libdir_flag_spec"; then
4836 eval flag=\"$hardcode_libdir_flag_spec\"
4838 echo " - use the \`$flag' linker flag"
4840 if test -n "$admincmds"; then
4841 echo " - have your system administrator run these commands:$admincmds"
4843 if test -f /etc/ld.so.conf; then
4844 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4847 echo "See any operating system documentation about shared libraries for"
4848 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4849 echo "----------------------------------------------------------------------"
4853 # libtool execute mode
4855 modename="$modename: execute"
4857 # The first argument is the command name.
4859 if test -z "$cmd"; then
4860 $echo "$modename: you must specify a COMMAND" 1>&2
4865 # Handle -dlopen flags immediately.
4866 for file in $execute_dlfiles; do
4867 if test ! -f "$file"; then
4868 $echo "$modename: \`$file' is not a file" 1>&2
4876 # Check to see that this really is a libtool archive.
4877 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4879 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4884 # Read the libtool library.
4888 # If there is no directory component, then add one.
4890 */* | *\\*) . $file ;;
4894 # Skip this library if it cannot be dlopened.
4895 if test -z "$dlname"; then
4896 # Warn if it was a shared library.
4897 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4901 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4902 test "X$dir" = "X$file" && dir=.
4904 if test -f "$dir/$objdir/$dlname"; then
4907 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4913 # Just add the directory containing the .lo file.
4914 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4915 test "X$dir" = "X$file" && dir=.
4919 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4924 # Get the absolute pathname.
4925 absdir=`cd "$dir" && pwd`
4926 test -n "$absdir" && dir="$absdir"
4928 # Now add the directory to shlibpath_var.
4929 if eval "test -z \"\$$shlibpath_var\""; then
4930 eval "$shlibpath_var=\"\$dir\""
4932 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4936 # This variable tells wrapper scripts just to set shlibpath_var
4937 # rather than running their programs.
4938 libtool_execute_magic="$magic"
4940 # Check if any of the arguments is a wrapper script.
4947 # Do a test to see if this is really a libtool program.
4948 if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4949 # If there is no directory component, then add one.
4951 */* | *\\*) . $file ;;
4955 # Transform arg to wrapped name.
4956 file="$progdir/$program"
4960 # Quote arguments (to preserve shell metacharacters).
4961 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4962 args="$args \"$file\""
4965 if test -z "$run"; then
4966 if test -n "$shlibpath_var"; then
4967 # Export the shlibpath_var.
4968 eval "export $shlibpath_var"
4971 # Restore saved enviroment variables
4972 if test "${save_LC_ALL+set}" = set; then
4973 LC_ALL="$save_LC_ALL"; export LC_ALL
4975 if test "${save_LANG+set}" = set; then
4976 LANG="$save_LANG"; export LANG
4979 # Now prepare to actually exec the command.
4980 exec_cmd="\$cmd$args"
4982 # Display what would be done.
4983 if test -n "$shlibpath_var"; then
4984 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4985 $echo "export $shlibpath_var"
4992 # libtool clean and uninstall mode
4994 modename="$modename: $mode"
5000 # This variable tells wrapper scripts just to set variables rather
5001 # than running their programs.
5002 libtool_install_magic="$magic"
5007 -f) rm="$rm $arg"; rmforce=yes ;;
5008 -*) rm="$rm $arg" ;;
5009 *) files="$files $arg" ;;
5013 if test -z "$rm"; then
5014 $echo "$modename: you must specify an RM program" 1>&2
5021 for file in $files; do
5022 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5023 if test "X$dir" = "X$file"; then
5027 objdir="$dir/$objdir"
5029 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5030 test $mode = uninstall && objdir="$dir"
5032 # Remember objdir for removal later, being careful to avoid duplicates
5033 if test $mode = clean; then
5036 *) rmdirs="$rmdirs $objdir" ;;
5040 # Don't error if the file doesn't exist and rm -f was used.
5041 if (test -L "$file") >/dev/null 2>&1 \
5042 || (test -h "$file") >/dev/null 2>&1 \
5043 || test -f "$file"; then
5045 elif test -d "$file"; then
5048 elif test "$rmforce" = yes; then
5056 # Possibly a libtool archive, so verify it.
5057 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5060 # Delete the libtool libraries and symlinks.
5061 for n in $library_names; do
5062 rmfiles="$rmfiles $objdir/$n"
5064 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5065 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5067 if test $mode = uninstall; then
5068 if test -n "$library_names"; then
5069 # Do each command in the postuninstall commands.
5070 eval cmds=\"$postuninstall_cmds\"
5071 save_ifs="$IFS"; IFS='~'
5072 for cmd in $cmds; do
5076 if test $? != 0 && test "$rmforce" != yes; then
5083 if test -n "$old_library"; then
5084 # Do each command in the old_postuninstall commands.
5085 eval cmds=\"$old_postuninstall_cmds\"
5086 save_ifs="$IFS"; IFS='~'
5087 for cmd in $cmds; do
5091 if test $? != 0 && test "$rmforce" != yes; then
5097 # FIXME: should reinstall the best remaining shared library.
5103 if test "$build_old_libs" = yes; then
5104 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5105 rmfiles="$rmfiles $dir/$oldobj"
5110 # Do a test to see if this is a libtool program.
5111 if test $mode = clean &&
5112 (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5116 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5117 if test "$fast_install" = yes && test -n "$relink_command"; then
5118 rmfiles="$rmfiles $objdir/lt-$name"
5123 $show "$rm $rmfiles"
5124 $run $rm $rmfiles || exit_status=1
5127 # Try to remove the ${objdir}s in the directories where we deleted files
5128 for dir in $rmdirs; do
5129 if test -d "$dir"; then
5131 $run rmdir $dir >/dev/null 2>&1
5139 $echo "$modename: you must specify a MODE" 1>&2
5140 $echo "$generic_help" 1>&2
5145 if test -z "$exec_cmd"; then
5146 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5147 $echo "$generic_help" 1>&2
5150 fi # test -z "$show_help"
5152 if test -n "$exec_cmd"; then
5157 # We need to display help for each of the modes.
5160 "Usage: $modename [OPTION]... [MODE-ARG]...
5162 Provide generalized library-building support services.
5164 --config show all configuration variables
5165 --debug enable verbose shell tracing
5166 -n, --dry-run display commands without modifying any files
5167 --features display basic configuration information and exit
5168 --finish same as \`--mode=finish'
5169 --help display this help message and exit
5170 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5171 --quiet same as \`--silent'
5172 --silent don't print informational messages
5173 --version print version information
5175 MODE must be one of the following:
5177 clean remove files from the build directory
5178 compile compile a source file into a libtool object
5179 execute automatically set library path, then run a program
5180 finish complete the installation of libtool libraries
5181 install install libraries or executables
5182 link create a library or an executable
5183 uninstall remove libraries from an installed directory
5185 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5186 a more detailed description of MODE."
5192 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5194 Remove files from the build directory.
5196 RM is the name of the program to use to delete files associated with each FILE
5197 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5200 If FILE is a libtool library, object or program, all the files associated
5201 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5206 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5208 Compile a source file into a libtool library object.
5210 This mode accepts the following additional options:
5212 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5213 -prefer-pic try to building PIC objects only
5214 -prefer-non-pic try to building non-PIC objects only
5215 -static always build a \`.o' file suitable for static linking
5217 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5218 from the given SOURCEFILE.
5220 The output file name is determined by removing the directory component from
5221 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5222 library object suffix, \`.lo'."
5227 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5229 Automatically set library path, then run a program.
5231 This mode accepts the following additional options:
5233 -dlopen FILE add the directory containing FILE to the library path
5235 This mode sets the library path environment variable according to \`-dlopen'
5238 If any of the ARGS are libtool executable wrappers, then they are translated
5239 into their corresponding uninstalled binary, and any of their required library
5240 directories are added to the library path.
5242 Then, COMMAND is executed, with ARGS as arguments."
5247 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5249 Complete the installation of libtool libraries.
5251 Each LIBDIR is a directory that contains libtool libraries.
5253 The commands that this mode executes may require superuser privileges. Use
5254 the \`--dry-run' option if you just want to see what would be executed."
5259 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5261 Install executables or libraries.
5263 INSTALL-COMMAND is the installation command. The first component should be
5264 either the \`install' or \`cp' program.
5266 The rest of the components are interpreted as arguments to that command (only
5267 BSD-compatible install options are recognized)."
5272 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5274 Link object files or libraries together to form another library, or to
5275 create an executable program.
5277 LINK-COMMAND is a command using the C compiler that you would use to create
5278 a program from several object files.
5280 The following components of LINK-COMMAND are treated specially:
5282 -all-static do not do any dynamic linking at all
5283 -avoid-version do not add a version suffix if possible
5284 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5285 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5286 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5287 -export-symbols SYMFILE
5288 try to export only the symbols listed in SYMFILE
5289 -export-symbols-regex REGEX
5290 try to export only the symbols matching REGEX
5291 -LLIBDIR search LIBDIR for required installed libraries
5292 -lNAME OUTPUT-FILE requires the installed library libNAME
5293 -module build a library that can dlopened
5294 -no-fast-install disable the fast-install mode
5295 -no-install link a not-installable executable
5296 -no-undefined declare that a library does not refer to external symbols
5297 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5298 -release RELEASE specify package release information
5299 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5300 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5301 -static do not do any dynamic linking of libtool libraries
5302 -version-info CURRENT[:REVISION[:AGE]]
5303 specify library version info [each variable defaults to 0]
5305 All other options (arguments beginning with \`-') are ignored.
5307 Every other argument is treated as a filename. Files ending in \`.la' are
5308 treated as uninstalled libtool libraries, other files are standard or library
5311 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5312 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5313 required, except when creating a convenience library.
5315 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5316 using \`ar' and \`ranlib', or on Windows using \`lib'.
5318 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5319 is created, otherwise an executable program is created."
5324 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5326 Remove libraries from an installation directory.
5328 RM is the name of the program to use to delete files associated with each FILE
5329 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5332 If FILE is a libtool library, all the files associated with it are deleted.
5333 Otherwise, only FILE itself is deleted using RM."
5337 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5344 $echo "Try \`$modename --help' for more information about other modes."