3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by (GNU libxml2 2.4.28)
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 lin-msivertson.station.sony.com:
40 # Shell to use when invoking shell scripts.
43 # Whether or not to build shared libraries.
44 build_libtool_libs
=yes
46 # Whether or not to build static libraries.
49 # Whether or not to add -lc for building shared libraries.
50 build_libtool_need_lc
=no
52 # Whether or not to optimize for fast installation.
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"
149 # Compiler flag to allow reflexive dlopens.
150 export_dynamic_flag_spec
="\${wl}--export-dynamic"
152 # Compiler flag to generate shared objects directly from archives.
153 whole_archive_flag_spec
="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
155 # Compiler flag to generate thread-safe objects.
156 thread_safe_flag_spec
=""
158 # Library versioning type.
161 # Format of library name prefix.
162 libname_spec
="lib\$name"
164 # List of archive names. First name is the real one, the rest are links.
165 # The last name is the one that the linker finds with -lNAME.
166 library_names_spec
="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
168 # The coded name of the library, if different from the real name.
169 soname_spec
="\${libname}\${release}.so\$major"
171 # Commands used to build and install an old-style archive.
173 old_archive_cmds
="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
174 old_postinstall_cmds
="\$RANLIB \$oldlib~chmod 644 \$oldlib"
175 old_postuninstall_cmds
=""
177 # Create an old-style archive from a shared archive.
178 old_archive_from_new_cmds
=""
180 # Create a temporary old-style archive to link instead of a shared archive.
181 old_archive_from_expsyms_cmds
=""
183 # Commands used to build and install a shared archive.
184 archive_cmds
="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
185 archive_expsym_cmds
="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
187 postuninstall_cmds
=""
189 # Commands to strip libraries.
190 old_striplib
="strip --strip-debug"
191 striplib
="strip --strip-unneeded"
193 # Method to check whether dependent libraries are shared objects.
194 deplibs_check_method
="pass_all"
196 # Command to use when deplibs_check_method == file_magic.
197 file_magic_cmd
="\$MAGIC_CMD"
199 # Flag that allows shared libraries with undefined symbols to be built.
200 allow_undefined_flag
=""
202 # Flag that forces no undefined symbols.
205 # Commands used to finish a libtool library installation in a directory.
206 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
208 # Same as above, but a single script fragment to be evaled but not shown.
211 # Take the output of nm and produce a listing of raw symbols and C names.
212 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
214 # Transform the output of nm in a proper C declaration
215 global_symbol_to_cdecl
="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
217 # Transform the output of nm in a C name address pair
218 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
220 # This is the shared library runtime path variable.
221 runpath_var
=LD_RUN_PATH
223 # This is the shared library path variable.
224 shlibpath_var
=LD_LIBRARY_PATH
226 # Is shlibpath searched before the hard-coded library search path?
227 shlibpath_overrides_runpath
=no
229 # How to hardcode a shared library path into an executable.
230 hardcode_action
=immediate
232 # Whether we should hardcode library paths into libraries.
233 hardcode_into_libs
=yes
235 # Flag to hardcode $libdir into a binary during linking.
236 # This must work even if $libdir does not exist.
237 hardcode_libdir_flag_spec
="\${wl}--rpath \${wl}\$libdir"
239 # Whether we need a single -rpath flag with a separated argument.
240 hardcode_libdir_separator
=""
242 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
246 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
250 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
251 # the resulting binary.
252 hardcode_shlibpath_var
=unsupported
254 # Variables whose values should be saved in libtool wrapper scripts and
255 # restored at relink time.
256 variables_saved_for_relink
="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
258 # Whether libtool must link a program against all its dependency libraries.
259 link_all_deplibs
=unknown
261 # Compile-time system search path for libraries
262 sys_lib_search_path_spec
="/lib /usr/lib /usr/local/lib"
264 # Run-time system search path for libraries
265 sys_lib_dlsearch_path_spec
="/lib /usr/lib"
267 # Fix the shell variable $srcfile for the compiler.
270 # Set to yes if exported symbols are required.
271 always_export_symbols
=no
273 # The commands to list exported symbols.
274 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
276 # The commands to extract the exported symbol list from a shared archive.
277 extract_expsyms_cmds
=""
279 # Symbols that should not be listed in the preloaded symbols.
280 exclude_expsyms
="_GLOBAL_OFFSET_TABLE_"
282 # Symbols that must always be exported.
285 # ### END LIBTOOL CONFIG
287 # ltmain.sh - Provide generalized library-building support services.
288 # NOTE: Changing this file will not affect anything until you rerun configure.
290 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
291 # Free Software Foundation, Inc.
292 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
294 # This program is free software; you can redistribute it and/or modify
295 # it under the terms of the GNU General Public License as published by
296 # the Free Software Foundation; either version 2 of the License, or
297 # (at your option) any later version.
299 # This program is distributed in the hope that it will be useful, but
300 # WITHOUT ANY WARRANTY; without even the implied warranty of
301 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
302 # General Public License for more details.
304 # You should have received a copy of the GNU General Public License
305 # along with this program; if not, write to the Free Software
306 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
308 # As a special exception to the GNU General Public License, if you
309 # distribute this file as part of a program that contains a
310 # configuration script generated by Autoconf, you may include it under
311 # the same distribution terms that you use for the rest of that program.
313 # Check that we have a working $echo.
314 if test "X$1" = X--no-reexec
; then
315 # Discard the --no-reexec flag, and continue.
317 elif test "X$1" = X--fallback-echo
; then
318 # Avoid inline document here, it may be left over
320 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
321 # Yippee, $echo works!
324 # Restart under the correct shell, and then maybe $echo will work.
325 exec $SHELL "$0" --no-reexec ${1+"$@"}
328 if test "X$1" = X--fallback-echo
; then
329 # used as fallback echo
337 # The name of this program.
338 progname
=`$echo "$0" | sed 's%^.*/%%'`
345 TIMESTAMP
=" (1.922.2.54 2001/09/11 03:33:37)"
348 help="Try \`$progname --help' for more information."
349 magic
="%%%MAGIC variable%%%"
354 # Sed substitution that helps us do robust quoting. It backslashifies
355 # metacharacters that are still active within double-quoted strings.
356 Xsed
='sed -e 1s/^X//'
357 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
359 NL2SP
='tr \015\012 \040\040'
362 # Only set LANG and LC_ALL to C if already set.
363 # These must not be set unconditionally because not all systems understand
364 # e.g. LANG=C (notably SCO).
365 # We save the old values to restore during execute mode.
366 if test "${LC_ALL+set}" = set; then
367 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
369 if test "${LANG+set}" = set; then
370 save_LANG
="$LANG"; LANG
=C
; export LANG
373 # Make sure IFS has a sensible default
376 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
377 echo "$modename: not configured to build any kind of library" 1>&2
378 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
391 lo2o
="s/\\.lo\$/.${objext}/"
392 o2lo
="s/\\.${objext}\$/.lo/"
394 # Parse our command line options once, thoroughly.
401 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
405 # If the previous option needs an argument, assign it.
406 if test -n "$prev"; then
409 execute_dlfiles
="$execute_dlfiles $arg"
421 # Have we seen a non-optional argument yet?
428 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
433 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
438 echo "$progname: enabling shell trace mode"
448 if test "$build_libtool_libs" = yes; then
449 echo "enable shared libraries"
451 echo "disable shared libraries"
453 if test "$build_old_libs" = yes; then
454 echo "enable static libraries"
456 echo "disable static libraries"
461 --finish) mode
="finish" ;;
463 --mode) prevopt
="--mode" prev
=mode
;;
464 --mode=*) mode
="$optarg" ;;
466 --preserve-dup-deps) duplicate_deps
="yes" ;;
478 $echo "$modename: unrecognized option \`$arg'" 1>&2
490 if test -n "$prevopt"; then
491 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
496 # If this variable is set in any of the actions, the command in it
497 # will be execed at the end. This prevents here-documents from being
498 # left over by shells.
501 if test -z "$show_help"; then
503 # Infer the operation mode.
504 if test -z "$mode"; then
506 *cc |
*++ | gcc
* |
*-gcc*)
518 *db |
*dbx |
*strace |
*truss
)
528 # If we have no mode, but dlfiles were specified, then do execute mode.
529 test -n "$execute_dlfiles" && mode
=execute
531 # Just use the default operation mode.
532 if test -z "$mode"; then
533 if test -n "$nonopt"; then
534 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
536 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
543 # Only execute mode is allowed to have -dlopen flags.
544 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
545 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
550 # Change the help message to a mode-specific one.
552 help="Try \`$modename --help --mode=$mode' for more information."
554 # These modes are in order of execution frequency so that they run quickly.
556 # libtool compile mode
558 modename
="$modename: compile"
559 # Get the compilation command and the source file.
572 # Aesthetically quote the previous argument.
574 lastarg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
577 # Double-quote args containing other shell metacharacters.
578 # Many Bourne shells cannot handle close brackets correctly
579 # in scan sets, so we specify it separately.
580 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
585 # Add the previous argument to base_compile.
586 if test -z "$base_compile"; then
587 base_compile
="$lastarg"
589 base_compile
="$base_compile $lastarg"
595 # Accept any command-line options.
598 if test "$user_target" != "no"; then
599 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
626 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
628 save_ifs
="$IFS"; IFS
=','
632 # Double-quote args containing other shell metacharacters.
633 # Many Bourne shells cannot handle close brackets correctly
634 # in scan sets, so we specify it separately.
636 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
640 lastarg
="$lastarg $arg"
643 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
645 # Add the arguments to base_compile.
646 if test -z "$base_compile"; then
647 base_compile
="$lastarg"
649 base_compile
="$base_compile $lastarg"
657 # The next one is the -o target name
662 # We got the output file
669 # Accept the current argument as the source file.
673 # Aesthetically quote the previous argument.
675 # Backslashify any backslashes, double quotes, and dollar signs.
676 # These are the only characters that are still specially
677 # interpreted inside of double-quoted scrings.
678 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
680 # Double-quote args containing other shell metacharacters.
681 # Many Bourne shells cannot handle close brackets correctly
682 # in scan sets, so we specify it separately.
684 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
685 lastarg
="\"$lastarg\""
689 # Add the previous argument to base_compile.
690 if test -z "$base_compile"; then
691 base_compile
="$lastarg"
693 base_compile
="$base_compile $lastarg"
701 # Get the name of the library object.
702 libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
705 $echo "$modename: you must specify a target with \`-o'" 1>&2
710 # Recognize several different file suffixes.
711 # If the user specifies -o file.o, it is replaced with file.lo
726 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
729 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
731 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
736 if test -z "$base_compile"; then
737 $echo "$modename: you must specify a compilation command" 1>&2
742 # Delete any leftover library objects.
743 if test "$build_old_libs" = yes; then
744 removelist
="$obj $libobj"
750 trap "$run $rm $removelist; exit 1" 1 2 15
752 # On Cygwin there's no "real" PIC flag so we must build both object types
754 cygwin
* | mingw
* | pw32
* | os2
*)
758 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
759 # non-PIC code in shared libraries is not supported
763 # Calculate the filename of the output object if compiler does
764 # not support -o with -c
765 if test "$compiler_c_o" = no
; then
766 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
767 lockfile
="$output_obj.lock"
768 removelist
="$removelist $output_obj $lockfile"
769 trap "$run $rm $removelist; exit 1" 1 2 15
775 # Lock this critical section if it is needed
776 # We use this script file to make the link, it avoids creating a new file
777 if test "$need_locks" = yes; then
778 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
779 $show "Waiting for $lockfile to be removed"
782 elif test "$need_locks" = warn
; then
783 if test -f "$lockfile"; then
785 *** ERROR, $lockfile exists and contains:
786 `cat $lockfile 2>/dev/null`
788 This indicates that another process is trying to use the same
789 temporary object file, and libtool could not work around it because
790 your compiler does not support \`-c' and \`-o' together. If you
791 repeat this compilation, it may succeed, by chance, but you had better
792 avoid parallel builds (make -j) in this platform, or get a better
798 echo $srcfile > "$lockfile"
801 if test -n "$fix_srcfile_path"; then
802 eval srcfile
=\"$fix_srcfile_path\"
805 # Only build a PIC object if we are building libtool libraries.
806 if test "$build_libtool_libs" = yes; then
807 # Without this assignment, base_compile gets emptied.
808 fbsd_hideous_sh_bug
=$base_compile
810 if test "$pic_mode" != no
; then
811 # All platforms use -DPIC, to notify preprocessed assembler code.
812 command="$base_compile $srcfile $pic_flag -DPIC"
814 # Don't build PIC code
815 command="$base_compile $srcfile"
817 if test "$build_old_libs" = yes; then
819 dir
=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
820 if test "X$dir" = "X$libobj"; then
825 libobj
="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
827 if test -d "$dir"; then
834 if test $status -ne 0 && test ! -d $dir; then
839 if test "$compiler_o_lo" = yes; then
841 command="$command -o $output_obj"
842 elif test "$compiler_c_o" = yes; then
844 command="$command -o $output_obj"
847 $run $rm "$output_obj"
849 if $run eval "$command"; then :
851 test -n "$output_obj" && $run $rm $removelist
855 if test "$need_locks" = warn
&&
856 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
858 *** ERROR, $lockfile contains:
859 `cat $lockfile 2>/dev/null`
861 but it should contain:
864 This indicates that another process is trying to use the same
865 temporary object file, and libtool could not work around it because
866 your compiler does not support \`-c' and \`-o' together. If you
867 repeat this compilation, it may succeed, by chance, but you had better
868 avoid parallel builds (make -j) in this platform, or get a better
875 # Just move the object if needed, then go on to compile the next one
876 if test x
"$output_obj" != x
"$libobj"; then
877 $show "$mv $output_obj $libobj"
878 if $run $mv $output_obj $libobj; then :
886 # If we have no pic_flag, then copy the object into place and finish.
887 if (test -z "$pic_flag" ||
test "$pic_mode" != default
) &&
888 test "$build_old_libs" = yes; then
889 # Rename the .lo from within objdir to obj
890 if test -f $obj; then
895 $show "$mv $libobj $obj"
896 if $run $mv $libobj $obj; then :
903 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
904 if test "X$xdir" = "X$obj"; then
909 baseobj
=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
910 libobj
=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
911 # Now arrange that obj and lo_libobj become the same file
912 $show "(cd $xdir && $LN_S $baseobj $libobj)"
913 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
914 # Unlock the critical section if it was locked
915 if test "$need_locks" != no
; then
926 # Allow error messages only from the first compilation.
927 suppress_output
=' >/dev/null 2>&1'
930 # Only build a position-dependent object if we build old libraries.
931 if test "$build_old_libs" = yes; then
932 if test "$pic_mode" != yes; then
933 # Don't build PIC code
934 command="$base_compile $srcfile"
936 # All platforms use -DPIC, to notify preprocessed assembler code.
937 command="$base_compile $srcfile $pic_flag -DPIC"
939 if test "$compiler_c_o" = yes; then
940 command="$command -o $obj"
944 # Suppress compiler output if we already did a PIC compilation.
945 command="$command$suppress_output"
946 $run $rm "$output_obj"
948 if $run eval "$command"; then :
954 if test "$need_locks" = warn
&&
955 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
957 *** ERROR, $lockfile contains:
958 `cat $lockfile 2>/dev/null`
960 but it should contain:
963 This indicates that another process is trying to use the same
964 temporary object file, and libtool could not work around it because
965 your compiler does not support \`-c' and \`-o' together. If you
966 repeat this compilation, it may succeed, by chance, but you had better
967 avoid parallel builds (make -j) in this platform, or get a better
974 # Just move the object if needed
975 if test x
"$output_obj" != x
"$obj"; then
976 $show "$mv $output_obj $obj"
977 if $run $mv $output_obj $obj; then :
985 # Create an invalid libtool object if no PIC, so that we do not
986 # accidentally link it into a program.
987 if test "$build_libtool_libs" != yes; then
988 $show "echo timestamp > $libobj"
989 $run eval "echo timestamp > \$libobj" ||
exit $?
991 # Move the .lo from within objdir
992 $show "$mv $libobj $lo_libobj"
993 if $run $mv $libobj $lo_libobj; then :
1002 # Unlock the critical section if it was locked
1003 if test "$need_locks" != no
; then
1004 $run $rm "$lockfile"
1012 modename
="$modename: link"
1014 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1015 # It is impossible to link a dll without this setting, and
1016 # we shouldn't force the makefile maintainer to figure out
1017 # which system we are compiling for in order to pass an extra
1018 # flag for every libtool invokation.
1019 # allow_undefined=no
1021 # FIXME: Unfortunately, there are problems with the above when trying
1022 # to make a dll which has undefined symbols, in which case not
1023 # even a static library is built. For now, we need to specify
1024 # -no-undefined on the libtool link line when we can be certain
1025 # that all symbols are satisfied, otherwise we get a static library.
1032 libtool_args
="$nonopt"
1033 compile_command
="$nonopt"
1034 finalize_command
="$nonopt"
1047 lib_search_path
=`pwd`
1056 export_symbols_regex
=
1063 prefer_static_libs
=no
1075 # We need to know -static, to get the right output filenames.
1079 -all-static |
-static)
1080 if test "X$arg" = "X-all-static"; then
1081 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1082 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1084 if test -n "$link_static_flag"; then
1085 dlopen_self
=$dlopen_self_static
1088 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1089 dlopen_self
=$dlopen_self_static
1092 build_libtool_libs
=no
1094 prefer_static_libs
=yes
1100 # See if our shared archives depend on static archives.
1101 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1103 # Go through the arguments, transforming them on the way.
1104 while test $# -gt 0; do
1108 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1109 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1113 libtool_args
="$libtool_args $qarg"
1115 # If the previous option needs an argument, assign it.
1116 if test -n "$prev"; then
1119 compile_command
="$compile_command @OUTPUT@"
1120 finalize_command
="$finalize_command @OUTPUT@"
1126 if test "$preload" = no
; then
1127 # Add the symbol object into the linking commands.
1128 compile_command
="$compile_command @SYMFILE@"
1129 finalize_command
="$finalize_command @SYMFILE@"
1133 *.la |
*.lo
) ;; # We handle these cases below.
1135 if test "$dlself" = no
; then
1143 if test "$prev" = dlprefiles
; then
1145 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1155 if test "$prev" = dlfiles
; then
1156 dlfiles
="$dlfiles $arg"
1158 dlprefiles
="$dlprefiles $arg"
1166 export_symbols
="$arg"
1167 if test ! -f "$arg"; then
1168 $echo "$modename: symbol file \`$arg' does not exist"
1175 export_symbols_regex
="$arg"
1180 inst_prefix_dir
="$arg"
1190 # We need an absolute path.
1192 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1194 $echo "$modename: only absolute run-paths are allowed" 1>&2
1198 if test "$prev" = rpath
; then
1201 *) rpath
="$rpath $arg" ;;
1206 *) xrpath
="$xrpath $arg" ;;
1213 compiler_flags
="$compiler_flags $qarg"
1215 compile_command
="$compile_command $qarg"
1216 finalize_command
="$finalize_command $qarg"
1220 linker_flags
="$linker_flags $qarg"
1221 compiler_flags
="$compiler_flags $wl$qarg"
1223 compile_command
="$compile_command $wl$qarg"
1224 finalize_command
="$finalize_command $wl$qarg"
1228 eval "$prev=\"\$arg\""
1239 if test -n "$link_static_flag"; then
1240 compile_command
="$compile_command $link_static_flag"
1241 finalize_command
="$finalize_command $link_static_flag"
1247 # FIXME: remove this flag sometime in the future.
1248 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1272 -export-symbols |
-export-symbols-regex)
1273 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1274 $echo "$modename: more than one -exported-symbols argument is not allowed"
1277 if test "X$arg" = "X-export-symbols"; then
1290 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1291 # so, if we see these flags be careful not to treat them like -L
1293 case $with_gcc/$host in
1295 compile_command
="$compile_command $arg"
1296 finalize_command
="$finalize_command $arg"
1303 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1304 # We need an absolute path.
1306 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1308 absdir
=`cd "$dir" && pwd`
1309 if test -z "$absdir"; then
1310 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1319 deplibs
="$deplibs -L$dir"
1320 lib_search_path
="$lib_search_path $dir"
1324 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1325 case :$dllsearchpath: in
1327 *) dllsearchpath
="$dllsearchpath:$dir";;
1335 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1337 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1338 # These systems don't actually have a C or math library (as such)
1341 *-*-mingw* |
*-*-os2*)
1342 # These systems don't actually have a C library (as such)
1343 test "X$arg" = "X-lc" && continue
1346 # Do not include libc due to us having libc/libc_r.
1347 test "X$arg" = "X-lc" && continue
1350 elif test "X$arg" = "X-lc_r"; then
1353 # Do not include libc_r directly, use -pthread flag.
1358 deplibs
="$deplibs $arg"
1374 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1375 # The PATH hackery in wrapper scripts is required on Windows
1376 # in order for the loader to find any dlls it needs.
1377 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1378 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1381 *) no_install
=yes ;;
1409 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1410 # We need an absolute path.
1412 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1414 $echo "$modename: only absolute run-paths are allowed" 1>&2
1420 *) xrpath
="$xrpath $dir" ;;
1426 # The effects of -static are defined in a previous loop.
1427 # We used to do the same as -all-static on platforms that
1428 # didn't have a PIC flag, but the assumption that the effects
1429 # would be equivalent was wrong. It would break on at least
1430 # Digital Unix and AIX.
1445 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1447 save_ifs
="$IFS"; IFS
=','
1448 for flag
in $args; do
1451 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1456 compiler_flags
="$compiler_flags $flag"
1459 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1463 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1465 save_ifs
="$IFS"; IFS
=','
1466 for flag
in $args; do
1469 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1474 compiler_flags
="$compiler_flags $wl$flag"
1475 linker_flags
="$linker_flags $flag"
1478 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1491 # Some other compiler flag.
1493 # Unknown arguments in both finalize_command and compile_command need
1494 # to be aesthetically quoted because they are evaled later.
1495 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1497 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1504 # A library or standard object.
1505 if test "$prev" = dlfiles
; then
1506 # This file was specified with -dlopen.
1507 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1508 dlfiles
="$dlfiles $arg"
1512 # If libtool objects are unsupported, then we need to preload.
1517 if test "$prev" = dlprefiles
; then
1518 # Preload the old-style object.
1519 dlprefiles
="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1523 *.lo
) libobjs
="$libobjs $arg" ;;
1524 *) objs
="$objs $arg" ;;
1531 deplibs
="$deplibs $arg"
1532 old_deplibs
="$old_deplibs $arg"
1537 # A libtool-controlled library.
1539 if test "$prev" = dlfiles
; then
1540 # This library was specified with -dlopen.
1541 dlfiles
="$dlfiles $arg"
1543 elif test "$prev" = dlprefiles
; then
1544 # The library was specified with -dlpreopen.
1545 dlprefiles
="$dlprefiles $arg"
1548 deplibs
="$deplibs $arg"
1553 # Some other compiler argument.
1555 # Unknown arguments in both finalize_command and compile_command need
1556 # to be aesthetically quoted because they are evaled later.
1557 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1559 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1566 # Now actually substitute the argument into the commands.
1567 if test -n "$arg"; then
1568 compile_command
="$compile_command $arg"
1569 finalize_command
="$finalize_command $arg"
1571 done # argument parsing loop
1573 if test -n "$prev"; then
1574 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1579 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1580 eval arg
=\"$export_dynamic_flag_spec\"
1581 compile_command
="$compile_command $arg"
1582 finalize_command
="$finalize_command $arg"
1585 # calculate the name of the file, without its directory
1586 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1587 libobjs_save
="$libobjs"
1589 if test -n "$shlibpath_var"; then
1590 # get the directories listed in $shlibpath_var
1591 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1595 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1596 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1598 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1599 if test "X$output_objdir" = "X$output"; then
1600 output_objdir
="$objdir"
1602 output_objdir
="$output_objdir/$objdir"
1604 # Create the object directory.
1605 if test ! -d "$output_objdir"; then
1606 $show "$mkdir $output_objdir"
1607 $run $mkdir $output_objdir
1609 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1614 # Determine the type of output
1617 $echo "$modename: you must specify an output file" 1>&2
1621 *.
$libext) linkmode
=oldlib
;;
1622 *.lo |
*.
$objext) linkmode
=obj
;;
1623 *.la
) linkmode
=lib
;;
1624 *) linkmode
=prog
;; # Anything else should be a program.
1629 # Find all interdependent deplibs by searching for libraries
1630 # that are linked more than once (e.g. -la -lb -la)
1631 for deplib
in $deplibs; do
1632 if test "X$duplicate_deps" = "Xyes" ; then
1634 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1637 libs
="$libs $deplib"
1640 if test "$linkmode" = lib
; then
1641 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1643 # Compute libraries that are listed more than once in $predeps
1644 # $postdeps and mark them as special (i.e., whose duplicates are
1645 # not to be eliminated).
1647 if test "X$duplicate_deps" = "Xyes" ; then
1648 for pre_post_dep
in $predeps $postdeps; do
1649 case "$pre_post_deps " in
1650 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1652 pre_post_deps
="$pre_post_deps $pre_post_dep"
1661 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1662 notinst_deplibs
= # not-installed libtool libraries
1663 notinst_path
= # paths that contain not-installed libtool libraries
1667 for file in $dlfiles $dlprefiles; do
1671 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1683 passes
="conv scan dlopen dlpreopen link"
1688 for pass
in $passes; do
1689 if test "$linkmode" = prog
; then
1690 # Determine which files to process
1694 save_deplibs
="$deplibs" # Collect dlpreopened libraries
1697 dlpreopen
) libs
="$dlprefiles" ;;
1698 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1701 for deplib
in $libs; do
1706 if test "$linkmode" = oldlib
&& test "$linkmode" = obj
; then
1707 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1710 if test "$pass" = conv
; then
1711 deplibs
="$deplib $deplibs"
1714 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1715 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1716 # Search the libtool library
1717 lib
="$searchdir/lib${name}.la"
1718 if test -f "$lib"; then
1723 if test "$found" != yes; then
1724 # deplib doesn't seem to be a libtool library
1725 if test "$linkmode,$pass" = "prog,link"; then
1726 compile_deplibs
="$deplib $compile_deplibs"
1727 finalize_deplibs
="$deplib $finalize_deplibs"
1729 deplibs
="$deplib $deplibs"
1730 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1738 deplibs
="$deplib $deplibs"
1739 test "$pass" = conv
&& continue
1740 newdependency_libs
="$deplib $newdependency_libs"
1741 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1744 if test "$pass" = conv
; then
1745 deplibs
="$deplib $deplibs"
1748 if test "$pass" = scan
; then
1749 deplibs
="$deplib $deplibs"
1750 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1752 compile_deplibs
="$deplib $compile_deplibs"
1753 finalize_deplibs
="$deplib $finalize_deplibs"
1757 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1763 if test "$pass" = link
; then
1764 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1765 # Make sure the xrpath contains only unique directories.
1768 *) xrpath
="$xrpath $dir" ;;
1771 deplibs
="$deplib $deplibs"
1774 *.la
) lib
="$deplib" ;;
1776 if test "$pass" = conv
; then
1777 deplibs
="$deplib $deplibs"
1782 if test "$deplibs_check_method" != pass_all
; then
1784 echo "*** Warning: This library needs some functionality provided by $deplib."
1785 echo "*** I have the capability to make that library automatically link in when"
1786 echo "*** you link to this library. But I can only do this if you have a"
1787 echo "*** shared version of the library, which you do not appear to have."
1790 echo "*** Warning: Linking the shared library $output against the"
1791 echo "*** static library $deplib is not portable!"
1792 deplibs
="$deplib $deplibs"
1797 if test "$pass" != link
; then
1798 deplibs
="$deplib $deplibs"
1800 compile_deplibs
="$deplib $compile_deplibs"
1801 finalize_deplibs
="$deplib $finalize_deplibs"
1808 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1809 # If there is no dlopen support or we're linking statically,
1810 # we need to preload.
1811 newdlprefiles
="$newdlprefiles $deplib"
1812 compile_deplibs
="$deplib $compile_deplibs"
1813 finalize_deplibs
="$deplib $finalize_deplibs"
1815 newdlfiles
="$newdlfiles $deplib"
1824 if test "$found" = yes ||
test -f "$lib"; then :
1826 $echo "$modename: cannot find the library \`$lib'" 1>&2
1830 # Check to see that this really is a libtool archive.
1831 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1833 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1837 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1838 test "X$ladir" = "X$lib" && ladir
="."
1846 # If the library was installed with an old release of libtool,
1847 # it will not redefine variable installed.
1852 */* |
*\\*) .
$lib ;;
1856 if test "$linkmode,$pass" = "lib,link" ||
1857 test "$linkmode,$pass" = "prog,scan" ||
1858 { test "$linkmode" = oldlib
&& test "$linkmode" = obj
; }; then
1859 # Add dl[pre]opened files of deplib
1860 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
1861 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
1864 if test "$pass" = conv
; then
1865 # Only check for convenience libraries
1866 deplibs
="$lib $deplibs"
1867 if test -z "$libdir"; then
1868 if test -z "$old_library"; then
1869 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1872 # It is a libtool convenience library, so add in its objects.
1873 convenience
="$convenience $ladir/$objdir/$old_library"
1874 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1876 for deplib
in $dependency_libs; do
1877 deplibs
="$deplib $deplibs"
1878 if test "X$duplicate_deps" = "Xyes" ; then
1879 case "$tmp_libs " in
1880 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1883 tmp_libs
="$tmp_libs $deplib"
1885 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
1886 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1892 # Get the name of the library we link against.
1894 for l
in $old_library $library_names; do
1897 if test -z "$linklib"; then
1898 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1902 # This library was specified with -dlopen.
1903 if test "$pass" = dlopen
; then
1904 if test -z "$libdir"; then
1905 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1908 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1909 # If there is no dlname, no dlopen support or we're linking
1910 # statically, we need to preload.
1911 dlprefiles
="$dlprefiles $lib"
1913 newdlfiles
="$newdlfiles $lib"
1918 # We need an absolute path.
1920 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1922 abs_ladir
=`cd "$ladir" && pwd`
1923 if test -z "$abs_ladir"; then
1924 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1925 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1930 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1932 # Find the relevant object directory and library name.
1933 if test "X$installed" = Xyes
; then
1934 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1935 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1944 dir
="$ladir/$objdir"
1945 absdir
="$abs_ladir/$objdir"
1946 # Remove this search path later
1947 notinst_path
="$notinst_path $abs_ladir"
1948 fi # $installed = yes
1949 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1951 # This library was specified with -dlpreopen.
1952 if test "$pass" = dlpreopen
; then
1953 if test -z "$libdir"; then
1954 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1957 # Prefer using a static library (so that no silly _DYNAMIC symbols
1958 # are required to link).
1959 if test -n "$old_library"; then
1960 newdlprefiles
="$newdlprefiles $dir/$old_library"
1961 # Otherwise, use the dlname, so that lt_dlopen finds it.
1962 elif test -n "$dlname"; then
1963 newdlprefiles
="$newdlprefiles $dir/$dlname"
1965 newdlprefiles
="$newdlprefiles $dir/$linklib"
1967 fi # $pass = dlpreopen
1969 if test -z "$libdir"; then
1970 # Link the convenience library
1971 if test "$linkmode" = lib
; then
1972 deplibs
="$dir/$old_library $deplibs"
1973 elif test "$linkmode,$pass" = "prog,link"; then
1974 compile_deplibs
="$dir/$old_library $compile_deplibs"
1975 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
1977 deplibs
="$lib $deplibs"
1982 if test "$linkmode" = prog
&& test "$pass" != link
; then
1983 newlib_search_path
="$newlib_search_path $ladir"
1984 deplibs
="$lib $deplibs"
1987 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
1988 test "$build_libtool_libs" = no
; then
1993 for deplib
in $dependency_libs; do
1995 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1997 # Need to link against all dependency_libs?
1998 if test "$linkalldeplibs" = yes; then
1999 deplibs
="$deplib $deplibs"
2001 # Need to hardcode shared library paths
2002 # or/and link against static libraries
2003 newdependency_libs
="$deplib $newdependency_libs"
2005 if test "X$duplicate_deps" = "Xyes" ; then
2006 case "$tmp_libs " in
2007 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2010 tmp_libs
="$tmp_libs $deplib"
2013 fi # $linkmode = prog...
2015 link_static
=no
# Whether the deplib will be linked statically
2016 if test -n "$library_names" &&
2017 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2018 # Link against this shared library
2020 if test "$linkmode,$pass" = "prog,link" ||
2021 { test "$linkmode" = lib
&& test "$hardcode_into_libs" = yes; }; then
2022 # Hardcode the library path.
2023 # Skip directories that are in the system default run-time
2025 case " $sys_lib_dlsearch_path " in
2028 case "$compile_rpath " in
2030 *) compile_rpath
="$compile_rpath $absdir"
2034 case " $sys_lib_dlsearch_path " in
2037 case "$finalize_rpath " in
2039 *) finalize_rpath
="$finalize_rpath $libdir"
2043 if test "$linkmode" = prog
; then
2044 # We need to hardcode the library path
2045 if test -n "$shlibpath_var"; then
2046 # Make sure the rpath contains only unique directories.
2047 case "$temp_rpath " in
2050 *) temp_rpath
="$temp_rpath $dir" ;;
2054 fi # $linkmode,$pass = prog,link...
2056 if test "$alldeplibs" = yes &&
2057 { test "$deplibs_check_method" = pass_all ||
2058 { test "$build_libtool_libs" = yes &&
2059 test -n "$library_names"; }; }; then
2060 # We only need to search for static libraries
2064 if test "$installed" = no
; then
2065 notinst_deplibs
="$notinst_deplibs $lib"
2069 if test -n "$old_archive_from_expsyms_cmds"; then
2070 # figure out the soname
2071 set dummy
$library_names
2074 libname
=`eval \\$echo \"$libname_spec\"`
2075 # use dlname if we got it. it's perfectly good, no?
2076 if test -n "$dlname"; then
2078 elif test -n "$soname_spec"; then
2082 major
=`expr $current - $age`
2086 eval soname
=\"$soname_spec\"
2091 # Make a new name for the extract_expsyms_cmds to use
2093 soname
=`echo $soroot | sed -e 's/^.*\///'`
2094 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2096 # If the library has no export list, then create one now
2097 if test -f "$output_objdir/$soname-def"; then :
2099 $show "extracting exported symbol list from \`$soname'"
2100 save_ifs
="$IFS"; IFS
='~'
2101 eval cmds
=\"$extract_expsyms_cmds\"
2102 for cmd
in $cmds; do
2105 $run eval "$cmd" ||
exit $?
2111 if test -f "$output_objdir/$newlib"; then :; else
2112 $show "generating import library for \`$soname'"
2113 save_ifs
="$IFS"; IFS
='~'
2114 eval cmds
=\"$old_archive_from_expsyms_cmds\"
2115 for cmd
in $cmds; do
2118 $run eval "$cmd" ||
exit $?
2122 # make sure the library variables are pointing to the new library
2125 fi # test -n "$old_archive_from_expsyms_cmds"
2127 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2132 case $hardcode_action in
2133 immediate | unsupported
)
2134 if test "$hardcode_direct" = no
; then
2136 elif test "$hardcode_minus_L" = no
; then
2138 *-*-sunos*) add_shlibpath
="$dir" ;;
2142 elif test "$hardcode_shlibpath_var" = no
; then
2143 add_shlibpath
="$dir"
2150 if test "$hardcode_direct" = yes; then
2152 elif test "$hardcode_minus_L" = yes; then
2155 elif test "$hardcode_shlibpath_var" = yes; then
2156 add_shlibpath
="$dir"
2165 if test "$lib_linked" != yes; then
2166 $echo "$modename: configuration error: unsupported hardcode properties"
2170 if test -n "$add_shlibpath"; then
2171 case :$compile_shlibpath: in
2172 *":$add_shlibpath:"*) ;;
2173 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2176 if test "$linkmode" = prog
; then
2177 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2178 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2180 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2181 test -n "$add" && deplibs
="$add $deplibs"
2182 if test "$hardcode_direct" != yes && \
2183 test "$hardcode_minus_L" != yes && \
2184 test "$hardcode_shlibpath_var" = yes; then
2185 case :$finalize_shlibpath: in
2187 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2193 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2197 # Finalize command for both is simple: just hardcode it.
2198 if test "$hardcode_direct" = yes; then
2199 add
="$libdir/$linklib"
2200 elif test "$hardcode_minus_L" = yes; then
2201 # Try looking first in the location we're being installed to.
2203 if test -n "$inst_prefix_dir"; then
2206 add_dir
="-L$inst_prefix_dir$libdir"
2210 add_dir
="$add_dir -L$libdir"
2212 elif test "$hardcode_shlibpath_var" = yes; then
2213 case :$finalize_shlibpath: in
2215 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2219 # We cannot seem to hardcode it, guess we'll fake it.
2220 # Try looking first in the location we're being installed to.
2222 if test -n "$inst_prefix_dir"; then
2225 add_dir
="-L$inst_prefix_dir$libdir"
2229 add_dir
="$add_dir -L$libdir"
2233 if test "$linkmode" = prog
; then
2234 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2235 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2237 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2238 test -n "$add" && deplibs
="$add $deplibs"
2241 elif test "$linkmode" = prog
; then
2242 if test "$alldeplibs" = yes &&
2243 { test "$deplibs_check_method" = pass_all ||
2244 { test "$build_libtool_libs" = yes &&
2245 test -n "$library_names"; }; }; then
2246 # We only need to search for static libraries
2250 # Try to link the static library
2251 # Here we assume that one of hardcode_direct or hardcode_minus_L
2252 # is not unsupported. This is valid on all known static and
2254 if test "$hardcode_direct" != unsupported
; then
2255 test -n "$old_library" && linklib
="$old_library"
2256 compile_deplibs
="$dir/$linklib $compile_deplibs"
2257 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2259 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2260 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2262 elif test "$build_libtool_libs" = yes; then
2263 # Not a shared library
2264 if test "$deplibs_check_method" != pass_all
; then
2265 # We're trying link a shared library against a static one
2266 # but the system doesn't support it.
2268 # Just print a warning and add the library to dependency_libs so
2269 # that the program can be linked against the static library.
2271 echo "*** Warning: This library needs some functionality provided by $lib."
2272 echo "*** I have the capability to make that library automatically link in when"
2273 echo "*** you link to this library. But I can only do this if you have a"
2274 echo "*** shared version of the library, which you do not appear to have."
2275 if test "$module" = yes; then
2276 echo "*** Therefore, libtool will create a static module, that should work "
2277 echo "*** as long as the dlopening application is linked with the -dlopen flag."
2278 if test -z "$global_symbol_pipe"; then
2280 echo "*** However, this would only work if libtool was able to extract symbol"
2281 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2282 echo "*** not find such a program. So, this module is probably useless."
2283 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2285 if test "$build_old_libs" = no
; then
2286 build_libtool_libs
=module
2289 build_libtool_libs
=no
2293 convenience
="$convenience $dir/$old_library"
2294 old_convenience
="$old_convenience $dir/$old_library"
2295 deplibs
="$dir/$old_library $deplibs"
2298 fi # link shared/static library?
2300 if test "$linkmode" = lib
; then
2301 if test -n "$dependency_libs" &&
2302 { test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes ||
2303 test "$link_static" = yes; }; then
2304 # Extract -R from dependency_libs
2306 for libdir
in $dependency_libs; do
2308 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2310 *" $temp_xrpath "*) ;;
2311 *) xrpath
="$xrpath $temp_xrpath";;
2313 *) temp_deplibs
="$temp_deplibs $libdir";;
2316 dependency_libs
="$temp_deplibs"
2319 newlib_search_path
="$newlib_search_path $absdir"
2320 # Link against this library
2321 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2322 # ... and its dependency_libs
2324 for deplib
in $dependency_libs; do
2325 newdependency_libs
="$deplib $newdependency_libs"
2326 if test "X$duplicate_deps" = "Xyes" ; then
2327 case "$tmp_libs " in
2328 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2331 tmp_libs
="$tmp_libs $deplib"
2334 if test "$link_all_deplibs" != no
; then
2335 # Add the search paths of all dependency libraries
2336 for deplib
in $dependency_libs; do
2338 -L*) path
="$deplib" ;;
2340 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2341 test "X$dir" = "X$deplib" && dir
="."
2342 # We need an absolute path.
2344 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2346 absdir
=`cd "$dir" && pwd`
2347 if test -z "$absdir"; then
2348 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2353 if grep "^installed=no" $deplib > /dev
/null
; then
2354 path
="-L$absdir/$objdir"
2356 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2357 if test -z "$libdir"; then
2358 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2361 if test "$absdir" != "$libdir"; then
2362 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2369 case " $deplibs " in
2371 *) deplibs
="$deplibs $path" ;;
2374 fi # link_all_deplibs != no
2376 done # for deplib in $libs
2377 if test "$pass" = dlpreopen
; then
2378 # Link the dlpreopened libraries before other libraries
2379 for deplib
in $save_deplibs; do
2380 deplibs
="$deplib $deplibs"
2383 if test "$pass" != dlopen
; then
2384 test "$pass" != scan
&& dependency_libs
="$newdependency_libs"
2385 if test "$pass" != conv
; then
2386 # Make sure lib_search_path contains only unique directories.
2388 for dir
in $newlib_search_path; do
2389 case "$lib_search_path " in
2391 *) lib_search_path
="$lib_search_path $dir" ;;
2397 if test "$linkmode,$pass" != "prog,link"; then
2400 vars
="compile_deplibs finalize_deplibs"
2402 for var
in $vars dependency_libs
; do
2403 # Add libraries to $var in reverse order
2404 eval tmp_libs
=\"\$
$var\"
2406 for deplib
in $tmp_libs; do
2408 -L*) new_libs
="$deplib $new_libs" ;;
2410 case " $specialdeplibs " in
2411 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2413 case " $new_libs " in
2415 *) new_libs
="$deplib $new_libs" ;;
2423 for deplib
in $new_libs; do
2426 case " $tmp_libs " in
2428 *) tmp_libs
="$tmp_libs $deplib" ;;
2431 *) tmp_libs
="$tmp_libs $deplib" ;;
2434 eval $var=\"$tmp_libs\"
2437 if test "$pass" = "conv" &&
2438 { test "$linkmode" = "lib" ||
test "$linkmode" = "prog"; }; then
2439 libs
="$deplibs" # reset libs
2443 if test "$linkmode" = prog
; then
2444 dlfiles
="$newdlfiles"
2445 dlprefiles
="$newdlprefiles"
2450 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2451 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2454 if test -n "$rpath"; then
2455 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2458 if test -n "$xrpath"; then
2459 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2462 if test -n "$vinfo"; then
2463 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2466 if test -n "$release"; then
2467 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2470 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2471 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2474 # Now set the variables for building old libraries.
2475 build_libtool_libs
=no
2477 objs
="$objs$old_deplibs"
2481 # Make sure we only generate libraries of the form `libNAME.la'.
2484 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2485 eval libname
=\"$libname_spec\"
2488 if test "$module" = no
; then
2489 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2493 if test "$need_lib_prefix" != no
; then
2494 # Add the "lib" prefix for modules if required
2495 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2496 eval libname
=\"$libname_spec\"
2498 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2503 if test -n "$objs"; then
2504 if test "$deplibs_check_method" != pass_all
; then
2505 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2509 echo "*** Warning: Linking the shared library $output against the non-libtool"
2510 echo "*** objects $objs is not portable!"
2511 libobjs
="$libobjs $objs"
2515 if test "$dlself" != no
; then
2516 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2520 if test "$#" -gt 2; then
2521 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2526 if test -z "$rpath"; then
2527 if test "$build_libtool_libs" = yes; then
2528 # Building a libtool convenience library.
2530 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2531 build_libtool_libs
=convenience
2535 if test -n "$vinfo"; then
2536 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2539 if test -n "$release"; then
2540 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2544 # Parse the version information argument.
2545 save_ifs
="$IFS"; IFS
=':'
2546 set dummy
$vinfo 0 0 0
2549 if test -n "$8"; then
2550 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2559 # Check that each of the things are valid numbers.
2563 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2564 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2572 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2573 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2581 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2582 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2587 if test "$age" -gt "$current"; then
2588 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2589 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2593 # Calculate the version variables.
2597 case $version_type in
2601 # Like Linux, but with the current version available in
2602 # verstring for coding it into the library header
2603 major
=.
`expr $current - $age`
2604 versuffix
="$major.$age.$revision"
2605 # Darwin ld doesn't like 0 for these options...
2606 minor_current
=`expr $current + 1`
2607 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2612 versuffix
=".$current.$revision";
2617 versuffix
=".$current";
2621 major
=`expr $current - $age + 1`
2622 verstring
="sgi$major.$revision"
2624 # Add in all the interfaces that we are compatible with.
2626 while test "$loop" -ne 0; do
2627 iface
=`expr $revision - $loop`
2628 loop
=`expr $loop - 1`
2629 verstring
="sgi$major.$iface:$verstring"
2632 # Before this point, $major must not contain `.'.
2634 versuffix
="$major.$revision"
2638 major
=.
`expr $current - $age`
2639 versuffix
="$major.$age.$revision"
2643 major
=`expr $current - $age`
2644 versuffix
=".$current.$age.$revision"
2645 verstring
="$current.$age.$revision"
2647 # Add in all the interfaces that we are compatible with.
2649 while test "$loop" -ne 0; do
2650 iface
=`expr $current - $loop`
2651 loop
=`expr $loop - 1`
2652 verstring
="$verstring:${iface}.0"
2655 # Make executables depend on our current version.
2656 verstring
="$verstring:${current}.0"
2661 versuffix
=".$current.$revision"
2665 # Use '-' rather than '.', since we only want one
2666 # extension on DOS 8.3 filesystems.
2667 major
=`expr $current - $age`
2672 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2673 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2678 # Clear the version info if we defaulted, and they specified a release.
2679 if test -z "$vinfo" && test -n "$release"; then
2682 case $version_type in
2684 # we can't check for "0.0" in archive_cmds due to quoting
2685 # problems, so we reset it completely
2692 if test "$need_version" = no
; then
2699 # Remove version info from name if versioning should be avoided
2700 if test "$avoid_version" = yes && test "$need_version" = no
; then
2706 # Check to see if the archive will have undefined symbols.
2707 if test "$allow_undefined" = yes; then
2708 if test "$allow_undefined_flag" = unsupported
; then
2709 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2710 build_libtool_libs
=no
2714 # Don't allow undefined symbols.
2715 allow_undefined_flag
="$no_undefined_flag"
2719 if test "$mode" != relink
; then
2720 # Remove our outputs.
2721 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2722 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.
*
2725 # Now set the variables for building old libraries.
2726 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2727 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2729 # Transform .lo files to .o files.
2730 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2733 # Eliminate all temporary directories.
2734 for path
in $notinst_path; do
2735 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2736 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2737 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2740 if test -n "$xrpath"; then
2741 # If the user specified any rpath flags, then add them.
2743 for libdir
in $xrpath; do
2744 temp_xrpath
="$temp_xrpath -R$libdir"
2745 case "$finalize_rpath " in
2747 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2750 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
2751 dependency_libs
="$temp_xrpath $dependency_libs"
2755 # Make sure dlfiles contains only unique files that won't be dlpreopened
2756 old_dlfiles
="$dlfiles"
2758 for lib
in $old_dlfiles; do
2759 case " $dlprefiles $dlfiles " in
2761 *) dlfiles
="$dlfiles $lib" ;;
2765 # Make sure dlprefiles contains only unique files
2766 old_dlprefiles
="$dlprefiles"
2768 for lib
in $old_dlprefiles; do
2769 case "$dlprefiles " in
2771 *) dlprefiles
="$dlprefiles $lib" ;;
2775 if test "$build_libtool_libs" = yes; then
2776 if test -n "$rpath"; then
2778 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
2779 # these systems don't actually have a c library (as such)!
2781 *-*-rhapsody* |
*-*-darwin1.
[012])
2782 # Rhapsody C library is in the System framework
2783 deplibs
="$deplibs -framework System"
2786 # Don't link with libc until the a.out ld.so is fixed.
2789 # Do not include libc due to us having libc/libc_r.
2792 # Add libc to deplibs on all other systems if necessary.
2793 if test "$build_libtool_need_lc" = "yes"; then
2794 deplibs
="$deplibs -lc"
2800 # Transform deplibs into only deplibs that can be linked in shared.
2802 libname_save
=$libname
2803 release_save
=$release
2804 versuffix_save
=$versuffix
2806 # I'm not sure if I'm treating the release correctly. I think
2807 # release should show up in the -l (ie -lgmp5) so we don't want to
2808 # add it in twice. Is that correct?
2814 case $deplibs_check_method in
2816 # Don't check for shared/static. Everything works.
2817 # This might be a little naive. We might want to check
2818 # whether the library exists or not. But this is on
2819 # osf3 & osf4 and I'm not really sure... Just
2820 # implementing what was already the behaviour.
2824 # This code stresses the "libraries are programs" paradigm to its
2825 # limits. Maybe even breaks it. We compile a program, linking it
2826 # against the deplibs as a proxy for the library. Then we can check
2827 # whether they linked in statically or dynamically with ldd.
2829 cat > conftest.c
<<EOF
2830 int main() { return 0; }
2833 $CC -o conftest conftest.c
$deplibs
2834 if test "$?" -eq 0 ; then
2835 ldd_output
=`ldd conftest`
2836 for i
in $deplibs; do
2837 name
="`expr $i : '-l\(.*\)'`"
2838 # If $name is empty we are operating on a -L argument.
2839 if test -n "$name" && test "$name" != "0"; then
2840 libname
=`eval \\$echo \"$libname_spec\"`
2841 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2842 set dummy
$deplib_matches
2844 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2845 newdeplibs
="$newdeplibs $i"
2849 echo "*** Warning: This library needs some functionality provided by $i."
2850 echo "*** I have the capability to make that library automatically link in when"
2851 echo "*** you link to this library. But I can only do this if you have a"
2852 echo "*** shared version of the library, which you do not appear to have."
2855 newdeplibs
="$newdeplibs $i"
2859 # Error occured in the first compile. Let's try to salvage the situation:
2860 # Compile a seperate program for each library.
2861 for i
in $deplibs; do
2862 name
="`expr $i : '-l\(.*\)'`"
2863 # If $name is empty we are operating on a -L argument.
2864 if test -n "$name" && test "$name" != "0"; then
2866 $CC -o conftest conftest.c
$i
2868 if test "$?" -eq 0 ; then
2869 ldd_output
=`ldd conftest`
2870 libname
=`eval \\$echo \"$libname_spec\"`
2871 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2872 set dummy
$deplib_matches
2874 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2875 newdeplibs
="$newdeplibs $i"
2879 echo "*** Warning: This library needs some functionality provided by $i."
2880 echo "*** I have the capability to make that library automatically link in when"
2881 echo "*** you link to this library. But I can only do this if you have a"
2882 echo "*** shared version of the library, which you do not appear to have."
2887 echo "*** Warning! Library $i is needed by this library but I was not able to"
2888 echo "*** make it link in! You will probably need to install it or some"
2889 echo "*** library that it depends on before this library will be fully"
2890 echo "*** functional. Installing it before continuing would be even better."
2893 newdeplibs
="$newdeplibs $i"
2899 set dummy
$deplibs_check_method
2900 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2901 for a_deplib
in $deplibs; do
2902 name
="`expr $a_deplib : '-l\(.*\)'`"
2903 # If $name is empty we are operating on a -L argument.
2904 if test -n "$name" && test "$name" != "0"; then
2905 libname
=`eval \\$echo \"$libname_spec\"`
2906 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2907 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2908 for potent_lib
in $potential_libs; do
2909 # Follow soft links.
2910 if ls -lLd "$potent_lib" 2>/dev
/null \
2911 |
grep " -> " >/dev
/null
; then
2914 # The statement above tries to avoid entering an
2915 # endless loop below, in case of cyclic links.
2916 # We might still enter an endless loop, since a link
2917 # loop can be closed while we follow links,
2919 potlib
="$potent_lib"
2920 while test -h "$potlib" 2>/dev
/null
; do
2921 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2923 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2924 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2927 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
2929 |
egrep "$file_magic_regex" > /dev
/null
; then
2930 newdeplibs
="$newdeplibs $a_deplib"
2936 if test -n "$a_deplib" ; then
2939 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2940 echo "*** I have the capability to make that library automatically link in when"
2941 echo "*** you link to this library. But I can only do this if you have a"
2942 echo "*** shared version of the library, which you do not appear to have."
2945 # Add a -L argument.
2946 newdeplibs
="$newdeplibs $a_deplib"
2948 done # Gone through all deplibs.
2951 set dummy
$deplibs_check_method
2952 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2953 for a_deplib
in $deplibs; do
2954 name
="`expr $a_deplib : '-l\(.*\)'`"
2955 # If $name is empty we are operating on a -L argument.
2956 if test -n "$name" && test "$name" != "0"; then
2957 libname
=`eval \\$echo \"$libname_spec\"`
2958 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2959 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2960 for potent_lib
in $potential_libs; do
2961 if eval echo \"$potent_lib\" 2>/dev
/null \
2963 |
egrep "$match_pattern_regex" > /dev
/null
; then
2964 newdeplibs
="$newdeplibs $a_deplib"
2970 if test -n "$a_deplib" ; then
2973 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2974 echo "*** I have the capability to make that library automatically link in when"
2975 echo "*** you link to this library. But I can only do this if you have a"
2976 echo "*** shared version of the library, which you do not appear to have."
2979 # Add a -L argument.
2980 newdeplibs
="$newdeplibs $a_deplib"
2982 done # Gone through all deplibs.
2986 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
2987 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2988 grep .
>/dev
/null
; then
2990 if test "X$deplibs_check_method" = "Xnone"; then
2991 echo "*** Warning: inter-library dependencies are not supported in this platform."
2993 echo "*** Warning: inter-library dependencies are not known to be supported."
2995 echo "*** All declared inter-library dependencies are being dropped."
3000 versuffix
=$versuffix_save
3002 release
=$release_save
3003 libname
=$libname_save
3007 *-*-rhapsody* |
*-*-darwin1.
[012])
3008 # On Rhapsody replace the C library is the System framework
3009 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3013 if test "$droppeddeps" = yes; then
3014 if test "$module" = yes; then
3016 echo "*** Warning: libtool could not satisfy all declared inter-library"
3017 echo "*** dependencies of module $libname. Therefore, libtool will create"
3018 echo "*** a static module, that should work as long as the dlopening"
3019 echo "*** application is linked with the -dlopen flag."
3020 if test -z "$global_symbol_pipe"; then
3022 echo "*** However, this would only work if libtool was able to extract symbol"
3023 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3024 echo "*** not find such a program. So, this module is probably useless."
3025 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3027 if test "$build_old_libs" = no
; then
3028 oldlibs
="$output_objdir/$libname.$libext"
3029 build_libtool_libs
=module
3032 build_libtool_libs
=no
3035 echo "*** The inter-library dependencies that have been dropped here will be"
3036 echo "*** automatically added whenever a program is linked with this library"
3037 echo "*** or is declared to -dlopen it."
3039 if test "$allow_undefined" = no
; then
3041 echo "*** Since this library must not contain undefined symbols,"
3042 echo "*** because either the platform does not support them or"
3043 echo "*** it was explicitly requested with -no-undefined,"
3044 echo "*** libtool will only create a static version of it."
3045 if test "$build_old_libs" = no
; then
3046 oldlibs
="$output_objdir/$libname.$libext"
3047 build_libtool_libs
=module
3050 build_libtool_libs
=no
3055 # Done checking deplibs!
3059 # All the library-specific variables (install_libdir is set above).
3064 # Test again, we may have decided not to build it any more
3065 if test "$build_libtool_libs" = yes; then
3066 if test "$hardcode_into_libs" = yes; then
3067 # Hardcode the library paths
3070 rpath
="$finalize_rpath"
3071 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3072 for libdir
in $rpath; do
3073 if test -n "$hardcode_libdir_flag_spec"; then
3074 if test -n "$hardcode_libdir_separator"; then
3075 if test -z "$hardcode_libdirs"; then
3076 hardcode_libdirs
="$libdir"
3078 # Just accumulate the unique libdirs.
3079 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3080 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3083 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3088 eval flag
=\"$hardcode_libdir_flag_spec\"
3089 dep_rpath
="$dep_rpath $flag"
3091 elif test -n "$runpath_var"; then
3092 case "$perm_rpath " in
3094 *) perm_rpath
="$perm_rpath $libdir" ;;
3098 # Substitute the hardcoded libdirs into the rpath.
3099 if test -n "$hardcode_libdir_separator" &&
3100 test -n "$hardcode_libdirs"; then
3101 libdir
="$hardcode_libdirs"
3102 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3104 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3105 # We should set the runpath_var.
3107 for dir
in $perm_rpath; do
3110 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3112 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3115 shlibpath
="$finalize_shlibpath"
3116 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3117 if test -n "$shlibpath"; then
3118 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3121 # Get the real and link names of the library.
3122 eval library_names
=\"$library_names_spec\"
3123 set dummy
$library_names
3127 if test -n "$soname_spec"; then
3128 eval soname
=\"$soname_spec\"
3132 test -z "$dlname" && dlname
=$soname
3134 lib
="$output_objdir/$realname"
3137 linknames
="$linknames $link"
3140 # Ensure that we have .o objects for linkers which dislike .lo
3141 # (e.g. aix) in case we are running --disable-static
3142 for obj
in $libobjs; do
3143 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3144 if test "X$xdir" = "X$obj"; then
3149 baseobj
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3150 oldobj
=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3151 if test ! -f $xdir/$oldobj; then
3152 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3153 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' ||
exit $?
3157 # Use standard objects if they are pic
3158 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3160 # Prepare the list of exported symbols
3161 if test -z "$export_symbols"; then
3162 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3163 $show "generating symbol list for \`$libname.la'"
3164 export_symbols
="$output_objdir/$libname.exp"
3165 $run $rm $export_symbols
3166 eval cmds
=\"$export_symbols_cmds\"
3167 save_ifs
="$IFS"; IFS
='~'
3168 for cmd
in $cmds; do
3171 $run eval "$cmd" ||
exit $?
3174 if test -n "$export_symbols_regex"; then
3175 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3176 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3177 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3178 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3183 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3184 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3187 if test -n "$convenience"; then
3188 if test -n "$whole_archive_flag_spec"; then
3189 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3191 gentop
="$output_objdir/${outputname}x"
3192 $show "${rm}r $gentop"
3193 $run ${rm}r
"$gentop"
3194 $show "mkdir $gentop"
3195 $run mkdir
"$gentop"
3197 if test "$status" -ne 0 && test ! -d "$gentop"; then
3200 generated
="$generated $gentop"
3202 for xlib
in $convenience; do
3203 # Extract the objects.
3205 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3206 *) xabs
=`pwd`"/$xlib" ;;
3208 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3209 xdir
="$gentop/$xlib"
3211 $show "${rm}r $xdir"
3216 if test "$status" -ne 0 && test ! -d "$xdir"; then
3219 $show "(cd $xdir && $AR x $xabs)"
3220 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3222 libobjs
="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3227 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3228 eval flag
=\"$thread_safe_flag_spec\"
3229 linker_flags
="$linker_flags $flag"
3232 # Make a backup of the uninstalled library when relinking
3233 if test "$mode" = relink
; then
3234 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3237 # Do each of the archive commands.
3238 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3239 eval cmds
=\"$archive_expsym_cmds\"
3241 eval cmds
=\"$archive_cmds\"
3243 save_ifs
="$IFS"; IFS
='~'
3244 for cmd
in $cmds; do
3247 $run eval "$cmd" ||
exit $?
3251 # Restore the uninstalled library and exit
3252 if test "$mode" = relink
; then
3253 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3257 # Create links to the real library.
3258 for linkname
in $linknames; do
3259 if test "$realname" != "$linkname"; then
3260 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3261 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3265 # If -module or -export-dynamic was specified, set the dlname.
3266 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3267 # On all known operating systems, these are identical.
3274 if test -n "$deplibs"; then
3275 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3278 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3279 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3282 if test -n "$rpath"; then
3283 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3286 if test -n "$xrpath"; then
3287 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3290 if test -n "$vinfo"; then
3291 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3294 if test -n "$release"; then
3295 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3300 if test -n "$objs$old_deplibs"; then
3301 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3305 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3313 # Delete the old objects.
3314 $run $rm $obj $libobj
3316 # Objects from convenience libraries. This assumes
3317 # single-version convenience libraries. Whenever we create
3318 # different ones for PIC/non-PIC, this we'll have to duplicate
3322 # reload_cmds runs $LD directly, so let us get rid of
3323 # -Wl from whole_archive_flag_spec
3326 if test -n "$convenience"; then
3327 if test -n "$whole_archive_flag_spec"; then
3328 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3330 gentop
="$output_objdir/${obj}x"
3331 $show "${rm}r $gentop"
3332 $run ${rm}r
"$gentop"
3333 $show "mkdir $gentop"
3334 $run mkdir
"$gentop"
3336 if test "$status" -ne 0 && test ! -d "$gentop"; then
3339 generated
="$generated $gentop"
3341 for xlib
in $convenience; do
3342 # Extract the objects.
3344 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3345 *) xabs
=`pwd`"/$xlib" ;;
3347 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3348 xdir
="$gentop/$xlib"
3350 $show "${rm}r $xdir"
3355 if test "$status" -ne 0 && test ! -d "$xdir"; then
3358 $show "(cd $xdir && $AR x $xabs)"
3359 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3361 reload_conv_objs
="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3366 # Create the old-style object.
3367 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
3370 eval cmds
=\"$reload_cmds\"
3371 save_ifs
="$IFS"; IFS
='~'
3372 for cmd
in $cmds; do
3375 $run eval "$cmd" ||
exit $?
3379 # Exit if we aren't doing a library object file.
3380 if test -z "$libobj"; then
3381 if test -n "$gentop"; then
3382 $show "${rm}r $gentop"
3389 if test "$build_libtool_libs" != yes; then
3390 if test -n "$gentop"; then
3391 $show "${rm}r $gentop"
3395 # Create an invalid libtool object if no PIC, so that we don't
3396 # accidentally link it into a program.
3397 $show "echo timestamp > $libobj"
3398 $run eval "echo timestamp > $libobj" ||
exit $?
3402 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3403 # Only do commands if we really have different PIC objects.
3404 reload_objs
="$libobjs $reload_conv_objs"
3406 eval cmds
=\"$reload_cmds\"
3407 save_ifs
="$IFS"; IFS
='~'
3408 for cmd
in $cmds; do
3411 $run eval "$cmd" ||
exit $?
3415 # Just create a symlink.
3418 xdir
=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3419 if test "X$xdir" = "X$libobj"; then
3424 baseobj
=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3425 oldobj
=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3426 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3427 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' ||
exit $?
3430 if test -n "$gentop"; then
3431 $show "${rm}r $gentop"
3440 *cygwin
*) output
=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3442 if test -n "$vinfo"; then
3443 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3446 if test -n "$release"; then
3447 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3450 if test "$preload" = yes; then
3451 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3452 test "$dlopen_self_static" = unknown
; then
3453 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3458 *-*-rhapsody* |
*-*-darwin1.
[012])
3459 # On Rhapsody replace the C library is the System framework
3460 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3461 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3465 compile_command
="$compile_command $compile_deplibs"
3466 finalize_command
="$finalize_command $finalize_deplibs"
3468 if test -n "$rpath$xrpath"; then
3469 # If the user specified any rpath flags, then add them.
3470 for libdir
in $rpath $xrpath; do
3471 # This is the magic to use -rpath.
3472 case "$finalize_rpath " in
3474 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3479 # Now hardcode the library paths
3482 for libdir
in $compile_rpath $finalize_rpath; do
3483 if test -n "$hardcode_libdir_flag_spec"; then
3484 if test -n "$hardcode_libdir_separator"; then
3485 if test -z "$hardcode_libdirs"; then
3486 hardcode_libdirs
="$libdir"
3488 # Just accumulate the unique libdirs.
3489 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3490 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3493 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3498 eval flag
=\"$hardcode_libdir_flag_spec\"
3499 rpath
="$rpath $flag"
3501 elif test -n "$runpath_var"; then
3502 case "$perm_rpath " in
3504 *) perm_rpath
="$perm_rpath $libdir" ;;
3508 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3509 case :$dllsearchpath: in
3511 *) dllsearchpath
="$dllsearchpath:$libdir";;
3516 # Substitute the hardcoded libdirs into the rpath.
3517 if test -n "$hardcode_libdir_separator" &&
3518 test -n "$hardcode_libdirs"; then
3519 libdir
="$hardcode_libdirs"
3520 eval rpath
=\" $hardcode_libdir_flag_spec\"
3522 compile_rpath
="$rpath"
3526 for libdir
in $finalize_rpath; do
3527 if test -n "$hardcode_libdir_flag_spec"; then
3528 if test -n "$hardcode_libdir_separator"; then
3529 if test -z "$hardcode_libdirs"; then
3530 hardcode_libdirs
="$libdir"
3532 # Just accumulate the unique libdirs.
3533 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3534 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3537 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3542 eval flag
=\"$hardcode_libdir_flag_spec\"
3543 rpath
="$rpath $flag"
3545 elif test -n "$runpath_var"; then
3546 case "$finalize_perm_rpath " in
3548 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
3552 # Substitute the hardcoded libdirs into the rpath.
3553 if test -n "$hardcode_libdir_separator" &&
3554 test -n "$hardcode_libdirs"; then
3555 libdir
="$hardcode_libdirs"
3556 eval rpath
=\" $hardcode_libdir_flag_spec\"
3558 finalize_rpath
="$rpath"
3560 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3561 # Transform all the library objects into standard objects.
3562 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3563 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3567 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3568 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3569 dlsyms
="${outputname}S.c"
3571 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3575 if test -n "$dlsyms"; then
3579 # Discover the nlist of each of the dlfiles.
3580 nlist
="$output_objdir/${outputname}.nm"
3582 $show "$rm $nlist ${nlist}S ${nlist}T"
3583 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3585 # Parse the name list into a source file.
3586 $show "creating $output_objdir/$dlsyms"
3588 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3589 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3590 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3596 /* Prevent the only kind of declaration conflicts we can make. */
3597 #define lt_preloaded_symbols some_other_symbol
3599 /* External symbol declarations for the compiler. */\
3602 if test "$dlself" = yes; then
3603 $show "generating symbol list for \`$output'"
3605 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3607 # Add our own program objects to the symbol list.
3608 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3609 for arg
in $progfiles; do
3610 $show "extracting global C symbols from \`$arg'"
3611 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3614 if test -n "$exclude_expsyms"; then
3615 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3616 $run eval '$mv "$nlist"T "$nlist"'
3619 if test -n "$export_symbols_regex"; then
3620 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3621 $run eval '$mv "$nlist"T "$nlist"'
3624 # Prepare the list of exported symbols
3625 if test -z "$export_symbols"; then
3626 export_symbols
="$output_objdir/$output.exp"
3627 $run $rm $export_symbols
3628 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3630 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3631 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3632 $run eval 'mv "$nlist"T "$nlist"'
3636 for arg
in $dlprefiles; do
3637 $show "extracting global C symbols from \`$arg'"
3638 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3639 $run eval 'echo ": $name " >> "$nlist"'
3640 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3643 if test -z "$run"; then
3644 # Make sure we have at least an empty file.
3645 test -f "$nlist" ||
: > "$nlist"
3647 if test -n "$exclude_expsyms"; then
3648 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3649 $mv "$nlist"T
"$nlist"
3652 # Try sorting and uniquifying the output.
3653 if grep -v "^: " < "$nlist" |
sort +2 |
uniq > "$nlist"S
; then
3656 grep -v "^: " < "$nlist" > "$nlist"S
3659 if test -f "$nlist"S
; then
3660 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3662 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3665 $echo >> "$output_objdir/$dlsyms" "\
3667 #undef lt_preloaded_symbols
3669 #if defined (__STDC__) && __STDC__
3670 # define lt_ptr void *
3672 # define lt_ptr char *
3676 /* The mapping between symbol names and symbols. */
3681 lt_preloaded_symbols[] =
3685 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3687 $echo >> "$output_objdir/$dlsyms" "\
3691 /* This works around a problem in FreeBSD linker */
3692 #ifdef FREEBSD_WORKAROUND
3693 static const void *lt_preloaded_setup() {
3694 return lt_preloaded_symbols;
3704 pic_flag_for_symtable
=
3706 # compiling the symbol table file with pic_flag works around
3707 # a FreeBSD bug that causes programs to crash when -lm is
3708 # linked before any other PIC object. But we must not use
3709 # pic_flag when linking with -static. The problem exists in
3710 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3711 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3712 case "$compile_command " in
3714 *) pic_flag_for_symtable
=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3717 case "$compile_command " in
3719 *) pic_flag_for_symtable
=" $pic_flag -DPIC";;
3723 # Now compile the dynamic symbol file.
3724 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3725 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3727 # Clean up the generated files.
3728 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3729 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3731 # Transform the symbol file into the correct name.
3732 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3733 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3736 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3741 # We keep going just in case the user didn't refer to
3742 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3743 # really was required.
3745 # Nullify the symbol file.
3746 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3747 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3750 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
3751 # Replace the output file specification.
3752 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3753 link_command
="$compile_command$compile_rpath"
3755 # We have no uninstalled library dependencies, so finalize right now.
3756 $show "$link_command"
3757 $run eval "$link_command"
3760 # Delete the generated files.
3761 if test -n "$dlsyms"; then
3762 $show "$rm $output_objdir/${outputname}S.${objext}"
3763 $run $rm "$output_objdir/${outputname}S.${objext}"
3769 if test -n "$shlibpath_var"; then
3770 # We should set the shlibpath_var
3772 for dir
in $temp_rpath; do
3774 [\\/]* |
[A-Za-z
]:[\\/]*)
3779 # Relative path: add a thisdir entry.
3780 rpath
="$rpath\$thisdir/$dir:"
3787 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3788 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3790 if test -n "$finalize_shlibpath"; then
3791 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3796 if test -n "$runpath_var"; then
3797 if test -n "$perm_rpath"; then
3798 # We should set the runpath_var.
3800 for dir
in $perm_rpath; do
3803 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3805 if test -n "$finalize_perm_rpath"; then
3806 # We should set the runpath_var.
3808 for dir
in $finalize_perm_rpath; do
3811 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3815 if test "$no_install" = yes; then
3816 # We don't need to create a wrapper script.
3817 link_command
="$compile_var$compile_command$compile_rpath"
3818 # Replace the output file specification.
3819 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3820 # Delete the old output file.
3822 # Link the executable and exit
3823 $show "$link_command"
3824 $run eval "$link_command" ||
exit $?
3828 if test "$hardcode_action" = relink
; then
3829 # Fast installation is not supported
3830 link_command
="$compile_var$compile_command$compile_rpath"
3831 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3833 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3834 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3836 if test "$fast_install" != no
; then
3837 link_command
="$finalize_var$compile_command$finalize_rpath"
3838 if test "$fast_install" = yes; then
3839 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3841 # fast_install is set to needless
3845 link_command
="$compile_var$compile_command$compile_rpath"
3846 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3850 # Replace the output file specification.
3851 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3853 # Delete the old output files.
3854 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
3856 $show "$link_command"
3857 $run eval "$link_command" ||
exit $?
3859 # Now create the wrapper script.
3860 $show "creating $output"
3862 # Quote the relink command for shipping.
3863 if test -n "$relink_command"; then
3864 # Preserve any variables that may affect compiler behavior
3865 for var
in $variables_saved_for_relink; do
3866 if eval test -z \"\
${$var+set}\"; then
3867 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3868 elif eval var_value
=\$
$var; test -z "$var_value"; then
3869 relink_command
="$var=; export $var; $relink_command"
3871 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3872 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
3875 relink_command
="(cd `pwd`; $relink_command)"
3876 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3879 # Quote $echo for shipping.
3880 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3882 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
3883 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
3885 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3887 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3890 # Only actually do things if our run command is non-null.
3891 if test -z "$run"; then
3892 # win32 will think the script is a binary if it has
3893 # a .exe suffix, so we strip it off here.
3895 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
3897 # test for cygwin because mv fails w/o .exe extensions
3899 *cygwin
*) exeext
=.exe
;;
3903 trap "$rm $output; exit 1" 1 2 15
3908 # $output - temporary wrapper script for $objdir/$outputname
3909 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3911 # The $output program cannot be directly executed until all the libtool
3912 # libraries that it depends on are installed.
3914 # This wrapper script should never be moved out of the build directory.
3915 # If it is, it will not operate correctly.
3917 # Sed substitution that helps us do robust quoting. It backslashifies
3918 # metacharacters that are still active within double-quoted strings.
3919 Xsed='sed -e 1s/^X//'
3920 sed_quote_subst='$sed_quote_subst'
3922 # The HP-UX ksh and POSIX shell print the target directory to stdout
3924 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3926 relink_command=\"$relink_command\"
3928 # This environment variable determines our operation mode.
3929 if test \"\$libtool_install_magic\" = \"$magic\"; then
3930 # install mode needs the following variable:
3931 notinst_deplibs='$notinst_deplibs'
3933 # When we are sourced in execute mode, \$file and \$echo are already set.
3934 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3937 # Make sure echo works.
3938 if test \"X\$1\" = X--no-reexec; then
3939 # Discard the --no-reexec flag, and continue.
3941 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3942 # Yippee, \$echo works!
3945 # Restart under the correct shell, and then maybe \$echo will work.
3946 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3952 # Find the directory that this script lives in.
3953 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3954 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3956 # Follow symbolic links until we get to the real thisdir.
3957 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3958 while test -n \"\$file\"; do
3959 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3961 # If there was a directory component, then change thisdir.
3962 if test \"x\$destdir\" != \"x\$file\"; then
3963 case \"\$destdir\" in
3964 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3965 *) thisdir=\"\$thisdir/\$destdir\" ;;
3969 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3970 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3973 # Try to get the absolute directory name.
3974 absdir=\`cd \"\$thisdir\" && pwd\`
3975 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3978 if test "$fast_install" = yes; then
3980 program=lt-'$outputname'$exeext
3981 progdir=\"\$thisdir/$objdir\"
3983 if test ! -f \"\$progdir/\$program\" || \\
3984 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3985 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3987 file=\"\$\$-\$program\"
3989 if test ! -d \"\$progdir\"; then
3990 $mkdir \"\$progdir\"
3992 $rm \"\$progdir/\$file\"
3997 # relink executable if necessary
3998 if test -n \"\$relink_command\"; then
3999 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4001 $echo \"\$relink_command_output\" >&2
4002 $rm \"\$progdir/\$file\"
4007 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4008 { $rm \"\$progdir/\$program\";
4009 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4010 $rm \"\$progdir/\$file\"
4014 program='$outputname'
4015 progdir=\"\$thisdir/$objdir\"
4021 if test -f \"\$progdir/\$program\"; then"
4023 # Export our shlibpath_var if we have one.
4024 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4026 # Add our own library path to $shlibpath_var
4027 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4029 # Some systems cannot cope with colon-terminated $shlibpath_var
4030 # The second colon is a workaround for a bug in BeOS R4 sed
4031 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4033 export $shlibpath_var
4037 # fixup the dll searchpath if we need to.
4038 if test -n "$dllsearchpath"; then
4040 # Add the dll search path components to the executable PATH
4041 PATH=$dllsearchpath:\$PATH
4046 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4047 # Run the actual program with our arguments.
4050 # win32 systems need to use the prog path for dll
4052 *-*-cygwin* |
*-*-pw32*)
4054 exec \$progdir/\$program \${1+\"\$@\"}
4058 # Backslashes separate directories on plain windows
4059 *-*-mingw |
*-*-os2*)
4061 exec \$progdir\\\\\$program \${1+\"\$@\"}
4067 # Export the path to the program.
4068 PATH=\"\$progdir:\$PATH\"
4071 exec \$program \${1+\"\$@\"}
4076 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4080 # The program doesn't exist.
4081 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4082 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4083 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4094 # See if we need to build an old-fashioned archive.
4095 for oldlib
in $oldlibs; do
4097 if test "$build_libtool_libs" = convenience
; then
4098 oldobjs
="$libobjs_save"
4099 addlibs
="$convenience"
4100 build_libtool_libs
=no
4102 if test "$build_libtool_libs" = module
; then
4103 oldobjs
="$libobjs_save"
4104 build_libtool_libs
=no
4106 oldobjs
="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4108 addlibs
="$old_convenience"
4111 if test -n "$addlibs"; then
4112 gentop
="$output_objdir/${outputname}x"
4113 $show "${rm}r $gentop"
4114 $run ${rm}r
"$gentop"
4115 $show "mkdir $gentop"
4116 $run mkdir
"$gentop"
4118 if test "$status" -ne 0 && test ! -d "$gentop"; then
4121 generated
="$generated $gentop"
4123 # Add in members from convenience archives.
4124 for xlib
in $addlibs; do
4125 # Extract the objects.
4127 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4128 *) xabs
=`pwd`"/$xlib" ;;
4130 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4131 xdir
="$gentop/$xlib"
4133 $show "${rm}r $xdir"
4138 if test "$status" -ne 0 && test ! -d "$xdir"; then
4141 $show "(cd $xdir && $AR x $xabs)"
4142 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4144 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4148 # Do each command in the archive commands.
4149 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4150 eval cmds
=\"$old_archive_from_new_cmds\"
4152 # Ensure that we have .o objects in place in case we decided
4153 # not to build a shared library, and have fallen back to building
4154 # static libs even though --disable-static was passed!
4155 for oldobj
in $oldobjs; do
4156 if test ! -f $oldobj; then
4157 xdir
=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4158 if test "X$xdir" = "X$oldobj"; then
4163 baseobj
=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4164 obj
=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4165 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4166 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' ||
exit $?
4170 eval cmds
=\"$old_archive_cmds\"
4172 save_ifs
="$IFS"; IFS
='~'
4173 for cmd
in $cmds; do
4176 $run eval "$cmd" ||
exit $?
4181 if test -n "$generated"; then
4182 $show "${rm}r$generated"
4183 $run ${rm}r
$generated
4186 # Now create the libtool archive.
4190 test "$build_old_libs" = yes && old_library
="$libname.$libext"
4191 $show "creating $output"
4193 # Preserve any variables that may affect compiler behavior
4194 for var
in $variables_saved_for_relink; do
4195 if eval test -z \"\
${$var+set}\"; then
4196 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4197 elif eval var_value
=\$
$var; test -z "$var_value"; then
4198 relink_command
="$var=; export $var; $relink_command"
4200 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4201 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4204 # Quote the link command for shipping.
4205 relink_command
="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
4206 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4208 # Only create the output if not a dry run.
4209 if test -z "$run"; then
4210 for installed
in no
yes; do
4211 if test "$installed" = yes; then
4212 if test -z "$install_libdir"; then
4215 output
="$output_objdir/$outputname"i
4216 # Replace all uninstalled libtool libraries with the installed ones
4218 for deplib
in $dependency_libs; do
4221 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4222 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4223 if test -z "$libdir"; then
4224 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4227 newdependency_libs
="$newdependency_libs $libdir/$name"
4229 *) newdependency_libs
="$newdependency_libs $deplib" ;;
4232 dependency_libs
="$newdependency_libs"
4234 for lib
in $dlfiles; do
4235 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4236 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4237 if test -z "$libdir"; then
4238 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4241 newdlfiles
="$newdlfiles $libdir/$name"
4243 dlfiles
="$newdlfiles"
4245 for lib
in $dlprefiles; do
4246 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4247 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4248 if test -z "$libdir"; then
4249 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4252 newdlprefiles
="$newdlprefiles $libdir/$name"
4254 dlprefiles
="$newdlprefiles"
4257 # place dlname in correct position for cygwin
4259 case $host,$output,$installed,$module,$dlname in
4260 *cygwin
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
4263 # $outputname - a libtool library file
4264 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4266 # Please DO NOT delete this file!
4267 # It is necessary for linking the library.
4269 # The name that we can dlopen(3).
4272 # Names of this library.
4273 library_names='$library_names'
4275 # The name of the static archive.
4276 old_library='$old_library'
4278 # Libraries that this one depends upon.
4279 dependency_libs='$dependency_libs'
4281 # Version information for $libname.
4286 # Is this an already installed library?
4287 installed=$installed
4289 # Files to dlopen/dlpreopen
4291 dlpreopen='$dlprefiles'
4293 # Directory that this library needs to be installed in:
4294 libdir='$install_libdir'"
4295 if test "$installed" = no
&& test "$need_relink" = yes; then
4297 relink_command=\"$relink_command\""
4302 # Do a symbolic link so that the libtool archive can be found in
4303 # LD_LIBRARY_PATH before the program is installed.
4304 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4305 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
4311 # libtool install mode
4313 modename
="$modename: install"
4315 # There may be an optional sh(1) argument at the beginning of
4316 # install_prog (especially on Windows NT).
4317 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
4318 # Allow the use of GNU shtool's install command.
4319 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
4320 # Aesthetically quote it.
4321 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4323 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4327 install_prog
="$arg "
4335 # The real first argument should be the name of the installation program.
4336 # Aesthetically quote it.
4337 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4339 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4343 install_prog
="$install_prog$arg"
4345 # We need to accept at least all the BSD install flags.
4355 if test -n "$dest"; then
4356 files
="$files $dest"
4374 # If the previous option needed an argument, then skip it.
4375 if test -n "$prev"; then
4384 # Aesthetically quote the argument.
4385 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4387 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4391 install_prog
="$install_prog $arg"
4394 if test -z "$install_prog"; then
4395 $echo "$modename: you must specify an install program" 1>&2
4400 if test -n "$prev"; then
4401 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4406 if test -z "$files"; then
4407 if test -z "$dest"; then
4408 $echo "$modename: no file or destination specified" 1>&2
4410 $echo "$modename: you must specify a destination" 1>&2
4416 # Strip any trailing slash from the destination.
4417 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4419 # Check to see that the destination is a directory.
4420 test -d "$dest" && isdir
=yes
4421 if test "$isdir" = yes; then
4425 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4426 test "X$destdir" = "X$dest" && destdir
=.
4427 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4429 # Not a directory, so check to see that there is only one file specified.
4431 if test "$#" -gt 2; then
4432 $echo "$modename: \`$dest' is not a directory" 1>&2
4438 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
4440 for file in $files; do
4444 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4453 # This variable tells wrapper scripts just to set variables rather
4454 # than running their programs.
4455 libtool_install_magic
="$magic"
4460 for file in $files; do
4462 # Do each installation.
4465 # Do the static libraries later.
4466 staticlibs
="$staticlibs $file"
4470 # Check to see that this really is a libtool archive.
4471 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4473 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4481 # If there is no directory component, then add one.
4483 */* |
*\\*) .
$file ;;
4487 # Add the libdir to current_libdirs if it is the destination.
4488 if test "X$destdir" = "X$libdir"; then
4489 case "$current_libdirs " in
4491 *) current_libdirs
="$current_libdirs $libdir" ;;
4494 # Note the libdir as a future libdir.
4495 case "$future_libdirs " in
4497 *) future_libdirs
="$future_libdirs $libdir" ;;
4501 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4502 test "X$dir" = "X$file/" && dir
=
4505 if test -n "$relink_command"; then
4506 # Determine the prefix the user has applied to our future dir.
4507 inst_prefix_dir
=`$echo "$destdir" | sed "s%$libdir\$%%"`
4509 # Don't allow the user to place us outside of our expected
4510 # location b/c this prevents finding dependent libraries that
4511 # are installed to the same prefix.
4512 if test "$inst_prefix_dir" = "$destdir"; then
4513 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4517 if test -n "$inst_prefix_dir"; then
4518 # Stick the inst_prefix_dir data into the link command.
4519 relink_command
=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4521 relink_command
=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
4524 $echo "$modename: warning: relinking \`$file'" 1>&2
4525 $show "$relink_command"
4526 if $run eval "$relink_command"; then :
4528 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4533 # See the names of the shared library.
4534 set dummy
$library_names
4535 if test -n "$2"; then
4541 test -n "$relink_command" && srcname
="$realname"T
4543 # Install the shared library and build the symlinks.
4544 $show "$install_prog $dir/$srcname $destdir/$realname"
4545 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
4546 if test -n "$stripme" && test -n "$striplib"; then
4547 $show "$striplib $destdir/$realname"
4548 $run eval "$striplib $destdir/$realname" ||
exit $?
4551 if test "$#" -gt 0; then
4552 # Delete the old symlinks, and create new ones.
4555 if test "$linkname" != "$realname"; then
4556 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4557 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4562 # Do each command in the postinstall commands.
4563 lib
="$destdir/$realname"
4564 eval cmds
=\"$postinstall_cmds\"
4565 save_ifs
="$IFS"; IFS
='~'
4566 for cmd
in $cmds; do
4569 $run eval "$cmd" ||
exit $?
4574 # Install the pseudo-library for information purposes.
4575 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4576 instname
="$dir/$name"i
4577 $show "$install_prog $instname $destdir/$name"
4578 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
4580 # Maybe install the static library, too.
4581 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
4585 # Install (i.e. copy) a libtool object.
4587 # Figure out destination file name, if it wasn't already specified.
4588 if test -n "$destname"; then
4589 destfile
="$destdir/$destname"
4591 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4592 destfile
="$destdir/$destfile"
4595 # Deduce the name of the destination old-style object file.
4598 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4601 staticdest
="$destfile"
4605 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4611 # Install the libtool object if requested.
4612 if test -n "$destfile"; then
4613 $show "$install_prog $file $destfile"
4614 $run eval "$install_prog $file $destfile" ||
exit $?
4617 # Install the old object if enabled.
4618 if test "$build_old_libs" = yes; then
4619 # Deduce the name of the old-style object file.
4620 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
4622 $show "$install_prog $staticobj $staticdest"
4623 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
4629 # Figure out destination file name, if it wasn't already specified.
4630 if test -n "$destname"; then
4631 destfile
="$destdir/$destname"
4633 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4634 destfile
="$destdir/$destfile"
4637 # Do a test to see if this is really a libtool program.
4638 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4642 # If there is no directory component, then add one.
4644 */* |
*\\*) .
$file ;;
4648 # Check the variables that should have been set.
4649 if test -z "$notinst_deplibs"; then
4650 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4655 for lib
in $notinst_deplibs; do
4656 # Check to see that each library is installed.
4658 if test -f "$lib"; then
4659 # If there is no directory component, then add one.
4661 */* |
*\\*) .
$lib ;;
4665 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4666 if test -n "$libdir" && test ! -f "$libfile"; then
4667 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4673 # If there is no directory component, then add one.
4675 */* |
*\\*) .
$file ;;
4680 if test "$fast_install" = no
&& test -n "$relink_command"; then
4681 if test "$finalize" = yes && test -z "$run"; then
4683 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
4684 tmpdir
=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
4685 if test $?
= 0 ; then :
4687 tmpdir
="$tmpdir/libtool-$$"
4689 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4691 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4694 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4695 outputname
="$tmpdir/$file"
4696 # Replace the output file specification.
4697 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4699 $show "$relink_command"
4700 if $run eval "$relink_command"; then :
4702 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4708 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4711 # Install the binary that we compiled earlier.
4712 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4716 # remove .exe since cygwin /usr/bin/install will append another
4718 case $install_prog,$host in
4719 /usr
/bin
/install*,*cygwin
*)
4720 case $file:$destfile in
4725 destfile
=$destfile.exe
4728 destfile
=`echo $destfile | sed -e 's,.exe$,,'`
4733 $show "$install_prog$stripme $file $destfile"
4734 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
4735 test -n "$outputname" && ${rm}r
"$tmpdir"
4740 for file in $staticlibs; do
4741 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4743 # Set up the ranlib parameters.
4744 oldlib
="$destdir/$name"
4746 $show "$install_prog $file $oldlib"
4747 $run eval "$install_prog \$file \$oldlib" ||
exit $?
4749 if test -n "$stripme" && test -n "$striplib"; then
4750 $show "$old_striplib $oldlib"
4751 $run eval "$old_striplib $oldlib" ||
exit $?
4754 # Do each command in the postinstall commands.
4755 eval cmds
=\"$old_postinstall_cmds\"
4756 save_ifs
="$IFS"; IFS
='~'
4757 for cmd
in $cmds; do
4760 $run eval "$cmd" ||
exit $?
4765 if test -n "$future_libdirs"; then
4766 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4769 if test -n "$current_libdirs"; then
4770 # Maybe just do a dry run.
4771 test -n "$run" && current_libdirs
=" -n$current_libdirs"
4772 exec_cmd
='$SHELL $0 --finish$current_libdirs'
4778 # libtool finish mode
4780 modename
="$modename: finish"
4784 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4787 libdirs
="$libdirs $dir"
4790 for libdir
in $libdirs; do
4791 if test -n "$finish_cmds"; then
4792 # Do each command in the finish commands.
4793 eval cmds
=\"$finish_cmds\"
4794 save_ifs
="$IFS"; IFS
='~'
4795 for cmd
in $cmds; do
4798 $run eval "$cmd" || admincmds
="$admincmds
4803 if test -n "$finish_eval"; then
4804 # Do the single finish_eval.
4805 eval cmds
=\"$finish_eval\"
4806 $run eval "$cmds" || admincmds
="$admincmds
4812 # Exit here if they wanted silent mode.
4813 test "$show" = : && exit 0
4815 echo "----------------------------------------------------------------------"
4816 echo "Libraries have been installed in:"
4817 for libdir
in $libdirs; do
4821 echo "If you ever happen to want to link against installed libraries"
4822 echo "in a given directory, LIBDIR, you must either use libtool, and"
4823 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4824 echo "flag during linking and do at least one of the following:"
4825 if test -n "$shlibpath_var"; then
4826 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4827 echo " during execution"
4829 if test -n "$runpath_var"; then
4830 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4831 echo " during linking"
4833 if test -n "$hardcode_libdir_flag_spec"; then
4835 eval flag
=\"$hardcode_libdir_flag_spec\"
4837 echo " - use the \`$flag' linker flag"
4839 if test -n "$admincmds"; then
4840 echo " - have your system administrator run these commands:$admincmds"
4842 if test -f /etc
/ld.so.conf
; then
4843 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4846 echo "See any operating system documentation about shared libraries for"
4847 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4848 echo "----------------------------------------------------------------------"
4852 # libtool execute mode
4854 modename
="$modename: execute"
4856 # The first argument is the command name.
4858 if test -z "$cmd"; then
4859 $echo "$modename: you must specify a COMMAND" 1>&2
4864 # Handle -dlopen flags immediately.
4865 for file in $execute_dlfiles; do
4866 if test ! -f "$file"; then
4867 $echo "$modename: \`$file' is not a file" 1>&2
4875 # Check to see that this really is a libtool archive.
4876 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4878 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4883 # Read the libtool library.
4887 # If there is no directory component, then add one.
4889 */* |
*\\*) .
$file ;;
4893 # Skip this library if it cannot be dlopened.
4894 if test -z "$dlname"; then
4895 # Warn if it was a shared library.
4896 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4900 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4901 test "X$dir" = "X$file" && dir
=.
4903 if test -f "$dir/$objdir/$dlname"; then
4906 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4912 # Just add the directory containing the .lo file.
4913 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4914 test "X$dir" = "X$file" && dir
=.
4918 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4923 # Get the absolute pathname.
4924 absdir
=`cd "$dir" && pwd`
4925 test -n "$absdir" && dir
="$absdir"
4927 # Now add the directory to shlibpath_var.
4928 if eval "test -z \"\$$shlibpath_var\""; then
4929 eval "$shlibpath_var=\"\$dir\""
4931 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4935 # This variable tells wrapper scripts just to set shlibpath_var
4936 # rather than running their programs.
4937 libtool_execute_magic
="$magic"
4939 # Check if any of the arguments is a wrapper script.
4946 # Do a test to see if this is really a libtool program.
4947 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4948 # If there is no directory component, then add one.
4950 */* |
*\\*) .
$file ;;
4954 # Transform arg to wrapped name.
4955 file="$progdir/$program"
4959 # Quote arguments (to preserve shell metacharacters).
4960 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4961 args
="$args \"$file\""
4964 if test -z "$run"; then
4965 if test -n "$shlibpath_var"; then
4966 # Export the shlibpath_var.
4967 eval "export $shlibpath_var"
4970 # Restore saved enviroment variables
4971 if test "${save_LC_ALL+set}" = set; then
4972 LC_ALL
="$save_LC_ALL"; export LC_ALL
4974 if test "${save_LANG+set}" = set; then
4975 LANG
="$save_LANG"; export LANG
4978 # Now prepare to actually exec the command.
4979 exec_cmd
="\$cmd$args"
4981 # Display what would be done.
4982 if test -n "$shlibpath_var"; then
4983 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4984 $echo "export $shlibpath_var"
4991 # libtool clean and uninstall mode
4993 modename
="$modename: $mode"
4999 # This variable tells wrapper scripts just to set variables rather
5000 # than running their programs.
5001 libtool_install_magic
="$magic"
5006 -f) rm="$rm $arg"; rmforce
=yes ;;
5007 -*) rm="$rm $arg" ;;
5008 *) files
="$files $arg" ;;
5012 if test -z "$rm"; then
5013 $echo "$modename: you must specify an RM program" 1>&2
5020 for file in $files; do
5021 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5022 if test "X$dir" = "X$file"; then
5026 objdir
="$dir/$objdir"
5028 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5029 test "$mode" = uninstall
&& objdir
="$dir"
5031 # Remember objdir for removal later, being careful to avoid duplicates
5032 if test "$mode" = clean
; then
5035 *) rmdirs
="$rmdirs $objdir" ;;
5039 # Don't error if the file doesn't exist and rm -f was used.
5040 if (test -L "$file") >/dev
/null
2>&1 \
5041 ||
(test -h "$file") >/dev
/null
2>&1 \
5042 ||
test -f "$file"; then
5044 elif test -d "$file"; then
5047 elif test "$rmforce" = yes; then
5055 # Possibly a libtool archive, so verify it.
5056 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5059 # Delete the libtool libraries and symlinks.
5060 for n
in $library_names; do
5061 rmfiles
="$rmfiles $objdir/$n"
5063 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
5064 test "$mode" = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
5066 if test "$mode" = uninstall
; then
5067 if test -n "$library_names"; then
5068 # Do each command in the postuninstall commands.
5069 eval cmds
=\"$postuninstall_cmds\"
5070 save_ifs
="$IFS"; IFS
='~'
5071 for cmd
in $cmds; do
5075 if test "$?" -ne 0 && test "$rmforce" != yes; then
5082 if test -n "$old_library"; then
5083 # Do each command in the old_postuninstall commands.
5084 eval cmds
=\"$old_postuninstall_cmds\"
5085 save_ifs
="$IFS"; IFS
='~'
5086 for cmd
in $cmds; do
5090 if test "$?" -ne 0 && test "$rmforce" != yes; then
5096 # FIXME: should reinstall the best remaining shared library.
5102 if test "$build_old_libs" = yes; then
5103 oldobj
=`$echo "X$name" | $Xsed -e "$lo2o"`
5104 rmfiles
="$rmfiles $dir/$oldobj"
5109 # Do a test to see if this is a libtool program.
5110 if test "$mode" = clean
&&
5111 (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5115 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5116 if test "$fast_install" = yes && test -n "$relink_command"; then
5117 rmfiles
="$rmfiles $objdir/lt-$name"
5122 $show "$rm $rmfiles"
5123 $run $rm $rmfiles || exit_status
=1
5126 # Try to remove the ${objdir}s in the directories where we deleted files
5127 for dir
in $rmdirs; do
5128 if test -d "$dir"; then
5130 $run rmdir $dir >/dev
/null
2>&1
5138 $echo "$modename: you must specify a MODE" 1>&2
5139 $echo "$generic_help" 1>&2
5144 if test -z "$exec_cmd"; then
5145 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5146 $echo "$generic_help" 1>&2
5149 fi # test -z "$show_help"
5151 if test -n "$exec_cmd"; then
5156 # We need to display help for each of the modes.
5159 "Usage: $modename [OPTION]... [MODE-ARG]...
5161 Provide generalized library-building support services.
5163 --config show all configuration variables
5164 --debug enable verbose shell tracing
5165 -n, --dry-run display commands without modifying any files
5166 --features display basic configuration information and exit
5167 --finish same as \`--mode=finish'
5168 --help display this help message and exit
5169 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5170 --quiet same as \`--silent'
5171 --silent don't print informational messages
5172 --version print version information
5174 MODE must be one of the following:
5176 clean remove files from the build directory
5177 compile compile a source file into a libtool object
5178 execute automatically set library path, then run a program
5179 finish complete the installation of libtool libraries
5180 install install libraries or executables
5181 link create a library or an executable
5182 uninstall remove libraries from an installed directory
5184 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5185 a more detailed description of MODE."
5191 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5193 Remove files from the build directory.
5195 RM is the name of the program to use to delete files associated with each FILE
5196 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5199 If FILE is a libtool library, object or program, all the files associated
5200 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5205 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5207 Compile a source file into a libtool library object.
5209 This mode accepts the following additional options:
5211 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5212 -prefer-pic try to building PIC objects only
5213 -prefer-non-pic try to building non-PIC objects only
5214 -static always build a \`.o' file suitable for static linking
5216 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5217 from the given SOURCEFILE.
5219 The output file name is determined by removing the directory component from
5220 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5221 library object suffix, \`.lo'."
5226 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5228 Automatically set library path, then run a program.
5230 This mode accepts the following additional options:
5232 -dlopen FILE add the directory containing FILE to the library path
5234 This mode sets the library path environment variable according to \`-dlopen'
5237 If any of the ARGS are libtool executable wrappers, then they are translated
5238 into their corresponding uninstalled binary, and any of their required library
5239 directories are added to the library path.
5241 Then, COMMAND is executed, with ARGS as arguments."
5246 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5248 Complete the installation of libtool libraries.
5250 Each LIBDIR is a directory that contains libtool libraries.
5252 The commands that this mode executes may require superuser privileges. Use
5253 the \`--dry-run' option if you just want to see what would be executed."
5258 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5260 Install executables or libraries.
5262 INSTALL-COMMAND is the installation command. The first component should be
5263 either the \`install' or \`cp' program.
5265 The rest of the components are interpreted as arguments to that command (only
5266 BSD-compatible install options are recognized)."
5271 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5273 Link object files or libraries together to form another library, or to
5274 create an executable program.
5276 LINK-COMMAND is a command using the C compiler that you would use to create
5277 a program from several object files.
5279 The following components of LINK-COMMAND are treated specially:
5281 -all-static do not do any dynamic linking at all
5282 -avoid-version do not add a version suffix if possible
5283 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5284 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5285 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5286 -export-symbols SYMFILE
5287 try to export only the symbols listed in SYMFILE
5288 -export-symbols-regex REGEX
5289 try to export only the symbols matching REGEX
5290 -LLIBDIR search LIBDIR for required installed libraries
5291 -lNAME OUTPUT-FILE requires the installed library libNAME
5292 -module build a library that can dlopened
5293 -no-fast-install disable the fast-install mode
5294 -no-install link a not-installable executable
5295 -no-undefined declare that a library does not refer to external symbols
5296 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5297 -release RELEASE specify package release information
5298 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5299 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5300 -static do not do any dynamic linking of libtool libraries
5301 -version-info CURRENT[:REVISION[:AGE]]
5302 specify library version info [each variable defaults to 0]
5304 All other options (arguments beginning with \`-') are ignored.
5306 Every other argument is treated as a filename. Files ending in \`.la' are
5307 treated as uninstalled libtool libraries, other files are standard or library
5310 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5311 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5312 required, except when creating a convenience library.
5314 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5315 using \`ar' and \`ranlib', or on Windows using \`lib'.
5317 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5318 is created, otherwise an executable program is created."
5323 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5325 Remove libraries from an installation directory.
5327 RM is the name of the program to use to delete files associated with each FILE
5328 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5331 If FILE is a libtool library, all the files associated with it are deleted.
5332 Otherwise, only FILE itself is deleted using RM."
5336 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5343 $echo "Try \`$modename --help' for more information about other modes."