3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU mod_jk 1.2.32)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
32 # A sed program that does not truncate output.
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/bin/sed -e s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
40 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
42 # The names of the tagged configurations supported by this script.
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host ubuntu:
49 # Shell to use when invoking shell scripts.
52 # Whether or not to build shared libraries.
53 build_libtool_libs=yes
55 # Whether or not to build static libraries.
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc=no
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=no
64 # Whether or not to optimize for fast installation.
69 host=x86_64-unknown-linux-gnu
71 # An echo program that does not interpret backslashes.
81 # A language-specific compiler.
84 # Is the compiler the GNU C compiler?
90 # The linker used to build libraries.
91 LD="/usr/bin/ld -m elf_x86_64"
93 # Whether we need hard or soft links.
96 # A BSD-compatible nm program.
99 # A symbol stripping program
102 # Used to examine libraries when file_magic_cmd begins "file"
105 # Used on cygwin: DLL creation program.
108 # Used on cygwin: object dumper.
111 # Used on cygwin: assembler.
114 # The name of the directory that contains temporary libtool files.
117 # How to create reloadable object files.
119 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
121 # How to pass a linker flag through the compiler.
124 # Object file suffix (normally "o").
127 # Old archive suffix (normally "a").
130 # Shared library suffix (normally ".so").
133 # Executable file suffix (normally "").
136 # Additional compiler flags for building library objects.
137 pic_flag=" -fPIC -DPIC"
140 # What is the maximum length of a command?
143 # Does compiler simultaneously support -c and -o options?
146 # Must we lock files when doing compilation ?
149 # Do we need the lib prefix for modules?
152 # Do we need a version for libraries?
155 # Whether dlopen is supported.
158 # Whether dlopen of programs is supported.
161 # Whether dlopen of statically linked programs is supported.
162 dlopen_self_static=yes
164 # Compiler flag to prevent dynamic linking.
165 link_static_flag="-static"
167 # Compiler flag to turn off builtin functions.
168 no_builtin_flag=" -fno-builtin"
170 # Compiler flag to allow reflexive dlopens.
171 export_dynamic_flag_spec="\${wl}--export-dynamic"
173 # Compiler flag to generate shared objects directly from archives.
174 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
176 # Compiler flag to generate thread-safe objects.
177 thread_safe_flag_spec=""
179 # Library versioning type.
182 # Format of library name prefix.
183 libname_spec="lib\$name"
185 # List of archive names. First name is the real one, the rest are links.
186 # The last name is the one that the linker finds with -lNAME.
187 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
189 # The coded name of the library, if different from the real name.
190 soname_spec="\${libname}\${release}\${shared_ext}\$major"
192 # Commands used to build and install an old-style archive.
194 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
195 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
196 old_postuninstall_cmds=""
198 # Create an old-style archive from a shared archive.
199 old_archive_from_new_cmds=""
201 # Create a temporary old-style archive to link instead of a shared archive.
202 old_archive_from_expsyms_cmds=""
204 # Commands used to build and install a shared archive.
205 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
206 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
207 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
208 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
209 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
211 postuninstall_cmds=""
213 # Commands used to build a loadable module (assumed same as above if empty)
215 module_expsym_cmds=""
217 # Commands to strip libraries.
218 old_striplib="strip --strip-debug"
219 striplib="strip --strip-unneeded"
221 # Dependencies to place before the objects being linked to create a
225 # Dependencies to place after the objects being linked to create a
229 # Dependencies to place before the objects being linked to create a
233 # Dependencies to place after the objects being linked to create a
237 # The library search path used internally by the compiler when linking
239 compiler_lib_search_path=""
241 # Method to check whether dependent libraries are shared objects.
242 deplibs_check_method="pass_all"
244 # Command to use when deplibs_check_method == file_magic.
245 file_magic_cmd="\$MAGIC_CMD"
247 # Flag that allows shared libraries with undefined symbols to be built.
248 allow_undefined_flag=""
250 # Flag that forces no undefined symbols.
253 # Commands used to finish a libtool library installation in a directory.
254 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
256 # Same as above, but a single script fragment to be evaled but not shown.
259 # Take the output of nm and produce a listing of raw symbols and C names.
260 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
262 # Transform the output of nm in a proper C declaration
263 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
265 # Transform the output of nm in a C name address pair
266 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
268 # This is the shared library runtime path variable.
269 runpath_var=LD_RUN_PATH
271 # This is the shared library path variable.
272 shlibpath_var=LD_LIBRARY_PATH
274 # Is shlibpath searched before the hard-coded library search path?
275 shlibpath_overrides_runpath=no
277 # How to hardcode a shared library path into an executable.
278 hardcode_action=immediate
280 # Whether we should hardcode library paths into libraries.
281 hardcode_into_libs=yes
283 # Flag to hardcode $libdir into a binary during linking.
284 # This must work even if $libdir does not exist.
285 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
287 # If ld is used when linking, flag to hardcode $libdir into
288 # a binary during linking. This must work even if $libdir does
290 hardcode_libdir_flag_spec_ld=""
292 # Whether we need a single -rpath flag with a separated argument.
293 hardcode_libdir_separator=""
295 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
299 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
303 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
304 # the resulting binary.
305 hardcode_shlibpath_var=unsupported
307 # Set to yes if building a shared library automatically hardcodes DIR into the library
308 # and all subsequent libraries and executables linked against it.
309 hardcode_automatic=no
311 # Variables whose values should be saved in libtool wrapper scripts and
312 # restored at relink time.
313 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
315 # Whether libtool must link a program against all its dependency libraries.
316 link_all_deplibs=unknown
318 # Compile-time system search path for libraries
319 sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
321 # Run-time system search path for libraries
322 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 include /etc/ld.so.conf.d/*.conf "
324 # Fix the shell variable $srcfile for the compiler.
327 # Set to yes if exported symbols are required.
328 always_export_symbols=no
330 # The commands to list exported symbols.
331 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
333 # The commands to extract the exported symbol list from a shared archive.
334 extract_expsyms_cmds=""
336 # Symbols that should not be listed in the preloaded symbols.
337 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
339 # Symbols that must always be exported.
342 # ### END LIBTOOL CONFIG
344 # ltmain.sh - Provide generalized library-building support services.
345 # NOTE: Changing this file will not affect anything until you rerun configure.
347 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
348 # Free Software Foundation, Inc.
349 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
351 # This program is free software; you can redistribute it and/or modify
352 # it under the terms of the GNU General Public License as published by
353 # the Free Software Foundation; either version 2 of the License, or
354 # (at your option) any later version.
356 # This program is distributed in the hope that it will be useful, but
357 # WITHOUT ANY WARRANTY; without even the implied warranty of
358 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
359 # General Public License for more details.
361 # You should have received a copy of the GNU General Public License
362 # along with this program; if not, write to the Free Software
363 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
365 # As a special exception to the GNU General Public License, if you
366 # distribute this file as part of a program that contains a
367 # configuration script generated by Autoconf, you may include it under
368 # the same distribution terms that you use for the rest of that program.
372 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
373 # is ksh but when the shell is invoked as "sh" and the current value of
374 # the _XPG environment variable is not equal to 1 (one), the special
375 # positional parameter $0, within a function call, is the name of the
379 # RH: define SED for historic ltconfig's generated by Libtool 1.3
380 [ -z "$SED" ] && SED=sed
382 # The name of this program:
383 progname=`echo "$progpath" | $SED $basename`
393 TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
397 # Check that we have a working $echo.
398 if test "X$1" = X--no-reexec; then
399 # Discard the --no-reexec flag, and continue.
401 elif test "X$1" = X--fallback-echo; then
402 # Avoid inline document here, it may be left over
404 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
405 # Yippee, $echo works!
408 # Restart under the correct shell, and then maybe $echo will work.
409 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
412 if test "X$1" = X--fallback-echo; then
413 # used as fallback echo
422 help="Try \`$progname --help' for more information."
423 magic="%%%MAGIC variable%%%"
428 # Sed substitution that helps us do robust quoting. It backslashifies
429 # metacharacters that are still active within double-quoted strings.
430 Xsed="${SED}"' -e 1s/^X//'
431 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
432 # test EBCDIC or ASCII
433 case `echo A|tr A '\301'` in
434 A) # EBCDIC based system
435 SP2NL="tr '\100' '\n'"
436 NL2SP="tr '\r\n' '\100\100'"
438 *) # Assume ASCII based system
439 SP2NL="tr '\040' '\012'"
440 NL2SP="tr '\015\012' '\040\040'"
445 # Only set LANG and LC_ALL to C if already set.
446 # These must not be set unconditionally because not all systems understand
447 # e.g. LANG=C (notably SCO).
448 # We save the old values to restore during execute mode.
449 if test "${LC_ALL+set}" = set; then
450 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
452 if test "${LANG+set}" = set; then
453 save_LANG="$LANG"; LANG=C; export LANG
456 # Make sure IFS has a sensible default
460 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
461 $echo "$modename: not configured to build any kind of library" 1>&2
462 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
475 lo2o="s/\\.lo\$/.${objext}/"
476 o2lo="s/\\.${objext}\$/.lo/"
478 #####################################
479 # Shell function definitions:
480 # This seems to be the best place for them
482 # func_win32_libid arg
483 # return the library type of file 'arg'
485 # Need a lot of goo to handle *both* DLLs and import libs
486 # Has to be a shell function in order to 'eat' the argument
487 # that is supplied when $file_magic_command is called.
488 func_win32_libid () {
489 win32_libid_type="unknown"
490 win32_fileres=`file -L $1 2>/dev/null`
491 case $win32_fileres in
492 *ar\ archive\ import\ library*) # definitely import
493 win32_libid_type="x86 archive import"
495 *ar\ archive*) # could be an import, or static
496 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
497 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
498 win32_nmres=`eval $NM -f posix -A $1 | \
499 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
500 if test "X$win32_nmres" = "Ximport" ; then
501 win32_libid_type="x86 archive import"
503 win32_libid_type="x86 archive static"
508 win32_libid_type="x86 DLL"
510 *executable*) # but shell scripts are "executable" too...
511 case $win32_fileres in
512 *MS\ Windows\ PE\ Intel*)
513 win32_libid_type="x86 DLL"
518 $echo $win32_libid_type
523 # Infer tagged configuration to use if any are available and
524 # if one wasn't chosen via the "--tag" command line option.
525 # Only attempt this if the compiler in the base compile
526 # command doesn't match the default compiler.
527 # arg is usually of the form 'gcc ...'
529 if test -n "$available_tags" && test -z "$tagname"; then
533 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
537 CC_quoted="$CC_quoted $arg"
540 # Blanks in the command may have been stripped by the calling shell,
541 # but not from the CC environment variable when configure was run.
542 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
543 # Blanks at the start of $base_compile will cause this to fail
544 # if we don't check for them as well.
546 for z in $available_tags; do
547 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
548 # Evaluate the configuration.
549 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
552 # Double-quote args containing other shell metacharacters.
554 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
558 CC_quoted="$CC_quoted $arg"
561 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
562 # The compiler in the base compile command matches
563 # the one in the tagged configuration.
564 # Assume this is the tagged configuration we want.
571 # If $tagname still isn't set, then no tagged configuration
572 # was found and let the user know that the "--tag" command
573 # line option must be used.
574 if test -z "$tagname"; then
575 $echo "$modename: unable to infer tagged configuration"
576 $echo "$modename: specify a tag with \`--tag'" 1>&2
579 # $echo "$modename: using $tagname tagged configuration"
585 # End of Shell function definitions
586 #####################################
589 eval std_shrext=\"$shrext_cmds\"
591 # Parse our command line options once, thoroughly.
592 while test "$#" -gt 0
598 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
602 # If the previous option needs an argument, assign it.
603 if test -n "$prev"; then
606 execute_dlfiles="$execute_dlfiles $arg"
610 preserve_args="${preserve_args}=$arg"
612 # Check whether tagname contains only valid characters
615 $echo "$progname: invalid tag name: $tagname" 1>&2
622 # Don't test for the "default" C tag, as we know, it's there, but
623 # not specially marked.
626 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
627 taglist="$taglist $tagname"
628 # Evaluate the configuration.
629 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
631 $echo "$progname: ignoring unknown tag $tagname" 1>&2
646 # Have we seen a non-optional argument yet?
653 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
655 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
656 $echo "This is free software; see the source for copying conditions. There is NO"
657 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
662 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
663 # Now print the configurations for the tags.
664 for tagname in $taglist; do
665 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
671 $echo "$progname: enabling shell trace mode"
673 preserve_args="$preserve_args $arg"
682 if test "$build_libtool_libs" = yes; then
683 $echo "enable shared libraries"
685 $echo "disable shared libraries"
687 if test "$build_old_libs" = yes; then
688 $echo "enable static libraries"
690 $echo "disable static libraries"
695 --finish) mode="finish" ;;
697 --mode) prevopt="--mode" prev=mode ;;
698 --mode=*) mode="$optarg" ;;
700 --preserve-dup-deps) duplicate_deps="yes" ;;
704 preserve_args="$preserve_args $arg"
707 --tag) prevopt="--tag" prev=tag ;;
709 set tag "$optarg" ${1+"$@"}
712 preserve_args="$preserve_args --tag"
721 $echo "$modename: unrecognized option \`$arg'" 1>&2
733 if test -n "$prevopt"; then
734 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
739 # If this variable is set in any of the actions, the command in it
740 # will be execed at the end. This prevents here-documents from being
741 # left over by shells.
744 if test -z "$show_help"; then
746 # Infer the operation mode.
747 if test -z "$mode"; then
748 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
749 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
751 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
763 *db | *dbx | *strace | *truss)
773 # If we have no mode, but dlfiles were specified, then do execute mode.
774 test -n "$execute_dlfiles" && mode=execute
776 # Just use the default operation mode.
777 if test -z "$mode"; then
778 if test -n "$nonopt"; then
779 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
781 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
788 # Only execute mode is allowed to have -dlopen flags.
789 if test -n "$execute_dlfiles" && test "$mode" != execute; then
790 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
795 # Change the help message to a mode-specific one.
797 help="Try \`$modename --help --mode=$mode' for more information."
799 # These modes are in order of execution frequency so that they run quickly.
801 # libtool compile mode
803 modename="$modename: compile"
804 # Get the compilation command and the source file.
806 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
817 # do not "continue". Instead, add this to base_compile
829 # Accept any command-line options.
832 if test -n "$libobj" ; then
833 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
840 -static | -prefer-pic | -prefer-non-pic)
851 arg_mode=arg # the next one goes into the "base_compile" arg list
852 continue # The current "srcfile" will either be retained or
853 ;; # replaced later. I would guess that would be a bug.
856 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
858 save_ifs="$IFS"; IFS=','
862 # Double-quote args containing other shell metacharacters.
863 # Many Bourne shells cannot handle close brackets correctly
864 # in scan sets, so we specify it separately.
866 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
870 lastarg="$lastarg $arg"
873 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
875 # Add the arguments to base_compile.
876 base_compile="$base_compile $lastarg"
881 # Accept the current argument as the source file.
882 # The previous "srcfile" becomes the current argument.
889 esac # case $arg_mode
891 # Aesthetically quote the previous argument.
892 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
895 # Double-quote args containing other shell metacharacters.
896 # Many Bourne shells cannot handle close brackets correctly
897 # in scan sets, so we specify it separately.
898 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
899 lastarg="\"$lastarg\""
903 base_compile="$base_compile $lastarg"
908 $echo "$modename: you must specify an argument for -Xcompile"
912 $echo "$modename: you must specify a target with \`-o'" 1>&2
916 # Get the name of the library object.
917 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
921 # Recognize several different file suffixes.
922 # If the user specifies -o file.o, it is replaced with file.lo
932 *.class) xform=class ;;
937 *.java) xform=java ;;
940 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
943 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
945 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
950 func_infer_tag $base_compile
952 for arg in $later; do
971 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
972 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
973 if test "X$xdir" = "X$obj"; then
978 lobj=${xdir}$objdir/$objname
980 if test -z "$base_compile"; then
981 $echo "$modename: you must specify a compilation command" 1>&2
986 # Delete any leftover library objects.
987 if test "$build_old_libs" = yes; then
988 removelist="$obj $lobj $libobj ${libobj}T"
990 removelist="$lobj $libobj ${libobj}T"
994 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
996 # On Cygwin there's no "real" PIC flag so we must build both object types
998 cygwin* | mingw* | pw32* | os2*)
1002 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1003 # non-PIC code in shared libraries is not supported
1007 # Calculate the filename of the output object if compiler does
1008 # not support -o with -c
1009 if test "$compiler_c_o" = no; then
1010 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1011 lockfile="$output_obj.lock"
1012 removelist="$removelist $output_obj $lockfile"
1013 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1020 # Lock this critical section if it is needed
1021 # We use this script file to make the link, it avoids creating a new file
1022 if test "$need_locks" = yes; then
1023 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1024 $show "Waiting for $lockfile to be removed"
1027 elif test "$need_locks" = warn; then
1028 if test -f "$lockfile"; then
1030 *** ERROR, $lockfile exists and contains:
1031 `cat $lockfile 2>/dev/null`
1033 This indicates that another process is trying to use the same
1034 temporary object file, and libtool could not work around it because
1035 your compiler does not support \`-c' and \`-o' together. If you
1036 repeat this compilation, it may succeed, by chance, but you had better
1037 avoid parallel builds (make -j) in this platform, or get a better
1040 $run $rm $removelist
1043 $echo $srcfile > "$lockfile"
1046 if test -n "$fix_srcfile_path"; then
1047 eval srcfile=\"$fix_srcfile_path\"
1050 $run $rm "$libobj" "${libobj}T"
1052 # Create a libtool object file (analogous to a ".la" file),
1053 # but don't create it if we're doing a dry run.
1054 test -z "$run" && cat > ${libobj}T <<EOF
1055 # $libobj - a libtool object file
1056 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1058 # Please DO NOT delete this file!
1059 # It is necessary for linking the library.
1061 # Name of the PIC object.
1064 # Only build a PIC object if we are building libtool libraries.
1065 if test "$build_libtool_libs" = yes; then
1066 # Without this assignment, base_compile gets emptied.
1067 fbsd_hideous_sh_bug=$base_compile
1069 if test "$pic_mode" != no; then
1070 command="$base_compile $srcfile $pic_flag"
1072 # Don't build PIC code
1073 command="$base_compile $srcfile"
1076 if test ! -d "${xdir}$objdir"; then
1077 $show "$mkdir ${xdir}$objdir"
1078 $run $mkdir ${xdir}$objdir
1080 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
1085 if test -z "$output_obj"; then
1086 # Place PIC objects in $objdir
1087 command="$command -o $lobj"
1090 $run $rm "$lobj" "$output_obj"
1093 if $run eval "$command"; then :
1095 test -n "$output_obj" && $run $rm $removelist
1099 if test "$need_locks" = warn &&
1100 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1102 *** ERROR, $lockfile contains:
1103 `cat $lockfile 2>/dev/null`
1105 but it should contain:
1108 This indicates that another process is trying to use the same
1109 temporary object file, and libtool could not work around it because
1110 your compiler does not support \`-c' and \`-o' together. If you
1111 repeat this compilation, it may succeed, by chance, but you had better
1112 avoid parallel builds (make -j) in this platform, or get a better
1115 $run $rm $removelist
1119 # Just move the object if needed, then go on to compile the next one
1120 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1121 $show "$mv $output_obj $lobj"
1122 if $run $mv $output_obj $lobj; then :
1125 $run $rm $removelist
1130 # Append the name of the PIC object to the libtool object file.
1131 test -z "$run" && cat >> ${libobj}T <<EOF
1132 pic_object='$objdir/$objname'
1136 # Allow error messages only from the first compilation.
1137 if test "$suppress_opt" = yes; then
1138 suppress_output=' >/dev/null 2>&1'
1141 # No PIC object so indicate it doesn't exist in the libtool
1143 test -z "$run" && cat >> ${libobj}T <<EOF
1149 # Only build a position-dependent object if we build old libraries.
1150 if test "$build_old_libs" = yes; then
1151 if test "$pic_mode" != yes; then
1152 # Don't build PIC code
1153 command="$base_compile $srcfile"
1155 command="$base_compile $srcfile $pic_flag"
1157 if test "$compiler_c_o" = yes; then
1158 command="$command -o $obj"
1161 # Suppress compiler output if we already did a PIC compilation.
1162 command="$command$suppress_output"
1163 $run $rm "$obj" "$output_obj"
1165 if $run eval "$command"; then :
1167 $run $rm $removelist
1171 if test "$need_locks" = warn &&
1172 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1174 *** ERROR, $lockfile contains:
1175 `cat $lockfile 2>/dev/null`
1177 but it should contain:
1180 This indicates that another process is trying to use the same
1181 temporary object file, and libtool could not work around it because
1182 your compiler does not support \`-c' and \`-o' together. If you
1183 repeat this compilation, it may succeed, by chance, but you had better
1184 avoid parallel builds (make -j) in this platform, or get a better
1187 $run $rm $removelist
1191 # Just move the object if needed
1192 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1193 $show "$mv $output_obj $obj"
1194 if $run $mv $output_obj $obj; then :
1197 $run $rm $removelist
1202 # Append the name of the non-PIC object the libtool object file.
1203 # Only append if the libtool object file exists.
1204 test -z "$run" && cat >> ${libobj}T <<EOF
1205 # Name of the non-PIC object.
1206 non_pic_object='$objname'
1210 # Append the name of the non-PIC object the libtool object file.
1211 # Only append if the libtool object file exists.
1212 test -z "$run" && cat >> ${libobj}T <<EOF
1213 # Name of the non-PIC object.
1219 $run $mv "${libobj}T" "${libobj}"
1221 # Unlock the critical section if it was locked
1222 if test "$need_locks" != no; then
1223 $run $rm "$lockfile"
1231 modename="$modename: link"
1233 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1234 # It is impossible to link a dll without this setting, and
1235 # we shouldn't force the makefile maintainer to figure out
1236 # which system we are compiling for in order to pass an extra
1237 # flag for every libtool invocation.
1238 # allow_undefined=no
1240 # FIXME: Unfortunately, there are problems with the above when trying
1241 # to make a dll which has undefined symbols, in which case not
1242 # even a static library is built. For now, we need to specify
1243 # -no-undefined on the libtool link line when we can be certain
1244 # that all symbols are satisfied, otherwise we get a static library.
1251 libtool_args="$nonopt"
1252 base_compile="$nonopt $@"
1253 compile_command="$nonopt"
1254 finalize_command="$nonopt"
1267 lib_search_path=`pwd`
1276 export_symbols_regex=
1284 precious_files_regex=
1285 prefer_static_libs=no
1298 func_infer_tag $base_compile
1300 # We need to know -static, to get the right output filenames.
1304 -all-static | -static)
1305 if test "X$arg" = "X-all-static"; then
1306 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1307 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1309 if test -n "$link_static_flag"; then
1310 dlopen_self=$dlopen_self_static
1313 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1314 dlopen_self=$dlopen_self_static
1317 build_libtool_libs=no
1319 prefer_static_libs=yes
1325 # See if our shared archives depend on static archives.
1326 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1328 # Go through the arguments, transforming them on the way.
1329 while test "$#" -gt 0; do
1333 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1334 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1338 libtool_args="$libtool_args $qarg"
1340 # If the previous option needs an argument, assign it.
1341 if test -n "$prev"; then
1344 compile_command="$compile_command @OUTPUT@"
1345 finalize_command="$finalize_command @OUTPUT@"
1351 if test "$preload" = no; then
1352 # Add the symbol object into the linking commands.
1353 compile_command="$compile_command @SYMFILE@"
1354 finalize_command="$finalize_command @SYMFILE@"
1358 *.la | *.lo) ;; # We handle these cases below.
1360 if test "$dlself" = no; then
1368 if test "$prev" = dlprefiles; then
1370 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1380 if test "$prev" = dlfiles; then
1381 dlfiles="$dlfiles $arg"
1383 dlprefiles="$dlprefiles $arg"
1391 export_symbols="$arg"
1392 if test ! -f "$arg"; then
1393 $echo "$modename: symbol file \`$arg' does not exist"
1400 export_symbols_regex="$arg"
1405 inst_prefix_dir="$arg"
1410 precious_files_regex="$arg"
1420 if test -f "$arg"; then
1423 for fil in `cat $save_arg`
1425 # moreargs="$moreargs $fil"
1427 # A libtool-controlled object.
1429 # Check to see that this really is a libtool object.
1430 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1435 # If there is no directory component, then add one.
1437 */* | *\\*) . $arg ;;
1441 if test -z "$pic_object" || \
1442 test -z "$non_pic_object" ||
1443 test "$pic_object" = none && \
1444 test "$non_pic_object" = none; then
1445 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1449 # Extract subdirectory from the argument.
1450 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1451 if test "X$xdir" = "X$arg"; then
1457 if test "$pic_object" != none; then
1458 # Prepend the subdirectory the object is found in.
1459 pic_object="$xdir$pic_object"
1461 if test "$prev" = dlfiles; then
1462 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1463 dlfiles="$dlfiles $pic_object"
1467 # If libtool objects are unsupported, then we need to preload.
1472 # CHECK ME: I think I busted this. -Ossama
1473 if test "$prev" = dlprefiles; then
1474 # Preload the old-style object.
1475 dlprefiles="$dlprefiles $pic_object"
1480 libobjs="$libobjs $pic_object"
1485 if test "$non_pic_object" != none; then
1486 # Prepend the subdirectory the object is found in.
1487 non_pic_object="$xdir$non_pic_object"
1489 # A standard non-PIC object
1490 non_pic_objects="$non_pic_objects $non_pic_object"
1491 if test -z "$pic_object" || test "$pic_object" = none ; then
1492 arg="$non_pic_object"
1496 # Only an error if not doing a dry-run.
1497 if test -z "$run"; then
1498 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1503 # Extract subdirectory from the argument.
1504 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1505 if test "X$xdir" = "X$arg"; then
1511 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1512 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1513 libobjs="$libobjs $pic_object"
1514 non_pic_objects="$non_pic_objects $non_pic_object"
1519 $echo "$modename: link input file \`$save_arg' does not exist"
1527 # We need an absolute path.
1529 [\\/]* | [A-Za-z]:[\\/]*) ;;
1531 $echo "$modename: only absolute run-paths are allowed" 1>&2
1535 if test "$prev" = rpath; then
1538 *) rpath="$rpath $arg" ;;
1543 *) xrpath="$xrpath $arg" ;;
1550 compiler_flags="$compiler_flags $qarg"
1552 compile_command="$compile_command $qarg"
1553 finalize_command="$finalize_command $qarg"
1557 linker_flags="$linker_flags $qarg"
1558 compiler_flags="$compiler_flags $wl$qarg"
1560 compile_command="$compile_command $wl$qarg"
1561 finalize_command="$finalize_command $wl$qarg"
1565 linker_flags="$linker_flags $qarg"
1566 compiler_flags="$compiler_flags $qarg"
1568 compile_command="$compile_command $qarg"
1569 finalize_command="$finalize_command $qarg"
1578 eval "$prev=\"\$arg\""
1583 fi # test -n "$prev"
1589 if test -n "$link_static_flag"; then
1590 compile_command="$compile_command $link_static_flag"
1591 finalize_command="$finalize_command $link_static_flag"
1597 # FIXME: remove this flag sometime in the future.
1598 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1622 -export-symbols | -export-symbols-regex)
1623 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1624 $echo "$modename: more than one -exported-symbols argument is not allowed"
1627 if test "X$arg" = "X-export-symbols"; then
1640 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1641 # so, if we see these flags be careful not to treat them like -L
1643 case $with_gcc/$host in
1644 no/*-*-irix* | /*-*-irix*)
1645 compile_command="$compile_command $arg"
1646 finalize_command="$finalize_command $arg"
1653 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1654 # We need an absolute path.
1656 [\\/]* | [A-Za-z]:[\\/]*) ;;
1658 absdir=`cd "$dir" && pwd`
1659 if test -z "$absdir"; then
1660 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1669 deplibs="$deplibs -L$dir"
1670 lib_search_path="$lib_search_path $dir"
1674 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1675 case :$dllsearchpath: in
1677 *) dllsearchpath="$dllsearchpath:$dir";;
1685 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1687 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1688 # These systems don't actually have a C or math library (as such)
1691 *-*-mingw* | *-*-os2*)
1692 # These systems don't actually have a C library (as such)
1693 test "X$arg" = "X-lc" && continue
1695 *-*-openbsd* | *-*-freebsd*)
1696 # Do not include libc due to us having libc/libc_r.
1697 test "X$arg" = "X-lc" && continue
1699 *-*-rhapsody* | *-*-darwin1.[012])
1700 # Rhapsody C and math libraries are in the System framework
1701 deplibs="$deplibs -framework System"
1704 elif test "X$arg" = "X-lc_r"; then
1706 *-*-openbsd* | *-*-freebsd*)
1707 # Do not include libc_r directly, use -pthread flag.
1712 deplibs="$deplibs $arg"
1716 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1717 deplibs="$deplibs $arg"
1726 # gcc -m* arguments should be passed to the linker via $compiler_flags
1727 # in order to pass architecture information to the linker
1728 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1729 # but this is not reliable with gcc because gcc may use -mfoo to
1730 # select a different linker, different libraries, etc, while
1731 # -Wl,-mfoo simply passes -mfoo to the linker.
1733 # Unknown arguments in both finalize_command and compile_command need
1734 # to be aesthetically quoted because they are evaled later.
1735 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1737 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1741 compile_command="$compile_command $arg"
1742 finalize_command="$finalize_command $arg"
1743 if test "$with_gcc" = "yes" ; then
1744 compiler_flags="$compiler_flags $arg"
1761 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1762 # The PATH hackery in wrapper scripts is required on Windows
1763 # in order for the loader to find any dlls it needs.
1764 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1765 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1768 *) no_install=yes ;;
1785 -precious-files-regex)
1806 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1807 # We need an absolute path.
1809 [\\/]* | [A-Za-z]:[\\/]*) ;;
1811 $echo "$modename: only absolute run-paths are allowed" 1>&2
1817 *) xrpath="$xrpath $dir" ;;
1823 # The effects of -static are defined in a previous loop.
1824 # We used to do the same as -all-static on platforms that
1825 # didn't have a PIC flag, but the assumption that the effects
1826 # would be equivalent was wrong. It would break on at least
1827 # Digital Unix and AIX.
1847 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1849 save_ifs="$IFS"; IFS=','
1850 for flag in $args; do
1853 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1858 compiler_flags="$compiler_flags $flag"
1861 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1865 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1867 save_ifs="$IFS"; IFS=','
1868 for flag in $args; do
1871 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1876 compiler_flags="$compiler_flags $wl$flag"
1877 linker_flags="$linker_flags $flag"
1880 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1898 # Some other compiler flag.
1900 # Unknown arguments in both finalize_command and compile_command need
1901 # to be aesthetically quoted because they are evaled later.
1902 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1904 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1911 # A standard object.
1916 # A libtool-controlled object.
1918 # Check to see that this really is a libtool object.
1919 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1924 # If there is no directory component, then add one.
1926 */* | *\\*) . $arg ;;
1930 if test -z "$pic_object" || \
1931 test -z "$non_pic_object" ||
1932 test "$pic_object" = none && \
1933 test "$non_pic_object" = none; then
1934 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1938 # Extract subdirectory from the argument.
1939 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1940 if test "X$xdir" = "X$arg"; then
1946 if test "$pic_object" != none; then
1947 # Prepend the subdirectory the object is found in.
1948 pic_object="$xdir$pic_object"
1950 if test "$prev" = dlfiles; then
1951 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1952 dlfiles="$dlfiles $pic_object"
1956 # If libtool objects are unsupported, then we need to preload.
1961 # CHECK ME: I think I busted this. -Ossama
1962 if test "$prev" = dlprefiles; then
1963 # Preload the old-style object.
1964 dlprefiles="$dlprefiles $pic_object"
1969 libobjs="$libobjs $pic_object"
1974 if test "$non_pic_object" != none; then
1975 # Prepend the subdirectory the object is found in.
1976 non_pic_object="$xdir$non_pic_object"
1978 # A standard non-PIC object
1979 non_pic_objects="$non_pic_objects $non_pic_object"
1980 if test -z "$pic_object" || test "$pic_object" = none ; then
1981 arg="$non_pic_object"
1985 # Only an error if not doing a dry-run.
1986 if test -z "$run"; then
1987 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1992 # Extract subdirectory from the argument.
1993 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1994 if test "X$xdir" = "X$arg"; then
2000 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2001 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2002 libobjs="$libobjs $pic_object"
2003 non_pic_objects="$non_pic_objects $non_pic_object"
2010 deplibs="$deplibs $arg"
2011 old_deplibs="$old_deplibs $arg"
2016 # A libtool-controlled library.
2018 if test "$prev" = dlfiles; then
2019 # This library was specified with -dlopen.
2020 dlfiles="$dlfiles $arg"
2022 elif test "$prev" = dlprefiles; then
2023 # The library was specified with -dlpreopen.
2024 dlprefiles="$dlprefiles $arg"
2027 deplibs="$deplibs $arg"
2032 # Some other compiler argument.
2034 # Unknown arguments in both finalize_command and compile_command need
2035 # to be aesthetically quoted because they are evaled later.
2036 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2038 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2045 # Now actually substitute the argument into the commands.
2046 if test -n "$arg"; then
2047 compile_command="$compile_command $arg"
2048 finalize_command="$finalize_command $arg"
2050 done # argument parsing loop
2052 if test -n "$prev"; then
2053 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2058 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2059 eval arg=\"$export_dynamic_flag_spec\"
2060 compile_command="$compile_command $arg"
2061 finalize_command="$finalize_command $arg"
2065 # calculate the name of the file, without its directory
2066 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2067 libobjs_save="$libobjs"
2069 if test -n "$shlibpath_var"; then
2070 # get the directories listed in $shlibpath_var
2071 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2075 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2076 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2078 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2079 if test "X$output_objdir" = "X$output"; then
2080 output_objdir="$objdir"
2082 output_objdir="$output_objdir/$objdir"
2084 # Create the object directory.
2085 if test ! -d "$output_objdir"; then
2086 $show "$mkdir $output_objdir"
2087 $run $mkdir $output_objdir
2089 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
2094 # Determine the type of output
2097 $echo "$modename: you must specify an output file" 1>&2
2101 *.$libext) linkmode=oldlib ;;
2102 *.lo | *.$objext) linkmode=obj ;;
2103 *.la) linkmode=lib ;;
2104 *) linkmode=prog ;; # Anything else should be a program.
2108 *cygwin* | *mingw* | *pw32*)
2109 # don't eliminate duplications in $postdeps and $predeps
2110 duplicate_compiler_generated_deps=yes
2113 duplicate_compiler_generated_deps=$duplicate_deps
2119 # Find all interdependent deplibs by searching for libraries
2120 # that are linked more than once (e.g. -la -lb -la)
2121 for deplib in $deplibs; do
2122 if test "X$duplicate_deps" = "Xyes" ; then
2124 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2127 libs="$libs $deplib"
2130 if test "$linkmode" = lib; then
2131 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2133 # Compute libraries that are listed more than once in $predeps
2134 # $postdeps and mark them as special (i.e., whose duplicates are
2135 # not to be eliminated).
2137 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2138 for pre_post_dep in $predeps $postdeps; do
2139 case "$pre_post_deps " in
2140 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2142 pre_post_deps="$pre_post_deps $pre_post_dep"
2151 need_relink=no # whether we're linking any uninstalled libtool libraries
2152 notinst_deplibs= # not-installed libtool libraries
2153 notinst_path= # paths that contain not-installed libtool libraries
2157 for file in $dlfiles $dlprefiles; do
2161 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2173 passes="conv scan dlopen dlpreopen link"
2178 for pass in $passes; do
2179 if test "$linkmode,$pass" = "lib,link" ||
2180 test "$linkmode,$pass" = "prog,scan"; then
2184 if test "$linkmode" = prog; then
2186 dlopen) libs="$dlfiles" ;;
2187 dlpreopen) libs="$dlprefiles" ;;
2188 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2191 if test "$pass" = dlopen; then
2192 # Collect dlpreopened libraries
2193 save_deplibs="$deplibs"
2196 for deplib in $libs; do
2200 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2201 if test "$linkmode,$pass" = "prog,link"; then
2202 compile_deplibs="$deplib $compile_deplibs"
2203 finalize_deplibs="$deplib $finalize_deplibs"
2205 deplibs="$deplib $deplibs"
2210 if test "$linkmode" != lib && test "$linkmode" != prog; then
2211 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2214 if test "$pass" = conv; then
2215 deplibs="$deplib $deplibs"
2218 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2219 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2220 for search_ext in .la $std_shrext .so .a; do
2221 # Search the libtool library
2222 lib="$searchdir/lib${name}${search_ext}"
2223 if test -f "$lib"; then
2224 if test "$search_ext" = ".la"; then
2233 if test "$found" != yes; then
2234 # deplib doesn't seem to be a libtool library
2235 if test "$linkmode,$pass" = "prog,link"; then
2236 compile_deplibs="$deplib $compile_deplibs"
2237 finalize_deplibs="$deplib $finalize_deplibs"
2239 deplibs="$deplib $deplibs"
2240 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2243 else # deplib is a libtool library
2244 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2245 # We need to do some special things here, and not later.
2246 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2247 case " $predeps $postdeps " in
2249 if (${SED} -e '2q' $lib |
2250 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2254 */* | *\\*) . $lib ;;
2257 for l in $old_library $library_names; do
2260 if test "X$ll" = "X$old_library" ; then # only static version available
2262 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2263 test "X$ladir" = "X$lib" && ladir="."
2264 lib=$ladir/$old_library
2265 if test "$linkmode,$pass" = "prog,link"; then
2266 compile_deplibs="$deplib $compile_deplibs"
2267 finalize_deplibs="$deplib $finalize_deplibs"
2269 deplibs="$deplib $deplibs"
2270 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2284 deplibs="$deplib $deplibs"
2285 test "$pass" = conv && continue
2286 newdependency_libs="$deplib $newdependency_libs"
2287 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2290 if test "$pass" = conv; then
2291 deplibs="$deplib $deplibs"
2294 if test "$pass" = scan; then
2295 deplibs="$deplib $deplibs"
2297 compile_deplibs="$deplib $compile_deplibs"
2298 finalize_deplibs="$deplib $finalize_deplibs"
2300 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2303 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2309 if test "$pass" = link; then
2310 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2311 # Make sure the xrpath contains only unique directories.
2314 *) xrpath="$xrpath $dir" ;;
2317 deplibs="$deplib $deplibs"
2320 *.la) lib="$deplib" ;;
2322 if test "$pass" = conv; then
2323 deplibs="$deplib $deplibs"
2328 if test "$deplibs_check_method" != pass_all; then
2330 $echo "*** Warning: Trying to link with static lib archive $deplib."
2331 $echo "*** I have the capability to make that library automatically link in when"
2332 $echo "*** you link to this library. But I can only do this if you have a"
2333 $echo "*** shared version of the library, which you do not appear to have"
2334 $echo "*** because the file extensions .$libext of this argument makes me believe"
2335 $echo "*** that it is just a static archive that I should not used here."
2338 $echo "*** Warning: Linking the shared library $output against the"
2339 $echo "*** static library $deplib is not portable!"
2340 deplibs="$deplib $deplibs"
2345 if test "$pass" != link; then
2346 deplibs="$deplib $deplibs"
2348 compile_deplibs="$deplib $compile_deplibs"
2349 finalize_deplibs="$deplib $finalize_deplibs"
2356 if test "$pass" = conv; then
2357 deplibs="$deplib $deplibs"
2358 elif test "$linkmode" = prog; then
2359 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2360 # If there is no dlopen support or we're linking statically,
2361 # we need to preload.
2362 newdlprefiles="$newdlprefiles $deplib"
2363 compile_deplibs="$deplib $compile_deplibs"
2364 finalize_deplibs="$deplib $finalize_deplibs"
2366 newdlfiles="$newdlfiles $deplib"
2376 if test "$found" = yes || test -f "$lib"; then :
2378 $echo "$modename: cannot find the library \`$lib'" 1>&2
2382 # Check to see that this really is a libtool archive.
2383 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2385 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2389 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2390 test "X$ladir" = "X$lib" && ladir="."
2398 # If the library was installed with an old release of libtool,
2399 # it will not redefine variables installed, or shouldnotlink
2405 */* | *\\*) . $lib ;;
2409 if test "$linkmode,$pass" = "lib,link" ||
2410 test "$linkmode,$pass" = "prog,scan" ||
2411 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2412 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2413 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2416 if test "$pass" = conv; then
2417 # Only check for convenience libraries
2418 deplibs="$lib $deplibs"
2419 if test -z "$libdir"; then
2420 if test -z "$old_library"; then
2421 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2424 # It is a libtool convenience library, so add in its objects.
2425 convenience="$convenience $ladir/$objdir/$old_library"
2426 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2428 for deplib in $dependency_libs; do
2429 deplibs="$deplib $deplibs"
2430 if test "X$duplicate_deps" = "Xyes" ; then
2431 case "$tmp_libs " in
2432 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2435 tmp_libs="$tmp_libs $deplib"
2437 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2438 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2445 # Get the name of the library we link against.
2447 for l in $old_library $library_names; do
2450 if test -z "$linklib"; then
2451 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2455 # This library was specified with -dlopen.
2456 if test "$pass" = dlopen; then
2457 if test -z "$libdir"; then
2458 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2461 if test -z "$dlname" ||
2462 test "$dlopen_support" != yes ||
2463 test "$build_libtool_libs" = no; then
2464 # If there is no dlname, no dlopen support or we're linking
2465 # statically, we need to preload. We also need to preload any
2466 # dependent libraries so libltdl's deplib preloader doesn't
2467 # bomb out in the load deplibs phase.
2468 dlprefiles="$dlprefiles $lib $dependency_libs"
2470 newdlfiles="$newdlfiles $lib"
2475 # We need an absolute path.
2477 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2479 abs_ladir=`cd "$ladir" && pwd`
2480 if test -z "$abs_ladir"; then
2481 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2482 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2487 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2489 # Find the relevant object directory and library name.
2490 if test "X$installed" = Xyes; then
2491 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2492 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2501 dir="$ladir/$objdir"
2502 absdir="$abs_ladir/$objdir"
2503 # Remove this search path later
2504 notinst_path="$notinst_path $abs_ladir"
2505 fi # $installed = yes
2506 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2508 # This library was specified with -dlpreopen.
2509 if test "$pass" = dlpreopen; then
2510 if test -z "$libdir"; then
2511 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2514 # Prefer using a static library (so that no silly _DYNAMIC symbols
2515 # are required to link).
2516 if test -n "$old_library"; then
2517 newdlprefiles="$newdlprefiles $dir/$old_library"
2518 # Otherwise, use the dlname, so that lt_dlopen finds it.
2519 elif test -n "$dlname"; then
2520 newdlprefiles="$newdlprefiles $dir/$dlname"
2522 newdlprefiles="$newdlprefiles $dir/$linklib"
2524 fi # $pass = dlpreopen
2526 if test -z "$libdir"; then
2527 # Link the convenience library
2528 if test "$linkmode" = lib; then
2529 deplibs="$dir/$old_library $deplibs"
2530 elif test "$linkmode,$pass" = "prog,link"; then
2531 compile_deplibs="$dir/$old_library $compile_deplibs"
2532 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2534 deplibs="$lib $deplibs" # used for prog,scan pass
2540 if test "$linkmode" = prog && test "$pass" != link; then
2541 newlib_search_path="$newlib_search_path $ladir"
2542 deplibs="$lib $deplibs"
2545 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2546 test "$build_libtool_libs" = no; then
2551 for deplib in $dependency_libs; do
2553 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2555 # Need to link against all dependency_libs?
2556 if test "$linkalldeplibs" = yes; then
2557 deplibs="$deplib $deplibs"
2559 # Need to hardcode shared library paths
2560 # or/and link against static libraries
2561 newdependency_libs="$deplib $newdependency_libs"
2563 if test "X$duplicate_deps" = "Xyes" ; then
2564 case "$tmp_libs " in
2565 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2568 tmp_libs="$tmp_libs $deplib"
2571 fi # $linkmode = prog...
2573 if test "$linkmode,$pass" = "prog,link"; then
2574 if test -n "$library_names" &&
2575 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2576 # We need to hardcode the library path
2577 if test -n "$shlibpath_var"; then
2578 # Make sure the rpath contains only unique directories.
2579 case "$temp_rpath " in
2582 *) temp_rpath="$temp_rpath $dir" ;;
2586 # Hardcode the library path.
2587 # Skip directories that are in the system default run-time
2589 case " $sys_lib_dlsearch_path " in
2592 case "$compile_rpath " in
2594 *) compile_rpath="$compile_rpath $absdir"
2598 case " $sys_lib_dlsearch_path " in
2601 case "$finalize_rpath " in
2603 *) finalize_rpath="$finalize_rpath $libdir"
2607 fi # $linkmode,$pass = prog,link...
2609 if test "$alldeplibs" = yes &&
2610 { test "$deplibs_check_method" = pass_all ||
2611 { test "$build_libtool_libs" = yes &&
2612 test -n "$library_names"; }; }; then
2613 # We only need to search for static libraries
2618 link_static=no # Whether the deplib will be linked statically
2619 if test -n "$library_names" &&
2620 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2621 if test "$installed" = no; then
2622 notinst_deplibs="$notinst_deplibs $lib"
2625 # This is a shared library
2627 # Warn about portability, can't link against -module's on
2628 # some systems (darwin)
2629 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2631 if test "$linkmode" = prog; then
2632 $echo "*** Warning: Linking the executable $output against the loadable module"
2634 $echo "*** Warning: Linking the shared library $output against the loadable module"
2636 $echo "*** $linklib is not portable!"
2638 if test "$linkmode" = lib &&
2639 test "$hardcode_into_libs" = yes; then
2640 # Hardcode the library path.
2641 # Skip directories that are in the system default run-time
2643 case " $sys_lib_dlsearch_path " in
2646 case "$compile_rpath " in
2648 *) compile_rpath="$compile_rpath $absdir"
2652 case " $sys_lib_dlsearch_path " in
2655 case "$finalize_rpath " in
2657 *) finalize_rpath="$finalize_rpath $libdir"
2663 if test -n "$old_archive_from_expsyms_cmds"; then
2664 # figure out the soname
2665 set dummy $library_names
2668 libname=`eval \\$echo \"$libname_spec\"`
2669 # use dlname if we got it. it's perfectly good, no?
2670 if test -n "$dlname"; then
2672 elif test -n "$soname_spec"; then
2676 major=`expr $current - $age`
2680 eval soname=\"$soname_spec\"
2685 # Make a new name for the extract_expsyms_cmds to use
2687 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2688 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2690 # If the library has no export list, then create one now
2691 if test -f "$output_objdir/$soname-def"; then :
2693 $show "extracting exported symbol list from \`$soname'"
2694 save_ifs="$IFS"; IFS='~'
2695 cmds=$extract_expsyms_cmds
2696 for cmd in $cmds; do
2700 $run eval "$cmd" || exit $?
2706 if test -f "$output_objdir/$newlib"; then :; else
2707 $show "generating import library for \`$soname'"
2708 save_ifs="$IFS"; IFS='~'
2709 cmds=$old_archive_from_expsyms_cmds
2710 for cmd in $cmds; do
2714 $run eval "$cmd" || exit $?
2718 # make sure the library variables are pointing to the new library
2721 fi # test -n "$old_archive_from_expsyms_cmds"
2723 if test "$linkmode" = prog || test "$mode" != relink; then
2728 case $hardcode_action in
2729 immediate | unsupported)
2730 if test "$hardcode_direct" = no; then
2733 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2735 # if the lib is a module then we can not link against
2736 # it, someone is ignoring the new warnings I added
2737 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2738 $echo "** Warning, lib $linklib is a module, not a shared library"
2739 if test -z "$old_library" ; then
2741 $echo "** And there doesn't seem to be a static archive available"
2742 $echo "** The link will probably fail, sorry"
2744 add="$dir/$old_library"
2748 elif test "$hardcode_minus_L" = no; then
2750 *-*-sunos*) add_shlibpath="$dir" ;;
2754 elif test "$hardcode_shlibpath_var" = no; then
2755 add_shlibpath="$dir"
2762 if test "$hardcode_direct" = yes; then
2764 elif test "$hardcode_minus_L" = yes; then
2766 # Try looking first in the location we're being installed to.
2767 if test -n "$inst_prefix_dir"; then
2770 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2775 elif test "$hardcode_shlibpath_var" = yes; then
2776 add_shlibpath="$dir"
2785 if test "$lib_linked" != yes; then
2786 $echo "$modename: configuration error: unsupported hardcode properties"
2790 if test -n "$add_shlibpath"; then
2791 case :$compile_shlibpath: in
2792 *":$add_shlibpath:"*) ;;
2793 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2796 if test "$linkmode" = prog; then
2797 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2798 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2800 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2801 test -n "$add" && deplibs="$add $deplibs"
2802 if test "$hardcode_direct" != yes && \
2803 test "$hardcode_minus_L" != yes && \
2804 test "$hardcode_shlibpath_var" = yes; then
2805 case :$finalize_shlibpath: in
2807 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2813 if test "$linkmode" = prog || test "$mode" = relink; then
2817 # Finalize command for both is simple: just hardcode it.
2818 if test "$hardcode_direct" = yes; then
2819 add="$libdir/$linklib"
2820 elif test "$hardcode_minus_L" = yes; then
2823 elif test "$hardcode_shlibpath_var" = yes; then
2824 case :$finalize_shlibpath: in
2826 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2829 elif test "$hardcode_automatic" = yes; then
2830 if test -n "$inst_prefix_dir" &&
2831 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2832 add="$inst_prefix_dir$libdir/$linklib"
2834 add="$libdir/$linklib"
2837 # We cannot seem to hardcode it, guess we'll fake it.
2839 # Try looking first in the location we're being installed to.
2840 if test -n "$inst_prefix_dir"; then
2843 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2850 if test "$linkmode" = prog; then
2851 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2852 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2854 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2855 test -n "$add" && deplibs="$add $deplibs"
2858 elif test "$linkmode" = prog; then
2859 # Here we assume that one of hardcode_direct or hardcode_minus_L
2860 # is not unsupported. This is valid on all known static and
2862 if test "$hardcode_direct" != unsupported; then
2863 test -n "$old_library" && linklib="$old_library"
2864 compile_deplibs="$dir/$linklib $compile_deplibs"
2865 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2867 compile_deplibs="-l$name -L$dir $compile_deplibs"
2868 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2870 elif test "$build_libtool_libs" = yes; then
2871 # Not a shared library
2872 if test "$deplibs_check_method" != pass_all; then
2873 # We're trying link a shared library against a static one
2874 # but the system doesn't support it.
2876 # Just print a warning and add the library to dependency_libs so
2877 # that the program can be linked against the static library.
2879 $echo "*** Warning: This system can not link to static lib archive $lib."
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."
2883 if test "$module" = yes; then
2884 $echo "*** But as you try to build a module library, libtool will still create "
2885 $echo "*** a static module, that should work as long as the dlopening application"
2886 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2887 if test -z "$global_symbol_pipe"; then
2889 $echo "*** However, this would only work if libtool was able to extract symbol"
2890 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2891 $echo "*** not find such a program. So, this module is probably useless."
2892 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2894 if test "$build_old_libs" = no; then
2895 build_libtool_libs=module
2898 build_libtool_libs=no
2902 convenience="$convenience $dir/$old_library"
2903 old_convenience="$old_convenience $dir/$old_library"
2904 deplibs="$dir/$old_library $deplibs"
2907 fi # link shared/static library?
2909 if test "$linkmode" = lib; then
2910 if test -n "$dependency_libs" &&
2911 { test "$hardcode_into_libs" != yes ||
2912 test "$build_old_libs" = yes ||
2913 test "$link_static" = yes; }; then
2914 # Extract -R from dependency_libs
2916 for libdir in $dependency_libs; do
2918 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2920 *" $temp_xrpath "*) ;;
2921 *) xrpath="$xrpath $temp_xrpath";;
2923 *) temp_deplibs="$temp_deplibs $libdir";;
2926 dependency_libs="$temp_deplibs"
2929 newlib_search_path="$newlib_search_path $absdir"
2930 # Link against this library
2931 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2932 # ... and its dependency_libs
2934 for deplib in $dependency_libs; do
2935 newdependency_libs="$deplib $newdependency_libs"
2936 if test "X$duplicate_deps" = "Xyes" ; then
2937 case "$tmp_libs " in
2938 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2941 tmp_libs="$tmp_libs $deplib"
2944 if test "$link_all_deplibs" != no; then
2945 # Add the search paths of all dependency libraries
2946 for deplib in $dependency_libs; do
2948 -L*) path="$deplib" ;;
2950 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2951 test "X$dir" = "X$deplib" && dir="."
2952 # We need an absolute path.
2954 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2956 absdir=`cd "$dir" && pwd`
2957 if test -z "$absdir"; then
2958 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2963 if grep "^installed=no" $deplib > /dev/null; then
2964 path="$absdir/$objdir"
2966 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2967 if test -z "$libdir"; then
2968 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2971 if test "$absdir" != "$libdir"; then
2972 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2979 # we do not want to link against static libs,
2980 # but need to link against shared
2981 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2982 if test -n "$deplibrary_names" ; then
2983 for tmp in $deplibrary_names ; do
2986 if test -f "$path/$depdepl" ; then
2987 depdepl="$path/$depdepl"
2989 # do not add paths which are already there
2990 case " $newlib_search_path " in
2992 *) newlib_search_path="$newlib_search_path $path";;
3005 # Again, we only want to link against shared libraries
3006 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3007 for tmp in $newlib_search_path ; do
3008 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3009 eval depdepl="$tmp/lib$tmp_libs.dylib"
3020 case " $deplibs " in
3022 *) deplibs="$depdepl $deplibs" ;;
3024 case " $deplibs " in
3026 *) deplibs="$deplibs $path" ;;
3029 fi # link_all_deplibs != no
3031 done # for deplib in $libs
3032 dependency_libs="$newdependency_libs"
3033 if test "$pass" = dlpreopen; then
3034 # Link the dlpreopened libraries before other libraries
3035 for deplib in $save_deplibs; do
3036 deplibs="$deplib $deplibs"
3039 if test "$pass" != dlopen; then
3040 if test "$pass" != conv; then
3041 # Make sure lib_search_path contains only unique directories.
3043 for dir in $newlib_search_path; do
3044 case "$lib_search_path " in
3046 *) lib_search_path="$lib_search_path $dir" ;;
3052 if test "$linkmode,$pass" != "prog,link"; then
3055 vars="compile_deplibs finalize_deplibs"
3057 for var in $vars dependency_libs; do
3058 # Add libraries to $var in reverse order
3059 eval tmp_libs=\"\$$var\"
3061 for deplib in $tmp_libs; do
3062 # FIXME: Pedantically, this is the right thing to do, so
3063 # that some nasty dependency loop isn't accidentally
3065 #new_libs="$deplib $new_libs"
3066 # Pragmatically, this seems to cause very few problems in
3069 -L*) new_libs="$deplib $new_libs" ;;
3072 # And here is the reason: when a library appears more
3073 # than once as an explicit dependence of a library, or
3074 # is implicitly linked in more than once by the
3075 # compiler, it is considered special, and multiple
3076 # occurrences thereof are not removed. Compare this
3077 # with having the same library being listed as a
3078 # dependency of multiple other libraries: in this case,
3079 # we know (pedantically, we assume) the library does not
3080 # need to be listed more than once, so we keep only the
3081 # last copy. This is not always right, but it is rare
3082 # enough that we require users that really mean to play
3083 # such unportable linking tricks to link the library
3084 # using -Wl,-lname, so that libtool does not consider it
3085 # for duplicate removal.
3086 case " $specialdeplibs " in
3087 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3089 case " $new_libs " in
3091 *) new_libs="$deplib $new_libs" ;;
3099 for deplib in $new_libs; do
3102 case " $tmp_libs " in
3104 *) tmp_libs="$tmp_libs $deplib" ;;
3107 *) tmp_libs="$tmp_libs $deplib" ;;
3110 eval $var=\"$tmp_libs\"
3113 # Last step: remove runtime libs from dependency_libs
3114 # (they stay in deplibs)
3116 for i in $dependency_libs ; do
3117 case " $predeps $postdeps $compiler_lib_search_path " in
3122 if test -n "$i" ; then
3123 tmp_libs="$tmp_libs $i"
3126 dependency_libs=$tmp_libs
3128 if test "$linkmode" = prog; then
3129 dlfiles="$newdlfiles"
3130 dlprefiles="$newdlprefiles"
3135 if test -n "$deplibs"; then
3136 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3139 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3140 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3143 if test -n "$rpath"; then
3144 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3147 if test -n "$xrpath"; then
3148 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3151 if test -n "$vinfo"; then
3152 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3155 if test -n "$release"; then
3156 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3159 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3160 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3163 # Now set the variables for building old libraries.
3164 build_libtool_libs=no
3166 objs="$objs$old_deplibs"
3170 # Make sure we only generate libraries of the form `libNAME.la'.
3173 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3174 eval shared_ext=\"$shrext_cmds\"
3175 eval libname=\"$libname_spec\"
3178 if test "$module" = no; then
3179 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3183 if test "$need_lib_prefix" != no; then
3184 # Add the "lib" prefix for modules if required
3185 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3186 eval shared_ext=\"$shrext_cmds\"
3187 eval libname=\"$libname_spec\"
3189 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3194 if test -n "$objs"; then
3195 if test "$deplibs_check_method" != pass_all; then
3196 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3200 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3201 $echo "*** objects $objs is not portable!"
3202 libobjs="$libobjs $objs"
3206 if test "$dlself" != no; then
3207 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3211 if test "$#" -gt 2; then
3212 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3217 if test -z "$rpath"; then
3218 if test "$build_libtool_libs" = yes; then
3219 # Building a libtool convenience library.
3220 # Some compilers have problems with a `.al' extension so
3221 # convenience libraries should have the same extension an
3222 # archive normally would.
3223 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3224 build_libtool_libs=convenience
3228 if test -n "$vinfo"; then
3229 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3232 if test -n "$release"; then
3233 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3237 # Parse the version information argument.
3238 save_ifs="$IFS"; IFS=':'
3239 set dummy $vinfo 0 0 0
3242 if test -n "$8"; then
3243 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3248 # convert absolute version numbers to libtool ages
3249 # this retains compatibility with .la files and attempts
3250 # to make the code below a bit more comprehensible
3252 case $vinfo_number in
3256 number_revision="$4"
3258 # There are really only two kinds -- those that
3259 # use the current revision as the major version
3260 # and those that subtract age and use age as
3261 # a minor version. But, then there is irix
3262 # which has an extra 1 added just for fun
3264 case $version_type in
3265 darwin|linux|osf|windows)
3266 current=`expr $number_major + $number_minor`
3268 revision="$number_revision"
3270 freebsd-aout|freebsd-elf|sunos)
3271 current="$number_major"
3272 revision="$number_minor"
3276 current=`expr $number_major + $number_minor - 1`
3278 revision="$number_minor"
3289 # Check that each of the things are valid numbers.
3293 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3294 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3302 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3303 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3311 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3312 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3317 if test "$age" -gt "$current"; then
3318 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3319 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3323 # Calculate the version variables.
3327 case $version_type in
3331 # Like Linux, but with the current version available in
3332 # verstring for coding it into the library header
3333 major=.`expr $current - $age`
3334 versuffix="$major.$age.$revision"
3335 # Darwin ld doesn't like 0 for these options...
3336 minor_current=`expr $current + 1`
3337 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3342 versuffix=".$current.$revision";
3347 versuffix=".$current";
3351 major=`expr $current - $age + 1`
3353 case $version_type in
3354 nonstopux) verstring_prefix=nonstopux ;;
3355 *) verstring_prefix=sgi ;;
3357 verstring="$verstring_prefix$major.$revision"
3359 # Add in all the interfaces that we are compatible with.
3361 while test "$loop" -ne 0; do
3362 iface=`expr $revision - $loop`
3363 loop=`expr $loop - 1`
3364 verstring="$verstring_prefix$major.$iface:$verstring"
3367 # Before this point, $major must not contain `.'.
3369 versuffix="$major.$revision"
3373 major=.`expr $current - $age`
3374 versuffix="$major.$age.$revision"
3378 major=.`expr $current - $age`
3379 versuffix=".$current.$age.$revision"
3380 verstring="$current.$age.$revision"
3382 # Add in all the interfaces that we are compatible with.
3384 while test "$loop" -ne 0; do
3385 iface=`expr $current - $loop`
3386 loop=`expr $loop - 1`
3387 verstring="$verstring:${iface}.0"
3390 # Make executables depend on our current version.
3391 verstring="$verstring:${current}.0"
3396 versuffix=".$current.$revision"
3400 # Use '-' rather than '.', since we only want one
3401 # extension on DOS 8.3 filesystems.
3402 major=`expr $current - $age`
3407 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3408 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3413 # Clear the version info if we defaulted, and they specified a release.
3414 if test -z "$vinfo" && test -n "$release"; then
3416 case $version_type in
3418 # we can't check for "0.0" in archive_cmds due to quoting
3419 # problems, so we reset it completely
3426 if test "$need_version" = no; then
3433 # Remove version info from name if versioning should be avoided
3434 if test "$avoid_version" = yes && test "$need_version" = no; then
3440 # Check to see if the archive will have undefined symbols.
3441 if test "$allow_undefined" = yes; then
3442 if test "$allow_undefined_flag" = unsupported; then
3443 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3444 build_libtool_libs=no
3448 # Don't allow undefined symbols.
3449 allow_undefined_flag="$no_undefined_flag"
3453 if test "$mode" != relink; then
3454 # Remove our outputs, but don't remove object files since they
3455 # may have been created when compiling PIC objects.
3457 tempremovelist=`$echo "$output_objdir/*"`
3458 for p in $tempremovelist; do
3462 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3463 if test "X$precious_files_regex" != "X"; then
3464 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3469 removelist="$removelist $p"
3474 if test -n "$removelist"; then
3475 $show "${rm}r $removelist"
3476 $run ${rm}r $removelist
3480 # Now set the variables for building old libraries.
3481 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3482 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3484 # Transform .lo files to .o files.
3485 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3488 # Eliminate all temporary directories.
3489 for path in $notinst_path; do
3490 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3491 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3492 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3495 if test -n "$xrpath"; then
3496 # If the user specified any rpath flags, then add them.
3498 for libdir in $xrpath; do
3499 temp_xrpath="$temp_xrpath -R$libdir"
3500 case "$finalize_rpath " in
3502 *) finalize_rpath="$finalize_rpath $libdir" ;;
3505 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3506 dependency_libs="$temp_xrpath $dependency_libs"
3510 # Make sure dlfiles contains only unique files that won't be dlpreopened
3511 old_dlfiles="$dlfiles"
3513 for lib in $old_dlfiles; do
3514 case " $dlprefiles $dlfiles " in
3516 *) dlfiles="$dlfiles $lib" ;;
3520 # Make sure dlprefiles contains only unique files
3521 old_dlprefiles="$dlprefiles"
3523 for lib in $old_dlprefiles; do
3524 case "$dlprefiles " in
3526 *) dlprefiles="$dlprefiles $lib" ;;
3530 if test "$build_libtool_libs" = yes; then
3531 if test -n "$rpath"; then
3533 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3534 # these systems don't actually have a c library (as such)!
3536 *-*-rhapsody* | *-*-darwin1.[012])
3537 # Rhapsody C library is in the System framework
3538 deplibs="$deplibs -framework System"
3541 # Don't link with libc until the a.out ld.so is fixed.
3543 *-*-openbsd* | *-*-freebsd*)
3544 # Do not include libc due to us having libc/libc_r.
3545 test "X$arg" = "X-lc" && continue
3548 # Add libc to deplibs on all other systems if necessary.
3549 if test "$build_libtool_need_lc" = "yes"; then
3550 deplibs="$deplibs -lc"
3556 # Transform deplibs into only deplibs that can be linked in shared.
3558 libname_save=$libname
3559 release_save=$release
3560 versuffix_save=$versuffix
3562 # I'm not sure if I'm treating the release correctly. I think
3563 # release should show up in the -l (ie -lgmp5) so we don't want to
3564 # add it in twice. Is that correct?
3570 case $deplibs_check_method in
3572 # Don't check for shared/static. Everything works.
3573 # This might be a little naive. We might want to check
3574 # whether the library exists or not. But this is on
3575 # osf3 & osf4 and I'm not really sure... Just
3576 # implementing what was already the behavior.
3580 # This code stresses the "libraries are programs" paradigm to its
3581 # limits. Maybe even breaks it. We compile a program, linking it
3582 # against the deplibs as a proxy for the library. Then we can check
3583 # whether they linked in statically or dynamically with ldd.
3585 cat > conftest.c <<EOF
3586 int main() { return 0; }
3589 $LTCC -o conftest conftest.c $deplibs
3590 if test "$?" -eq 0 ; then
3591 ldd_output=`ldd conftest`
3592 for i in $deplibs; do
3593 name="`expr $i : '-l\(.*\)'`"
3594 # If $name is empty we are operating on a -L argument.
3595 if test "$name" != "" && test "$name" -ne "0"; then
3596 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3597 case " $predeps $postdeps " in
3599 newdeplibs="$newdeplibs $i"
3604 if test -n "$i" ; then
3605 libname=`eval \\$echo \"$libname_spec\"`
3606 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3607 set dummy $deplib_matches
3609 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3610 newdeplibs="$newdeplibs $i"
3614 $echo "*** Warning: dynamic linker does not accept needed library $i."
3615 $echo "*** I have the capability to make that library automatically link in when"
3616 $echo "*** you link to this library. But I can only do this if you have a"
3617 $echo "*** shared version of the library, which I believe you do not have"
3618 $echo "*** because a test_compile did reveal that the linker did not use it for"
3619 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3623 newdeplibs="$newdeplibs $i"
3627 # Error occurred in the first compile. Let's try to salvage
3628 # the situation: Compile a separate program for each library.
3629 for i in $deplibs; do
3630 name="`expr $i : '-l\(.*\)'`"
3631 # If $name is empty we are operating on a -L argument.
3632 if test "$name" != "" && test "$name" != "0"; then
3634 $LTCC -o conftest conftest.c $i
3636 if test "$?" -eq 0 ; then
3637 ldd_output=`ldd conftest`
3638 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3639 case " $predeps $postdeps " in
3641 newdeplibs="$newdeplibs $i"
3646 if test -n "$i" ; then
3647 libname=`eval \\$echo \"$libname_spec\"`
3648 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3649 set dummy $deplib_matches
3651 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3652 newdeplibs="$newdeplibs $i"
3656 $echo "*** Warning: dynamic linker does not accept needed library $i."
3657 $echo "*** I have the capability to make that library automatically link in when"
3658 $echo "*** you link to this library. But I can only do this if you have a"
3659 $echo "*** shared version of the library, which you do not appear to have"
3660 $echo "*** because a test_compile did reveal that the linker did not use this one"
3661 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3667 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3668 $echo "*** make it link in! You will probably need to install it or some"
3669 $echo "*** library that it depends on before this library will be fully"
3670 $echo "*** functional. Installing it before continuing would be even better."
3673 newdeplibs="$newdeplibs $i"
3679 set dummy $deplibs_check_method
3680 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3681 for a_deplib in $deplibs; do
3682 name="`expr $a_deplib : '-l\(.*\)'`"
3683 # If $name is empty we are operating on a -L argument.
3684 if test "$name" != "" && test "$name" != "0"; then
3685 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3686 case " $predeps $postdeps " in
3688 newdeplibs="$newdeplibs $a_deplib"
3693 if test -n "$a_deplib" ; then
3694 libname=`eval \\$echo \"$libname_spec\"`
3695 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3696 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3697 for potent_lib in $potential_libs; do
3698 # Follow soft links.
3699 if ls -lLd "$potent_lib" 2>/dev/null \
3700 | grep " -> " >/dev/null; then
3703 # The statement above tries to avoid entering an
3704 # endless loop below, in case of cyclic links.
3705 # We might still enter an endless loop, since a link
3706 # loop can be closed while we follow links,
3708 potlib="$potent_lib"
3709 while test -h "$potlib" 2>/dev/null; do
3710 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3712 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3713 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3716 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3718 | $EGREP "$file_magic_regex" > /dev/null; then
3719 newdeplibs="$newdeplibs $a_deplib"
3726 if test -n "$a_deplib" ; then
3729 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3730 $echo "*** I have the capability to make that library automatically link in when"
3731 $echo "*** you link to this library. But I can only do this if you have a"
3732 $echo "*** shared version of the library, which you do not appear to have"
3733 $echo "*** because I did check the linker path looking for a file starting"
3734 if test -z "$potlib" ; then
3735 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3737 $echo "*** with $libname and none of the candidates passed a file format test"
3738 $echo "*** using a file magic. Last file checked: $potlib"
3742 # Add a -L argument.
3743 newdeplibs="$newdeplibs $a_deplib"
3745 done # Gone through all deplibs.
3748 set dummy $deplibs_check_method
3749 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3750 for a_deplib in $deplibs; do
3751 name="`expr $a_deplib : '-l\(.*\)'`"
3752 # If $name is empty we are operating on a -L argument.
3753 if test -n "$name" && test "$name" != "0"; then
3754 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3755 case " $predeps $postdeps " in
3757 newdeplibs="$newdeplibs $a_deplib"
3762 if test -n "$a_deplib" ; then
3763 libname=`eval \\$echo \"$libname_spec\"`
3764 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3765 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3766 for potent_lib in $potential_libs; do
3767 potlib="$potent_lib" # see symlink-check above in file_magic test
3768 if eval $echo \"$potent_lib\" 2>/dev/null \
3770 | $EGREP "$match_pattern_regex" > /dev/null; then
3771 newdeplibs="$newdeplibs $a_deplib"
3778 if test -n "$a_deplib" ; then
3781 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3782 $echo "*** I have the capability to make that library automatically link in when"
3783 $echo "*** you link to this library. But I can only do this if you have a"
3784 $echo "*** shared version of the library, which you do not appear to have"
3785 $echo "*** because I did check the linker path looking for a file starting"
3786 if test -z "$potlib" ; then
3787 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3789 $echo "*** with $libname and none of the candidates passed a file format test"
3790 $echo "*** using a regex pattern. Last file checked: $potlib"
3794 # Add a -L argument.
3795 newdeplibs="$newdeplibs $a_deplib"
3797 done # Gone through all deplibs.
3801 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3802 -e 's/ -[LR][^ ]*//g'`
3803 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3804 for i in $predeps $postdeps ; do
3805 # can't use Xsed below, because $i might contain '/'
3806 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3809 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3810 | grep . >/dev/null; then
3812 if test "X$deplibs_check_method" = "Xnone"; then
3813 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3815 $echo "*** Warning: inter-library dependencies are not known to be supported."
3817 $echo "*** All declared inter-library dependencies are being dropped."
3822 versuffix=$versuffix_save
3824 release=$release_save
3825 libname=$libname_save
3829 *-*-rhapsody* | *-*-darwin1.[012])
3830 # On Rhapsody replace the C library is the System framework
3831 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3835 if test "$droppeddeps" = yes; then
3836 if test "$module" = yes; then
3838 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3839 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3840 $echo "*** a static module, that should work as long as the dlopening"
3841 $echo "*** application is linked with the -dlopen flag."
3842 if test -z "$global_symbol_pipe"; then
3844 $echo "*** However, this would only work if libtool was able to extract symbol"
3845 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3846 $echo "*** not find such a program. So, this module is probably useless."
3847 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3849 if test "$build_old_libs" = no; then
3850 oldlibs="$output_objdir/$libname.$libext"
3851 build_libtool_libs=module
3854 build_libtool_libs=no
3857 $echo "*** The inter-library dependencies that have been dropped here will be"
3858 $echo "*** automatically added whenever a program is linked with this library"
3859 $echo "*** or is declared to -dlopen it."
3861 if test "$allow_undefined" = no; then
3863 $echo "*** Since this library must not contain undefined symbols,"
3864 $echo "*** because either the platform does not support them or"
3865 $echo "*** it was explicitly requested with -no-undefined,"
3866 $echo "*** libtool will only create a static version of it."
3867 if test "$build_old_libs" = no; then
3868 oldlibs="$output_objdir/$libname.$libext"
3869 build_libtool_libs=module
3872 build_libtool_libs=no
3877 # Done checking deplibs!
3881 # All the library-specific variables (install_libdir is set above).
3886 # Test again, we may have decided not to build it any more
3887 if test "$build_libtool_libs" = yes; then
3888 if test "$hardcode_into_libs" = yes; then
3889 # Hardcode the library paths
3892 rpath="$finalize_rpath"
3893 test "$mode" != relink && rpath="$compile_rpath$rpath"
3894 for libdir in $rpath; do
3895 if test -n "$hardcode_libdir_flag_spec"; then
3896 if test -n "$hardcode_libdir_separator"; then
3897 if test -z "$hardcode_libdirs"; then
3898 hardcode_libdirs="$libdir"
3900 # Just accumulate the unique libdirs.
3901 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3902 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3905 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3910 eval flag=\"$hardcode_libdir_flag_spec\"
3911 dep_rpath="$dep_rpath $flag"
3913 elif test -n "$runpath_var"; then
3914 case "$perm_rpath " in
3916 *) perm_rpath="$perm_rpath $libdir" ;;
3920 # Substitute the hardcoded libdirs into the rpath.
3921 if test -n "$hardcode_libdir_separator" &&
3922 test -n "$hardcode_libdirs"; then
3923 libdir="$hardcode_libdirs"
3924 if test -n "$hardcode_libdir_flag_spec_ld"; then
3925 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3927 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3930 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3931 # We should set the runpath_var.
3933 for dir in $perm_rpath; do
3936 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3938 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3941 shlibpath="$finalize_shlibpath"
3942 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3943 if test -n "$shlibpath"; then
3944 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3947 # Get the real and link names of the library.
3948 eval shared_ext=\"$shrext_cmds\"
3949 eval library_names=\"$library_names_spec\"
3950 set dummy $library_names
3954 if test -n "$soname_spec"; then
3955 eval soname=\"$soname_spec\"
3959 if test -z "$dlname"; then
3963 lib="$output_objdir/$realname"
3966 linknames="$linknames $link"
3969 # Use standard objects if they are pic
3970 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3972 # Prepare the list of exported symbols
3973 if test -z "$export_symbols"; then
3974 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3975 $show "generating symbol list for \`$libname.la'"
3976 export_symbols="$output_objdir/$libname.exp"
3977 $run $rm $export_symbols
3978 cmds=$export_symbols_cmds
3979 save_ifs="$IFS"; IFS='~'
3980 for cmd in $cmds; do
3983 if len=`expr "X$cmd" : ".*"` &&
3984 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3986 $run eval "$cmd" || exit $?
3987 skipped_export=false
3989 # The command line is too long to execute in one step.
3990 $show "using reloadable object file for export list..."
3995 if test -n "$export_symbols_regex"; then
3996 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3997 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3998 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3999 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4004 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4005 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4009 for test_deplib in $deplibs; do
4010 case " $convenience " in
4011 *" $test_deplib "*) ;;
4013 tmp_deplibs="$tmp_deplibs $test_deplib"
4017 deplibs="$tmp_deplibs"
4019 if test -n "$convenience"; then
4020 if test -n "$whole_archive_flag_spec"; then
4021 save_libobjs=$libobjs
4022 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4024 gentop="$output_objdir/${outputname}x"
4025 $show "${rm}r $gentop"
4026 $run ${rm}r "$gentop"
4027 $show "$mkdir $gentop"
4028 $run $mkdir "$gentop"
4030 if test "$status" -ne 0 && test ! -d "$gentop"; then
4033 generated="$generated $gentop"
4035 for xlib in $convenience; do
4036 # Extract the objects.
4038 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4039 *) xabs=`pwd`"/$xlib" ;;
4041 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4042 xdir="$gentop/$xlib"
4044 $show "${rm}r $xdir"
4046 $show "$mkdir $xdir"
4049 if test "$status" -ne 0 && test ! -d "$xdir"; then
4052 # We will extract separately just the conflicting names and we will no
4053 # longer touch any unique names. It is faster to leave these extract
4054 # automatically by $AR in one run.
4055 $show "(cd $xdir && $AR x $xabs)"
4056 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4057 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4060 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4061 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4062 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4065 while test "$i" -le "$count"
4067 # Put our $i before any first dot (extension)
4068 # Never overwrite any file
4070 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4072 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4074 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4075 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4081 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4086 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4087 eval flag=\"$thread_safe_flag_spec\"
4088 linker_flags="$linker_flags $flag"
4091 # Make a backup of the uninstalled library when relinking
4092 if test "$mode" = relink; then
4093 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4096 # Do each of the archive commands.
4097 if test "$module" = yes && test -n "$module_cmds" ; then
4098 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4099 eval test_cmds=\"$module_expsym_cmds\"
4100 cmds=$module_expsym_cmds
4102 eval test_cmds=\"$module_cmds\"
4106 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4107 eval test_cmds=\"$archive_expsym_cmds\"
4108 cmds=$archive_expsym_cmds
4110 eval test_cmds=\"$archive_cmds\"
4115 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
4116 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4119 # The command line is too long to link in one step, link piecewise.
4120 $echo "creating reloadable object files..."
4122 # Save the value of $output and $libobjs because we want to
4123 # use them later. If we have whole_archive_flag_spec, we
4124 # want to use save_libobjs as it was before
4125 # whole_archive_flag_spec was expanded, because we can't
4126 # assume the linker understands whole_archive_flag_spec.
4127 # This may have to be revisited, in case too many
4128 # convenience libraries get linked in and end up exceeding
4130 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4131 save_libobjs=$libobjs
4135 # Clear the reloadable object creation command queue and
4136 # initialize k to one.
4143 output=$output_objdir/$save_output-${k}.$objext
4144 # Loop over the list of objects to be linked.
4145 for obj in $save_libobjs
4147 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4148 if test "X$objlist" = X ||
4149 { len=`expr "X$test_cmds" : ".*"` &&
4150 test "$len" -le "$max_cmd_len"; }; then
4151 objlist="$objlist $obj"
4153 # The command $test_cmds is almost too long, add a
4154 # command to the queue.
4155 if test "$k" -eq 1 ; then
4156 # The first file doesn't have a previous command to add.
4157 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4159 # All subsequent reloadable object files will link in
4160 # the last one created.
4161 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4163 last_robj=$output_objdir/$save_output-${k}.$objext
4165 output=$output_objdir/$save_output-${k}.$objext
4170 # Handle the remaining objects by creating one last
4171 # reloadable object file. All subsequent reloadable object
4172 # files will link in the last one created.
4173 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4174 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4176 if ${skipped_export-false}; then
4177 $show "generating symbol list for \`$libname.la'"
4178 export_symbols="$output_objdir/$libname.exp"
4179 $run $rm $export_symbols
4181 # Append the command to create the export file.
4182 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4185 # Set up a command to remove the reloadale object files
4186 # after they are used.
4188 while test "$i" -lt "$k"
4191 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
4194 $echo "creating a temporary reloadable object file: $output"
4196 # Loop through the commands generated above and execute them.
4197 save_ifs="$IFS"; IFS='~'
4198 for cmd in $concat_cmds; do
4201 $run eval "$cmd" || exit $?
4206 # Restore the value of output.
4209 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4210 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4212 # Expand the library linking commands again to reset the
4213 # value of $libobjs for piecewise linking.
4215 # Do each of the archive commands.
4216 if test "$module" = yes && test -n "$module_cmds" ; then
4217 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4218 cmds=$module_expsym_cmds
4223 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4224 cmds=$archive_expsym_cmds
4230 # Append the command to remove the reloadable object files
4231 # to the just-reset $cmds.
4232 eval cmds=\"\$cmds~\$rm $delfiles\"
4234 save_ifs="$IFS"; IFS='~'
4235 for cmd in $cmds; do
4239 $run eval "$cmd" || exit $?
4243 # Restore the uninstalled library and exit
4244 if test "$mode" = relink; then
4245 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4249 # Create links to the real library.
4250 for linkname in $linknames; do
4251 if test "$realname" != "$linkname"; then
4252 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4253 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4257 # If -module or -export-dynamic was specified, set the dlname.
4258 if test "$module" = yes || test "$export_dynamic" = yes; then
4259 # On all known operating systems, these are identical.
4266 if test -n "$deplibs"; then
4267 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4270 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4271 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4274 if test -n "$rpath"; then
4275 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4278 if test -n "$xrpath"; then
4279 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4282 if test -n "$vinfo"; then
4283 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4286 if test -n "$release"; then
4287 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4292 if test -n "$objs$old_deplibs"; then
4293 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4297 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4305 # Delete the old objects.
4306 $run $rm $obj $libobj
4308 # Objects from convenience libraries. This assumes
4309 # single-version convenience libraries. Whenever we create
4310 # different ones for PIC/non-PIC, this we'll have to duplicate
4314 # reload_cmds runs $LD directly, so let us get rid of
4315 # -Wl from whole_archive_flag_spec
4318 if test -n "$convenience"; then
4319 if test -n "$whole_archive_flag_spec"; then
4320 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4322 gentop="$output_objdir/${obj}x"
4323 $show "${rm}r $gentop"
4324 $run ${rm}r "$gentop"
4325 $show "$mkdir $gentop"
4326 $run $mkdir "$gentop"
4328 if test "$status" -ne 0 && test ! -d "$gentop"; then
4331 generated="$generated $gentop"
4333 for xlib in $convenience; do
4334 # Extract the objects.
4336 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4337 *) xabs=`pwd`"/$xlib" ;;
4339 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4340 xdir="$gentop/$xlib"
4342 $show "${rm}r $xdir"
4344 $show "$mkdir $xdir"
4347 if test "$status" -ne 0 && test ! -d "$xdir"; then
4350 # We will extract separately just the conflicting names and we will no
4351 # longer touch any unique names. It is faster to leave these extract
4352 # automatically by $AR in one run.
4353 $show "(cd $xdir && $AR x $xabs)"
4354 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4355 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4358 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4359 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4360 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4363 while test "$i" -le "$count"
4365 # Put our $i before any first dot (extension)
4366 # Never overwrite any file
4368 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4370 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4372 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4373 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4379 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4384 # Create the old-style object.
4385 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
4389 save_ifs="$IFS"; IFS='~'
4390 for cmd in $cmds; do
4394 $run eval "$cmd" || exit $?
4398 # Exit if we aren't doing a library object file.
4399 if test -z "$libobj"; then
4400 if test -n "$gentop"; then
4401 $show "${rm}r $gentop"
4408 if test "$build_libtool_libs" != yes; then
4409 if test -n "$gentop"; then
4410 $show "${rm}r $gentop"
4414 # Create an invalid libtool object if no PIC, so that we don't
4415 # accidentally link it into a program.
4416 # $show "echo timestamp > $libobj"
4417 # $run eval "echo timestamp > $libobj" || exit $?
4421 if test -n "$pic_flag" || test "$pic_mode" != default; then
4422 # Only do commands if we really have different PIC objects.
4423 reload_objs="$libobjs $reload_conv_objs"
4426 save_ifs="$IFS"; IFS='~'
4427 for cmd in $cmds; do
4431 $run eval "$cmd" || exit $?
4436 if test -n "$gentop"; then
4437 $show "${rm}r $gentop"
4446 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4448 if test -n "$vinfo"; then
4449 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4452 if test -n "$release"; then
4453 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4456 if test "$preload" = yes; then
4457 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4458 test "$dlopen_self_static" = unknown; then
4459 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4464 *-*-rhapsody* | *-*-darwin1.[012])
4465 # On Rhapsody replace the C library is the System framework
4466 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4467 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4473 # Don't allow lazy linking, it breaks C++ global constructors
4474 if test "$tagname" = CXX ; then
4475 compile_command="$compile_command ${wl}-bind_at_load"
4476 finalize_command="$finalize_command ${wl}-bind_at_load"
4481 compile_command="$compile_command $compile_deplibs"
4482 finalize_command="$finalize_command $finalize_deplibs"
4484 if test -n "$rpath$xrpath"; then
4485 # If the user specified any rpath flags, then add them.
4486 for libdir in $rpath $xrpath; do
4487 # This is the magic to use -rpath.
4488 case "$finalize_rpath " in
4490 *) finalize_rpath="$finalize_rpath $libdir" ;;
4495 # Now hardcode the library paths
4498 for libdir in $compile_rpath $finalize_rpath; do
4499 if test -n "$hardcode_libdir_flag_spec"; then
4500 if test -n "$hardcode_libdir_separator"; then
4501 if test -z "$hardcode_libdirs"; then
4502 hardcode_libdirs="$libdir"
4504 # Just accumulate the unique libdirs.
4505 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4506 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4509 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4514 eval flag=\"$hardcode_libdir_flag_spec\"
4515 rpath="$rpath $flag"
4517 elif test -n "$runpath_var"; then
4518 case "$perm_rpath " in
4520 *) perm_rpath="$perm_rpath $libdir" ;;
4524 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4525 case :$dllsearchpath: in
4527 *) dllsearchpath="$dllsearchpath:$libdir";;
4532 # Substitute the hardcoded libdirs into the rpath.
4533 if test -n "$hardcode_libdir_separator" &&
4534 test -n "$hardcode_libdirs"; then
4535 libdir="$hardcode_libdirs"
4536 eval rpath=\" $hardcode_libdir_flag_spec\"
4538 compile_rpath="$rpath"
4542 for libdir in $finalize_rpath; do
4543 if test -n "$hardcode_libdir_flag_spec"; then
4544 if test -n "$hardcode_libdir_separator"; then
4545 if test -z "$hardcode_libdirs"; then
4546 hardcode_libdirs="$libdir"
4548 # Just accumulate the unique libdirs.
4549 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4550 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4553 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4558 eval flag=\"$hardcode_libdir_flag_spec\"
4559 rpath="$rpath $flag"
4561 elif test -n "$runpath_var"; then
4562 case "$finalize_perm_rpath " in
4564 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4568 # Substitute the hardcoded libdirs into the rpath.
4569 if test -n "$hardcode_libdir_separator" &&
4570 test -n "$hardcode_libdirs"; then
4571 libdir="$hardcode_libdirs"
4572 eval rpath=\" $hardcode_libdir_flag_spec\"
4574 finalize_rpath="$rpath"
4576 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4577 # Transform all the library objects into standard objects.
4578 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4579 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4583 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4584 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4585 dlsyms="${outputname}S.c"
4587 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4591 if test -n "$dlsyms"; then
4595 # Discover the nlist of each of the dlfiles.
4596 nlist="$output_objdir/${outputname}.nm"
4598 $show "$rm $nlist ${nlist}S ${nlist}T"
4599 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4601 # Parse the name list into a source file.
4602 $show "creating $output_objdir/$dlsyms"
4604 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4605 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4606 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4612 /* Prevent the only kind of declaration conflicts we can make. */
4613 #define lt_preloaded_symbols some_other_symbol
4615 /* External symbol declarations for the compiler. */\
4618 if test "$dlself" = yes; then
4619 $show "generating symbol list for \`$output'"
4621 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4623 # Add our own program objects to the symbol list.
4624 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4625 for arg in $progfiles; do
4626 $show "extracting global C symbols from \`$arg'"
4627 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4630 if test -n "$exclude_expsyms"; then
4631 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4632 $run eval '$mv "$nlist"T "$nlist"'
4635 if test -n "$export_symbols_regex"; then
4636 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4637 $run eval '$mv "$nlist"T "$nlist"'
4640 # Prepare the list of exported symbols
4641 if test -z "$export_symbols"; then
4642 export_symbols="$output_objdir/$output.exp"
4643 $run $rm $export_symbols
4644 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4646 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4647 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4648 $run eval 'mv "$nlist"T "$nlist"'
4652 for arg in $dlprefiles; do
4653 $show "extracting global C symbols from \`$arg'"
4654 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4655 $run eval '$echo ": $name " >> "$nlist"'
4656 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4659 if test -z "$run"; then
4660 # Make sure we have at least an empty file.
4661 test -f "$nlist" || : > "$nlist"
4663 if test -n "$exclude_expsyms"; then
4664 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4665 $mv "$nlist"T "$nlist"
4668 # Try sorting and uniquifying the output.
4669 if grep -v "^: " < "$nlist" |
4670 if sort -k 3 </dev/null >/dev/null 2>&1; then
4675 uniq > "$nlist"S; then
4678 grep -v "^: " < "$nlist" > "$nlist"S
4681 if test -f "$nlist"S; then
4682 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4684 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4687 $echo >> "$output_objdir/$dlsyms" "\
4689 #undef lt_preloaded_symbols
4691 #if defined (__STDC__) && __STDC__
4692 # define lt_ptr void *
4694 # define lt_ptr char *
4698 /* The mapping between symbol names and symbols. */
4703 lt_preloaded_symbols[] =
4707 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4709 $echo >> "$output_objdir/$dlsyms" "\
4713 /* This works around a problem in FreeBSD linker */
4714 #ifdef FREEBSD_WORKAROUND
4715 static const void *lt_preloaded_setup() {
4716 return lt_preloaded_symbols;
4726 pic_flag_for_symtable=
4728 # compiling the symbol table file with pic_flag works around
4729 # a FreeBSD bug that causes programs to crash when -lm is
4730 # linked before any other PIC object. But we must not use
4731 # pic_flag when linking with -static. The problem exists in
4732 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4733 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4734 case "$compile_command " in
4736 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4739 case "$compile_command " in
4741 *) pic_flag_for_symtable=" $pic_flag";;
4745 # Now compile the dynamic symbol file.
4746 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4747 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4749 # Clean up the generated files.
4750 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4751 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4753 # Transform the symbol file into the correct name.
4754 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4755 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4758 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4763 # We keep going just in case the user didn't refer to
4764 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4765 # really was required.
4767 # Nullify the symbol file.
4768 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4769 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4772 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4773 # Replace the output file specification.
4774 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4775 link_command="$compile_command$compile_rpath"
4777 # We have no uninstalled library dependencies, so finalize right now.
4778 $show "$link_command"
4779 $run eval "$link_command"
4782 # Delete the generated files.
4783 if test -n "$dlsyms"; then
4784 $show "$rm $output_objdir/${outputname}S.${objext}"
4785 $run $rm "$output_objdir/${outputname}S.${objext}"
4791 if test -n "$shlibpath_var"; then
4792 # We should set the shlibpath_var
4794 for dir in $temp_rpath; do
4796 [\\/]* | [A-Za-z]:[\\/]*)
4801 # Relative path: add a thisdir entry.
4802 rpath="$rpath\$thisdir/$dir:"
4809 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4810 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4812 if test -n "$finalize_shlibpath"; then
4813 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4818 if test -n "$runpath_var"; then
4819 if test -n "$perm_rpath"; then
4820 # We should set the runpath_var.
4822 for dir in $perm_rpath; do
4825 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4827 if test -n "$finalize_perm_rpath"; then
4828 # We should set the runpath_var.
4830 for dir in $finalize_perm_rpath; do
4833 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4837 if test "$no_install" = yes; then
4838 # We don't need to create a wrapper script.
4839 link_command="$compile_var$compile_command$compile_rpath"
4840 # Replace the output file specification.
4841 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4842 # Delete the old output file.
4844 # Link the executable and exit
4845 $show "$link_command"
4846 $run eval "$link_command" || exit $?
4850 if test "$hardcode_action" = relink; then
4851 # Fast installation is not supported
4852 link_command="$compile_var$compile_command$compile_rpath"
4853 relink_command="$finalize_var$finalize_command$finalize_rpath"
4855 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4856 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4858 if test "$fast_install" != no; then
4859 link_command="$finalize_var$compile_command$finalize_rpath"
4860 if test "$fast_install" = yes; then
4861 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4863 # fast_install is set to needless
4867 link_command="$compile_var$compile_command$compile_rpath"
4868 relink_command="$finalize_var$finalize_command$finalize_rpath"
4872 # Replace the output file specification.
4873 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4875 # Delete the old output files.
4876 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4878 $show "$link_command"
4879 $run eval "$link_command" || exit $?
4881 # Now create the wrapper script.
4882 $show "creating $output"
4884 # Quote the relink command for shipping.
4885 if test -n "$relink_command"; then
4886 # Preserve any variables that may affect compiler behavior
4887 for var in $variables_saved_for_relink; do
4888 if eval test -z \"\${$var+set}\"; then
4889 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4890 elif eval var_value=\$$var; test -z "$var_value"; then
4891 relink_command="$var=; export $var; $relink_command"
4893 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4894 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4897 relink_command="(cd `pwd`; $relink_command)"
4898 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4901 # Quote $echo for shipping.
4902 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4904 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4905 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4907 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4909 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4912 # Only actually do things if our run command is non-null.
4913 if test -z "$run"; then
4914 # win32 will think the script is a binary if it has
4915 # a .exe suffix, so we strip it off here.
4917 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4919 # test for cygwin because mv fails w/o .exe extensions
4923 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4927 *cygwin* | *mingw* )
4928 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4929 cwrapper=`$echo ${output}.exe`
4930 $rm $cwrappersource $cwrapper
4931 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4933 cat > $cwrappersource <<EOF
4935 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4936 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4938 The $output program cannot be directly executed until all the libtool
4939 libraries that it depends on are installed.
4941 This wrapper executable should never be moved out of the build directory.
4942 If it is, it will not operate correctly.
4944 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4945 but could eventually absorb all of the scripts functionality and
4946 exec $objdir/$outputname directly.
4949 cat >> $cwrappersource<<"EOF"
4957 #if defined(PATH_MAX)
4958 # define LT_PATHMAX PATH_MAX
4959 #elif defined(MAXPATHLEN)
4960 # define LT_PATHMAX MAXPATHLEN
4962 # define LT_PATHMAX 1024
4965 #ifndef DIR_SEPARATOR
4966 #define DIR_SEPARATOR '/'
4969 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4971 #define HAVE_DOS_BASED_FILE_SYSTEM
4972 #ifndef DIR_SEPARATOR_2
4973 #define DIR_SEPARATOR_2 '\\'
4977 #ifndef DIR_SEPARATOR_2
4978 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4979 #else /* DIR_SEPARATOR_2 */
4980 # define IS_DIR_SEPARATOR(ch) \
4981 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4982 #endif /* DIR_SEPARATOR_2 */
4984 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4985 #define XFREE(stale) do { \
4986 if (stale) { free ((void *) stale); stale = 0; } \
4989 const char *program_name = NULL;
4991 void * xmalloc (size_t num);
4992 char * xstrdup (const char *string);
4993 char * basename (const char *name);
4994 char * fnqualify(const char *path);
4995 char * strendzap(char *str, const char *pat);
4996 void lt_fatal (const char *message, ...);
4999 main (int argc, char *argv[])
5004 program_name = (char *) xstrdup ((char *) basename (argv[0]));
5005 newargz = XMALLOC(char *, argc+2);
5008 cat >> $cwrappersource <<EOF
5009 newargz[0] = "$SHELL";
5012 cat >> $cwrappersource <<"EOF"
5013 newargz[1] = fnqualify(argv[0]);
5014 /* we know the script has the same name, without the .exe */
5015 /* so make sure newargz[1] doesn't end in .exe */
5016 strendzap(newargz[1],".exe");
5017 for (i = 1; i < argc; i++)
5018 newargz[i+1] = xstrdup(argv[i]);
5019 newargz[argc+1] = NULL;
5022 cat >> $cwrappersource <<EOF
5023 execv("$SHELL",newargz);
5026 cat >> $cwrappersource <<"EOF"
5030 xmalloc (size_t num)
5032 void * p = (void *) malloc (num);
5034 lt_fatal ("Memory exhausted");
5040 xstrdup (const char *string)
5042 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5047 basename (const char *name)
5051 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5052 /* Skip over the disk name in MSDOS pathnames. */
5053 if (isalpha (name[0]) && name[1] == ':')
5057 for (base = name; *name; name++)
5058 if (IS_DIR_SEPARATOR (*name))
5060 return (char *) base;
5064 fnqualify(const char *path)
5068 char tmp[LT_PATHMAX + 1];
5070 assert(path != NULL);
5072 /* Is it qualified already? */
5073 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5074 if (isalpha (path[0]) && path[1] == ':')
5075 return xstrdup (path);
5077 if (IS_DIR_SEPARATOR (path[0]))
5078 return xstrdup (path);
5080 /* prepend the current directory */
5081 /* doesn't handle '~' */
5082 if (getcwd (tmp, LT_PATHMAX) == NULL)
5083 lt_fatal ("getcwd failed");
5084 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
5085 p = XMALLOC(char, size);
5086 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5091 strendzap(char *str, const char *pat)
5095 assert(str != NULL);
5096 assert(pat != NULL);
5099 patlen = strlen(pat);
5103 str += len - patlen;
5104 if (strcmp(str, pat) == 0)
5111 lt_error_core (int exit_status, const char * mode,
5112 const char * message, va_list ap)
5114 fprintf (stderr, "%s: %s: ", program_name, mode);
5115 vfprintf (stderr, message, ap);
5116 fprintf (stderr, ".\n");
5118 if (exit_status >= 0)
5123 lt_fatal (const char *message, ...)
5126 va_start (ap, message);
5127 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5131 # we should really use a build-platform specific compiler
5132 # here, but OTOH, the wrappers (shell script and this C one)
5133 # are only useful if you want to execute the "real" binary.
5134 # Since the "real" binary is built for $host, then this
5135 # wrapper might as well be built for $host, too.
5136 $run $LTCC -s -o $cwrapper $cwrappersource
5140 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5145 # $output - temporary wrapper script for $objdir/$outputname
5146 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5148 # The $output program cannot be directly executed until all the libtool
5149 # libraries that it depends on are installed.
5151 # This wrapper script should never be moved out of the build directory.
5152 # If it is, it will not operate correctly.
5154 # Sed substitution that helps us do robust quoting. It backslashifies
5155 # metacharacters that are still active within double-quoted strings.
5156 Xsed='${SED} -e 1s/^X//'
5157 sed_quote_subst='$sed_quote_subst'
5159 # The HP-UX ksh and POSIX shell print the target directory to stdout
5161 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
5163 relink_command=\"$relink_command\"
5165 # This environment variable determines our operation mode.
5166 if test \"\$libtool_install_magic\" = \"$magic\"; then
5167 # install mode needs the following variable:
5168 notinst_deplibs='$notinst_deplibs'
5170 # When we are sourced in execute mode, \$file and \$echo are already set.
5171 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5174 # Make sure echo works.
5175 if test \"X\$1\" = X--no-reexec; then
5176 # Discard the --no-reexec flag, and continue.
5178 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5179 # Yippee, \$echo works!
5182 # Restart under the correct shell, and then maybe \$echo will work.
5183 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5189 # Find the directory that this script lives in.
5190 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5191 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5193 # Follow symbolic links until we get to the real thisdir.
5194 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5195 while test -n \"\$file\"; do
5196 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5198 # If there was a directory component, then change thisdir.
5199 if test \"x\$destdir\" != \"x\$file\"; then
5200 case \"\$destdir\" in
5201 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5202 *) thisdir=\"\$thisdir/\$destdir\" ;;
5206 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5207 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5210 # Try to get the absolute directory name.
5211 absdir=\`cd \"\$thisdir\" && pwd\`
5212 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5215 if test "$fast_install" = yes; then
5217 program=lt-'$outputname'$exeext
5218 progdir=\"\$thisdir/$objdir\"
5220 if test ! -f \"\$progdir/\$program\" || \\
5221 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5222 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5224 file=\"\$\$-\$program\"
5226 if test ! -d \"\$progdir\"; then
5227 $mkdir \"\$progdir\"
5229 $rm \"\$progdir/\$file\"
5234 # relink executable if necessary
5235 if test -n \"\$relink_command\"; then
5236 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5238 $echo \"\$relink_command_output\" >&2
5239 $rm \"\$progdir/\$file\"
5244 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5245 { $rm \"\$progdir/\$program\";
5246 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5247 $rm \"\$progdir/\$file\"
5251 program='$outputname'
5252 progdir=\"\$thisdir/$objdir\"
5258 if test -f \"\$progdir/\$program\"; then"
5260 # Export our shlibpath_var if we have one.
5261 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5263 # Add our own library path to $shlibpath_var
5264 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5266 # Some systems cannot cope with colon-terminated $shlibpath_var
5267 # The second colon is a workaround for a bug in BeOS R4 sed
5268 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5270 export $shlibpath_var
5274 # fixup the dll searchpath if we need to.
5275 if test -n "$dllsearchpath"; then
5277 # Add the dll search path components to the executable PATH
5278 PATH=$dllsearchpath:\$PATH
5283 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5284 # Run the actual program with our arguments.
5287 # Backslashes separate directories on plain windows
5288 *-*-mingw | *-*-os2*)
5290 exec \$progdir\\\\\$program \${1+\"\$@\"}
5296 exec \$progdir/\$program \${1+\"\$@\"}
5301 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5305 # The program doesn't exist.
5306 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5307 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5308 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5319 # See if we need to build an old-fashioned archive.
5320 for oldlib in $oldlibs; do
5322 if test "$build_libtool_libs" = convenience; then
5323 oldobjs="$libobjs_save"
5324 addlibs="$convenience"
5325 build_libtool_libs=no
5327 if test "$build_libtool_libs" = module; then
5328 oldobjs="$libobjs_save"
5329 build_libtool_libs=no
5331 oldobjs="$old_deplibs $non_pic_objects"
5333 addlibs="$old_convenience"
5336 if test -n "$addlibs"; then
5337 gentop="$output_objdir/${outputname}x"
5338 $show "${rm}r $gentop"
5339 $run ${rm}r "$gentop"
5340 $show "$mkdir $gentop"
5341 $run $mkdir "$gentop"
5343 if test "$status" -ne 0 && test ! -d "$gentop"; then
5346 generated="$generated $gentop"
5348 # Add in members from convenience archives.
5349 for xlib in $addlibs; do
5350 # Extract the objects.
5352 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5353 *) xabs=`pwd`"/$xlib" ;;
5355 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5356 xdir="$gentop/$xlib"
5358 $show "${rm}r $xdir"
5360 $show "$mkdir $xdir"
5363 if test "$status" -ne 0 && test ! -d "$xdir"; then
5366 # We will extract separately just the conflicting names and we will no
5367 # longer touch any unique names. It is faster to leave these extract
5368 # automatically by $AR in one run.
5369 $show "(cd $xdir && $AR x $xabs)"
5370 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5371 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5374 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5375 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5376 $AR t "$xabs" | sort | uniq -cd | while read -r count name
5379 while test "$i" -le "$count"
5381 # Put our $i before any first dot (extension)
5382 # Never overwrite any file
5384 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5386 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5388 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5389 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5395 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5399 # Do each command in the archive commands.
5400 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5401 cmds=$old_archive_from_new_cmds
5403 eval cmds=\"$old_archive_cmds\"
5405 if len=`expr "X$cmds" : ".*"` &&
5406 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5407 cmds=$old_archive_cmds
5409 # the command line is too long to link in one step, link in parts
5410 $echo "using piecewise archive linking..."
5415 save_oldobjs=$oldobjs
5416 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5417 # encoded into archives. This makes 'ar r' malfunction in
5418 # this piecewise linking case whenever conflicting object
5419 # names appear in distinct ar calls; check, warn and compensate.
5420 if (for obj in $save_oldobjs
5422 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5423 done | sort | sort -uc >/dev/null 2>&1); then
5426 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5427 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5430 # Is there a better way of finding the last object in the list?
5431 for obj in $save_oldobjs
5435 for obj in $save_oldobjs
5437 oldobjs="$objlist $obj"
5438 objlist="$objlist $obj"
5439 eval test_cmds=\"$old_archive_cmds\"
5440 if len=`expr "X$test_cmds" : ".*"` &&
5441 test "$len" -le "$max_cmd_len"; then
5444 # the above command should be used before it gets too long
5446 if test "$obj" = "$last_oldobj" ; then
5449 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5450 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5456 if test "X$oldobjs" = "X" ; then
5457 eval cmds=\"\$concat_cmds\"
5459 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5463 save_ifs="$IFS"; IFS='~'
5464 for cmd in $cmds; do
5468 $run eval "$cmd" || exit $?
5473 if test -n "$generated"; then
5474 $show "${rm}r$generated"
5475 $run ${rm}r$generated
5478 # Now create the libtool archive.
5482 test "$build_old_libs" = yes && old_library="$libname.$libext"
5483 $show "creating $output"
5485 # Preserve any variables that may affect compiler behavior
5486 for var in $variables_saved_for_relink; do
5487 if eval test -z \"\${$var+set}\"; then
5488 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5489 elif eval var_value=\$$var; test -z "$var_value"; then
5490 relink_command="$var=; export $var; $relink_command"
5492 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5493 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5496 # Quote the link command for shipping.
5497 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5498 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5499 if test "$hardcode_automatic" = yes ; then
5504 # Only create the output if not a dry run.
5505 if test -z "$run"; then
5506 for installed in no yes; do
5507 if test "$installed" = yes; then
5508 if test -z "$install_libdir"; then
5511 output="$output_objdir/$outputname"i
5512 # Replace all uninstalled libtool libraries with the installed ones
5514 for deplib in $dependency_libs; do
5517 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5518 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5519 if test -z "$libdir"; then
5520 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5523 newdependency_libs="$newdependency_libs $libdir/$name"
5525 *) newdependency_libs="$newdependency_libs $deplib" ;;
5528 dependency_libs="$newdependency_libs"
5530 for lib in $dlfiles; do
5531 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5532 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5533 if test -z "$libdir"; then
5534 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5537 newdlfiles="$newdlfiles $libdir/$name"
5539 dlfiles="$newdlfiles"
5541 for lib in $dlprefiles; do
5542 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5543 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5544 if test -z "$libdir"; then
5545 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5548 newdlprefiles="$newdlprefiles $libdir/$name"
5550 dlprefiles="$newdlprefiles"
5553 for lib in $dlfiles; do
5555 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5556 *) abs=`pwd`"/$lib" ;;
5558 newdlfiles="$newdlfiles $abs"
5560 dlfiles="$newdlfiles"
5562 for lib in $dlprefiles; do
5564 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5565 *) abs=`pwd`"/$lib" ;;
5567 newdlprefiles="$newdlprefiles $abs"
5569 dlprefiles="$newdlprefiles"
5572 # place dlname in correct position for cygwin
5574 case $host,$output,$installed,$module,$dlname in
5575 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5578 # $outputname - a libtool library file
5579 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5581 # Please DO NOT delete this file!
5582 # It is necessary for linking the library.
5584 # The name that we can dlopen(3).
5587 # Names of this library.
5588 library_names='$library_names'
5590 # The name of the static archive.
5591 old_library='$old_library'
5593 # Libraries that this one depends upon.
5594 dependency_libs='$dependency_libs'
5596 # Version information for $libname.
5601 # Is this an already installed library?
5602 installed=$installed
5604 # Should we warn about portability when linking against -modules?
5605 shouldnotlink=$module
5607 # Files to dlopen/dlpreopen
5609 dlpreopen='$dlprefiles'
5611 # Directory that this library needs to be installed in:
5612 libdir='$install_libdir'"
5613 if test "$installed" = no && test "$need_relink" = yes; then
5615 relink_command=\"$relink_command\""
5620 # Do a symbolic link so that the libtool archive can be found in
5621 # LD_LIBRARY_PATH before the program is installed.
5622 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5623 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5629 # libtool install mode
5631 modename="$modename: install"
5633 # There may be an optional sh(1) argument at the beginning of
5634 # install_prog (especially on Windows NT).
5635 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5636 # Allow the use of GNU shtool's install command.
5637 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5638 # Aesthetically quote it.
5639 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5641 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5645 install_prog="$arg "
5653 # The real first argument should be the name of the installation program.
5654 # Aesthetically quote it.
5655 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5657 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5661 install_prog="$install_prog$arg"
5663 # We need to accept at least all the BSD install flags.
5673 if test -n "$dest"; then
5674 files="$files $dest"
5692 # If the previous option needed an argument, then skip it.
5693 if test -n "$prev"; then
5702 # Aesthetically quote the argument.
5703 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5705 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5709 install_prog="$install_prog $arg"
5712 if test -z "$install_prog"; then
5713 $echo "$modename: you must specify an install program" 1>&2
5718 if test -n "$prev"; then
5719 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5724 if test -z "$files"; then
5725 if test -z "$dest"; then
5726 $echo "$modename: no file or destination specified" 1>&2
5728 $echo "$modename: you must specify a destination" 1>&2
5734 # Strip any trailing slash from the destination.
5735 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5737 # Check to see that the destination is a directory.
5738 test -d "$dest" && isdir=yes
5739 if test "$isdir" = yes; then
5743 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5744 test "X$destdir" = "X$dest" && destdir=.
5745 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5747 # Not a directory, so check to see that there is only one file specified.
5749 if test "$#" -gt 2; then
5750 $echo "$modename: \`$dest' is not a directory" 1>&2
5756 [\\/]* | [A-Za-z]:[\\/]*) ;;
5758 for file in $files; do
5762 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5771 # This variable tells wrapper scripts just to set variables rather
5772 # than running their programs.
5773 libtool_install_magic="$magic"
5778 for file in $files; do
5780 # Do each installation.
5783 # Do the static libraries later.
5784 staticlibs="$staticlibs $file"
5788 # Check to see that this really is a libtool archive.
5789 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5791 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5799 # If there is no directory component, then add one.
5801 */* | *\\*) . $file ;;
5805 # Add the libdir to current_libdirs if it is the destination.
5806 if test "X$destdir" = "X$libdir"; then
5807 case "$current_libdirs " in
5809 *) current_libdirs="$current_libdirs $libdir" ;;
5812 # Note the libdir as a future libdir.
5813 case "$future_libdirs " in
5815 *) future_libdirs="$future_libdirs $libdir" ;;
5819 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5820 test "X$dir" = "X$file/" && dir=
5823 if test -n "$relink_command"; then
5824 # Determine the prefix the user has applied to our future dir.
5825 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5827 # Don't allow the user to place us outside of our expected
5828 # location b/c this prevents finding dependent libraries that
5829 # are installed to the same prefix.
5830 # At present, this check doesn't affect windows .dll's that
5831 # are installed into $libdir/../bin (currently, that works fine)
5832 # but it's something to keep an eye on.
5833 if test "$inst_prefix_dir" = "$destdir"; then
5834 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5838 if test -n "$inst_prefix_dir"; then
5839 # Stick the inst_prefix_dir data into the link command.
5840 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5842 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5845 $echo "$modename: warning: relinking \`$file'" 1>&2
5846 $show "$relink_command"
5847 if $run eval "$relink_command"; then :
5849 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5854 # See the names of the shared library.
5855 set dummy $library_names
5856 if test -n "$2"; then
5862 test -n "$relink_command" && srcname="$realname"T
5864 # Install the shared library and build the symlinks.
5865 $show "$install_prog $dir/$srcname $destdir/$realname"
5866 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5867 if test -n "$stripme" && test -n "$striplib"; then
5868 $show "$striplib $destdir/$realname"
5869 $run eval "$striplib $destdir/$realname" || exit $?
5872 if test "$#" -gt 0; then
5873 # Delete the old symlinks, and create new ones.
5876 if test "$linkname" != "$realname"; then
5877 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5878 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5883 # Do each command in the postinstall commands.
5884 lib="$destdir/$realname"
5885 cmds=$postinstall_cmds
5886 save_ifs="$IFS"; IFS='~'
5887 for cmd in $cmds; do
5891 $run eval "$cmd" || exit $?
5896 # Install the pseudo-library for information purposes.
5897 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5898 instname="$dir/$name"i
5899 $show "$install_prog $instname $destdir/$name"
5900 $run eval "$install_prog $instname $destdir/$name" || exit $?
5902 # Maybe install the static library, too.
5903 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5907 # Install (i.e. copy) a libtool object.
5909 # Figure out destination file name, if it wasn't already specified.
5910 if test -n "$destname"; then
5911 destfile="$destdir/$destname"
5913 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5914 destfile="$destdir/$destfile"
5917 # Deduce the name of the destination old-style object file.
5920 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5923 staticdest="$destfile"
5927 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5933 # Install the libtool object if requested.
5934 if test -n "$destfile"; then
5935 $show "$install_prog $file $destfile"
5936 $run eval "$install_prog $file $destfile" || exit $?
5939 # Install the old object if enabled.
5940 if test "$build_old_libs" = yes; then
5941 # Deduce the name of the old-style object file.
5942 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5944 $show "$install_prog $staticobj $staticdest"
5945 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5951 # Figure out destination file name, if it wasn't already specified.
5952 if test -n "$destname"; then
5953 destfile="$destdir/$destname"
5955 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5956 destfile="$destdir/$destfile"
5959 # If the file is missing, and there is a .exe on the end, strip it
5960 # because it is most likely a libtool script we actually want to
5965 if test ! -f "$file"; then
5966 file=`$echo $file|${SED} 's,.exe$,,'`
5972 # Do a test to see if this is really a libtool program.
5975 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5981 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5985 # To insure that "foo" is sourced, and not "foo.exe",
5986 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5987 # which disallows the automatic-append-.exe behavior.
5989 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5990 *) wrapperdot=${wrapper} ;;
5992 # If there is no directory component, then add one.
5994 */* | *\\*) . ${wrapperdot} ;;
5995 *) . ./${wrapperdot} ;;
5998 # Check the variables that should have been set.
5999 if test -z "$notinst_deplibs"; then
6000 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6005 for lib in $notinst_deplibs; do
6006 # Check to see that each library is installed.
6008 if test -f "$lib"; then
6009 # If there is no directory component, then add one.
6011 */* | *\\*) . $lib ;;
6015 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6016 if test -n "$libdir" && test ! -f "$libfile"; then
6017 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6023 # To insure that "foo" is sourced, and not "foo.exe",
6024 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6025 # which disallows the automatic-append-.exe behavior.
6027 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
6028 *) wrapperdot=${wrapper} ;;
6030 # If there is no directory component, then add one.
6032 */* | *\\*) . ${wrapperdot} ;;
6033 *) . ./${wrapperdot} ;;
6037 if test "$fast_install" = no && test -n "$relink_command"; then
6038 if test "$finalize" = yes && test -z "$run"; then
6040 test -n "$TMPDIR" && tmpdir="$TMPDIR"
6041 tmpdir="$tmpdir/libtool-$$"
6044 if $mkdir "$tmpdir"; then
6048 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
6051 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6052 outputname="$tmpdir/$file"
6053 # Replace the output file specification.
6054 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6056 $show "$relink_command"
6057 if $run eval "$relink_command"; then :
6059 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6065 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6068 # Install the binary that we compiled earlier.
6069 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6073 # remove .exe since cygwin /usr/bin/install will append another
6075 case $install_prog,$host in
6076 */usr/bin/install*,*cygwin*)
6077 case $file:$destfile in
6082 destfile=$destfile.exe
6085 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6090 $show "$install_prog$stripme $file $destfile"
6091 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6092 test -n "$outputname" && ${rm}r "$tmpdir"
6097 for file in $staticlibs; do
6098 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6100 # Set up the ranlib parameters.
6101 oldlib="$destdir/$name"
6103 $show "$install_prog $file $oldlib"
6104 $run eval "$install_prog \$file \$oldlib" || exit $?
6106 if test -n "$stripme" && test -n "$old_striplib"; then
6107 $show "$old_striplib $oldlib"
6108 $run eval "$old_striplib $oldlib" || exit $?
6111 # Do each command in the postinstall commands.
6112 cmds=$old_postinstall_cmds
6113 save_ifs="$IFS"; IFS='~'
6114 for cmd in $cmds; do
6118 $run eval "$cmd" || exit $?
6123 if test -n "$future_libdirs"; then
6124 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6127 if test -n "$current_libdirs"; then
6128 # Maybe just do a dry run.
6129 test -n "$run" && current_libdirs=" -n$current_libdirs"
6130 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6136 # libtool finish mode
6138 modename="$modename: finish"
6142 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6145 libdirs="$libdirs $dir"
6148 for libdir in $libdirs; do
6149 if test -n "$finish_cmds"; then
6150 # Do each command in the finish commands.
6152 save_ifs="$IFS"; IFS='~'
6153 for cmd in $cmds; do
6157 $run eval "$cmd" || admincmds="$admincmds
6162 if test -n "$finish_eval"; then
6163 # Do the single finish_eval.
6164 eval cmds=\"$finish_eval\"
6165 $run eval "$cmds" || admincmds="$admincmds
6171 # Exit here if they wanted silent mode.
6172 test "$show" = : && exit $EXIT_SUCCESS
6174 $echo "----------------------------------------------------------------------"
6175 $echo "Libraries have been installed in:"
6176 for libdir in $libdirs; do
6180 $echo "If you ever happen to want to link against installed libraries"
6181 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6182 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6183 $echo "flag during linking and do at least one of the following:"
6184 if test -n "$shlibpath_var"; then
6185 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6186 $echo " during execution"
6188 if test -n "$runpath_var"; then
6189 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6190 $echo " during linking"
6192 if test -n "$hardcode_libdir_flag_spec"; then
6194 eval flag=\"$hardcode_libdir_flag_spec\"
6196 $echo " - use the \`$flag' linker flag"
6198 if test -n "$admincmds"; then
6199 $echo " - have your system administrator run these commands:$admincmds"
6201 if test -f /etc/ld.so.conf; then
6202 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6205 $echo "See any operating system documentation about shared libraries for"
6206 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6207 $echo "----------------------------------------------------------------------"
6211 # libtool execute mode
6213 modename="$modename: execute"
6215 # The first argument is the command name.
6217 if test -z "$cmd"; then
6218 $echo "$modename: you must specify a COMMAND" 1>&2
6223 # Handle -dlopen flags immediately.
6224 for file in $execute_dlfiles; do
6225 if test ! -f "$file"; then
6226 $echo "$modename: \`$file' is not a file" 1>&2
6234 # Check to see that this really is a libtool archive.
6235 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6237 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6242 # Read the libtool library.
6246 # If there is no directory component, then add one.
6248 */* | *\\*) . $file ;;
6252 # Skip this library if it cannot be dlopened.
6253 if test -z "$dlname"; then
6254 # Warn if it was a shared library.
6255 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6259 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6260 test "X$dir" = "X$file" && dir=.
6262 if test -f "$dir/$objdir/$dlname"; then
6265 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6271 # Just add the directory containing the .lo file.
6272 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6273 test "X$dir" = "X$file" && dir=.
6277 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6282 # Get the absolute pathname.
6283 absdir=`cd "$dir" && pwd`
6284 test -n "$absdir" && dir="$absdir"
6286 # Now add the directory to shlibpath_var.
6287 if eval "test -z \"\$$shlibpath_var\""; then
6288 eval "$shlibpath_var=\"\$dir\""
6290 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6294 # This variable tells wrapper scripts just to set shlibpath_var
6295 # rather than running their programs.
6296 libtool_execute_magic="$magic"
6298 # Check if any of the arguments is a wrapper script.
6305 # Do a test to see if this is really a libtool program.
6306 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6307 # If there is no directory component, then add one.
6309 */* | *\\*) . $file ;;
6313 # Transform arg to wrapped name.
6314 file="$progdir/$program"
6318 # Quote arguments (to preserve shell metacharacters).
6319 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6320 args="$args \"$file\""
6323 if test -z "$run"; then
6324 if test -n "$shlibpath_var"; then
6325 # Export the shlibpath_var.
6326 eval "export $shlibpath_var"
6329 # Restore saved environment variables
6330 if test "${save_LC_ALL+set}" = set; then
6331 LC_ALL="$save_LC_ALL"; export LC_ALL
6333 if test "${save_LANG+set}" = set; then
6334 LANG="$save_LANG"; export LANG
6337 # Now prepare to actually exec the command.
6338 exec_cmd="\$cmd$args"
6340 # Display what would be done.
6341 if test -n "$shlibpath_var"; then
6342 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6343 $echo "export $shlibpath_var"
6350 # libtool clean and uninstall mode
6352 modename="$modename: $mode"
6358 # This variable tells wrapper scripts just to set variables rather
6359 # than running their programs.
6360 libtool_install_magic="$magic"
6365 -f) rm="$rm $arg"; rmforce=yes ;;
6366 -*) rm="$rm $arg" ;;
6367 *) files="$files $arg" ;;
6371 if test -z "$rm"; then
6372 $echo "$modename: you must specify an RM program" 1>&2
6379 origobjdir="$objdir"
6380 for file in $files; do
6381 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6382 if test "X$dir" = "X$file"; then
6384 objdir="$origobjdir"
6386 objdir="$dir/$origobjdir"
6388 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6389 test "$mode" = uninstall && objdir="$dir"
6391 # Remember objdir for removal later, being careful to avoid duplicates
6392 if test "$mode" = clean; then
6395 *) rmdirs="$rmdirs $objdir" ;;
6399 # Don't error if the file doesn't exist and rm -f was used.
6400 if (test -L "$file") >/dev/null 2>&1 \
6401 || (test -h "$file") >/dev/null 2>&1 \
6402 || test -f "$file"; then
6404 elif test -d "$file"; then
6407 elif test "$rmforce" = yes; then
6415 # Possibly a libtool archive, so verify it.
6416 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6419 # Delete the libtool libraries and symlinks.
6420 for n in $library_names; do
6421 rmfiles="$rmfiles $objdir/$n"
6423 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6424 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6426 if test "$mode" = uninstall; then
6427 if test -n "$library_names"; then
6428 # Do each command in the postuninstall commands.
6429 cmds=$postuninstall_cmds
6430 save_ifs="$IFS"; IFS='~'
6431 for cmd in $cmds; do
6436 if test "$?" -ne 0 && test "$rmforce" != yes; then
6443 if test -n "$old_library"; then
6444 # Do each command in the old_postuninstall commands.
6445 cmds=$old_postuninstall_cmds
6446 save_ifs="$IFS"; IFS='~'
6447 for cmd in $cmds; do
6452 if test "$?" -ne 0 && test "$rmforce" != yes; then
6458 # FIXME: should reinstall the best remaining shared library.
6464 # Possibly a libtool object, so verify it.
6465 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6470 # Add PIC object to the list of files to remove.
6471 if test -n "$pic_object" \
6472 && test "$pic_object" != none; then
6473 rmfiles="$rmfiles $dir/$pic_object"
6476 # Add non-PIC object to the list of files to remove.
6477 if test -n "$non_pic_object" \
6478 && test "$non_pic_object" != none; then
6479 rmfiles="$rmfiles $dir/$non_pic_object"
6485 if test "$mode" = clean ; then
6489 file=`$echo $file|${SED} 's,.exe$,,'`
6490 noexename=`$echo $name|${SED} 's,.exe$,,'`
6491 # $file with .exe has already been added to rmfiles,
6492 # add $file without .exe
6493 rmfiles="$rmfiles $file"
6496 # Do a test to see if this is a libtool program.
6497 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6501 # note $name still contains .exe if it was in $file originally
6502 # as does the version of $file that was added into $rmfiles
6503 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6504 if test "$fast_install" = yes && test -n "$relink_command"; then
6505 rmfiles="$rmfiles $objdir/lt-$name"
6507 if test "X$noexename" != "X$name" ; then
6508 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6514 $show "$rm $rmfiles"
6515 $run $rm $rmfiles || exit_status=1
6517 objdir="$origobjdir"
6519 # Try to remove the ${objdir}s in the directories where we deleted files
6520 for dir in $rmdirs; do
6521 if test -d "$dir"; then
6523 $run rmdir $dir >/dev/null 2>&1
6531 $echo "$modename: you must specify a MODE" 1>&2
6532 $echo "$generic_help" 1>&2
6537 if test -z "$exec_cmd"; then
6538 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6539 $echo "$generic_help" 1>&2
6542 fi # test -z "$show_help"
6544 if test -n "$exec_cmd"; then
6549 # We need to display help for each of the modes.
6552 "Usage: $modename [OPTION]... [MODE-ARG]...
6554 Provide generalized library-building support services.
6556 --config show all configuration variables
6557 --debug enable verbose shell tracing
6558 -n, --dry-run display commands without modifying any files
6559 --features display basic configuration information and exit
6560 --finish same as \`--mode=finish'
6561 --help display this help message and exit
6562 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6563 --quiet same as \`--silent'
6564 --silent don't print informational messages
6565 --tag=TAG use configuration variables from tag TAG
6566 --version print version information
6568 MODE must be one of the following:
6570 clean remove files from the build directory
6571 compile compile a source file into a libtool object
6572 execute automatically set library path, then run a program
6573 finish complete the installation of libtool libraries
6574 install install libraries or executables
6575 link create a library or an executable
6576 uninstall remove libraries from an installed directory
6578 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6579 a more detailed description of MODE.
6581 Report bugs to <bug-libtool@gnu.org>."
6587 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6589 Remove files from the build directory.
6591 RM is the name of the program to use to delete files associated with each FILE
6592 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6595 If FILE is a libtool library, object or program, all the files associated
6596 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6601 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6603 Compile a source file into a libtool library object.
6605 This mode accepts the following additional options:
6607 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6608 -prefer-pic try to building PIC objects only
6609 -prefer-non-pic try to building non-PIC objects only
6610 -static always build a \`.o' file suitable for static linking
6612 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6613 from the given SOURCEFILE.
6615 The output file name is determined by removing the directory component from
6616 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6617 library object suffix, \`.lo'."
6622 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6624 Automatically set library path, then run a program.
6626 This mode accepts the following additional options:
6628 -dlopen FILE add the directory containing FILE to the library path
6630 This mode sets the library path environment variable according to \`-dlopen'
6633 If any of the ARGS are libtool executable wrappers, then they are translated
6634 into their corresponding uninstalled binary, and any of their required library
6635 directories are added to the library path.
6637 Then, COMMAND is executed, with ARGS as arguments."
6642 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6644 Complete the installation of libtool libraries.
6646 Each LIBDIR is a directory that contains libtool libraries.
6648 The commands that this mode executes may require superuser privileges. Use
6649 the \`--dry-run' option if you just want to see what would be executed."
6654 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6656 Install executables or libraries.
6658 INSTALL-COMMAND is the installation command. The first component should be
6659 either the \`install' or \`cp' program.
6661 The rest of the components are interpreted as arguments to that command (only
6662 BSD-compatible install options are recognized)."
6667 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6669 Link object files or libraries together to form another library, or to
6670 create an executable program.
6672 LINK-COMMAND is a command using the C compiler that you would use to create
6673 a program from several object files.
6675 The following components of LINK-COMMAND are treated specially:
6677 -all-static do not do any dynamic linking at all
6678 -avoid-version do not add a version suffix if possible
6679 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6680 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6681 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6682 -export-symbols SYMFILE
6683 try to export only the symbols listed in SYMFILE
6684 -export-symbols-regex REGEX
6685 try to export only the symbols matching REGEX
6686 -LLIBDIR search LIBDIR for required installed libraries
6687 -lNAME OUTPUT-FILE requires the installed library libNAME
6688 -module build a library that can dlopened
6689 -no-fast-install disable the fast-install mode
6690 -no-install link a not-installable executable
6691 -no-undefined declare that a library does not refer to external symbols
6692 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6693 -objectlist FILE Use a list of object files found in FILE to specify objects
6694 -precious-files-regex REGEX
6695 don't remove output files matching REGEX
6696 -release RELEASE specify package release information
6697 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6698 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6699 -static do not do any dynamic linking of libtool libraries
6700 -version-info CURRENT[:REVISION[:AGE]]
6701 specify library version info [each variable defaults to 0]
6703 All other options (arguments beginning with \`-') are ignored.
6705 Every other argument is treated as a filename. Files ending in \`.la' are
6706 treated as uninstalled libtool libraries, other files are standard or library
6709 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6710 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6711 required, except when creating a convenience library.
6713 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6714 using \`ar' and \`ranlib', or on Windows using \`lib'.
6716 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6717 is created, otherwise an executable program is created."
6722 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6724 Remove libraries from an installation directory.
6726 RM is the name of the program to use to delete files associated with each FILE
6727 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6730 If FILE is a libtool library, all the files associated with it are deleted.
6731 Otherwise, only FILE itself is deleted using RM."
6735 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6742 $echo "Try \`$modename --help' for more information about other modes."
6746 # The TAGs below are defined such that we never get into a situation
6747 # in which we disable both kinds of libraries. Given conflicting
6748 # choices, we go for a static library, that is the most portable,
6749 # since we can't tell whether shared libraries were disabled because
6750 # the user asked for that or because the platform doesn't support
6751 # them. This is particularly important on AIX, because we don't
6752 # support having both static and shared libraries enabled at the same
6753 # time on that platform, so we default to a shared-only configuration.
6754 # If a disable-shared tag is given, we'll fallback to a static-only
6755 # configuration. But we'll never go from static-only to shared-only.
6757 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6758 build_libtool_libs=no
6760 # ### END LIBTOOL TAG CONFIG: disable-shared
6762 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6763 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6764 # ### END LIBTOOL TAG CONFIG: disable-static
6770 # ### BEGIN LIBTOOL TAG CONFIG: CXX
6772 # Libtool was configured on host ubuntu:
6774 # Shell to use when invoking shell scripts.
6777 # Whether or not to build shared libraries.
6778 build_libtool_libs=yes
6780 # Whether or not to build static libraries.
6783 # Whether or not to add -lc for building shared libraries.
6784 build_libtool_need_lc=no
6786 # Whether or not to disallow shared libs when runtime libs are static
6787 allow_libtool_libs_with_static_runtimes=no
6789 # Whether or not to optimize for fast installation.
6794 host=x86_64-unknown-linux-gnu
6796 # An echo program that does not interpret backslashes.
6806 # A language-specific compiler.
6809 # Is the compiler the GNU C compiler?
6815 # The linker used to build libraries.
6816 LD="/usr/bin/ld -m elf_x86_64"
6818 # Whether we need hard or soft links.
6821 # A BSD-compatible nm program.
6824 # A symbol stripping program
6827 # Used to examine libraries when file_magic_cmd begins "file"
6830 # Used on cygwin: DLL creation program.
6833 # Used on cygwin: object dumper.
6836 # Used on cygwin: assembler.
6839 # The name of the directory that contains temporary libtool files.
6842 # How to create reloadable object files.
6844 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6846 # How to pass a linker flag through the compiler.
6849 # Object file suffix (normally "o").
6852 # Old archive suffix (normally "a").
6855 # Shared library suffix (normally ".so").
6858 # Executable file suffix (normally "").
6861 # Additional compiler flags for building library objects.
6862 pic_flag=" -fPIC -DPIC"
6865 # What is the maximum length of a command?
6868 # Does compiler simultaneously support -c and -o options?
6871 # Must we lock files when doing compilation ?
6874 # Do we need the lib prefix for modules?
6877 # Do we need a version for libraries?
6880 # Whether dlopen is supported.
6883 # Whether dlopen of programs is supported.
6886 # Whether dlopen of statically linked programs is supported.
6887 dlopen_self_static=yes
6889 # Compiler flag to prevent dynamic linking.
6890 link_static_flag="-static"
6892 # Compiler flag to turn off builtin functions.
6893 no_builtin_flag=" -fno-builtin"
6895 # Compiler flag to allow reflexive dlopens.
6896 export_dynamic_flag_spec="\${wl}--export-dynamic"
6898 # Compiler flag to generate shared objects directly from archives.
6899 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
6901 # Compiler flag to generate thread-safe objects.
6902 thread_safe_flag_spec=""
6904 # Library versioning type.
6907 # Format of library name prefix.
6908 libname_spec="lib\$name"
6910 # List of archive names. First name is the real one, the rest are links.
6911 # The last name is the one that the linker finds with -lNAME.
6912 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
6914 # The coded name of the library, if different from the real name.
6915 soname_spec="\${libname}\${release}\${shared_ext}\$major"
6917 # Commands used to build and install an old-style archive.
6919 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
6920 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
6921 old_postuninstall_cmds=""
6923 # Create an old-style archive from a shared archive.
6924 old_archive_from_new_cmds=""
6926 # Create a temporary old-style archive to link instead of a shared archive.
6927 old_archive_from_expsyms_cmds=""
6929 # Commands used to build and install a shared archive.
6930 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
6931 archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
6933 postuninstall_cmds=""
6935 # Commands used to build a loadable module (assumed same as above if empty)
6937 module_expsym_cmds=""
6939 # Commands to strip libraries.
6940 old_striplib="strip --strip-debug"
6941 striplib="strip --strip-unneeded"
6943 # Dependencies to place before the objects being linked to create a
6945 predep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o"
6947 # Dependencies to place after the objects being linked to create a
6949 postdep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o"
6951 # Dependencies to place before the objects being linked to create a
6955 # Dependencies to place after the objects being linked to create a
6957 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
6959 # The library search path used internally by the compiler when linking
6961 compiler_lib_search_path="-L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.."
6963 # Method to check whether dependent libraries are shared objects.
6964 deplibs_check_method="pass_all"
6966 # Command to use when deplibs_check_method == file_magic.
6967 file_magic_cmd="\$MAGIC_CMD"
6969 # Flag that allows shared libraries with undefined symbols to be built.
6970 allow_undefined_flag=""
6972 # Flag that forces no undefined symbols.
6973 no_undefined_flag=""
6975 # Commands used to finish a libtool library installation in a directory.
6976 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
6978 # Same as above, but a single script fragment to be evaled but not shown.
6981 # Take the output of nm and produce a listing of raw symbols and C names.
6982 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
6984 # Transform the output of nm in a proper C declaration
6985 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
6987 # Transform the output of nm in a C name address pair
6988 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
6990 # This is the shared library runtime path variable.
6991 runpath_var=LD_RUN_PATH
6993 # This is the shared library path variable.
6994 shlibpath_var=LD_LIBRARY_PATH
6996 # Is shlibpath searched before the hard-coded library search path?
6997 shlibpath_overrides_runpath=no
6999 # How to hardcode a shared library path into an executable.
7000 hardcode_action=immediate
7002 # Whether we should hardcode library paths into libraries.
7003 hardcode_into_libs=yes
7005 # Flag to hardcode $libdir into a binary during linking.
7006 # This must work even if $libdir does not exist.
7007 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
7009 # If ld is used when linking, flag to hardcode $libdir into
7010 # a binary during linking. This must work even if $libdir does
7012 hardcode_libdir_flag_spec_ld=""
7014 # Whether we need a single -rpath flag with a separated argument.
7015 hardcode_libdir_separator=""
7017 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7021 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7025 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7026 # the resulting binary.
7027 hardcode_shlibpath_var=
7029 # Set to yes if building a shared library automatically hardcodes DIR into the library
7030 # and all subsequent libraries and executables linked against it.
7031 hardcode_automatic=no
7033 # Variables whose values should be saved in libtool wrapper scripts and
7034 # restored at relink time.
7035 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7037 # Whether libtool must link a program against all its dependency libraries.
7038 link_all_deplibs=unknown
7040 # Compile-time system search path for libraries
7041 sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
7043 # Run-time system search path for libraries
7044 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 include /etc/ld.so.conf.d/*.conf "
7046 # Fix the shell variable $srcfile for the compiler.
7049 # Set to yes if exported symbols are required.
7050 always_export_symbols=no
7052 # The commands to list exported symbols.
7053 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7055 # The commands to extract the exported symbol list from a shared archive.
7056 extract_expsyms_cmds=""
7058 # Symbols that should not be listed in the preloaded symbols.
7061 # Symbols that must always be exported.
7064 # ### END LIBTOOL TAG CONFIG: CXX