3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by (GNU 0.5.4)
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 sparc-solaris1:
40 # Shell to use when invoking shell scripts.
43 # Whether or not to build shared libraries.
44 build_libtool_libs=yes
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.
57 host=sparc-sun-solaris2.9
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.
79 NM="/usr/local/bin/nm -B"
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"
149 # Compiler flag to allow reflexive dlopens.
150 export_dynamic_flag_spec=""
152 # Compiler flag to generate shared objects directly from archives.
153 whole_archive_flag_spec="-z allextract\$convenience -z defaultextract"
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="\$LD -G\${allow_undefined_flag} -h \$soname -o \$lib \$libobjs \$deplibs \$linker_flags"
185 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$lib.exp~cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$lib.exp~\$echo \\\"local: *; };\\\" >> \$lib.exp~
186 \$LD -G\${allow_undefined_flag} -M \$lib.exp -h \$soname -o \$lib \$libobjs \$deplibs \$linker_flags~\$rm \$lib.exp"
187 postinstall_cmds="chmod +x \$lib"
188 postuninstall_cmds=""
190 # Commands to strip libraries.
191 old_striplib="strip --strip-debug"
192 striplib="strip --strip-unneeded"
194 # Method to check whether dependent libraries are shared objects.
195 deplibs_check_method="pass_all"
197 # Command to use when deplibs_check_method == file_magic.
198 file_magic_cmd="\$MAGIC_CMD"
200 # Flag that allows shared libraries with undefined symbols to be built.
201 allow_undefined_flag=""
203 # Flag that forces no undefined symbols.
204 no_undefined_flag=" -z defs"
206 # Commands used to finish a libtool library installation in a directory.
209 # Same as above, but a single script fragment to be evaled but not shown.
212 # Take the output of nm and produce a listing of raw symbols and C names.
213 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
215 # Transform the output of nm in a proper C declaration
216 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
218 # Transform the output of nm in a C name address pair
219 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
221 # This is the shared library runtime path variable.
224 # This is the shared library path variable.
225 shlibpath_var=LD_LIBRARY_PATH
227 # Is shlibpath searched before the hard-coded library search path?
228 shlibpath_overrides_runpath=yes
230 # How to hardcode a shared library path into an executable.
231 hardcode_action=immediate
233 # Whether we should hardcode library paths into libraries.
234 hardcode_into_libs=yes
236 # Flag to hardcode $libdir into a binary during linking.
237 # This must work even if $libdir does not exist.
238 hardcode_libdir_flag_spec="-R\$libdir"
240 # Whether we need a single -rpath flag with a separated argument.
241 hardcode_libdir_separator=""
243 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
247 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
251 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
252 # the resulting binary.
253 hardcode_shlibpath_var=no
255 # Variables whose values should be saved in libtool wrapper scripts and
256 # restored at relink time.
257 variables_saved_for_relink="PATH LD_LIBRARY_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
259 # Whether libtool must link a program against all its dependency libraries.
262 # Compile-time system search path for libraries
263 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
265 # Run-time system search path for libraries
266 sys_lib_dlsearch_path_spec="/lib /usr/lib"
268 # Fix the shell variable $srcfile for the compiler.
271 # Set to yes if exported symbols are required.
272 always_export_symbols=no
274 # The commands to list exported symbols.
275 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
277 # The commands to extract the exported symbol list from a shared archive.
278 extract_expsyms_cmds=""
280 # Symbols that should not be listed in the preloaded symbols.
281 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
283 # Symbols that must always be exported.
286 # ### END LIBTOOL CONFIG
288 # ltmain.sh - Provide generalized library-building support services.
289 # NOTE: Changing this file will not affect anything until you rerun configure.
291 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
292 # Free Software Foundation, Inc.
293 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
295 # This program is free software; you can redistribute it and/or modify
296 # it under the terms of the GNU General Public License as published by
297 # the Free Software Foundation; either version 2 of the License, or
298 # (at your option) any later version.
300 # This program is distributed in the hope that it will be useful, but
301 # WITHOUT ANY WARRANTY; without even the implied warranty of
302 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
303 # General Public License for more details.
305 # You should have received a copy of the GNU General Public License
306 # along with this program; if not, write to the Free Software
307 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
309 # As a special exception to the GNU General Public License, if you
310 # distribute this file as part of a program that contains a
311 # configuration script generated by Autoconf, you may include it under
312 # the same distribution terms that you use for the rest of that program.
314 # Check that we have a working $echo.
315 if test "X$1" = X--no-reexec; then
316 # Discard the --no-reexec flag, and continue.
318 elif test "X$1" = X--fallback-echo; then
319 # Avoid inline document here, it may be left over
321 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
322 # Yippee, $echo works!
325 # Restart under the correct shell, and then maybe $echo will work.
326 exec $SHELL "$0" --no-reexec ${1+"$@"}
329 if test "X$1" = X--fallback-echo; then
330 # used as fallback echo
338 # The name of this program.
339 progname=`$echo "$0" | sed 's%^.*/%%'`
346 TIMESTAMP=" (1.922.2.79 2001/11/28 21:50:31)"
349 help="Try \`$progname --help' for more information."
350 magic="%%%MAGIC variable%%%"
355 # Sed substitution that helps us do robust quoting. It backslashifies
356 # metacharacters that are still active within double-quoted strings.
357 Xsed='sed -e 1s/^X//'
358 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
360 NL2SP='tr \015\012 \040\040'
363 # Only set LANG and LC_ALL to C if already set.
364 # These must not be set unconditionally because not all systems understand
365 # e.g. LANG=C (notably SCO).
366 # We save the old values to restore during execute mode.
367 if test "${LC_ALL+set}" = set; then
368 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
370 if test "${LANG+set}" = set; then
371 save_LANG="$LANG"; LANG=C; export LANG
374 # Make sure IFS has a sensible default
377 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
378 echo "$modename: not configured to build any kind of library" 1>&2
379 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
392 lo2o="s/\\.lo\$/.${objext}/"
393 o2lo="s/\\.${objext}\$/.lo/"
395 # Parse our command line options once, thoroughly.
402 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
406 # If the previous option needs an argument, assign it.
407 if test -n "$prev"; then
410 execute_dlfiles="$execute_dlfiles $arg"
422 # Have we seen a non-optional argument yet?
429 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
434 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
439 echo "$progname: enabling shell trace mode"
449 if test "$build_libtool_libs" = yes; then
450 echo "enable shared libraries"
452 echo "disable shared libraries"
454 if test "$build_old_libs" = yes; then
455 echo "enable static libraries"
457 echo "disable static libraries"
462 --finish) mode="finish" ;;
464 --mode) prevopt="--mode" prev=mode ;;
465 --mode=*) mode="$optarg" ;;
467 --preserve-dup-deps) duplicate_deps="yes" ;;
479 $echo "$modename: unrecognized option \`$arg'" 1>&2
491 if test -n "$prevopt"; then
492 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
497 # If this variable is set in any of the actions, the command in it
498 # will be execed at the end. This prevents here-documents from being
499 # left over by shells.
502 if test -z "$show_help"; then
504 # Infer the operation mode.
505 if test -z "$mode"; then
507 *cc | *++ | gcc* | *-gcc*)
519 *db | *dbx | *strace | *truss)
529 # If we have no mode, but dlfiles were specified, then do execute mode.
530 test -n "$execute_dlfiles" && mode=execute
532 # Just use the default operation mode.
533 if test -z "$mode"; then
534 if test -n "$nonopt"; then
535 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
537 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
544 # Only execute mode is allowed to have -dlopen flags.
545 if test -n "$execute_dlfiles" && test "$mode" != execute; then
546 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
551 # Change the help message to a mode-specific one.
553 help="Try \`$modename --help --mode=$mode' for more information."
555 # These modes are in order of execution frequency so that they run quickly.
557 # libtool compile mode
559 modename="$modename: compile"
560 # Get the compilation command and the source file.
573 # Aesthetically quote the previous argument.
575 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
578 # Double-quote args containing other shell metacharacters.
579 # Many Bourne shells cannot handle close brackets correctly
580 # in scan sets, so we specify it separately.
581 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
586 # Add the previous argument to base_compile.
587 if test -z "$base_compile"; then
588 base_compile="$lastarg"
590 base_compile="$base_compile $lastarg"
596 # Accept any command-line options.
599 if test "$user_target" != "no"; then
600 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
627 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
629 save_ifs="$IFS"; IFS=','
633 # Double-quote args containing other shell metacharacters.
634 # Many Bourne shells cannot handle close brackets correctly
635 # in scan sets, so we specify it separately.
637 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
641 lastarg="$lastarg $arg"
644 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
646 # Add the arguments to base_compile.
647 if test -z "$base_compile"; then
648 base_compile="$lastarg"
650 base_compile="$base_compile $lastarg"
658 # The next one is the -o target name
663 # We got the output file
670 # Accept the current argument as the source file.
674 # Aesthetically quote the previous argument.
676 # Backslashify any backslashes, double quotes, and dollar signs.
677 # These are the only characters that are still specially
678 # interpreted inside of double-quoted scrings.
679 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
681 # Double-quote args containing other shell metacharacters.
682 # Many Bourne shells cannot handle close brackets correctly
683 # in scan sets, so we specify it separately.
685 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
686 lastarg="\"$lastarg\""
690 # Add the previous argument to base_compile.
691 if test -z "$base_compile"; then
692 base_compile="$lastarg"
694 base_compile="$base_compile $lastarg"
702 # Get the name of the library object.
703 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
706 $echo "$modename: you must specify a target with \`-o'" 1>&2
711 # Recognize several different file suffixes.
712 # If the user specifies -o file.o, it is replaced with file.lo
727 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
730 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
732 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
737 if test -z "$base_compile"; then
738 $echo "$modename: you must specify a compilation command" 1>&2
743 # Delete any leftover library objects.
744 if test "$build_old_libs" = yes; then
745 removelist="$obj $libobj"
751 trap "$run $rm $removelist; exit 1" 1 2 15
753 # On Cygwin there's no "real" PIC flag so we must build both object types
755 cygwin* | mingw* | pw32* | os2*)
759 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
760 # non-PIC code in shared libraries is not supported
764 # Calculate the filename of the output object if compiler does
765 # not support -o with -c
766 if test "$compiler_c_o" = no; then
767 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
768 lockfile="$output_obj.lock"
769 removelist="$removelist $output_obj $lockfile"
770 trap "$run $rm $removelist; exit 1" 1 2 15
776 # Lock this critical section if it is needed
777 # We use this script file to make the link, it avoids creating a new file
778 if test "$need_locks" = yes; then
779 until $run ln "$0" "$lockfile" 2>/dev/null; do
780 $show "Waiting for $lockfile to be removed"
783 elif test "$need_locks" = warn; then
784 if test -f "$lockfile"; then
786 *** ERROR, $lockfile exists and contains:
787 `cat $lockfile 2>/dev/null`
789 This indicates that another process is trying to use the same
790 temporary object file, and libtool could not work around it because
791 your compiler does not support \`-c' and \`-o' together. If you
792 repeat this compilation, it may succeed, by chance, but you had better
793 avoid parallel builds (make -j) in this platform, or get a better
799 echo $srcfile > "$lockfile"
802 if test -n "$fix_srcfile_path"; then
803 eval srcfile=\"$fix_srcfile_path\"
806 # Only build a PIC object if we are building libtool libraries.
807 if test "$build_libtool_libs" = yes; then
808 # Without this assignment, base_compile gets emptied.
809 fbsd_hideous_sh_bug=$base_compile
811 if test "$pic_mode" != no; then
812 # All platforms use -DPIC, to notify preprocessed assembler code.
813 command="$base_compile $srcfile $pic_flag -DPIC"
815 # Don't build PIC code
816 command="$base_compile $srcfile"
818 if test "$build_old_libs" = yes; then
820 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
821 if test "X$dir" = "X$libobj"; then
826 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
828 if test -d "$dir"; then
835 if test $status -ne 0 && test ! -d $dir; then
840 if test "$compiler_o_lo" = yes; then
842 command="$command -o $output_obj"
843 elif test "$compiler_c_o" = yes; then
845 command="$command -o $output_obj"
848 $run $rm "$output_obj"
850 if $run eval "$command"; then :
852 test -n "$output_obj" && $run $rm $removelist
856 if test "$need_locks" = warn &&
857 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
859 *** ERROR, $lockfile contains:
860 `cat $lockfile 2>/dev/null`
862 but it should contain:
865 This indicates that another process is trying to use the same
866 temporary object file, and libtool could not work around it because
867 your compiler does not support \`-c' and \`-o' together. If you
868 repeat this compilation, it may succeed, by chance, but you had better
869 avoid parallel builds (make -j) in this platform, or get a better
876 # Just move the object if needed, then go on to compile the next one
877 if test x"$output_obj" != x"$libobj"; then
878 $show "$mv $output_obj $libobj"
879 if $run $mv $output_obj $libobj; then :
887 # If we have no pic_flag, then copy the object into place and finish.
888 if (test -z "$pic_flag" || test "$pic_mode" != default) &&
889 test "$build_old_libs" = yes; then
890 # Rename the .lo from within objdir to obj
891 if test -f $obj; then
896 $show "$mv $libobj $obj"
897 if $run $mv $libobj $obj; then :
904 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
905 if test "X$xdir" = "X$obj"; then
910 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
911 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
912 # Now arrange that obj and lo_libobj become the same file
913 $show "(cd $xdir && $LN_S $baseobj $libobj)"
914 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
915 # Unlock the critical section if it was locked
916 if test "$need_locks" != no; then
927 # Allow error messages only from the first compilation.
928 suppress_output=' >/dev/null 2>&1'
931 # Only build a position-dependent object if we build old libraries.
932 if test "$build_old_libs" = yes; then
933 if test "$pic_mode" != yes; then
934 # Don't build PIC code
935 command="$base_compile $srcfile"
937 # All platforms use -DPIC, to notify preprocessed assembler code.
938 command="$base_compile $srcfile $pic_flag -DPIC"
940 if test "$compiler_c_o" = yes; then
941 command="$command -o $obj"
945 # Suppress compiler output if we already did a PIC compilation.
946 command="$command$suppress_output"
947 $run $rm "$output_obj"
949 if $run eval "$command"; then :
955 if test "$need_locks" = warn &&
956 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
958 *** ERROR, $lockfile contains:
959 `cat $lockfile 2>/dev/null`
961 but it should contain:
964 This indicates that another process is trying to use the same
965 temporary object file, and libtool could not work around it because
966 your compiler does not support \`-c' and \`-o' together. If you
967 repeat this compilation, it may succeed, by chance, but you had better
968 avoid parallel builds (make -j) in this platform, or get a better
975 # Just move the object if needed
976 if test x"$output_obj" != x"$obj"; then
977 $show "$mv $output_obj $obj"
978 if $run $mv $output_obj $obj; then :
986 # Create an invalid libtool object if no PIC, so that we do not
987 # accidentally link it into a program.
988 if test "$build_libtool_libs" != yes; then
989 $show "echo timestamp > $libobj"
990 $run eval "echo timestamp > \$libobj" || exit $?
992 # Move the .lo from within objdir
993 $show "$mv $libobj $lo_libobj"
994 if $run $mv $libobj $lo_libobj; then :
1003 # Unlock the critical section if it was locked
1004 if test "$need_locks" != no; then
1005 $run $rm "$lockfile"
1013 modename="$modename: link"
1015 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1016 # It is impossible to link a dll without this setting, and
1017 # we shouldn't force the makefile maintainer to figure out
1018 # which system we are compiling for in order to pass an extra
1019 # flag for every libtool invokation.
1020 # allow_undefined=no
1022 # FIXME: Unfortunately, there are problems with the above when trying
1023 # to make a dll which has undefined symbols, in which case not
1024 # even a static library is built. For now, we need to specify
1025 # -no-undefined on the libtool link line when we can be certain
1026 # that all symbols are satisfied, otherwise we get a static library.
1033 libtool_args="$nonopt"
1034 compile_command="$nonopt"
1035 finalize_command="$nonopt"
1048 lib_search_path=`pwd`
1056 export_symbols_regex=
1063 prefer_static_libs=no
1075 # We need to know -static, to get the right output filenames.
1079 -all-static | -static)
1080 if test "X$arg" = "X-all-static"; then
1081 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1082 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1084 if test -n "$link_static_flag"; then
1085 dlopen_self=$dlopen_self_static
1088 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1089 dlopen_self=$dlopen_self_static
1092 build_libtool_libs=no
1094 prefer_static_libs=yes
1100 # See if our shared archives depend on static archives.
1101 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1103 # Go through the arguments, transforming them on the way.
1104 while test $# -gt 0; do
1108 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1109 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1113 libtool_args="$libtool_args $qarg"
1115 # If the previous option needs an argument, assign it.
1116 if test -n "$prev"; then
1119 compile_command="$compile_command @OUTPUT@"
1120 finalize_command="$finalize_command @OUTPUT@"
1126 if test "$preload" = no; then
1127 # Add the symbol object into the linking commands.
1128 compile_command="$compile_command @SYMFILE@"
1129 finalize_command="$finalize_command @SYMFILE@"
1133 *.la | *.lo) ;; # We handle these cases below.
1135 if test "$dlself" = no; then
1143 if test "$prev" = dlprefiles; then
1145 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1155 if test "$prev" = dlfiles; then
1156 dlfiles="$dlfiles $arg"
1158 dlprefiles="$dlprefiles $arg"
1166 export_symbols="$arg"
1167 if test ! -f "$arg"; then
1168 $echo "$modename: symbol file \`$arg' does not exist"
1175 export_symbols_regex="$arg"
1185 # We need an absolute path.
1187 [\\/]* | [A-Za-z]:[\\/]*) ;;
1189 $echo "$modename: only absolute run-paths are allowed" 1>&2
1193 if test "$prev" = rpath; then
1196 *) rpath="$rpath $arg" ;;
1201 *) xrpath="$xrpath $arg" ;;
1208 compiler_flags="$compiler_flags $qarg"
1210 compile_command="$compile_command $qarg"
1211 finalize_command="$finalize_command $qarg"
1215 linker_flags="$linker_flags $qarg"
1216 compiler_flags="$compiler_flags $wl$qarg"
1218 compile_command="$compile_command $wl$qarg"
1219 finalize_command="$finalize_command $wl$qarg"
1223 eval "$prev=\"\$arg\""
1234 if test -n "$link_static_flag"; then
1235 compile_command="$compile_command $link_static_flag"
1236 finalize_command="$finalize_command $link_static_flag"
1242 # FIXME: remove this flag sometime in the future.
1243 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1267 -export-symbols | -export-symbols-regex)
1268 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1269 $echo "$modename: more than one -exported-symbols argument is not allowed"
1272 if test "X$arg" = "X-export-symbols"; then
1280 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1281 # so, if we see these flags be careful not to treat them like -L
1283 case $with_gcc/$host in
1284 no/*-*-irix* | no/*-*-nonstopux*)
1285 compile_command="$compile_command $arg"
1286 finalize_command="$finalize_command $arg"
1293 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1294 # We need an absolute path.
1296 [\\/]* | [A-Za-z]:[\\/]*) ;;
1298 absdir=`cd "$dir" && pwd`
1299 if test -z "$absdir"; then
1300 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1309 deplibs="$deplibs -L$dir"
1310 lib_search_path="$lib_search_path $dir"
1314 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1315 case :$dllsearchpath: in
1317 *) dllsearchpath="$dllsearchpath:$dir";;
1325 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1327 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1328 # These systems don't actually have a C or math library (as such)
1331 *-*-mingw* | *-*-os2*)
1332 # These systems don't actually have a C library (as such)
1333 test "X$arg" = "X-lc" && continue
1335 *-*-openbsd* | *-*-freebsd*)
1336 # Do not include libc due to us having libc/libc_r.
1337 test "X$arg" = "X-lc" && continue
1340 elif test "X$arg" = "X-lc_r"; then
1342 *-*-openbsd* | *-*-freebsd*)
1343 # Do not include libc_r directly, use -pthread flag.
1348 deplibs="$deplibs $arg"
1364 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1365 # The PATH hackery in wrapper scripts is required on Windows
1366 # in order for the loader to find any dlls it needs.
1367 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1368 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1371 *) no_install=yes ;;
1399 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1400 # We need an absolute path.
1402 [\\/]* | [A-Za-z]:[\\/]*) ;;
1404 $echo "$modename: only absolute run-paths are allowed" 1>&2
1410 *) xrpath="$xrpath $dir" ;;
1416 # The effects of -static are defined in a previous loop.
1417 # We used to do the same as -all-static on platforms that
1418 # didn't have a PIC flag, but the assumption that the effects
1419 # would be equivalent was wrong. It would break on at least
1420 # Digital Unix and AIX.
1435 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1437 save_ifs="$IFS"; IFS=','
1438 for flag in $args; do
1441 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1446 compiler_flags="$compiler_flags $flag"
1449 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1453 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1455 save_ifs="$IFS"; IFS=','
1456 for flag in $args; do
1459 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1464 compiler_flags="$compiler_flags $wl$flag"
1465 linker_flags="$linker_flags $flag"
1468 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1481 # Some other compiler flag.
1483 # Unknown arguments in both finalize_command and compile_command need
1484 # to be aesthetically quoted because they are evaled later.
1485 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1487 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1494 # A library or standard object.
1495 if test "$prev" = dlfiles; then
1496 # This file was specified with -dlopen.
1497 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1498 dlfiles="$dlfiles $arg"
1502 # If libtool objects are unsupported, then we need to preload.
1507 if test "$prev" = dlprefiles; then
1508 # Preload the old-style object.
1509 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1513 *.lo) libobjs="$libobjs $arg" ;;
1514 *) objs="$objs $arg" ;;
1521 deplibs="$deplibs $arg"
1522 old_deplibs="$old_deplibs $arg"
1527 # A libtool-controlled library.
1529 if test "$prev" = dlfiles; then
1530 # This library was specified with -dlopen.
1531 dlfiles="$dlfiles $arg"
1533 elif test "$prev" = dlprefiles; then
1534 # The library was specified with -dlpreopen.
1535 dlprefiles="$dlprefiles $arg"
1538 deplibs="$deplibs $arg"
1543 # Some other compiler argument.
1545 # Unknown arguments in both finalize_command and compile_command need
1546 # to be aesthetically quoted because they are evaled later.
1547 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1549 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1556 # Now actually substitute the argument into the commands.
1557 if test -n "$arg"; then
1558 compile_command="$compile_command $arg"
1559 finalize_command="$finalize_command $arg"
1561 done # argument parsing loop
1563 if test -n "$prev"; then
1564 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1569 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1570 eval arg=\"$export_dynamic_flag_spec\"
1571 compile_command="$compile_command $arg"
1572 finalize_command="$finalize_command $arg"
1575 # calculate the name of the file, without its directory
1576 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1577 libobjs_save="$libobjs"
1579 if test -n "$shlibpath_var"; then
1580 # get the directories listed in $shlibpath_var
1581 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1585 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1586 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1588 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1589 if test "X$output_objdir" = "X$output"; then
1590 output_objdir="$objdir"
1592 output_objdir="$output_objdir/$objdir"
1594 # Create the object directory.
1595 if test ! -d $output_objdir; then
1596 $show "$mkdir $output_objdir"
1597 $run $mkdir $output_objdir
1599 if test $status -ne 0 && test ! -d $output_objdir; then
1604 # Determine the type of output
1607 $echo "$modename: you must specify an output file" 1>&2
1611 *.$libext) linkmode=oldlib ;;
1612 *.lo | *.$objext) linkmode=obj ;;
1613 *.la) linkmode=lib ;;
1614 *) linkmode=prog ;; # Anything else should be a program.
1619 # Find all interdependent deplibs by searching for libraries
1620 # that are linked more than once (e.g. -la -lb -la)
1621 for deplib in $deplibs; do
1622 if test "X$duplicate_deps" = "Xyes" ; then
1624 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1627 libs="$libs $deplib"
1632 need_relink=no # whether we're linking any uninstalled libtool libraries
1633 notinst_deplibs= # not-installed libtool libraries
1634 notinst_path= # paths that contain not-installed libtool libraries
1638 for file in $dlfiles $dlprefiles; do
1642 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1654 passes="conv scan dlopen dlpreopen link"
1659 for pass in $passes; do
1660 if test $linkmode = prog; then
1661 # Determine which files to process
1665 save_deplibs="$deplibs" # Collect dlpreopened libraries
1668 dlpreopen) libs="$dlprefiles" ;;
1669 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1672 for deplib in $libs; do
1677 if test $linkmode = oldlib && test $linkmode = obj; then
1678 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1681 if test $pass = conv; then
1682 deplibs="$deplib $deplibs"
1685 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1686 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1687 # Search the libtool library
1688 lib="$searchdir/lib${name}.la"
1689 if test -f "$lib"; then
1694 if test "$found" != yes; then
1695 # deplib doesn't seem to be a libtool library
1696 if test "$linkmode,$pass" = "prog,link"; then
1697 compile_deplibs="$deplib $compile_deplibs"
1698 finalize_deplibs="$deplib $finalize_deplibs"
1700 deplibs="$deplib $deplibs"
1701 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1709 deplibs="$deplib $deplibs"
1710 test $pass = conv && continue
1711 newdependency_libs="$deplib $newdependency_libs"
1712 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1715 if test $pass = conv; then
1716 deplibs="$deplib $deplibs"
1719 if test $pass = scan; then
1720 deplibs="$deplib $deplibs"
1721 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1723 compile_deplibs="$deplib $compile_deplibs"
1724 finalize_deplibs="$deplib $finalize_deplibs"
1728 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1734 if test $pass = link; then
1735 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1736 # Make sure the xrpath contains only unique directories.
1739 *) xrpath="$xrpath $dir" ;;
1742 deplibs="$deplib $deplibs"
1745 *.la) lib="$deplib" ;;
1747 if test $pass = conv; then
1748 deplibs="$deplib $deplibs"
1753 if test "$deplibs_check_method" != pass_all; then
1755 echo "*** Warning: Trying to link with static lib archive $deplib."
1756 echo "*** I have the capability to make that library automatically link in when"
1757 echo "*** you link to this library. But I can only do this if you have a"
1758 echo "*** shared version of the library, which you do not appear to have"
1759 echo "*** because the file extensions .$libext of this argument makes me believe"
1760 echo "*** that it is just a static archive that I should not used here."
1763 echo "*** Warning: Linking the shared library $output against the"
1764 echo "*** static library $deplib is not portable!"
1765 deplibs="$deplib $deplibs"
1770 if test $pass != link; then
1771 deplibs="$deplib $deplibs"
1773 compile_deplibs="$deplib $compile_deplibs"
1774 finalize_deplibs="$deplib $finalize_deplibs"
1781 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1782 # If there is no dlopen support or we're linking statically,
1783 # we need to preload.
1784 newdlprefiles="$newdlprefiles $deplib"
1785 compile_deplibs="$deplib $compile_deplibs"
1786 finalize_deplibs="$deplib $finalize_deplibs"
1788 newdlfiles="$newdlfiles $deplib"
1797 if test $found = yes || test -f "$lib"; then :
1799 $echo "$modename: cannot find the library \`$lib'" 1>&2
1803 # Check to see that this really is a libtool archive.
1804 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1806 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1810 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1811 test "X$ladir" = "X$lib" && ladir="."
1819 # If the library was installed with an old release of libtool,
1820 # it will not redefine variable installed.
1825 */* | *\\*) . $lib ;;
1829 if test "$linkmode,$pass" = "lib,link" ||
1830 test "$linkmode,$pass" = "prog,scan" ||
1831 { test $linkmode = oldlib && test $linkmode = obj; }; then
1832 # Add dl[pre]opened files of deplib
1833 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1834 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1837 if test $pass = conv; then
1838 # Only check for convenience libraries
1839 deplibs="$lib $deplibs"
1840 if test -z "$libdir"; then
1841 if test -z "$old_library"; then
1842 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1845 # It is a libtool convenience library, so add in its objects.
1846 convenience="$convenience $ladir/$objdir/$old_library"
1847 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1849 for deplib in $dependency_libs; do
1850 deplibs="$deplib $deplibs"
1851 if test "X$duplicate_deps" = "Xyes" ; then
1852 case "$tmp_libs " in
1853 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1856 tmp_libs="$tmp_libs $deplib"
1858 elif test $linkmode != prog && test $linkmode != lib; then
1859 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1865 # Get the name of the library we link against.
1867 for l in $old_library $library_names; do
1870 if test -z "$linklib"; then
1871 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1875 # This library was specified with -dlopen.
1876 if test $pass = dlopen; then
1877 if test -z "$libdir"; then
1878 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1881 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1882 # If there is no dlname, no dlopen support or we're linking
1883 # statically, we need to preload.
1884 dlprefiles="$dlprefiles $lib"
1886 newdlfiles="$newdlfiles $lib"
1891 # We need an absolute path.
1893 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1895 abs_ladir=`cd "$ladir" && pwd`
1896 if test -z "$abs_ladir"; then
1897 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1898 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1903 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1905 # Find the relevant object directory and library name.
1906 if test "X$installed" = Xyes; then
1907 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1908 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1917 dir="$ladir/$objdir"
1918 absdir="$abs_ladir/$objdir"
1919 # Remove this search path later
1920 notinst_path="$notinst_path $abs_ladir"
1921 fi # $installed = yes
1922 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1924 # This library was specified with -dlpreopen.
1925 if test $pass = dlpreopen; then
1926 if test -z "$libdir"; then
1927 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1930 # Prefer using a static library (so that no silly _DYNAMIC symbols
1931 # are required to link).
1932 if test -n "$old_library"; then
1933 newdlprefiles="$newdlprefiles $dir/$old_library"
1934 # Otherwise, use the dlname, so that lt_dlopen finds it.
1935 elif test -n "$dlname"; then
1936 newdlprefiles="$newdlprefiles $dir/$dlname"
1938 newdlprefiles="$newdlprefiles $dir/$linklib"
1940 fi # $pass = dlpreopen
1942 if test -z "$libdir"; then
1943 # Link the convenience library
1944 if test $linkmode = lib; then
1945 deplibs="$dir/$old_library $deplibs"
1946 elif test "$linkmode,$pass" = "prog,link"; then
1947 compile_deplibs="$dir/$old_library $compile_deplibs"
1948 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1950 deplibs="$lib $deplibs"
1955 if test $linkmode = prog && test $pass != link; then
1956 newlib_search_path="$newlib_search_path $ladir"
1957 deplibs="$lib $deplibs"
1960 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1961 test "$build_libtool_libs" = no; then
1966 for deplib in $dependency_libs; do
1968 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1970 # Need to link against all dependency_libs?
1971 if test $linkalldeplibs = yes; then
1972 deplibs="$deplib $deplibs"
1974 # Need to hardcode shared library paths
1975 # or/and link against static libraries
1976 newdependency_libs="$deplib $newdependency_libs"
1978 if test "X$duplicate_deps" = "Xyes" ; then
1979 case "$tmp_libs " in
1980 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1983 tmp_libs="$tmp_libs $deplib"
1986 fi # $linkmode = prog...
1988 link_static=no # Whether the deplib will be linked statically
1989 if test -n "$library_names" &&
1990 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1991 # Link against this shared library
1993 if test "$linkmode,$pass" = "prog,link" ||
1994 { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1995 # Hardcode the library path.
1996 # Skip directories that are in the system default run-time
1998 case " $sys_lib_dlsearch_path " in
2001 case "$compile_rpath " in
2003 *) compile_rpath="$compile_rpath $absdir"
2007 case " $sys_lib_dlsearch_path " in
2010 case "$finalize_rpath " in
2012 *) finalize_rpath="$finalize_rpath $libdir"
2016 if test $linkmode = prog; then
2017 # We need to hardcode the library path
2018 if test -n "$shlibpath_var"; then
2019 # Make sure the rpath contains only unique directories.
2020 case "$temp_rpath " in
2023 *) temp_rpath="$temp_rpath $dir" ;;
2027 fi # $linkmode,$pass = prog,link...
2029 if test "$alldeplibs" = yes &&
2030 { test "$deplibs_check_method" = pass_all ||
2031 { test "$build_libtool_libs" = yes &&
2032 test -n "$library_names"; }; }; then
2033 # We only need to search for static libraries
2037 if test "$installed" = no; then
2038 notinst_deplibs="$notinst_deplibs $lib"
2042 if test -n "$old_archive_from_expsyms_cmds"; then
2043 # figure out the soname
2044 set dummy $library_names
2047 libname=`eval \\$echo \"$libname_spec\"`
2048 # use dlname if we got it. it's perfectly good, no?
2049 if test -n "$dlname"; then
2051 elif test -n "$soname_spec"; then
2055 major=`expr $current - $age`
2059 eval soname=\"$soname_spec\"
2064 # Make a new name for the extract_expsyms_cmds to use
2066 soname=`echo $soroot | sed -e 's/^.*\///'`
2067 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2069 # If the library has no export list, then create one now
2070 if test -f "$output_objdir/$soname-def"; then :
2072 $show "extracting exported symbol list from \`$soname'"
2073 save_ifs="$IFS"; IFS='~'
2074 eval cmds=\"$extract_expsyms_cmds\"
2075 for cmd in $cmds; do
2078 $run eval "$cmd" || exit $?
2084 if test -f "$output_objdir/$newlib"; then :; else
2085 $show "generating import library for \`$soname'"
2086 save_ifs="$IFS"; IFS='~'
2087 eval cmds=\"$old_archive_from_expsyms_cmds\"
2088 for cmd in $cmds; do
2091 $run eval "$cmd" || exit $?
2095 # make sure the library variables are pointing to the new library
2098 fi # test -n $old_archive_from_expsyms_cmds
2100 if test $linkmode = prog || test "$mode" != relink; then
2105 case $hardcode_action in
2106 immediate | unsupported)
2107 if test "$hardcode_direct" = no; then
2109 elif test "$hardcode_minus_L" = no; then
2111 *-*-sunos*) add_shlibpath="$dir" ;;
2115 elif test "$hardcode_shlibpath_var" = no; then
2116 add_shlibpath="$dir"
2123 if test "$hardcode_direct" = yes; then
2125 elif test "$hardcode_minus_L" = yes; then
2128 elif test "$hardcode_shlibpath_var" = yes; then
2129 add_shlibpath="$dir"
2138 if test "$lib_linked" != yes; then
2139 $echo "$modename: configuration error: unsupported hardcode properties"
2143 if test -n "$add_shlibpath"; then
2144 case :$compile_shlibpath: in
2145 *":$add_shlibpath:"*) ;;
2146 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2149 if test $linkmode = prog; then
2150 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2151 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2153 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2154 test -n "$add" && deplibs="$add $deplibs"
2155 if test "$hardcode_direct" != yes && \
2156 test "$hardcode_minus_L" != yes && \
2157 test "$hardcode_shlibpath_var" = yes; then
2158 case :$finalize_shlibpath: in
2160 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2166 if test $linkmode = prog || test "$mode" = relink; then
2170 # Finalize command for both is simple: just hardcode it.
2171 if test "$hardcode_direct" = yes; then
2172 add="$libdir/$linklib"
2173 elif test "$hardcode_minus_L" = yes; then
2176 elif test "$hardcode_shlibpath_var" = yes; then
2177 case :$finalize_shlibpath: in
2179 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2183 # We cannot seem to hardcode it, guess we'll fake it.
2188 if test $linkmode = prog; then
2189 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2190 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2192 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2193 test -n "$add" && deplibs="$add $deplibs"
2196 elif test $linkmode = prog; then
2197 if test "$alldeplibs" = yes &&
2198 { test "$deplibs_check_method" = pass_all ||
2199 { test "$build_libtool_libs" = yes &&
2200 test -n "$library_names"; }; }; then
2201 # We only need to search for static libraries
2205 # Try to link the static library
2206 # Here we assume that one of hardcode_direct or hardcode_minus_L
2207 # is not unsupported. This is valid on all known static and
2209 if test "$hardcode_direct" != unsupported; then
2210 test -n "$old_library" && linklib="$old_library"
2211 compile_deplibs="$dir/$linklib $compile_deplibs"
2212 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2214 compile_deplibs="-l$name -L$dir $compile_deplibs"
2215 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2217 elif test "$build_libtool_libs" = yes; then
2218 # Not a shared library
2219 if test "$deplibs_check_method" != pass_all; then
2220 # We're trying link a shared library against a static one
2221 # but the system doesn't support it.
2223 # Just print a warning and add the library to dependency_libs so
2224 # that the program can be linked against the static library.
2226 echo "*** Warning: This system can not link to static lib archive $lib."
2227 echo "*** I have the capability to make that library automatically link in when"
2228 echo "*** you link to this library. But I can only do this if you have a"
2229 echo "*** shared version of the library, which you do not appear to have."
2230 if test "$module" = yes; then
2231 echo "*** But as you try to build a module library, libtool will still create "
2232 echo "*** a static module, that should work as long as the dlopening application"
2233 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2234 if test -z "$global_symbol_pipe"; then
2236 echo "*** However, this would only work if libtool was able to extract symbol"
2237 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2238 echo "*** not find such a program. So, this module is probably useless."
2239 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2241 if test "$build_old_libs" = no; then
2242 build_libtool_libs=module
2245 build_libtool_libs=no
2249 convenience="$convenience $dir/$old_library"
2250 old_convenience="$old_convenience $dir/$old_library"
2251 deplibs="$dir/$old_library $deplibs"
2254 fi # link shared/static library?
2256 if test $linkmode = lib; then
2257 if test -n "$dependency_libs" &&
2258 { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2259 test $link_static = yes; }; then
2260 # Extract -R from dependency_libs
2262 for libdir in $dependency_libs; do
2264 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2266 *" $temp_xrpath "*) ;;
2267 *) xrpath="$xrpath $temp_xrpath";;
2269 *) temp_deplibs="$temp_deplibs $libdir";;
2272 dependency_libs="$temp_deplibs"
2275 newlib_search_path="$newlib_search_path $absdir"
2276 # Link against this library
2277 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2278 # ... and its dependency_libs
2280 for deplib in $dependency_libs; do
2281 newdependency_libs="$deplib $newdependency_libs"
2282 if test "X$duplicate_deps" = "Xyes" ; then
2283 case "$tmp_libs " in
2284 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2287 tmp_libs="$tmp_libs $deplib"
2290 if test $link_all_deplibs != no; then
2291 # Add the search paths of all dependency libraries
2292 for deplib in $dependency_libs; do
2294 -L*) path="$deplib" ;;
2296 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2297 test "X$dir" = "X$deplib" && dir="."
2298 # We need an absolute path.
2300 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2302 absdir=`cd "$dir" && pwd`
2303 if test -z "$absdir"; then
2304 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2309 if grep "^installed=no" $deplib > /dev/null; then
2310 path="-L$absdir/$objdir"
2312 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2313 if test -z "$libdir"; then
2314 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2317 if test "$absdir" != "$libdir"; then
2318 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2325 case " $deplibs " in
2327 *) deplibs="$deplibs $path" ;;
2330 fi # link_all_deplibs != no
2332 done # for deplib in $libs
2333 if test $pass = dlpreopen; then
2334 # Link the dlpreopened libraries before other libraries
2335 for deplib in $save_deplibs; do
2336 deplibs="$deplib $deplibs"
2339 if test $pass != dlopen; then
2340 test $pass != scan && dependency_libs="$newdependency_libs"
2341 if test $pass != conv; then
2342 # Make sure lib_search_path contains only unique directories.
2344 for dir in $newlib_search_path; do
2345 case "$lib_search_path " in
2347 *) lib_search_path="$lib_search_path $dir" ;;
2353 if test "$linkmode,$pass" != "prog,link"; then
2356 vars="compile_deplibs finalize_deplibs"
2358 for var in $vars dependency_libs; do
2359 # Add libraries to $var in reverse order
2360 eval tmp_libs=\"\$$var\"
2362 for deplib in $tmp_libs; do
2364 -L*) new_libs="$deplib $new_libs" ;;
2366 case " $specialdeplibs " in
2367 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2369 case " $new_libs " in
2371 *) new_libs="$deplib $new_libs" ;;
2379 for deplib in $new_libs; do
2382 case " $tmp_libs " in
2384 *) tmp_libs="$tmp_libs $deplib" ;;
2387 *) tmp_libs="$tmp_libs $deplib" ;;
2390 eval $var=\"$tmp_libs\"
2393 if test "$pass" = "conv" &&
2394 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2395 libs="$deplibs" # reset libs
2399 if test $linkmode = prog; then
2400 dlfiles="$newdlfiles"
2401 dlprefiles="$newdlprefiles"
2406 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2407 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2410 if test -n "$rpath"; then
2411 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2414 if test -n "$xrpath"; then
2415 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2418 if test -n "$vinfo"; then
2419 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2422 if test -n "$release"; then
2423 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2426 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2427 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2430 # Now set the variables for building old libraries.
2431 build_libtool_libs=no
2433 objs="$objs$old_deplibs"
2437 # Make sure we only generate libraries of the form `libNAME.la'.
2440 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2441 eval libname=\"$libname_spec\"
2444 if test "$module" = no; then
2445 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2449 if test "$need_lib_prefix" != no; then
2450 # Add the "lib" prefix for modules if required
2451 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2452 eval libname=\"$libname_spec\"
2454 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2459 if test -n "$objs"; then
2460 if test "$deplibs_check_method" != pass_all; then
2461 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2465 echo "*** Warning: Linking the shared library $output against the non-libtool"
2466 echo "*** objects $objs is not portable!"
2467 libobjs="$libobjs $objs"
2471 if test "$dlself" != no; then
2472 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2476 if test $# -gt 2; then
2477 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2482 if test -z "$rpath"; then
2483 if test "$build_libtool_libs" = yes; then
2484 # Building a libtool convenience library.
2486 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2487 build_libtool_libs=convenience
2491 if test -n "$vinfo"; then
2492 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2495 if test -n "$release"; then
2496 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2500 # Parse the version information argument.
2501 save_ifs="$IFS"; IFS=':'
2502 set dummy $vinfo 0 0 0
2505 if test -n "$8"; then
2506 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2515 # Check that each of the things are valid numbers.
2517 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2519 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2520 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2526 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2528 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2529 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2535 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2537 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2538 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2543 if test $age -gt $current; then
2544 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2545 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2549 # Calculate the version variables.
2553 case $version_type in
2557 # Like Linux, but with the current version available in
2558 # verstring for coding it into the library header
2559 major=.`expr $current - $age`
2560 versuffix="$major.$age.$revision"
2561 # Darwin ld doesn't like 0 for these options...
2562 minor_current=`expr $current + 1`
2563 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2568 versuffix=".$current.$revision";
2573 versuffix=".$current";
2577 case $version_type in
2578 nonstopux) verstring_prefix=nonstopux ;;
2579 *) verstring_prefix=sgi ;;
2581 verstring="$verstring_prefix$major.$revision"
2583 major=`expr $current - $age + 1`
2585 # Add in all the interfaces that we are compatible with.
2587 while test $loop != 0; do
2588 iface=`expr $revision - $loop`
2589 loop=`expr $loop - 1`
2590 verstring="$verstring_prefix$major.$iface:$verstring"
2593 # Before this point, $major must not contain `.'.
2595 versuffix="$major.$revision"
2599 major=.`expr $current - $age`
2600 versuffix="$major.$age.$revision"
2604 major=`expr $current - $age`
2605 versuffix=".$current.$age.$revision"
2606 verstring="$current.$age.$revision"
2608 # Add in all the interfaces that we are compatible with.
2610 while test $loop != 0; do
2611 iface=`expr $current - $loop`
2612 loop=`expr $loop - 1`
2613 verstring="$verstring:${iface}.0"
2616 # Make executables depend on our current version.
2617 verstring="$verstring:${current}.0"
2622 versuffix=".$current.$revision"
2626 # Use '-' rather than '.', since we only want one
2627 # extension on DOS 8.3 filesystems.
2628 major=`expr $current - $age`
2633 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2634 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2639 # Clear the version info if we defaulted, and they specified a release.
2640 if test -z "$vinfo" && test -n "$release"; then
2643 case $version_type in
2645 # we can't check for "0.0" in archive_cmds due to quoting
2646 # problems, so we reset it completely
2653 if test "$need_version" = no; then
2660 # Remove version info from name if versioning should be avoided
2661 if test "$avoid_version" = yes && test "$need_version" = no; then
2667 # Check to see if the archive will have undefined symbols.
2668 if test "$allow_undefined" = yes; then
2669 if test "$allow_undefined_flag" = unsupported; then
2670 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2671 build_libtool_libs=no
2675 # Don't allow undefined symbols.
2676 allow_undefined_flag="$no_undefined_flag"
2680 if test "$mode" != relink; then
2681 # Remove our outputs.
2682 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2683 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2686 # Now set the variables for building old libraries.
2687 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2688 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2690 # Transform .lo files to .o files.
2691 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2694 # Eliminate all temporary directories.
2695 for path in $notinst_path; do
2696 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2697 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2698 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2701 if test -n "$xrpath"; then
2702 # If the user specified any rpath flags, then add them.
2704 for libdir in $xrpath; do
2705 temp_xrpath="$temp_xrpath -R$libdir"
2706 case "$finalize_rpath " in
2708 *) finalize_rpath="$finalize_rpath $libdir" ;;
2711 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2712 dependency_libs="$temp_xrpath $dependency_libs"
2716 # Make sure dlfiles contains only unique files that won't be dlpreopened
2717 old_dlfiles="$dlfiles"
2719 for lib in $old_dlfiles; do
2720 case " $dlprefiles $dlfiles " in
2722 *) dlfiles="$dlfiles $lib" ;;
2726 # Make sure dlprefiles contains only unique files
2727 old_dlprefiles="$dlprefiles"
2729 for lib in $old_dlprefiles; do
2730 case "$dlprefiles " in
2732 *) dlprefiles="$dlprefiles $lib" ;;
2736 if test "$build_libtool_libs" = yes; then
2737 if test -n "$rpath"; then
2739 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2740 # these systems don't actually have a c library (as such)!
2742 *-*-rhapsody* | *-*-darwin1.[012])
2743 # Rhapsody C library is in the System framework
2744 deplibs="$deplibs -framework System"
2747 # Don't link with libc until the a.out ld.so is fixed.
2749 *-*-openbsd* | *-*-freebsd*)
2750 # Do not include libc due to us having libc/libc_r.
2753 # Add libc to deplibs on all other systems if necessary.
2754 if test $build_libtool_need_lc = "yes"; then
2755 deplibs="$deplibs -lc"
2761 # Transform deplibs into only deplibs that can be linked in shared.
2763 libname_save=$libname
2764 release_save=$release
2765 versuffix_save=$versuffix
2767 # I'm not sure if I'm treating the release correctly. I think
2768 # release should show up in the -l (ie -lgmp5) so we don't want to
2769 # add it in twice. Is that correct?
2775 case $deplibs_check_method in
2777 # Don't check for shared/static. Everything works.
2778 # This might be a little naive. We might want to check
2779 # whether the library exists or not. But this is on
2780 # osf3 & osf4 and I'm not really sure... Just
2781 # implementing what was already the behaviour.
2785 # This code stresses the "libraries are programs" paradigm to its
2786 # limits. Maybe even breaks it. We compile a program, linking it
2787 # against the deplibs as a proxy for the library. Then we can check
2788 # whether they linked in statically or dynamically with ldd.
2790 cat > conftest.c <<EOF
2791 int main() { return 0; }
2794 $CC -o conftest conftest.c $deplibs
2795 if test $? -eq 0 ; then
2796 ldd_output=`ldd conftest`
2797 for i in $deplibs; do
2798 name="`expr $i : '-l\(.*\)'`"
2799 # If $name is empty we are operating on a -L argument.
2800 if test -n "$name" && test "$name" != "0"; then
2801 libname=`eval \\$echo \"$libname_spec\"`
2802 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2803 set dummy $deplib_matches
2805 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2806 newdeplibs="$newdeplibs $i"
2810 echo "*** Warning: dynamic linker does not accept needed library $i."
2811 echo "*** I have the capability to make that library automatically link in when"
2812 echo "*** you link to this library. But I can only do this if you have a"
2813 echo "*** shared version of the library, which I believe you do not have"
2814 echo "*** because a test_compile did reveal that the linker did not use it for"
2815 echo "*** its dynamic dependency list that programs get resolved with at runtime."
2818 newdeplibs="$newdeplibs $i"
2822 # Error occured in the first compile. Let's try to salvage
2823 # the situation: Compile a separate program for each library.
2824 for i in $deplibs; do
2825 name="`expr $i : '-l\(.*\)'`"
2826 # If $name is empty we are operating on a -L argument.
2827 if test -n "$name" && test "$name" != "0"; then
2829 $CC -o conftest conftest.c $i
2831 if test $? -eq 0 ; then
2832 ldd_output=`ldd conftest`
2833 libname=`eval \\$echo \"$libname_spec\"`
2834 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2835 set dummy $deplib_matches
2837 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2838 newdeplibs="$newdeplibs $i"
2842 echo "*** Warning: dynamic linker does not accept needed library $i."
2843 echo "*** I have the capability to make that library automatically link in when"
2844 echo "*** you link to this library. But I can only do this if you have a"
2845 echo "*** shared version of the library, which you do not appear to have"
2846 echo "*** because a test_compile did reveal that the linker did not use this one"
2847 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2852 echo "*** Warning! Library $i is needed by this library but I was not able to"
2853 echo "*** make it link in! You will probably need to install it or some"
2854 echo "*** library that it depends on before this library will be fully"
2855 echo "*** functional. Installing it before continuing would be even better."
2858 newdeplibs="$newdeplibs $i"
2864 set dummy $deplibs_check_method
2865 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2866 for a_deplib in $deplibs; do
2867 name="`expr $a_deplib : '-l\(.*\)'`"
2868 # If $name is empty we are operating on a -L argument.
2869 if test -n "$name" && test "$name" != "0"; then
2870 libname=`eval \\$echo \"$libname_spec\"`
2871 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2872 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2873 for potent_lib in $potential_libs; do
2874 # Follow soft links.
2875 if ls -lLd "$potent_lib" 2>/dev/null \
2876 | grep " -> " >/dev/null; then
2879 # The statement above tries to avoid entering an
2880 # endless loop below, in case of cyclic links.
2881 # We might still enter an endless loop, since a link
2882 # loop can be closed while we follow links,
2884 potlib="$potent_lib"
2885 while test -h "$potlib" 2>/dev/null; do
2886 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2888 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2889 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2892 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2894 | egrep "$file_magic_regex" > /dev/null; then
2895 newdeplibs="$newdeplibs $a_deplib"
2901 if test -n "$a_deplib" ; then
2904 echo "*** Warning: linker path does not have real file for library $a_deplib."
2905 echo "*** I have the capability to make that library automatically link in when"
2906 echo "*** you link to this library. But I can only do this if you have a"
2907 echo "*** shared version of the library, which you do not appear to have"
2908 echo "*** because I did check the linker path looking for a file starting"
2909 if test -z "$potlib" ; then
2910 echo "*** with $libname but no candidates were found. (...for file magic test)"
2912 echo "*** with $libname and none of the candidates passed a file format test"
2913 echo "*** using a file magic. Last file checked: $potlib"
2917 # Add a -L argument.
2918 newdeplibs="$newdeplibs $a_deplib"
2920 done # Gone through all deplibs.
2923 set dummy $deplibs_check_method
2924 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2925 for a_deplib in $deplibs; do
2926 name="`expr $a_deplib : '-l\(.*\)'`"
2927 # If $name is empty we are operating on a -L argument.
2928 if test -n "$name" && test "$name" != "0"; then
2929 libname=`eval \\$echo \"$libname_spec\"`
2930 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2931 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2932 for potent_lib in $potential_libs; do
2933 potlib="$potent_lib" # see symlink-check below in file_magic test
2934 if eval echo \"$potent_lib\" 2>/dev/null \
2936 | egrep "$match_pattern_regex" > /dev/null; then
2937 newdeplibs="$newdeplibs $a_deplib"
2943 if test -n "$a_deplib" ; then
2946 echo "*** Warning: linker path does not have real file for library $a_deplib."
2947 echo "*** I have the capability to make that library automatically link in when"
2948 echo "*** you link to this library. But I can only do this if you have a"
2949 echo "*** shared version of the library, which you do not appear to have"
2950 echo "*** because I did check the linker path looking for a file starting"
2951 if test -z "$potlib" ; then
2952 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2954 echo "*** with $libname and none of the candidates passed a file format test"
2955 echo "*** using a regex pattern. Last file checked: $potlib"
2959 # Add a -L argument.
2960 newdeplibs="$newdeplibs $a_deplib"
2962 done # Gone through all deplibs.
2966 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2967 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2968 grep . >/dev/null; then
2970 if test "X$deplibs_check_method" = "Xnone"; then
2971 echo "*** Warning: inter-library dependencies are not supported in this platform."
2973 echo "*** Warning: inter-library dependencies are not known to be supported."
2975 echo "*** All declared inter-library dependencies are being dropped."
2980 versuffix=$versuffix_save
2982 release=$release_save
2983 libname=$libname_save
2987 *-*-rhapsody* | *-*-darwin1.[012])
2988 # On Rhapsody replace the C library is the System framework
2989 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2993 if test "$droppeddeps" = yes; then
2994 if test "$module" = yes; then
2996 echo "*** Warning: libtool could not satisfy all declared inter-library"
2997 echo "*** dependencies of module $libname. Therefore, libtool will create"
2998 echo "*** a static module, that should work as long as the dlopening"
2999 echo "*** application is linked with the -dlopen flag."
3000 if test -z "$global_symbol_pipe"; then
3002 echo "*** However, this would only work if libtool was able to extract symbol"
3003 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3004 echo "*** not find such a program. So, this module is probably useless."
3005 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3007 if test "$build_old_libs" = no; then
3008 oldlibs="$output_objdir/$libname.$libext"
3009 build_libtool_libs=module
3012 build_libtool_libs=no
3015 echo "*** The inter-library dependencies that have been dropped here will be"
3016 echo "*** automatically added whenever a program is linked with this library"
3017 echo "*** or is declared to -dlopen it."
3019 if test $allow_undefined = no; then
3021 echo "*** Since this library must not contain undefined symbols,"
3022 echo "*** because either the platform does not support them or"
3023 echo "*** it was explicitly requested with -no-undefined,"
3024 echo "*** libtool will only create a static version of it."
3025 if test "$build_old_libs" = no; then
3026 oldlibs="$output_objdir/$libname.$libext"
3027 build_libtool_libs=module
3030 build_libtool_libs=no
3035 # Done checking deplibs!
3039 # All the library-specific variables (install_libdir is set above).
3044 # Test again, we may have decided not to build it any more
3045 if test "$build_libtool_libs" = yes; then
3046 if test $hardcode_into_libs = yes; then
3047 # Hardcode the library paths
3050 rpath="$finalize_rpath"
3051 test "$mode" != relink && rpath="$compile_rpath$rpath"
3052 for libdir in $rpath; do
3053 if test -n "$hardcode_libdir_flag_spec"; then
3054 if test -n "$hardcode_libdir_separator"; then
3055 if test -z "$hardcode_libdirs"; then
3056 hardcode_libdirs="$libdir"
3058 # Just accumulate the unique libdirs.
3059 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3060 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3063 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3068 eval flag=\"$hardcode_libdir_flag_spec\"
3069 dep_rpath="$dep_rpath $flag"
3071 elif test -n "$runpath_var"; then
3072 case "$perm_rpath " in
3074 *) perm_rpath="$perm_rpath $libdir" ;;
3078 # Substitute the hardcoded libdirs into the rpath.
3079 if test -n "$hardcode_libdir_separator" &&
3080 test -n "$hardcode_libdirs"; then
3081 libdir="$hardcode_libdirs"
3082 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3084 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3085 # We should set the runpath_var.
3087 for dir in $perm_rpath; do
3090 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3092 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3095 shlibpath="$finalize_shlibpath"
3096 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3097 if test -n "$shlibpath"; then
3098 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3101 # Get the real and link names of the library.
3102 eval library_names=\"$library_names_spec\"
3103 set dummy $library_names
3107 if test -n "$soname_spec"; then
3108 eval soname=\"$soname_spec\"
3112 test -z "$dlname" && dlname=$soname
3114 lib="$output_objdir/$realname"
3117 linknames="$linknames $link"
3120 # Ensure that we have .o objects for linkers which dislike .lo
3121 # (e.g. aix) in case we are running --disable-static
3122 for obj in $libobjs; do
3123 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3124 if test "X$xdir" = "X$obj"; then
3129 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3130 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3131 if test ! -f $xdir/$oldobj; then
3132 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3133 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3137 # Use standard objects if they are pic
3138 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3140 # Prepare the list of exported symbols
3141 if test -z "$export_symbols"; then
3142 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3143 $show "generating symbol list for \`$libname.la'"
3144 export_symbols="$output_objdir/$libname.exp"
3145 $run $rm $export_symbols
3146 eval cmds=\"$export_symbols_cmds\"
3147 save_ifs="$IFS"; IFS='~'
3148 for cmd in $cmds; do
3151 $run eval "$cmd" || exit $?
3154 if test -n "$export_symbols_regex"; then
3155 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3156 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3157 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3158 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3163 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3164 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3167 if test -n "$convenience"; then
3168 if test -n "$whole_archive_flag_spec"; then
3169 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3171 gentop="$output_objdir/${outputname}x"
3172 $show "${rm}r $gentop"
3173 $run ${rm}r "$gentop"
3174 $show "mkdir $gentop"
3175 $run mkdir "$gentop"
3177 if test $status -ne 0 && test ! -d "$gentop"; then
3180 generated="$generated $gentop"
3182 for xlib in $convenience; do
3183 # Extract the objects.
3185 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3186 *) xabs=`pwd`"/$xlib" ;;
3188 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3189 xdir="$gentop/$xlib"
3191 $show "${rm}r $xdir"
3196 if test $status -ne 0 && test ! -d "$xdir"; then
3199 $show "(cd $xdir && $AR x $xabs)"
3200 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3202 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3207 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3208 eval flag=\"$thread_safe_flag_spec\"
3209 linker_flags="$linker_flags $flag"
3212 # Make a backup of the uninstalled library when relinking
3213 if test "$mode" = relink; then
3214 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3217 # Do each of the archive commands.
3218 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3219 eval cmds=\"$archive_expsym_cmds\"
3221 eval cmds=\"$archive_cmds\"
3223 save_ifs="$IFS"; IFS='~'
3224 for cmd in $cmds; do
3227 $run eval "$cmd" || exit $?
3231 # Restore the uninstalled library and exit
3232 if test "$mode" = relink; then
3233 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3237 # Create links to the real library.
3238 for linkname in $linknames; do
3239 if test "$realname" != "$linkname"; then
3240 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3241 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3245 # If -module or -export-dynamic was specified, set the dlname.
3246 if test "$module" = yes || test "$export_dynamic" = yes; then
3247 # On all known operating systems, these are identical.
3254 if test -n "$deplibs"; then
3255 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3258 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3259 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3262 if test -n "$rpath"; then
3263 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3266 if test -n "$xrpath"; then
3267 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3270 if test -n "$vinfo"; then
3271 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3274 if test -n "$release"; then
3275 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3280 if test -n "$objs$old_deplibs"; then
3281 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3285 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3293 # Delete the old objects.
3294 $run $rm $obj $libobj
3296 # Objects from convenience libraries. This assumes
3297 # single-version convenience libraries. Whenever we create
3298 # different ones for PIC/non-PIC, this we'll have to duplicate
3302 # reload_cmds runs $LD directly, so let us get rid of
3303 # -Wl from whole_archive_flag_spec
3306 if test -n "$convenience"; then
3307 if test -n "$whole_archive_flag_spec"; then
3308 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3310 gentop="$output_objdir/${obj}x"
3311 $show "${rm}r $gentop"
3312 $run ${rm}r "$gentop"
3313 $show "mkdir $gentop"
3314 $run mkdir "$gentop"
3316 if test $status -ne 0 && test ! -d "$gentop"; then
3319 generated="$generated $gentop"
3321 for xlib in $convenience; do
3322 # Extract the objects.
3324 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3325 *) xabs=`pwd`"/$xlib" ;;
3327 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3328 xdir="$gentop/$xlib"
3330 $show "${rm}r $xdir"
3335 if test $status -ne 0 && test ! -d "$xdir"; then
3338 $show "(cd $xdir && $AR x $xabs)"
3339 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3341 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3346 # Create the old-style object.
3347 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
3350 eval cmds=\"$reload_cmds\"
3351 save_ifs="$IFS"; IFS='~'
3352 for cmd in $cmds; do
3355 $run eval "$cmd" || exit $?
3359 # Exit if we aren't doing a library object file.
3360 if test -z "$libobj"; then
3361 if test -n "$gentop"; then
3362 $show "${rm}r $gentop"
3369 if test "$build_libtool_libs" != yes; then
3370 if test -n "$gentop"; then
3371 $show "${rm}r $gentop"
3375 # Create an invalid libtool object if no PIC, so that we don't
3376 # accidentally link it into a program.
3377 $show "echo timestamp > $libobj"
3378 $run eval "echo timestamp > $libobj" || exit $?
3382 if test -n "$pic_flag" || test "$pic_mode" != default; then
3383 # Only do commands if we really have different PIC objects.
3384 reload_objs="$libobjs $reload_conv_objs"
3386 eval cmds=\"$reload_cmds\"
3387 save_ifs="$IFS"; IFS='~'
3388 for cmd in $cmds; do
3391 $run eval "$cmd" || exit $?
3395 # Just create a symlink.
3398 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3399 if test "X$xdir" = "X$libobj"; then
3404 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3405 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3406 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3407 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3410 if test -n "$gentop"; then
3411 $show "${rm}r $gentop"
3420 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3422 if test -n "$vinfo"; then
3423 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3426 if test -n "$release"; then
3427 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3430 if test "$preload" = yes; then
3431 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3432 test "$dlopen_self_static" = unknown; then
3433 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3438 *-*-rhapsody* | *-*-darwin1.[012])
3439 # On Rhapsody replace the C library is the System framework
3440 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3441 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3445 compile_command="$compile_command $compile_deplibs"
3446 finalize_command="$finalize_command $finalize_deplibs"
3448 if test -n "$rpath$xrpath"; then
3449 # If the user specified any rpath flags, then add them.
3450 for libdir in $rpath $xrpath; do
3451 # This is the magic to use -rpath.
3452 case "$finalize_rpath " in
3454 *) finalize_rpath="$finalize_rpath $libdir" ;;
3459 # Now hardcode the library paths
3462 for libdir in $compile_rpath $finalize_rpath; do
3463 if test -n "$hardcode_libdir_flag_spec"; then
3464 if test -n "$hardcode_libdir_separator"; then
3465 if test -z "$hardcode_libdirs"; then
3466 hardcode_libdirs="$libdir"
3468 # Just accumulate the unique libdirs.
3469 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3470 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3473 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3478 eval flag=\"$hardcode_libdir_flag_spec\"
3479 rpath="$rpath $flag"
3481 elif test -n "$runpath_var"; then
3482 case "$perm_rpath " in
3484 *) perm_rpath="$perm_rpath $libdir" ;;
3488 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3489 case :$dllsearchpath: in
3491 *) dllsearchpath="$dllsearchpath:$libdir";;
3496 # Substitute the hardcoded libdirs into the rpath.
3497 if test -n "$hardcode_libdir_separator" &&
3498 test -n "$hardcode_libdirs"; then
3499 libdir="$hardcode_libdirs"
3500 eval rpath=\" $hardcode_libdir_flag_spec\"
3502 compile_rpath="$rpath"
3506 for libdir in $finalize_rpath; do
3507 if test -n "$hardcode_libdir_flag_spec"; then
3508 if test -n "$hardcode_libdir_separator"; then
3509 if test -z "$hardcode_libdirs"; then
3510 hardcode_libdirs="$libdir"
3512 # Just accumulate the unique libdirs.
3513 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3514 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3517 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3522 eval flag=\"$hardcode_libdir_flag_spec\"
3523 rpath="$rpath $flag"
3525 elif test -n "$runpath_var"; then
3526 case "$finalize_perm_rpath " in
3528 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3532 # Substitute the hardcoded libdirs into the rpath.
3533 if test -n "$hardcode_libdir_separator" &&
3534 test -n "$hardcode_libdirs"; then
3535 libdir="$hardcode_libdirs"
3536 eval rpath=\" $hardcode_libdir_flag_spec\"
3538 finalize_rpath="$rpath"
3540 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3541 # Transform all the library objects into standard objects.
3542 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3543 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3547 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3548 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3549 dlsyms="${outputname}S.c"
3551 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3555 if test -n "$dlsyms"; then
3559 # Discover the nlist of each of the dlfiles.
3560 nlist="$output_objdir/${outputname}.nm"
3562 $show "$rm $nlist ${nlist}S ${nlist}T"
3563 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3565 # Parse the name list into a source file.
3566 $show "creating $output_objdir/$dlsyms"
3568 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3569 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3570 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3576 /* Prevent the only kind of declaration conflicts we can make. */
3577 #define lt_preloaded_symbols some_other_symbol
3579 /* External symbol declarations for the compiler. */\
3582 if test "$dlself" = yes; then
3583 $show "generating symbol list for \`$output'"
3585 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3587 # Add our own program objects to the symbol list.
3588 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3589 for arg in $progfiles; do
3590 $show "extracting global C symbols from \`$arg'"
3591 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3594 if test -n "$exclude_expsyms"; then
3595 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3596 $run eval '$mv "$nlist"T "$nlist"'
3599 if test -n "$export_symbols_regex"; then
3600 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3601 $run eval '$mv "$nlist"T "$nlist"'
3604 # Prepare the list of exported symbols
3605 if test -z "$export_symbols"; then
3606 export_symbols="$output_objdir/$output.exp"
3607 $run $rm $export_symbols
3608 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3610 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3611 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3612 $run eval 'mv "$nlist"T "$nlist"'
3616 for arg in $dlprefiles; do
3617 $show "extracting global C symbols from \`$arg'"
3618 name=`echo "$arg" | sed -e 's%^.*/%%'`
3619 $run eval 'echo ": $name " >> "$nlist"'
3620 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3623 if test -z "$run"; then
3624 # Make sure we have at least an empty file.
3625 test -f "$nlist" || : > "$nlist"
3627 if test -n "$exclude_expsyms"; then
3628 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3629 $mv "$nlist"T "$nlist"
3632 # Try sorting and uniquifying the output.
3633 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3636 grep -v "^: " < "$nlist" > "$nlist"S
3639 if test -f "$nlist"S; then
3640 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3642 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3645 $echo >> "$output_objdir/$dlsyms" "\
3647 #undef lt_preloaded_symbols
3649 #if defined (__STDC__) && __STDC__
3650 # define lt_ptr void *
3652 # define lt_ptr char *
3656 /* The mapping between symbol names and symbols. */
3661 lt_preloaded_symbols[] =
3665 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3667 $echo >> "$output_objdir/$dlsyms" "\
3671 /* This works around a problem in FreeBSD linker */
3672 #ifdef FREEBSD_WORKAROUND
3673 static const void *lt_preloaded_setup() {
3674 return lt_preloaded_symbols;
3684 pic_flag_for_symtable=
3686 # compiling the symbol table file with pic_flag works around
3687 # a FreeBSD bug that causes programs to crash when -lm is
3688 # linked before any other PIC object. But we must not use
3689 # pic_flag when linking with -static. The problem exists in
3690 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3691 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3692 case "$compile_command " in
3694 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3697 case "$compile_command " in
3699 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3703 # Now compile the dynamic symbol file.
3704 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3705 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3707 # Clean up the generated files.
3708 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3709 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3711 # Transform the symbol file into the correct name.
3712 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3713 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3716 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3721 # We keep going just in case the user didn't refer to
3722 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3723 # really was required.
3725 # Nullify the symbol file.
3726 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3727 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3730 if test $need_relink = no || test "$build_libtool_libs" != yes; then
3731 # Replace the output file specification.
3732 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3733 link_command="$compile_command$compile_rpath"
3735 # We have no uninstalled library dependencies, so finalize right now.
3736 $show "$link_command"
3737 $run eval "$link_command"
3740 # Delete the generated files.
3741 if test -n "$dlsyms"; then
3742 $show "$rm $output_objdir/${outputname}S.${objext}"
3743 $run $rm "$output_objdir/${outputname}S.${objext}"
3749 if test -n "$shlibpath_var"; then
3750 # We should set the shlibpath_var
3752 for dir in $temp_rpath; do
3754 [\\/]* | [A-Za-z]:[\\/]*)
3759 # Relative path: add a thisdir entry.
3760 rpath="$rpath\$thisdir/$dir:"
3767 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3768 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3770 if test -n "$finalize_shlibpath"; then
3771 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3776 if test -n "$runpath_var"; then
3777 if test -n "$perm_rpath"; then
3778 # We should set the runpath_var.
3780 for dir in $perm_rpath; do
3783 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3785 if test -n "$finalize_perm_rpath"; then
3786 # We should set the runpath_var.
3788 for dir in $finalize_perm_rpath; do
3791 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3795 if test "$no_install" = yes; then
3796 # We don't need to create a wrapper script.
3797 link_command="$compile_var$compile_command$compile_rpath"
3798 # Replace the output file specification.
3799 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3800 # Delete the old output file.
3802 # Link the executable and exit
3803 $show "$link_command"
3804 $run eval "$link_command" || exit $?
3808 if test "$hardcode_action" = relink; then
3809 # Fast installation is not supported
3810 link_command="$compile_var$compile_command$compile_rpath"
3811 relink_command="$finalize_var$finalize_command$finalize_rpath"
3813 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3814 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3816 if test "$fast_install" != no; then
3817 link_command="$finalize_var$compile_command$finalize_rpath"
3818 if test "$fast_install" = yes; then
3819 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3821 # fast_install is set to needless
3825 link_command="$compile_var$compile_command$compile_rpath"
3826 relink_command="$finalize_var$finalize_command$finalize_rpath"
3830 # Replace the output file specification.
3831 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3833 # Delete the old output files.
3834 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3836 $show "$link_command"
3837 $run eval "$link_command" || exit $?
3839 # Now create the wrapper script.
3840 $show "creating $output"
3842 # Quote the relink command for shipping.
3843 if test -n "$relink_command"; then
3844 # Preserve any variables that may affect compiler behavior
3845 for var in $variables_saved_for_relink; do
3846 if eval test -z \"\${$var+set}\"; then
3847 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3848 elif eval var_value=\$$var; test -z "$var_value"; then
3849 relink_command="$var=; export $var; $relink_command"
3851 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3852 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3855 relink_command="(cd `pwd`; $relink_command)"
3856 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3859 # Quote $echo for shipping.
3860 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3862 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3863 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3865 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3867 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3870 # Only actually do things if our run command is non-null.
3871 if test -z "$run"; then
3872 # win32 will think the script is a binary if it has
3873 # a .exe suffix, so we strip it off here.
3875 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3877 # test for cygwin because mv fails w/o .exe extensions
3879 *cygwin*) exeext=.exe ;;
3883 trap "$rm $output; exit 1" 1 2 15
3888 # $output - temporary wrapper script for $objdir/$outputname
3889 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3891 # The $output program cannot be directly executed until all the libtool
3892 # libraries that it depends on are installed.
3894 # This wrapper script should never be moved out of the build directory.
3895 # If it is, it will not operate correctly.
3897 # Sed substitution that helps us do robust quoting. It backslashifies
3898 # metacharacters that are still active within double-quoted strings.
3899 Xsed='sed -e 1s/^X//'
3900 sed_quote_subst='$sed_quote_subst'
3902 # The HP-UX ksh and POSIX shell print the target directory to stdout
3904 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3906 relink_command=\"$relink_command\"
3908 # This environment variable determines our operation mode.
3909 if test \"\$libtool_install_magic\" = \"$magic\"; then
3910 # install mode needs the following variable:
3911 notinst_deplibs='$notinst_deplibs'
3913 # When we are sourced in execute mode, \$file and \$echo are already set.
3914 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3917 # Make sure echo works.
3918 if test \"X\$1\" = X--no-reexec; then
3919 # Discard the --no-reexec flag, and continue.
3921 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3922 # Yippee, \$echo works!
3925 # Restart under the correct shell, and then maybe \$echo will work.
3926 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3932 # Find the directory that this script lives in.
3933 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3934 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3936 # Follow symbolic links until we get to the real thisdir.
3937 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3938 while test -n \"\$file\"; do
3939 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3941 # If there was a directory component, then change thisdir.
3942 if test \"x\$destdir\" != \"x\$file\"; then
3943 case \"\$destdir\" in
3944 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3945 *) thisdir=\"\$thisdir/\$destdir\" ;;
3949 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3950 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3953 # Try to get the absolute directory name.
3954 absdir=\`cd \"\$thisdir\" && pwd\`
3955 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3958 if test "$fast_install" = yes; then
3960 program=lt-'$outputname'$exeext
3961 progdir=\"\$thisdir/$objdir\"
3963 if test ! -f \"\$progdir/\$program\" || \\
3964 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3965 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3967 file=\"\$\$-\$program\"
3969 if test ! -d \"\$progdir\"; then
3970 $mkdir \"\$progdir\"
3972 $rm \"\$progdir/\$file\"
3977 # relink executable if necessary
3978 if test -n \"\$relink_command\"; then
3979 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3981 $echo \"\$relink_command_output\" >&2
3982 $rm \"\$progdir/\$file\"
3987 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3988 { $rm \"\$progdir/\$program\";
3989 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3990 $rm \"\$progdir/\$file\"
3994 program='$outputname'
3995 progdir=\"\$thisdir/$objdir\"
4001 if test -f \"\$progdir/\$program\"; then"
4003 # Export our shlibpath_var if we have one.
4004 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4006 # Add our own library path to $shlibpath_var
4007 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4009 # Some systems cannot cope with colon-terminated $shlibpath_var
4010 # The second colon is a workaround for a bug in BeOS R4 sed
4011 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4013 export $shlibpath_var
4017 # fixup the dll searchpath if we need to.
4018 if test -n "$dllsearchpath"; then
4020 # Add the dll search path components to the executable PATH
4021 PATH=$dllsearchpath:\$PATH
4026 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4027 # Run the actual program with our arguments.
4030 # win32 systems need to use the prog path for dll
4032 *-*-cygwin* | *-*-pw32*)
4034 exec \$progdir/\$program \${1+\"\$@\"}
4038 # Backslashes separate directories on plain windows
4039 *-*-mingw | *-*-os2*)
4041 exec \$progdir\\\\\$program \${1+\"\$@\"}
4047 # Export the path to the program.
4048 PATH=\"\$progdir:\$PATH\"
4051 exec \$program \${1+\"\$@\"}
4056 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4060 # The program doesn't exist.
4061 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4062 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4063 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4074 # See if we need to build an old-fashioned archive.
4075 for oldlib in $oldlibs; do
4077 if test "$build_libtool_libs" = convenience; then
4078 oldobjs="$libobjs_save"
4079 addlibs="$convenience"
4080 build_libtool_libs=no
4082 if test "$build_libtool_libs" = module; then
4083 oldobjs="$libobjs_save"
4084 build_libtool_libs=no
4086 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4088 addlibs="$old_convenience"
4091 if test -n "$addlibs"; then
4092 gentop="$output_objdir/${outputname}x"
4093 $show "${rm}r $gentop"
4094 $run ${rm}r "$gentop"
4095 $show "mkdir $gentop"
4096 $run mkdir "$gentop"
4098 if test $status -ne 0 && test ! -d "$gentop"; then
4101 generated="$generated $gentop"
4103 # Add in members from convenience archives.
4104 for xlib in $addlibs; do
4105 # Extract the objects.
4107 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4108 *) xabs=`pwd`"/$xlib" ;;
4110 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4111 xdir="$gentop/$xlib"
4113 $show "${rm}r $xdir"
4118 if test $status -ne 0 && test ! -d "$xdir"; then
4121 $show "(cd $xdir && $AR x $xabs)"
4122 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4124 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4128 # Do each command in the archive commands.
4129 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4130 eval cmds=\"$old_archive_from_new_cmds\"
4132 # Ensure that we have .o objects in place in case we decided
4133 # not to build a shared library, and have fallen back to building
4134 # static libs even though --disable-static was passed!
4135 for oldobj in $oldobjs; do
4136 if test ! -f $oldobj; then
4137 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4138 if test "X$xdir" = "X$oldobj"; then
4143 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4144 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4145 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4146 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4150 eval cmds=\"$old_archive_cmds\"
4152 save_ifs="$IFS"; IFS='~'
4153 for cmd in $cmds; do
4156 $run eval "$cmd" || exit $?
4161 if test -n "$generated"; then
4162 $show "${rm}r$generated"
4163 $run ${rm}r$generated
4166 # Now create the libtool archive.
4170 test "$build_old_libs" = yes && old_library="$libname.$libext"
4171 $show "creating $output"
4173 # Preserve any variables that may affect compiler behavior
4174 for var in $variables_saved_for_relink; do
4175 if eval test -z \"\${$var+set}\"; then
4176 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4177 elif eval var_value=\$$var; test -z "$var_value"; then
4178 relink_command="$var=; export $var; $relink_command"
4180 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4181 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4184 # Quote the link command for shipping.
4185 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
4186 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4188 # Only create the output if not a dry run.
4189 if test -z "$run"; then
4190 for installed in no yes; do
4191 if test "$installed" = yes; then
4192 if test -z "$install_libdir"; then
4195 output="$output_objdir/$outputname"i
4196 # Replace all uninstalled libtool libraries with the installed ones
4198 for deplib in $dependency_libs; do
4201 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4202 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4203 if test -z "$libdir"; then
4204 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4207 newdependency_libs="$newdependency_libs $libdir/$name"
4209 *) newdependency_libs="$newdependency_libs $deplib" ;;
4212 dependency_libs="$newdependency_libs"
4214 for lib in $dlfiles; do
4215 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4216 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4217 if test -z "$libdir"; then
4218 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4221 newdlfiles="$newdlfiles $libdir/$name"
4223 dlfiles="$newdlfiles"
4225 for lib in $dlprefiles; do
4226 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4227 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4228 if test -z "$libdir"; then
4229 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4232 newdlprefiles="$newdlprefiles $libdir/$name"
4234 dlprefiles="$newdlprefiles"
4237 # place dlname in correct position for cygwin
4239 case $host,$output,$installed,$module,$dlname in
4240 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4243 # $outputname - a libtool library file
4244 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4246 # Please DO NOT delete this file!
4247 # It is necessary for linking the library.
4249 # The name that we can dlopen(3).
4252 # Names of this library.
4253 library_names='$library_names'
4255 # The name of the static archive.
4256 old_library='$old_library'
4258 # Libraries that this one depends upon.
4259 dependency_libs='$dependency_libs'
4261 # Version information for $libname.
4266 # Is this an already installed library?
4267 installed=$installed
4269 # Files to dlopen/dlpreopen
4271 dlpreopen='$dlprefiles'
4273 # Directory that this library needs to be installed in:
4274 libdir='$install_libdir'"
4275 if test "$installed" = no && test $need_relink = yes; then
4277 relink_command=\"$relink_command\""
4282 # Do a symbolic link so that the libtool archive can be found in
4283 # LD_LIBRARY_PATH before the program is installed.
4284 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4285 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4291 # libtool install mode
4293 modename="$modename: install"
4295 # There may be an optional sh(1) argument at the beginning of
4296 # install_prog (especially on Windows NT).
4297 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4298 # Allow the use of GNU shtool's install command.
4299 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4300 # Aesthetically quote it.
4301 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4303 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4307 install_prog="$arg "
4315 # The real first argument should be the name of the installation program.
4316 # Aesthetically quote it.
4317 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4319 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4323 install_prog="$install_prog$arg"
4325 # We need to accept at least all the BSD install flags.
4335 if test -n "$dest"; then
4336 files="$files $dest"
4354 # If the previous option needed an argument, then skip it.
4355 if test -n "$prev"; then
4364 # Aesthetically quote the argument.
4365 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4367 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4371 install_prog="$install_prog $arg"
4374 if test -z "$install_prog"; then
4375 $echo "$modename: you must specify an install program" 1>&2
4380 if test -n "$prev"; then
4381 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4386 if test -z "$files"; then
4387 if test -z "$dest"; then
4388 $echo "$modename: no file or destination specified" 1>&2
4390 $echo "$modename: you must specify a destination" 1>&2
4396 # Strip any trailing slash from the destination.
4397 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4399 # Check to see that the destination is a directory.
4400 test -d "$dest" && isdir=yes
4401 if test "$isdir" = yes; then
4405 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4406 test "X$destdir" = "X$dest" && destdir=.
4407 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4409 # Not a directory, so check to see that there is only one file specified.
4411 if test $# -gt 2; then
4412 $echo "$modename: \`$dest' is not a directory" 1>&2
4418 [\\/]* | [A-Za-z]:[\\/]*) ;;
4420 for file in $files; do
4424 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4433 # This variable tells wrapper scripts just to set variables rather
4434 # than running their programs.
4435 libtool_install_magic="$magic"
4440 for file in $files; do
4442 # Do each installation.
4445 # Do the static libraries later.
4446 staticlibs="$staticlibs $file"
4450 # Check to see that this really is a libtool archive.
4451 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4453 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4461 # If there is no directory component, then add one.
4463 */* | *\\*) . $file ;;
4467 # Add the libdir to current_libdirs if it is the destination.
4468 if test "X$destdir" = "X$libdir"; then
4469 case "$current_libdirs " in
4471 *) current_libdirs="$current_libdirs $libdir" ;;
4474 # Note the libdir as a future libdir.
4475 case "$future_libdirs " in
4477 *) future_libdirs="$future_libdirs $libdir" ;;
4481 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4482 test "X$dir" = "X$file/" && dir=
4485 if test -n "$relink_command"; then
4486 $echo "$modename: warning: relinking \`$file'" 1>&2
4487 $show "$relink_command"
4488 if $run eval "$relink_command"; then :
4490 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4495 # See the names of the shared library.
4496 set dummy $library_names
4497 if test -n "$2"; then
4503 test -n "$relink_command" && srcname="$realname"T
4505 # Install the shared library and build the symlinks.
4506 $show "$install_prog $dir/$srcname $destdir/$realname"
4507 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4508 if test -n "$stripme" && test -n "$striplib"; then
4509 $show "$striplib $destdir/$realname"
4510 $run eval "$striplib $destdir/$realname" || exit $?
4513 if test $# -gt 0; then
4514 # Delete the old symlinks, and create new ones.
4517 if test "$linkname" != "$realname"; then
4518 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4519 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4524 # Do each command in the postinstall commands.
4525 lib="$destdir/$realname"
4526 eval cmds=\"$postinstall_cmds\"
4527 save_ifs="$IFS"; IFS='~'
4528 for cmd in $cmds; do
4531 $run eval "$cmd" || exit $?
4536 # Install the pseudo-library for information purposes.
4537 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4538 instname="$dir/$name"i
4539 $show "$install_prog $instname $destdir/$name"
4540 $run eval "$install_prog $instname $destdir/$name" || exit $?
4542 # Maybe install the static library, too.
4543 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4547 # Install (i.e. copy) a libtool object.
4549 # Figure out destination file name, if it wasn't already specified.
4550 if test -n "$destname"; then
4551 destfile="$destdir/$destname"
4553 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4554 destfile="$destdir/$destfile"
4557 # Deduce the name of the destination old-style object file.
4560 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4563 staticdest="$destfile"
4567 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4573 # Install the libtool object if requested.
4574 if test -n "$destfile"; then
4575 $show "$install_prog $file $destfile"
4576 $run eval "$install_prog $file $destfile" || exit $?
4579 # Install the old object if enabled.
4580 if test "$build_old_libs" = yes; then
4581 # Deduce the name of the old-style object file.
4582 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4584 $show "$install_prog $staticobj $staticdest"
4585 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4591 # Figure out destination file name, if it wasn't already specified.
4592 if test -n "$destname"; then
4593 destfile="$destdir/$destname"
4595 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4596 destfile="$destdir/$destfile"
4599 # Do a test to see if this is really a libtool program.
4602 wrapper=`echo $file | sed -e 's,.exe$,,'`
4608 if (sed -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4612 # If there is no directory component, then add one.
4614 */* | *\\*) . $wrapper ;;
4618 # Check the variables that should have been set.
4619 if test -z "$notinst_deplibs"; then
4620 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4625 for lib in $notinst_deplibs; do
4626 # Check to see that each library is installed.
4628 if test -f "$lib"; then
4629 # If there is no directory component, then add one.
4631 */* | *\\*) . $lib ;;
4635 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4636 if test -n "$libdir" && test ! -f "$libfile"; then
4637 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4643 # If there is no directory component, then add one.
4645 */* | *\\*) . $wrapper ;;
4650 if test "$fast_install" = no && test -n "$relink_command"; then
4651 if test "$finalize" = yes && test -z "$run"; then
4653 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4654 tmpdir="$tmpdir/libtool-$$"
4655 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4657 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4660 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4661 outputname="$tmpdir/$file"
4662 # Replace the output file specification.
4663 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4665 $show "$relink_command"
4666 if $run eval "$relink_command"; then :
4668 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4674 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4677 # Install the binary that we compiled earlier.
4678 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4682 # remove .exe since cygwin /usr/bin/install will append another
4684 case $install_prog,$host in
4685 /usr/bin/install*,*cygwin*)
4686 case $file:$destfile in
4691 destfile=$destfile.exe
4694 destfile=`echo $destfile | sed -e 's,.exe$,,'`
4699 $show "$install_prog$stripme $file $destfile"
4700 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4701 test -n "$outputname" && ${rm}r "$tmpdir"
4706 for file in $staticlibs; do
4707 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4709 # Set up the ranlib parameters.
4710 oldlib="$destdir/$name"
4712 $show "$install_prog $file $oldlib"
4713 $run eval "$install_prog \$file \$oldlib" || exit $?
4715 if test -n "$stripme" && test -n "$striplib"; then
4716 $show "$old_striplib $oldlib"
4717 $run eval "$old_striplib $oldlib" || exit $?
4720 # Do each command in the postinstall commands.
4721 eval cmds=\"$old_postinstall_cmds\"
4722 save_ifs="$IFS"; IFS='~'
4723 for cmd in $cmds; do
4726 $run eval "$cmd" || exit $?
4731 if test -n "$future_libdirs"; then
4732 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4735 if test -n "$current_libdirs"; then
4736 # Maybe just do a dry run.
4737 test -n "$run" && current_libdirs=" -n$current_libdirs"
4738 exec_cmd='$SHELL $0 --finish$current_libdirs'
4744 # libtool finish mode
4746 modename="$modename: finish"
4750 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4753 libdirs="$libdirs $dir"
4756 for libdir in $libdirs; do
4757 if test -n "$finish_cmds"; then
4758 # Do each command in the finish commands.
4759 eval cmds=\"$finish_cmds\"
4760 save_ifs="$IFS"; IFS='~'
4761 for cmd in $cmds; do
4764 $run eval "$cmd" || admincmds="$admincmds
4769 if test -n "$finish_eval"; then
4770 # Do the single finish_eval.
4771 eval cmds=\"$finish_eval\"
4772 $run eval "$cmds" || admincmds="$admincmds
4778 # Exit here if they wanted silent mode.
4779 test "$show" = ":" && exit 0
4781 echo "----------------------------------------------------------------------"
4782 echo "Libraries have been installed in:"
4783 for libdir in $libdirs; do
4787 echo "If you ever happen to want to link against installed libraries"
4788 echo "in a given directory, LIBDIR, you must either use libtool, and"
4789 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4790 echo "flag during linking and do at least one of the following:"
4791 if test -n "$shlibpath_var"; then
4792 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4793 echo " during execution"
4795 if test -n "$runpath_var"; then
4796 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4797 echo " during linking"
4799 if test -n "$hardcode_libdir_flag_spec"; then
4801 eval flag=\"$hardcode_libdir_flag_spec\"
4803 echo " - use the \`$flag' linker flag"
4805 if test -n "$admincmds"; then
4806 echo " - have your system administrator run these commands:$admincmds"
4808 if test -f /etc/ld.so.conf; then
4809 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4812 echo "See any operating system documentation about shared libraries for"
4813 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4814 echo "----------------------------------------------------------------------"
4818 # libtool execute mode
4820 modename="$modename: execute"
4822 # The first argument is the command name.
4824 if test -z "$cmd"; then
4825 $echo "$modename: you must specify a COMMAND" 1>&2
4830 # Handle -dlopen flags immediately.
4831 for file in $execute_dlfiles; do
4832 if test ! -f "$file"; then
4833 $echo "$modename: \`$file' is not a file" 1>&2
4841 # Check to see that this really is a libtool archive.
4842 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4844 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4849 # Read the libtool library.
4853 # If there is no directory component, then add one.
4855 */* | *\\*) . $file ;;
4859 # Skip this library if it cannot be dlopened.
4860 if test -z "$dlname"; then
4861 # Warn if it was a shared library.
4862 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4866 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4867 test "X$dir" = "X$file" && dir=.
4869 if test -f "$dir/$objdir/$dlname"; then
4872 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4878 # Just add the directory containing the .lo file.
4879 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4880 test "X$dir" = "X$file" && dir=.
4884 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4889 # Get the absolute pathname.
4890 absdir=`cd "$dir" && pwd`
4891 test -n "$absdir" && dir="$absdir"
4893 # Now add the directory to shlibpath_var.
4894 if eval "test -z \"\$$shlibpath_var\""; then
4895 eval "$shlibpath_var=\"\$dir\""
4897 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4901 # This variable tells wrapper scripts just to set shlibpath_var
4902 # rather than running their programs.
4903 libtool_execute_magic="$magic"
4905 # Check if any of the arguments is a wrapper script.
4912 # Do a test to see if this is really a libtool program.
4913 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4914 # If there is no directory component, then add one.
4916 */* | *\\*) . $file ;;
4920 # Transform arg to wrapped name.
4921 file="$progdir/$program"
4925 # Quote arguments (to preserve shell metacharacters).
4926 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4927 args="$args \"$file\""
4930 if test -z "$run"; then
4931 if test -n "$shlibpath_var"; then
4932 # Export the shlibpath_var.
4933 eval "export $shlibpath_var"
4936 # Restore saved enviroment variables
4937 if test "${save_LC_ALL+set}" = set; then
4938 LC_ALL="$save_LC_ALL"; export LC_ALL
4940 if test "${save_LANG+set}" = set; then
4941 LANG="$save_LANG"; export LANG
4944 # Now prepare to actually exec the command.
4945 exec_cmd="\$cmd$args"
4947 # Display what would be done.
4948 if test -n "$shlibpath_var"; then
4949 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4950 $echo "export $shlibpath_var"
4957 # libtool clean and uninstall mode
4959 modename="$modename: $mode"
4965 # This variable tells wrapper scripts just to set variables rather
4966 # than running their programs.
4967 libtool_install_magic="$magic"
4972 -f) rm="$rm $arg"; rmforce=yes ;;
4973 -*) rm="$rm $arg" ;;
4974 *) files="$files $arg" ;;
4978 if test -z "$rm"; then
4979 $echo "$modename: you must specify an RM program" 1>&2
4986 for file in $files; do
4987 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4988 if test "X$dir" = "X$file"; then
4992 objdir="$dir/$objdir"
4994 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4995 test $mode = uninstall && objdir="$dir"
4997 # Remember objdir for removal later, being careful to avoid duplicates
4998 if test $mode = clean; then
5001 *) rmdirs="$rmdirs $objdir" ;;
5005 # Don't error if the file doesn't exist and rm -f was used.
5006 if (test -L "$file") >/dev/null 2>&1 \
5007 || (test -h "$file") >/dev/null 2>&1 \
5008 || test -f "$file"; then
5010 elif test -d "$file"; then
5013 elif test "$rmforce" = yes; then
5021 # Possibly a libtool archive, so verify it.
5022 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5025 # Delete the libtool libraries and symlinks.
5026 for n in $library_names; do
5027 rmfiles="$rmfiles $objdir/$n"
5029 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5030 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5032 if test $mode = uninstall; then
5033 if test -n "$library_names"; then
5034 # Do each command in the postuninstall commands.
5035 eval cmds=\"$postuninstall_cmds\"
5036 save_ifs="$IFS"; IFS='~'
5037 for cmd in $cmds; do
5041 if test $? != 0 && test "$rmforce" != yes; then
5048 if test -n "$old_library"; then
5049 # Do each command in the old_postuninstall commands.
5050 eval cmds=\"$old_postuninstall_cmds\"
5051 save_ifs="$IFS"; IFS='~'
5052 for cmd in $cmds; do
5056 if test $? != 0 && test "$rmforce" != yes; then
5062 # FIXME: should reinstall the best remaining shared library.
5068 if test "$build_old_libs" = yes; then
5069 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5070 rmfiles="$rmfiles $dir/$oldobj"
5075 # Do a test to see if this is a libtool program.
5076 if test $mode = clean &&
5077 (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5081 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5082 if test "$fast_install" = yes && test -n "$relink_command"; then
5083 rmfiles="$rmfiles $objdir/lt-$name"
5088 $show "$rm $rmfiles"
5089 $run $rm $rmfiles || exit_status=1
5092 # Try to remove the ${objdir}s in the directories where we deleted files
5093 for dir in $rmdirs; do
5094 if test -d "$dir"; then
5096 $run rmdir $dir >/dev/null 2>&1
5104 $echo "$modename: you must specify a MODE" 1>&2
5105 $echo "$generic_help" 1>&2
5110 if test -z "$exec_cmd"; then
5111 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5112 $echo "$generic_help" 1>&2
5115 fi # test -z "$show_help"
5117 if test -n "$exec_cmd"; then
5122 # We need to display help for each of the modes.
5125 "Usage: $modename [OPTION]... [MODE-ARG]...
5127 Provide generalized library-building support services.
5129 --config show all configuration variables
5130 --debug enable verbose shell tracing
5131 -n, --dry-run display commands without modifying any files
5132 --features display basic configuration information and exit
5133 --finish same as \`--mode=finish'
5134 --help display this help message and exit
5135 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5136 --quiet same as \`--silent'
5137 --silent don't print informational messages
5138 --version print version information
5140 MODE must be one of the following:
5142 clean remove files from the build directory
5143 compile compile a source file into a libtool object
5144 execute automatically set library path, then run a program
5145 finish complete the installation of libtool libraries
5146 install install libraries or executables
5147 link create a library or an executable
5148 uninstall remove libraries from an installed directory
5150 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5151 a more detailed description of MODE."
5157 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5159 Remove files from the build directory.
5161 RM is the name of the program to use to delete files associated with each FILE
5162 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5165 If FILE is a libtool library, object or program, all the files associated
5166 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5171 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5173 Compile a source file into a libtool library object.
5175 This mode accepts the following additional options:
5177 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5178 -prefer-pic try to building PIC objects only
5179 -prefer-non-pic try to building non-PIC objects only
5180 -static always build a \`.o' file suitable for static linking
5182 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5183 from the given SOURCEFILE.
5185 The output file name is determined by removing the directory component from
5186 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5187 library object suffix, \`.lo'."
5192 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5194 Automatically set library path, then run a program.
5196 This mode accepts the following additional options:
5198 -dlopen FILE add the directory containing FILE to the library path
5200 This mode sets the library path environment variable according to \`-dlopen'
5203 If any of the ARGS are libtool executable wrappers, then they are translated
5204 into their corresponding uninstalled binary, and any of their required library
5205 directories are added to the library path.
5207 Then, COMMAND is executed, with ARGS as arguments."
5212 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5214 Complete the installation of libtool libraries.
5216 Each LIBDIR is a directory that contains libtool libraries.
5218 The commands that this mode executes may require superuser privileges. Use
5219 the \`--dry-run' option if you just want to see what would be executed."
5224 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5226 Install executables or libraries.
5228 INSTALL-COMMAND is the installation command. The first component should be
5229 either the \`install' or \`cp' program.
5231 The rest of the components are interpreted as arguments to that command (only
5232 BSD-compatible install options are recognized)."
5237 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5239 Link object files or libraries together to form another library, or to
5240 create an executable program.
5242 LINK-COMMAND is a command using the C compiler that you would use to create
5243 a program from several object files.
5245 The following components of LINK-COMMAND are treated specially:
5247 -all-static do not do any dynamic linking at all
5248 -avoid-version do not add a version suffix if possible
5249 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5250 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5251 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5252 -export-symbols SYMFILE
5253 try to export only the symbols listed in SYMFILE
5254 -export-symbols-regex REGEX
5255 try to export only the symbols matching REGEX
5256 -LLIBDIR search LIBDIR for required installed libraries
5257 -lNAME OUTPUT-FILE requires the installed library libNAME
5258 -module build a library that can dlopened
5259 -no-fast-install disable the fast-install mode
5260 -no-install link a not-installable executable
5261 -no-undefined declare that a library does not refer to external symbols
5262 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5263 -release RELEASE specify package release information
5264 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5265 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5266 -static do not do any dynamic linking of libtool libraries
5267 -version-info CURRENT[:REVISION[:AGE]]
5268 specify library version info [each variable defaults to 0]
5270 All other options (arguments beginning with \`-') are ignored.
5272 Every other argument is treated as a filename. Files ending in \`.la' are
5273 treated as uninstalled libtool libraries, other files are standard or library
5276 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5277 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5278 required, except when creating a convenience library.
5280 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5281 using \`ar' and \`ranlib', or on Windows using \`lib'.
5283 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5284 is created, otherwise an executable program is created."
5289 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5291 Remove libraries from an installation directory.
5293 RM is the name of the program to use to delete files associated with each FILE
5294 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5297 If FILE is a libtool library, all the files associated with it are deleted.
5298 Otherwise, only FILE itself is deleted using RM."
5302 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5309 $echo "Try \`$modename --help' for more information about other modes."