3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by (GNU libredblack 1.2)
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 localhost.localdomain:
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 add -lc for building shared libraries.
47 build_libtool_need_lc=no
49 # Whether or not to build static libraries.
52 # Whether or not to optimize for fast installation.
56 host_alias=i686-pc-linux-gnu
57 host=i686-pc-linux-gnu
59 # An echo program that does not interpret backslashes.
66 # The default C compiler.
69 # Is the compiler the GNU C compiler?
72 # The linker used to build libraries.
75 # Whether we need hard or soft links.
78 # A BSD-compatible nm program.
81 # A symbol stripping program
84 # Used to examine libraries when file_magic_cmd begins "file"
87 # Used on cygwin: DLL creation program.
90 # Used on cygwin: object dumper.
93 # Used on cygwin: assembler.
96 # The name of the directory that contains temporary libtool files.
99 # How to create reloadable object files.
101 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
103 # How to pass a linker flag through the compiler.
106 # Object file suffix (normally "o").
109 # Old archive suffix (normally "a").
112 # Executable file suffix (normally "").
115 # Additional compiler flags for building library objects.
119 # Does compiler simultaneously support -c and -o options?
122 # Can we write directly to a .lo ?
125 # Must we lock files when doing compilation ?
128 # Do we need the lib prefix for modules?
131 # Do we need a version for libraries?
134 # Whether dlopen is supported.
135 dlopen_support=unknown
137 # Whether dlopen of programs is supported.
140 # Whether dlopen of statically linked programs is supported.
141 dlopen_self_static=unknown
143 # Compiler flag to prevent dynamic linking.
144 link_static_flag="-static"
146 # Compiler flag to turn off builtin functions.
147 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
149 # Compiler flag to allow reflexive dlopens.
150 export_dynamic_flag_spec="\${wl}--export-dynamic"
152 # Compiler flag to generate shared objects directly from archives.
153 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
155 # Compiler flag to generate thread-safe objects.
156 thread_safe_flag_spec=""
158 # Library versioning type.
161 # Format of library name prefix.
162 libname_spec="lib\$name"
164 # List of archive names. First name is the real one, the rest are links.
165 # The last name is the one that the linker finds with -lNAME.
166 library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
168 # The coded name of the library, if different from the real name.
169 soname_spec="\${libname}\${release}.so\$major"
171 # Commands used to build and install an old-style archive.
173 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
174 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
175 old_postuninstall_cmds=""
177 # Create an old-style archive from a shared archive.
178 old_archive_from_new_cmds=""
180 # Create a temporary old-style archive to link instead of a shared archive.
181 old_archive_from_expsyms_cmds=""
183 # Commands used to build and install a shared archive.
184 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
185 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
187 postuninstall_cmds=""
189 # Commands to strip libraries.
190 old_striplib="strip --strip-debug"
191 striplib="strip --strip-unneeded"
193 # Method to check whether dependent libraries are shared objects.
194 deplibs_check_method="pass_all"
196 # Command to use when deplibs_check_method == file_magic.
197 file_magic_cmd="\$MAGIC_CMD"
199 # Flag that allows shared libraries with undefined symbols to be built.
200 allow_undefined_flag=""
202 # Flag that forces no undefined symbols.
205 # Commands used to finish a libtool library installation in a directory.
206 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
208 # Same as above, but a single script fragment to be evaled but not shown.
211 # Take the output of nm and produce a listing of raw symbols and C names.
212 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
214 # Transform the output of nm in a proper C declaration
215 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
217 # This is the shared library runtime path variable.
218 runpath_var=LD_RUN_PATH
220 # This is the shared library path variable.
221 shlibpath_var=LD_LIBRARY_PATH
223 # Is shlibpath searched before the hard-coded library search path?
224 shlibpath_overrides_runpath=no
226 # How to hardcode a shared library path into an executable.
227 hardcode_action=immediate
229 # Whether we should hardcode library paths into libraries.
230 hardcode_into_libs=yes
232 # Flag to hardcode $libdir into a binary during linking.
233 # This must work even if $libdir does not exist.
234 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
236 # Whether we need a single -rpath flag with a separated argument.
237 hardcode_libdir_separator=""
239 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
243 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
247 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
248 # the resulting binary.
249 hardcode_shlibpath_var=unsupported
251 # Variables whose values should be saved in libtool wrapper scripts and
252 # restored at relink time.
253 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
255 # Whether libtool must link a program against all its dependency libraries.
256 link_all_deplibs=unknown
258 # Compile-time system search path for libraries
259 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
261 # Run-time system search path for libraries
262 sys_lib_dlsearch_path_spec="/lib /usr/lib"
264 # Fix the shell variable $srcfile for the compiler.
267 # Set to yes if exported symbols are required.
268 always_export_symbols=no
270 # The commands to list exported symbols.
271 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
273 # The commands to extract the exported symbol list from a shared archive.
274 extract_expsyms_cmds=""
276 # Symbols that should not be listed in the preloaded symbols.
277 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
279 # Symbols that must always be exported.
282 # ### END LIBTOOL CONFIG
284 # ltmain.sh - Provide generalized library-building support services.
285 # NOTE: Changing this file will not affect anything until you rerun configure.
287 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
288 # Free Software Foundation, Inc.
289 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
291 # This program is free software; you can redistribute it and/or modify
292 # it under the terms of the GNU General Public License as published by
293 # the Free Software Foundation; either version 2 of the License, or
294 # (at your option) any later version.
296 # This program is distributed in the hope that it will be useful, but
297 # WITHOUT ANY WARRANTY; without even the implied warranty of
298 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
299 # General Public License for more details.
301 # You should have received a copy of the GNU General Public License
302 # along with this program; if not, write to the Free Software
303 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
305 # As a special exception to the GNU General Public License, if you
306 # distribute this file as part of a program that contains a
307 # configuration script generated by Autoconf, you may include it under
308 # the same distribution terms that you use for the rest of that program.
310 # Check that we have a working $echo.
311 if test "X$1" = X--no-reexec; then
312 # Discard the --no-reexec flag, and continue.
314 elif test "X$1" = X--fallback-echo; then
315 # Avoid inline document here, it may be left over
317 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
318 # Yippee, $echo works!
321 # Restart under the correct shell, and then maybe $echo will work.
322 exec $SHELL "$0" --no-reexec ${1+"$@"}
325 if test "X$1" = X--fallback-echo; then
326 # used as fallback echo
334 # The name of this program.
335 progname=`$echo "$0" | sed 's%^.*/%%'`
342 TIMESTAMP=" (1.922 2001/04/25 00:05:37)"
345 help="Try \`$progname --help' for more information."
346 magic="%%%MAGIC variable%%%"
351 # Sed substitution that helps us do robust quoting. It backslashifies
352 # metacharacters that are still active within double-quoted strings.
353 Xsed='sed -e 1s/^X//'
354 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
356 NL2SP='tr \015\012 \040\040'
359 # Only set LANG and LC_ALL to C if already set.
360 # These must not be set unconditionally because not all systems understand
361 # e.g. LANG=C (notably SCO).
362 # We save the old values to restore during execute mode.
363 if test "${LC_ALL+set}" = set; then
364 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
366 if test "${LANG+set}" = set; then
367 save_LANG="$LANG"; LANG=C; export LANG
370 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
371 echo "$modename: not configured to build any kind of library" 1>&2
372 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
385 lo2o="s/\\.lo\$/.${objext}/"
386 o2lo="s/\\.${objext}\$/.lo/"
388 # Parse our command line options once, thoroughly.
395 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
399 # If the previous option needs an argument, assign it.
400 if test -n "$prev"; then
403 execute_dlfiles="$execute_dlfiles $arg"
415 # Have we seen a non-optional argument yet?
422 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
427 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
432 echo "$progname: enabling shell trace mode"
442 if test "$build_libtool_libs" = yes; then
443 echo "enable shared libraries"
445 echo "disable shared libraries"
447 if test "$build_old_libs" = yes; then
448 echo "enable static libraries"
450 echo "disable static libraries"
455 --finish) mode="finish" ;;
457 --mode) prevopt="--mode" prev=mode ;;
458 --mode=*) mode="$optarg" ;;
470 $echo "$modename: unrecognized option \`$arg'" 1>&2
482 if test -n "$prevopt"; then
483 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
488 if test -z "$show_help"; then
490 # Infer the operation mode.
491 if test -z "$mode"; then
493 *cc | *++ | gcc* | *-gcc*)
505 *db | *dbx | *strace | *truss)
515 # If we have no mode, but dlfiles were specified, then do execute mode.
516 test -n "$execute_dlfiles" && mode=execute
518 # Just use the default operation mode.
519 if test -z "$mode"; then
520 if test -n "$nonopt"; then
521 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
523 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
530 # Only execute mode is allowed to have -dlopen flags.
531 if test -n "$execute_dlfiles" && test "$mode" != execute; then
532 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
537 # Change the help message to a mode-specific one.
539 help="Try \`$modename --help --mode=$mode' for more information."
541 # These modes are in order of execution frequency so that they run quickly.
543 # libtool compile mode
545 modename="$modename: compile"
546 # Get the compilation command and the source file.
559 # Aesthetically quote the previous argument.
561 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
564 # Double-quote args containing other shell metacharacters.
565 # Many Bourne shells cannot handle close brackets correctly
566 # in scan sets, so we specify it separately.
567 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
572 # Add the previous argument to base_compile.
573 if test -z "$base_compile"; then
574 base_compile="$lastarg"
576 base_compile="$base_compile $lastarg"
582 # Accept any command-line options.
585 if test "$user_target" != "no"; then
586 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
613 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
615 IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
619 # Double-quote args containing other shell metacharacters.
620 # Many Bourne shells cannot handle close brackets correctly
621 # in scan sets, so we specify it separately.
623 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
627 lastarg="$lastarg $arg"
630 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
632 # Add the arguments to base_compile.
633 if test -z "$base_compile"; then
634 base_compile="$lastarg"
636 base_compile="$base_compile $lastarg"
644 # The next one is the -o target name
649 # We got the output file
656 # Accept the current argument as the source file.
660 # Aesthetically quote the previous argument.
662 # Backslashify any backslashes, double quotes, and dollar signs.
663 # These are the only characters that are still specially
664 # interpreted inside of double-quoted scrings.
665 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
667 # Double-quote args containing other shell metacharacters.
668 # Many Bourne shells cannot handle close brackets correctly
669 # in scan sets, so we specify it separately.
671 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
672 lastarg="\"$lastarg\""
676 # Add the previous argument to base_compile.
677 if test -z "$base_compile"; then
678 base_compile="$lastarg"
680 base_compile="$base_compile $lastarg"
688 # Get the name of the library object.
689 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
692 $echo "$modename: you must specify a target with \`-o'" 1>&2
697 # Recognize several different file suffixes.
698 # If the user specifies -o file.o, it is replaced with file.lo
713 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
716 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
718 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
723 if test -z "$base_compile"; then
724 $echo "$modename: you must specify a compilation command" 1>&2
729 # Delete any leftover library objects.
730 if test "$build_old_libs" = yes; then
731 removelist="$obj $libobj"
737 trap "$run $rm $removelist; exit 1" 1 2 15
739 # On Cygwin there's no "real" PIC flag so we must build both object types
741 cygwin* | mingw* | pw32* | os2*)
745 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
746 # non-PIC code in shared libraries is not supported
750 # Calculate the filename of the output object if compiler does
751 # not support -o with -c
752 if test "$compiler_c_o" = no; then
753 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
754 lockfile="$output_obj.lock"
755 removelist="$removelist $output_obj $lockfile"
756 trap "$run $rm $removelist; exit 1" 1 2 15
762 # Lock this critical section if it is needed
763 # We use this script file to make the link, it avoids creating a new file
764 if test "$need_locks" = yes; then
765 until $run ln "$0" "$lockfile" 2>/dev/null; do
766 $show "Waiting for $lockfile to be removed"
769 elif test "$need_locks" = warn; then
770 if test -f "$lockfile"; then
772 *** ERROR, $lockfile exists and contains:
773 `cat $lockfile 2>/dev/null`
775 This indicates that another process is trying to use the same
776 temporary object file, and libtool could not work around it because
777 your compiler does not support \`-c' and \`-o' together. If you
778 repeat this compilation, it may succeed, by chance, but you had better
779 avoid parallel builds (make -j) in this platform, or get a better
785 echo $srcfile > "$lockfile"
788 if test -n "$fix_srcfile_path"; then
789 eval srcfile=\"$fix_srcfile_path\"
792 # Only build a PIC object if we are building libtool libraries.
793 if test "$build_libtool_libs" = yes; then
794 # Without this assignment, base_compile gets emptied.
795 fbsd_hideous_sh_bug=$base_compile
797 if test "$pic_mode" != no; then
798 # All platforms use -DPIC, to notify preprocessed assembler code.
799 command="$base_compile $srcfile $pic_flag -DPIC"
801 # Don't build PIC code
802 command="$base_compile $srcfile"
804 if test "$build_old_libs" = yes; then
806 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
807 if test "X$dir" = "X$libobj"; then
812 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
814 if test -d "$dir"; then
821 if test $status -ne 0 && test ! -d $dir; then
826 if test "$compiler_o_lo" = yes; then
828 command="$command -o $output_obj"
829 elif test "$compiler_c_o" = yes; then
831 command="$command -o $output_obj"
834 $run $rm "$output_obj"
836 if $run eval "$command"; then :
838 test -n "$output_obj" && $run $rm $removelist
842 if test "$need_locks" = warn &&
843 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
845 *** ERROR, $lockfile contains:
846 `cat $lockfile 2>/dev/null`
848 but it should contain:
851 This indicates that another process is trying to use the same
852 temporary object file, and libtool could not work around it because
853 your compiler does not support \`-c' and \`-o' together. If you
854 repeat this compilation, it may succeed, by chance, but you had better
855 avoid parallel builds (make -j) in this platform, or get a better
862 # Just move the object if needed, then go on to compile the next one
863 if test x"$output_obj" != x"$libobj"; then
864 $show "$mv $output_obj $libobj"
865 if $run $mv $output_obj $libobj; then :
873 # If we have no pic_flag, then copy the object into place and finish.
874 if (test -z "$pic_flag" || test "$pic_mode" != default) &&
875 test "$build_old_libs" = yes; then
876 # Rename the .lo from within objdir to obj
877 if test -f $obj; then
882 $show "$mv $libobj $obj"
883 if $run $mv $libobj $obj; then :
890 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
891 if test "X$xdir" = "X$obj"; then
896 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
897 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
898 # Now arrange that obj and lo_libobj become the same file
899 $show "(cd $xdir && $LN_S $baseobj $libobj)"
900 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
909 # Allow error messages only from the first compilation.
910 suppress_output=' >/dev/null 2>&1'
913 # Only build a position-dependent object if we build old libraries.
914 if test "$build_old_libs" = yes; then
915 if test "$pic_mode" != yes; then
916 # Don't build PIC code
917 command="$base_compile $srcfile"
919 # All platforms use -DPIC, to notify preprocessed assembler code.
920 command="$base_compile $srcfile $pic_flag -DPIC"
922 if test "$compiler_c_o" = yes; then
923 command="$command -o $obj"
927 # Suppress compiler output if we already did a PIC compilation.
928 command="$command$suppress_output"
929 $run $rm "$output_obj"
931 if $run eval "$command"; then :
937 if test "$need_locks" = warn &&
938 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
940 *** ERROR, $lockfile contains:
941 `cat $lockfile 2>/dev/null`
943 but it should contain:
946 This indicates that another process is trying to use the same
947 temporary object file, and libtool could not work around it because
948 your compiler does not support \`-c' and \`-o' together. If you
949 repeat this compilation, it may succeed, by chance, but you had better
950 avoid parallel builds (make -j) in this platform, or get a better
957 # Just move the object if needed
958 if test x"$output_obj" != x"$obj"; then
959 $show "$mv $output_obj $obj"
960 if $run $mv $output_obj $obj; then :
968 # Create an invalid libtool object if no PIC, so that we do not
969 # accidentally link it into a program.
970 if test "$build_libtool_libs" != yes; then
971 $show "echo timestamp > $libobj"
972 $run eval "echo timestamp > \$libobj" || exit $?
974 # Move the .lo from within objdir
975 $show "$mv $libobj $lo_libobj"
976 if $run $mv $libobj $lo_libobj; then :
985 # Unlock the critical section if it was locked
986 if test "$need_locks" != no; then
995 modename="$modename: link"
997 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
998 # It is impossible to link a dll without this setting, and
999 # we shouldn't force the makefile maintainer to figure out
1000 # which system we are compiling for in order to pass an extra
1001 # flag for every libtool invokation.
1002 # allow_undefined=no
1004 # FIXME: Unfortunately, there are problems with the above when trying
1005 # to make a dll which has undefined symbols, in which case not
1006 # even a static library is built. For now, we need to specify
1007 # -no-undefined on the libtool link line when we can be certain
1008 # that all symbols are satisfied, otherwise we get a static library.
1015 libtool_args="$nonopt"
1016 compile_command="$nonopt"
1017 finalize_command="$nonopt"
1030 lib_search_path=`pwd`
1039 export_symbols_regex=
1046 prefer_static_libs=no
1058 # We need to know -static, to get the right output filenames.
1062 -all-static | -static)
1063 if test "X$arg" = "X-all-static"; then
1064 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1065 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1067 if test -n "$link_static_flag"; then
1068 dlopen_self=$dlopen_self_static
1071 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1072 dlopen_self=$dlopen_self_static
1075 build_libtool_libs=no
1077 prefer_static_libs=yes
1083 # See if our shared archives depend on static archives.
1084 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1086 # Go through the arguments, transforming them on the way.
1087 while test $# -gt 0; do
1091 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1092 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1096 libtool_args="$libtool_args $qarg"
1098 # If the previous option needs an argument, assign it.
1099 if test -n "$prev"; then
1102 compile_command="$compile_command @OUTPUT@"
1103 finalize_command="$finalize_command @OUTPUT@"
1109 if test "$preload" = no; then
1110 # Add the symbol object into the linking commands.
1111 compile_command="$compile_command @SYMFILE@"
1112 finalize_command="$finalize_command @SYMFILE@"
1116 *.la | *.lo) ;; # We handle these cases below.
1118 if test "$dlself" = no; then
1126 if test "$prev" = dlprefiles; then
1128 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1138 if test "$prev" = dlfiles; then
1139 dlfiles="$dlfiles $arg"
1141 dlprefiles="$dlprefiles $arg"
1149 export_symbols="$arg"
1150 if test ! -f "$arg"; then
1151 $echo "$modename: symbol file \`$arg' does not exist"
1158 export_symbols_regex="$arg"
1163 inst_prefix_dir="$arg"
1173 # We need an absolute path.
1175 [\\/]* | [A-Za-z]:[\\/]*) ;;
1177 $echo "$modename: only absolute run-paths are allowed" 1>&2
1181 if test "$prev" = rpath; then
1184 *) rpath="$rpath $arg" ;;
1189 *) xrpath="$xrpath $arg" ;;
1196 compiler_flags="$compiler_flags $qarg"
1198 compile_command="$compile_command $qarg"
1199 finalize_command="$finalize_command $qarg"
1203 linker_flags="$linker_flags $qarg"
1204 compiler_flags="$compiler_flags $wl$qarg"
1206 compile_command="$compile_command $wl$qarg"
1207 finalize_command="$finalize_command $wl$qarg"
1211 eval "$prev=\"\$arg\""
1222 if test -n "$link_static_flag"; then
1223 compile_command="$compile_command $link_static_flag"
1224 finalize_command="$finalize_command $link_static_flag"
1230 # FIXME: remove this flag sometime in the future.
1231 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1255 -export-symbols | -export-symbols-regex)
1256 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1257 $echo "$modename: more than one -exported-symbols argument is not allowed"
1260 if test "X$arg" = "X-export-symbols"; then
1273 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1274 # so, if we see these flags be careful not to treat them like -L
1276 case $with_gcc/$host in
1278 compile_command="$compile_command $arg"
1279 finalize_command="$finalize_command $arg"
1286 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1287 # We need an absolute path.
1289 [\\/]* | [A-Za-z]:[\\/]*) ;;
1291 absdir=`cd "$dir" && pwd`
1292 if test -z "$absdir"; then
1293 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1302 deplibs="$deplibs -L$dir"
1303 lib_search_path="$lib_search_path $dir"
1307 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1308 case :$dllsearchpath: in
1310 *) dllsearchpath="$dllsearchpath:$dir";;
1318 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1320 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1321 # These systems don't actually have a C or math library (as such)
1324 *-*-mingw* | *-*-os2*)
1325 # These systems don't actually have a C library (as such)
1326 test "X$arg" = "X-lc" && continue
1330 deplibs="$deplibs $arg"
1346 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1347 # The PATH hackery in wrapper scripts is required on Windows
1348 # in order for the loader to find any dlls it needs.
1349 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1350 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1353 *) no_install=yes ;;
1381 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1382 # We need an absolute path.
1384 [\\/]* | [A-Za-z]:[\\/]*) ;;
1386 $echo "$modename: only absolute run-paths are allowed" 1>&2
1392 *) xrpath="$xrpath $dir" ;;
1398 # The effects of -static are defined in a previous loop.
1399 # We used to do the same as -all-static on platforms that
1400 # didn't have a PIC flag, but the assumption that the effects
1401 # would be equivalent was wrong. It would break on at least
1402 # Digital Unix and AIX.
1417 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1419 IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1420 for flag in $args; do
1423 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1428 compiler_flags="$compiler_flags $flag"
1431 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1435 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1437 IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1438 for flag in $args; do
1441 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1446 compiler_flags="$compiler_flags $wl$flag"
1447 linker_flags="$linker_flags $flag"
1450 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1463 # Some other compiler flag.
1465 # Unknown arguments in both finalize_command and compile_command need
1466 # to be aesthetically quoted because they are evaled later.
1467 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1469 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1476 # A library or standard object.
1477 if test "$prev" = dlfiles; then
1478 # This file was specified with -dlopen.
1479 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1480 dlfiles="$dlfiles $arg"
1484 # If libtool objects are unsupported, then we need to preload.
1489 if test "$prev" = dlprefiles; then
1490 # Preload the old-style object.
1491 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1495 *.lo) libobjs="$libobjs $arg" ;;
1496 *) objs="$objs $arg" ;;
1503 deplibs="$deplibs $arg"
1504 old_deplibs="$old_deplibs $arg"
1509 # A libtool-controlled library.
1511 if test "$prev" = dlfiles; then
1512 # This library was specified with -dlopen.
1513 dlfiles="$dlfiles $arg"
1515 elif test "$prev" = dlprefiles; then
1516 # The library was specified with -dlpreopen.
1517 dlprefiles="$dlprefiles $arg"
1520 deplibs="$deplibs $arg"
1525 # Some other compiler argument.
1527 # Unknown arguments in both finalize_command and compile_command need
1528 # to be aesthetically quoted because they are evaled later.
1529 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1531 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1538 # Now actually substitute the argument into the commands.
1539 if test -n "$arg"; then
1540 compile_command="$compile_command $arg"
1541 finalize_command="$finalize_command $arg"
1543 done # argument parsing loop
1545 if test -n "$prev"; then
1546 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1551 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1552 eval arg=\"$export_dynamic_flag_spec\"
1553 compile_command="$compile_command $arg"
1554 finalize_command="$finalize_command $arg"
1557 # calculate the name of the file, without its directory
1558 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1559 libobjs_save="$libobjs"
1561 if test -n "$shlibpath_var"; then
1562 # get the directories listed in $shlibpath_var
1563 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1567 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1568 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1570 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1571 if test "X$output_objdir" = "X$output"; then
1572 output_objdir="$objdir"
1574 output_objdir="$output_objdir/$objdir"
1576 # Create the object directory.
1577 if test ! -d $output_objdir; then
1578 $show "$mkdir $output_objdir"
1579 $run $mkdir $output_objdir
1581 if test $status -ne 0 && test ! -d $output_objdir; then
1586 # Determine the type of output
1589 $echo "$modename: you must specify an output file" 1>&2
1593 *.$libext) linkmode=oldlib ;;
1594 *.lo | *.$objext) linkmode=obj ;;
1595 *.la) linkmode=lib ;;
1596 *) linkmode=prog ;; # Anything else should be a program.
1601 # Find all interdependent deplibs by searching for libraries
1602 # that are linked more than once (e.g. -la -lb -la)
1603 for deplib in $deplibs; do
1605 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1607 libs="$libs $deplib"
1612 need_relink=no # whether we're linking any uninstalled libtool libraries
1613 notinst_deplibs= # not-installed libtool libraries
1614 notinst_path= # paths that contain not-installed libtool libraries
1618 for file in $dlfiles $dlprefiles; do
1622 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1634 passes="conv scan dlopen dlpreopen link"
1639 for pass in $passes; do
1640 if test $linkmode = prog; then
1641 # Determine which files to process
1645 save_deplibs="$deplibs" # Collect dlpreopened libraries
1648 dlpreopen) libs="$dlprefiles" ;;
1649 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1652 for deplib in $libs; do
1657 if test $linkmode = oldlib && test $linkmode = obj; then
1658 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1661 if test $pass = conv; then
1662 deplibs="$deplib $deplibs"
1665 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1666 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1667 # Search the libtool library
1668 lib="$searchdir/lib${name}.la"
1669 if test -f "$lib"; then
1674 if test "$found" != yes; then
1675 # deplib doesn't seem to be a libtool library
1676 if test "$linkmode,$pass" = "prog,link"; then
1677 compile_deplibs="$deplib $compile_deplibs"
1678 finalize_deplibs="$deplib $finalize_deplibs"
1680 deplibs="$deplib $deplibs"
1681 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1689 deplibs="$deplib $deplibs"
1690 test $pass = conv && continue
1691 newdependency_libs="$deplib $newdependency_libs"
1692 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1695 if test $pass = conv; then
1696 deplibs="$deplib $deplibs"
1699 if test $pass = scan; then
1700 deplibs="$deplib $deplibs"
1701 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1703 compile_deplibs="$deplib $compile_deplibs"
1704 finalize_deplibs="$deplib $finalize_deplibs"
1708 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1714 if test $pass = link; then
1715 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1716 # Make sure the xrpath contains only unique directories.
1719 *) xrpath="$xrpath $dir" ;;
1722 deplibs="$deplib $deplibs"
1725 *.la) lib="$deplib" ;;
1727 if test $pass = conv; then
1728 deplibs="$deplib $deplibs"
1733 if test "$deplibs_check_method" != pass_all; then
1735 echo "*** Warning: This library needs some functionality provided by $deplib."
1736 echo "*** I have the capability to make that library automatically link in when"
1737 echo "*** you link to this library. But I can only do this if you have a"
1738 echo "*** shared version of the library, which you do not appear to have."
1741 echo "*** Warning: Linking the shared library $output against the"
1742 echo "*** static library $deplib is not portable!"
1743 deplibs="$deplib $deplibs"
1748 if test $pass != link; then
1749 deplibs="$deplib $deplibs"
1751 compile_deplibs="$deplib $compile_deplibs"
1752 finalize_deplibs="$deplib $finalize_deplibs"
1759 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1760 # If there is no dlopen support or we're linking statically,
1761 # we need to preload.
1762 newdlprefiles="$newdlprefiles $deplib"
1763 compile_deplibs="$deplib $compile_deplibs"
1764 finalize_deplibs="$deplib $finalize_deplibs"
1766 newdlfiles="$newdlfiles $deplib"
1775 if test $found = yes || test -f "$lib"; then :
1777 $echo "$modename: cannot find the library \`$lib'" 1>&2
1781 # Check to see that this really is a libtool archive.
1782 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1784 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1788 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1789 test "X$ladir" = "X$lib" && ladir="."
1797 # If the library was installed with an old release of libtool,
1798 # it will not redefine variable installed.
1803 */* | *\\*) . $lib ;;
1807 if test "$linkmode,$pass" = "lib,link" ||
1808 test "$linkmode,$pass" = "prog,scan" ||
1809 { test $linkmode = oldlib && test $linkmode = obj; }; then
1810 # Add dl[pre]opened files of deplib
1811 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1812 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1815 if test $pass = conv; then
1816 # Only check for convenience libraries
1817 deplibs="$lib $deplibs"
1818 if test -z "$libdir"; then
1819 if test -z "$old_library"; then
1820 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1823 # It is a libtool convenience library, so add in its objects.
1824 convenience="$convenience $ladir/$objdir/$old_library"
1825 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1827 for deplib in $dependency_libs; do
1828 deplibs="$deplib $deplibs"
1829 case "$tmp_libs " in
1830 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1832 tmp_libs="$tmp_libs $deplib"
1834 elif test $linkmode != prog && test $linkmode != lib; then
1835 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1841 # Get the name of the library we link against.
1843 for l in $old_library $library_names; do
1846 if test -z "$linklib"; then
1847 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1851 # This library was specified with -dlopen.
1852 if test $pass = dlopen; then
1853 if test -z "$libdir"; then
1854 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1857 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1858 # If there is no dlname, no dlopen support or we're linking
1859 # statically, we need to preload.
1860 dlprefiles="$dlprefiles $lib"
1862 newdlfiles="$newdlfiles $lib"
1867 # We need an absolute path.
1869 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1871 abs_ladir=`cd "$ladir" && pwd`
1872 if test -z "$abs_ladir"; then
1873 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1874 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1879 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1881 # Find the relevant object directory and library name.
1882 if test "X$installed" = Xyes; then
1883 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1884 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1893 dir="$ladir/$objdir"
1894 absdir="$abs_ladir/$objdir"
1895 # Remove this search path later
1896 notinst_path="$notinst_path $abs_ladir"
1897 fi # $installed = yes
1898 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1900 # This library was specified with -dlpreopen.
1901 if test $pass = dlpreopen; then
1902 if test -z "$libdir"; then
1903 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1906 # Prefer using a static library (so that no silly _DYNAMIC symbols
1907 # are required to link).
1908 if test -n "$old_library"; then
1909 newdlprefiles="$newdlprefiles $dir/$old_library"
1910 # Otherwise, use the dlname, so that lt_dlopen finds it.
1911 elif test -n "$dlname"; then
1912 newdlprefiles="$newdlprefiles $dir/$dlname"
1914 newdlprefiles="$newdlprefiles $dir/$linklib"
1916 fi # $pass = dlpreopen
1918 if test -z "$libdir"; then
1919 # Link the convenience library
1920 if test $linkmode = lib; then
1921 deplibs="$dir/$old_library $deplibs"
1922 elif test "$linkmode,$pass" = "prog,link"; then
1923 compile_deplibs="$dir/$old_library $compile_deplibs"
1924 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1926 deplibs="$lib $deplibs"
1931 if test $linkmode = prog && test $pass != link; then
1932 newlib_search_path="$newlib_search_path $ladir"
1933 deplibs="$lib $deplibs"
1936 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1937 test "$build_libtool_libs" = no; then
1942 for deplib in $dependency_libs; do
1944 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1946 # Need to link against all dependency_libs?
1947 if test $linkalldeplibs = yes; then
1948 deplibs="$deplib $deplibs"
1950 # Need to hardcode shared library paths
1951 # or/and link against static libraries
1952 newdependency_libs="$deplib $newdependency_libs"
1954 case "$tmp_libs " in
1955 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1957 tmp_libs="$tmp_libs $deplib"
1960 fi # $linkmode = prog...
1962 link_static=no # Whether the deplib will be linked statically
1963 if test -n "$library_names" &&
1964 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1965 # Link against this shared library
1967 if test "$linkmode,$pass" = "prog,link" ||
1968 { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1969 # Hardcode the library path.
1970 # Skip directories that are in the system default run-time
1972 case " $sys_lib_dlsearch_path " in
1975 case "$compile_rpath " in
1977 *) compile_rpath="$compile_rpath $absdir"
1981 case " $sys_lib_dlsearch_path " in
1984 case "$finalize_rpath " in
1986 *) finalize_rpath="$finalize_rpath $libdir"
1990 if test $linkmode = prog; then
1991 # We need to hardcode the library path
1992 if test -n "$shlibpath_var"; then
1993 # Make sure the rpath contains only unique directories.
1994 case "$temp_rpath " in
1997 *) temp_rpath="$temp_rpath $dir" ;;
2001 fi # $linkmode,$pass = prog,link...
2003 if test "$alldeplibs" = yes &&
2004 { test "$deplibs_check_method" = pass_all ||
2005 { test "$build_libtool_libs" = yes &&
2006 test -n "$library_names"; }; }; then
2007 # We only need to search for static libraries
2011 if test "$installed" = no; then
2012 notinst_deplibs="$notinst_deplibs $lib"
2016 if test -n "$old_archive_from_expsyms_cmds"; then
2017 # figure out the soname
2018 set dummy $library_names
2021 libname=`eval \\$echo \"$libname_spec\"`
2022 # use dlname if we got it. it's perfectly good, no?
2023 if test -n "$dlname"; then
2025 elif test -n "$soname_spec"; then
2029 major=`expr $current - $age`
2033 eval soname=\"$soname_spec\"
2038 # Make a new name for the extract_expsyms_cmds to use
2040 soname=`echo $soroot | sed -e 's/^.*\///'`
2041 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2043 # If the library has no export list, then create one now
2044 if test -f "$output_objdir/$soname-def"; then :
2046 $show "extracting exported symbol list from \`$soname'"
2047 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2048 eval cmds=\"$extract_expsyms_cmds\"
2049 for cmd in $cmds; do
2052 $run eval "$cmd" || exit $?
2058 if test -f "$output_objdir/$newlib"; then :; else
2059 $show "generating import library for \`$soname'"
2060 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2061 eval cmds=\"$old_archive_from_expsyms_cmds\"
2062 for cmd in $cmds; do
2065 $run eval "$cmd" || exit $?
2069 # make sure the library variables are pointing to the new library
2072 fi # test -n $old_archive_from_expsyms_cmds
2074 if test $linkmode = prog || test "$mode" != relink; then
2079 case $hardcode_action in
2080 immediate | unsupported)
2081 if test "$hardcode_direct" = no; then
2083 elif test "$hardcode_minus_L" = no; then
2085 *-*-sunos*) add_shlibpath="$dir" ;;
2089 elif test "$hardcode_shlibpath_var" = no; then
2090 add_shlibpath="$dir"
2097 if test "$hardcode_direct" = yes; then
2099 elif test "$hardcode_minus_L" = yes; then
2102 elif test "$hardcode_shlibpath_var" = yes; then
2103 add_shlibpath="$dir"
2112 if test "$lib_linked" != yes; then
2113 $echo "$modename: configuration error: unsupported hardcode properties"
2117 if test -n "$add_shlibpath"; then
2118 case :$compile_shlibpath: in
2119 *":$add_shlibpath:"*) ;;
2120 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2123 if test $linkmode = prog; then
2124 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2125 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2127 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2128 test -n "$add" && deplibs="$add $deplibs"
2129 if test "$hardcode_direct" != yes && \
2130 test "$hardcode_minus_L" != yes && \
2131 test "$hardcode_shlibpath_var" = yes; then
2132 case :$finalize_shlibpath: in
2134 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2140 if test $linkmode = prog || test "$mode" = relink; then
2144 # Finalize command for both is simple: just hardcode it.
2145 if test "$hardcode_direct" = yes; then
2146 add="$libdir/$linklib"
2147 elif test "$hardcode_minus_L" = yes; then
2148 # Try looking first in the location we're being installed to.
2150 if test -n "$inst_prefix_dir"; then
2153 add_dir="-L$inst_prefix_dir$libdir"
2157 add_dir="$add_dir -L$libdir"
2159 elif test "$hardcode_shlibpath_var" = yes; then
2160 case :$finalize_shlibpath: in
2162 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2166 # We cannot seem to hardcode it, guess we'll fake it.
2167 # Try looking first in the location we're being installed to.
2169 if test -n "$inst_prefix_dir"; then
2172 add_dir="-L$inst_prefix_dir$libdir"
2176 add_dir="$add_dir -L$libdir"
2181 if test "$linkmode" = prog; then
2182 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2183 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2185 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2186 test -n "$add" && deplibs="$add $deplibs"
2189 elif test $linkmode = prog; then
2190 if test "$alldeplibs" = yes &&
2191 { test "$deplibs_check_method" = pass_all ||
2192 { test "$build_libtool_libs" = yes &&
2193 test -n "$library_names"; }; }; then
2194 # We only need to search for static libraries
2198 # Try to link the static library
2199 # Here we assume that one of hardcode_direct or hardcode_minus_L
2200 # is not unsupported. This is valid on all known static and
2202 if test "$hardcode_direct" != unsupported; then
2203 test -n "$old_library" && linklib="$old_library"
2204 compile_deplibs="$dir/$linklib $compile_deplibs"
2205 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2207 compile_deplibs="-l$name -L$dir $compile_deplibs"
2208 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2210 elif test "$build_libtool_libs" = yes; then
2211 # Not a shared library
2212 if test "$deplibs_check_method" != pass_all; then
2213 # We're trying link a shared library against a static one
2214 # but the system doesn't support it.
2216 # Just print a warning and add the library to dependency_libs so
2217 # that the program can be linked against the static library.
2219 echo "*** Warning: This library needs some functionality provided by $lib."
2220 echo "*** I have the capability to make that library automatically link in when"
2221 echo "*** you link to this library. But I can only do this if you have a"
2222 echo "*** shared version of the library, which you do not appear to have."
2223 if test "$module" = yes; then
2224 echo "*** Therefore, libtool will create a static module, that should work "
2225 echo "*** as long as the dlopening application is linked with the -dlopen flag."
2226 if test -z "$global_symbol_pipe"; then
2228 echo "*** However, this would only work if libtool was able to extract symbol"
2229 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2230 echo "*** not find such a program. So, this module is probably useless."
2231 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2233 if test "$build_old_libs" = no; then
2234 build_libtool_libs=module
2237 build_libtool_libs=no
2241 convenience="$convenience $dir/$old_library"
2242 old_convenience="$old_convenience $dir/$old_library"
2243 deplibs="$dir/$old_library $deplibs"
2246 fi # link shared/static library?
2248 if test $linkmode = lib; then
2249 if test -n "$dependency_libs" &&
2250 { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2251 test $link_static = yes; }; then
2252 # Extract -R from dependency_libs
2254 for libdir in $dependency_libs; do
2256 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2258 *" $temp_xrpath "*) ;;
2259 *) xrpath="$xrpath $temp_xrpath";;
2261 *) temp_deplibs="$temp_deplibs $libdir";;
2264 dependency_libs="$temp_deplibs"
2267 newlib_search_path="$newlib_search_path $absdir"
2268 # Link against this library
2269 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2270 # ... and its dependency_libs
2272 for deplib in $dependency_libs; do
2273 newdependency_libs="$deplib $newdependency_libs"
2274 case "$tmp_libs " in
2275 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2277 tmp_libs="$tmp_libs $deplib"
2280 if test $link_all_deplibs != no; then
2281 # Add the search paths of all dependency libraries
2282 for deplib in $dependency_libs; do
2284 -L*) path="$deplib" ;;
2286 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2287 test "X$dir" = "X$deplib" && dir="."
2288 # We need an absolute path.
2290 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2292 absdir=`cd "$dir" && pwd`
2293 if test -z "$absdir"; then
2294 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2299 if grep "^installed=no" $deplib > /dev/null; then
2300 path="-L$absdir/$objdir"
2302 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2303 if test -z "$libdir"; then
2304 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2307 if test "$absdir" != "$libdir"; then
2308 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2315 case " $deplibs " in
2317 *) deplibs="$deplibs $path" ;;
2320 fi # link_all_deplibs != no
2322 done # for deplib in $libs
2323 if test $pass = dlpreopen; then
2324 # Link the dlpreopened libraries before other libraries
2325 for deplib in $save_deplibs; do
2326 deplibs="$deplib $deplibs"
2329 if test $pass != dlopen; then
2330 test $pass != scan && dependency_libs="$newdependency_libs"
2331 if test $pass != conv; then
2332 # Make sure lib_search_path contains only unique directories.
2334 for dir in $newlib_search_path; do
2335 case "$lib_search_path " in
2337 *) lib_search_path="$lib_search_path $dir" ;;
2343 if test "$linkmode,$pass" != "prog,link"; then
2346 vars="compile_deplibs finalize_deplibs"
2348 for var in $vars dependency_libs; do
2349 # Add libraries to $var in reverse order
2350 eval tmp_libs=\"\$$var\"
2352 for deplib in $tmp_libs; do
2354 -L*) new_libs="$deplib $new_libs" ;;
2356 case " $specialdeplibs " in
2357 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2359 case " $new_libs " in
2361 *) new_libs="$deplib $new_libs" ;;
2369 for deplib in $new_libs; do
2372 case " $tmp_libs " in
2374 *) tmp_libs="$tmp_libs $deplib" ;;
2377 *) tmp_libs="$tmp_libs $deplib" ;;
2380 eval $var=\"$tmp_libs\"
2383 if test "$pass" = "conv" &&
2384 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2385 libs="$deplibs" # reset libs
2389 if test $linkmode = prog; then
2390 dlfiles="$newdlfiles"
2391 dlprefiles="$newdlprefiles"
2396 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2397 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2400 if test -n "$rpath"; then
2401 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2404 if test -n "$xrpath"; then
2405 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2408 if test -n "$vinfo"; then
2409 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2412 if test -n "$release"; then
2413 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2416 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2417 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2420 # Now set the variables for building old libraries.
2421 build_libtool_libs=no
2423 objs="$objs$old_deplibs"
2427 # Make sure we only generate libraries of the form `libNAME.la'.
2430 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2431 eval libname=\"$libname_spec\"
2434 if test "$module" = no; then
2435 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2439 if test "$need_lib_prefix" != no; then
2440 # Add the "lib" prefix for modules if required
2441 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2442 eval libname=\"$libname_spec\"
2444 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2449 if test -n "$objs"; then
2450 if test "$deplibs_check_method" != pass_all; then
2451 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2455 echo "*** Warning: Linking the shared library $output against the non-libtool"
2456 echo "*** objects $objs is not portable!"
2457 libobjs="$libobjs $objs"
2461 if test "$dlself" != no; then
2462 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2466 if test $# -gt 2; then
2467 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2472 if test -z "$rpath"; then
2473 if test "$build_libtool_libs" = yes; then
2474 # Building a libtool convenience library.
2476 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2477 build_libtool_libs=convenience
2481 if test -n "$vinfo"; then
2482 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2485 if test -n "$release"; then
2486 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2490 # Parse the version information argument.
2491 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
2492 set dummy $vinfo 0 0 0
2495 if test -n "$8"; then
2496 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2505 # Check that each of the things are valid numbers.
2509 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2510 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2518 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2519 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2527 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2528 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2533 if test $age -gt $current; then
2534 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2535 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2539 # Calculate the version variables.
2543 case $version_type in
2547 # Like Linux, but with the current version available in
2548 # verstring for coding it into the library header
2549 major=.`expr $current - $age`
2550 versuffix="$major.$age.$revision"
2551 # Darwin ld doesn't like 0 for these options...
2552 minor_current=`expr $current + 1`
2553 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2558 versuffix=".$current.$revision";
2563 versuffix=".$current";
2567 major=`expr $current - $age + 1`
2568 verstring="sgi$major.$revision"
2570 # Add in all the interfaces that we are compatible with.
2572 while test $loop != 0; do
2573 iface=`expr $revision - $loop`
2574 loop=`expr $loop - 1`
2575 verstring="sgi$major.$iface:$verstring"
2578 # Before this point, $major must not contain `.'.
2580 versuffix="$major.$revision"
2584 major=.`expr $current - $age`
2585 versuffix="$major.$age.$revision"
2589 major=`expr $current - $age`
2590 versuffix=".$current.$age.$revision"
2591 verstring="$current.$age.$revision"
2593 # Add in all the interfaces that we are compatible with.
2595 while test $loop != 0; do
2596 iface=`expr $current - $loop`
2597 loop=`expr $loop - 1`
2598 verstring="$verstring:${iface}.0"
2601 # Make executables depend on our current version.
2602 verstring="$verstring:${current}.0"
2607 versuffix=".$current.$revision"
2611 # Use '-' rather than '.', since we only want one
2612 # extension on DOS 8.3 filesystems.
2613 major=`expr $current - $age`
2618 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2619 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2624 # Clear the version info if we defaulted, and they specified a release.
2625 if test -z "$vinfo" && test -n "$release"; then
2628 if test "$need_version" = no; then
2635 # Remove version info from name if versioning should be avoided
2636 if test "$avoid_version" = yes && test "$need_version" = no; then
2642 # Check to see if the archive will have undefined symbols.
2643 if test "$allow_undefined" = yes; then
2644 if test "$allow_undefined_flag" = unsupported; then
2645 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2646 build_libtool_libs=no
2650 # Don't allow undefined symbols.
2651 allow_undefined_flag="$no_undefined_flag"
2655 if test "$mode" != relink; then
2656 # Remove our outputs.
2657 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2658 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2661 # Now set the variables for building old libraries.
2662 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2663 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2665 # Transform .lo files to .o files.
2666 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2669 # Eliminate all temporary directories.
2670 for path in $notinst_path; do
2671 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2672 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2673 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2676 if test -n "$xrpath"; then
2677 # If the user specified any rpath flags, then add them.
2679 for libdir in $xrpath; do
2680 temp_xrpath="$temp_xrpath -R$libdir"
2681 case "$finalize_rpath " in
2683 *) finalize_rpath="$finalize_rpath $libdir" ;;
2686 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2687 dependency_libs="$temp_xrpath $dependency_libs"
2691 # Make sure dlfiles contains only unique files that won't be dlpreopened
2692 old_dlfiles="$dlfiles"
2694 for lib in $old_dlfiles; do
2695 case " $dlprefiles $dlfiles " in
2697 *) dlfiles="$dlfiles $lib" ;;
2701 # Make sure dlprefiles contains only unique files
2702 old_dlprefiles="$dlprefiles"
2704 for lib in $old_dlprefiles; do
2705 case "$dlprefiles " in
2707 *) dlprefiles="$dlprefiles $lib" ;;
2711 if test "$build_libtool_libs" = yes; then
2712 if test -n "$rpath"; then
2714 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2715 # these systems don't actually have a c library (as such)!
2717 *-*-rhapsody* | *-*-darwin1.[012])
2718 # Rhapsody C library is in the System framework
2719 deplibs="$deplibs -framework System"
2722 # Don't link with libc until the a.out ld.so is fixed.
2725 # Add libc to deplibs on all other systems if necessary.
2726 if test $build_libtool_need_lc = "yes"; then
2727 deplibs="$deplibs -lc"
2733 # Transform deplibs into only deplibs that can be linked in shared.
2735 libname_save=$libname
2736 release_save=$release
2737 versuffix_save=$versuffix
2739 # I'm not sure if I'm treating the release correctly. I think
2740 # release should show up in the -l (ie -lgmp5) so we don't want to
2741 # add it in twice. Is that correct?
2747 case $deplibs_check_method in
2749 # Don't check for shared/static. Everything works.
2750 # This might be a little naive. We might want to check
2751 # whether the library exists or not. But this is on
2752 # osf3 & osf4 and I'm not really sure... Just
2753 # implementing what was already the behaviour.
2757 # This code stresses the "libraries are programs" paradigm to its
2758 # limits. Maybe even breaks it. We compile a program, linking it
2759 # against the deplibs as a proxy for the library. Then we can check
2760 # whether they linked in statically or dynamically with ldd.
2762 cat > conftest.c <<EOF
2763 int main() { return 0; }
2766 $CC -o conftest conftest.c $deplibs
2767 if test $? -eq 0 ; then
2768 ldd_output=`ldd conftest`
2769 for i in $deplibs; do
2770 name="`expr $i : '-l\(.*\)'`"
2771 # If $name is empty we are operating on a -L argument.
2772 if test -n "$name" && test "$name" != "0"; then
2773 libname=`eval \\$echo \"$libname_spec\"`
2774 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2775 set dummy $deplib_matches
2777 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2778 newdeplibs="$newdeplibs $i"
2782 echo "*** Warning: This library needs some functionality provided by $i."
2783 echo "*** I have the capability to make that library automatically link in when"
2784 echo "*** you link to this library. But I can only do this if you have a"
2785 echo "*** shared version of the library, which you do not appear to have."
2788 newdeplibs="$newdeplibs $i"
2792 # Error occured in the first compile. Let's try to salvage the situation:
2793 # Compile a seperate program for each library.
2794 for i in $deplibs; do
2795 name="`expr $i : '-l\(.*\)'`"
2796 # If $name is empty we are operating on a -L argument.
2797 if test -n "$name" && test "$name" != "0"; then
2799 $CC -o conftest conftest.c $i
2801 if test $? -eq 0 ; then
2802 ldd_output=`ldd conftest`
2803 libname=`eval \\$echo \"$libname_spec\"`
2804 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2805 set dummy $deplib_matches
2807 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2808 newdeplibs="$newdeplibs $i"
2812 echo "*** Warning: This library needs some functionality provided by $i."
2813 echo "*** I have the capability to make that library automatically link in when"
2814 echo "*** you link to this library. But I can only do this if you have a"
2815 echo "*** shared version of the library, which you do not appear to have."
2820 echo "*** Warning! Library $i is needed by this library but I was not able to"
2821 echo "*** make it link in! You will probably need to install it or some"
2822 echo "*** library that it depends on before this library will be fully"
2823 echo "*** functional. Installing it before continuing would be even better."
2826 newdeplibs="$newdeplibs $i"
2832 set dummy $deplibs_check_method
2833 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2834 for a_deplib in $deplibs; do
2835 name="`expr $a_deplib : '-l\(.*\)'`"
2836 # If $name is empty we are operating on a -L argument.
2837 if test -n "$name" && test "$name" != "0"; then
2838 libname=`eval \\$echo \"$libname_spec\"`
2839 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2840 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2841 for potent_lib in $potential_libs; do
2842 # Follow soft links.
2843 if ls -lLd "$potent_lib" 2>/dev/null \
2844 | grep " -> " >/dev/null; then
2847 # The statement above tries to avoid entering an
2848 # endless loop below, in case of cyclic links.
2849 # We might still enter an endless loop, since a link
2850 # loop can be closed while we follow links,
2852 potlib="$potent_lib"
2853 while test -h "$potlib" 2>/dev/null; do
2854 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2856 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2857 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2860 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2862 | egrep "$file_magic_regex" > /dev/null; then
2863 newdeplibs="$newdeplibs $a_deplib"
2869 if test -n "$a_deplib" ; then
2872 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2873 echo "*** I have the capability to make that library automatically link in when"
2874 echo "*** you link to this library. But I can only do this if you have a"
2875 echo "*** shared version of the library, which you do not appear to have."
2878 # Add a -L argument.
2879 newdeplibs="$newdeplibs $a_deplib"
2881 done # Gone through all deplibs.
2884 set dummy $deplibs_check_method
2885 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2886 for a_deplib in $deplibs; do
2887 name="`expr $a_deplib : '-l\(.*\)'`"
2888 # If $name is empty we are operating on a -L argument.
2889 if test -n "$name" && test "$name" != "0"; then
2890 libname=`eval \\$echo \"$libname_spec\"`
2891 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2892 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2893 for potent_lib in $potential_libs; do
2894 if eval echo \"$potent_lib\" 2>/dev/null \
2896 | egrep "$match_pattern_regex" > /dev/null; then
2897 newdeplibs="$newdeplibs $a_deplib"
2903 if test -n "$a_deplib" ; then
2906 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2907 echo "*** I have the capability to make that library automatically link in when"
2908 echo "*** you link to this library. But I can only do this if you have a"
2909 echo "*** shared version of the library, which you do not appear to have."
2912 # Add a -L argument.
2913 newdeplibs="$newdeplibs $a_deplib"
2915 done # Gone through all deplibs.
2919 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2920 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2921 grep . >/dev/null; then
2923 if test "X$deplibs_check_method" = "Xnone"; then
2924 echo "*** Warning: inter-library dependencies are not supported in this platform."
2926 echo "*** Warning: inter-library dependencies are not known to be supported."
2928 echo "*** All declared inter-library dependencies are being dropped."
2933 versuffix=$versuffix_save
2935 release=$release_save
2936 libname=$libname_save
2940 *-*-rhapsody* | *-*-darwin1.[012])
2941 # On Rhapsody replace the C library is the System framework
2942 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2946 if test "$droppeddeps" = yes; then
2947 if test "$module" = yes; then
2949 echo "*** Warning: libtool could not satisfy all declared inter-library"
2950 echo "*** dependencies of module $libname. Therefore, libtool will create"
2951 echo "*** a static module, that should work as long as the dlopening"
2952 echo "*** application is linked with the -dlopen flag."
2953 if test -z "$global_symbol_pipe"; then
2955 echo "*** However, this would only work if libtool was able to extract symbol"
2956 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2957 echo "*** not find such a program. So, this module is probably useless."
2958 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2960 if test "$build_old_libs" = no; then
2961 oldlibs="$output_objdir/$libname.$libext"
2962 build_libtool_libs=module
2965 build_libtool_libs=no
2968 echo "*** The inter-library dependencies that have been dropped here will be"
2969 echo "*** automatically added whenever a program is linked with this library"
2970 echo "*** or is declared to -dlopen it."
2972 if test $allow_undefined = no; then
2974 echo "*** Since this library must not contain undefined symbols,"
2975 echo "*** because either the platform does not support them or"
2976 echo "*** it was explicitly requested with -no-undefined,"
2977 echo "*** libtool will only create a static version of it."
2978 if test "$build_old_libs" = no; then
2979 oldlibs="$output_objdir/$libname.$libext"
2980 build_libtool_libs=module
2983 build_libtool_libs=no
2988 # Done checking deplibs!
2992 # All the library-specific variables (install_libdir is set above).
2997 # Test again, we may have decided not to build it any more
2998 if test "$build_libtool_libs" = yes; then
2999 if test $hardcode_into_libs = yes; then
3000 # Hardcode the library paths
3003 rpath="$finalize_rpath"
3004 test "$mode" != relink && rpath="$compile_rpath$rpath"
3005 for libdir in $rpath; do
3006 if test -n "$hardcode_libdir_flag_spec"; then
3007 if test -n "$hardcode_libdir_separator"; then
3008 if test -z "$hardcode_libdirs"; then
3009 hardcode_libdirs="$libdir"
3011 # Just accumulate the unique libdirs.
3012 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3013 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3016 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3021 eval flag=\"$hardcode_libdir_flag_spec\"
3022 dep_rpath="$dep_rpath $flag"
3024 elif test -n "$runpath_var"; then
3025 case "$perm_rpath " in
3027 *) perm_rpath="$perm_rpath $libdir" ;;
3031 # Substitute the hardcoded libdirs into the rpath.
3032 if test -n "$hardcode_libdir_separator" &&
3033 test -n "$hardcode_libdirs"; then
3034 libdir="$hardcode_libdirs"
3035 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3037 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3038 # We should set the runpath_var.
3040 for dir in $perm_rpath; do
3043 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3045 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3048 shlibpath="$finalize_shlibpath"
3049 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3050 if test -n "$shlibpath"; then
3051 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3054 # Get the real and link names of the library.
3055 eval library_names=\"$library_names_spec\"
3056 set dummy $library_names
3060 if test -n "$soname_spec"; then
3061 eval soname=\"$soname_spec\"
3065 test -z "$dlname" && dlname=$soname
3067 lib="$output_objdir/$realname"
3070 linknames="$linknames $link"
3073 # Ensure that we have .o objects for linkers which dislike .lo
3074 # (e.g. aix) in case we are running --disable-static
3075 for obj in $libobjs; do
3076 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3077 if test "X$xdir" = "X$obj"; then
3082 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3083 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3084 if test ! -f $xdir/$oldobj; then
3085 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3086 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3090 # Use standard objects if they are pic
3091 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3093 # Prepare the list of exported symbols
3094 if test -z "$export_symbols"; then
3095 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3096 $show "generating symbol list for \`$libname.la'"
3097 export_symbols="$output_objdir/$libname.exp"
3098 $run $rm $export_symbols
3099 eval cmds=\"$export_symbols_cmds\"
3100 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3101 for cmd in $cmds; do
3104 $run eval "$cmd" || exit $?
3107 if test -n "$export_symbols_regex"; then
3108 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3109 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3110 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3111 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3116 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3117 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3120 if test -n "$convenience"; then
3121 if test -n "$whole_archive_flag_spec"; then
3122 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3124 gentop="$output_objdir/${outputname}x"
3125 $show "${rm}r $gentop"
3126 $run ${rm}r "$gentop"
3127 $show "mkdir $gentop"
3128 $run mkdir "$gentop"
3130 if test $status -ne 0 && test ! -d "$gentop"; then
3133 generated="$generated $gentop"
3135 for xlib in $convenience; do
3136 # Extract the objects.
3138 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3139 *) xabs=`pwd`"/$xlib" ;;
3141 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3142 xdir="$gentop/$xlib"
3144 $show "${rm}r $xdir"
3149 if test $status -ne 0 && test ! -d "$xdir"; then
3152 $show "(cd $xdir && $AR x $xabs)"
3153 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3155 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3160 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3161 eval flag=\"$thread_safe_flag_spec\"
3162 linker_flags="$linker_flags $flag"
3165 # Make a backup of the uninstalled library when relinking
3166 if test "$mode" = relink; then
3167 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3170 # Do each of the archive commands.
3171 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3172 eval cmds=\"$archive_expsym_cmds\"
3174 eval cmds=\"$archive_cmds\"
3176 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3177 for cmd in $cmds; do
3180 $run eval "$cmd" || exit $?
3184 # Restore the uninstalled library and exit
3185 if test "$mode" = relink; then
3186 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3190 # Create links to the real library.
3191 for linkname in $linknames; do
3192 if test "$realname" != "$linkname"; then
3193 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3194 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3198 # If -module or -export-dynamic was specified, set the dlname.
3199 if test "$module" = yes || test "$export_dynamic" = yes; then
3200 # On all known operating systems, these are identical.
3207 if test -n "$deplibs"; then
3208 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3211 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3212 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3215 if test -n "$rpath"; then
3216 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3219 if test -n "$xrpath"; then
3220 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3223 if test -n "$vinfo"; then
3224 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3227 if test -n "$release"; then
3228 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3233 if test -n "$objs$old_deplibs"; then
3234 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3238 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3246 # Delete the old objects.
3247 $run $rm $obj $libobj
3249 # Objects from convenience libraries. This assumes
3250 # single-version convenience libraries. Whenever we create
3251 # different ones for PIC/non-PIC, this we'll have to duplicate
3255 # reload_cmds runs $LD directly, so let us get rid of
3256 # -Wl from whole_archive_flag_spec
3259 if test -n "$convenience"; then
3260 if test -n "$whole_archive_flag_spec"; then
3261 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3263 gentop="$output_objdir/${obj}x"
3264 $show "${rm}r $gentop"
3265 $run ${rm}r "$gentop"
3266 $show "mkdir $gentop"
3267 $run mkdir "$gentop"
3269 if test $status -ne 0 && test ! -d "$gentop"; then
3272 generated="$generated $gentop"
3274 for xlib in $convenience; do
3275 # Extract the objects.
3277 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3278 *) xabs=`pwd`"/$xlib" ;;
3280 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3281 xdir="$gentop/$xlib"
3283 $show "${rm}r $xdir"
3288 if test $status -ne 0 && test ! -d "$xdir"; then
3291 $show "(cd $xdir && $AR x $xabs)"
3292 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3294 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3299 # Create the old-style object.
3300 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
3303 eval cmds=\"$reload_cmds\"
3304 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3305 for cmd in $cmds; do
3308 $run eval "$cmd" || exit $?
3312 # Exit if we aren't doing a library object file.
3313 if test -z "$libobj"; then
3314 if test -n "$gentop"; then
3315 $show "${rm}r $gentop"
3322 if test "$build_libtool_libs" != yes; then
3323 if test -n "$gentop"; then
3324 $show "${rm}r $gentop"
3328 # Create an invalid libtool object if no PIC, so that we don't
3329 # accidentally link it into a program.
3330 $show "echo timestamp > $libobj"
3331 $run eval "echo timestamp > $libobj" || exit $?
3335 if test -n "$pic_flag" || test "$pic_mode" != default; then
3336 # Only do commands if we really have different PIC objects.
3337 reload_objs="$libobjs $reload_conv_objs"
3339 eval cmds=\"$reload_cmds\"
3340 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3341 for cmd in $cmds; do
3344 $run eval "$cmd" || exit $?
3348 # Just create a symlink.
3351 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3352 if test "X$xdir" = "X$libobj"; then
3357 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3358 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3359 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3360 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3363 if test -n "$gentop"; then
3364 $show "${rm}r $gentop"
3373 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3375 if test -n "$vinfo"; then
3376 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3379 if test -n "$release"; then
3380 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3383 if test "$preload" = yes; then
3384 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3385 test "$dlopen_self_static" = unknown; then
3386 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3391 *-*-rhapsody* | *-*-darwin1.[012])
3392 # On Rhapsody replace the C library is the System framework
3393 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3394 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3398 compile_command="$compile_command $compile_deplibs"
3399 finalize_command="$finalize_command $finalize_deplibs"
3401 if test -n "$rpath$xrpath"; then
3402 # If the user specified any rpath flags, then add them.
3403 for libdir in $rpath $xrpath; do
3404 # This is the magic to use -rpath.
3405 case "$finalize_rpath " in
3407 *) finalize_rpath="$finalize_rpath $libdir" ;;
3412 # Now hardcode the library paths
3415 for libdir in $compile_rpath $finalize_rpath; do
3416 if test -n "$hardcode_libdir_flag_spec"; then
3417 if test -n "$hardcode_libdir_separator"; then
3418 if test -z "$hardcode_libdirs"; then
3419 hardcode_libdirs="$libdir"
3421 # Just accumulate the unique libdirs.
3422 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3423 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3426 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3431 eval flag=\"$hardcode_libdir_flag_spec\"
3432 rpath="$rpath $flag"
3434 elif test -n "$runpath_var"; then
3435 case "$perm_rpath " in
3437 *) perm_rpath="$perm_rpath $libdir" ;;
3441 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3442 case :$dllsearchpath: in
3444 *) dllsearchpath="$dllsearchpath:$libdir";;
3449 # Substitute the hardcoded libdirs into the rpath.
3450 if test -n "$hardcode_libdir_separator" &&
3451 test -n "$hardcode_libdirs"; then
3452 libdir="$hardcode_libdirs"
3453 eval rpath=\" $hardcode_libdir_flag_spec\"
3455 compile_rpath="$rpath"
3459 for libdir in $finalize_rpath; do
3460 if test -n "$hardcode_libdir_flag_spec"; then
3461 if test -n "$hardcode_libdir_separator"; then
3462 if test -z "$hardcode_libdirs"; then
3463 hardcode_libdirs="$libdir"
3465 # Just accumulate the unique libdirs.
3466 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3467 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3470 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3475 eval flag=\"$hardcode_libdir_flag_spec\"
3476 rpath="$rpath $flag"
3478 elif test -n "$runpath_var"; then
3479 case "$finalize_perm_rpath " in
3481 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3485 # Substitute the hardcoded libdirs into the rpath.
3486 if test -n "$hardcode_libdir_separator" &&
3487 test -n "$hardcode_libdirs"; then
3488 libdir="$hardcode_libdirs"
3489 eval rpath=\" $hardcode_libdir_flag_spec\"
3491 finalize_rpath="$rpath"
3493 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3494 # Transform all the library objects into standard objects.
3495 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3496 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3500 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3501 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3502 dlsyms="${outputname}S.c"
3504 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3508 if test -n "$dlsyms"; then
3512 # Discover the nlist of each of the dlfiles.
3513 nlist="$output_objdir/${outputname}.nm"
3515 $show "$rm $nlist ${nlist}S ${nlist}T"
3516 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3518 # Parse the name list into a source file.
3519 $show "creating $output_objdir/$dlsyms"
3521 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3522 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3523 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3529 /* Prevent the only kind of declaration conflicts we can make. */
3530 #define lt_preloaded_symbols some_other_symbol
3532 /* External symbol declarations for the compiler. */\
3535 if test "$dlself" = yes; then
3536 $show "generating symbol list for \`$output'"
3538 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3540 # Add our own program objects to the symbol list.
3541 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3542 for arg in $progfiles; do
3543 $show "extracting global C symbols from \`$arg'"
3544 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3547 if test -n "$exclude_expsyms"; then
3548 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3549 $run eval '$mv "$nlist"T "$nlist"'
3552 if test -n "$export_symbols_regex"; then
3553 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3554 $run eval '$mv "$nlist"T "$nlist"'
3557 # Prepare the list of exported symbols
3558 if test -z "$export_symbols"; then
3559 export_symbols="$output_objdir/$output.exp"
3560 $run $rm $export_symbols
3561 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3563 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3564 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3565 $run eval 'mv "$nlist"T "$nlist"'
3569 for arg in $dlprefiles; do
3570 $show "extracting global C symbols from \`$arg'"
3571 name=`echo "$arg" | sed -e 's%^.*/%%'`
3572 $run eval 'echo ": $name " >> "$nlist"'
3573 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3576 if test -z "$run"; then
3577 # Make sure we have at least an empty file.
3578 test -f "$nlist" || : > "$nlist"
3580 if test -n "$exclude_expsyms"; then
3581 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3582 $mv "$nlist"T "$nlist"
3585 # Try sorting and uniquifying the output.
3586 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3589 grep -v "^: " < "$nlist" > "$nlist"S
3592 if test -f "$nlist"S; then
3593 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3595 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3598 $echo >> "$output_objdir/$dlsyms" "\
3600 #undef lt_preloaded_symbols
3602 #if defined (__STDC__) && __STDC__
3603 # define lt_ptr_t void *
3605 # define lt_ptr_t char *
3609 /* The mapping between symbol names and symbols. */
3614 lt_preloaded_symbols[] =
3618 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3619 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3620 < "$nlist" >> "$output_objdir/$dlsyms"
3622 $echo >> "$output_objdir/$dlsyms" "\
3626 /* This works around a problem in FreeBSD linker */
3627 #ifdef FREEBSD_WORKAROUND
3628 static const void *lt_preloaded_setup() {
3629 return lt_preloaded_symbols;
3639 pic_flag_for_symtable=
3641 # compiling the symbol table file with pic_flag works around
3642 # a FreeBSD bug that causes programs to crash when -lm is
3643 # linked before any other PIC object. But we must not use
3644 # pic_flag when linking with -static. The problem exists in
3645 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3646 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3647 case "$compile_command " in
3649 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3652 case "$compile_command " in
3654 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3658 # Now compile the dynamic symbol file.
3659 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3660 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3662 # Clean up the generated files.
3663 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3664 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3666 # Transform the symbol file into the correct name.
3667 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3668 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3671 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3676 # We keep going just in case the user didn't refer to
3677 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3678 # really was required.
3680 # Nullify the symbol file.
3681 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3682 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3685 if test $need_relink = no || test "$build_libtool_libs" != yes; then
3686 # Replace the output file specification.
3687 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3688 link_command="$compile_command$compile_rpath"
3690 # We have no uninstalled library dependencies, so finalize right now.
3691 $show "$link_command"
3692 $run eval "$link_command"
3695 # Delete the generated files.
3696 if test -n "$dlsyms"; then
3697 $show "$rm $output_objdir/${outputname}S.${objext}"
3698 $run $rm "$output_objdir/${outputname}S.${objext}"
3704 if test -n "$shlibpath_var"; then
3705 # We should set the shlibpath_var
3707 for dir in $temp_rpath; do
3709 [\\/]* | [A-Za-z]:[\\/]*)
3714 # Relative path: add a thisdir entry.
3715 rpath="$rpath\$thisdir/$dir:"
3722 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3723 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3725 if test -n "$finalize_shlibpath"; then
3726 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3731 if test -n "$runpath_var"; then
3732 if test -n "$perm_rpath"; then
3733 # We should set the runpath_var.
3735 for dir in $perm_rpath; do
3738 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3740 if test -n "$finalize_perm_rpath"; then
3741 # We should set the runpath_var.
3743 for dir in $finalize_perm_rpath; do
3746 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3750 if test "$no_install" = yes; then
3751 # We don't need to create a wrapper script.
3752 link_command="$compile_var$compile_command$compile_rpath"
3753 # Replace the output file specification.
3754 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3755 # Delete the old output file.
3757 # Link the executable and exit
3758 $show "$link_command"
3759 $run eval "$link_command" || exit $?
3763 if test "$hardcode_action" = relink; then
3764 # Fast installation is not supported
3765 link_command="$compile_var$compile_command$compile_rpath"
3766 relink_command="$finalize_var$finalize_command$finalize_rpath"
3768 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3769 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3771 if test "$fast_install" != no; then
3772 link_command="$finalize_var$compile_command$finalize_rpath"
3773 if test "$fast_install" = yes; then
3774 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3776 # fast_install is set to needless
3780 link_command="$compile_var$compile_command$compile_rpath"
3781 relink_command="$finalize_var$finalize_command$finalize_rpath"
3785 # Replace the output file specification.
3786 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3788 # Delete the old output files.
3789 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3791 $show "$link_command"
3792 $run eval "$link_command" || exit $?
3794 # Now create the wrapper script.
3795 $show "creating $output"
3797 # Quote the relink command for shipping.
3798 if test -n "$relink_command"; then
3799 # Preserve any variables that may affect compiler behavior
3800 for var in $variables_saved_for_relink; do
3801 if eval test -z \"\${$var+set}\"; then
3802 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3803 elif eval var_value=\$$var; test -z "$var_value"; then
3804 relink_command="$var=; export $var; $relink_command"
3806 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3807 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3810 relink_command="cd `pwd`; $relink_command"
3811 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3814 # Quote $echo for shipping.
3815 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3817 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3818 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3820 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3822 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3825 # Only actually do things if our run command is non-null.
3826 if test -z "$run"; then
3827 # win32 will think the script is a binary if it has
3828 # a .exe suffix, so we strip it off here.
3830 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3832 # test for cygwin because mv fails w/o .exe extensions
3834 *cygwin*) exeext=.exe ;;
3838 trap "$rm $output; exit 1" 1 2 15
3843 # $output - temporary wrapper script for $objdir/$outputname
3844 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3846 # The $output program cannot be directly executed until all the libtool
3847 # libraries that it depends on are installed.
3849 # This wrapper script should never be moved out of the build directory.
3850 # If it is, it will not operate correctly.
3852 # Sed substitution that helps us do robust quoting. It backslashifies
3853 # metacharacters that are still active within double-quoted strings.
3854 Xsed='sed -e 1s/^X//'
3855 sed_quote_subst='$sed_quote_subst'
3857 # The HP-UX ksh and POSIX shell print the target directory to stdout
3859 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3861 relink_command=\"$relink_command\"
3863 # This environment variable determines our operation mode.
3864 if test \"\$libtool_install_magic\" = \"$magic\"; then
3865 # install mode needs the following variable:
3866 notinst_deplibs='$notinst_deplibs'
3868 # When we are sourced in execute mode, \$file and \$echo are already set.
3869 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3872 # Make sure echo works.
3873 if test \"X\$1\" = X--no-reexec; then
3874 # Discard the --no-reexec flag, and continue.
3876 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3877 # Yippee, \$echo works!
3880 # Restart under the correct shell, and then maybe \$echo will work.
3881 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3887 # Find the directory that this script lives in.
3888 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3889 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3891 # Follow symbolic links until we get to the real thisdir.
3892 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3893 while test -n \"\$file\"; do
3894 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3896 # If there was a directory component, then change thisdir.
3897 if test \"x\$destdir\" != \"x\$file\"; then
3898 case \"\$destdir\" in
3899 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3900 *) thisdir=\"\$thisdir/\$destdir\" ;;
3904 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3905 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3908 # Try to get the absolute directory name.
3909 absdir=\`cd \"\$thisdir\" && pwd\`
3910 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3913 if test "$fast_install" = yes; then
3915 program=lt-'$outputname'$exeext
3916 progdir=\"\$thisdir/$objdir\"
3918 if test ! -f \"\$progdir/\$program\" || \\
3919 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3920 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3922 file=\"\$\$-\$program\"
3924 if test ! -d \"\$progdir\"; then
3925 $mkdir \"\$progdir\"
3927 $rm \"\$progdir/\$file\"
3932 # relink executable if necessary
3933 if test -n \"\$relink_command\"; then
3934 if (eval \$relink_command); then :
3936 $rm \"\$progdir/\$file\"
3941 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3942 { $rm \"\$progdir/\$program\";
3943 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3944 $rm \"\$progdir/\$file\"
3948 program='$outputname'
3949 progdir=\"\$thisdir/$objdir\"
3955 if test -f \"\$progdir/\$program\"; then"
3957 # Export our shlibpath_var if we have one.
3958 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3960 # Add our own library path to $shlibpath_var
3961 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3963 # Some systems cannot cope with colon-terminated $shlibpath_var
3964 # The second colon is a workaround for a bug in BeOS R4 sed
3965 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3967 export $shlibpath_var
3971 # fixup the dll searchpath if we need to.
3972 if test -n "$dllsearchpath"; then
3974 # Add the dll search path components to the executable PATH
3975 PATH=$dllsearchpath:\$PATH
3980 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3981 # Run the actual program with our arguments.
3984 # win32 systems need to use the prog path for dll
3986 *-*-cygwin* | *-*-pw32*)
3988 exec \$progdir/\$program \${1+\"\$@\"}
3992 # Backslashes separate directories on plain windows
3993 *-*-mingw | *-*-os2*)
3995 exec \$progdir\\\\\$program \${1+\"\$@\"}
4001 # Export the path to the program.
4002 PATH=\"\$progdir:\$PATH\"
4005 exec \$program \${1+\"\$@\"}
4010 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4014 # The program doesn't exist.
4015 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4016 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4017 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4028 # See if we need to build an old-fashioned archive.
4029 for oldlib in $oldlibs; do
4031 if test "$build_libtool_libs" = convenience; then
4032 oldobjs="$libobjs_save"
4033 addlibs="$convenience"
4034 build_libtool_libs=no
4036 if test "$build_libtool_libs" = module; then
4037 oldobjs="$libobjs_save"
4038 build_libtool_libs=no
4040 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4042 addlibs="$old_convenience"
4045 if test -n "$addlibs"; then
4046 gentop="$output_objdir/${outputname}x"
4047 $show "${rm}r $gentop"
4048 $run ${rm}r "$gentop"
4049 $show "mkdir $gentop"
4050 $run mkdir "$gentop"
4052 if test $status -ne 0 && test ! -d "$gentop"; then
4055 generated="$generated $gentop"
4057 # Add in members from convenience archives.
4058 for xlib in $addlibs; do
4059 # Extract the objects.
4061 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4062 *) xabs=`pwd`"/$xlib" ;;
4064 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4065 xdir="$gentop/$xlib"
4067 $show "${rm}r $xdir"
4072 if test $status -ne 0 && test ! -d "$xdir"; then
4075 $show "(cd $xdir && $AR x $xabs)"
4076 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4078 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4082 # Do each command in the archive commands.
4083 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4084 eval cmds=\"$old_archive_from_new_cmds\"
4086 # Ensure that we have .o objects in place in case we decided
4087 # not to build a shared library, and have fallen back to building
4088 # static libs even though --disable-static was passed!
4089 for oldobj in $oldobjs; do
4090 if test ! -f $oldobj; then
4091 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4092 if test "X$xdir" = "X$oldobj"; then
4097 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4098 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4099 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4100 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4104 eval cmds=\"$old_archive_cmds\"
4106 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4107 for cmd in $cmds; do
4110 $run eval "$cmd" || exit $?
4115 if test -n "$generated"; then
4116 $show "${rm}r$generated"
4117 $run ${rm}r$generated
4120 # Now create the libtool archive.
4124 test "$build_old_libs" = yes && old_library="$libname.$libext"
4125 $show "creating $output"
4127 # Preserve any variables that may affect compiler behavior
4128 for var in $variables_saved_for_relink; do
4129 if eval test -z \"\${$var+set}\"; then
4130 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4131 elif eval var_value=\$$var; test -z "$var_value"; then
4132 relink_command="$var=; export $var; $relink_command"
4134 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4135 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4138 # Quote the link command for shipping.
4139 relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@"
4140 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4142 # Only create the output if not a dry run.
4143 if test -z "$run"; then
4144 for installed in no yes; do
4145 if test "$installed" = yes; then
4146 if test -z "$install_libdir"; then
4149 output="$output_objdir/$outputname"i
4150 # Replace all uninstalled libtool libraries with the installed ones
4152 for deplib in $dependency_libs; do
4155 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4156 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4157 if test -z "$libdir"; then
4158 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4161 newdependency_libs="$newdependency_libs $libdir/$name"
4163 *) newdependency_libs="$newdependency_libs $deplib" ;;
4166 dependency_libs="$newdependency_libs"
4168 for lib in $dlfiles; do
4169 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4170 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4171 if test -z "$libdir"; then
4172 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4175 newdlfiles="$newdlfiles $libdir/$name"
4177 dlfiles="$newdlfiles"
4179 for lib in $dlprefiles; do
4180 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4181 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4182 if test -z "$libdir"; then
4183 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4186 newdlprefiles="$newdlprefiles $libdir/$name"
4188 dlprefiles="$newdlprefiles"
4191 # place dlname in correct position for cygwin
4193 case $host,$output,$installed,$module,$dlname in
4194 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4197 # $outputname - a libtool library file
4198 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4200 # Please DO NOT delete this file!
4201 # It is necessary for linking the library.
4203 # The name that we can dlopen(3).
4206 # Names of this library.
4207 library_names='$library_names'
4209 # The name of the static archive.
4210 old_library='$old_library'
4212 # Libraries that this one depends upon.
4213 dependency_libs='$dependency_libs'
4215 # Version information for $libname.
4220 # Is this an already installed library?
4221 installed=$installed
4223 # Files to dlopen/dlpreopen
4225 dlpreopen='$dlprefiles'
4227 # Directory that this library needs to be installed in:
4228 libdir='$install_libdir'"
4229 if test "$installed" = no && test $need_relink = yes; then
4231 relink_command=\"$relink_command\""
4236 # Do a symbolic link so that the libtool archive can be found in
4237 # LD_LIBRARY_PATH before the program is installed.
4238 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4239 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4245 # libtool install mode
4247 modename="$modename: install"
4249 # There may be an optional sh(1) argument at the beginning of
4250 # install_prog (especially on Windows NT).
4251 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4252 # Allow the use of GNU shtool's install command.
4253 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4254 # Aesthetically quote it.
4255 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4257 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4261 install_prog="$arg "
4269 # The real first argument should be the name of the installation program.
4270 # Aesthetically quote it.
4271 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4273 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4277 install_prog="$install_prog$arg"
4279 # We need to accept at least all the BSD install flags.
4289 if test -n "$dest"; then
4290 files="$files $dest"
4308 # If the previous option needed an argument, then skip it.
4309 if test -n "$prev"; then
4318 # Aesthetically quote the argument.
4319 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4321 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4325 install_prog="$install_prog $arg"
4328 if test -z "$install_prog"; then
4329 $echo "$modename: you must specify an install program" 1>&2
4334 if test -n "$prev"; then
4335 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4340 if test -z "$files"; then
4341 if test -z "$dest"; then
4342 $echo "$modename: no file or destination specified" 1>&2
4344 $echo "$modename: you must specify a destination" 1>&2
4350 # Strip any trailing slash from the destination.
4351 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4353 # Check to see that the destination is a directory.
4354 test -d "$dest" && isdir=yes
4355 if test "$isdir" = yes; then
4359 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4360 test "X$destdir" = "X$dest" && destdir=.
4361 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4363 # Not a directory, so check to see that there is only one file specified.
4365 if test $# -gt 2; then
4366 $echo "$modename: \`$dest' is not a directory" 1>&2
4372 [\\/]* | [A-Za-z]:[\\/]*) ;;
4374 for file in $files; do
4378 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4387 # This variable tells wrapper scripts just to set variables rather
4388 # than running their programs.
4389 libtool_install_magic="$magic"
4394 for file in $files; do
4396 # Do each installation.
4399 # Do the static libraries later.
4400 staticlibs="$staticlibs $file"
4404 # Check to see that this really is a libtool archive.
4405 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4407 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4415 # If there is no directory component, then add one.
4417 */* | *\\*) . $file ;;
4421 # Add the libdir to current_libdirs if it is the destination.
4422 if test "X$destdir" = "X$libdir"; then
4423 case "$current_libdirs " in
4425 *) current_libdirs="$current_libdirs $libdir" ;;
4428 # Note the libdir as a future libdir.
4429 case "$future_libdirs " in
4431 *) future_libdirs="$future_libdirs $libdir" ;;
4435 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4436 test "X$dir" = "X$file/" && dir=
4439 if test -n "$relink_command"; then
4440 # Determine the prefix the user has applied to our future dir.
4441 inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
4443 # Don't allow the user to place us outside of our expected
4444 # location b/c this prevents finding dependent libraries that
4445 # are installed to the same prefix.
4446 if test "$inst_prefix_dir" = "$destdir"; then
4447 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4451 if test -n "$inst_prefix_dir"; then
4452 # Stick the inst_prefix_dir data into the link command.
4453 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4455 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
4458 $echo "$modename: warning: relinking \`$file'" 1>&2
4459 $show "$relink_command"
4460 if $run eval "$relink_command"; then :
4462 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4467 # See the names of the shared library.
4468 set dummy $library_names
4469 if test -n "$2"; then
4475 test -n "$relink_command" && srcname="$realname"T
4477 # Install the shared library and build the symlinks.
4478 $show "$install_prog $dir/$srcname $destdir/$realname"
4479 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4480 if test -n "$stripme" && test -n "$striplib"; then
4481 $show "$striplib $destdir/$realname"
4482 $run eval "$striplib $destdir/$realname" || exit $?
4485 if test $# -gt 0; then
4486 # Delete the old symlinks, and create new ones.
4489 if test "$linkname" != "$realname"; then
4490 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4491 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4496 # Do each command in the postinstall commands.
4497 lib="$destdir/$realname"
4498 eval cmds=\"$postinstall_cmds\"
4499 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4500 for cmd in $cmds; do
4503 $run eval "$cmd" || exit $?
4508 # Install the pseudo-library for information purposes.
4509 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4510 instname="$dir/$name"i
4511 $show "$install_prog $instname $destdir/$name"
4512 $run eval "$install_prog $instname $destdir/$name" || exit $?
4514 # Maybe install the static library, too.
4515 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4519 # Install (i.e. copy) a libtool object.
4521 # Figure out destination file name, if it wasn't already specified.
4522 if test -n "$destname"; then
4523 destfile="$destdir/$destname"
4525 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4526 destfile="$destdir/$destfile"
4529 # Deduce the name of the destination old-style object file.
4532 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4535 staticdest="$destfile"
4539 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4545 # Install the libtool object if requested.
4546 if test -n "$destfile"; then
4547 $show "$install_prog $file $destfile"
4548 $run eval "$install_prog $file $destfile" || exit $?
4551 # Install the old object if enabled.
4552 if test "$build_old_libs" = yes; then
4553 # Deduce the name of the old-style object file.
4554 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4556 $show "$install_prog $staticobj $staticdest"
4557 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4563 # Figure out destination file name, if it wasn't already specified.
4564 if test -n "$destname"; then
4565 destfile="$destdir/$destname"
4567 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4568 destfile="$destdir/$destfile"
4571 # Do a test to see if this is really a libtool program.
4572 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4576 # If there is no directory component, then add one.
4578 */* | *\\*) . $file ;;
4582 # Check the variables that should have been set.
4583 if test -z "$notinst_deplibs"; then
4584 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4589 for lib in $notinst_deplibs; do
4590 # Check to see that each library is installed.
4592 if test -f "$lib"; then
4593 # If there is no directory component, then add one.
4595 */* | *\\*) . $lib ;;
4599 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4600 if test -n "$libdir" && test ! -f "$libfile"; then
4601 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4607 # If there is no directory component, then add one.
4609 */* | *\\*) . $file ;;
4614 if test "$fast_install" = no && test -n "$relink_command"; then
4615 if test "$finalize" = yes && test -z "$run"; then
4617 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4618 tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
4619 if test $? = 0 ; then :
4621 tmpdir="$tmpdir/libtool-$$"
4623 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4625 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4628 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4629 outputname="$tmpdir/$file"
4630 # Replace the output file specification.
4631 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4633 $show "$relink_command"
4634 if $run eval "$relink_command"; then :
4636 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4642 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4645 # Install the binary that we compiled earlier.
4646 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4650 # remove .exe since cygwin /usr/bin/install will append another
4652 case $install_prog,$host in
4653 /usr/bin/install*,*cygwin*)
4654 case $file:$destfile in
4659 destfile=$destfile.exe
4662 destfile=`echo $destfile | sed -e 's,.exe$,,'`
4667 $show "$install_prog$stripme $file $destfile"
4668 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4669 test -n "$outputname" && ${rm}r "$tmpdir"
4674 for file in $staticlibs; do
4675 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4677 # Set up the ranlib parameters.
4678 oldlib="$destdir/$name"
4680 $show "$install_prog $file $oldlib"
4681 $run eval "$install_prog \$file \$oldlib" || exit $?
4683 if test -n "$stripme" && test -n "$striplib"; then
4684 $show "$old_striplib $oldlib"
4685 $run eval "$old_striplib $oldlib" || exit $?
4688 # Do each command in the postinstall commands.
4689 eval cmds=\"$old_postinstall_cmds\"
4690 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4691 for cmd in $cmds; do
4694 $run eval "$cmd" || exit $?
4699 if test -n "$future_libdirs"; then
4700 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4703 if test -n "$current_libdirs"; then
4704 # Maybe just do a dry run.
4705 test -n "$run" && current_libdirs=" -n$current_libdirs"
4706 exec $SHELL $0 --finish$current_libdirs
4713 # libtool finish mode
4715 modename="$modename: finish"
4719 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4722 libdirs="$libdirs $dir"
4725 for libdir in $libdirs; do
4726 if test -n "$finish_cmds"; then
4727 # Do each command in the finish commands.
4728 eval cmds=\"$finish_cmds\"
4729 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4730 for cmd in $cmds; do
4733 $run eval "$cmd" || admincmds="$admincmds
4738 if test -n "$finish_eval"; then
4739 # Do the single finish_eval.
4740 eval cmds=\"$finish_eval\"
4741 $run eval "$cmds" || admincmds="$admincmds
4747 # Exit here if they wanted silent mode.
4748 test "$show" = ":" && exit 0
4750 echo "----------------------------------------------------------------------"
4751 echo "Libraries have been installed in:"
4752 for libdir in $libdirs; do
4756 echo "If you ever happen to want to link against installed libraries"
4757 echo "in a given directory, LIBDIR, you must either use libtool, and"
4758 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4759 echo "flag during linking and do at least one of the following:"
4760 if test -n "$shlibpath_var"; then
4761 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4762 echo " during execution"
4764 if test -n "$runpath_var"; then
4765 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4766 echo " during linking"
4768 if test -n "$hardcode_libdir_flag_spec"; then
4770 eval flag=\"$hardcode_libdir_flag_spec\"
4772 echo " - use the \`$flag' linker flag"
4774 if test -n "$admincmds"; then
4775 echo " - have your system administrator run these commands:$admincmds"
4777 if test -f /etc/ld.so.conf; then
4778 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4781 echo "See any operating system documentation about shared libraries for"
4782 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4783 echo "----------------------------------------------------------------------"
4787 # libtool execute mode
4789 modename="$modename: execute"
4791 # The first argument is the command name.
4793 if test -z "$cmd"; then
4794 $echo "$modename: you must specify a COMMAND" 1>&2
4799 # Handle -dlopen flags immediately.
4800 for file in $execute_dlfiles; do
4801 if test ! -f "$file"; then
4802 $echo "$modename: \`$file' is not a file" 1>&2
4810 # Check to see that this really is a libtool archive.
4811 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4813 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4818 # Read the libtool library.
4822 # If there is no directory component, then add one.
4824 */* | *\\*) . $file ;;
4828 # Skip this library if it cannot be dlopened.
4829 if test -z "$dlname"; then
4830 # Warn if it was a shared library.
4831 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4835 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4836 test "X$dir" = "X$file" && dir=.
4838 if test -f "$dir/$objdir/$dlname"; then
4841 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4847 # Just add the directory containing the .lo file.
4848 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4849 test "X$dir" = "X$file" && dir=.
4853 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4858 # Get the absolute pathname.
4859 absdir=`cd "$dir" && pwd`
4860 test -n "$absdir" && dir="$absdir"
4862 # Now add the directory to shlibpath_var.
4863 if eval "test -z \"\$$shlibpath_var\""; then
4864 eval "$shlibpath_var=\"\$dir\""
4866 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4870 # This variable tells wrapper scripts just to set shlibpath_var
4871 # rather than running their programs.
4872 libtool_execute_magic="$magic"
4874 # Check if any of the arguments is a wrapper script.
4881 # Do a test to see if this is really a libtool program.
4882 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4883 # If there is no directory component, then add one.
4885 */* | *\\*) . $file ;;
4889 # Transform arg to wrapped name.
4890 file="$progdir/$program"
4894 # Quote arguments (to preserve shell metacharacters).
4895 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4896 args="$args \"$file\""
4899 if test -z "$run"; then
4900 if test -n "$shlibpath_var"; then
4901 # Export the shlibpath_var.
4902 eval "export $shlibpath_var"
4905 # Restore saved enviroment variables
4906 if test "${save_LC_ALL+set}" = set; then
4907 LC_ALL="$save_LC_ALL"; export LC_ALL
4909 if test "${save_LANG+set}" = set; then
4910 LANG="$save_LANG"; export LANG
4913 # Now actually exec the command.
4914 eval "exec \$cmd$args"
4916 $echo "$modename: cannot exec \$cmd$args"
4919 # Display what would be done.
4920 if test -n "$shlibpath_var"; then
4921 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4922 $echo "export $shlibpath_var"
4929 # libtool clean and uninstall mode
4931 modename="$modename: $mode"
4937 # This variable tells wrapper scripts just to set variables rather
4938 # than running their programs.
4939 libtool_install_magic="$magic"
4944 -f) rm="$rm $arg"; rmforce=yes ;;
4945 -*) rm="$rm $arg" ;;
4946 *) files="$files $arg" ;;
4950 if test -z "$rm"; then
4951 $echo "$modename: you must specify an RM program" 1>&2
4958 for file in $files; do
4959 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4960 if test "X$dir" = "X$file"; then
4964 objdir="$dir/$objdir"
4966 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4967 test $mode = uninstall && objdir="$dir"
4969 # Remember objdir for removal later, being careful to avoid duplicates
4970 if test $mode = clean; then
4973 *) rmdirs="$rmdirs $objdir" ;;
4977 # Don't error if the file doesn't exist and rm -f was used.
4978 if (test -L "$file") >/dev/null 2>&1 \
4979 || (test -h "$file") >/dev/null 2>&1 \
4980 || test -f "$file"; then
4982 elif test -d "$file"; then
4985 elif test "$rmforce" = yes; then
4993 # Possibly a libtool archive, so verify it.
4994 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4997 # Delete the libtool libraries and symlinks.
4998 for n in $library_names; do
4999 rmfiles="$rmfiles $objdir/$n"
5001 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5002 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5004 if test $mode = uninstall; then
5005 if test -n "$library_names"; then
5006 # Do each command in the postuninstall commands.
5007 eval cmds=\"$postuninstall_cmds\"
5008 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
5009 for cmd in $cmds; do
5013 if test $? != 0 && test "$rmforce" != yes; then
5020 if test -n "$old_library"; then
5021 # Do each command in the old_postuninstall commands.
5022 eval cmds=\"$old_postuninstall_cmds\"
5023 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
5024 for cmd in $cmds; do
5028 if test $? != 0 && test "$rmforce" != yes; then
5034 # FIXME: should reinstall the best remaining shared library.
5040 if test "$build_old_libs" = yes; then
5041 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5042 rmfiles="$rmfiles $dir/$oldobj"
5047 # Do a test to see if this is a libtool program.
5048 if test $mode = clean &&
5049 (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5053 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5054 if test "$fast_install" = yes && test -n "$relink_command"; then
5055 rmfiles="$rmfiles $objdir/lt-$name"
5060 $show "$rm $rmfiles"
5061 $run $rm $rmfiles || exit_status=1
5064 # Try to remove the ${objdir}s in the directories where we deleted files
5065 for dir in $rmdirs; do
5066 if test -d "$dir"; then
5068 $run rmdir $dir >/dev/null 2>&1
5076 $echo "$modename: you must specify a MODE" 1>&2
5077 $echo "$generic_help" 1>&2
5082 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5083 $echo "$generic_help" 1>&2
5085 fi # test -z "$show_help"
5087 # We need to display help for each of the modes.
5090 "Usage: $modename [OPTION]... [MODE-ARG]...
5092 Provide generalized library-building support services.
5094 --config show all configuration variables
5095 --debug enable verbose shell tracing
5096 -n, --dry-run display commands without modifying any files
5097 --features display basic configuration information and exit
5098 --finish same as \`--mode=finish'
5099 --help display this help message and exit
5100 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5101 --quiet same as \`--silent'
5102 --silent don't print informational messages
5103 --version print version information
5105 MODE must be one of the following:
5107 clean remove files from the build directory
5108 compile compile a source file into a libtool object
5109 execute automatically set library path, then run a program
5110 finish complete the installation of libtool libraries
5111 install install libraries or executables
5112 link create a library or an executable
5113 uninstall remove libraries from an installed directory
5115 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5116 a more detailed description of MODE."
5122 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5124 Remove files from the build directory.
5126 RM is the name of the program to use to delete files associated with each FILE
5127 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5130 If FILE is a libtool library, object or program, all the files associated
5131 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5136 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5138 Compile a source file into a libtool library object.
5140 This mode accepts the following additional options:
5142 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5143 -prefer-pic try to building PIC objects only
5144 -prefer-non-pic try to building non-PIC objects only
5145 -static always build a \`.o' file suitable for static linking
5147 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5148 from the given SOURCEFILE.
5150 The output file name is determined by removing the directory component from
5151 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5152 library object suffix, \`.lo'."
5157 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5159 Automatically set library path, then run a program.
5161 This mode accepts the following additional options:
5163 -dlopen FILE add the directory containing FILE to the library path
5165 This mode sets the library path environment variable according to \`-dlopen'
5168 If any of the ARGS are libtool executable wrappers, then they are translated
5169 into their corresponding uninstalled binary, and any of their required library
5170 directories are added to the library path.
5172 Then, COMMAND is executed, with ARGS as arguments."
5177 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5179 Complete the installation of libtool libraries.
5181 Each LIBDIR is a directory that contains libtool libraries.
5183 The commands that this mode executes may require superuser privileges. Use
5184 the \`--dry-run' option if you just want to see what would be executed."
5189 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5191 Install executables or libraries.
5193 INSTALL-COMMAND is the installation command. The first component should be
5194 either the \`install' or \`cp' program.
5196 The rest of the components are interpreted as arguments to that command (only
5197 BSD-compatible install options are recognized)."
5202 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5204 Link object files or libraries together to form another library, or to
5205 create an executable program.
5207 LINK-COMMAND is a command using the C compiler that you would use to create
5208 a program from several object files.
5210 The following components of LINK-COMMAND are treated specially:
5212 -all-static do not do any dynamic linking at all
5213 -avoid-version do not add a version suffix if possible
5214 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5215 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5216 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5217 -export-symbols SYMFILE
5218 try to export only the symbols listed in SYMFILE
5219 -export-symbols-regex REGEX
5220 try to export only the symbols matching REGEX
5221 -LLIBDIR search LIBDIR for required installed libraries
5222 -lNAME OUTPUT-FILE requires the installed library libNAME
5223 -module build a library that can dlopened
5224 -no-fast-install disable the fast-install mode
5225 -no-install link a not-installable executable
5226 -no-undefined declare that a library does not refer to external symbols
5227 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5228 -release RELEASE specify package release information
5229 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5230 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5231 -static do not do any dynamic linking of libtool libraries
5232 -version-info CURRENT[:REVISION[:AGE]]
5233 specify library version info [each variable defaults to 0]
5235 All other options (arguments beginning with \`-') are ignored.
5237 Every other argument is treated as a filename. Files ending in \`.la' are
5238 treated as uninstalled libtool libraries, other files are standard or library
5241 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5242 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5243 required, except when creating a convenience library.
5245 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5246 using \`ar' and \`ranlib', or on Windows using \`lib'.
5248 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5249 is created, otherwise an executable program is created."
5254 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5256 Remove libraries from an installation directory.
5258 RM is the name of the program to use to delete files associated with each FILE
5259 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5262 If FILE is a libtool library, all the files associated with it are deleted.
5263 Otherwise, only FILE itself is deleted using RM."
5267 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5274 $echo "Try \`$modename --help' for more information about other modes."