3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by (GNU a52dec 0.7.3)
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 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
32 # The HP-UX ksh and POSIX shell print the target directory to stdout
34 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
36 # ### BEGIN LIBTOOL CONFIG
38 # Libtool was configured on host heroine:
40 # Shell to use when invoking shell scripts.
43 # Whether or not to build shared libraries.
46 # Whether or not to build static libraries.
49 # Whether or not to add -lc for building shared libraries.
50 build_libtool_need_lc=yes
52 # Whether or not to optimize for fast installation.
56 host_alias=i686-pc-linux-gnu
57 host=i686-pc-linux-gnu
59 # An echo program that does not interpret backslashes.
66 # The default C compiler.
69 # Is the compiler the GNU C compiler?
72 # The linker used to build libraries.
75 # Whether we need hard or soft links.
78 # A BSD-compatible nm program.
81 # A symbol stripping program
84 # Used to examine libraries when file_magic_cmd begins "file"
87 # Used on cygwin: DLL creation program.
90 # Used on cygwin: object dumper.
93 # Used on cygwin: assembler.
96 # The name of the directory that contains temporary libtool files.
99 # How to create reloadable object files.
101 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
103 # How to pass a linker flag through the compiler.
106 # Object file suffix (normally "o").
109 # Old archive suffix (normally "a").
112 # Executable file suffix (normally "").
115 # Additional compiler flags for building library objects.
119 # Does compiler simultaneously support -c and -o options?
122 # Can we write directly to a .lo ?
125 # Must we lock files when doing compilation ?
128 # Do we need the lib prefix for modules?
131 # Do we need a version for libraries?
134 # Whether dlopen is supported.
135 dlopen_support=unknown
137 # Whether dlopen of programs is supported.
140 # Whether dlopen of statically linked programs is supported.
141 dlopen_self_static=unknown
143 # Compiler flag to prevent dynamic linking.
144 link_static_flag="-static"
146 # Compiler flag to turn off builtin functions.
147 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
149 # Compiler flag to allow reflexive dlopens.
150 export_dynamic_flag_spec="\${wl}--export-dynamic"
152 # Compiler flag to generate shared objects directly from archives.
153 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
155 # Compiler flag to generate thread-safe objects.
156 thread_safe_flag_spec=""
158 # Library versioning type.
161 # Format of library name prefix.
162 libname_spec="lib\$name"
164 # List of archive names. First name is the real one, the rest are links.
165 # The last name is the one that the linker finds with -lNAME.
166 library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
168 # The coded name of the library, if different from the real name.
169 soname_spec="\${libname}\${release}.so\$major"
171 # Commands used to build and install an old-style archive.
173 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
174 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
175 old_postuninstall_cmds=""
177 # Create an old-style archive from a shared archive.
178 old_archive_from_new_cmds=""
180 # Create a temporary old-style archive to link instead of a shared archive.
181 old_archive_from_expsyms_cmds=""
183 # Commands used to build and install a shared archive.
184 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
185 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
187 postuninstall_cmds=""
189 # Commands to strip libraries.
190 old_striplib="strip --strip-debug"
191 striplib="strip --strip-unneeded"
193 # Method to check whether dependent libraries are shared objects.
194 deplibs_check_method="pass_all"
196 # Command to use when deplibs_check_method == file_magic.
197 file_magic_cmd="\$MAGIC_CMD"
199 # Flag that allows shared libraries with undefined symbols to be built.
200 allow_undefined_flag=""
202 # Flag that forces no undefined symbols.
205 # Commands used to finish a libtool library installation in a directory.
206 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
208 # Same as above, but a single script fragment to be evaled but not shown.
211 # Take the output of nm and produce a listing of raw symbols and C names.
212 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
214 # Transform the output of nm in a proper C declaration
215 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
217 # Transform the output of nm in a C name address pair
218 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
220 # This is the shared library runtime path variable.
221 runpath_var=LD_RUN_PATH
223 # This is the shared library path variable.
224 shlibpath_var=LD_LIBRARY_PATH
226 # Is shlibpath searched before the hard-coded library search path?
227 shlibpath_overrides_runpath=no
229 # How to hardcode a shared library path into an executable.
230 hardcode_action=immediate
232 # Whether we should hardcode library paths into libraries.
233 hardcode_into_libs=yes
235 # Flag to hardcode $libdir into a binary during linking.
236 # This must work even if $libdir does not exist.
237 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
239 # Whether we need a single -rpath flag with a separated argument.
240 hardcode_libdir_separator=""
242 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
246 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
250 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
251 # the resulting binary.
252 hardcode_shlibpath_var=unsupported
254 # Variables whose values should be saved in libtool wrapper scripts and
255 # restored at relink time.
256 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
258 # Whether libtool must link a program against all its dependency libraries.
259 link_all_deplibs=unknown
261 # Compile-time system search path for libraries
262 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
264 # Run-time system search path for libraries
265 sys_lib_dlsearch_path_spec="/lib /usr/lib"
267 # Fix the shell variable $srcfile for the compiler.
270 # Set to yes if exported symbols are required.
271 always_export_symbols=no
273 # The commands to list exported symbols.
274 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
276 # The commands to extract the exported symbol list from a shared archive.
277 extract_expsyms_cmds=""
279 # Symbols that should not be listed in the preloaded symbols.
280 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
282 # Symbols that must always be exported.
285 # ### END LIBTOOL CONFIG
287 # ltmain.sh - Provide generalized library-building support services.
288 # NOTE: Changing this file will not affect anything until you rerun configure.
290 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
291 # Free Software Foundation, Inc.
292 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
294 # This program is free software; you can redistribute it and/or modify
295 # it under the terms of the GNU General Public License as published by
296 # the Free Software Foundation; either version 2 of the License, or
297 # (at your option) any later version.
299 # This program is distributed in the hope that it will be useful, but
300 # WITHOUT ANY WARRANTY; without even the implied warranty of
301 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
302 # General Public License for more details.
304 # You should have received a copy of the GNU General Public License
305 # along with this program; if not, write to the Free Software
306 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
308 # As a special exception to the GNU General Public License, if you
309 # distribute this file as part of a program that contains a
310 # configuration script generated by Autoconf, you may include it under
311 # the same distribution terms that you use for the rest of that program.
313 # Check that we have a working $echo.
314 if test "X$1" = X--no-reexec; then
315 # Discard the --no-reexec flag, and continue.
317 elif test "X$1" = X--fallback-echo; then
318 # Avoid inline document here, it may be left over
320 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
321 # Yippee, $echo works!
324 # Restart under the correct shell, and then maybe $echo will work.
325 exec $SHELL "$0" --no-reexec ${1+"$@"}
328 if test "X$1" = X--fallback-echo; then
329 # used as fallback echo
337 # The name of this program.
338 progname=`$echo "$0" | sed 's%^.*/%%'`
345 TIMESTAMP=" (1.922.2.79 2001/11/28 21:50:31)"
348 help="Try \`$progname --help' for more information."
349 magic="%%%MAGIC variable%%%"
354 # Sed substitution that helps us do robust quoting. It backslashifies
355 # metacharacters that are still active within double-quoted strings.
356 Xsed='sed -e 1s/^X//'
357 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
359 NL2SP='tr \015\012 \040\040'
362 # Only set LANG and LC_ALL to C if already set.
363 # These must not be set unconditionally because not all systems understand
364 # e.g. LANG=C (notably SCO).
365 # We save the old values to restore during execute mode.
366 if test "${LC_ALL+set}" = set; then
367 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
369 if test "${LANG+set}" = set; then
370 save_LANG="$LANG"; LANG=C; export LANG
373 # Make sure IFS has a sensible default
376 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
377 echo "$modename: not configured to build any kind of library" 1>&2
378 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
391 lo2o="s/\\.lo\$/.${objext}/"
392 o2lo="s/\\.${objext}\$/.lo/"
394 # Parse our command line options once, thoroughly.
401 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
405 # If the previous option needs an argument, assign it.
406 if test -n "$prev"; then
409 execute_dlfiles="$execute_dlfiles $arg"
421 # Have we seen a non-optional argument yet?
428 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
433 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
438 echo "$progname: enabling shell trace mode"
448 if test "$build_libtool_libs" = yes; then
449 echo "enable shared libraries"
451 echo "disable shared libraries"
453 if test "$build_old_libs" = yes; then
454 echo "enable static libraries"
456 echo "disable static libraries"
461 --finish) mode="finish" ;;
463 --mode) prevopt="--mode" prev=mode ;;
464 --mode=*) mode="$optarg" ;;
466 --preserve-dup-deps) duplicate_deps="yes" ;;
478 $echo "$modename: unrecognized option \`$arg'" 1>&2
490 if test -n "$prevopt"; then
491 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
496 # If this variable is set in any of the actions, the command in it
497 # will be execed at the end. This prevents here-documents from being
498 # left over by shells.
501 if test -z "$show_help"; then
503 # Infer the operation mode.
504 if test -z "$mode"; then
506 *cc | *++ | gcc* | *-gcc*)
518 *db | *dbx | *strace | *truss)
528 # If we have no mode, but dlfiles were specified, then do execute mode.
529 test -n "$execute_dlfiles" && mode=execute
531 # Just use the default operation mode.
532 if test -z "$mode"; then
533 if test -n "$nonopt"; then
534 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
536 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
543 # Only execute mode is allowed to have -dlopen flags.
544 if test -n "$execute_dlfiles" && test "$mode" != execute; then
545 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
550 # Change the help message to a mode-specific one.
552 help="Try \`$modename --help --mode=$mode' for more information."
554 # These modes are in order of execution frequency so that they run quickly.
556 # libtool compile mode
558 modename="$modename: compile"
559 # Get the compilation command and the source file.
572 # Aesthetically quote the previous argument.
574 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
577 # Double-quote args containing other shell metacharacters.
578 # Many Bourne shells cannot handle close brackets correctly
579 # in scan sets, so we specify it separately.
580 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
585 # Add the previous argument to base_compile.
586 if test -z "$base_compile"; then
587 base_compile="$lastarg"
589 base_compile="$base_compile $lastarg"
595 # Accept any command-line options.
598 if test "$user_target" != "no"; then
599 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
626 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
628 save_ifs="$IFS"; IFS=','
632 # Double-quote args containing other shell metacharacters.
633 # Many Bourne shells cannot handle close brackets correctly
634 # in scan sets, so we specify it separately.
636 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
640 lastarg="$lastarg $arg"
643 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
645 # Add the arguments to base_compile.
646 if test -z "$base_compile"; then
647 base_compile="$lastarg"
649 base_compile="$base_compile $lastarg"
657 # The next one is the -o target name
662 # We got the output file
669 # Accept the current argument as the source file.
673 # Aesthetically quote the previous argument.
675 # Backslashify any backslashes, double quotes, and dollar signs.
676 # These are the only characters that are still specially
677 # interpreted inside of double-quoted scrings.
678 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
680 # Double-quote args containing other shell metacharacters.
681 # Many Bourne shells cannot handle close brackets correctly
682 # in scan sets, so we specify it separately.
684 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
685 lastarg="\"$lastarg\""
689 # Add the previous argument to base_compile.
690 if test -z "$base_compile"; then
691 base_compile="$lastarg"
693 base_compile="$base_compile $lastarg"
701 # Get the name of the library object.
702 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
705 $echo "$modename: you must specify a target with \`-o'" 1>&2
710 # Recognize several different file suffixes.
711 # If the user specifies -o file.o, it is replaced with file.lo
726 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
729 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
731 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
736 if test -z "$base_compile"; then
737 $echo "$modename: you must specify a compilation command" 1>&2
742 # Delete any leftover library objects.
743 if test "$build_old_libs" = yes; then
744 removelist="$obj $libobj"
750 trap "$run $rm $removelist; exit 1" 1 2 15
752 # On Cygwin there's no "real" PIC flag so we must build both object types
754 cygwin* | mingw* | pw32* | os2*)
758 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
759 # non-PIC code in shared libraries is not supported
763 # Calculate the filename of the output object if compiler does
764 # not support -o with -c
765 if test "$compiler_c_o" = no; then
766 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
767 lockfile="$output_obj.lock"
768 removelist="$removelist $output_obj $lockfile"
769 trap "$run $rm $removelist; exit 1" 1 2 15
775 # Lock this critical section if it is needed
776 # We use this script file to make the link, it avoids creating a new file
777 if test "$need_locks" = yes; then
778 until $run ln "$0" "$lockfile" 2>/dev/null; do
779 $show "Waiting for $lockfile to be removed"
782 elif test "$need_locks" = warn; then
783 if test -f "$lockfile"; then
785 *** ERROR, $lockfile exists and contains:
786 `cat $lockfile 2>/dev/null`
788 This indicates that another process is trying to use the same
789 temporary object file, and libtool could not work around it because
790 your compiler does not support \`-c' and \`-o' together. If you
791 repeat this compilation, it may succeed, by chance, but you had better
792 avoid parallel builds (make -j) in this platform, or get a better
798 echo $srcfile > "$lockfile"
801 if test -n "$fix_srcfile_path"; then
802 eval srcfile=\"$fix_srcfile_path\"
805 # Only build a PIC object if we are building libtool libraries.
806 if test "$build_libtool_libs" = yes; then
807 # Without this assignment, base_compile gets emptied.
808 fbsd_hideous_sh_bug=$base_compile
810 if test "$pic_mode" != no; then
811 # All platforms use -DPIC, to notify preprocessed assembler code.
812 command="$base_compile $srcfile $pic_flag -DPIC"
814 # Don't build PIC code
815 command="$base_compile $srcfile"
817 if test "$build_old_libs" = yes; then
819 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
820 if test "X$dir" = "X$libobj"; then
825 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
827 if test -d "$dir"; then
834 if test $status -ne 0 && test ! -d $dir; then
839 if test "$compiler_o_lo" = yes; then
841 command="$command -o $output_obj"
842 elif test "$compiler_c_o" = yes; then
844 command="$command -o $output_obj"
847 $run $rm "$output_obj"
849 if $run eval "$command"; then :
851 test -n "$output_obj" && $run $rm $removelist
855 if test "$need_locks" = warn &&
856 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
858 *** ERROR, $lockfile contains:
859 `cat $lockfile 2>/dev/null`
861 but it should contain:
864 This indicates that another process is trying to use the same
865 temporary object file, and libtool could not work around it because
866 your compiler does not support \`-c' and \`-o' together. If you
867 repeat this compilation, it may succeed, by chance, but you had better
868 avoid parallel builds (make -j) in this platform, or get a better
875 # Just move the object if needed, then go on to compile the next one
876 if test x"$output_obj" != x"$libobj"; then
877 $show "$mv $output_obj $libobj"
878 if $run $mv $output_obj $libobj; then :
886 # If we have no pic_flag, then copy the object into place and finish.
887 if (test -z "$pic_flag" || test "$pic_mode" != default) &&
888 test "$build_old_libs" = yes; then
889 # Rename the .lo from within objdir to obj
890 if test -f $obj; then
895 $show "$mv $libobj $obj"
896 if $run $mv $libobj $obj; then :
903 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
904 if test "X$xdir" = "X$obj"; then
909 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
910 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
911 # Now arrange that obj and lo_libobj become the same file
912 $show "(cd $xdir && $LN_S $baseobj $libobj)"
913 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
914 # Unlock the critical section if it was locked
915 if test "$need_locks" != no; then
926 # Allow error messages only from the first compilation.
927 suppress_output=' >/dev/null 2>&1'
930 # Only build a position-dependent object if we build old libraries.
931 if test "$build_old_libs" = yes; then
932 if test "$pic_mode" != yes; then
933 # Don't build PIC code
934 command="$base_compile $srcfile"
936 # All platforms use -DPIC, to notify preprocessed assembler code.
937 command="$base_compile $srcfile $pic_flag -DPIC"
939 if test "$compiler_c_o" = yes; then
940 command="$command -o $obj"
944 # Suppress compiler output if we already did a PIC compilation.
945 command="$command$suppress_output"
946 $run $rm "$output_obj"
948 if $run eval "$command"; then :
954 if test "$need_locks" = warn &&
955 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
957 *** ERROR, $lockfile contains:
958 `cat $lockfile 2>/dev/null`
960 but it should contain:
963 This indicates that another process is trying to use the same
964 temporary object file, and libtool could not work around it because
965 your compiler does not support \`-c' and \`-o' together. If you
966 repeat this compilation, it may succeed, by chance, but you had better
967 avoid parallel builds (make -j) in this platform, or get a better
974 # Just move the object if needed
975 if test x"$output_obj" != x"$obj"; then
976 $show "$mv $output_obj $obj"
977 if $run $mv $output_obj $obj; then :
985 # Create an invalid libtool object if no PIC, so that we do not
986 # accidentally link it into a program.
987 if test "$build_libtool_libs" != yes; then
988 $show "echo timestamp > $libobj"
989 $run eval "echo timestamp > \$libobj" || exit $?
991 # Move the .lo from within objdir
992 $show "$mv $libobj $lo_libobj"
993 if $run $mv $libobj $lo_libobj; then :
1002 # Unlock the critical section if it was locked
1003 if test "$need_locks" != no; then
1004 $run $rm "$lockfile"
1012 modename="$modename: link"
1014 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1015 # It is impossible to link a dll without this setting, and
1016 # we shouldn't force the makefile maintainer to figure out
1017 # which system we are compiling for in order to pass an extra
1018 # flag for every libtool invokation.
1019 # allow_undefined=no
1021 # FIXME: Unfortunately, there are problems with the above when trying
1022 # to make a dll which has undefined symbols, in which case not
1023 # even a static library is built. For now, we need to specify
1024 # -no-undefined on the libtool link line when we can be certain
1025 # that all symbols are satisfied, otherwise we get a static library.
1032 libtool_args="$nonopt"
1033 compile_command="$nonopt"
1034 finalize_command="$nonopt"
1047 lib_search_path=`pwd`
1055 export_symbols_regex=
1062 prefer_static_libs=no
1074 # We need to know -static, to get the right output filenames.
1078 -all-static | -static)
1079 if test "X$arg" = "X-all-static"; then
1080 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1081 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1083 if test -n "$link_static_flag"; then
1084 dlopen_self=$dlopen_self_static
1087 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1088 dlopen_self=$dlopen_self_static
1091 build_libtool_libs=no
1093 prefer_static_libs=yes
1099 # See if our shared archives depend on static archives.
1100 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1102 # Go through the arguments, transforming them on the way.
1103 while test $# -gt 0; do
1107 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1108 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1112 libtool_args="$libtool_args $qarg"
1114 # If the previous option needs an argument, assign it.
1115 if test -n "$prev"; then
1118 compile_command="$compile_command @OUTPUT@"
1119 finalize_command="$finalize_command @OUTPUT@"
1125 if test "$preload" = no; then
1126 # Add the symbol object into the linking commands.
1127 compile_command="$compile_command @SYMFILE@"
1128 finalize_command="$finalize_command @SYMFILE@"
1132 *.la | *.lo) ;; # We handle these cases below.
1134 if test "$dlself" = no; then
1142 if test "$prev" = dlprefiles; then
1144 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1154 if test "$prev" = dlfiles; then
1155 dlfiles="$dlfiles $arg"
1157 dlprefiles="$dlprefiles $arg"
1165 export_symbols="$arg"
1166 if test ! -f "$arg"; then
1167 $echo "$modename: symbol file \`$arg' does not exist"
1174 export_symbols_regex="$arg"
1184 # We need an absolute path.
1186 [\\/]* | [A-Za-z]:[\\/]*) ;;
1188 $echo "$modename: only absolute run-paths are allowed" 1>&2
1192 if test "$prev" = rpath; then
1195 *) rpath="$rpath $arg" ;;
1200 *) xrpath="$xrpath $arg" ;;
1207 compiler_flags="$compiler_flags $qarg"
1209 compile_command="$compile_command $qarg"
1210 finalize_command="$finalize_command $qarg"
1214 linker_flags="$linker_flags $qarg"
1215 compiler_flags="$compiler_flags $wl$qarg"
1217 compile_command="$compile_command $wl$qarg"
1218 finalize_command="$finalize_command $wl$qarg"
1222 eval "$prev=\"\$arg\""
1233 if test -n "$link_static_flag"; then
1234 compile_command="$compile_command $link_static_flag"
1235 finalize_command="$finalize_command $link_static_flag"
1241 # FIXME: remove this flag sometime in the future.
1242 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1266 -export-symbols | -export-symbols-regex)
1267 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1268 $echo "$modename: more than one -exported-symbols argument is not allowed"
1271 if test "X$arg" = "X-export-symbols"; then
1279 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1280 # so, if we see these flags be careful not to treat them like -L
1282 case $with_gcc/$host in
1283 no/*-*-irix* | no/*-*-nonstopux*)
1284 compile_command="$compile_command $arg"
1285 finalize_command="$finalize_command $arg"
1292 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1293 # We need an absolute path.
1295 [\\/]* | [A-Za-z]:[\\/]*) ;;
1297 absdir=`cd "$dir" && pwd`
1298 if test -z "$absdir"; then
1299 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1308 deplibs="$deplibs -L$dir"
1309 lib_search_path="$lib_search_path $dir"
1313 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1314 case :$dllsearchpath: in
1316 *) dllsearchpath="$dllsearchpath:$dir";;
1324 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1326 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1327 # These systems don't actually have a C or math library (as such)
1330 *-*-mingw* | *-*-os2*)
1331 # These systems don't actually have a C library (as such)
1332 test "X$arg" = "X-lc" && continue
1334 *-*-openbsd* | *-*-freebsd*)
1335 # Do not include libc due to us having libc/libc_r.
1336 test "X$arg" = "X-lc" && continue
1339 elif test "X$arg" = "X-lc_r"; then
1341 *-*-openbsd* | *-*-freebsd*)
1342 # Do not include libc_r directly, use -pthread flag.
1347 deplibs="$deplibs $arg"
1363 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1364 # The PATH hackery in wrapper scripts is required on Windows
1365 # in order for the loader to find any dlls it needs.
1366 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1367 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1370 *) no_install=yes ;;
1398 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1399 # We need an absolute path.
1401 [\\/]* | [A-Za-z]:[\\/]*) ;;
1403 $echo "$modename: only absolute run-paths are allowed" 1>&2
1409 *) xrpath="$xrpath $dir" ;;
1415 # The effects of -static are defined in a previous loop.
1416 # We used to do the same as -all-static on platforms that
1417 # didn't have a PIC flag, but the assumption that the effects
1418 # would be equivalent was wrong. It would break on at least
1419 # Digital Unix and AIX.
1434 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1436 save_ifs="$IFS"; IFS=','
1437 for flag in $args; do
1440 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1445 compiler_flags="$compiler_flags $flag"
1448 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1452 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1454 save_ifs="$IFS"; IFS=','
1455 for flag in $args; do
1458 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1463 compiler_flags="$compiler_flags $wl$flag"
1464 linker_flags="$linker_flags $flag"
1467 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1480 # Some other compiler flag.
1482 # Unknown arguments in both finalize_command and compile_command need
1483 # to be aesthetically quoted because they are evaled later.
1484 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1486 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1493 # A library or standard object.
1494 if test "$prev" = dlfiles; then
1495 # This file was specified with -dlopen.
1496 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1497 dlfiles="$dlfiles $arg"
1501 # If libtool objects are unsupported, then we need to preload.
1506 if test "$prev" = dlprefiles; then
1507 # Preload the old-style object.
1508 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1512 *.lo) libobjs="$libobjs $arg" ;;
1513 *) objs="$objs $arg" ;;
1520 deplibs="$deplibs $arg"
1521 old_deplibs="$old_deplibs $arg"
1526 # A libtool-controlled library.
1528 if test "$prev" = dlfiles; then
1529 # This library was specified with -dlopen.
1530 dlfiles="$dlfiles $arg"
1532 elif test "$prev" = dlprefiles; then
1533 # The library was specified with -dlpreopen.
1534 dlprefiles="$dlprefiles $arg"
1537 deplibs="$deplibs $arg"
1542 # Some other compiler argument.
1544 # Unknown arguments in both finalize_command and compile_command need
1545 # to be aesthetically quoted because they are evaled later.
1546 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1548 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1555 # Now actually substitute the argument into the commands.
1556 if test -n "$arg"; then
1557 compile_command="$compile_command $arg"
1558 finalize_command="$finalize_command $arg"
1560 done # argument parsing loop
1562 if test -n "$prev"; then
1563 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1568 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1569 eval arg=\"$export_dynamic_flag_spec\"
1570 compile_command="$compile_command $arg"
1571 finalize_command="$finalize_command $arg"
1574 # calculate the name of the file, without its directory
1575 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1576 libobjs_save="$libobjs"
1578 if test -n "$shlibpath_var"; then
1579 # get the directories listed in $shlibpath_var
1580 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1584 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1585 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1587 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1588 if test "X$output_objdir" = "X$output"; then
1589 output_objdir="$objdir"
1591 output_objdir="$output_objdir/$objdir"
1593 # Create the object directory.
1594 if test ! -d $output_objdir; then
1595 $show "$mkdir $output_objdir"
1596 $run $mkdir $output_objdir
1598 if test $status -ne 0 && test ! -d $output_objdir; then
1603 # Determine the type of output
1606 $echo "$modename: you must specify an output file" 1>&2
1610 *.$libext) linkmode=oldlib ;;
1611 *.lo | *.$objext) linkmode=obj ;;
1612 *.la) linkmode=lib ;;
1613 *) linkmode=prog ;; # Anything else should be a program.
1618 # Find all interdependent deplibs by searching for libraries
1619 # that are linked more than once (e.g. -la -lb -la)
1620 for deplib in $deplibs; do
1621 if test "X$duplicate_deps" = "Xyes" ; then
1623 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1626 libs="$libs $deplib"
1631 need_relink=no # whether we're linking any uninstalled libtool libraries
1632 notinst_deplibs= # not-installed libtool libraries
1633 notinst_path= # paths that contain not-installed libtool libraries
1637 for file in $dlfiles $dlprefiles; do
1641 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1653 passes="conv scan dlopen dlpreopen link"
1658 for pass in $passes; do
1659 if test $linkmode = prog; then
1660 # Determine which files to process
1664 save_deplibs="$deplibs" # Collect dlpreopened libraries
1667 dlpreopen) libs="$dlprefiles" ;;
1668 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1671 for deplib in $libs; do
1676 if test $linkmode = oldlib && test $linkmode = obj; then
1677 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1680 if test $pass = conv; then
1681 deplibs="$deplib $deplibs"
1684 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1685 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1686 # Search the libtool library
1687 lib="$searchdir/lib${name}.la"
1688 if test -f "$lib"; then
1693 if test "$found" != yes; then
1694 # deplib doesn't seem to be a libtool library
1695 if test "$linkmode,$pass" = "prog,link"; then
1696 compile_deplibs="$deplib $compile_deplibs"
1697 finalize_deplibs="$deplib $finalize_deplibs"
1699 deplibs="$deplib $deplibs"
1700 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1708 deplibs="$deplib $deplibs"
1709 test $pass = conv && continue
1710 newdependency_libs="$deplib $newdependency_libs"
1711 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1714 if test $pass = conv; then
1715 deplibs="$deplib $deplibs"
1718 if test $pass = scan; then
1719 deplibs="$deplib $deplibs"
1720 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1722 compile_deplibs="$deplib $compile_deplibs"
1723 finalize_deplibs="$deplib $finalize_deplibs"
1727 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1733 if test $pass = link; then
1734 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1735 # Make sure the xrpath contains only unique directories.
1738 *) xrpath="$xrpath $dir" ;;
1741 deplibs="$deplib $deplibs"
1744 *.la) lib="$deplib" ;;
1746 if test $pass = conv; then
1747 deplibs="$deplib $deplibs"
1752 if test "$deplibs_check_method" != pass_all; then
1754 echo "*** Warning: Trying to link with static lib archive $deplib."
1755 echo "*** I have the capability to make that library automatically link in when"
1756 echo "*** you link to this library. But I can only do this if you have a"
1757 echo "*** shared version of the library, which you do not appear to have"
1758 echo "*** because the file extensions .$libext of this argument makes me believe"
1759 echo "*** that it is just a static archive that I should not used here."
1762 echo "*** Warning: Linking the shared library $output against the"
1763 echo "*** static library $deplib is not portable!"
1764 deplibs="$deplib $deplibs"
1769 if test $pass != link; then
1770 deplibs="$deplib $deplibs"
1772 compile_deplibs="$deplib $compile_deplibs"
1773 finalize_deplibs="$deplib $finalize_deplibs"
1780 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1781 # If there is no dlopen support or we're linking statically,
1782 # we need to preload.
1783 newdlprefiles="$newdlprefiles $deplib"
1784 compile_deplibs="$deplib $compile_deplibs"
1785 finalize_deplibs="$deplib $finalize_deplibs"
1787 newdlfiles="$newdlfiles $deplib"
1796 if test $found = yes || test -f "$lib"; then :
1798 $echo "$modename: cannot find the library \`$lib'" 1>&2
1802 # Check to see that this really is a libtool archive.
1803 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1805 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1809 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1810 test "X$ladir" = "X$lib" && ladir="."
1818 # If the library was installed with an old release of libtool,
1819 # it will not redefine variable installed.
1824 */* | *\\*) . $lib ;;
1828 if test "$linkmode,$pass" = "lib,link" ||
1829 test "$linkmode,$pass" = "prog,scan" ||
1830 { test $linkmode = oldlib && test $linkmode = obj; }; then
1831 # Add dl[pre]opened files of deplib
1832 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1833 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1836 if test $pass = conv; then
1837 # Only check for convenience libraries
1838 deplibs="$lib $deplibs"
1839 if test -z "$libdir"; then
1840 if test -z "$old_library"; then
1841 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1844 # It is a libtool convenience library, so add in its objects.
1845 convenience="$convenience $ladir/$objdir/$old_library"
1846 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1848 for deplib in $dependency_libs; do
1849 deplibs="$deplib $deplibs"
1850 if test "X$duplicate_deps" = "Xyes" ; then
1851 case "$tmp_libs " in
1852 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1855 tmp_libs="$tmp_libs $deplib"
1857 elif test $linkmode != prog && test $linkmode != lib; then
1858 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1864 # Get the name of the library we link against.
1866 for l in $old_library $library_names; do
1869 if test -z "$linklib"; then
1870 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1874 # This library was specified with -dlopen.
1875 if test $pass = dlopen; then
1876 if test -z "$libdir"; then
1877 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1880 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1881 # If there is no dlname, no dlopen support or we're linking
1882 # statically, we need to preload.
1883 dlprefiles="$dlprefiles $lib"
1885 newdlfiles="$newdlfiles $lib"
1890 # We need an absolute path.
1892 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1894 abs_ladir=`cd "$ladir" && pwd`
1895 if test -z "$abs_ladir"; then
1896 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1897 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1902 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1904 # Find the relevant object directory and library name.
1905 if test "X$installed" = Xyes; then
1906 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1907 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1916 dir="$ladir/$objdir"
1917 absdir="$abs_ladir/$objdir"
1918 # Remove this search path later
1919 notinst_path="$notinst_path $abs_ladir"
1920 fi # $installed = yes
1921 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1923 # This library was specified with -dlpreopen.
1924 if test $pass = dlpreopen; then
1925 if test -z "$libdir"; then
1926 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1929 # Prefer using a static library (so that no silly _DYNAMIC symbols
1930 # are required to link).
1931 if test -n "$old_library"; then
1932 newdlprefiles="$newdlprefiles $dir/$old_library"
1933 # Otherwise, use the dlname, so that lt_dlopen finds it.
1934 elif test -n "$dlname"; then
1935 newdlprefiles="$newdlprefiles $dir/$dlname"
1937 newdlprefiles="$newdlprefiles $dir/$linklib"
1939 fi # $pass = dlpreopen
1941 if test -z "$libdir"; then
1942 # Link the convenience library
1943 if test $linkmode = lib; then
1944 deplibs="$dir/$old_library $deplibs"
1945 elif test "$linkmode,$pass" = "prog,link"; then
1946 compile_deplibs="$dir/$old_library $compile_deplibs"
1947 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1949 deplibs="$lib $deplibs"
1954 if test $linkmode = prog && test $pass != link; then
1955 newlib_search_path="$newlib_search_path $ladir"
1956 deplibs="$lib $deplibs"
1959 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1960 test "$build_libtool_libs" = no; then
1965 for deplib in $dependency_libs; do
1967 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1969 # Need to link against all dependency_libs?
1970 if test $linkalldeplibs = yes; then
1971 deplibs="$deplib $deplibs"
1973 # Need to hardcode shared library paths
1974 # or/and link against static libraries
1975 newdependency_libs="$deplib $newdependency_libs"
1977 if test "X$duplicate_deps" = "Xyes" ; then
1978 case "$tmp_libs " in
1979 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1982 tmp_libs="$tmp_libs $deplib"
1985 fi # $linkmode = prog...
1987 link_static=no # Whether the deplib will be linked statically
1988 if test -n "$library_names" &&
1989 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1990 # Link against this shared library
1992 if test "$linkmode,$pass" = "prog,link" ||
1993 { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1994 # Hardcode the library path.
1995 # Skip directories that are in the system default run-time
1997 case " $sys_lib_dlsearch_path " in
2000 case "$compile_rpath " in
2002 *) compile_rpath="$compile_rpath $absdir"
2006 case " $sys_lib_dlsearch_path " in
2009 case "$finalize_rpath " in
2011 *) finalize_rpath="$finalize_rpath $libdir"
2015 if test $linkmode = prog; then
2016 # We need to hardcode the library path
2017 if test -n "$shlibpath_var"; then
2018 # Make sure the rpath contains only unique directories.
2019 case "$temp_rpath " in
2022 *) temp_rpath="$temp_rpath $dir" ;;
2026 fi # $linkmode,$pass = prog,link...
2028 if test "$alldeplibs" = yes &&
2029 { test "$deplibs_check_method" = pass_all ||
2030 { test "$build_libtool_libs" = yes &&
2031 test -n "$library_names"; }; }; then
2032 # We only need to search for static libraries
2036 if test "$installed" = no; then
2037 notinst_deplibs="$notinst_deplibs $lib"
2041 if test -n "$old_archive_from_expsyms_cmds"; then
2042 # figure out the soname
2043 set dummy $library_names
2046 libname=`eval \\$echo \"$libname_spec\"`
2047 # use dlname if we got it. it's perfectly good, no?
2048 if test -n "$dlname"; then
2050 elif test -n "$soname_spec"; then
2054 major=`expr $current - $age`
2058 eval soname=\"$soname_spec\"
2063 # Make a new name for the extract_expsyms_cmds to use
2065 soname=`echo $soroot | sed -e 's/^.*\///'`
2066 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2068 # If the library has no export list, then create one now
2069 if test -f "$output_objdir/$soname-def"; then :
2071 $show "extracting exported symbol list from \`$soname'"
2072 save_ifs="$IFS"; IFS='~'
2073 eval cmds=\"$extract_expsyms_cmds\"
2074 for cmd in $cmds; do
2077 $run eval "$cmd" || exit $?
2083 if test -f "$output_objdir/$newlib"; then :; else
2084 $show "generating import library for \`$soname'"
2085 save_ifs="$IFS"; IFS='~'
2086 eval cmds=\"$old_archive_from_expsyms_cmds\"
2087 for cmd in $cmds; do
2090 $run eval "$cmd" || exit $?
2094 # make sure the library variables are pointing to the new library
2097 fi # test -n $old_archive_from_expsyms_cmds
2099 if test $linkmode = prog || test "$mode" != relink; then
2104 case $hardcode_action in
2105 immediate | unsupported)
2106 if test "$hardcode_direct" = no; then
2108 elif test "$hardcode_minus_L" = no; then
2110 *-*-sunos*) add_shlibpath="$dir" ;;
2114 elif test "$hardcode_shlibpath_var" = no; then
2115 add_shlibpath="$dir"
2122 if test "$hardcode_direct" = yes; then
2124 elif test "$hardcode_minus_L" = yes; then
2127 elif test "$hardcode_shlibpath_var" = yes; then
2128 add_shlibpath="$dir"
2137 if test "$lib_linked" != yes; then
2138 $echo "$modename: configuration error: unsupported hardcode properties"
2142 if test -n "$add_shlibpath"; then
2143 case :$compile_shlibpath: in
2144 *":$add_shlibpath:"*) ;;
2145 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2148 if test $linkmode = prog; then
2149 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2150 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2152 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2153 test -n "$add" && deplibs="$add $deplibs"
2154 if test "$hardcode_direct" != yes && \
2155 test "$hardcode_minus_L" != yes && \
2156 test "$hardcode_shlibpath_var" = yes; then
2157 case :$finalize_shlibpath: in
2159 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2165 if test $linkmode = prog || test "$mode" = relink; then
2169 # Finalize command for both is simple: just hardcode it.
2170 if test "$hardcode_direct" = yes; then
2171 add="$libdir/$linklib"
2172 elif test "$hardcode_minus_L" = yes; then
2175 elif test "$hardcode_shlibpath_var" = yes; then
2176 case :$finalize_shlibpath: in
2178 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2182 # We cannot seem to hardcode it, guess we'll fake it.
2187 if test $linkmode = prog; then
2188 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2189 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2191 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2192 test -n "$add" && deplibs="$add $deplibs"
2195 elif test $linkmode = prog; then
2196 if test "$alldeplibs" = yes &&
2197 { test "$deplibs_check_method" = pass_all ||
2198 { test "$build_libtool_libs" = yes &&
2199 test -n "$library_names"; }; }; then
2200 # We only need to search for static libraries
2204 # Try to link the static library
2205 # Here we assume that one of hardcode_direct or hardcode_minus_L
2206 # is not unsupported. This is valid on all known static and
2208 if test "$hardcode_direct" != unsupported; then
2209 test -n "$old_library" && linklib="$old_library"
2210 compile_deplibs="$dir/$linklib $compile_deplibs"
2211 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2213 compile_deplibs="-l$name -L$dir $compile_deplibs"
2214 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2216 elif test "$build_libtool_libs" = yes; then
2217 # Not a shared library
2218 if test "$deplibs_check_method" != pass_all; then
2219 # We're trying link a shared library against a static one
2220 # but the system doesn't support it.
2222 # Just print a warning and add the library to dependency_libs so
2223 # that the program can be linked against the static library.
2225 echo "*** Warning: This system can not link to static lib archive $lib."
2226 echo "*** I have the capability to make that library automatically link in when"
2227 echo "*** you link to this library. But I can only do this if you have a"
2228 echo "*** shared version of the library, which you do not appear to have."
2229 if test "$module" = yes; then
2230 echo "*** But as you try to build a module library, libtool will still create "
2231 echo "*** a static module, that should work as long as the dlopening application"
2232 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2233 if test -z "$global_symbol_pipe"; then
2235 echo "*** However, this would only work if libtool was able to extract symbol"
2236 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2237 echo "*** not find such a program. So, this module is probably useless."
2238 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2240 if test "$build_old_libs" = no; then
2241 build_libtool_libs=module
2244 build_libtool_libs=no
2248 convenience="$convenience $dir/$old_library"
2249 old_convenience="$old_convenience $dir/$old_library"
2250 deplibs="$dir/$old_library $deplibs"
2253 fi # link shared/static library?
2255 if test $linkmode = lib; then
2256 if test -n "$dependency_libs" &&
2257 { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2258 test $link_static = yes; }; then
2259 # Extract -R from dependency_libs
2261 for libdir in $dependency_libs; do
2263 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2265 *" $temp_xrpath "*) ;;
2266 *) xrpath="$xrpath $temp_xrpath";;
2268 *) temp_deplibs="$temp_deplibs $libdir";;
2271 dependency_libs="$temp_deplibs"
2274 newlib_search_path="$newlib_search_path $absdir"
2275 # Link against this library
2276 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2277 # ... and its dependency_libs
2279 for deplib in $dependency_libs; do
2280 newdependency_libs="$deplib $newdependency_libs"
2281 if test "X$duplicate_deps" = "Xyes" ; then
2282 case "$tmp_libs " in
2283 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2286 tmp_libs="$tmp_libs $deplib"
2289 if test $link_all_deplibs != no; then
2290 # Add the search paths of all dependency libraries
2291 for deplib in $dependency_libs; do
2293 -L*) path="$deplib" ;;
2295 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2296 test "X$dir" = "X$deplib" && dir="."
2297 # We need an absolute path.
2299 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2301 absdir=`cd "$dir" && pwd`
2302 if test -z "$absdir"; then
2303 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2308 if grep "^installed=no" $deplib > /dev/null; then
2309 path="-L$absdir/$objdir"
2311 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2312 if test -z "$libdir"; then
2313 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2316 if test "$absdir" != "$libdir"; then
2317 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2324 case " $deplibs " in
2326 *) deplibs="$deplibs $path" ;;
2329 fi # link_all_deplibs != no
2331 done # for deplib in $libs
2332 if test $pass = dlpreopen; then
2333 # Link the dlpreopened libraries before other libraries
2334 for deplib in $save_deplibs; do
2335 deplibs="$deplib $deplibs"
2338 if test $pass != dlopen; then
2339 test $pass != scan && dependency_libs="$newdependency_libs"
2340 if test $pass != conv; then
2341 # Make sure lib_search_path contains only unique directories.
2343 for dir in $newlib_search_path; do
2344 case "$lib_search_path " in
2346 *) lib_search_path="$lib_search_path $dir" ;;
2352 if test "$linkmode,$pass" != "prog,link"; then
2355 vars="compile_deplibs finalize_deplibs"
2357 for var in $vars dependency_libs; do
2358 # Add libraries to $var in reverse order
2359 eval tmp_libs=\"\$$var\"
2361 for deplib in $tmp_libs; do
2363 -L*) new_libs="$deplib $new_libs" ;;
2365 case " $specialdeplibs " in
2366 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2368 case " $new_libs " in
2370 *) new_libs="$deplib $new_libs" ;;
2378 for deplib in $new_libs; do
2381 case " $tmp_libs " in
2383 *) tmp_libs="$tmp_libs $deplib" ;;
2386 *) tmp_libs="$tmp_libs $deplib" ;;
2389 eval $var=\"$tmp_libs\"
2392 if test "$pass" = "conv" &&
2393 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2394 libs="$deplibs" # reset libs
2398 if test $linkmode = prog; then
2399 dlfiles="$newdlfiles"
2400 dlprefiles="$newdlprefiles"
2405 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2406 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2409 if test -n "$rpath"; then
2410 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2413 if test -n "$xrpath"; then
2414 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2417 if test -n "$vinfo"; then
2418 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2421 if test -n "$release"; then
2422 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2425 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2426 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2429 # Now set the variables for building old libraries.
2430 build_libtool_libs=no
2432 objs="$objs$old_deplibs"
2436 # Make sure we only generate libraries of the form `libNAME.la'.
2439 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2440 eval libname=\"$libname_spec\"
2443 if test "$module" = no; then
2444 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2448 if test "$need_lib_prefix" != no; then
2449 # Add the "lib" prefix for modules if required
2450 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2451 eval libname=\"$libname_spec\"
2453 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2458 if test -n "$objs"; then
2459 if test "$deplibs_check_method" != pass_all; then
2460 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2464 echo "*** Warning: Linking the shared library $output against the non-libtool"
2465 echo "*** objects $objs is not portable!"
2466 libobjs="$libobjs $objs"
2470 if test "$dlself" != no; then
2471 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2475 if test $# -gt 2; then
2476 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2481 if test -z "$rpath"; then
2482 if test "$build_libtool_libs" = yes; then
2483 # Building a libtool convenience library.
2485 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2486 build_libtool_libs=convenience
2490 if test -n "$vinfo"; then
2491 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2494 if test -n "$release"; then
2495 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2499 # Parse the version information argument.
2500 save_ifs="$IFS"; IFS=':'
2501 set dummy $vinfo 0 0 0
2504 if test -n "$8"; then
2505 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2514 # Check that each of the things are valid numbers.
2516 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2518 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2519 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2525 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2527 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2528 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2534 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2536 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2537 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2542 if test $age -gt $current; then
2543 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2544 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2548 # Calculate the version variables.
2552 case $version_type in
2556 # Like Linux, but with the current version available in
2557 # verstring for coding it into the library header
2558 major=.`expr $current - $age`
2559 versuffix="$major.$age.$revision"
2560 # Darwin ld doesn't like 0 for these options...
2561 minor_current=`expr $current + 1`
2562 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2567 versuffix=".$current.$revision";
2572 versuffix=".$current";
2576 case $version_type in
2577 nonstopux) verstring_prefix=nonstopux ;;
2578 *) verstring_prefix=sgi ;;
2580 verstring="$verstring_prefix$major.$revision"
2582 major=`expr $current - $age + 1`
2584 # Add in all the interfaces that we are compatible with.
2586 while test $loop != 0; do
2587 iface=`expr $revision - $loop`
2588 loop=`expr $loop - 1`
2589 verstring="$verstring_prefix$major.$iface:$verstring"
2592 # Before this point, $major must not contain `.'.
2594 versuffix="$major.$revision"
2598 major=.`expr $current - $age`
2599 versuffix="$major.$age.$revision"
2603 major=`expr $current - $age`
2604 versuffix=".$current.$age.$revision"
2605 verstring="$current.$age.$revision"
2607 # Add in all the interfaces that we are compatible with.
2609 while test $loop != 0; do
2610 iface=`expr $current - $loop`
2611 loop=`expr $loop - 1`
2612 verstring="$verstring:${iface}.0"
2615 # Make executables depend on our current version.
2616 verstring="$verstring:${current}.0"
2621 versuffix=".$current.$revision"
2625 # Use '-' rather than '.', since we only want one
2626 # extension on DOS 8.3 filesystems.
2627 major=`expr $current - $age`
2632 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2633 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2638 # Clear the version info if we defaulted, and they specified a release.
2639 if test -z "$vinfo" && test -n "$release"; then
2642 case $version_type in
2644 # we can't check for "0.0" in archive_cmds due to quoting
2645 # problems, so we reset it completely
2652 if test "$need_version" = no; then
2659 # Remove version info from name if versioning should be avoided
2660 if test "$avoid_version" = yes && test "$need_version" = no; then
2666 # Check to see if the archive will have undefined symbols.
2667 if test "$allow_undefined" = yes; then
2668 if test "$allow_undefined_flag" = unsupported; then
2669 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2670 build_libtool_libs=no
2674 # Don't allow undefined symbols.
2675 allow_undefined_flag="$no_undefined_flag"
2679 if test "$mode" != relink; then
2680 # Remove our outputs.
2681 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2682 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2685 # Now set the variables for building old libraries.
2686 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2687 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2689 # Transform .lo files to .o files.
2690 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2693 # Eliminate all temporary directories.
2694 for path in $notinst_path; do
2695 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2696 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2697 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2700 if test -n "$xrpath"; then
2701 # If the user specified any rpath flags, then add them.
2703 for libdir in $xrpath; do
2704 temp_xrpath="$temp_xrpath -R$libdir"
2705 case "$finalize_rpath " in
2707 *) finalize_rpath="$finalize_rpath $libdir" ;;
2710 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2711 dependency_libs="$temp_xrpath $dependency_libs"
2715 # Make sure dlfiles contains only unique files that won't be dlpreopened
2716 old_dlfiles="$dlfiles"
2718 for lib in $old_dlfiles; do
2719 case " $dlprefiles $dlfiles " in
2721 *) dlfiles="$dlfiles $lib" ;;
2725 # Make sure dlprefiles contains only unique files
2726 old_dlprefiles="$dlprefiles"
2728 for lib in $old_dlprefiles; do
2729 case "$dlprefiles " in
2731 *) dlprefiles="$dlprefiles $lib" ;;
2735 if test "$build_libtool_libs" = yes; then
2736 if test -n "$rpath"; then
2738 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2739 # these systems don't actually have a c library (as such)!
2741 *-*-rhapsody* | *-*-darwin1.[012])
2742 # Rhapsody C library is in the System framework
2743 deplibs="$deplibs -framework System"
2746 # Don't link with libc until the a.out ld.so is fixed.
2748 *-*-openbsd* | *-*-freebsd*)
2749 # Do not include libc due to us having libc/libc_r.
2752 # Add libc to deplibs on all other systems if necessary.
2753 if test $build_libtool_need_lc = "yes"; then
2754 deplibs="$deplibs -lc"
2760 # Transform deplibs into only deplibs that can be linked in shared.
2762 libname_save=$libname
2763 release_save=$release
2764 versuffix_save=$versuffix
2766 # I'm not sure if I'm treating the release correctly. I think
2767 # release should show up in the -l (ie -lgmp5) so we don't want to
2768 # add it in twice. Is that correct?
2774 case $deplibs_check_method in
2776 # Don't check for shared/static. Everything works.
2777 # This might be a little naive. We might want to check
2778 # whether the library exists or not. But this is on
2779 # osf3 & osf4 and I'm not really sure... Just
2780 # implementing what was already the behaviour.
2784 # This code stresses the "libraries are programs" paradigm to its
2785 # limits. Maybe even breaks it. We compile a program, linking it
2786 # against the deplibs as a proxy for the library. Then we can check
2787 # whether they linked in statically or dynamically with ldd.
2789 cat > conftest.c <<EOF
2790 int main() { return 0; }
2793 $CC -o conftest conftest.c $deplibs
2794 if test $? -eq 0 ; then
2795 ldd_output=`ldd conftest`
2796 for i in $deplibs; do
2797 name="`expr $i : '-l\(.*\)'`"
2798 # If $name is empty we are operating on a -L argument.
2799 if test -n "$name" && test "$name" != "0"; then
2800 libname=`eval \\$echo \"$libname_spec\"`
2801 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2802 set dummy $deplib_matches
2804 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2805 newdeplibs="$newdeplibs $i"
2809 echo "*** Warning: dynamic linker does not accept needed library $i."
2810 echo "*** I have the capability to make that library automatically link in when"
2811 echo "*** you link to this library. But I can only do this if you have a"
2812 echo "*** shared version of the library, which I believe you do not have"
2813 echo "*** because a test_compile did reveal that the linker did not use it for"
2814 echo "*** its dynamic dependency list that programs get resolved with at runtime."
2817 newdeplibs="$newdeplibs $i"
2821 # Error occured in the first compile. Let's try to salvage
2822 # the situation: Compile a separate program for each library.
2823 for i in $deplibs; do
2824 name="`expr $i : '-l\(.*\)'`"
2825 # If $name is empty we are operating on a -L argument.
2826 if test -n "$name" && test "$name" != "0"; then
2828 $CC -o conftest conftest.c $i
2830 if test $? -eq 0 ; then
2831 ldd_output=`ldd conftest`
2832 libname=`eval \\$echo \"$libname_spec\"`
2833 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2834 set dummy $deplib_matches
2836 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2837 newdeplibs="$newdeplibs $i"
2841 echo "*** Warning: dynamic linker does not accept needed library $i."
2842 echo "*** I have the capability to make that library automatically link in when"
2843 echo "*** you link to this library. But I can only do this if you have a"
2844 echo "*** shared version of the library, which you do not appear to have"
2845 echo "*** because a test_compile did reveal that the linker did not use this one"
2846 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2851 echo "*** Warning! Library $i is needed by this library but I was not able to"
2852 echo "*** make it link in! You will probably need to install it or some"
2853 echo "*** library that it depends on before this library will be fully"
2854 echo "*** functional. Installing it before continuing would be even better."
2857 newdeplibs="$newdeplibs $i"
2863 set dummy $deplibs_check_method
2864 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2865 for a_deplib in $deplibs; do
2866 name="`expr $a_deplib : '-l\(.*\)'`"
2867 # If $name is empty we are operating on a -L argument.
2868 if test -n "$name" && test "$name" != "0"; then
2869 libname=`eval \\$echo \"$libname_spec\"`
2870 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2871 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2872 for potent_lib in $potential_libs; do
2873 # Follow soft links.
2874 if ls -lLd "$potent_lib" 2>/dev/null \
2875 | grep " -> " >/dev/null; then
2878 # The statement above tries to avoid entering an
2879 # endless loop below, in case of cyclic links.
2880 # We might still enter an endless loop, since a link
2881 # loop can be closed while we follow links,
2883 potlib="$potent_lib"
2884 while test -h "$potlib" 2>/dev/null; do
2885 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2887 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2888 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2891 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2893 | egrep "$file_magic_regex" > /dev/null; then
2894 newdeplibs="$newdeplibs $a_deplib"
2900 if test -n "$a_deplib" ; then
2903 echo "*** Warning: linker path does not have real file for library $a_deplib."
2904 echo "*** I have the capability to make that library automatically link in when"
2905 echo "*** you link to this library. But I can only do this if you have a"
2906 echo "*** shared version of the library, which you do not appear to have"
2907 echo "*** because I did check the linker path looking for a file starting"
2908 if test -z "$potlib" ; then
2909 echo "*** with $libname but no candidates were found. (...for file magic test)"
2911 echo "*** with $libname and none of the candidates passed a file format test"
2912 echo "*** using a file magic. Last file checked: $potlib"
2916 # Add a -L argument.
2917 newdeplibs="$newdeplibs $a_deplib"
2919 done # Gone through all deplibs.
2922 set dummy $deplibs_check_method
2923 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2924 for a_deplib in $deplibs; do
2925 name="`expr $a_deplib : '-l\(.*\)'`"
2926 # If $name is empty we are operating on a -L argument.
2927 if test -n "$name" && test "$name" != "0"; then
2928 libname=`eval \\$echo \"$libname_spec\"`
2929 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2930 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2931 for potent_lib in $potential_libs; do
2932 potlib="$potent_lib" # see symlink-check below in file_magic test
2933 if eval echo \"$potent_lib\" 2>/dev/null \
2935 | egrep "$match_pattern_regex" > /dev/null; then
2936 newdeplibs="$newdeplibs $a_deplib"
2942 if test -n "$a_deplib" ; then
2945 echo "*** Warning: linker path does not have real file for library $a_deplib."
2946 echo "*** I have the capability to make that library automatically link in when"
2947 echo "*** you link to this library. But I can only do this if you have a"
2948 echo "*** shared version of the library, which you do not appear to have"
2949 echo "*** because I did check the linker path looking for a file starting"
2950 if test -z "$potlib" ; then
2951 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2953 echo "*** with $libname and none of the candidates passed a file format test"
2954 echo "*** using a regex pattern. Last file checked: $potlib"
2958 # Add a -L argument.
2959 newdeplibs="$newdeplibs $a_deplib"
2961 done # Gone through all deplibs.
2965 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2966 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2967 grep . >/dev/null; then
2969 if test "X$deplibs_check_method" = "Xnone"; then
2970 echo "*** Warning: inter-library dependencies are not supported in this platform."
2972 echo "*** Warning: inter-library dependencies are not known to be supported."
2974 echo "*** All declared inter-library dependencies are being dropped."
2979 versuffix=$versuffix_save
2981 release=$release_save
2982 libname=$libname_save
2986 *-*-rhapsody* | *-*-darwin1.[012])
2987 # On Rhapsody replace the C library is the System framework
2988 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2992 if test "$droppeddeps" = yes; then
2993 if test "$module" = yes; then
2995 echo "*** Warning: libtool could not satisfy all declared inter-library"
2996 echo "*** dependencies of module $libname. Therefore, libtool will create"
2997 echo "*** a static module, that should work as long as the dlopening"
2998 echo "*** application is linked with the -dlopen flag."
2999 if test -z "$global_symbol_pipe"; then
3001 echo "*** However, this would only work if libtool was able to extract symbol"
3002 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3003 echo "*** not find such a program. So, this module is probably useless."
3004 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3006 if test "$build_old_libs" = no; then
3007 oldlibs="$output_objdir/$libname.$libext"
3008 build_libtool_libs=module
3011 build_libtool_libs=no
3014 echo "*** The inter-library dependencies that have been dropped here will be"
3015 echo "*** automatically added whenever a program is linked with this library"
3016 echo "*** or is declared to -dlopen it."
3018 if test $allow_undefined = no; then
3020 echo "*** Since this library must not contain undefined symbols,"
3021 echo "*** because either the platform does not support them or"
3022 echo "*** it was explicitly requested with -no-undefined,"
3023 echo "*** libtool will only create a static version of it."
3024 if test "$build_old_libs" = no; then
3025 oldlibs="$output_objdir/$libname.$libext"
3026 build_libtool_libs=module
3029 build_libtool_libs=no
3034 # Done checking deplibs!
3038 # All the library-specific variables (install_libdir is set above).
3043 # Test again, we may have decided not to build it any more
3044 if test "$build_libtool_libs" = yes; then
3045 if test $hardcode_into_libs = yes; then
3046 # Hardcode the library paths
3049 rpath="$finalize_rpath"
3050 test "$mode" != relink && rpath="$compile_rpath$rpath"
3051 for libdir in $rpath; do
3052 if test -n "$hardcode_libdir_flag_spec"; then
3053 if test -n "$hardcode_libdir_separator"; then
3054 if test -z "$hardcode_libdirs"; then
3055 hardcode_libdirs="$libdir"
3057 # Just accumulate the unique libdirs.
3058 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3059 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3062 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3067 eval flag=\"$hardcode_libdir_flag_spec\"
3068 dep_rpath="$dep_rpath $flag"
3070 elif test -n "$runpath_var"; then
3071 case "$perm_rpath " in
3073 *) perm_rpath="$perm_rpath $libdir" ;;
3077 # Substitute the hardcoded libdirs into the rpath.
3078 if test -n "$hardcode_libdir_separator" &&
3079 test -n "$hardcode_libdirs"; then
3080 libdir="$hardcode_libdirs"
3081 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3083 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3084 # We should set the runpath_var.
3086 for dir in $perm_rpath; do
3089 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3091 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3094 shlibpath="$finalize_shlibpath"
3095 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3096 if test -n "$shlibpath"; then
3097 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3100 # Get the real and link names of the library.
3101 eval library_names=\"$library_names_spec\"
3102 set dummy $library_names
3106 if test -n "$soname_spec"; then
3107 eval soname=\"$soname_spec\"
3111 test -z "$dlname" && dlname=$soname
3113 lib="$output_objdir/$realname"
3116 linknames="$linknames $link"
3119 # Ensure that we have .o objects for linkers which dislike .lo
3120 # (e.g. aix) in case we are running --disable-static
3121 for obj in $libobjs; do
3122 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3123 if test "X$xdir" = "X$obj"; then
3128 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3129 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3130 if test ! -f $xdir/$oldobj; then
3131 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3132 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3136 # Use standard objects if they are pic
3137 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3139 # Prepare the list of exported symbols
3140 if test -z "$export_symbols"; then
3141 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3142 $show "generating symbol list for \`$libname.la'"
3143 export_symbols="$output_objdir/$libname.exp"
3144 $run $rm $export_symbols
3145 eval cmds=\"$export_symbols_cmds\"
3146 save_ifs="$IFS"; IFS='~'
3147 for cmd in $cmds; do
3150 $run eval "$cmd" || exit $?
3153 if test -n "$export_symbols_regex"; then
3154 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3155 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3156 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3157 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3162 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3163 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3166 if test -n "$convenience"; then
3167 if test -n "$whole_archive_flag_spec"; then
3168 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3170 gentop="$output_objdir/${outputname}x"
3171 $show "${rm}r $gentop"
3172 $run ${rm}r "$gentop"
3173 $show "mkdir $gentop"
3174 $run mkdir "$gentop"
3176 if test $status -ne 0 && test ! -d "$gentop"; then
3179 generated="$generated $gentop"
3181 for xlib in $convenience; do
3182 # Extract the objects.
3184 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3185 *) xabs=`pwd`"/$xlib" ;;
3187 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3188 xdir="$gentop/$xlib"
3190 $show "${rm}r $xdir"
3195 if test $status -ne 0 && test ! -d "$xdir"; then
3198 $show "(cd $xdir && $AR x $xabs)"
3199 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3201 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3206 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3207 eval flag=\"$thread_safe_flag_spec\"
3208 linker_flags="$linker_flags $flag"
3211 # Make a backup of the uninstalled library when relinking
3212 if test "$mode" = relink; then
3213 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3216 # Do each of the archive commands.
3217 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3218 eval cmds=\"$archive_expsym_cmds\"
3220 eval cmds=\"$archive_cmds\"
3222 save_ifs="$IFS"; IFS='~'
3223 for cmd in $cmds; do
3226 $run eval "$cmd" || exit $?
3230 # Restore the uninstalled library and exit
3231 if test "$mode" = relink; then
3232 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3236 # Create links to the real library.
3237 for linkname in $linknames; do
3238 if test "$realname" != "$linkname"; then
3239 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3240 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3244 # If -module or -export-dynamic was specified, set the dlname.
3245 if test "$module" = yes || test "$export_dynamic" = yes; then
3246 # On all known operating systems, these are identical.
3253 if test -n "$deplibs"; then
3254 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3257 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3258 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3261 if test -n "$rpath"; then
3262 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3265 if test -n "$xrpath"; then
3266 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3269 if test -n "$vinfo"; then
3270 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3273 if test -n "$release"; then
3274 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3279 if test -n "$objs$old_deplibs"; then
3280 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3284 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3292 # Delete the old objects.
3293 $run $rm $obj $libobj
3295 # Objects from convenience libraries. This assumes
3296 # single-version convenience libraries. Whenever we create
3297 # different ones for PIC/non-PIC, this we'll have to duplicate
3301 # reload_cmds runs $LD directly, so let us get rid of
3302 # -Wl from whole_archive_flag_spec
3305 if test -n "$convenience"; then
3306 if test -n "$whole_archive_flag_spec"; then
3307 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3309 gentop="$output_objdir/${obj}x"
3310 $show "${rm}r $gentop"
3311 $run ${rm}r "$gentop"
3312 $show "mkdir $gentop"
3313 $run mkdir "$gentop"
3315 if test $status -ne 0 && test ! -d "$gentop"; then
3318 generated="$generated $gentop"
3320 for xlib in $convenience; do
3321 # Extract the objects.
3323 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3324 *) xabs=`pwd`"/$xlib" ;;
3326 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3327 xdir="$gentop/$xlib"
3329 $show "${rm}r $xdir"
3334 if test $status -ne 0 && test ! -d "$xdir"; then
3337 $show "(cd $xdir && $AR x $xabs)"
3338 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3340 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3345 # Create the old-style object.
3346 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
3349 eval cmds=\"$reload_cmds\"
3350 save_ifs="$IFS"; IFS='~'
3351 for cmd in $cmds; do
3354 $run eval "$cmd" || exit $?
3358 # Exit if we aren't doing a library object file.
3359 if test -z "$libobj"; then
3360 if test -n "$gentop"; then
3361 $show "${rm}r $gentop"
3368 if test "$build_libtool_libs" != yes; then
3369 if test -n "$gentop"; then
3370 $show "${rm}r $gentop"
3374 # Create an invalid libtool object if no PIC, so that we don't
3375 # accidentally link it into a program.
3376 $show "echo timestamp > $libobj"
3377 $run eval "echo timestamp > $libobj" || exit $?
3381 if test -n "$pic_flag" || test "$pic_mode" != default; then
3382 # Only do commands if we really have different PIC objects.
3383 reload_objs="$libobjs $reload_conv_objs"
3385 eval cmds=\"$reload_cmds\"
3386 save_ifs="$IFS"; IFS='~'
3387 for cmd in $cmds; do
3390 $run eval "$cmd" || exit $?
3394 # Just create a symlink.
3397 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3398 if test "X$xdir" = "X$libobj"; then
3403 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3404 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3405 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3406 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3409 if test -n "$gentop"; then
3410 $show "${rm}r $gentop"
3419 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3421 if test -n "$vinfo"; then
3422 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3425 if test -n "$release"; then
3426 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3429 if test "$preload" = yes; then
3430 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3431 test "$dlopen_self_static" = unknown; then
3432 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3437 *-*-rhapsody* | *-*-darwin1.[012])
3438 # On Rhapsody replace the C library is the System framework
3439 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3440 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3444 compile_command="$compile_command $compile_deplibs"
3445 finalize_command="$finalize_command $finalize_deplibs"
3447 if test -n "$rpath$xrpath"; then
3448 # If the user specified any rpath flags, then add them.
3449 for libdir in $rpath $xrpath; do
3450 # This is the magic to use -rpath.
3451 case "$finalize_rpath " in
3453 *) finalize_rpath="$finalize_rpath $libdir" ;;
3458 # Now hardcode the library paths
3461 for libdir in $compile_rpath $finalize_rpath; do
3462 if test -n "$hardcode_libdir_flag_spec"; then
3463 if test -n "$hardcode_libdir_separator"; then
3464 if test -z "$hardcode_libdirs"; then
3465 hardcode_libdirs="$libdir"
3467 # Just accumulate the unique libdirs.
3468 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3469 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3472 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3477 eval flag=\"$hardcode_libdir_flag_spec\"
3478 rpath="$rpath $flag"
3480 elif test -n "$runpath_var"; then
3481 case "$perm_rpath " in
3483 *) perm_rpath="$perm_rpath $libdir" ;;
3487 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3488 case :$dllsearchpath: in
3490 *) dllsearchpath="$dllsearchpath:$libdir";;
3495 # Substitute the hardcoded libdirs into the rpath.
3496 if test -n "$hardcode_libdir_separator" &&
3497 test -n "$hardcode_libdirs"; then
3498 libdir="$hardcode_libdirs"
3499 eval rpath=\" $hardcode_libdir_flag_spec\"
3501 compile_rpath="$rpath"
3505 for libdir in $finalize_rpath; do
3506 if test -n "$hardcode_libdir_flag_spec"; then
3507 if test -n "$hardcode_libdir_separator"; then
3508 if test -z "$hardcode_libdirs"; then
3509 hardcode_libdirs="$libdir"
3511 # Just accumulate the unique libdirs.
3512 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3513 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3516 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3521 eval flag=\"$hardcode_libdir_flag_spec\"
3522 rpath="$rpath $flag"
3524 elif test -n "$runpath_var"; then
3525 case "$finalize_perm_rpath " in
3527 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3531 # Substitute the hardcoded libdirs into the rpath.
3532 if test -n "$hardcode_libdir_separator" &&
3533 test -n "$hardcode_libdirs"; then
3534 libdir="$hardcode_libdirs"
3535 eval rpath=\" $hardcode_libdir_flag_spec\"
3537 finalize_rpath="$rpath"
3539 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3540 # Transform all the library objects into standard objects.
3541 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3542 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3546 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3547 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3548 dlsyms="${outputname}S.c"
3550 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3554 if test -n "$dlsyms"; then
3558 # Discover the nlist of each of the dlfiles.
3559 nlist="$output_objdir/${outputname}.nm"
3561 $show "$rm $nlist ${nlist}S ${nlist}T"
3562 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3564 # Parse the name list into a source file.
3565 $show "creating $output_objdir/$dlsyms"
3567 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3568 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3569 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3575 /* Prevent the only kind of declaration conflicts we can make. */
3576 #define lt_preloaded_symbols some_other_symbol
3578 /* External symbol declarations for the compiler. */\
3581 if test "$dlself" = yes; then
3582 $show "generating symbol list for \`$output'"
3584 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3586 # Add our own program objects to the symbol list.
3587 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3588 for arg in $progfiles; do
3589 $show "extracting global C symbols from \`$arg'"
3590 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3593 if test -n "$exclude_expsyms"; then
3594 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3595 $run eval '$mv "$nlist"T "$nlist"'
3598 if test -n "$export_symbols_regex"; then
3599 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3600 $run eval '$mv "$nlist"T "$nlist"'
3603 # Prepare the list of exported symbols
3604 if test -z "$export_symbols"; then
3605 export_symbols="$output_objdir/$output.exp"
3606 $run $rm $export_symbols
3607 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3609 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3610 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3611 $run eval 'mv "$nlist"T "$nlist"'
3615 for arg in $dlprefiles; do
3616 $show "extracting global C symbols from \`$arg'"
3617 name=`echo "$arg" | sed -e 's%^.*/%%'`
3618 $run eval 'echo ": $name " >> "$nlist"'
3619 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3622 if test -z "$run"; then
3623 # Make sure we have at least an empty file.
3624 test -f "$nlist" || : > "$nlist"
3626 if test -n "$exclude_expsyms"; then
3627 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3628 $mv "$nlist"T "$nlist"
3631 # Try sorting and uniquifying the output.
3632 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3635 grep -v "^: " < "$nlist" > "$nlist"S
3638 if test -f "$nlist"S; then
3639 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3641 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3644 $echo >> "$output_objdir/$dlsyms" "\
3646 #undef lt_preloaded_symbols
3648 #if defined (__STDC__) && __STDC__
3649 # define lt_ptr void *
3651 # define lt_ptr char *
3655 /* The mapping between symbol names and symbols. */
3660 lt_preloaded_symbols[] =
3664 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3666 $echo >> "$output_objdir/$dlsyms" "\
3670 /* This works around a problem in FreeBSD linker */
3671 #ifdef FREEBSD_WORKAROUND
3672 static const void *lt_preloaded_setup() {
3673 return lt_preloaded_symbols;
3683 pic_flag_for_symtable=
3685 # compiling the symbol table file with pic_flag works around
3686 # a FreeBSD bug that causes programs to crash when -lm is
3687 # linked before any other PIC object. But we must not use
3688 # pic_flag when linking with -static. The problem exists in
3689 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3690 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3691 case "$compile_command " in
3693 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3696 case "$compile_command " in
3698 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3702 # Now compile the dynamic symbol file.
3703 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3704 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3706 # Clean up the generated files.
3707 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3708 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3710 # Transform the symbol file into the correct name.
3711 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3712 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3715 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3720 # We keep going just in case the user didn't refer to
3721 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3722 # really was required.
3724 # Nullify the symbol file.
3725 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3726 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3729 if test $need_relink = no || test "$build_libtool_libs" != yes; then
3730 # Replace the output file specification.
3731 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3732 link_command="$compile_command$compile_rpath"
3734 # We have no uninstalled library dependencies, so finalize right now.
3735 $show "$link_command"
3736 $run eval "$link_command"
3739 # Delete the generated files.
3740 if test -n "$dlsyms"; then
3741 $show "$rm $output_objdir/${outputname}S.${objext}"
3742 $run $rm "$output_objdir/${outputname}S.${objext}"
3748 if test -n "$shlibpath_var"; then
3749 # We should set the shlibpath_var
3751 for dir in $temp_rpath; do
3753 [\\/]* | [A-Za-z]:[\\/]*)
3758 # Relative path: add a thisdir entry.
3759 rpath="$rpath\$thisdir/$dir:"
3766 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3767 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3769 if test -n "$finalize_shlibpath"; then
3770 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3775 if test -n "$runpath_var"; then
3776 if test -n "$perm_rpath"; then
3777 # We should set the runpath_var.
3779 for dir in $perm_rpath; do
3782 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3784 if test -n "$finalize_perm_rpath"; then
3785 # We should set the runpath_var.
3787 for dir in $finalize_perm_rpath; do
3790 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3794 if test "$no_install" = yes; then
3795 # We don't need to create a wrapper script.
3796 link_command="$compile_var$compile_command$compile_rpath"
3797 # Replace the output file specification.
3798 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3799 # Delete the old output file.
3801 # Link the executable and exit
3802 $show "$link_command"
3803 $run eval "$link_command" || exit $?
3807 if test "$hardcode_action" = relink; then
3808 # Fast installation is not supported
3809 link_command="$compile_var$compile_command$compile_rpath"
3810 relink_command="$finalize_var$finalize_command$finalize_rpath"
3812 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3813 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3815 if test "$fast_install" != no; then
3816 link_command="$finalize_var$compile_command$finalize_rpath"
3817 if test "$fast_install" = yes; then
3818 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3820 # fast_install is set to needless
3824 link_command="$compile_var$compile_command$compile_rpath"
3825 relink_command="$finalize_var$finalize_command$finalize_rpath"
3829 # Replace the output file specification.
3830 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3832 # Delete the old output files.
3833 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3835 $show "$link_command"
3836 $run eval "$link_command" || exit $?
3838 # Now create the wrapper script.
3839 $show "creating $output"
3841 # Quote the relink command for shipping.
3842 if test -n "$relink_command"; then
3843 # Preserve any variables that may affect compiler behavior
3844 for var in $variables_saved_for_relink; do
3845 if eval test -z \"\${$var+set}\"; then
3846 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3847 elif eval var_value=\$$var; test -z "$var_value"; then
3848 relink_command="$var=; export $var; $relink_command"
3850 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3851 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3854 relink_command="(cd `pwd`; $relink_command)"
3855 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3858 # Quote $echo for shipping.
3859 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3861 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3862 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3864 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3866 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3869 # Only actually do things if our run command is non-null.
3870 if test -z "$run"; then
3871 # win32 will think the script is a binary if it has
3872 # a .exe suffix, so we strip it off here.
3874 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3876 # test for cygwin because mv fails w/o .exe extensions
3878 *cygwin*) exeext=.exe ;;
3882 trap "$rm $output; exit 1" 1 2 15
3887 # $output - temporary wrapper script for $objdir/$outputname
3888 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3890 # The $output program cannot be directly executed until all the libtool
3891 # libraries that it depends on are installed.
3893 # This wrapper script should never be moved out of the build directory.
3894 # If it is, it will not operate correctly.
3896 # Sed substitution that helps us do robust quoting. It backslashifies
3897 # metacharacters that are still active within double-quoted strings.
3898 Xsed='sed -e 1s/^X//'
3899 sed_quote_subst='$sed_quote_subst'
3901 # The HP-UX ksh and POSIX shell print the target directory to stdout
3903 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3905 relink_command=\"$relink_command\"
3907 # This environment variable determines our operation mode.
3908 if test \"\$libtool_install_magic\" = \"$magic\"; then
3909 # install mode needs the following variable:
3910 notinst_deplibs='$notinst_deplibs'
3912 # When we are sourced in execute mode, \$file and \$echo are already set.
3913 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3916 # Make sure echo works.
3917 if test \"X\$1\" = X--no-reexec; then
3918 # Discard the --no-reexec flag, and continue.
3920 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3921 # Yippee, \$echo works!
3924 # Restart under the correct shell, and then maybe \$echo will work.
3925 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3931 # Find the directory that this script lives in.
3932 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3933 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3935 # Follow symbolic links until we get to the real thisdir.
3936 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3937 while test -n \"\$file\"; do
3938 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3940 # If there was a directory component, then change thisdir.
3941 if test \"x\$destdir\" != \"x\$file\"; then
3942 case \"\$destdir\" in
3943 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3944 *) thisdir=\"\$thisdir/\$destdir\" ;;
3948 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3949 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3952 # Try to get the absolute directory name.
3953 absdir=\`cd \"\$thisdir\" && pwd\`
3954 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3957 if test "$fast_install" = yes; then
3959 program=lt-'$outputname'$exeext
3960 progdir=\"\$thisdir/$objdir\"
3962 if test ! -f \"\$progdir/\$program\" || \\
3963 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3964 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3966 file=\"\$\$-\$program\"
3968 if test ! -d \"\$progdir\"; then
3969 $mkdir \"\$progdir\"
3971 $rm \"\$progdir/\$file\"
3976 # relink executable if necessary
3977 if test -n \"\$relink_command\"; then
3978 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3980 $echo \"\$relink_command_output\" >&2
3981 $rm \"\$progdir/\$file\"
3986 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3987 { $rm \"\$progdir/\$program\";
3988 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3989 $rm \"\$progdir/\$file\"
3993 program='$outputname'
3994 progdir=\"\$thisdir/$objdir\"
4000 if test -f \"\$progdir/\$program\"; then"
4002 # Export our shlibpath_var if we have one.
4003 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4005 # Add our own library path to $shlibpath_var
4006 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4008 # Some systems cannot cope with colon-terminated $shlibpath_var
4009 # The second colon is a workaround for a bug in BeOS R4 sed
4010 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4012 export $shlibpath_var
4016 # fixup the dll searchpath if we need to.
4017 if test -n "$dllsearchpath"; then
4019 # Add the dll search path components to the executable PATH
4020 PATH=$dllsearchpath:\$PATH
4025 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4026 # Run the actual program with our arguments.
4029 # win32 systems need to use the prog path for dll
4031 *-*-cygwin* | *-*-pw32*)
4033 exec \$progdir/\$program \${1+\"\$@\"}
4037 # Backslashes separate directories on plain windows
4038 *-*-mingw | *-*-os2*)
4040 exec \$progdir\\\\\$program \${1+\"\$@\"}
4046 # Export the path to the program.
4047 PATH=\"\$progdir:\$PATH\"
4050 exec \$program \${1+\"\$@\"}
4055 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4059 # The program doesn't exist.
4060 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4061 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4062 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4073 # See if we need to build an old-fashioned archive.
4074 for oldlib in $oldlibs; do
4076 if test "$build_libtool_libs" = convenience; then
4077 oldobjs="$libobjs_save"
4078 addlibs="$convenience"
4079 build_libtool_libs=no
4081 if test "$build_libtool_libs" = module; then
4082 oldobjs="$libobjs_save"
4083 build_libtool_libs=no
4085 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4087 addlibs="$old_convenience"
4090 if test -n "$addlibs"; then
4091 gentop="$output_objdir/${outputname}x"
4092 $show "${rm}r $gentop"
4093 $run ${rm}r "$gentop"
4094 $show "mkdir $gentop"
4095 $run mkdir "$gentop"
4097 if test $status -ne 0 && test ! -d "$gentop"; then
4100 generated="$generated $gentop"
4102 # Add in members from convenience archives.
4103 for xlib in $addlibs; do
4104 # Extract the objects.
4106 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4107 *) xabs=`pwd`"/$xlib" ;;
4109 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4110 xdir="$gentop/$xlib"
4112 $show "${rm}r $xdir"
4117 if test $status -ne 0 && test ! -d "$xdir"; then
4120 $show "(cd $xdir && $AR x $xabs)"
4121 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4123 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4127 # Do each command in the archive commands.
4128 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4129 eval cmds=\"$old_archive_from_new_cmds\"
4131 # Ensure that we have .o objects in place in case we decided
4132 # not to build a shared library, and have fallen back to building
4133 # static libs even though --disable-static was passed!
4134 for oldobj in $oldobjs; do
4135 if test ! -f $oldobj; then
4136 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4137 if test "X$xdir" = "X$oldobj"; then
4142 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4143 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4144 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4145 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4149 eval cmds=\"$old_archive_cmds\"
4151 save_ifs="$IFS"; IFS='~'
4152 for cmd in $cmds; do
4155 $run eval "$cmd" || exit $?
4160 if test -n "$generated"; then
4161 $show "${rm}r$generated"
4162 $run ${rm}r$generated
4165 # Now create the libtool archive.
4169 test "$build_old_libs" = yes && old_library="$libname.$libext"
4170 $show "creating $output"
4172 # Preserve any variables that may affect compiler behavior
4173 for var in $variables_saved_for_relink; do
4174 if eval test -z \"\${$var+set}\"; then
4175 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4176 elif eval var_value=\$$var; test -z "$var_value"; then
4177 relink_command="$var=; export $var; $relink_command"
4179 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4180 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4183 # Quote the link command for shipping.
4184 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
4185 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4187 # Only create the output if not a dry run.
4188 if test -z "$run"; then
4189 for installed in no yes; do
4190 if test "$installed" = yes; then
4191 if test -z "$install_libdir"; then
4194 output="$output_objdir/$outputname"i
4195 # Replace all uninstalled libtool libraries with the installed ones
4197 for deplib in $dependency_libs; do
4200 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4201 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4202 if test -z "$libdir"; then
4203 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4206 newdependency_libs="$newdependency_libs $libdir/$name"
4208 *) newdependency_libs="$newdependency_libs $deplib" ;;
4211 dependency_libs="$newdependency_libs"
4213 for lib in $dlfiles; do
4214 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4215 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4216 if test -z "$libdir"; then
4217 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4220 newdlfiles="$newdlfiles $libdir/$name"
4222 dlfiles="$newdlfiles"
4224 for lib in $dlprefiles; do
4225 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4226 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4227 if test -z "$libdir"; then
4228 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4231 newdlprefiles="$newdlprefiles $libdir/$name"
4233 dlprefiles="$newdlprefiles"
4236 # place dlname in correct position for cygwin
4238 case $host,$output,$installed,$module,$dlname in
4239 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4242 # $outputname - a libtool library file
4243 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4245 # Please DO NOT delete this file!
4246 # It is necessary for linking the library.
4248 # The name that we can dlopen(3).
4251 # Names of this library.
4252 library_names='$library_names'
4254 # The name of the static archive.
4255 old_library='$old_library'
4257 # Libraries that this one depends upon.
4258 dependency_libs='$dependency_libs'
4260 # Version information for $libname.
4265 # Is this an already installed library?
4266 installed=$installed
4268 # Files to dlopen/dlpreopen
4270 dlpreopen='$dlprefiles'
4272 # Directory that this library needs to be installed in:
4273 libdir='$install_libdir'"
4274 if test "$installed" = no && test $need_relink = yes; then
4276 relink_command=\"$relink_command\""
4281 # Do a symbolic link so that the libtool archive can be found in
4282 # LD_LIBRARY_PATH before the program is installed.
4283 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4284 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4290 # libtool install mode
4292 modename="$modename: install"
4294 # There may be an optional sh(1) argument at the beginning of
4295 # install_prog (especially on Windows NT).
4296 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4297 # Allow the use of GNU shtool's install command.
4298 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4299 # Aesthetically quote it.
4300 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4302 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4306 install_prog="$arg "
4314 # The real first argument should be the name of the installation program.
4315 # Aesthetically quote it.
4316 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4318 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4322 install_prog="$install_prog$arg"
4324 # We need to accept at least all the BSD install flags.
4334 if test -n "$dest"; then
4335 files="$files $dest"
4353 # If the previous option needed an argument, then skip it.
4354 if test -n "$prev"; then
4363 # Aesthetically quote the argument.
4364 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4366 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4370 install_prog="$install_prog $arg"
4373 if test -z "$install_prog"; then
4374 $echo "$modename: you must specify an install program" 1>&2
4379 if test -n "$prev"; then
4380 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4385 if test -z "$files"; then
4386 if test -z "$dest"; then
4387 $echo "$modename: no file or destination specified" 1>&2
4389 $echo "$modename: you must specify a destination" 1>&2
4395 # Strip any trailing slash from the destination.
4396 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4398 # Check to see that the destination is a directory.
4399 test -d "$dest" && isdir=yes
4400 if test "$isdir" = yes; then
4404 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4405 test "X$destdir" = "X$dest" && destdir=.
4406 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4408 # Not a directory, so check to see that there is only one file specified.
4410 if test $# -gt 2; then
4411 $echo "$modename: \`$dest' is not a directory" 1>&2
4417 [\\/]* | [A-Za-z]:[\\/]*) ;;
4419 for file in $files; do
4423 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4432 # This variable tells wrapper scripts just to set variables rather
4433 # than running their programs.
4434 libtool_install_magic="$magic"
4439 for file in $files; do
4441 # Do each installation.
4444 # Do the static libraries later.
4445 staticlibs="$staticlibs $file"
4449 # Check to see that this really is a libtool archive.
4450 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4452 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4460 # If there is no directory component, then add one.
4462 */* | *\\*) . $file ;;
4466 # Add the libdir to current_libdirs if it is the destination.
4467 if test "X$destdir" = "X$libdir"; then
4468 case "$current_libdirs " in
4470 *) current_libdirs="$current_libdirs $libdir" ;;
4473 # Note the libdir as a future libdir.
4474 case "$future_libdirs " in
4476 *) future_libdirs="$future_libdirs $libdir" ;;
4480 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4481 test "X$dir" = "X$file/" && dir=
4484 if test -n "$relink_command"; then
4485 $echo "$modename: warning: relinking \`$file'" 1>&2
4486 $show "$relink_command"
4487 if $run eval "$relink_command"; then :
4489 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4494 # See the names of the shared library.
4495 set dummy $library_names
4496 if test -n "$2"; then
4502 test -n "$relink_command" && srcname="$realname"T
4504 # Install the shared library and build the symlinks.
4505 $show "$install_prog $dir/$srcname $destdir/$realname"
4506 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4507 if test -n "$stripme" && test -n "$striplib"; then
4508 $show "$striplib $destdir/$realname"
4509 $run eval "$striplib $destdir/$realname" || exit $?
4512 if test $# -gt 0; then
4513 # Delete the old symlinks, and create new ones.
4516 if test "$linkname" != "$realname"; then
4517 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4518 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4523 # Do each command in the postinstall commands.
4524 lib="$destdir/$realname"
4525 eval cmds=\"$postinstall_cmds\"
4526 save_ifs="$IFS"; IFS='~'
4527 for cmd in $cmds; do
4530 $run eval "$cmd" || exit $?
4535 # Install the pseudo-library for information purposes.
4536 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4537 instname="$dir/$name"i
4538 $show "$install_prog $instname $destdir/$name"
4539 $run eval "$install_prog $instname $destdir/$name" || exit $?
4541 # Maybe install the static library, too.
4542 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4546 # Install (i.e. copy) a libtool object.
4548 # Figure out destination file name, if it wasn't already specified.
4549 if test -n "$destname"; then
4550 destfile="$destdir/$destname"
4552 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4553 destfile="$destdir/$destfile"
4556 # Deduce the name of the destination old-style object file.
4559 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4562 staticdest="$destfile"
4566 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4572 # Install the libtool object if requested.
4573 if test -n "$destfile"; then
4574 $show "$install_prog $file $destfile"
4575 $run eval "$install_prog $file $destfile" || exit $?
4578 # Install the old object if enabled.
4579 if test "$build_old_libs" = yes; then
4580 # Deduce the name of the old-style object file.
4581 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4583 $show "$install_prog $staticobj $staticdest"
4584 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4590 # Figure out destination file name, if it wasn't already specified.
4591 if test -n "$destname"; then
4592 destfile="$destdir/$destname"
4594 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4595 destfile="$destdir/$destfile"
4598 # Do a test to see if this is really a libtool program.
4601 wrapper=`echo $file | sed -e 's,.exe$,,'`
4607 if (sed -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4611 # If there is no directory component, then add one.
4613 */* | *\\*) . $wrapper ;;
4617 # Check the variables that should have been set.
4618 if test -z "$notinst_deplibs"; then
4619 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4624 for lib in $notinst_deplibs; do
4625 # Check to see that each library is installed.
4627 if test -f "$lib"; then
4628 # If there is no directory component, then add one.
4630 */* | *\\*) . $lib ;;
4634 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4635 if test -n "$libdir" && test ! -f "$libfile"; then
4636 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4642 # If there is no directory component, then add one.
4644 */* | *\\*) . $wrapper ;;
4649 if test "$fast_install" = no && test -n "$relink_command"; then
4650 if test "$finalize" = yes && test -z "$run"; then
4652 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4653 tmpdir="$tmpdir/libtool-$$"
4654 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4656 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4659 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4660 outputname="$tmpdir/$file"
4661 # Replace the output file specification.
4662 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4664 $show "$relink_command"
4665 if $run eval "$relink_command"; then :
4667 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4673 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4676 # Install the binary that we compiled earlier.
4677 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4681 # remove .exe since cygwin /usr/bin/install will append another
4683 case $install_prog,$host in
4684 /usr/bin/install*,*cygwin*)
4685 case $file:$destfile in
4690 destfile=$destfile.exe
4693 destfile=`echo $destfile | sed -e 's,.exe$,,'`
4698 $show "$install_prog$stripme $file $destfile"
4699 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4700 test -n "$outputname" && ${rm}r "$tmpdir"
4705 for file in $staticlibs; do
4706 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4708 # Set up the ranlib parameters.
4709 oldlib="$destdir/$name"
4711 $show "$install_prog $file $oldlib"
4712 $run eval "$install_prog \$file \$oldlib" || exit $?
4714 if test -n "$stripme" && test -n "$striplib"; then
4715 $show "$old_striplib $oldlib"
4716 $run eval "$old_striplib $oldlib" || exit $?
4719 # Do each command in the postinstall commands.
4720 eval cmds=\"$old_postinstall_cmds\"
4721 save_ifs="$IFS"; IFS='~'
4722 for cmd in $cmds; do
4725 $run eval "$cmd" || exit $?
4730 if test -n "$future_libdirs"; then
4731 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4734 if test -n "$current_libdirs"; then
4735 # Maybe just do a dry run.
4736 test -n "$run" && current_libdirs=" -n$current_libdirs"
4737 exec_cmd='$SHELL $0 --finish$current_libdirs'
4743 # libtool finish mode
4745 modename="$modename: finish"
4749 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4752 libdirs="$libdirs $dir"
4755 for libdir in $libdirs; do
4756 if test -n "$finish_cmds"; then
4757 # Do each command in the finish commands.
4758 eval cmds=\"$finish_cmds\"
4759 save_ifs="$IFS"; IFS='~'
4760 for cmd in $cmds; do
4763 $run eval "$cmd" || admincmds="$admincmds
4768 if test -n "$finish_eval"; then
4769 # Do the single finish_eval.
4770 eval cmds=\"$finish_eval\"
4771 $run eval "$cmds" || admincmds="$admincmds
4777 # Exit here if they wanted silent mode.
4778 test "$show" = ":" && exit 0
4780 echo "----------------------------------------------------------------------"
4781 echo "Libraries have been installed in:"
4782 for libdir in $libdirs; do
4786 echo "If you ever happen to want to link against installed libraries"
4787 echo "in a given directory, LIBDIR, you must either use libtool, and"
4788 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4789 echo "flag during linking and do at least one of the following:"
4790 if test -n "$shlibpath_var"; then
4791 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4792 echo " during execution"
4794 if test -n "$runpath_var"; then
4795 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4796 echo " during linking"
4798 if test -n "$hardcode_libdir_flag_spec"; then
4800 eval flag=\"$hardcode_libdir_flag_spec\"
4802 echo " - use the \`$flag' linker flag"
4804 if test -n "$admincmds"; then
4805 echo " - have your system administrator run these commands:$admincmds"
4807 if test -f /etc/ld.so.conf; then
4808 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4811 echo "See any operating system documentation about shared libraries for"
4812 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4813 echo "----------------------------------------------------------------------"
4817 # libtool execute mode
4819 modename="$modename: execute"
4821 # The first argument is the command name.
4823 if test -z "$cmd"; then
4824 $echo "$modename: you must specify a COMMAND" 1>&2
4829 # Handle -dlopen flags immediately.
4830 for file in $execute_dlfiles; do
4831 if test ! -f "$file"; then
4832 $echo "$modename: \`$file' is not a file" 1>&2
4840 # Check to see that this really is a libtool archive.
4841 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4843 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4848 # Read the libtool library.
4852 # If there is no directory component, then add one.
4854 */* | *\\*) . $file ;;
4858 # Skip this library if it cannot be dlopened.
4859 if test -z "$dlname"; then
4860 # Warn if it was a shared library.
4861 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4865 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4866 test "X$dir" = "X$file" && dir=.
4868 if test -f "$dir/$objdir/$dlname"; then
4871 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4877 # Just add the directory containing the .lo file.
4878 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4879 test "X$dir" = "X$file" && dir=.
4883 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4888 # Get the absolute pathname.
4889 absdir=`cd "$dir" && pwd`
4890 test -n "$absdir" && dir="$absdir"
4892 # Now add the directory to shlibpath_var.
4893 if eval "test -z \"\$$shlibpath_var\""; then
4894 eval "$shlibpath_var=\"\$dir\""
4896 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4900 # This variable tells wrapper scripts just to set shlibpath_var
4901 # rather than running their programs.
4902 libtool_execute_magic="$magic"
4904 # Check if any of the arguments is a wrapper script.
4911 # Do a test to see if this is really a libtool program.
4912 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4913 # If there is no directory component, then add one.
4915 */* | *\\*) . $file ;;
4919 # Transform arg to wrapped name.
4920 file="$progdir/$program"
4924 # Quote arguments (to preserve shell metacharacters).
4925 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4926 args="$args \"$file\""
4929 if test -z "$run"; then
4930 if test -n "$shlibpath_var"; then
4931 # Export the shlibpath_var.
4932 eval "export $shlibpath_var"
4935 # Restore saved enviroment variables
4936 if test "${save_LC_ALL+set}" = set; then
4937 LC_ALL="$save_LC_ALL"; export LC_ALL
4939 if test "${save_LANG+set}" = set; then
4940 LANG="$save_LANG"; export LANG
4943 # Now prepare to actually exec the command.
4944 exec_cmd="\$cmd$args"
4946 # Display what would be done.
4947 if test -n "$shlibpath_var"; then
4948 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4949 $echo "export $shlibpath_var"
4956 # libtool clean and uninstall mode
4958 modename="$modename: $mode"
4964 # This variable tells wrapper scripts just to set variables rather
4965 # than running their programs.
4966 libtool_install_magic="$magic"
4971 -f) rm="$rm $arg"; rmforce=yes ;;
4972 -*) rm="$rm $arg" ;;
4973 *) files="$files $arg" ;;
4977 if test -z "$rm"; then
4978 $echo "$modename: you must specify an RM program" 1>&2
4985 for file in $files; do
4986 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4987 if test "X$dir" = "X$file"; then
4991 objdir="$dir/$objdir"
4993 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4994 test $mode = uninstall && objdir="$dir"
4996 # Remember objdir for removal later, being careful to avoid duplicates
4997 if test $mode = clean; then
5000 *) rmdirs="$rmdirs $objdir" ;;
5004 # Don't error if the file doesn't exist and rm -f was used.
5005 if (test -L "$file") >/dev/null 2>&1 \
5006 || (test -h "$file") >/dev/null 2>&1 \
5007 || test -f "$file"; then
5009 elif test -d "$file"; then
5012 elif test "$rmforce" = yes; then
5020 # Possibly a libtool archive, so verify it.
5021 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5024 # Delete the libtool libraries and symlinks.
5025 for n in $library_names; do
5026 rmfiles="$rmfiles $objdir/$n"
5028 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5029 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5031 if test $mode = uninstall; then
5032 if test -n "$library_names"; then
5033 # Do each command in the postuninstall commands.
5034 eval cmds=\"$postuninstall_cmds\"
5035 save_ifs="$IFS"; IFS='~'
5036 for cmd in $cmds; do
5040 if test $? != 0 && test "$rmforce" != yes; then
5047 if test -n "$old_library"; then
5048 # Do each command in the old_postuninstall commands.
5049 eval cmds=\"$old_postuninstall_cmds\"
5050 save_ifs="$IFS"; IFS='~'
5051 for cmd in $cmds; do
5055 if test $? != 0 && test "$rmforce" != yes; then
5061 # FIXME: should reinstall the best remaining shared library.
5067 if test "$build_old_libs" = yes; then
5068 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5069 rmfiles="$rmfiles $dir/$oldobj"
5074 # Do a test to see if this is a libtool program.
5075 if test $mode = clean &&
5076 (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5080 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5081 if test "$fast_install" = yes && test -n "$relink_command"; then
5082 rmfiles="$rmfiles $objdir/lt-$name"
5087 $show "$rm $rmfiles"
5088 $run $rm $rmfiles || exit_status=1
5091 # Try to remove the ${objdir}s in the directories where we deleted files
5092 for dir in $rmdirs; do
5093 if test -d "$dir"; then
5095 $run rmdir $dir >/dev/null 2>&1
5103 $echo "$modename: you must specify a MODE" 1>&2
5104 $echo "$generic_help" 1>&2
5109 if test -z "$exec_cmd"; then
5110 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5111 $echo "$generic_help" 1>&2
5114 fi # test -z "$show_help"
5116 if test -n "$exec_cmd"; then
5121 # We need to display help for each of the modes.
5124 "Usage: $modename [OPTION]... [MODE-ARG]...
5126 Provide generalized library-building support services.
5128 --config show all configuration variables
5129 --debug enable verbose shell tracing
5130 -n, --dry-run display commands without modifying any files
5131 --features display basic configuration information and exit
5132 --finish same as \`--mode=finish'
5133 --help display this help message and exit
5134 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5135 --quiet same as \`--silent'
5136 --silent don't print informational messages
5137 --version print version information
5139 MODE must be one of the following:
5141 clean remove files from the build directory
5142 compile compile a source file into a libtool object
5143 execute automatically set library path, then run a program
5144 finish complete the installation of libtool libraries
5145 install install libraries or executables
5146 link create a library or an executable
5147 uninstall remove libraries from an installed directory
5149 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5150 a more detailed description of MODE."
5156 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5158 Remove files from the build directory.
5160 RM is the name of the program to use to delete files associated with each FILE
5161 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5164 If FILE is a libtool library, object or program, all the files associated
5165 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5170 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5172 Compile a source file into a libtool library object.
5174 This mode accepts the following additional options:
5176 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5177 -prefer-pic try to building PIC objects only
5178 -prefer-non-pic try to building non-PIC objects only
5179 -static always build a \`.o' file suitable for static linking
5181 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5182 from the given SOURCEFILE.
5184 The output file name is determined by removing the directory component from
5185 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5186 library object suffix, \`.lo'."
5191 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5193 Automatically set library path, then run a program.
5195 This mode accepts the following additional options:
5197 -dlopen FILE add the directory containing FILE to the library path
5199 This mode sets the library path environment variable according to \`-dlopen'
5202 If any of the ARGS are libtool executable wrappers, then they are translated
5203 into their corresponding uninstalled binary, and any of their required library
5204 directories are added to the library path.
5206 Then, COMMAND is executed, with ARGS as arguments."
5211 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5213 Complete the installation of libtool libraries.
5215 Each LIBDIR is a directory that contains libtool libraries.
5217 The commands that this mode executes may require superuser privileges. Use
5218 the \`--dry-run' option if you just want to see what would be executed."
5223 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5225 Install executables or libraries.
5227 INSTALL-COMMAND is the installation command. The first component should be
5228 either the \`install' or \`cp' program.
5230 The rest of the components are interpreted as arguments to that command (only
5231 BSD-compatible install options are recognized)."
5236 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5238 Link object files or libraries together to form another library, or to
5239 create an executable program.
5241 LINK-COMMAND is a command using the C compiler that you would use to create
5242 a program from several object files.
5244 The following components of LINK-COMMAND are treated specially:
5246 -all-static do not do any dynamic linking at all
5247 -avoid-version do not add a version suffix if possible
5248 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5249 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5250 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5251 -export-symbols SYMFILE
5252 try to export only the symbols listed in SYMFILE
5253 -export-symbols-regex REGEX
5254 try to export only the symbols matching REGEX
5255 -LLIBDIR search LIBDIR for required installed libraries
5256 -lNAME OUTPUT-FILE requires the installed library libNAME
5257 -module build a library that can dlopened
5258 -no-fast-install disable the fast-install mode
5259 -no-install link a not-installable executable
5260 -no-undefined declare that a library does not refer to external symbols
5261 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5262 -release RELEASE specify package release information
5263 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5264 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5265 -static do not do any dynamic linking of libtool libraries
5266 -version-info CURRENT[:REVISION[:AGE]]
5267 specify library version info [each variable defaults to 0]
5269 All other options (arguments beginning with \`-') are ignored.
5271 Every other argument is treated as a filename. Files ending in \`.la' are
5272 treated as uninstalled libtool libraries, other files are standard or library
5275 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5276 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5277 required, except when creating a convenience library.
5279 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5280 using \`ar' and \`ranlib', or on Windows using \`lib'.
5282 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5283 is created, otherwise an executable program is created."
5288 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5290 Remove libraries from an installation directory.
5292 RM is the name of the program to use to delete files associated with each FILE
5293 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5296 If FILE is a libtool library, all the files associated with it are deleted.
5297 Otherwise, only FILE itself is deleted using RM."
5301 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5308 $echo "Try \`$modename --help' for more information about other modes."