3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU simgrid 3.3-cvs)
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 1s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
40 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
42 # The names of the tagged configurations supported by this script.
43 available_tags=" CXX GCJ"
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host blaise:
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=i686-pc-linux-gnu
74 build=i686-pc-linux-gnu
77 # An echo program that does not interpret backslashes.
87 # LTCC compiler flags.
90 # A language-specific compiler.
93 # Is the compiler the GNU C compiler?
99 # The linker used to build libraries.
102 # Whether we need hard or soft links.
105 # A BSD-compatible nm program.
108 # A symbol stripping program
111 # Used to examine libraries when file_magic_cmd begins "file"
114 # Used on cygwin: DLL creation program.
117 # Used on cygwin: object dumper.
120 # Used on cygwin: assembler.
123 # The name of the directory that contains temporary libtool files.
126 # How to create reloadable object files.
128 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
130 # How to pass a linker flag through the compiler.
133 # Object file suffix (normally "o").
136 # Old archive suffix (normally "a").
139 # Shared library suffix (normally ".so").
142 # Executable file suffix (normally "").
145 # Additional compiler flags for building library objects.
146 pic_flag=" -fPIC -DPIC"
149 # What is the maximum length of a command?
152 # Does compiler simultaneously support -c and -o options?
155 # Must we lock files when doing compilation?
158 # Do we need the lib prefix for modules?
161 # Do we need a version for libraries?
164 # Whether dlopen is supported.
165 dlopen_support=unknown
167 # Whether dlopen of programs is supported.
170 # Whether dlopen of statically linked programs is supported.
171 dlopen_self_static=unknown
173 # Compiler flag to prevent dynamic linking.
174 link_static_flag="-static"
176 # Compiler flag to turn off builtin functions.
177 no_builtin_flag=" -fno-builtin"
179 # Compiler flag to allow reflexive dlopens.
180 export_dynamic_flag_spec="\${wl}--export-dynamic"
182 # Compiler flag to generate shared objects directly from archives.
183 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
185 # Compiler flag to generate thread-safe objects.
186 thread_safe_flag_spec=""
188 # Library versioning type.
191 # Format of library name prefix.
192 libname_spec="lib\$name"
194 # List of archive names. First name is the real one, the rest are links.
195 # The last name is the one that the linker finds with -lNAME.
196 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
198 # The coded name of the library, if different from the real name.
199 soname_spec="\${libname}\${release}\${shared_ext}\$major"
201 # Commands used to build and install an old-style archive.
203 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
204 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205 old_postuninstall_cmds=""
207 # Create an old-style archive from a shared archive.
208 old_archive_from_new_cmds=""
210 # Create a temporary old-style archive to link instead of a shared archive.
211 old_archive_from_expsyms_cmds=""
213 # Commands used to build and install a shared archive.
214 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
215 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
216 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
217 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
218 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
220 postuninstall_cmds=""
222 # Commands used to build a loadable module (assumed same as above if empty)
224 module_expsym_cmds=""
226 # Commands to strip libraries.
227 old_striplib="strip --strip-debug"
228 striplib="strip --strip-unneeded"
230 # Dependencies to place before the objects being linked to create a
234 # Dependencies to place after the objects being linked to create a
238 # Dependencies to place before the objects being linked to create a
242 # Dependencies to place after the objects being linked to create a
246 # The library search path used internally by the compiler when linking
248 compiler_lib_search_path=""
250 # Method to check whether dependent libraries are shared objects.
251 deplibs_check_method="pass_all"
253 # Command to use when deplibs_check_method == file_magic.
254 file_magic_cmd="\$MAGIC_CMD"
256 # Flag that allows shared libraries with undefined symbols to be built.
257 allow_undefined_flag=""
259 # Flag that forces no undefined symbols.
262 # Commands used to finish a libtool library installation in a directory.
263 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
265 # Same as above, but a single script fragment to be evaled but not shown.
268 # Take the output of nm and produce a listing of raw symbols and C names.
269 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
271 # Transform the output of nm in a proper C declaration
272 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
274 # Transform the output of nm in a C name address pair
275 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
277 # This is the shared library runtime path variable.
278 runpath_var=LD_RUN_PATH
280 # This is the shared library path variable.
281 shlibpath_var=LD_LIBRARY_PATH
283 # Is shlibpath searched before the hard-coded library search path?
284 shlibpath_overrides_runpath=no
286 # How to hardcode a shared library path into an executable.
287 hardcode_action=immediate
289 # Whether we should hardcode library paths into libraries.
290 hardcode_into_libs=yes
292 # Flag to hardcode $libdir into a binary during linking.
293 # This must work even if $libdir does not exist.
294 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
296 # If ld is used when linking, flag to hardcode $libdir into
297 # a binary during linking. This must work even if $libdir does
299 hardcode_libdir_flag_spec_ld=""
301 # Whether we need a single -rpath flag with a separated argument.
302 hardcode_libdir_separator=""
304 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
308 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
312 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
313 # the resulting binary.
314 hardcode_shlibpath_var=unsupported
316 # Set to yes if building a shared library automatically hardcodes DIR into the library
317 # and all subsequent libraries and executables linked against it.
318 hardcode_automatic=no
320 # Variables whose values should be saved in libtool wrapper scripts and
321 # restored at relink time.
322 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
324 # Whether libtool must link a program against all its dependency libraries.
327 # Compile-time system search path for libraries
328 sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.2.1/ /usr/lib/gcc/i486-linux-gnu/4.2.1/ /usr/lib/gcc/i486-linux-gnu/4.2.1/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.2.1/ /usr/lib/gcc/i486-linux-gnu/4.2.1/../../../../i486-linux-gnu/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.2.1/../../../i486-linux-gnu/4.2.1/ /usr/lib/gcc/i486-linux-gnu/4.2.1/../../../../lib/ /lib/i486-linux-gnu/4.2.1/ /lib/../lib/ /usr/lib/i486-linux-gnu/4.2.1/ /usr/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.2.1/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.2.1/../../../ /lib/ /usr/lib/"
330 # Run-time system search path for libraries
331 sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/local/lib "
333 # Fix the shell variable $srcfile for the compiler.
336 # Set to yes if exported symbols are required.
337 always_export_symbols=no
339 # The commands to list exported symbols.
340 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
342 # The commands to extract the exported symbol list from a shared archive.
343 extract_expsyms_cmds=""
345 # Symbols that should not be listed in the preloaded symbols.
346 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
348 # Symbols that must always be exported.
351 # ### END LIBTOOL CONFIG
353 # ltmain.sh - Provide generalized library-building support services.
354 # NOTE: Changing this file will not affect anything until you rerun configure.
356 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
357 # 2007 Free Software Foundation, Inc.
358 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
360 # This program is free software; you can redistribute it and/or modify
361 # it under the terms of the GNU General Public License as published by
362 # the Free Software Foundation; either version 2 of the License, or
363 # (at your option) any later version.
365 # This program is distributed in the hope that it will be useful, but
366 # WITHOUT ANY WARRANTY; without even the implied warranty of
367 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
368 # General Public License for more details.
370 # You should have received a copy of the GNU General Public License
371 # along with this program; if not, write to the Free Software
372 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
374 # As a special exception to the GNU General Public License, if you
375 # distribute this file as part of a program that contains a
376 # configuration script generated by Autoconf, you may include it under
377 # the same distribution terms that you use for the rest of that program.
381 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
382 # is ksh but when the shell is invoked as "sh" and the current value of
383 # the _XPG environment variable is not equal to 1 (one), the special
384 # positional parameter $0, within a function call, is the name of the
388 # The name of this program:
389 progname=`echo "$progpath" | $SED $basename`
399 TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)"
401 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
402 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
405 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
406 # is contrary to our usage. Disable this feature.
407 alias -g '${1+"$@"}'='"$@"'
410 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
412 BIN_SH=xpg4; export BIN_SH # for Tru64
413 DUALCASE=1; export DUALCASE # for MKS sh
415 # Check that we have a working $echo.
416 if test "X$1" = X--no-reexec; then
417 # Discard the --no-reexec flag, and continue.
419 elif test "X$1" = X--fallback-echo; then
420 # Avoid inline document here, it may be left over
422 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
423 # Yippee, $echo works!
426 # Restart under the correct shell, and then maybe $echo will work.
427 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
430 if test "X$1" = X--fallback-echo; then
431 # used as fallback echo
440 help="Try \`$progname --help' for more information."
441 magic="%%%MAGIC variable%%%"
446 # Sed substitution that helps us do robust quoting. It backslashifies
447 # metacharacters that are still active within double-quoted strings.
448 Xsed="${SED}"' -e 1s/^X//'
449 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
450 # test EBCDIC or ASCII
451 case `echo X|tr X '\101'` in
452 A) # ASCII based system
453 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
455 NL2SP='tr \015\012 \040\040'
457 *) # EBCDIC based system
459 NL2SP='tr \r\n \100\100'
464 # Only set LANG and LC_ALL to C if already set.
465 # These must not be set unconditionally because not all systems understand
466 # e.g. LANG=C (notably SCO).
467 # We save the old values to restore during execute mode.
468 for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
470 eval "if test \"\${$lt_var+set}\" = set; then
471 save_$lt_var=\$$lt_var
477 # Make sure IFS has a sensible default
482 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
483 $echo "$modename: not configured to build any kind of library" 1>&2
484 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
499 lo2o="s/\\.lo\$/.${objext}/"
500 o2lo="s/\\.${objext}\$/.lo/"
504 #####################################
505 # Shell function definitions:
506 # This seems to be the best place for them
508 # func_mktempdir [string]
509 # Make a temporary directory that won't clash with other running
510 # libtool processes, and avoids race conditions if possible. If
511 # given, STRING is the basename for that directory.
514 my_template="${TMPDIR-/tmp}/${1-$progname}"
516 if test "$run" = ":"; then
517 # Return a directory name, but don't create it in dry-run mode
518 my_tmpdir="${my_template}-$$"
521 # If mktemp works, use that first and foremost
522 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
524 if test ! -d "$my_tmpdir"; then
525 # Failing that, at least try and use $RANDOM to avoid a race
526 my_tmpdir="${my_template}-${RANDOM-0}$$"
528 save_mktempdir_umask=`umask`
531 umask $save_mktempdir_umask
534 # If we're not in dry-run mode, bomb out on failure
535 test -d "$my_tmpdir" || {
536 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
541 $echo "X$my_tmpdir" | $Xsed
545 # func_win32_libid arg
546 # return the library type of file 'arg'
548 # Need a lot of goo to handle *both* DLLs and import libs
549 # Has to be a shell function in order to 'eat' the argument
550 # that is supplied when $file_magic_command is called.
553 win32_libid_type="unknown"
554 win32_fileres=`file -L $1 2>/dev/null`
555 case $win32_fileres in
556 *ar\ archive\ import\ library*) # definitely import
557 win32_libid_type="x86 archive import"
559 *ar\ archive*) # could be an import, or static
560 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
561 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
562 win32_nmres=`eval $NM -f posix -A $1 | \
571 import*) win32_libid_type="x86 archive import";;
572 *) win32_libid_type="x86 archive static";;
577 win32_libid_type="x86 DLL"
579 *executable*) # but shell scripts are "executable" too...
580 case $win32_fileres in
581 *MS\ Windows\ PE\ Intel*)
582 win32_libid_type="x86 DLL"
587 $echo $win32_libid_type
592 # Infer tagged configuration to use if any are available and
593 # if one wasn't chosen via the "--tag" command line option.
594 # Only attempt this if the compiler in the base compile
595 # command doesn't match the default compiler.
596 # arg is usually of the form 'gcc ...'
599 if test -n "$available_tags" && test -z "$tagname"; then
603 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
607 CC_quoted="$CC_quoted $arg"
610 # Blanks in the command may have been stripped by the calling shell,
611 # but not from the CC environment variable when configure was run.
612 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
613 # Blanks at the start of $base_compile will cause this to fail
614 # if we don't check for them as well.
616 for z in $available_tags; do
617 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
618 # Evaluate the configuration.
619 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
622 # Double-quote args containing other shell metacharacters.
624 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
628 CC_quoted="$CC_quoted $arg"
630 # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
631 trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
632 # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
633 extendcc=${host}-${CC}
634 # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
635 # (Gentoo-specific hack because we always export $CHOST)
636 mungedcc=${CHOST-${host}}-${trimedcc}
638 "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
639 "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
642 "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
643 "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
644 "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
645 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
646 # The compiler in the base compile command matches
647 # the one in the tagged configuration.
648 # Assume this is the tagged configuration we want.
655 # If $tagname still isn't set, then no tagged configuration
656 # was found and let the user know that the "--tag" command
657 # line option must be used.
658 if test -z "$tagname"; then
659 $echo "$modename: unable to infer tagged configuration"
660 $echo "$modename: specify a tag with \`--tag'" 1>&2
663 # $echo "$modename: using $tagname tagged configuration"
671 # func_extract_an_archive dir oldlib
672 func_extract_an_archive ()
674 f_ex_an_ar_dir="$1"; shift
675 f_ex_an_ar_oldlib="$1"
677 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
678 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
679 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
682 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
687 # func_extract_archives gentop oldlib ...
688 func_extract_archives ()
690 my_gentop="$1"; shift
698 $show "${rm}r $my_gentop"
699 $run ${rm}r "$my_gentop"
700 $show "$mkdir $my_gentop"
701 $run $mkdir "$my_gentop"
703 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
707 for my_xlib in $my_oldlibs; do
708 # Extract the objects.
710 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
711 *) my_xabs=`pwd`"/$my_xlib" ;;
713 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
716 case " $extracted_archives " in
718 extracted_serial=`expr $extracted_serial + 1`
719 my_xlib_u=lt$extracted_serial-$my_xlib ;;
723 extracted_archives="$extracted_archives $my_xlib_u"
724 my_xdir="$my_gentop/$my_xlib_u"
726 $show "${rm}r $my_xdir"
727 $run ${rm}r "$my_xdir"
728 $show "$mkdir $my_xdir"
729 $run $mkdir "$my_xdir"
731 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
736 $show "Extracting $my_xabs"
737 # Do not bother doing anything if just a dry run
738 if test -z "$run"; then
739 darwin_orig_dir=`pwd`
740 cd $my_xdir || exit $?
741 darwin_archive=$my_xabs
743 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
744 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
745 if test -n "$darwin_arches"; then
746 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
748 $show "$darwin_base_archive has multiple architectures $darwin_arches"
749 for darwin_arch in $darwin_arches ; do
750 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
751 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
752 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
753 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
755 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
756 done # $darwin_arches
757 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
758 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
761 for darwin_file in $darwin_filelist; do
762 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
763 lipo -create -output "$darwin_file" $darwin_files
764 done # $darwin_filelist
766 cd "$darwin_orig_dir"
768 cd "$darwin_orig_dir"
769 func_extract_an_archive "$my_xdir" "$my_xabs"
774 func_extract_an_archive "$my_xdir" "$my_xabs"
777 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
779 func_extract_archives_result="$my_oldobjs"
781 # End of Shell function definitions
782 #####################################
785 eval std_shrext=\"$shrext_cmds\"
789 # Parse our command line options once, thoroughly.
790 while test "$#" -gt 0
796 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
800 # If the previous option needs an argument, assign it.
801 if test -n "$prev"; then
804 execute_dlfiles="$execute_dlfiles $arg"
808 preserve_args="${preserve_args}=$arg"
810 # Check whether tagname contains only valid characters
813 $echo "$progname: invalid tag name: $tagname" 1>&2
820 # Don't test for the "default" C tag, as we know, it's there, but
821 # not specially marked.
824 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
825 taglist="$taglist $tagname"
826 # Evaluate the configuration.
827 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
829 $echo "$progname: ignoring unknown tag $tagname" 1>&2
844 # Have we seen a non-optional argument yet?
852 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
854 Copyright (C) 2007 Free Software Foundation, Inc.
855 This is free software; see the source for copying conditions. There is NO
856 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
861 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
862 # Now print the configurations for the tags.
863 for tagname in $taglist; do
864 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
870 $echo "$progname: enabling shell trace mode"
872 preserve_args="$preserve_args $arg"
881 if test "$build_libtool_libs" = yes; then
882 $echo "enable shared libraries"
884 $echo "disable shared libraries"
886 if test "$build_old_libs" = yes; then
887 $echo "enable static libraries"
889 $echo "disable static libraries"
894 --finish) mode="finish" ;;
896 --mode) prevopt="--mode" prev=mode ;;
897 --mode=*) mode="$optarg" ;;
899 --preserve-dup-deps) duplicate_deps="yes" ;;
903 preserve_args="$preserve_args $arg"
909 preserve_args="$preserve_args --tag"
912 set tag "$optarg" ${1+"$@"}
915 preserve_args="$preserve_args --tag"
924 $echo "$modename: unrecognized option \`$arg'" 1>&2
936 if test -n "$prevopt"; then
937 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
942 case $disable_libs in
946 build_libtool_libs=no
950 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
954 # If this variable is set in any of the actions, the command in it
955 # will be execed at the end. This prevents here-documents from being
956 # left over by shells.
959 if test -z "$show_help"; then
961 # Infer the operation mode.
962 if test -z "$mode"; then
963 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
964 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
966 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
978 *db | *dbx | *strace | *truss)
988 # If we have no mode, but dlfiles were specified, then do execute mode.
989 test -n "$execute_dlfiles" && mode=execute
991 # Just use the default operation mode.
992 if test -z "$mode"; then
993 if test -n "$nonopt"; then
994 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
996 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
1003 # Only execute mode is allowed to have -dlopen flags.
1004 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1005 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1010 # Change the help message to a mode-specific one.
1011 generic_help="$help"
1012 help="Try \`$modename --help --mode=$mode' for more information."
1014 # These modes are in order of execution frequency so that they run quickly.
1016 # libtool compile mode
1018 modename="$modename: compile"
1019 # Get the compilation command and the source file.
1021 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1032 # do not "continue". Instead, add this to base_compile
1044 # Accept any command-line options.
1047 if test -n "$libobj" ; then
1048 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1055 -static | -prefer-pic | -prefer-non-pic)
1066 arg_mode=arg # the next one goes into the "base_compile" arg list
1067 continue # The current "srcfile" will either be retained or
1068 ;; # replaced later. I would guess that would be a bug.
1071 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1073 save_ifs="$IFS"; IFS=','
1074 for arg in $args; do
1077 # Double-quote args containing other shell metacharacters.
1078 # Many Bourne shells cannot handle close brackets correctly
1079 # in scan sets, so we specify it separately.
1081 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1085 lastarg="$lastarg $arg"
1088 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1090 # Add the arguments to base_compile.
1091 base_compile="$base_compile $lastarg"
1096 # Accept the current argument as the source file.
1097 # The previous "srcfile" becomes the current argument.
1104 esac # case $arg_mode
1106 # Aesthetically quote the previous argument.
1107 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1110 # Double-quote args containing other shell metacharacters.
1111 # Many Bourne shells cannot handle close brackets correctly
1112 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1113 # in scan sets (worked around with variable expansion),
1114 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1115 # at all, so we specify them separately.
1116 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1117 lastarg="\"$lastarg\""
1121 base_compile="$base_compile $lastarg"
1126 $echo "$modename: you must specify an argument for -Xcompile"
1130 $echo "$modename: you must specify a target with \`-o'" 1>&2
1134 # Get the name of the library object.
1135 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1139 # Recognize several different file suffixes.
1140 # If the user specifies -o file.o, it is replaced with file.lo
1150 *.class) xform=class ;;
1153 *.[fF][09]?) xform=[fF][09]. ;;
1155 *.java) xform=java ;;
1159 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1162 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1164 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1169 func_infer_tag $base_compile
1171 for arg in $later; do
1190 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1192 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1193 qlibobj="\"$qlibobj\"" ;;
1195 test "X$libobj" != "X$qlibobj" \
1196 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1197 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1198 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1199 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1200 if test "X$xdir" = "X$obj"; then
1205 lobj=${xdir}$objdir/$objname
1207 if test -z "$base_compile"; then
1208 $echo "$modename: you must specify a compilation command" 1>&2
1213 # Delete any leftover library objects.
1214 if test "$build_old_libs" = yes; then
1215 removelist="$obj $lobj $libobj ${libobj}T"
1217 removelist="$lobj $libobj ${libobj}T"
1220 $run $rm $removelist
1221 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1223 # On Cygwin there's no "real" PIC flag so we must build both object types
1225 cygwin* | mingw* | pw32* | os2*)
1229 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1230 # non-PIC code in shared libraries is not supported
1234 # Calculate the filename of the output object if compiler does
1235 # not support -o with -c
1236 if test "$compiler_c_o" = no; then
1237 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1238 lockfile="$output_obj.lock"
1239 removelist="$removelist $output_obj $lockfile"
1240 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1247 # Lock this critical section if it is needed
1248 # We use this script file to make the link, it avoids creating a new file
1249 if test "$need_locks" = yes; then
1250 until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
1251 $show "Waiting for $lockfile to be removed"
1254 elif test "$need_locks" = warn; then
1255 if test -f "$lockfile"; then
1257 *** ERROR, $lockfile exists and contains:
1258 `cat $lockfile 2>/dev/null`
1260 This indicates that another process is trying to use the same
1261 temporary object file, and libtool could not work around it because
1262 your compiler does not support \`-c' and \`-o' together. If you
1263 repeat this compilation, it may succeed, by chance, but you had better
1264 avoid parallel builds (make -j) in this platform, or get a better
1267 $run $rm $removelist
1270 $echo "$srcfile" > "$lockfile"
1273 if test -n "$fix_srcfile_path"; then
1274 eval srcfile=\"$fix_srcfile_path\"
1276 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1278 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1279 qsrcfile="\"$qsrcfile\"" ;;
1282 $run $rm "$libobj" "${libobj}T"
1284 # Create a libtool object file (analogous to a ".la" file),
1285 # but don't create it if we're doing a dry run.
1286 test -z "$run" && cat > ${libobj}T <<EOF
1287 # $libobj - a libtool object file
1288 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1290 # Please DO NOT delete this file!
1291 # It is necessary for linking the library.
1293 # Name of the PIC object.
1296 # Only build a PIC object if we are building libtool libraries.
1297 if test "$build_libtool_libs" = yes; then
1298 # Without this assignment, base_compile gets emptied.
1299 fbsd_hideous_sh_bug=$base_compile
1301 if test "$pic_mode" != no; then
1302 command="$base_compile $qsrcfile $pic_flag"
1304 # Don't build PIC code
1305 command="$base_compile $qsrcfile"
1308 if test ! -d "${xdir}$objdir"; then
1309 $show "$mkdir ${xdir}$objdir"
1310 $run $mkdir ${xdir}$objdir
1312 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1317 if test -z "$output_obj"; then
1318 # Place PIC objects in $objdir
1319 command="$command -o $lobj"
1322 $run $rm "$lobj" "$output_obj"
1325 if $run eval "$command"; then :
1327 test -n "$output_obj" && $run $rm $removelist
1331 if test "$need_locks" = warn &&
1332 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1334 *** ERROR, $lockfile contains:
1335 `cat $lockfile 2>/dev/null`
1337 but it should contain:
1340 This indicates that another process is trying to use the same
1341 temporary object file, and libtool could not work around it because
1342 your compiler does not support \`-c' and \`-o' together. If you
1343 repeat this compilation, it may succeed, by chance, but you had better
1344 avoid parallel builds (make -j) in this platform, or get a better
1347 $run $rm $removelist
1351 # Just move the object if needed, then go on to compile the next one
1352 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1353 $show "$mv $output_obj $lobj"
1354 if $run $mv $output_obj $lobj; then :
1357 $run $rm $removelist
1362 # Append the name of the PIC object to the libtool object file.
1363 test -z "$run" && cat >> ${libobj}T <<EOF
1364 pic_object='$objdir/$objname'
1368 # Allow error messages only from the first compilation.
1369 if test "$suppress_opt" = yes; then
1370 suppress_output=' >/dev/null 2>&1'
1373 # No PIC object so indicate it doesn't exist in the libtool
1375 test -z "$run" && cat >> ${libobj}T <<EOF
1381 # Only build a position-dependent object if we build old libraries.
1382 if test "$build_old_libs" = yes; then
1383 if test "$pic_mode" != yes; then
1384 # Don't build PIC code
1385 command="$base_compile $qsrcfile"
1387 command="$base_compile $qsrcfile $pic_flag"
1389 if test "$compiler_c_o" = yes; then
1390 command="$command -o $obj"
1393 # Suppress compiler output if we already did a PIC compilation.
1394 command="$command$suppress_output"
1395 $run $rm "$obj" "$output_obj"
1397 if $run eval "$command"; then :
1399 $run $rm $removelist
1403 if test "$need_locks" = warn &&
1404 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1406 *** ERROR, $lockfile contains:
1407 `cat $lockfile 2>/dev/null`
1409 but it should contain:
1412 This indicates that another process is trying to use the same
1413 temporary object file, and libtool could not work around it because
1414 your compiler does not support \`-c' and \`-o' together. If you
1415 repeat this compilation, it may succeed, by chance, but you had better
1416 avoid parallel builds (make -j) in this platform, or get a better
1419 $run $rm $removelist
1423 # Just move the object if needed
1424 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1425 $show "$mv $output_obj $obj"
1426 if $run $mv $output_obj $obj; then :
1429 $run $rm $removelist
1434 # Append the name of the non-PIC object the libtool object file.
1435 # Only append if the libtool object file exists.
1436 test -z "$run" && cat >> ${libobj}T <<EOF
1437 # Name of the non-PIC object.
1438 non_pic_object='$objname'
1442 # Append the name of the non-PIC object the libtool object file.
1443 # Only append if the libtool object file exists.
1444 test -z "$run" && cat >> ${libobj}T <<EOF
1445 # Name of the non-PIC object.
1451 $run $mv "${libobj}T" "${libobj}"
1453 # Unlock the critical section if it was locked
1454 if test "$need_locks" != no; then
1455 $run $rm "$lockfile"
1463 modename="$modename: link"
1465 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1466 # It is impossible to link a dll without this setting, and
1467 # we shouldn't force the makefile maintainer to figure out
1468 # which system we are compiling for in order to pass an extra
1469 # flag for every libtool invocation.
1470 # allow_undefined=no
1472 # FIXME: Unfortunately, there are problems with the above when trying
1473 # to make a dll which has undefined symbols, in which case not
1474 # even a static library is built. For now, we need to specify
1475 # -no-undefined on the libtool link line when we can be certain
1476 # that all symbols are satisfied, otherwise we get a static library.
1483 libtool_args="$nonopt"
1484 base_compile="$nonopt $@"
1485 compile_command="$nonopt"
1486 finalize_command="$nonopt"
1499 lib_search_path=`pwd`
1508 export_symbols_regex=
1516 notinst_path= # paths that contain not-installed libtool libraries
1517 precious_files_regex=
1518 prefer_static_libs=no
1531 func_infer_tag $base_compile
1533 # We need to know -static, to get the right output filenames.
1537 -all-static | -static | -static-libtool-libs)
1540 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1541 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1543 if test -n "$link_static_flag"; then
1544 dlopen_self=$dlopen_self_static
1546 prefer_static_libs=yes
1549 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1550 dlopen_self=$dlopen_self_static
1552 prefer_static_libs=built
1554 -static-libtool-libs)
1555 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1556 dlopen_self=$dlopen_self_static
1558 prefer_static_libs=yes
1561 build_libtool_libs=no
1568 # See if our shared archives depend on static archives.
1569 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1571 # Go through the arguments, transforming them on the way.
1572 while test "$#" -gt 0; do
1576 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1577 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1581 libtool_args="$libtool_args $qarg"
1583 # If the previous option needs an argument, assign it.
1584 if test -n "$prev"; then
1587 compile_command="$compile_command @OUTPUT@"
1588 finalize_command="$finalize_command @OUTPUT@"
1594 if test "$preload" = no; then
1595 # Add the symbol object into the linking commands.
1596 compile_command="$compile_command @SYMFILE@"
1597 finalize_command="$finalize_command @SYMFILE@"
1601 *.la | *.lo) ;; # We handle these cases below.
1603 if test "$dlself" = no; then
1611 if test "$prev" = dlprefiles; then
1613 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1623 if test "$prev" = dlfiles; then
1624 dlfiles="$dlfiles $arg"
1626 dlprefiles="$dlprefiles $arg"
1634 export_symbols="$arg"
1635 if test ! -f "$arg"; then
1636 $echo "$modename: symbol file \`$arg' does not exist"
1643 export_symbols_regex="$arg"
1648 inst_prefix_dir="$arg"
1653 precious_files_regex="$arg"
1663 if test -f "$arg"; then
1666 for fil in `cat $save_arg`
1668 # moreargs="$moreargs $fil"
1670 # A libtool-controlled object.
1672 # Check to see that this really is a libtool object.
1673 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1678 # If there is no directory component, then add one.
1680 */* | *\\*) . $arg ;;
1684 if test -z "$pic_object" || \
1685 test -z "$non_pic_object" ||
1686 test "$pic_object" = none && \
1687 test "$non_pic_object" = none; then
1688 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1692 # Extract subdirectory from the argument.
1693 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1694 if test "X$xdir" = "X$arg"; then
1700 if test "$pic_object" != none; then
1701 # Prepend the subdirectory the object is found in.
1702 pic_object="$xdir$pic_object"
1704 if test "$prev" = dlfiles; then
1705 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1706 dlfiles="$dlfiles $pic_object"
1710 # If libtool objects are unsupported, then we need to preload.
1715 # CHECK ME: I think I busted this. -Ossama
1716 if test "$prev" = dlprefiles; then
1717 # Preload the old-style object.
1718 dlprefiles="$dlprefiles $pic_object"
1723 libobjs="$libobjs $pic_object"
1728 if test "$non_pic_object" != none; then
1729 # Prepend the subdirectory the object is found in.
1730 non_pic_object="$xdir$non_pic_object"
1732 # A standard non-PIC object
1733 non_pic_objects="$non_pic_objects $non_pic_object"
1734 if test -z "$pic_object" || test "$pic_object" = none ; then
1735 arg="$non_pic_object"
1738 # If the PIC object exists, use it instead.
1739 # $xdir was prepended to $pic_object above.
1740 non_pic_object="$pic_object"
1741 non_pic_objects="$non_pic_objects $non_pic_object"
1744 # Only an error if not doing a dry-run.
1745 if test -z "$run"; then
1746 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1751 # Extract subdirectory from the argument.
1752 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1753 if test "X$xdir" = "X$arg"; then
1759 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1760 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1761 libobjs="$libobjs $pic_object"
1762 non_pic_objects="$non_pic_objects $non_pic_object"
1767 $echo "$modename: link input file \`$save_arg' does not exist"
1775 # We need an absolute path.
1777 [\\/]* | [A-Za-z]:[\\/]*) ;;
1779 $echo "$modename: only absolute run-paths are allowed" 1>&2
1783 if test "$prev" = rpath; then
1786 *) rpath="$rpath $arg" ;;
1791 *) xrpath="$xrpath $arg" ;;
1798 compiler_flags="$compiler_flags $qarg"
1800 compile_command="$compile_command $qarg"
1801 finalize_command="$finalize_command $qarg"
1805 linker_flags="$linker_flags $qarg"
1806 compiler_flags="$compiler_flags $wl$qarg"
1808 compile_command="$compile_command $wl$qarg"
1809 finalize_command="$finalize_command $wl$qarg"
1813 linker_flags="$linker_flags $qarg"
1814 compiler_flags="$compiler_flags $qarg"
1816 compile_command="$compile_command $qarg"
1817 finalize_command="$finalize_command $qarg"
1825 darwin_framework|darwin_framework_skip)
1826 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1827 compile_command="$compile_command $arg"
1828 finalize_command="$finalize_command $arg"
1833 eval "$prev=\"\$arg\""
1838 fi # test -n "$prev"
1844 if test -n "$link_static_flag"; then
1845 compile_command="$compile_command $link_static_flag"
1846 finalize_command="$finalize_command $link_static_flag"
1852 # FIXME: remove this flag sometime in the future.
1853 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1877 -export-symbols | -export-symbols-regex)
1878 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1879 $echo "$modename: more than one -exported-symbols argument is not allowed"
1882 if test "X$arg" = "X-export-symbols"; then
1890 -framework|-arch|-isysroot)
1892 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1893 prev=darwin_framework_skip ;;
1894 *) compiler_flags="$compiler_flags $arg"
1895 prev=darwin_framework ;;
1897 compile_command="$compile_command $arg"
1898 finalize_command="$finalize_command $arg"
1907 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1908 # so, if we see these flags be careful not to treat them like -L
1910 case $with_gcc/$host in
1911 no/*-*-irix* | /*-*-irix*)
1912 compile_command="$compile_command $arg"
1913 finalize_command="$finalize_command $arg"
1920 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1921 # We need an absolute path.
1923 [\\/]* | [A-Za-z]:[\\/]*) ;;
1925 absdir=`cd "$dir" && pwd`
1926 if test -z "$absdir"; then
1927 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1929 notinst_path="$notinst_path $dir"
1937 deplibs="$deplibs -L$dir"
1938 lib_search_path="$lib_search_path $dir"
1942 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1943 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1944 case :$dllsearchpath: in
1946 *) dllsearchpath="$dllsearchpath:$dir";;
1948 case :$dllsearchpath: in
1949 *":$testbindir:"*) ;;
1950 *) dllsearchpath="$dllsearchpath:$testbindir";;
1958 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1960 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1961 # These systems don't actually have a C or math library (as such)
1965 # These systems don't actually have a C library (as such)
1966 test "X$arg" = "X-lc" && continue
1968 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1969 # Do not include libc due to us having libc/libc_r.
1970 test "X$arg" = "X-lc" && continue
1972 *-*-rhapsody* | *-*-darwin1.[012])
1973 # Rhapsody C and math libraries are in the System framework
1974 deplibs="$deplibs -framework System"
1977 *-*-sco3.2v5* | *-*-sco5v6*)
1978 # Causes problems with __ctype
1979 test "X$arg" = "X-lc" && continue
1981 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1982 # Compiler inserts libc in the correct place for threads to work
1983 test "X$arg" = "X-lc" && continue
1986 elif test "X$arg" = "X-lc_r"; then
1988 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1989 # Do not include libc_r directly, use -pthread flag.
1994 deplibs="$deplibs $arg"
1998 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1999 # classes, name mangling, and exception handling.
2001 compile_command="$compile_command $arg"
2002 compiler_flags="$compiler_flags $arg"
2003 finalize_command="$finalize_command $arg"
2008 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2009 compiler_flags="$compiler_flags $arg"
2010 compile_command="$compile_command $arg"
2011 finalize_command="$finalize_command $arg"
2020 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2021 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2022 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2023 # +DA*, +DD* enable 64-bit mode on the HP compiler
2024 # -q* pass through compiler args for the IBM compiler
2025 # -m* pass through architecture-specific compiler args for GCC
2026 # -m*, -t[45]*, -txscale* pass through architecture-specific
2027 # compiler args for GCC
2028 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
2029 # -F/path gives path to uninstalled frameworks, gcc on darwin
2030 # @file GCC response files
2031 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
2032 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
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 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2042 compile_command="$compile_command $arg"
2043 finalize_command="$finalize_command $arg"
2044 compiler_flags="$compiler_flags $arg"
2060 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
2061 # The PATH hackery in wrapper scripts is required on Windows
2062 # and Darwin in order for the loader to find any dlls it needs.
2063 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2064 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2067 *) no_install=yes ;;
2084 -precious-files-regex)
2105 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2106 # We need an absolute path.
2108 [\\/]* | [A-Za-z]:[\\/]*) ;;
2110 $echo "$modename: only absolute run-paths are allowed" 1>&2
2116 *) xrpath="$xrpath $dir" ;;
2121 -static | -static-libtool-libs)
2122 # The effects of -static are defined in a previous loop.
2123 # We used to do the same as -all-static on platforms that
2124 # didn't have a PIC flag, but the assumption that the effects
2125 # would be equivalent was wrong. It would break on at least
2126 # Digital Unix and AIX.
2146 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2148 save_ifs="$IFS"; IFS=','
2149 for flag in $args; do
2152 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2157 compiler_flags="$compiler_flags $flag"
2160 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2164 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2166 save_ifs="$IFS"; IFS=','
2167 for flag in $args; do
2170 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2175 compiler_flags="$compiler_flags $wl$flag"
2176 linker_flags="$linker_flags $flag"
2179 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2197 # Some other compiler flag.
2199 # Unknown arguments in both finalize_command and compile_command need
2200 # to be aesthetically quoted because they are evaled later.
2201 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2203 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2210 # A standard object.
2215 # A libtool-controlled object.
2217 # Check to see that this really is a libtool object.
2218 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2223 # If there is no directory component, then add one.
2225 */* | *\\*) . $arg ;;
2229 if test -z "$pic_object" || \
2230 test -z "$non_pic_object" ||
2231 test "$pic_object" = none && \
2232 test "$non_pic_object" = none; then
2233 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2237 # Extract subdirectory from the argument.
2238 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2239 if test "X$xdir" = "X$arg"; then
2245 if test "$pic_object" != none; then
2246 # Prepend the subdirectory the object is found in.
2247 pic_object="$xdir$pic_object"
2249 if test "$prev" = dlfiles; then
2250 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2251 dlfiles="$dlfiles $pic_object"
2255 # If libtool objects are unsupported, then we need to preload.
2260 # CHECK ME: I think I busted this. -Ossama
2261 if test "$prev" = dlprefiles; then
2262 # Preload the old-style object.
2263 dlprefiles="$dlprefiles $pic_object"
2268 libobjs="$libobjs $pic_object"
2273 if test "$non_pic_object" != none; then
2274 # Prepend the subdirectory the object is found in.
2275 non_pic_object="$xdir$non_pic_object"
2277 # A standard non-PIC object
2278 non_pic_objects="$non_pic_objects $non_pic_object"
2279 if test -z "$pic_object" || test "$pic_object" = none ; then
2280 arg="$non_pic_object"
2283 # If the PIC object exists, use it instead.
2284 # $xdir was prepended to $pic_object above.
2285 non_pic_object="$pic_object"
2286 non_pic_objects="$non_pic_objects $non_pic_object"
2289 # Only an error if not doing a dry-run.
2290 if test -z "$run"; then
2291 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2296 # Extract subdirectory from the argument.
2297 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2298 if test "X$xdir" = "X$arg"; then
2304 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2305 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2306 libobjs="$libobjs $pic_object"
2307 non_pic_objects="$non_pic_objects $non_pic_object"
2314 deplibs="$deplibs $arg"
2315 old_deplibs="$old_deplibs $arg"
2320 # A libtool-controlled library.
2322 if test "$prev" = dlfiles; then
2323 # This library was specified with -dlopen.
2324 dlfiles="$dlfiles $arg"
2326 elif test "$prev" = dlprefiles; then
2327 # The library was specified with -dlpreopen.
2328 dlprefiles="$dlprefiles $arg"
2331 deplibs="$deplibs $arg"
2336 # Some other compiler argument.
2338 # Unknown arguments in both finalize_command and compile_command need
2339 # to be aesthetically quoted because they are evaled later.
2340 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2342 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2349 # Now actually substitute the argument into the commands.
2350 if test -n "$arg"; then
2351 compile_command="$compile_command $arg"
2352 finalize_command="$finalize_command $arg"
2354 done # argument parsing loop
2356 if test -n "$prev"; then
2357 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2362 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2363 eval arg=\"$export_dynamic_flag_spec\"
2364 compile_command="$compile_command $arg"
2365 finalize_command="$finalize_command $arg"
2369 # calculate the name of the file, without its directory
2370 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2371 libobjs_save="$libobjs"
2373 if test -n "$shlibpath_var"; then
2374 # get the directories listed in $shlibpath_var
2375 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2379 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2380 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2382 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2383 if test "X$output_objdir" = "X$output"; then
2384 output_objdir="$objdir"
2386 output_objdir="$output_objdir/$objdir"
2388 # Create the object directory.
2389 if test ! -d "$output_objdir"; then
2390 $show "$mkdir $output_objdir"
2391 $run $mkdir $output_objdir
2393 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2398 # Determine the type of output
2401 $echo "$modename: you must specify an output file" 1>&2
2405 *.$libext) linkmode=oldlib ;;
2406 *.lo | *.$objext) linkmode=obj ;;
2407 *.la) linkmode=lib ;;
2408 *) linkmode=prog ;; # Anything else should be a program.
2412 *cygwin* | *mingw* | *pw32*)
2413 # don't eliminate duplications in $postdeps and $predeps
2414 duplicate_compiler_generated_deps=yes
2417 duplicate_compiler_generated_deps=$duplicate_deps
2423 # Find all interdependent deplibs by searching for libraries
2424 # that are linked more than once (e.g. -la -lb -la)
2425 for deplib in $deplibs; do
2426 if test "X$duplicate_deps" = "Xyes" ; then
2428 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2431 libs="$libs $deplib"
2434 if test "$linkmode" = lib; then
2435 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2437 # Compute libraries that are listed more than once in $predeps
2438 # $postdeps and mark them as special (i.e., whose duplicates are
2439 # not to be eliminated).
2441 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2442 for pre_post_dep in $predeps $postdeps; do
2443 case "$pre_post_deps " in
2444 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2446 pre_post_deps="$pre_post_deps $pre_post_dep"
2455 need_relink=no # whether we're linking any uninstalled libtool libraries
2456 notinst_deplibs= # not-installed libtool libraries
2460 for file in $dlfiles $dlprefiles; do
2464 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2476 passes="conv scan dlopen dlpreopen link"
2481 for pass in $passes; do
2482 if test "$linkmode,$pass" = "lib,link" ||
2483 test "$linkmode,$pass" = "prog,scan"; then
2487 if test "$linkmode" = prog; then
2489 dlopen) libs="$dlfiles" ;;
2490 dlpreopen) libs="$dlprefiles" ;;
2491 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2494 if test "$pass" = dlopen; then
2495 # Collect dlpreopened libraries
2496 save_deplibs="$deplibs"
2499 for deplib in $libs; do
2503 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2504 if test "$linkmode,$pass" = "prog,link"; then
2505 compile_deplibs="$deplib $compile_deplibs"
2506 finalize_deplibs="$deplib $finalize_deplibs"
2508 compiler_flags="$compiler_flags $deplib"
2513 if test "$linkmode" != lib && test "$linkmode" != prog; then
2514 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2517 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2518 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2519 for search_ext in .la $std_shrext .so .a; do
2520 # Search the libtool library
2521 lib="$searchdir/lib${name}${search_ext}"
2522 if test -f "$lib"; then
2523 if test "$search_ext" = ".la"; then
2532 if test "$found" != yes; then
2533 # deplib doesn't seem to be a libtool library
2534 if test "$linkmode,$pass" = "prog,link"; then
2535 compile_deplibs="$deplib $compile_deplibs"
2536 finalize_deplibs="$deplib $finalize_deplibs"
2538 deplibs="$deplib $deplibs"
2539 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2542 else # deplib is a libtool library
2543 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2544 # We need to do some special things here, and not later.
2545 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2546 case " $predeps $postdeps " in
2548 if (${SED} -e '2q' $lib |
2549 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2553 */* | *\\*) . $lib ;;
2556 for l in $old_library $library_names; do
2559 if test "X$ll" = "X$old_library" ; then # only static version available
2561 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2562 test "X$ladir" = "X$lib" && ladir="."
2563 lib=$ladir/$old_library
2564 if test "$linkmode,$pass" = "prog,link"; then
2565 compile_deplibs="$deplib $compile_deplibs"
2566 finalize_deplibs="$deplib $finalize_deplibs"
2568 deplibs="$deplib $deplibs"
2569 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2583 deplibs="$deplib $deplibs"
2584 test "$pass" = conv && continue
2585 newdependency_libs="$deplib $newdependency_libs"
2586 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2589 if test "$pass" = conv; then
2590 deplibs="$deplib $deplibs"
2593 if test "$pass" = scan; then
2594 deplibs="$deplib $deplibs"
2596 compile_deplibs="$deplib $compile_deplibs"
2597 finalize_deplibs="$deplib $finalize_deplibs"
2599 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2602 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2608 if test "$pass" = link; then
2609 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2610 # Make sure the xrpath contains only unique directories.
2613 *) xrpath="$xrpath $dir" ;;
2616 deplibs="$deplib $deplibs"
2619 *.la) lib="$deplib" ;;
2621 if test "$pass" = conv; then
2622 deplibs="$deplib $deplibs"
2628 case $deplibs_check_method in
2630 set dummy $deplibs_check_method
2631 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2632 if eval $echo \"$deplib\" 2>/dev/null \
2634 | $EGREP "$match_pattern_regex" > /dev/null; then
2642 if test "$valid_a_lib" != yes; then
2644 $echo "*** Warning: Trying to link with static lib archive $deplib."
2645 $echo "*** I have the capability to make that library automatically link in when"
2646 $echo "*** you link to this library. But I can only do this if you have a"
2647 $echo "*** shared version of the library, which you do not appear to have"
2648 $echo "*** because the file extensions .$libext of this argument makes me believe"
2649 $echo "*** that it is just a static archive that I should not used here."
2652 $echo "*** Warning: Linking the shared library $output against the"
2653 $echo "*** static library $deplib is not portable!"
2654 deplibs="$deplib $deplibs"
2659 if test "$pass" != link; then
2660 deplibs="$deplib $deplibs"
2662 compile_deplibs="$deplib $compile_deplibs"
2663 finalize_deplibs="$deplib $finalize_deplibs"
2670 if test "$pass" = conv; then
2671 deplibs="$deplib $deplibs"
2672 elif test "$linkmode" = prog; then
2673 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2674 # If there is no dlopen support or we're linking statically,
2675 # we need to preload.
2676 newdlprefiles="$newdlprefiles $deplib"
2677 compile_deplibs="$deplib $compile_deplibs"
2678 finalize_deplibs="$deplib $finalize_deplibs"
2680 newdlfiles="$newdlfiles $deplib"
2690 if test "$found" = yes || test -f "$lib"; then :
2692 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2696 # Check to see that this really is a libtool archive.
2697 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2699 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2703 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2704 test "X$ladir" = "X$lib" && ladir="."
2712 # If the library was installed with an old release of libtool,
2713 # it will not redefine variables installed, or shouldnotlink
2721 */* | *\\*) . $lib ;;
2725 if test "$linkmode,$pass" = "lib,link" ||
2726 test "$linkmode,$pass" = "prog,scan" ||
2727 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2728 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2729 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2732 if test "$pass" = conv; then
2733 # Only check for convenience libraries
2734 deplibs="$lib $deplibs"
2735 if test -z "$libdir"; then
2736 if test -z "$old_library"; then
2737 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2740 # It is a libtool convenience library, so add in its objects.
2741 convenience="$convenience $ladir/$objdir/$old_library"
2742 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2744 for deplib in $dependency_libs; do
2745 deplibs="$deplib $deplibs"
2746 if test "X$duplicate_deps" = "Xyes" ; then
2747 case "$tmp_libs " in
2748 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2751 tmp_libs="$tmp_libs $deplib"
2753 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2754 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2761 # Get the name of the library we link against.
2763 for l in $old_library $library_names; do
2766 if test -z "$linklib"; then
2767 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2771 # This library was specified with -dlopen.
2772 if test "$pass" = dlopen; then
2773 if test -z "$libdir"; then
2774 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2777 if test -z "$dlname" ||
2778 test "$dlopen_support" != yes ||
2779 test "$build_libtool_libs" = no; then
2780 # If there is no dlname, no dlopen support or we're linking
2781 # statically, we need to preload. We also need to preload any
2782 # dependent libraries so libltdl's deplib preloader doesn't
2783 # bomb out in the load deplibs phase.
2784 dlprefiles="$dlprefiles $lib $dependency_libs"
2786 newdlfiles="$newdlfiles $lib"
2791 # We need an absolute path.
2793 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2795 abs_ladir=`cd "$ladir" && pwd`
2796 if test -z "$abs_ladir"; then
2797 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2798 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2803 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2805 # Find the relevant object directory and library name.
2806 if test "X$installed" = Xyes; then
2807 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2808 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2816 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2818 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2821 # Remove this search path later
2822 notinst_path="$notinst_path $abs_ladir"
2824 dir="$ladir/$objdir"
2825 absdir="$abs_ladir/$objdir"
2826 # Remove this search path later
2827 notinst_path="$notinst_path $abs_ladir"
2829 fi # $installed = yes
2830 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2832 # This library was specified with -dlpreopen.
2833 if test "$pass" = dlpreopen; then
2834 if test -z "$libdir"; then
2835 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2838 # Prefer using a static library (so that no silly _DYNAMIC symbols
2839 # are required to link).
2840 if test -n "$old_library"; then
2841 newdlprefiles="$newdlprefiles $dir/$old_library"
2842 # Otherwise, use the dlname, so that lt_dlopen finds it.
2843 elif test -n "$dlname"; then
2844 newdlprefiles="$newdlprefiles $dir/$dlname"
2846 newdlprefiles="$newdlprefiles $dir/$linklib"
2848 fi # $pass = dlpreopen
2850 if test -z "$libdir"; then
2851 # Link the convenience library
2852 if test "$linkmode" = lib; then
2853 deplibs="$dir/$old_library $deplibs"
2854 elif test "$linkmode,$pass" = "prog,link"; then
2855 compile_deplibs="$dir/$old_library $compile_deplibs"
2856 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2858 deplibs="$lib $deplibs" # used for prog,scan pass
2864 if test "$linkmode" = prog && test "$pass" != link; then
2865 newlib_search_path="$newlib_search_path $ladir"
2866 deplibs="$lib $deplibs"
2869 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2870 test "$build_libtool_libs" = no; then
2875 for deplib in $dependency_libs; do
2877 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2879 # Need to link against all dependency_libs?
2880 if test "$linkalldeplibs" = yes; then
2881 deplibs="$deplib $deplibs"
2883 # Need to hardcode shared library paths
2884 # or/and link against static libraries
2885 newdependency_libs="$deplib $newdependency_libs"
2887 if test "X$duplicate_deps" = "Xyes" ; then
2888 case "$tmp_libs " in
2889 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2892 tmp_libs="$tmp_libs $deplib"
2895 fi # $linkmode = prog...
2897 if test "$linkmode,$pass" = "prog,link"; then
2898 if test -n "$library_names" &&
2899 { { test "$prefer_static_libs" = no ||
2900 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2901 test -z "$old_library"; }; then
2902 # We need to hardcode the library path
2903 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2904 # Make sure the rpath contains only unique directories.
2905 case "$temp_rpath " in
2908 *) temp_rpath="$temp_rpath $absdir" ;;
2912 # Hardcode the library path.
2913 # Skip directories that are in the system default run-time
2915 case " $sys_lib_dlsearch_path " in
2918 case "$compile_rpath " in
2920 *) compile_rpath="$compile_rpath $absdir"
2924 case " $sys_lib_dlsearch_path " in
2927 case "$finalize_rpath " in
2929 *) finalize_rpath="$finalize_rpath $libdir"
2933 fi # $linkmode,$pass = prog,link...
2935 if test "$alldeplibs" = yes &&
2936 { test "$deplibs_check_method" = pass_all ||
2937 { test "$build_libtool_libs" = yes &&
2938 test -n "$library_names"; }; }; then
2939 # We only need to search for static libraries
2944 link_static=no # Whether the deplib will be linked statically
2945 use_static_libs=$prefer_static_libs
2946 if test "$use_static_libs" = built && test "$installed" = yes ; then
2949 if test -n "$library_names" &&
2950 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2951 if test "$installed" = no; then
2952 notinst_deplibs="$notinst_deplibs $lib"
2955 # This is a shared library
2957 # Warn about portability, can't link against -module's on
2958 # some systems (darwin)
2959 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2961 if test "$linkmode" = prog; then
2962 $echo "*** Warning: Linking the executable $output against the loadable module"
2964 $echo "*** Warning: Linking the shared library $output against the loadable module"
2966 $echo "*** $linklib is not portable!"
2968 if test "$linkmode" = lib &&
2969 test "$hardcode_into_libs" = yes; then
2970 # Hardcode the library path.
2971 # Skip directories that are in the system default run-time
2973 case " $sys_lib_dlsearch_path " in
2976 case "$compile_rpath " in
2978 *) compile_rpath="$compile_rpath $absdir"
2982 case " $sys_lib_dlsearch_path " in
2985 case "$finalize_rpath " in
2987 *) finalize_rpath="$finalize_rpath $libdir"
2993 if test -n "$old_archive_from_expsyms_cmds"; then
2994 # figure out the soname
2995 set dummy $library_names
2998 libname=`eval \\$echo \"$libname_spec\"`
2999 # use dlname if we got it. it's perfectly good, no?
3000 if test -n "$dlname"; then
3002 elif test -n "$soname_spec"; then
3006 major=`expr $current - $age`
3010 eval soname=\"$soname_spec\"
3015 # Make a new name for the extract_expsyms_cmds to use
3017 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3018 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3020 # If the library has no export list, then create one now
3021 if test -f "$output_objdir/$soname-def"; then :
3023 $show "extracting exported symbol list from \`$soname'"
3024 save_ifs="$IFS"; IFS='~'
3025 cmds=$extract_expsyms_cmds
3026 for cmd in $cmds; do
3030 $run eval "$cmd" || exit $?
3036 if test -f "$output_objdir/$newlib"; then :; else
3037 $show "generating import library for \`$soname'"
3038 save_ifs="$IFS"; IFS='~'
3039 cmds=$old_archive_from_expsyms_cmds
3040 for cmd in $cmds; do
3044 $run eval "$cmd" || exit $?
3048 # make sure the library variables are pointing to the new library
3051 fi # test -n "$old_archive_from_expsyms_cmds"
3053 if test "$linkmode" = prog || test "$mode" != relink; then
3058 case $hardcode_action in
3059 immediate | unsupported)
3060 if test "$hardcode_direct" = no; then
3063 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3064 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3065 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3066 *-*-unixware7*) add_dir="-L$dir" ;;
3068 # if the lib is a module then we can not link against
3069 # it, someone is ignoring the new warnings I added
3070 if /usr/bin/file -L $add 2> /dev/null |
3071 $EGREP ": [^:]* bundle" >/dev/null ; then
3072 $echo "** Warning, lib $linklib is a module, not a shared library"
3073 if test -z "$old_library" ; then
3075 $echo "** And there doesn't seem to be a static archive available"
3076 $echo "** The link will probably fail, sorry"
3078 add="$dir/$old_library"
3082 elif test "$hardcode_minus_L" = no; then
3084 *-*-sunos*) add_shlibpath="$dir" ;;
3088 elif test "$hardcode_shlibpath_var" = no; then
3089 add_shlibpath="$dir"
3096 if test "$hardcode_direct" = yes; then
3098 elif test "$hardcode_minus_L" = yes; then
3100 # Try looking first in the location we're being installed to.
3101 if test -n "$inst_prefix_dir"; then
3104 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3109 elif test "$hardcode_shlibpath_var" = yes; then
3110 add_shlibpath="$dir"
3119 if test "$lib_linked" != yes; then
3120 $echo "$modename: configuration error: unsupported hardcode properties"
3124 if test -n "$add_shlibpath"; then
3125 case :$compile_shlibpath: in
3126 *":$add_shlibpath:"*) ;;
3127 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3130 if test "$linkmode" = prog; then
3131 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3132 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3134 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3135 test -n "$add" && deplibs="$add $deplibs"
3136 if test "$hardcode_direct" != yes && \
3137 test "$hardcode_minus_L" != yes && \
3138 test "$hardcode_shlibpath_var" = yes; then
3139 case :$finalize_shlibpath: in
3141 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3147 if test "$linkmode" = prog || test "$mode" = relink; then
3151 # Finalize command for both is simple: just hardcode it.
3152 if test "$hardcode_direct" = yes; then
3153 add="$libdir/$linklib"
3154 elif test "$hardcode_minus_L" = yes; then
3157 elif test "$hardcode_shlibpath_var" = yes; then
3158 case :$finalize_shlibpath: in
3160 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3163 elif test "$hardcode_automatic" = yes; then
3164 if test -n "$inst_prefix_dir" &&
3165 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3166 add="$inst_prefix_dir$libdir/$linklib"
3168 add="$libdir/$linklib"
3171 # We cannot seem to hardcode it, guess we'll fake it.
3173 # Try looking first in the location we're being installed to.
3174 if test -n "$inst_prefix_dir"; then
3177 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3184 if test "$linkmode" = prog; then
3185 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3186 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3188 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3189 test -n "$add" && deplibs="$add $deplibs"
3192 elif test "$linkmode" = prog; then
3193 # Here we assume that one of hardcode_direct or hardcode_minus_L
3194 # is not unsupported. This is valid on all known static and
3196 if test "$hardcode_direct" != unsupported; then
3197 test -n "$old_library" && linklib="$old_library"
3198 compile_deplibs="$dir/$linklib $compile_deplibs"
3199 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3201 compile_deplibs="-l$name -L$dir $compile_deplibs"
3202 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3204 elif test "$build_libtool_libs" = yes; then
3205 # Not a shared library
3206 if test "$deplibs_check_method" != pass_all; then
3207 # We're trying link a shared library against a static one
3208 # but the system doesn't support it.
3210 # Just print a warning and add the library to dependency_libs so
3211 # that the program can be linked against the static library.
3213 $echo "*** Warning: This system can not link to static lib archive $lib."
3214 $echo "*** I have the capability to make that library automatically link in when"
3215 $echo "*** you link to this library. But I can only do this if you have a"
3216 $echo "*** shared version of the library, which you do not appear to have."
3217 if test "$module" = yes; then
3218 $echo "*** But as you try to build a module library, libtool will still create "
3219 $echo "*** a static module, that should work as long as the dlopening application"
3220 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3221 if test -z "$global_symbol_pipe"; then
3223 $echo "*** However, this would only work if libtool was able to extract symbol"
3224 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3225 $echo "*** not find such a program. So, this module is probably useless."
3226 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3228 if test "$build_old_libs" = no; then
3229 build_libtool_libs=module
3232 build_libtool_libs=no
3236 deplibs="$dir/$old_library $deplibs"
3239 fi # link shared/static library?
3241 if test "$linkmode" = lib; then
3242 if test -n "$dependency_libs" &&
3243 { test "$hardcode_into_libs" != yes ||
3244 test "$build_old_libs" = yes ||
3245 test "$link_static" = yes; }; then
3246 # Extract -R from dependency_libs
3248 for libdir in $dependency_libs; do
3250 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3252 *" $temp_xrpath "*) ;;
3253 *) xrpath="$xrpath $temp_xrpath";;
3255 *) temp_deplibs="$temp_deplibs $libdir";;
3258 dependency_libs="$temp_deplibs"
3261 newlib_search_path="$newlib_search_path $absdir"
3262 # Link against this library
3263 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3264 # ... and its dependency_libs
3266 for deplib in $dependency_libs; do
3267 newdependency_libs="$deplib $newdependency_libs"
3268 if test "X$duplicate_deps" = "Xyes" ; then
3269 case "$tmp_libs " in
3270 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3273 tmp_libs="$tmp_libs $deplib"
3276 if test "$link_all_deplibs" != no; then
3277 # Add the search paths of all dependency libraries
3278 for deplib in $dependency_libs; do
3280 -L*) path="$deplib" ;;
3282 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3283 test "X$dir" = "X$deplib" && dir="."
3284 # We need an absolute path.
3286 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3288 absdir=`cd "$dir" && pwd`
3289 if test -z "$absdir"; then
3290 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3295 if grep "^installed=no" $deplib > /dev/null; then
3296 path="$absdir/$objdir"
3298 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3299 if test -z "$libdir"; then
3300 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3303 if test "$absdir" != "$libdir"; then
3304 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3311 # we do not want to link against static libs,
3312 # but need to link against shared
3313 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3314 if test -n "$deplibrary_names" ; then
3315 for tmp in $deplibrary_names ; do
3318 if test -f "$path/$depdepl" ; then
3319 depdepl="$path/$depdepl"
3321 # do not add paths which are already there
3322 case " $newlib_search_path " in
3324 *) newlib_search_path="$newlib_search_path $path";;
3337 # Again, we only want to link against shared libraries
3338 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3339 for tmp in $newlib_search_path ; do
3340 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3341 eval depdepl="$tmp/lib$tmp_libs.dylib"
3352 case " $deplibs " in
3354 *) deplibs="$path $deplibs" ;;
3356 case " $deplibs " in
3358 *) deplibs="$depdepl $deplibs" ;;
3361 fi # link_all_deplibs != no
3363 done # for deplib in $libs
3364 dependency_libs="$newdependency_libs"
3365 if test "$pass" = dlpreopen; then
3366 # Link the dlpreopened libraries before other libraries
3367 for deplib in $save_deplibs; do
3368 deplibs="$deplib $deplibs"
3371 if test "$pass" != dlopen; then
3372 if test "$pass" != conv; then
3373 # Make sure lib_search_path contains only unique directories.
3375 for dir in $newlib_search_path; do
3376 case "$lib_search_path " in
3378 *) lib_search_path="$lib_search_path $dir" ;;
3384 if test "$linkmode,$pass" != "prog,link"; then
3387 vars="compile_deplibs finalize_deplibs"
3389 for var in $vars dependency_libs; do
3390 # Add libraries to $var in reverse order
3391 eval tmp_libs=\"\$$var\"
3393 for deplib in $tmp_libs; do
3394 # FIXME: Pedantically, this is the right thing to do, so
3395 # that some nasty dependency loop isn't accidentally
3397 #new_libs="$deplib $new_libs"
3398 # Pragmatically, this seems to cause very few problems in
3401 -L*) new_libs="$deplib $new_libs" ;;
3404 # And here is the reason: when a library appears more
3405 # than once as an explicit dependence of a library, or
3406 # is implicitly linked in more than once by the
3407 # compiler, it is considered special, and multiple
3408 # occurrences thereof are not removed. Compare this
3409 # with having the same library being listed as a
3410 # dependency of multiple other libraries: in this case,
3411 # we know (pedantically, we assume) the library does not
3412 # need to be listed more than once, so we keep only the
3413 # last copy. This is not always right, but it is rare
3414 # enough that we require users that really mean to play
3415 # such unportable linking tricks to link the library
3416 # using -Wl,-lname, so that libtool does not consider it
3417 # for duplicate removal.
3418 case " $specialdeplibs " in
3419 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3421 case " $new_libs " in
3423 *) new_libs="$deplib $new_libs" ;;
3431 for deplib in $new_libs; do
3434 case " $tmp_libs " in
3436 *) tmp_libs="$tmp_libs $deplib" ;;
3439 *) tmp_libs="$tmp_libs $deplib" ;;
3442 eval $var=\"$tmp_libs\"
3445 # Last step: remove runtime libs from dependency_libs
3446 # (they stay in deplibs)
3448 for i in $dependency_libs ; do
3449 case " $predeps $postdeps $compiler_lib_search_path " in
3454 if test -n "$i" ; then
3455 tmp_libs="$tmp_libs $i"
3458 dependency_libs=$tmp_libs
3460 if test "$linkmode" = prog; then
3461 dlfiles="$newdlfiles"
3462 dlprefiles="$newdlprefiles"
3467 if test -n "$deplibs"; then
3468 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3471 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3472 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3475 if test -n "$rpath"; then
3476 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3479 if test -n "$xrpath"; then
3480 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3483 if test -n "$vinfo"; then
3484 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3487 if test -n "$release"; then
3488 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3491 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3492 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3495 # Now set the variables for building old libraries.
3496 build_libtool_libs=no
3498 objs="$objs$old_deplibs"
3502 # Make sure we only generate libraries of the form `libNAME.la'.
3505 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3506 eval shared_ext=\"$shrext_cmds\"
3507 eval libname=\"$libname_spec\"
3510 if test "$module" = no; then
3511 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3515 if test "$need_lib_prefix" != no; then
3516 # Add the "lib" prefix for modules if required
3517 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3518 eval shared_ext=\"$shrext_cmds\"
3519 eval libname=\"$libname_spec\"
3521 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3526 if test -n "$objs"; then
3527 if test "$deplibs_check_method" != pass_all; then
3528 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3532 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3533 $echo "*** objects $objs is not portable!"
3534 libobjs="$libobjs $objs"
3538 if test "$dlself" != no; then
3539 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3543 if test "$#" -gt 2; then
3544 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3549 if test -z "$rpath"; then
3550 if test "$build_libtool_libs" = yes; then
3551 # Building a libtool convenience library.
3552 # Some compilers have problems with a `.al' extension so
3553 # convenience libraries should have the same extension an
3554 # archive normally would.
3555 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3556 build_libtool_libs=convenience
3560 if test -n "$vinfo"; then
3561 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3564 if test -n "$release"; then
3565 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3569 # Parse the version information argument.
3570 save_ifs="$IFS"; IFS=':'
3571 set dummy $vinfo 0 0 0
3574 if test -n "$8"; then
3575 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3580 # convert absolute version numbers to libtool ages
3581 # this retains compatibility with .la files and attempts
3582 # to make the code below a bit more comprehensible
3584 case $vinfo_number in
3588 number_revision="$4"
3590 # There are really only two kinds -- those that
3591 # use the current revision as the major version
3592 # and those that subtract age and use age as
3593 # a minor version. But, then there is irix
3594 # which has an extra 1 added just for fun
3596 case $version_type in
3597 darwin|linux|osf|windows|none)
3598 current=`expr $number_major + $number_minor`
3600 revision="$number_revision"
3602 freebsd-aout|freebsd-elf|sunos)
3603 current="$number_major"
3604 revision="$number_minor"
3608 current=`expr $number_major + $number_minor`
3610 revision="$number_minor"
3611 lt_irix_increment=no
3622 # Check that each of the things are valid numbers.
3624 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3626 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3627 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3633 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3635 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3636 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3642 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3644 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3645 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3650 if test "$age" -gt "$current"; then
3651 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3652 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3656 # Calculate the version variables.
3660 case $version_type in
3664 # Like Linux, but with the current version available in
3665 # verstring for coding it into the library header
3666 major=.`expr $current - $age`
3667 versuffix="$major.$age.$revision"
3668 # Darwin ld doesn't like 0 for these options...
3669 minor_current=`expr $current + 1`
3670 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3671 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3676 versuffix=".$current.$revision";
3681 versuffix=".$current";
3685 if test "X$lt_irix_increment" = "Xno"; then
3686 major=`expr $current - $age`
3688 major=`expr $current - $age + 1`
3690 case $version_type in
3691 nonstopux) verstring_prefix=nonstopux ;;
3692 *) verstring_prefix=sgi ;;
3694 verstring="$verstring_prefix$major.$revision"
3696 # Add in all the interfaces that we are compatible with.
3698 while test "$loop" -ne 0; do
3699 iface=`expr $revision - $loop`
3700 loop=`expr $loop - 1`
3701 verstring="$verstring_prefix$major.$iface:$verstring"
3704 # Before this point, $major must not contain `.'.
3706 versuffix="$major.$revision"
3710 major=.`expr $current - $age`
3711 versuffix="$major.$age.$revision"
3715 major=.`expr $current - $age`
3716 versuffix=".$current.$age.$revision"
3717 verstring="$current.$age.$revision"
3719 # Add in all the interfaces that we are compatible with.
3721 while test "$loop" -ne 0; do
3722 iface=`expr $current - $loop`
3723 loop=`expr $loop - 1`
3724 verstring="$verstring:${iface}.0"
3727 # Make executables depend on our current version.
3728 verstring="$verstring:${current}.0"
3733 versuffix=".$current.$revision"
3737 # Use '-' rather than '.', since we only want one
3738 # extension on DOS 8.3 filesystems.
3739 major=`expr $current - $age`
3744 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3745 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3750 # Clear the version info if we defaulted, and they specified a release.
3751 if test -z "$vinfo" && test -n "$release"; then
3753 case $version_type in
3755 # we can't check for "0.0" in archive_cmds due to quoting
3756 # problems, so we reset it completely
3763 if test "$need_version" = no; then
3770 # Remove version info from name if versioning should be avoided
3771 if test "$avoid_version" = yes && test "$need_version" = no; then
3777 # Check to see if the archive will have undefined symbols.
3778 if test "$allow_undefined" = yes; then
3779 if test "$allow_undefined_flag" = unsupported; then
3780 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3781 build_libtool_libs=no
3785 # Don't allow undefined symbols.
3786 allow_undefined_flag="$no_undefined_flag"
3790 if test "$mode" != relink; then
3791 # Remove our outputs, but don't remove object files since they
3792 # may have been created when compiling PIC objects.
3794 tempremovelist=`$echo "$output_objdir/*"`
3795 for p in $tempremovelist; do
3799 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3800 if test "X$precious_files_regex" != "X"; then
3801 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3806 removelist="$removelist $p"
3811 if test -n "$removelist"; then
3812 $show "${rm}r $removelist"
3813 $run ${rm}r $removelist
3817 # Now set the variables for building old libraries.
3818 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3819 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3821 # Transform .lo files to .o files.
3822 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3825 # Eliminate all temporary directories.
3826 #for path in $notinst_path; do
3827 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3828 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3829 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3832 if test -n "$xrpath"; then
3833 # If the user specified any rpath flags, then add them.
3835 for libdir in $xrpath; do
3836 temp_xrpath="$temp_xrpath -R$libdir"
3837 case "$finalize_rpath " in
3839 *) finalize_rpath="$finalize_rpath $libdir" ;;
3842 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3843 dependency_libs="$temp_xrpath $dependency_libs"
3847 # Make sure dlfiles contains only unique files that won't be dlpreopened
3848 old_dlfiles="$dlfiles"
3850 for lib in $old_dlfiles; do
3851 case " $dlprefiles $dlfiles " in
3853 *) dlfiles="$dlfiles $lib" ;;
3857 # Make sure dlprefiles contains only unique files
3858 old_dlprefiles="$dlprefiles"
3860 for lib in $old_dlprefiles; do
3861 case "$dlprefiles " in
3863 *) dlprefiles="$dlprefiles $lib" ;;
3867 if test "$build_libtool_libs" = yes; then
3868 if test -n "$rpath"; then
3870 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3871 # these systems don't actually have a c library (as such)!
3873 *-*-rhapsody* | *-*-darwin1.[012])
3874 # Rhapsody C library is in the System framework
3875 deplibs="$deplibs -framework System"
3878 # Don't link with libc until the a.out ld.so is fixed.
3880 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3881 # Do not include libc due to us having libc/libc_r.
3883 *-*-sco3.2v5* | *-*-sco5v6*)
3884 # Causes problems with __ctype
3886 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3887 # Compiler inserts libc in the correct place for threads to work
3890 # Add libc to deplibs on all other systems if necessary.
3891 if test "$build_libtool_need_lc" = "yes"; then
3892 deplibs="$deplibs -lc"
3898 # Transform deplibs into only deplibs that can be linked in shared.
3900 libname_save=$libname
3901 release_save=$release
3902 versuffix_save=$versuffix
3904 # I'm not sure if I'm treating the release correctly. I think
3905 # release should show up in the -l (ie -lgmp5) so we don't want to
3906 # add it in twice. Is that correct?
3912 case $deplibs_check_method in
3914 # Don't check for shared/static. Everything works.
3915 # This might be a little naive. We might want to check
3916 # whether the library exists or not. But this is on
3917 # osf3 & osf4 and I'm not really sure... Just
3918 # implementing what was already the behavior.
3922 # This code stresses the "libraries are programs" paradigm to its
3923 # limits. Maybe even breaks it. We compile a program, linking it
3924 # against the deplibs as a proxy for the library. Then we can check
3925 # whether they linked in statically or dynamically with ldd.
3927 cat > conftest.c <<EOF
3928 int main() { return 0; }
3931 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3932 ldd_output=`ldd conftest`
3933 for i in $deplibs; do
3934 name=`expr $i : '-l\(.*\)'`
3935 # If $name is empty we are operating on a -L argument.
3936 if test "$name" != "" && test "$name" != "0"; then
3937 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3938 case " $predeps $postdeps " in
3940 newdeplibs="$newdeplibs $i"
3945 if test -n "$i" ; then
3946 libname=`eval \\$echo \"$libname_spec\"`
3947 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3948 set dummy $deplib_matches
3950 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3951 newdeplibs="$newdeplibs $i"
3955 $echo "*** Warning: dynamic linker does not accept needed library $i."
3956 $echo "*** I have the capability to make that library automatically link in when"
3957 $echo "*** you link to this library. But I can only do this if you have a"
3958 $echo "*** shared version of the library, which I believe you do not have"
3959 $echo "*** because a test_compile did reveal that the linker did not use it for"
3960 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3964 newdeplibs="$newdeplibs $i"
3968 # Error occurred in the first compile. Let's try to salvage
3969 # the situation: Compile a separate program for each library.
3970 for i in $deplibs; do
3971 name=`expr $i : '-l\(.*\)'`
3972 # If $name is empty we are operating on a -L argument.
3973 if test "$name" != "" && test "$name" != "0"; then
3975 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3976 ldd_output=`ldd conftest`
3977 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3978 case " $predeps $postdeps " in
3980 newdeplibs="$newdeplibs $i"
3985 if test -n "$i" ; then
3986 libname=`eval \\$echo \"$libname_spec\"`
3987 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3988 set dummy $deplib_matches
3990 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3991 newdeplibs="$newdeplibs $i"
3995 $echo "*** Warning: dynamic linker does not accept needed library $i."
3996 $echo "*** I have the capability to make that library automatically link in when"
3997 $echo "*** you link to this library. But I can only do this if you have a"
3998 $echo "*** shared version of the library, which you do not appear to have"
3999 $echo "*** because a test_compile did reveal that the linker did not use this one"
4000 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
4006 $echo "*** Warning! Library $i is needed by this library but I was not able to"
4007 $echo "*** make it link in! You will probably need to install it or some"
4008 $echo "*** library that it depends on before this library will be fully"
4009 $echo "*** functional. Installing it before continuing would be even better."
4012 newdeplibs="$newdeplibs $i"
4018 set dummy $deplibs_check_method
4019 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4020 for a_deplib in $deplibs; do
4021 name=`expr $a_deplib : '-l\(.*\)'`
4022 # If $name is empty we are operating on a -L argument.
4023 if test "$name" != "" && test "$name" != "0"; then
4024 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4025 case " $predeps $postdeps " in
4027 newdeplibs="$newdeplibs $a_deplib"
4032 if test -n "$a_deplib" ; then
4033 libname=`eval \\$echo \"$libname_spec\"`
4034 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4035 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4036 for potent_lib in $potential_libs; do
4037 # Follow soft links.
4038 if ls -lLd "$potent_lib" 2>/dev/null \
4039 | grep " -> " >/dev/null; then
4042 # The statement above tries to avoid entering an
4043 # endless loop below, in case of cyclic links.
4044 # We might still enter an endless loop, since a link
4045 # loop can be closed while we follow links,
4047 potlib="$potent_lib"
4048 while test -h "$potlib" 2>/dev/null; do
4049 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4051 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4052 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4055 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4057 | $EGREP "$file_magic_regex" > /dev/null; then
4058 newdeplibs="$newdeplibs $a_deplib"
4065 if test -n "$a_deplib" ; then
4068 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4069 $echo "*** I have the capability to make that library automatically link in when"
4070 $echo "*** you link to this library. But I can only do this if you have a"
4071 $echo "*** shared version of the library, which you do not appear to have"
4072 $echo "*** because I did check the linker path looking for a file starting"
4073 if test -z "$potlib" ; then
4074 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4076 $echo "*** with $libname and none of the candidates passed a file format test"
4077 $echo "*** using a file magic. Last file checked: $potlib"
4081 # Add a -L argument.
4082 newdeplibs="$newdeplibs $a_deplib"
4084 done # Gone through all deplibs.
4087 set dummy $deplibs_check_method
4088 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4089 for a_deplib in $deplibs; do
4090 name=`expr $a_deplib : '-l\(.*\)'`
4091 # If $name is empty we are operating on a -L argument.
4092 if test -n "$name" && test "$name" != "0"; then
4093 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4094 case " $predeps $postdeps " in
4096 newdeplibs="$newdeplibs $a_deplib"
4101 if test -n "$a_deplib" ; then
4102 libname=`eval \\$echo \"$libname_spec\"`
4103 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4104 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4105 for potent_lib in $potential_libs; do
4106 potlib="$potent_lib" # see symlink-check above in file_magic test
4107 if eval $echo \"$potent_lib\" 2>/dev/null \
4109 | $EGREP "$match_pattern_regex" > /dev/null; then
4110 newdeplibs="$newdeplibs $a_deplib"
4117 if test -n "$a_deplib" ; then
4120 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4121 $echo "*** I have the capability to make that library automatically link in when"
4122 $echo "*** you link to this library. But I can only do this if you have a"
4123 $echo "*** shared version of the library, which you do not appear to have"
4124 $echo "*** because I did check the linker path looking for a file starting"
4125 if test -z "$potlib" ; then
4126 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4128 $echo "*** with $libname and none of the candidates passed a file format test"
4129 $echo "*** using a regex pattern. Last file checked: $potlib"
4133 # Add a -L argument.
4134 newdeplibs="$newdeplibs $a_deplib"
4136 done # Gone through all deplibs.
4140 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4141 -e 's/ -[LR][^ ]*//g'`
4142 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4143 for i in $predeps $postdeps ; do
4144 # can't use Xsed below, because $i might contain '/'
4145 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4148 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4149 | grep . >/dev/null; then
4151 if test "X$deplibs_check_method" = "Xnone"; then
4152 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4154 $echo "*** Warning: inter-library dependencies are not known to be supported."
4156 $echo "*** All declared inter-library dependencies are being dropped."
4161 versuffix=$versuffix_save
4163 release=$release_save
4164 libname=$libname_save
4168 *-*-rhapsody* | *-*-darwin1.[012])
4169 # On Rhapsody replace the C library is the System framework
4170 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4174 if test "$droppeddeps" = yes; then
4175 if test "$module" = yes; then
4177 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4178 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4179 $echo "*** a static module, that should work as long as the dlopening"
4180 $echo "*** application is linked with the -dlopen flag."
4181 if test -z "$global_symbol_pipe"; then
4183 $echo "*** However, this would only work if libtool was able to extract symbol"
4184 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4185 $echo "*** not find such a program. So, this module is probably useless."
4186 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4188 if test "$build_old_libs" = no; then
4189 oldlibs="$output_objdir/$libname.$libext"
4190 build_libtool_libs=module
4193 build_libtool_libs=no
4196 $echo "*** The inter-library dependencies that have been dropped here will be"
4197 $echo "*** automatically added whenever a program is linked with this library"
4198 $echo "*** or is declared to -dlopen it."
4200 if test "$allow_undefined" = no; then
4202 $echo "*** Since this library must not contain undefined symbols,"
4203 $echo "*** because either the platform does not support them or"
4204 $echo "*** it was explicitly requested with -no-undefined,"
4205 $echo "*** libtool will only create a static version of it."
4206 if test "$build_old_libs" = no; then
4207 oldlibs="$output_objdir/$libname.$libext"
4208 build_libtool_libs=module
4211 build_libtool_libs=no
4216 # Done checking deplibs!
4221 # move library search paths that coincide with paths to not yet
4222 # installed libraries to the beginning of the library search list
4224 for path in $notinst_path; do
4225 case " $new_libs " in
4226 *" -L$path/$objdir "*) ;;
4228 case " $deplibs " in
4229 *" -L$path/$objdir "*)
4230 new_libs="$new_libs -L$path/$objdir" ;;
4235 for deplib in $deplibs; do
4238 case " $new_libs " in
4240 *) new_libs="$new_libs $deplib" ;;
4243 *) new_libs="$new_libs $deplib" ;;
4249 # All the library-specific variables (install_libdir is set above).
4254 # Test again, we may have decided not to build it any more
4255 if test "$build_libtool_libs" = yes; then
4256 if test "$hardcode_into_libs" = yes; then
4257 # Hardcode the library paths
4260 rpath="$finalize_rpath"
4261 test "$mode" != relink && rpath="$compile_rpath$rpath"
4262 for libdir in $rpath; do