3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU ccunit 1.1)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
32 # A sed program that does not truncate output.
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/usr/bin/sed -e s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
40 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
42 # The names of the tagged configurations supported by this script.
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host susan.mitocities.ne.jp:
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=powerpc-apple-darwin7.0.0
71 # An echo program that does not interpret backslashes.
81 # A language-specific compiler.
84 # Is the compiler the GNU C compiler?
90 # The linker used to build libraries.
93 # Whether we need hard or soft links.
96 # A BSD-compatible nm program.
99 # A symbol stripping program
102 # Used to examine libraries when file_magic_cmd begins "file"
105 # Used on cygwin: DLL creation program.
108 # Used on cygwin: object dumper.
111 # Used on cygwin: assembler.
114 # The name of the directory that contains temporary libtool files.
117 # How to create reloadable object files.
119 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
121 # How to pass a linker flag through the compiler.
124 # Object file suffix (normally "o").
127 # Old archive suffix (normally "a").
130 # Shared library suffix (normally ".so").
131 shrext='$(test .$module = .yes && echo .so || echo .dylib)'
133 # Executable file suffix (normally "").
136 # Additional compiler flags for building library objects.
137 pic_flag=" -fno-common -DPIC"
140 # What is the maximum length of a command?
143 # Does compiler simultaneously support -c and -o options?
146 # Must we lock files when doing compilation ?
149 # Do we need the lib prefix for modules?
152 # Do we need a version for libraries?
155 # Whether dlopen is supported.
158 # Whether dlopen of programs is supported.
161 # Whether dlopen of statically linked programs is supported.
162 dlopen_self_static=yes
164 # Compiler flag to prevent dynamic linking.
165 link_static_flag="-static"
167 # Compiler flag to turn off builtin functions.
168 no_builtin_flag=" -fno-builtin"
170 # Compiler flag to allow reflexive dlopens.
171 export_dynamic_flag_spec=""
173 # Compiler flag to generate shared objects directly from archives.
174 whole_archive_flag_spec="-all_load \$convenience"
176 # Compiler flag to generate thread-safe objects.
177 thread_safe_flag_spec=""
179 # Library versioning type.
182 # Format of library name prefix.
183 libname_spec="lib\$name"
185 # List of archive names. First name is the real one, the rest are links.
186 # The last name is the one that the linker finds with -lNAME.
187 library_names_spec="\${libname}\${release}\${versuffix}\$shared_ext \${libname}\${release}\${major}\$shared_ext \${libname}\$shared_ext"
189 # The coded name of the library, if different from the real name.
190 soname_spec="\${libname}\${release}\${major}\$shared_ext"
192 # Commands used to build and install an old-style archive.
194 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
195 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
196 old_postuninstall_cmds=""
198 # Create an old-style archive from a shared archive.
199 old_archive_from_new_cmds=""
201 # Create a temporary old-style archive to link instead of a shared archive.
202 old_archive_from_expsyms_cmds=""
204 # Commands used to build and install a shared archive.
205 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs\$compiler_flags -install_name \$rpath/\$soname \$verstring"
206 archive_expsym_cmds="sed -e \\\"s,#.*,,\\\" -e \\\"s,^[ ]*,,\\\" -e \\\"s,^\\\\(..*\\\\),_&,\\\" < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs\$compiler_flags -install_name \$rpath/\$soname \$verstring~nmedit -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
208 postuninstall_cmds=""
210 # Commands used to build a loadable module (assumed same as above if empty)
211 module_cmds="\$CC -bundle \$allow_undefined_flag -o \$lib \$libobjs \$deplibs\$compiler_flags"
212 module_expsym_cmds="sed -e \\\"s,#.*,,\\\" -e \\\"s,^[ ]*,,\\\" -e \\\"s,^\\\\(..*\\\\),_&,\\\" < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -bundle \$allow_undefined_flag -o \$lib \$libobjs \$deplibs\$compiler_flags~nmedit -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
214 # Commands to strip libraries.
218 # Dependencies to place before the objects being linked to create a
222 # Dependencies to place after the objects being linked to create a
226 # Dependencies to place before the objects being linked to create a
230 # Dependencies to place after the objects being linked to create a
234 # The library search path used internally by the compiler when linking
236 compiler_lib_search_path=""
238 # Method to check whether dependent libraries are shared objects.
239 deplibs_check_method="pass_all"
241 # Command to use when deplibs_check_method == file_magic.
242 file_magic_cmd="/usr/bin/file -L"
244 # Flag that allows shared libraries with undefined symbols to be built.
245 allow_undefined_flag="-flat_namespace -undefined suppress"
247 # Flag that forces no undefined symbols.
250 # Commands used to finish a libtool library installation in a directory.
253 # Same as above, but a single script fragment to be evaled but not shown.
256 # Take the output of nm and produce a listing of raw symbols and C names.
257 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([BCDEGRST][BCDEGRST]*\\)[ ][ ]*\\(_\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
259 # Transform the output of nm in a proper C declaration
260 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
262 # Transform the output of nm in a C name address pair
263 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
265 # This is the shared library runtime path variable.
268 # This is the shared library path variable.
269 shlibpath_var=DYLD_LIBRARY_PATH
271 # Is shlibpath searched before the hard-coded library search path?
272 shlibpath_overrides_runpath=yes
274 # How to hardcode a shared library path into an executable.
275 hardcode_action=immediate
277 # Whether we should hardcode library paths into libraries.
278 hardcode_into_libs=no
280 # Flag to hardcode $libdir into a binary during linking.
281 # This must work even if $libdir does not exist.
282 hardcode_libdir_flag_spec=""
284 # If ld is used when linking, flag to hardcode $libdir into
285 # a binary during linking. This must work even if $libdir does
287 hardcode_libdir_flag_spec_ld=""
289 # Whether we need a single -rpath flag with a separated argument.
290 hardcode_libdir_separator=""
292 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
296 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
300 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
301 # the resulting binary.
302 hardcode_shlibpath_var=unsupported
304 # Set to yes if building a shared library automatically hardcodes DIR into the library
305 # and all subsequent libraries and executables linked against it.
306 hardcode_automatic=yes
308 # Variables whose values should be saved in libtool wrapper scripts and
309 # restored at relink time.
310 variables_saved_for_relink="PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
312 # Whether libtool must link a program against all its dependency libraries.
315 # Compile-time system search path for libraries
316 sys_lib_search_path_spec=" /usr/libexec/gcc/darwin/ppc/3.3/ /usr/local/libexec/gcc/darwin/ppc/3.3/ /usr/libexec/gcc/darwin/../../ppc-darwin/lib/ppc/3.3/ /usr/libexec/gcc/darwin/../../ppc-darwin/lib/ /usr/lib/gcc/darwin/ppc/3.3/ /usr/lib/gcc/darwin/ /usr/libexec/gcc/darwin/ppc/3.3/../../../ppc/3.3/ /usr/libexec/gcc/darwin/ppc/3.3/../../../ /lib/ppc/3.3/ /lib/ /usr/lib/ppc/3.3/ /usr/lib/ /lib /usr/lib /usr/local/lib"
318 # Run-time system search path for libraries
319 sys_lib_dlsearch_path_spec="/usr/local/lib /lib /usr/lib"
321 # Fix the shell variable $srcfile for the compiler.
324 # Set to yes if exported symbols are required.
325 always_export_symbols=no
327 # The commands to list exported symbols.
328 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
330 # The commands to extract the exported symbol list from a shared archive.
331 extract_expsyms_cmds=""
333 # Symbols that should not be listed in the preloaded symbols.
334 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
336 # Symbols that must always be exported.
339 # ### END LIBTOOL CONFIG
341 # ltmain.sh - Provide generalized library-building support services.
342 # NOTE: Changing this file will not affect anything until you rerun configure.
344 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
345 # Free Software Foundation, Inc.
346 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
348 # This program is free software; you can redistribute it and/or modify
349 # it under the terms of the GNU General Public License as published by
350 # the Free Software Foundation; either version 2 of the License, or
351 # (at your option) any later version.
353 # This program is distributed in the hope that it will be useful, but
354 # WITHOUT ANY WARRANTY; without even the implied warranty of
355 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
356 # General Public License for more details.
358 # You should have received a copy of the GNU General Public License
359 # along with this program; if not, write to the Free Software
360 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
362 # As a special exception to the GNU General Public License, if you
363 # distribute this file as part of a program that contains a
364 # configuration script generated by Autoconf, you may include it under
365 # the same distribution terms that you use for the rest of that program.
367 # Check that we have a working $echo.
368 if test "X$1" = X--no-reexec; then
369 # Discard the --no-reexec flag, and continue.
371 elif test "X$1" = X--fallback-echo; then
372 # Avoid inline document here, it may be left over
374 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
375 # Yippee, $echo works!
378 # Restart under the correct shell, and then maybe $echo will work.
379 exec $SHELL "$0" --no-reexec ${1+"$@"}
382 if test "X$1" = X--fallback-echo; then
383 # used as fallback echo
391 # The name of this program.
392 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
399 TIMESTAMP=" (1.1220 2003/04/05 19:32:58)"
402 help="Try \`$progname --help' for more information."
403 magic="%%%MAGIC variable%%%"
408 # Sed substitution that helps us do robust quoting. It backslashifies
409 # metacharacters that are still active within double-quoted strings.
410 Xsed="${SED}"' -e 1s/^X//'
411 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
412 # test EBCDIC or ASCII
413 case `echo A|od -x` in
414 *[Cc]1*) # EBCDIC based system
415 SP2NL="tr '\100' '\n'"
416 NL2SP="tr '\r\n' '\100\100'"
418 *) # Assume ASCII based system
419 SP2NL="tr '\040' '\012'"
420 NL2SP="tr '\015\012' '\040\040'"
425 # Only set LANG and LC_ALL to C if already set.
426 # These must not be set unconditionally because not all systems understand
427 # e.g. LANG=C (notably SCO).
428 # We save the old values to restore during execute mode.
429 if test "${LC_ALL+set}" = set; then
430 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
432 if test "${LANG+set}" = set; then
433 save_LANG="$LANG"; LANG=C; export LANG
436 # Make sure IFS has a sensible default
439 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
440 $echo "$modename: not configured to build any kind of library" 1>&2
441 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
454 lo2o="s/\\.lo\$/.${objext}/"
455 o2lo="s/\\.${objext}\$/.lo/"
457 #####################################
458 # Shell function definitions:
459 # This seems to be the best place for them
461 # Need a lot of goo to handle *both* DLLs and import libs
462 # Has to be a shell function in order to 'eat' the argument
463 # that is supplied when $file_magic_command is called.
465 win32_libid_type="unknown"
466 win32_fileres=`file -L $1 2>/dev/null`
467 case $win32_fileres in
468 *ar\ archive\ import\ library*) # definitely import
469 win32_libid_type="x86 archive import"
471 *ar\ archive*) # could be an import, or static
472 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
473 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
474 win32_nmres=`eval $NM -f posix -A $1 | \
475 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
476 if test "X$win32_nmres" = "Ximport" ; then
477 win32_libid_type="x86 archive import"
479 win32_libid_type="x86 archive static"
484 win32_libid_type="x86 DLL"
486 *executable*) # but shell scripts are "executable" too...
487 case $win32_fileres in
488 *MS\ Windows\ PE\ Intel*)
489 win32_libid_type="x86 DLL"
494 $echo $win32_libid_type
497 # End of Shell function definitions
498 #####################################
500 # Parse our command line options once, thoroughly.
501 while test "$#" -gt 0
507 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
511 # If the previous option needs an argument, assign it.
512 if test -n "$prev"; then
515 execute_dlfiles="$execute_dlfiles $arg"
520 # Check whether tagname contains only valid characters
523 $echo "$progname: invalid tag name: $tagname" 1>&2
530 # Don't test for the "default" C tag, as we know, it's there, but
531 # not specially marked.
534 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
535 taglist="$taglist $tagname"
536 # Evaluate the configuration.
537 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
539 $echo "$progname: ignoring unknown tag $tagname" 1>&2
554 # Have we seen a non-optional argument yet?
561 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
563 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
564 $echo "This is free software; see the source for copying conditions. There is NO"
565 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
570 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
571 # Now print the configurations for the tags.
572 for tagname in $taglist; do
573 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
579 $echo "$progname: enabling shell trace mode"
589 if test "$build_libtool_libs" = yes; then
590 $echo "enable shared libraries"
592 $echo "disable shared libraries"
594 if test "$build_old_libs" = yes; then
595 $echo "enable static libraries"
597 $echo "disable static libraries"
602 --finish) mode="finish" ;;
604 --mode) prevopt="--mode" prev=mode ;;
605 --mode=*) mode="$optarg" ;;
607 --preserve-dup-deps) duplicate_deps="yes" ;;
613 --tag) prevopt="--tag" prev=tag ;;
615 set tag "$optarg" ${1+"$@"}
626 $echo "$modename: unrecognized option \`$arg'" 1>&2
638 if test -n "$prevopt"; then
639 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
644 # If this variable is set in any of the actions, the command in it
645 # will be execed at the end. This prevents here-documents from being
646 # left over by shells.
649 if test -z "$show_help"; then
651 # Infer the operation mode.
652 if test -z "$mode"; then
653 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
654 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
656 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
668 *db | *dbx | *strace | *truss)
678 # If we have no mode, but dlfiles were specified, then do execute mode.
679 test -n "$execute_dlfiles" && mode=execute
681 # Just use the default operation mode.
682 if test -z "$mode"; then
683 if test -n "$nonopt"; then
684 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
686 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
693 # Only execute mode is allowed to have -dlopen flags.
694 if test -n "$execute_dlfiles" && test "$mode" != execute; then
695 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
700 # Change the help message to a mode-specific one.
702 help="Try \`$modename --help --mode=$mode' for more information."
704 # These modes are in order of execution frequency so that they run quickly.
706 # libtool compile mode
708 modename="$modename: compile"
709 # Get the compilation command and the source file.
711 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
720 # do not "continue". Instead, add this to base_compile
732 # Accept any command-line options.
735 if test -n "$libobj" ; then
736 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
759 arg_mode=arg # the next one goes into the "base_compile" arg list
760 continue # The current "srcfile" will either be retained or
761 ;; # replaced later. I would guess that would be a bug.
764 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
766 save_ifs="$IFS"; IFS=','
770 # Double-quote args containing other shell metacharacters.
771 # Many Bourne shells cannot handle close brackets correctly
772 # in scan sets, so we specify it separately.
774 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
778 lastarg="$lastarg $arg"
781 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
783 # Add the arguments to base_compile.
784 base_compile="$base_compile $lastarg"
789 # Accept the current argument as the source file.
790 # The previous "srcfile" becomes the current argument.
797 esac # case $arg_mode
799 # Aesthetically quote the previous argument.
800 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
803 # Double-quote args containing other shell metacharacters.
804 # Many Bourne shells cannot handle close brackets correctly
805 # in scan sets, so we specify it separately.
806 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
807 lastarg="\"$lastarg\""
811 base_compile="$base_compile $lastarg"
816 $echo "$modename: you must specify an argument for -Xcompile"
820 $echo "$modename: you must specify a target with \`-o'" 1>&2
824 # Get the name of the library object.
825 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
829 # Recognize several different file suffixes.
830 # If the user specifies -o file.o, it is replaced with file.lo
840 *.class) xform=class ;;
845 *.java) xform=java ;;
848 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
851 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
853 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
858 # Infer tagged configuration to use if any are available and
859 # if one wasn't chosen via the "--tag" command line option.
860 # Only attempt this if the compiler in the base compile
861 # command doesn't match the default compiler.
862 if test -n "$available_tags" && test -z "$tagname"; then
863 case $base_compile in
864 # Blanks in the command may have been stripped by the calling shell,
865 # but not from the CC environment variable when configure was run.
866 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
867 # Blanks at the start of $base_compile will cause this to fail
868 # if we don't check for them as well.
870 for z in $available_tags; do
871 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
872 # Evaluate the configuration.
873 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
874 case "$base_compile " in
875 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
876 # The compiler in the base compile command matches
877 # the one in the tagged configuration.
878 # Assume this is the tagged configuration we want.
885 # If $tagname still isn't set, then no tagged configuration
886 # was found and let the user know that the "--tag" command
887 # line option must be used.
888 if test -z "$tagname"; then
889 $echo "$modename: unable to infer tagged configuration"
890 $echo "$modename: specify a tag with \`--tag'" 1>&2
893 # $echo "$modename: using $tagname tagged configuration"
899 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
900 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
901 if test "X$xdir" = "X$obj"; then
906 lobj=${xdir}$objdir/$objname
908 if test -z "$base_compile"; then
909 $echo "$modename: you must specify a compilation command" 1>&2
914 # Delete any leftover library objects.
915 if test "$build_old_libs" = yes; then
916 removelist="$obj $lobj $libobj ${libobj}T"
918 removelist="$lobj $libobj ${libobj}T"
922 trap "$run $rm $removelist; exit 1" 1 2 15
924 # On Cygwin there's no "real" PIC flag so we must build both object types
926 cygwin* | mingw* | pw32* | os2*)
930 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
931 # non-PIC code in shared libraries is not supported
935 # Calculate the filename of the output object if compiler does
936 # not support -o with -c
937 if test "$compiler_c_o" = no; then
938 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
939 lockfile="$output_obj.lock"
940 removelist="$removelist $output_obj $lockfile"
941 trap "$run $rm $removelist; exit 1" 1 2 15
948 # Lock this critical section if it is needed
949 # We use this script file to make the link, it avoids creating a new file
950 if test "$need_locks" = yes; then
951 until $run ln "$0" "$lockfile" 2>/dev/null; do
952 $show "Waiting for $lockfile to be removed"
955 elif test "$need_locks" = warn; then
956 if test -f "$lockfile"; then
958 *** ERROR, $lockfile exists and contains:
959 `cat $lockfile 2>/dev/null`
961 This indicates that another process is trying to use the same
962 temporary object file, and libtool could not work around it because
963 your compiler does not support \`-c' and \`-o' together. If you
964 repeat this compilation, it may succeed, by chance, but you had better
965 avoid parallel builds (make -j) in this platform, or get a better
971 $echo $srcfile > "$lockfile"
974 if test -n "$fix_srcfile_path"; then
975 eval srcfile=\"$fix_srcfile_path\"
978 $run $rm "$libobj" "${libobj}T"
980 # Create a libtool object file (analogous to a ".la" file),
981 # but don't create it if we're doing a dry run.
982 test -z "$run" && cat > ${libobj}T <<EOF
983 # $libobj - a libtool object file
984 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
986 # Please DO NOT delete this file!
987 # It is necessary for linking the library.
989 # Name of the PIC object.
992 # Only build a PIC object if we are building libtool libraries.
993 if test "$build_libtool_libs" = yes; then
994 # Without this assignment, base_compile gets emptied.
995 fbsd_hideous_sh_bug=$base_compile
997 if test "$pic_mode" != no; then
998 command="$base_compile $srcfile $pic_flag"
1000 # Don't build PIC code
1001 command="$base_compile $srcfile"
1004 if test ! -d "${xdir}$objdir"; then
1005 $show "$mkdir ${xdir}$objdir"
1006 $run $mkdir ${xdir}$objdir
1008 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
1013 if test -z "$output_obj"; then
1014 # Place PIC objects in $objdir
1015 command="$command -o $lobj"
1018 $run $rm "$lobj" "$output_obj"
1021 if $run eval "$command"; then :
1023 test -n "$output_obj" && $run $rm $removelist
1027 if test "$need_locks" = warn &&
1028 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1030 *** ERROR, $lockfile contains:
1031 `cat $lockfile 2>/dev/null`
1033 but it should contain:
1036 This indicates that another process is trying to use the same
1037 temporary object file, and libtool could not work around it because
1038 your compiler does not support \`-c' and \`-o' together. If you
1039 repeat this compilation, it may succeed, by chance, but you had better
1040 avoid parallel builds (make -j) in this platform, or get a better
1043 $run $rm $removelist
1047 # Just move the object if needed, then go on to compile the next one
1048 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1049 $show "$mv $output_obj $lobj"
1050 if $run $mv $output_obj $lobj; then :
1053 $run $rm $removelist
1058 # Append the name of the PIC object to the libtool object file.
1059 test -z "$run" && cat >> ${libobj}T <<EOF
1060 pic_object='$objdir/$objname'
1064 # Allow error messages only from the first compilation.
1065 suppress_output=' >/dev/null 2>&1'
1067 # No PIC object so indicate it doesn't exist in the libtool
1069 test -z "$run" && cat >> ${libobj}T <<EOF
1075 # Only build a position-dependent object if we build old libraries.
1076 if test "$build_old_libs" = yes; then
1077 if test "$pic_mode" != yes; then
1078 # Don't build PIC code
1079 command="$base_compile $srcfile"
1081 command="$base_compile $srcfile $pic_flag"
1083 if test "$compiler_c_o" = yes; then
1084 command="$command -o $obj"
1087 # Suppress compiler output if we already did a PIC compilation.
1088 command="$command$suppress_output"
1089 $run $rm "$obj" "$output_obj"
1091 if $run eval "$command"; then :
1093 $run $rm $removelist
1097 if test "$need_locks" = warn &&
1098 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1100 *** ERROR, $lockfile contains:
1101 `cat $lockfile 2>/dev/null`
1103 but it should contain:
1106 This indicates that another process is trying to use the same
1107 temporary object file, and libtool could not work around it because
1108 your compiler does not support \`-c' and \`-o' together. If you
1109 repeat this compilation, it may succeed, by chance, but you had better
1110 avoid parallel builds (make -j) in this platform, or get a better
1113 $run $rm $removelist
1117 # Just move the object if needed
1118 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1119 $show "$mv $output_obj $obj"
1120 if $run $mv $output_obj $obj; then :
1123 $run $rm $removelist
1128 # Append the name of the non-PIC object the libtool object file.
1129 # Only append if the libtool object file exists.
1130 test -z "$run" && cat >> ${libobj}T <<EOF
1131 # Name of the non-PIC object.
1132 non_pic_object='$objname'
1136 # Append the name of the non-PIC object the libtool object file.
1137 # Only append if the libtool object file exists.
1138 test -z "$run" && cat >> ${libobj}T <<EOF
1139 # Name of the non-PIC object.
1145 $run $mv "${libobj}T" "${libobj}"
1147 # Unlock the critical section if it was locked
1148 if test "$need_locks" != no; then
1149 $run $rm "$lockfile"
1157 modename="$modename: link"
1159 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1160 # It is impossible to link a dll without this setting, and
1161 # we shouldn't force the makefile maintainer to figure out
1162 # which system we are compiling for in order to pass an extra
1163 # flag for every libtool invocation.
1164 # allow_undefined=no
1166 # FIXME: Unfortunately, there are problems with the above when trying
1167 # to make a dll which has undefined symbols, in which case not
1168 # even a static library is built. For now, we need to specify
1169 # -no-undefined on the libtool link line when we can be certain
1170 # that all symbols are satisfied, otherwise we get a static library.
1177 libtool_args="$nonopt"
1178 base_compile="$nonopt"
1179 compile_command="$nonopt"
1180 finalize_command="$nonopt"
1193 lib_search_path=`pwd`
1202 export_symbols_regex=
1210 prefer_static_libs=no
1223 # We need to know -static, to get the right output filenames.
1227 -all-static | -static)
1228 if test "X$arg" = "X-all-static"; then
1229 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1230 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1232 if test -n "$link_static_flag"; then
1233 dlopen_self=$dlopen_self_static
1236 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1237 dlopen_self=$dlopen_self_static
1240 build_libtool_libs=no
1242 prefer_static_libs=yes
1248 # See if our shared archives depend on static archives.
1249 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1251 # Go through the arguments, transforming them on the way.
1252 while test "$#" -gt 0; do
1254 base_compile="$base_compile $arg"
1257 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1258 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1262 libtool_args="$libtool_args $qarg"
1264 # If the previous option needs an argument, assign it.
1265 if test -n "$prev"; then
1268 compile_command="$compile_command @OUTPUT@"
1269 finalize_command="$finalize_command @OUTPUT@"
1275 if test "$preload" = no; then
1276 # Add the symbol object into the linking commands.
1277 compile_command="$compile_command @SYMFILE@"
1278 finalize_command="$finalize_command @SYMFILE@"
1282 *.la | *.lo) ;; # We handle these cases below.
1284 if test "$dlself" = no; then
1292 if test "$prev" = dlprefiles; then
1294 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1304 if test "$prev" = dlfiles; then
1305 dlfiles="$dlfiles $arg"
1307 dlprefiles="$dlprefiles $arg"
1315 export_symbols="$arg"
1316 if test ! -f "$arg"; then
1317 $echo "$modename: symbol file \`$arg' does not exist"
1324 export_symbols_regex="$arg"
1329 inst_prefix_dir="$arg"
1339 if test -f "$arg"; then
1342 for fil in `cat $save_arg`
1344 # moreargs="$moreargs $fil"
1346 # A libtool-controlled object.
1348 # Check to see that this really is a libtool object.
1349 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1354 # If there is no directory component, then add one.
1356 */* | *\\*) . $arg ;;
1360 if test -z "$pic_object" || \
1361 test -z "$non_pic_object" ||
1362 test "$pic_object" = none && \
1363 test "$non_pic_object" = none; then
1364 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1368 # Extract subdirectory from the argument.
1369 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1370 if test "X$xdir" = "X$arg"; then
1376 if test "$pic_object" != none; then
1377 # Prepend the subdirectory the object is found in.
1378 pic_object="$xdir$pic_object"
1380 if test "$prev" = dlfiles; then
1381 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1382 dlfiles="$dlfiles $pic_object"
1386 # If libtool objects are unsupported, then we need to preload.
1391 # CHECK ME: I think I busted this. -Ossama
1392 if test "$prev" = dlprefiles; then
1393 # Preload the old-style object.
1394 dlprefiles="$dlprefiles $pic_object"
1399 libobjs="$libobjs $pic_object"
1404 if test "$non_pic_object" != none; then
1405 # Prepend the subdirectory the object is found in.
1406 non_pic_object="$xdir$non_pic_object"
1408 # A standard non-PIC object
1409 non_pic_objects="$non_pic_objects $non_pic_object"
1410 if test -z "$pic_object" || test "$pic_object" = none ; then
1411 arg="$non_pic_object"
1415 # Only an error if not doing a dry-run.
1416 if test -z "$run"; then
1417 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1422 # Extract subdirectory from the argument.
1423 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1424 if test "X$xdir" = "X$arg"; then
1430 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1431 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1432 libobjs="$libobjs $pic_object"
1433 non_pic_objects="$non_pic_objects $non_pic_object"
1438 $echo "$modename: link input file \`$save_arg' does not exist"
1446 # We need an absolute path.
1448 [\\/]* | [A-Za-z]:[\\/]*) ;;
1450 $echo "$modename: only absolute run-paths are allowed" 1>&2
1454 if test "$prev" = rpath; then
1457 *) rpath="$rpath $arg" ;;
1462 *) xrpath="$xrpath $arg" ;;
1469 compiler_flags="$compiler_flags $qarg"
1471 compile_command="$compile_command $qarg"
1472 finalize_command="$finalize_command $qarg"
1476 linker_flags="$linker_flags $qarg"
1477 compiler_flags="$compiler_flags $wl$qarg"
1479 compile_command="$compile_command $wl$qarg"
1480 finalize_command="$finalize_command $wl$qarg"
1484 linker_flags="$linker_flags $qarg"
1485 compiler_flags="$compiler_flags $qarg"
1487 compile_command="$compile_command $qarg"
1488 finalize_command="$finalize_command $qarg"
1492 eval "$prev=\"\$arg\""
1497 fi # test -n "$prev"
1503 if test -n "$link_static_flag"; then
1504 compile_command="$compile_command $link_static_flag"
1505 finalize_command="$finalize_command $link_static_flag"
1511 # FIXME: remove this flag sometime in the future.
1512 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1536 -export-symbols | -export-symbols-regex)
1537 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1538 $echo "$modename: more than one -exported-symbols argument is not allowed"
1541 if test "X$arg" = "X-export-symbols"; then
1554 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1555 # so, if we see these flags be careful not to treat them like -L
1557 case $with_gcc/$host in
1558 no/*-*-irix* | /*-*-irix*)
1559 compile_command="$compile_command $arg"
1560 finalize_command="$finalize_command $arg"
1567 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1568 # We need an absolute path.
1570 [\\/]* | [A-Za-z]:[\\/]*) ;;
1572 absdir=`cd "$dir" && pwd`
1573 if test -z "$absdir"; then
1574 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1583 deplibs="$deplibs -L$dir"
1584 lib_search_path="$lib_search_path $dir"
1588 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1589 case :$dllsearchpath: in
1591 *) dllsearchpath="$dllsearchpath:$dir";;
1599 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1601 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1602 # These systems don't actually have a C or math library (as such)
1605 *-*-mingw* | *-*-os2*)
1606 # These systems don't actually have a C library (as such)
1607 test "X$arg" = "X-lc" && continue
1609 *-*-openbsd* | *-*-freebsd*)
1610 # Do not include libc due to us having libc/libc_r.
1611 test "X$arg" = "X-lc" && continue
1613 *-*-rhapsody* | *-*-darwin1.[012])
1614 # Rhapsody C and math libraries are in the System framework
1615 deplibs="$deplibs -framework System"
1618 elif test "X$arg" = "X-lc_r"; then
1620 *-*-openbsd* | *-*-freebsd*)
1621 # Do not include libc_r directly, use -pthread flag.
1626 deplibs="$deplibs $arg"
1635 # gcc -m* arguments should be passed to the linker via $compiler_flags
1636 # in order to pass architecture information to the linker
1637 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1638 # but this is not reliable with gcc because gcc may use -mfoo to
1639 # select a different linker, different libraries, etc, while
1640 # -Wl,-mfoo simply passes -mfoo to the linker.
1642 # Unknown arguments in both finalize_command and compile_command need
1643 # to be aesthetically quoted because they are evaled later.
1644 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1646 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1650 compile_command="$compile_command $arg"
1651 finalize_command="$finalize_command $arg"
1652 if test "$with_gcc" = "yes" ; then
1653 compiler_flags="$compiler_flags $arg"
1670 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1671 # The PATH hackery in wrapper scripts is required on Windows
1672 # in order for the loader to find any dlls it needs.
1673 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1674 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1677 *) no_install=yes ;;
1710 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1711 # We need an absolute path.
1713 [\\/]* | [A-Za-z]:[\\/]*) ;;
1715 $echo "$modename: only absolute run-paths are allowed" 1>&2
1721 *) xrpath="$xrpath $dir" ;;
1727 # The effects of -static are defined in a previous loop.
1728 # We used to do the same as -all-static on platforms that
1729 # didn't have a PIC flag, but the assumption that the effects
1730 # would be equivalent was wrong. It would break on at least
1731 # Digital Unix and AIX.
1751 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1753 save_ifs="$IFS"; IFS=','
1754 for flag in $args; do
1757 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1762 compiler_flags="$compiler_flags $flag"
1765 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1769 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1771 save_ifs="$IFS"; IFS=','
1772 for flag in $args; do
1775 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1780 compiler_flags="$compiler_flags $wl$flag"
1781 linker_flags="$linker_flags $flag"
1784 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1802 # Some other compiler flag.
1804 # Unknown arguments in both finalize_command and compile_command need
1805 # to be aesthetically quoted because they are evaled later.
1806 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1808 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1815 # A standard object.
1820 # A libtool-controlled object.
1822 # Check to see that this really is a libtool object.
1823 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1828 # If there is no directory component, then add one.
1830 */* | *\\*) . $arg ;;
1834 if test -z "$pic_object" || \
1835 test -z "$non_pic_object" ||
1836 test "$pic_object" = none && \
1837 test "$non_pic_object" = none; then
1838 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1842 # Extract subdirectory from the argument.
1843 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1844 if test "X$xdir" = "X$arg"; then
1850 if test "$pic_object" != none; then
1851 # Prepend the subdirectory the object is found in.
1852 pic_object="$xdir$pic_object"
1854 if test "$prev" = dlfiles; then
1855 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1856 dlfiles="$dlfiles $pic_object"
1860 # If libtool objects are unsupported, then we need to preload.
1865 # CHECK ME: I think I busted this. -Ossama
1866 if test "$prev" = dlprefiles; then
1867 # Preload the old-style object.
1868 dlprefiles="$dlprefiles $pic_object"
1873 libobjs="$libobjs $pic_object"
1878 if test "$non_pic_object" != none; then
1879 # Prepend the subdirectory the object is found in.
1880 non_pic_object="$xdir$non_pic_object"
1882 # A standard non-PIC object
1883 non_pic_objects="$non_pic_objects $non_pic_object"
1884 if test -z "$pic_object" || test "$pic_object" = none ; then
1885 arg="$non_pic_object"
1889 # Only an error if not doing a dry-run.
1890 if test -z "$run"; then
1891 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1896 # Extract subdirectory from the argument.
1897 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1898 if test "X$xdir" = "X$arg"; then
1904 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1905 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1906 libobjs="$libobjs $pic_object"
1907 non_pic_objects="$non_pic_objects $non_pic_object"
1914 deplibs="$deplibs $arg"
1915 old_deplibs="$old_deplibs $arg"
1920 # A libtool-controlled library.
1922 if test "$prev" = dlfiles; then
1923 # This library was specified with -dlopen.
1924 dlfiles="$dlfiles $arg"
1926 elif test "$prev" = dlprefiles; then
1927 # The library was specified with -dlpreopen.
1928 dlprefiles="$dlprefiles $arg"
1931 deplibs="$deplibs $arg"
1936 # Some other compiler argument.
1938 # Unknown arguments in both finalize_command and compile_command need
1939 # to be aesthetically quoted because they are evaled later.
1940 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1942 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1949 # Now actually substitute the argument into the commands.
1950 if test -n "$arg"; then
1951 compile_command="$compile_command $arg"
1952 finalize_command="$finalize_command $arg"
1954 done # argument parsing loop
1956 if test -n "$prev"; then
1957 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1962 # Infer tagged configuration to use if any are available and
1963 # if one wasn't chosen via the "--tag" command line option.
1964 # Only attempt this if the compiler in the base link
1965 # command doesn't match the default compiler.
1966 if test -n "$available_tags" && test -z "$tagname"; then
1967 case $base_compile in
1968 # Blanks in the command may have been stripped by the calling shell,
1969 # but not from the CC environment variable when configure was run.
1970 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1971 # Blanks at the start of $base_compile will cause this to fail
1972 # if we don't check for them as well.
1974 for z in $available_tags; do
1975 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1976 # Evaluate the configuration.
1977 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1978 case $base_compile in
1979 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1980 # The compiler in $compile_command matches
1981 # the one in the tagged configuration.
1982 # Assume this is the tagged configuration we want.
1989 # If $tagname still isn't set, then no tagged configuration
1990 # was found and let the user know that the "--tag" command
1991 # line option must be used.
1992 if test -z "$tagname"; then
1993 $echo "$modename: unable to infer tagged configuration"
1994 $echo "$modename: specify a tag with \`--tag'" 1>&2
1997 # $echo "$modename: using $tagname tagged configuration"
2003 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2004 eval arg=\"$export_dynamic_flag_spec\"
2005 compile_command="$compile_command $arg"
2006 finalize_command="$finalize_command $arg"
2010 # calculate the name of the file, without its directory
2011 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2012 libobjs_save="$libobjs"
2014 if test -n "$shlibpath_var"; then
2015 # get the directories listed in $shlibpath_var
2016 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2020 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2021 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2023 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2024 if test "X$output_objdir" = "X$output"; then
2025 output_objdir="$objdir"
2027 output_objdir="$output_objdir/$objdir"
2029 # Create the object directory.
2030 if test ! -d "$output_objdir"; then
2031 $show "$mkdir $output_objdir"
2032 $run $mkdir $output_objdir
2034 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
2039 # Determine the type of output
2042 $echo "$modename: you must specify an output file" 1>&2
2046 *.$libext) linkmode=oldlib ;;
2047 *.lo | *.$objext) linkmode=obj ;;
2048 *.la) linkmode=lib ;;
2049 *) linkmode=prog ;; # Anything else should be a program.
2053 *cygwin* | *mingw* | *pw32*)
2054 # don't eliminate duplcations in $postdeps and $predeps
2055 duplicate_compiler_generated_deps=yes
2058 duplicate_compiler_generated_deps=$duplicate_deps
2064 # Find all interdependent deplibs by searching for libraries
2065 # that are linked more than once (e.g. -la -lb -la)
2066 for deplib in $deplibs; do
2067 if test "X$duplicate_deps" = "Xyes" ; then
2069 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2072 libs="$libs $deplib"
2075 if test "$linkmode" = lib; then
2076 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2078 # Compute libraries that are listed more than once in $predeps
2079 # $postdeps and mark them as special (i.e., whose duplicates are
2080 # not to be eliminated).
2082 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2083 for pre_post_dep in $predeps $postdeps; do
2084 case "$pre_post_deps " in
2085 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2087 pre_post_deps="$pre_post_deps $pre_post_dep"
2096 need_relink=no # whether we're linking any uninstalled libtool libraries
2097 notinst_deplibs= # not-installed libtool libraries
2098 notinst_path= # paths that contain not-installed libtool libraries
2102 for file in $dlfiles $dlprefiles; do
2106 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2118 passes="conv scan dlopen dlpreopen link"
2123 for pass in $passes; do
2124 if test "$linkmode,$pass" = "lib,link" ||
2125 test "$linkmode,$pass" = "prog,scan"; then
2129 if test "$linkmode" = prog; then
2131 dlopen) libs="$dlfiles" ;;
2132 dlpreopen) libs="$dlprefiles" ;;
2133 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2136 if test "$pass" = dlopen; then
2137 # Collect dlpreopened libraries
2138 save_deplibs="$deplibs"
2141 for deplib in $libs; do
2146 if test "$linkmode" != lib && test "$linkmode" != prog; then
2147 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2150 if test "$pass" = conv; then
2151 deplibs="$deplib $deplibs"
2154 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2155 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2156 # Search the libtool library
2157 lib="$searchdir/lib${name}.la"
2158 if test -f "$lib"; then
2163 if test "$found" != yes; then
2164 # deplib doesn't seem to be a libtool library
2165 if test "$linkmode,$pass" = "prog,link"; then
2166 compile_deplibs="$deplib $compile_deplibs"
2167 finalize_deplibs="$deplib $finalize_deplibs"
2169 deplibs="$deplib $deplibs"
2170 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2173 else # deplib is a libtool library
2174 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2175 # We need to do some special things here, and not later.
2176 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2177 case " $predeps $postdeps " in
2179 if (${SED} -e '2q' $lib |
2180 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2184 */* | *\\*) . $lib ;;
2187 for l in $old_library $library_names; do
2190 if test "X$ll" = "X$old_library" ; then # only static version available
2192 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2193 test "X$ladir" = "X$lib" && ladir="."
2194 lib=$ladir/$old_library
2195 if test "$linkmode,$pass" = "prog,link"; then
2196 compile_deplibs="$deplib $compile_deplibs"
2197 finalize_deplibs="$deplib $finalize_deplibs"
2199 deplibs="$deplib $deplibs"
2200 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2214 deplibs="$deplib $deplibs"
2215 test "$pass" = conv && continue
2216 newdependency_libs="$deplib $newdependency_libs"
2217 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2220 if test "$pass" = conv; then
2221 deplibs="$deplib $deplibs"
2224 if test "$pass" = scan; then
2225 deplibs="$deplib $deplibs"
2226 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2228 compile_deplibs="$deplib $compile_deplibs"
2229 finalize_deplibs="$deplib $finalize_deplibs"
2233 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2239 if test "$pass" = link; then
2240 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2241 # Make sure the xrpath contains only unique directories.
2244 *) xrpath="$xrpath $dir" ;;
2247 deplibs="$deplib $deplibs"
2250 *.la) lib="$deplib" ;;
2252 if test "$pass" = conv; then
2253 deplibs="$deplib $deplibs"
2258 if test "$deplibs_check_method" != pass_all; then
2260 $echo "*** Warning: Trying to link with static lib archive $deplib."
2261 $echo "*** I have the capability to make that library automatically link in when"
2262 $echo "*** you link to this library. But I can only do this if you have a"
2263 $echo "*** shared version of the library, which you do not appear to have"
2264 $echo "*** because the file extensions .$libext of this argument makes me believe"
2265 $echo "*** that it is just a static archive that I should not used here."
2268 $echo "*** Warning: Linking the shared library $output against the"
2269 $echo "*** static library $deplib is not portable!"
2270 deplibs="$deplib $deplibs"
2275 if test "$pass" != link; then
2276 deplibs="$deplib $deplibs"
2278 compile_deplibs="$deplib $compile_deplibs"
2279 finalize_deplibs="$deplib $finalize_deplibs"
2286 if test "$pass" = conv; then
2287 deplibs="$deplib $deplibs"
2288 elif test "$linkmode" = prog; then
2289 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2290 # If there is no dlopen support or we're linking statically,
2291 # we need to preload.
2292 newdlprefiles="$newdlprefiles $deplib"
2293 compile_deplibs="$deplib $compile_deplibs"
2294 finalize_deplibs="$deplib $finalize_deplibs"
2296 newdlfiles="$newdlfiles $deplib"
2306 if test "$found" = yes || test -f "$lib"; then :
2308 $echo "$modename: cannot find the library \`$lib'" 1>&2
2312 # Check to see that this really is a libtool archive.
2313 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2315 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2319 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2320 test "X$ladir" = "X$lib" && ladir="."
2328 # If the library was installed with an old release of libtool,
2329 # it will not redefine variables installed, or shouldnotlink
2335 */* | *\\*) . $lib ;;
2339 if test "$linkmode,$pass" = "lib,link" ||
2340 test "$linkmode,$pass" = "prog,scan" ||
2341 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2342 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2343 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2346 if test "$pass" = conv; then
2347 # Only check for convenience libraries
2348 deplibs="$lib $deplibs"
2349 if test -z "$libdir"; then
2350 if test -z "$old_library"; then
2351 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2354 # It is a libtool convenience library, so add in its objects.
2355 convenience="$convenience $ladir/$objdir/$old_library"
2356 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2358 for deplib in $dependency_libs; do
2359 deplibs="$deplib $deplibs"
2360 if test "X$duplicate_deps" = "Xyes" ; then
2361 case "$tmp_libs " in
2362 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2365 tmp_libs="$tmp_libs $deplib"
2367 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2368 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2375 # Get the name of the library we link against.
2377 for l in $old_library $library_names; do
2380 if test -z "$linklib"; then
2381 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2385 # This library was specified with -dlopen.
2386 if test "$pass" = dlopen; then
2387 if test -z "$libdir"; then
2388 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2391 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2392 # If there is no dlname, no dlopen support or we're linking
2393 # statically, we need to preload. We also need to preload any
2394 # dependent libraries so libltdl's deplib preloader doesn't
2395 # bomb out in the load deplibs phase.
2396 dlprefiles="$dlprefiles $lib $dependency_libs"
2398 newdlfiles="$newdlfiles $lib"
2403 # We need an absolute path.
2405 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2407 abs_ladir=`cd "$ladir" && pwd`
2408 if test -z "$abs_ladir"; then
2409 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2410 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2415 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2417 # Find the relevant object directory and library name.
2418 if test "X$installed" = Xyes; then
2419 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2420 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2429 dir="$ladir/$objdir"
2430 absdir="$abs_ladir/$objdir"
2431 # Remove this search path later
2432 notinst_path="$notinst_path $abs_ladir"
2433 fi # $installed = yes
2434 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2436 # This library was specified with -dlpreopen.
2437 if test "$pass" = dlpreopen; then
2438 if test -z "$libdir"; then
2439 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2442 # Prefer using a static library (so that no silly _DYNAMIC symbols
2443 # are required to link).
2444 if test -n "$old_library"; then
2445 newdlprefiles="$newdlprefiles $dir/$old_library"
2446 # Otherwise, use the dlname, so that lt_dlopen finds it.
2447 elif test -n "$dlname"; then
2448 newdlprefiles="$newdlprefiles $dir/$dlname"
2450 newdlprefiles="$newdlprefiles $dir/$linklib"
2452 fi # $pass = dlpreopen
2454 if test -z "$libdir"; then
2455 # Link the convenience library
2456 if test "$linkmode" = lib; then
2457 deplibs="$dir/$old_library $deplibs"
2458 elif test "$linkmode,$pass" = "prog,link"; then
2459 compile_deplibs="$dir/$old_library $compile_deplibs"
2460 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2462 deplibs="$lib $deplibs" # used for prog,scan pass
2468 if test "$linkmode" = prog && test "$pass" != link; then
2469 newlib_search_path="$newlib_search_path $ladir"
2470 deplibs="$lib $deplibs"
2473 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2474 test "$build_libtool_libs" = no; then
2479 for deplib in $dependency_libs; do
2481 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2483 # Need to link against all dependency_libs?
2484 if test "$linkalldeplibs" = yes; then
2485 deplibs="$deplib $deplibs"
2487 # Need to hardcode shared library paths
2488 # or/and link against static libraries
2489 newdependency_libs="$deplib $newdependency_libs"
2491 if test "X$duplicate_deps" = "Xyes" ; then
2492 case "$tmp_libs " in
2493 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2496 tmp_libs="$tmp_libs $deplib"
2499 fi # $linkmode = prog...
2501 if test "$linkmode,$pass" = "prog,link"; then
2502 if test -n "$library_names" &&
2503 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2504 # We need to hardcode the library path
2505 if test -n "$shlibpath_var"; then
2506 # Make sure the rpath contains only unique directories.
2507 case "$temp_rpath " in
2510 *) temp_rpath="$temp_rpath $dir" ;;
2514 # Hardcode the library path.
2515 # Skip directories that are in the system default run-time
2517 case " $sys_lib_dlsearch_path " in
2520 case "$compile_rpath " in
2522 *) compile_rpath="$compile_rpath $absdir"
2526 case " $sys_lib_dlsearch_path " in
2529 case "$finalize_rpath " in
2531 *) finalize_rpath="$finalize_rpath $libdir"
2535 fi # $linkmode,$pass = prog,link...
2537 if test "$alldeplibs" = yes &&
2538 { test "$deplibs_check_method" = pass_all ||
2539 { test "$build_libtool_libs" = yes &&
2540 test -n "$library_names"; }; }; then
2541 # We only need to search for static libraries
2546 link_static=no # Whether the deplib will be linked statically
2547 if test -n "$library_names" &&
2548 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2549 if test "$installed" = no; then
2550 notinst_deplibs="$notinst_deplibs $lib"
2553 # This is a shared library
2555 # Warn about portability, can't link against -module's on some systems (darwin)
2556 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2558 if test "$linkmode" = prog; then
2559 $echo "*** Warning: Linking the executable $output against the loadable module"
2561 $echo "*** Warning: Linking the shared library $output against the loadable module"
2563 $echo "*** $linklib is not portable!"
2565 if test "$linkmode" = lib &&
2566 test "$hardcode_into_libs" = yes; then
2567 # Hardcode the library path.
2568 # Skip directories that are in the system default run-time
2570 case " $sys_lib_dlsearch_path " in
2573 case "$compile_rpath " in
2575 *) compile_rpath="$compile_rpath $absdir"
2579 case " $sys_lib_dlsearch_path " in
2582 case "$finalize_rpath " in
2584 *) finalize_rpath="$finalize_rpath $libdir"
2590 if test -n "$old_archive_from_expsyms_cmds"; then
2591 # figure out the soname
2592 set dummy $library_names
2595 libname=`eval \\$echo \"$libname_spec\"`
2596 # use dlname if we got it. it's perfectly good, no?
2597 if test -n "$dlname"; then
2599 elif test -n "$soname_spec"; then
2603 major=`expr $current - $age`
2607 eval soname=\"$soname_spec\"
2612 # Make a new name for the extract_expsyms_cmds to use
2614 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2615 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2617 # If the library has no export list, then create one now
2618 if test -f "$output_objdir/$soname-def"; then :
2620 $show "extracting exported symbol list from \`$soname'"
2621 save_ifs="$IFS"; IFS='~'
2622 eval cmds=\"$extract_expsyms_cmds\"
2623 for cmd in $cmds; do
2626 $run eval "$cmd" || exit $?
2632 if test -f "$output_objdir/$newlib"; then :; else
2633 $show "generating import library for \`$soname'"
2634 save_ifs="$IFS"; IFS='~'
2635 eval cmds=\"$old_archive_from_expsyms_cmds\"
2636 for cmd in $cmds; do
2639 $run eval "$cmd" || exit $?
2643 # make sure the library variables are pointing to the new library
2646 fi # test -n "$old_archive_from_expsyms_cmds"
2648 if test "$linkmode" = prog || test "$mode" != relink; then
2653 case $hardcode_action in
2654 immediate | unsupported)
2655 if test "$hardcode_direct" = no; then
2658 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2660 # if the lib is a module then we can not link against it, someone
2661 # is ignoring the new warnings I added
2662 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2663 $echo "** Warning, lib $linklib is a module, not a shared library"
2664 if test -z "$old_library" ; then
2666 $echo "** And there doesn't seem to be a static archive available"
2667 $echo "** The link will probably fail, sorry"
2669 add="$dir/$old_library"
2673 elif test "$hardcode_minus_L" = no; then
2675 *-*-sunos*) add_shlibpath="$dir" ;;
2679 elif test "$hardcode_shlibpath_var" = no; then
2680 add_shlibpath="$dir"
2687 if test "$hardcode_direct" = yes; then
2689 elif test "$hardcode_minus_L" = yes; then
2691 # Try looking first in the location we're being installed to.
2692 if test -n "$inst_prefix_dir"; then
2695 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2700 elif test "$hardcode_shlibpath_var" = yes; then
2701 add_shlibpath="$dir"
2710 if test "$lib_linked" != yes; then
2711 $echo "$modename: configuration error: unsupported hardcode properties"
2715 if test -n "$add_shlibpath"; then
2716 case :$compile_shlibpath: in
2717 *":$add_shlibpath:"*) ;;
2718 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2721 if test "$linkmode" = prog; then
2722 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2723 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2725 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2726 test -n "$add" && deplibs="$add $deplibs"
2727 if test "$hardcode_direct" != yes && \
2728 test "$hardcode_minus_L" != yes && \
2729 test "$hardcode_shlibpath_var" = yes; then
2730 case :$finalize_shlibpath: in
2732 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2738 if test "$linkmode" = prog || test "$mode" = relink; then
2742 # Finalize command for both is simple: just hardcode it.
2743 if test "$hardcode_direct" = yes; then
2744 add="$libdir/$linklib"
2745 elif test "$hardcode_minus_L" = yes; then
2748 elif test "$hardcode_shlibpath_var" = yes; then
2749 case :$finalize_shlibpath: in
2751 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2754 elif test "$hardcode_automatic" = yes; then
2755 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2756 add="$inst_prefix_dir$libdir/$linklib"
2758 add="$libdir/$linklib"
2761 # We cannot seem to hardcode it, guess we'll fake it.
2763 # Try looking first in the location we're being installed to.
2764 if test -n "$inst_prefix_dir"; then
2767 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2774 if test "$linkmode" = prog; then
2775 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2776 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2778 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2779 test -n "$add" && deplibs="$add $deplibs"
2782 elif test "$linkmode" = prog; then
2783 # Here we assume that one of hardcode_direct or hardcode_minus_L
2784 # is not unsupported. This is valid on all known static and
2786 if test "$hardcode_direct" != unsupported; then
2787 test -n "$old_library" && linklib="$old_library"
2788 compile_deplibs="$dir/$linklib $compile_deplibs"
2789 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2791 compile_deplibs="-l$name -L$dir $compile_deplibs"
2792 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2794 elif test "$build_libtool_libs" = yes; then
2795 # Not a shared library
2796 if test "$deplibs_check_method" != pass_all; then
2797 # We're trying link a shared library against a static one
2798 # but the system doesn't support it.
2800 # Just print a warning and add the library to dependency_libs so
2801 # that the program can be linked against the static library.
2803 $echo "*** Warning: This system can not link to static lib archive $lib."
2804 $echo "*** I have the capability to make that library automatically link in when"
2805 $echo "*** you link to this library. But I can only do this if you have a"
2806 $echo "*** shared version of the library, which you do not appear to have."
2807 if test "$module" = yes; then
2808 $echo "*** But as you try to build a module library, libtool will still create "
2809 $echo "*** a static module, that should work as long as the dlopening application"
2810 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2811 if test -z "$global_symbol_pipe"; then
2813 $echo "*** However, this would only work if libtool was able to extract symbol"
2814 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2815 $echo "*** not find such a program. So, this module is probably useless."
2816 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2818 if test "$build_old_libs" = no; then
2819 build_libtool_libs=module
2822 build_libtool_libs=no
2826 convenience="$convenience $dir/$old_library"
2827 old_convenience="$old_convenience $dir/$old_library"
2828 deplibs="$dir/$old_library $deplibs"
2831 fi # link shared/static library?
2833 if test "$linkmode" = lib; then
2834 if test -n "$dependency_libs" &&
2835 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2836 test "$link_static" = yes; }; then
2837 # Extract -R from dependency_libs
2839 for libdir in $dependency_libs; do
2841 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2843 *" $temp_xrpath "*) ;;
2844 *) xrpath="$xrpath $temp_xrpath";;
2846 *) temp_deplibs="$temp_deplibs $libdir";;
2849 dependency_libs="$temp_deplibs"
2852 newlib_search_path="$newlib_search_path $absdir"
2853 # Link against this library
2854 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2855 # ... and its dependency_libs
2857 for deplib in $dependency_libs; do
2858 newdependency_libs="$deplib $newdependency_libs"
2859 if test "X$duplicate_deps" = "Xyes" ; then
2860 case "$tmp_libs " in
2861 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2864 tmp_libs="$tmp_libs $deplib"
2867 if test "$link_all_deplibs" != no; then
2868 # Add the search paths of all dependency libraries
2869 for deplib in $dependency_libs; do
2871 -L*) path="$deplib" ;;
2873 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2874 test "X$dir" = "X$deplib" && dir="."
2875 # We need an absolute path.
2877 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2879 absdir=`cd "$dir" && pwd`
2880 if test -z "$absdir"; then
2881 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2886 if grep "^installed=no" $deplib > /dev/null; then
2887 path="$absdir/$objdir"
2889 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2890 if test -z "$libdir"; then
2891 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2894 if test "$absdir" != "$libdir"; then
2895 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2902 # we do not want to link against static libs, but need to link against shared
2903 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2904 if test -n "$deplibrary_names" ; then
2905 for tmp in $deplibrary_names ; do
2908 if test -f "$path/$depdepl" ; then
2909 depdepl="$path/$depdepl"
2911 newlib_search_path="$newlib_search_path $path"
2924 # Again, we only want to link against shared libraries
2925 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2926 for tmp in $newlib_search_path ; do
2927 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2928 eval depdepl="$tmp/lib$tmp_libs.dylib"
2939 case " $deplibs " in
2941 *) deplibs="$deplibs $depdepl" ;;
2943 case " $deplibs " in
2945 *) deplibs="$deplibs $path" ;;
2948 fi # link_all_deplibs != no
2950 done # for deplib in $libs
2951 dependency_libs="$newdependency_libs"
2952 if test "$pass" = dlpreopen; then
2953 # Link the dlpreopened libraries before other libraries
2954 for deplib in $save_deplibs; do
2955 deplibs="$deplib $deplibs"
2958 if test "$pass" != dlopen; then
2959 if test "$pass" != conv; then
2960 # Make sure lib_search_path contains only unique directories.
2962 for dir in $newlib_search_path; do
2963 case "$lib_search_path " in
2965 *) lib_search_path="$lib_search_path $dir" ;;
2971 if test "$linkmode,$pass" != "prog,link"; then
2974 vars="compile_deplibs finalize_deplibs"
2976 for var in $vars dependency_libs; do
2977 # Add libraries to $var in reverse order
2978 eval tmp_libs=\"\$$var\"
2980 for deplib in $tmp_libs; do
2981 # FIXME: Pedantically, this is the right thing to do, so
2982 # that some nasty dependency loop isn't accidentally
2984 #new_libs="$deplib $new_libs"
2985 # Pragmatically, this seems to cause very few problems in
2988 -L*) new_libs="$deplib $new_libs" ;;
2991 # And here is the reason: when a library appears more
2992 # than once as an explicit dependence of a library, or
2993 # is implicitly linked in more than once by the
2994 # compiler, it is considered special, and multiple
2995 # occurrences thereof are not removed. Compare this
2996 # with having the same library being listed as a
2997 # dependency of multiple other libraries: in this case,
2998 # we know (pedantically, we assume) the library does not
2999 # need to be listed more than once, so we keep only the
3000 # last copy. This is not always right, but it is rare
3001 # enough that we require users that really mean to play
3002 # such unportable linking tricks to link the library
3003 # using -Wl,-lname, so that libtool does not consider it
3004 # for duplicate removal.
3005 case " $specialdeplibs " in
3006 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3008 case " $new_libs " in
3010 *) new_libs="$deplib $new_libs" ;;
3018 for deplib in $new_libs; do
3021 case " $tmp_libs " in
3023 *) tmp_libs="$tmp_libs $deplib" ;;
3026 *) tmp_libs="$tmp_libs $deplib" ;;
3029 eval $var=\"$tmp_libs\"
3032 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
3034 for i in $dependency_libs ; do
3035 case " $predeps $postdeps $compiler_lib_search_path " in
3040 if test -n "$i" ; then
3041 tmp_libs="$tmp_libs $i"
3044 dependency_libs=$tmp_libs
3046 if test "$linkmode" = prog; then
3047 dlfiles="$newdlfiles"
3048 dlprefiles="$newdlprefiles"
3053 if test -n "$deplibs"; then
3054 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3057 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3058 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3061 if test -n "$rpath"; then
3062 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3065 if test -n "$xrpath"; then
3066 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3069 if test -n "$vinfo"; then
3070 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3073 if test -n "$release"; then
3074 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3077 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3078 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3081 # Now set the variables for building old libraries.
3082 build_libtool_libs=no
3084 objs="$objs$old_deplibs"
3088 # Make sure we only generate libraries of the form `libNAME.la'.
3091 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3092 eval shared_ext=\"$shrext\"
3093 eval libname=\"$libname_spec\"
3096 if test "$module" = no; then
3097 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3101 if test "$need_lib_prefix" != no; then
3102 # Add the "lib" prefix for modules if required
3103 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3104 eval shared_ext=\"$shrext\"
3105 eval libname=\"$libname_spec\"
3107 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3112 if test -n "$objs"; then
3113 if test "$deplibs_check_method" != pass_all; then
3114 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3118 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3119 $echo "*** objects $objs is not portable!"
3120 libobjs="$libobjs $objs"
3124 if test "$dlself" != no; then
3125 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3129 if test "$#" -gt 2; then
3130 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3135 if test -z "$rpath"; then
3136 if test "$build_libtool_libs" = yes; then
3137 # Building a libtool convenience library.
3138 # Some compilers have problems with a `.al' extension so
3139 # convenience libraries should have the same extension an
3140 # archive normally would.
3141 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3142 build_libtool_libs=convenience
3146 if test -n "$vinfo"; then
3147 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3150 if test -n "$release"; then
3151 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3155 # Parse the version information argument.
3156 save_ifs="$IFS"; IFS=':'
3157 set dummy $vinfo 0 0 0
3160 if test -n "$8"; then
3161 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3166 # convert absolute version numbers to libtool ages
3167 # this retains compatibility with .la files and attempts
3168 # to make the code below a bit more comprehensible
3170 case $vinfo_number in
3174 number_revision="$4"
3176 # There are really only two kinds -- those that
3177 # use the current revision as the major version
3178 # and those that subtract age and use age as
3179 # a minor version. But, then there is irix
3180 # which has an extra 1 added just for fun
3182 case $version_type in
3183 darwin|linux|osf|windows)
3184 current=`expr $number_major + $number_minor`
3186 revision="$number_revision"
3188 freebsd-aout|freebsd-elf|sunos)
3189 current="$number_major"
3190 revision="$number_minor"
3194 current=`expr $number_major + $number_minor - 1`
3196 revision="$number_minor"
3207 # Check that each of the things are valid numbers.
3209 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3211 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3212 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3218 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3220 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3221 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3227 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3229 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3230 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3235 if test "$age" -gt "$current"; then
3236 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3237 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3241 # Calculate the version variables.
3245 case $version_type in
3249 # Like Linux, but with the current version available in
3250 # verstring for coding it into the library header
3251 major=.`expr $current - $age`
3252 versuffix="$major.$age.$revision"
3253 # Darwin ld doesn't like 0 for these options...
3254 minor_current=`expr $current + 1`
3255 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3260 versuffix=".$current.$revision";
3265 versuffix=".$current";
3269 major=`expr $current - $age + 1`
3271 case $version_type in
3272 nonstopux) verstring_prefix=nonstopux ;;
3273 *) verstring_prefix=sgi ;;
3275 verstring="$verstring_prefix$major.$revision"
3277 # Add in all the interfaces that we are compatible with.
3279 while test "$loop" -ne 0; do
3280 iface=`expr $revision - $loop`
3281 loop=`expr $loop - 1`
3282 verstring="$verstring_prefix$major.$iface:$verstring"
3285 # Before this point, $major must not contain `.'.
3287 versuffix="$major.$revision"
3291 major=.`expr $current - $age`
3292 versuffix="$major.$age.$revision"
3296 major=.`expr $current - $age`
3297 versuffix=".$current.$age.$revision"
3298 verstring="$current.$age.$revision"
3300 # Add in all the interfaces that we are compatible with.
3302 while test "$loop" -ne 0; do
3303 iface=`expr $current - $loop`
3304 loop=`expr $loop - 1`
3305 verstring="$verstring:${iface}.0"
3308 # Make executables depend on our current version.
3309 verstring="$verstring:${current}.0"
3314 versuffix=".$current.$revision"
3318 # Use '-' rather than '.', since we only want one
3319 # extension on DOS 8.3 filesystems.
3320 major=`expr $current - $age`
3325 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3326 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3331 # Clear the version info if we defaulted, and they specified a release.
3332 if test -z "$vinfo" && test -n "$release"; then
3334 case $version_type in
3336 # we can't check for "0.0" in archive_cmds due to quoting
3337 # problems, so we reset it completely
3344 if test "$need_version" = no; then
3351 # Remove version info from name if versioning should be avoided
3352 if test "$avoid_version" = yes && test "$need_version" = no; then
3358 # Check to see if the archive will have undefined symbols.
3359 if test "$allow_undefined" = yes; then
3360 if test "$allow_undefined_flag" = unsupported; then
3361 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3362 build_libtool_libs=no
3366 # Don't allow undefined symbols.
3367 allow_undefined_flag="$no_undefined_flag"
3371 if test "$mode" != relink; then
3372 # Remove our outputs, but don't remove object files since they
3373 # may have been created when compiling PIC objects.
3375 tempremovelist=`$echo "$output_objdir/*"`
3376 for p in $tempremovelist; do
3380 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3381 removelist="$removelist $p"
3386 if test -n "$removelist"; then
3387 $show "${rm}r $removelist"
3388 $run ${rm}r $removelist
3392 # Now set the variables for building old libraries.
3393 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3394 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3396 # Transform .lo files to .o files.
3397 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3400 # Eliminate all temporary directories.
3401 for path in $notinst_path; do
3402 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3403 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3404 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3407 if test -n "$xrpath"; then
3408 # If the user specified any rpath flags, then add them.
3410 for libdir in $xrpath; do
3411 temp_xrpath="$temp_xrpath -R$libdir"
3412 case "$finalize_rpath " in
3414 *) finalize_rpath="$finalize_rpath $libdir" ;;
3417 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3418 dependency_libs="$temp_xrpath $dependency_libs"
3422 # Make sure dlfiles contains only unique files that won't be dlpreopened
3423 old_dlfiles="$dlfiles"
3425 for lib in $old_dlfiles; do
3426 case " $dlprefiles $dlfiles " in
3428 *) dlfiles="$dlfiles $lib" ;;
3432 # Make sure dlprefiles contains only unique files
3433 old_dlprefiles="$dlprefiles"
3435 for lib in $old_dlprefiles; do
3436 case "$dlprefiles " in
3438 *) dlprefiles="$dlprefiles $lib" ;;
3442 if test "$build_libtool_libs" = yes; then
3443 if test -n "$rpath"; then
3445 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3446 # these systems don't actually have a c library (as such)!
3448 *-*-rhapsody* | *-*-darwin1.[012])
3449 # Rhapsody C library is in the System framework
3450 deplibs="$deplibs -framework System"
3453 # Don't link with libc until the a.out ld.so is fixed.
3455 *-*-openbsd* | *-*-freebsd*)
3456 # Do not include libc due to us having libc/libc_r.
3457 test "X$arg" = "X-lc" && continue
3460 # Add libc to deplibs on all other systems if necessary.
3461 if test "$build_libtool_need_lc" = "yes"; then
3462 deplibs="$deplibs -lc"
3468 # Transform deplibs into only deplibs that can be linked in shared.
3470 libname_save=$libname
3471 release_save=$release
3472 versuffix_save=$versuffix
3474 # I'm not sure if I'm treating the release correctly. I think
3475 # release should show up in the -l (ie -lgmp5) so we don't want to
3476 # add it in twice. Is that correct?
3482 case $deplibs_check_method in
3484 # Don't check for shared/static. Everything works.
3485 # This might be a little naive. We might want to check
3486 # whether the library exists or not. But this is on
3487 # osf3 & osf4 and I'm not really sure... Just
3488 # implementing what was already the behavior.
3492 # This code stresses the "libraries are programs" paradigm to its
3493 # limits. Maybe even breaks it. We compile a program, linking it
3494 # against the deplibs as a proxy for the library. Then we can check
3495 # whether they linked in statically or dynamically with ldd.
3497 cat > conftest.c <<EOF
3498 int main() { return 0; }
3501 $LTCC -o conftest conftest.c $deplibs
3502 if test "$?" -eq 0 ; then
3503 ldd_output=`ldd conftest`
3504 for i in $deplibs; do
3505 name="`expr $i : '-l\(.*\)'`"
3506 # If $name is empty we are operating on a -L argument.
3507 if test "$name" != "" && test "$name" -ne "0"; then
3508 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3509 case " $predeps $postdeps " in
3511 newdeplibs="$newdeplibs $i"
3516 if test -n "$i" ; then
3517 libname=`eval \\$echo \"$libname_spec\"`
3518 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3519 set dummy $deplib_matches
3521 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3522 newdeplibs="$newdeplibs $i"
3526 $echo "*** Warning: dynamic linker does not accept needed library $i."
3527 $echo "*** I have the capability to make that library automatically link in when"
3528 $echo "*** you link to this library. But I can only do this if you have a"
3529 $echo "*** shared version of the library, which I believe you do not have"
3530 $echo "*** because a test_compile did reveal that the linker did not use it for"
3531 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3535 newdeplibs="$newdeplibs $i"
3539 # Error occurred in the first compile. Let's try to salvage
3540 # the situation: Compile a separate program for each library.
3541 for i in $deplibs; do
3542 name="`expr $i : '-l\(.*\)'`"
3543 # If $name is empty we are operating on a -L argument.
3544 if test "$name" != "" && test "$name" != "0"; then
3546 $LTCC -o conftest conftest.c $i
3548 if test "$?" -eq 0 ; then
3549 ldd_output=`ldd conftest`
3550 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3551 case " $predeps $postdeps " in
3553 newdeplibs="$newdeplibs $i"
3558 if test -n "$i" ; then
3559 libname=`eval \\$echo \"$libname_spec\"`
3560 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3561 set dummy $deplib_matches
3563 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3564 newdeplibs="$newdeplibs $i"
3568 $echo "*** Warning: dynamic linker does not accept needed library $i."
3569 $echo "*** I have the capability to make that library automatically link in when"
3570 $echo "*** you link to this library. But I can only do this if you have a"
3571 $echo "*** shared version of the library, which you do not appear to have"
3572 $echo "*** because a test_compile did reveal that the linker did not use this one"
3573 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3579 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3580 $echo "*** make it link in! You will probably need to install it or some"
3581 $echo "*** library that it depends on before this library will be fully"
3582 $echo "*** functional. Installing it before continuing would be even better."
3585 newdeplibs="$newdeplibs $i"
3591 set dummy $deplibs_check_method
3592 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3593 for a_deplib in $deplibs; do
3594 name="`expr $a_deplib : '-l\(.*\)'`"
3595 # If $name is empty we are operating on a -L argument.
3596 if test "$name" != "" && test "$name" != "0"; then
3597 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3598 case " $predeps $postdeps " in
3600 newdeplibs="$newdeplibs $a_deplib"
3605 if test -n "$a_deplib" ; then
3606 libname=`eval \\$echo \"$libname_spec\"`
3607 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3608 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3609 for potent_lib in $potential_libs; do
3610 # Follow soft links.
3611 if ls -lLd "$potent_lib" 2>/dev/null \
3612 | grep " -> " >/dev/null; then
3615 # The statement above tries to avoid entering an
3616 # endless loop below, in case of cyclic links.
3617 # We might still enter an endless loop, since a link
3618 # loop can be closed while we follow links,
3620 potlib="$potent_lib"
3621 while test -h "$potlib" 2>/dev/null; do
3622 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3624 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3625 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3628 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3630 | $EGREP "$file_magic_regex" > /dev/null; then
3631 newdeplibs="$newdeplibs $a_deplib"
3638 if test -n "$a_deplib" ; then
3641 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3642 $echo "*** I have the capability to make that library automatically link in when"
3643 $echo "*** you link to this library. But I can only do this if you have a"
3644 $echo "*** shared version of the library, which you do not appear to have"
3645 $echo "*** because I did check the linker path looking for a file starting"
3646 if test -z "$potlib" ; then
3647 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3649 $echo "*** with $libname and none of the candidates passed a file format test"
3650 $echo "*** using a file magic. Last file checked: $potlib"
3654 # Add a -L argument.
3655 newdeplibs="$newdeplibs $a_deplib"
3657 done # Gone through all deplibs.
3660 set dummy $deplibs_check_method
3661 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3662 for a_deplib in $deplibs; do
3663 name="`expr $a_deplib : '-l\(.*\)'`"
3664 # If $name is empty we are operating on a -L argument.
3665 if test -n "$name" && test "$name" != "0"; then
3666 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3667 case " $predeps $postdeps " in
3669 newdeplibs="$newdeplibs $a_deplib"
3674 if test -n "$a_deplib" ; then
3675 libname=`eval \\$echo \"$libname_spec\"`
3676 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3677 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3678 for potent_lib in $potential_libs; do
3679 potlib="$potent_lib" # see symlink-check above in file_magic test
3680 if eval $echo \"$potent_lib\" 2>/dev/null \
3682 | $EGREP "$match_pattern_regex" > /dev/null; then
3683 newdeplibs="$newdeplibs $a_deplib"
3690 if test -n "$a_deplib" ; then
3693 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3694 $echo "*** I have the capability to make that library automatically link in when"
3695 $echo "*** you link to this library. But I can only do this if you have a"
3696 $echo "*** shared version of the library, which you do not appear to have"
3697 $echo "*** because I did check the linker path looking for a file starting"
3698 if test -z "$potlib" ; then
3699 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3701 $echo "*** with $libname and none of the candidates passed a file format test"
3702 $echo "*** using a regex pattern. Last file checked: $potlib"
3706 # Add a -L argument.
3707 newdeplibs="$newdeplibs $a_deplib"
3709 done # Gone through all deplibs.
3713 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3714 -e 's/ -[LR][^ ]*//g'`
3715 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3716 for i in $predeps $postdeps ; do
3717 # can't use Xsed below, because $i might contain '/'
3718 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3721 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3722 | grep . >/dev/null; then
3724 if test "X$deplibs_check_method" = "Xnone"; then
3725 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3727 $echo "*** Warning: inter-library dependencies are not known to be supported."
3729 $echo "*** All declared inter-library dependencies are being dropped."
3734 versuffix=$versuffix_save
3736 release=$release_save
3737 libname=$libname_save
3741 *-*-rhapsody* | *-*-darwin1.[012])
3742 # On Rhapsody replace the C library is the System framework
3743 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3747 if test "$droppeddeps" = yes; then
3748 if test "$module" = yes; then
3750 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3751 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3752 $echo "*** a static module, that should work as long as the dlopening"
3753 $echo "*** application is linked with the -dlopen flag."
3754 if test -z "$global_symbol_pipe"; then
3756 $echo "*** However, this would only work if libtool was able to extract symbol"
3757 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3758 $echo "*** not find such a program. So, this module is probably useless."
3759 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3761 if test "$build_old_libs" = no; then
3762 oldlibs="$output_objdir/$libname.$libext"
3763 build_libtool_libs=module
3766 build_libtool_libs=no
3769 $echo "*** The inter-library dependencies that have been dropped here will be"
3770 $echo "*** automatically added whenever a program is linked with this library"
3771 $echo "*** or is declared to -dlopen it."
3773 if test "$allow_undefined" = no; then
3775 $echo "*** Since this library must not contain undefined symbols,"
3776 $echo "*** because either the platform does not support them or"
3777 $echo "*** it was explicitly requested with -no-undefined,"
3778 $echo "*** libtool will only create a static version of it."
3779 if test "$build_old_libs" = no; then
3780 oldlibs="$output_objdir/$libname.$libext"
3781 build_libtool_libs=module
3784 build_libtool_libs=no
3789 # Done checking deplibs!
3793 # All the library-specific variables (install_libdir is set above).
3798 # Test again, we may have decided not to build it any more
3799 if test "$build_libtool_libs" = yes; then
3800 if test "$hardcode_into_libs" = yes; then
3801 # Hardcode the library paths
3804 rpath="$finalize_rpath"
3805 test "$mode" != relink && rpath="$compile_rpath$rpath"
3806 for libdir in $rpath; do
3807 if test -n "$hardcode_libdir_flag_spec"; then
3808 if test -n "$hardcode_libdir_separator"; then
3809 if test -z "$hardcode_libdirs"; then
3810 hardcode_libdirs="$libdir"
3812 # Just accumulate the unique libdirs.
3813 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3814 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3817 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3822 eval flag=\"$hardcode_libdir_flag_spec\"
3823 dep_rpath="$dep_rpath $flag"
3825 elif test -n "$runpath_var"; then
3826 case "$perm_rpath " in
3828 *) perm_rpath="$perm_rpath $libdir" ;;
3832 # Substitute the hardcoded libdirs into the rpath.
3833 if test -n "$hardcode_libdir_separator" &&
3834 test -n "$hardcode_libdirs"; then
3835 libdir="$hardcode_libdirs"
3836 if test -n "$hardcode_libdir_flag_spec_ld"; then
3837 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3839 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3842 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3843 # We should set the runpath_var.
3845 for dir in $perm_rpath; do
3848 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3850 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3853 shlibpath="$finalize_shlibpath"
3854 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3855 if test -n "$shlibpath"; then
3856 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3859 # Get the real and link names of the library.
3860 eval shared_ext=\"$shrext\"
3861 eval library_names=\"$library_names_spec\"
3862 set dummy $library_names
3866 if test -n "$soname_spec"; then
3867 eval soname=\"$soname_spec\"
3871 if test -z "$dlname"; then
3875 lib="$output_objdir/$realname"
3878 linknames="$linknames $link"
3881 # Use standard objects if they are pic
3882 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3884 # Prepare the list of exported symbols
3885 if test -z "$export_symbols"; then
3886 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3887 $show "generating symbol list for \`$libname.la'"
3888 export_symbols="$output_objdir/$libname.exp"
3889 $run $rm $export_symbols
3890 eval cmds=\"$export_symbols_cmds\"
3891 save_ifs="$IFS"; IFS='~'
3892 for cmd in $cmds; do
3894 if len=`expr "X$cmd" : ".*"` &&
3895 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3897 $run eval "$cmd" || exit $?
3898 skipped_export=false
3900 # The command line is too long to execute in one step.
3901 $show "using reloadable object file for export list..."
3906 if test -n "$export_symbols_regex"; then
3907 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3908 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3909 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3910 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3915 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3916 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3920 for test_deplib in $deplibs; do
3921 case " $convenience " in
3922 *" $test_deplib "*) ;;
3924 tmp_deplibs="$tmp_deplibs $test_deplib"
3928 deplibs="$tmp_deplibs"
3930 if test -n "$convenience"; then
3931 if test -n "$whole_archive_flag_spec"; then
3932 save_libobjs=$libobjs
3933 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3935 gentop="$output_objdir/${outputname}x"
3936 $show "${rm}r $gentop"
3937 $run ${rm}r "$gentop"
3938 $show "$mkdir $gentop"
3939 $run $mkdir "$gentop"
3941 if test "$status" -ne 0 && test ! -d "$gentop"; then
3944 generated="$generated $gentop"
3946 for xlib in $convenience; do
3947 # Extract the objects.
3949 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3950 *) xabs=`pwd`"/$xlib" ;;
3952 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3953 xdir="$gentop/$xlib"
3955 $show "${rm}r $xdir"
3957 $show "$mkdir $xdir"
3960 if test "$status" -ne 0 && test ! -d "$xdir"; then
3963 # We will extract separately just the conflicting names and we will no
3964 # longer touch any unique names. It is faster to leave these extract
3965 # automatically by $AR in one run.
3966 $show "(cd $xdir && $AR x $xabs)"
3967 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3968 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3971 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3972 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3973 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3976 while test "$i" -le "$count"
3978 # Put our $i before any first dot (extension)
3979 # Never overwrite any file
3981 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3983 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3985 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3986 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3992 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3997 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3998 eval flag=\"$thread_safe_flag_spec\"
3999 linker_flags="$linker_flags $flag"
4002 # Make a backup of the uninstalled library when relinking
4003 if test "$mode" = relink; then
4004 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4007 # Do each of the archive commands.
4008 if test "$module" = yes && test -n "$module_cmds" ; then
4009 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4010 eval cmds=\"$module_expsym_cmds\"
4012 eval cmds=\"$module_cmds\"
4015 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4016 eval cmds=\"$archive_expsym_cmds\"
4018 eval cmds=\"$archive_cmds\"
4022 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
4023 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4026 # The command line is too long to link in one step, link piecewise.
4027 $echo "creating reloadable object files..."
4029 # Save the value of $output and $libobjs because we want to
4030 # use them later. If we have whole_archive_flag_spec, we
4031 # want to use save_libobjs as it was before
4032 # whole_archive_flag_spec was expanded, because we can't
4033 # assume the linker understands whole_archive_flag_spec.
4034 # This may have to be revisited, in case too many
4035 # convenience libraries get linked in and end up exceeding
4037 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4038 save_libobjs=$libobjs
4042 # Clear the reloadable object creation command queue and
4043 # initialize k to one.
4050 output=$output_objdir/$save_output-${k}.$objext
4051 # Loop over the list of objects to be linked.
4052 for obj in $save_libobjs
4054 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4055 if test "X$objlist" = X ||
4056 { len=`expr "X$test_cmds" : ".*"` &&
4057 test "$len" -le "$max_cmd_len"; }; then
4058 objlist="$objlist $obj"
4060 # The command $test_cmds is almost too long, add a
4061 # command to the queue.
4062 if test "$k" -eq 1 ; then
4063 # The first file doesn't have a previous command to add.
4064 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4066 # All subsequent reloadable object files will link in
4067 # the last one created.
4068 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4070 last_robj=$output_objdir/$save_output-${k}.$objext
4072 output=$output_objdir/$save_output-${k}.$objext
4077 # Handle the remaining objects by creating one last
4078 # reloadable object file. All subsequent reloadable object
4079 # files will link in the last one created.
4080 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4081 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4083 if ${skipped_export-false}; then
4084 $show "generating symbol list for \`$libname.la'"
4085 export_symbols="$output_objdir/$libname.exp"
4086 $run $rm $export_symbols
4088 # Append the command to create the export file.
4089 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4092 # Set up a command to remove the reloadale object files
4093 # after they are used.
4095 while test "$i" -lt "$k"
4098 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
4101 $echo "creating a temporary reloadable object file: $output"
4103 # Loop through the commands generated above and execute them.
4104 save_ifs="$IFS"; IFS='~'
4105 for cmd in $concat_cmds; do
4108 $run eval "$cmd" || exit $?
4113 # Restore the value of output.
4116 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4117 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4119 # Expand the library linking commands again to reset the
4120 # value of $libobjs for piecewise linking.
4122 # Do each of the archive commands.
4123 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4124 eval cmds=\"$archive_expsym_cmds\"
4126 eval cmds=\"$archive_cmds\"
4129 # Append the command to remove the reloadable object files
4130 # to the just-reset $cmds.
4131 eval cmds=\"\$cmds~$rm $delfiles\"
4133 save_ifs="$IFS"; IFS='~'
4134 for cmd in $cmds; do
4137 $run eval "$cmd" || exit $?
4141 # Restore the uninstalled library and exit
4142 if test "$mode" = relink; then
4143 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4147 # Create links to the real library.
4148 for linkname in $linknames; do
4149 if test "$realname" != "$linkname"; then
4150 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4151 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4155 # If -module or -export-dynamic was specified, set the dlname.
4156 if test "$module" = yes || test "$export_dynamic" = yes; then
4157 # On all known operating systems, these are identical.
4164 if test -n "$deplibs"; then
4165 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4168 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4169 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4172 if test -n "$rpath"; then
4173 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4176 if test -n "$xrpath"; then
4177 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4180 if test -n "$vinfo"; then
4181 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4184 if test -n "$release"; then
4185 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4190 if test -n "$objs$old_deplibs"; then
4191 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4195 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4203 # Delete the old objects.
4204 $run $rm $obj $libobj
4206 # Objects from convenience libraries. This assumes
4207 # single-version convenience libraries. Whenever we create
4208 # different ones for PIC/non-PIC, this we'll have to duplicate
4212 # reload_cmds runs $LD directly, so let us get rid of
4213 # -Wl from whole_archive_flag_spec
4216 if test -n "$convenience"; then
4217 if test -n "$whole_archive_flag_spec"; then
4218 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4220 gentop="$output_objdir/${obj}x"
4221 $show "${rm}r $gentop"
4222 $run ${rm}r "$gentop"
4223 $show "$mkdir $gentop"
4224 $run $mkdir "$gentop"
4226 if test "$status" -ne 0 && test ! -d "$gentop"; then
4229 generated="$generated $gentop"
4231 for xlib in $convenience; do
4232 # Extract the objects.
4234 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4235 *) xabs=`pwd`"/$xlib" ;;
4237 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4238 xdir="$gentop/$xlib"
4240 $show "${rm}r $xdir"
4242 $show "$mkdir $xdir"
4245 if test "$status" -ne 0 && test ! -d "$xdir"; then
4248 # We will extract separately just the conflicting names and we will no
4249 # longer touch any unique names. It is faster to leave these extract
4250 # automatically by $AR in one run.
4251 $show "(cd $xdir && $AR x $xabs)"
4252 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4253 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4256 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4257 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4258 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4261 while test "$i" -le "$count"
4263 # Put our $i before any first dot (extension)
4264 # Never overwrite any file
4266 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4268 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4270 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4271 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4277 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4282 # Create the old-style object.
4283 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
4286 eval cmds=\"$reload_cmds\"
4287 save_ifs="$IFS"; IFS='~'
4288 for cmd in $cmds; do
4291 $run eval "$cmd" || exit $?
4295 # Exit if we aren't doing a library object file.
4296 if test -z "$libobj"; then
4297 if test -n "$gentop"; then
4298 $show "${rm}r $gentop"
4305 if test "$build_libtool_libs" != yes; then
4306 if test -n "$gentop"; then
4307 $show "${rm}r $gentop"
4311 # Create an invalid libtool object if no PIC, so that we don't
4312 # accidentally link it into a program.
4313 # $show "echo timestamp > $libobj"
4314 # $run eval "echo timestamp > $libobj" || exit $?
4318 if test -n "$pic_flag" || test "$pic_mode" != default; then
4319 # Only do commands if we really have different PIC objects.
4320 reload_objs="$libobjs $reload_conv_objs"
4322 eval cmds=\"$reload_cmds\"
4323 save_ifs="$IFS"; IFS='~'
4324 for cmd in $cmds; do
4327 $run eval "$cmd" || exit $?
4332 if test -n "$gentop"; then
4333 $show "${rm}r $gentop"
4342 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4344 if test -n "$vinfo"; then
4345 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4348 if test -n "$release"; then
4349 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4352 if test "$preload" = yes; then
4353 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4354 test "$dlopen_self_static" = unknown; then
4355 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4360 *-*-rhapsody* | *-*-darwin1.[012])
4361 # On Rhapsody replace the C library is the System framework
4362 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4363 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4369 # Don't allow lazy linking, it breaks C++ global constructors
4370 if test "$tagname" = CXX ; then
4371 compile_command="$compile_command ${wl}-bind_at_load"
4372 finalize_command="$finalize_command ${wl}-bind_at_load"
4377 compile_command="$compile_command $compile_deplibs"
4378 finalize_command="$finalize_command $finalize_deplibs"
4380 if test -n "$rpath$xrpath"; then
4381 # If the user specified any rpath flags, then add them.
4382 for libdir in $rpath $xrpath; do
4383 # This is the magic to use -rpath.
4384 case "$finalize_rpath " in
4386 *) finalize_rpath="$finalize_rpath $libdir" ;;
4391 # Now hardcode the library paths
4394 for libdir in $compile_rpath $finalize_rpath; do
4395 if test -n "$hardcode_libdir_flag_spec"; then
4396 if test -n "$hardcode_libdir_separator"; then
4397 if test -z "$hardcode_libdirs"; then
4398 hardcode_libdirs="$libdir"
4400 # Just accumulate the unique libdirs.
4401 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4402 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4405 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4410 eval flag=\"$hardcode_libdir_flag_spec\"
4411 rpath="$rpath $flag"
4413 elif test -n "$runpath_var"; then
4414 case "$perm_rpath " in
4416 *) perm_rpath="$perm_rpath $libdir" ;;
4420 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4421 case :$dllsearchpath: in
4423 *) dllsearchpath="$dllsearchpath:$libdir";;
4428 # Substitute the hardcoded libdirs into the rpath.
4429 if test -n "$hardcode_libdir_separator" &&
4430 test -n "$hardcode_libdirs"; then
4431 libdir="$hardcode_libdirs"
4432 eval rpath=\" $hardcode_libdir_flag_spec\"
4434 compile_rpath="$rpath"
4438 for libdir in $finalize_rpath; do
4439 if test -n "$hardcode_libdir_flag_spec"; then
4440 if test -n "$hardcode_libdir_separator"; then
4441 if test -z "$hardcode_libdirs"; then
4442 hardcode_libdirs="$libdir"
4444 # Just accumulate the unique libdirs.
4445 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4446 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4449 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4454 eval flag=\"$hardcode_libdir_flag_spec\"
4455 rpath="$rpath $flag"
4457 elif test -n "$runpath_var"; then
4458 case "$finalize_perm_rpath " in
4460 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4464 # Substitute the hardcoded libdirs into the rpath.
4465 if test -n "$hardcode_libdir_separator" &&
4466 test -n "$hardcode_libdirs"; then
4467 libdir="$hardcode_libdirs"
4468 eval rpath=\" $hardcode_libdir_flag_spec\"
4470 finalize_rpath="$rpath"
4472 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4473 # Transform all the library objects into standard objects.
4474 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4475 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4479 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4480 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4481 dlsyms="${outputname}S.c"
4483 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4487 if test -n "$dlsyms"; then
4491 # Discover the nlist of each of the dlfiles.
4492 nlist="$output_objdir/${outputname}.nm"
4494 $show "$rm $nlist ${nlist}S ${nlist}T"
4495 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4497 # Parse the name list into a source file.
4498 $show "creating $output_objdir/$dlsyms"
4500 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4501 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4502 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4508 /* Prevent the only kind of declaration conflicts we can make. */
4509 #define lt_preloaded_symbols some_other_symbol
4511 /* External symbol declarations for the compiler. */\
4514 if test "$dlself" = yes; then
4515 $show "generating symbol list for \`$output'"
4517 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4519 # Add our own program objects to the symbol list.
4520 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4521 for arg in $progfiles; do
4522 $show "extracting global C symbols from \`$arg'"
4523 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4526 if test -n "$exclude_expsyms"; then
4527 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4528 $run eval '$mv "$nlist"T "$nlist"'
4531 if test -n "$export_symbols_regex"; then
4532 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4533 $run eval '$mv "$nlist"T "$nlist"'
4536 # Prepare the list of exported symbols
4537 if test -z "$export_symbols"; then
4538 export_symbols="$output_objdir/$output.exp"
4539 $run $rm $export_symbols
4540 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4542 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4543 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4544 $run eval 'mv "$nlist"T "$nlist"'
4548 for arg in $dlprefiles; do
4549 $show "extracting global C symbols from \`$arg'"
4550 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4551 $run eval '$echo ": $name " >> "$nlist"'
4552 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4555 if test -z "$run"; then
4556 # Make sure we have at least an empty file.
4557 test -f "$nlist" || : > "$nlist"
4559 if test -n "$exclude_expsyms"; then
4560 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4561 $mv "$nlist"T "$nlist"
4564 # Try sorting and uniquifying the output.
4565 if grep -v "^: " < "$nlist" |
4566 if sort -k 3 </dev/null >/dev/null 2>&1; then
4571 uniq > "$nlist"S; then
4574 grep -v "^: " < "$nlist" > "$nlist"S
4577 if test -f "$nlist"S; then
4578 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4580 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4583 $echo >> "$output_objdir/$dlsyms" "\
4585 #undef lt_preloaded_symbols
4587 #if defined (__STDC__) && __STDC__
4588 # define lt_ptr void *
4590 # define lt_ptr char *
4594 /* The mapping between symbol names and symbols. */
4599 lt_preloaded_symbols[] =
4603 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4605 $echo >> "$output_objdir/$dlsyms" "\
4609 /* This works around a problem in FreeBSD linker */
4610 #ifdef FREEBSD_WORKAROUND
4611 static const void *lt_preloaded_setup() {
4612 return lt_preloaded_symbols;
4622 pic_flag_for_symtable=
4624 # compiling the symbol table file with pic_flag works around
4625 # a FreeBSD bug that causes programs to crash when -lm is
4626 # linked before any other PIC object. But we must not use
4627 # pic_flag when linking with -static. The problem exists in
4628 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4629 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4630 case "$compile_command " in
4632 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4635 case "$compile_command " in
4637 *) pic_flag_for_symtable=" $pic_flag";;
4641 # Now compile the dynamic symbol file.
4642 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4643 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4645 # Clean up the generated files.
4646 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4647 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4649 # Transform the symbol file into the correct name.
4650 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4651 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4654 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4659 # We keep going just in case the user didn't refer to
4660 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4661 # really was required.
4663 # Nullify the symbol file.
4664 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4665 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4668 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4669 # Replace the output file specification.
4670 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4671 link_command="$compile_command$compile_rpath"
4673 # We have no uninstalled library dependencies, so finalize right now.
4674 $show "$link_command"
4675 $run eval "$link_command"
4678 # Delete the generated files.
4679 if test -n "$dlsyms"; then
4680 $show "$rm $output_objdir/${outputname}S.${objext}"
4681 $run $rm "$output_objdir/${outputname}S.${objext}"
4687 if test -n "$shlibpath_var"; then
4688 # We should set the shlibpath_var
4690 for dir in $temp_rpath; do
4692 [\\/]* | [A-Za-z]:[\\/]*)
4697 # Relative path: add a thisdir entry.
4698 rpath="$rpath\$thisdir/$dir:"
4705 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4706 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4708 if test -n "$finalize_shlibpath"; then
4709 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4714 if test -n "$runpath_var"; then
4715 if test -n "$perm_rpath"; then
4716 # We should set the runpath_var.
4718 for dir in $perm_rpath; do
4721 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4723 if test -n "$finalize_perm_rpath"; then
4724 # We should set the runpath_var.
4726 for dir in $finalize_perm_rpath; do
4729 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4733 if test "$no_install" = yes; then
4734 # We don't need to create a wrapper script.
4735 link_command="$compile_var$compile_command$compile_rpath"
4736 # Replace the output file specification.
4737 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4738 # Delete the old output file.
4740 # Link the executable and exit
4741 $show "$link_command"
4742 $run eval "$link_command" || exit $?
4746 if test "$hardcode_action" = relink; then
4747 # Fast installation is not supported
4748 link_command="$compile_var$compile_command$compile_rpath"
4749 relink_command="$finalize_var$finalize_command$finalize_rpath"
4751 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4752 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4754 if test "$fast_install" != no; then
4755 link_command="$finalize_var$compile_command$finalize_rpath"
4756 if test "$fast_install" = yes; then
4757 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4759 # fast_install is set to needless
4763 link_command="$compile_var$compile_command$compile_rpath"
4764 relink_command="$finalize_var$finalize_command$finalize_rpath"
4768 # Replace the output file specification.
4769 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4771 # Delete the old output files.
4772 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4774 $show "$link_command"
4775 $run eval "$link_command" || exit $?
4777 # Now create the wrapper script.
4778 $show "creating $output"
4780 # Quote the relink command for shipping.
4781 if test -n "$relink_command"; then
4782 # Preserve any variables that may affect compiler behavior
4783 for var in $variables_saved_for_relink; do
4784 if eval test -z \"\${$var+set}\"; then
4785 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4786 elif eval var_value=\$$var; test -z "$var_value"; then
4787 relink_command="$var=; export $var; $relink_command"
4789 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4790 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4793 relink_command="(cd `pwd`; $relink_command)"
4794 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4797 # Quote $echo for shipping.
4798 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4800 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4801 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4803 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4805 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4808 # Only actually do things if our run command is non-null.
4809 if test -z "$run"; then
4810 # win32 will think the script is a binary if it has
4811 # a .exe suffix, so we strip it off here.
4813 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4815 # test for cygwin because mv fails w/o .exe extensions
4819 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4823 *cygwin* | *mingw* )
4824 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4825 cwrapper=`$echo ${output}.exe`
4826 $rm $cwrappersource $cwrapper
4827 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4829 cat > $cwrappersource <<EOF
4831 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4832 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4834 The $output program cannot be directly executed until all the libtool
4835 libraries that it depends on are installed.
4837 This wrapper executable should never be moved out of the build directory.
4838 If it is, it will not operate correctly.
4840 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4841 but could eventually absorb all of the scripts functionality and
4842 exec $objdir/$outputname directly.
4845 cat >> $cwrappersource<<"EOF"
4853 #if defined(PATH_MAX)
4854 # define LT_PATHMAX PATH_MAX
4855 #elif defined(MAXPATHLEN)
4856 # define LT_PATHMAX MAXPATHLEN
4858 # define LT_PATHMAX 1024
4861 #ifndef DIR_SEPARATOR
4862 #define DIR_SEPARATOR '/'
4865 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4867 #define HAVE_DOS_BASED_FILE_SYSTEM
4868 #ifndef DIR_SEPARATOR_2
4869 #define DIR_SEPARATOR_2 '\\'
4873 #ifndef DIR_SEPARATOR_2
4874 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4875 #else /* DIR_SEPARATOR_2 */
4876 # define IS_DIR_SEPARATOR(ch) \
4877 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4878 #endif /* DIR_SEPARATOR_2 */
4880 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4881 #define XFREE(stale) do { \
4882 if (stale) { free ((void *) stale); stale = 0; } \
4885 const char *program_name = NULL;
4887 void * xmalloc (size_t num);
4888 char * xstrdup (const char *string);
4889 char * basename (const char *name);
4890 char * fnqualify(const char *path);
4891 char * strendzap(char *str, const char *pat);
4892 void lt_fatal (const char *message, ...);
4895 main (int argc, char *argv[])
4900 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4901 newargz = XMALLOC(char *, argc+2);
4904 cat >> $cwrappersource <<EOF
4905 newargz[0] = "$SHELL";
4908 cat >> $cwrappersource <<"EOF"
4909 newargz[1] = fnqualify(argv[0]);
4910 /* we know the script has the same name, without the .exe */
4911 /* so make sure newargz[1] doesn't end in .exe */
4912 strendzap(newargz[1],".exe");
4913 for (i = 1; i < argc; i++)
4914 newargz[i+1] = xstrdup(argv[i]);
4915 newargz[argc+1] = NULL;
4918 cat >> $cwrappersource <<EOF
4919 execv("$SHELL",newargz);
4922 cat >> $cwrappersource <<"EOF"
4926 xmalloc (size_t num)
4928 void * p = (void *) malloc (num);
4930 lt_fatal ("Memory exhausted");
4936 xstrdup (const char *string)
4938 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4943 basename (const char *name)
4947 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4948 /* Skip over the disk name in MSDOS pathnames. */
4949 if (isalpha (name[0]) && name[1] == ':')
4953 for (base = name; *name; name++)
4954 if (IS_DIR_SEPARATOR (*name))
4956 return (char *) base;
4960 fnqualify(const char *path)
4964 char tmp[LT_PATHMAX + 1];
4966 assert(path != NULL);
4968 /* Is it qualified already? */
4969 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4970 if (isalpha (path[0]) && path[1] == ':')
4971 return xstrdup (path);
4973 if (IS_DIR_SEPARATOR (path[0]))
4974 return xstrdup (path);
4976 /* prepend the current directory */
4977 /* doesn't handle '~' */
4978 if (getcwd (tmp, LT_PATHMAX) == NULL)
4979 lt_fatal ("getcwd failed");
4980 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4981 p = XMALLOC(char, size);
4982 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4987 strendzap(char *str, const char *pat)
4991 assert(str != NULL);
4992 assert(pat != NULL);
4995 patlen = strlen(pat);
4999 str += len - patlen;
5000 if (strcmp(str, pat) == 0)
5007 lt_error_core (int exit_status, const char * mode,
5008 const char * message, va_list ap)
5010 fprintf (stderr, "%s: %s: ", program_name, mode);
5011 vfprintf (stderr, message, ap);
5012 fprintf (stderr, ".\n");
5014 if (exit_status >= 0)
5019 lt_fatal (const char *message, ...)
5022 va_start (ap, message);
5023 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5027 # we should really use a build-platform specific compiler
5028 # here, but OTOH, the wrappers (shell script and this C one)
5029 # are only useful if you want to execute the "real" binary.
5030 # Since the "real" binary is built for $host, then this
5031 # wrapper might as well be built for $host, too.
5032 $run $LTCC -s -o $cwrapper $cwrappersource
5036 trap "$rm $output; exit 1" 1 2 15
5041 # $output - temporary wrapper script for $objdir/$outputname
5042 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5044 # The $output program cannot be directly executed until all the libtool
5045 # libraries that it depends on are installed.
5047 # This wrapper script should never be moved out of the build directory.
5048 # If it is, it will not operate correctly.
5050 # Sed substitution that helps us do robust quoting. It backslashifies
5051 # metacharacters that are still active within double-quoted strings.
5052 Xsed='${SED} -e 1s/^X//'
5053 sed_quote_subst='$sed_quote_subst'
5055 # The HP-UX ksh and POSIX shell print the target directory to stdout
5057 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
5059 relink_command=\"$relink_command\"
5061 # This environment variable determines our operation mode.
5062 if test \"\$libtool_install_magic\" = \"$magic\"; then
5063 # install mode needs the following variable:
5064 notinst_deplibs='$notinst_deplibs'
5066 # When we are sourced in execute mode, \$file and \$echo are already set.
5067 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5070 # Make sure echo works.
5071 if test \"X\$1\" = X--no-reexec; then
5072 # Discard the --no-reexec flag, and continue.
5074 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5075 # Yippee, \$echo works!
5078 # Restart under the correct shell, and then maybe \$echo will work.
5079 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5085 # Find the directory that this script lives in.
5086 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5087 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5089 # Follow symbolic links until we get to the real thisdir.
5090 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5091 while test -n \"\$file\"; do
5092 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5094 # If there was a directory component, then change thisdir.
5095 if test \"x\$destdir\" != \"x\$file\"; then
5096 case \"\$destdir\" in
5097 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5098 *) thisdir=\"\$thisdir/\$destdir\" ;;
5102 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5103 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5106 # Try to get the absolute directory name.
5107 absdir=\`cd \"\$thisdir\" && pwd\`
5108 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5111 if test "$fast_install" = yes; then
5113 program=lt-'$outputname'$exeext
5114 progdir=\"\$thisdir/$objdir\"
5116 if test ! -f \"\$progdir/\$program\" || \\
5117 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5118 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5120 file=\"\$\$-\$program\"
5122 if test ! -d \"\$progdir\"; then
5123 $mkdir \"\$progdir\"
5125 $rm \"\$progdir/\$file\"
5130 # relink executable if necessary
5131 if test -n \"\$relink_command\"; then
5132 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5134 $echo \"\$relink_command_output\" >&2
5135 $rm \"\$progdir/\$file\"
5140 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5141 { $rm \"\$progdir/\$program\";
5142 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5143 $rm \"\$progdir/\$file\"
5147 program='$outputname'
5148 progdir=\"\$thisdir/$objdir\"
5154 if test -f \"\$progdir/\$program\"; then"
5156 # Export our shlibpath_var if we have one.
5157 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5159 # Add our own library path to $shlibpath_var
5160 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5162 # Some systems cannot cope with colon-terminated $shlibpath_var
5163 # The second colon is a workaround for a bug in BeOS R4 sed
5164 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5166 export $shlibpath_var
5170 # fixup the dll searchpath if we need to.
5171 if test -n "$dllsearchpath"; then
5173 # Add the dll search path components to the executable PATH
5174 PATH=$dllsearchpath:\$PATH
5179 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5180 # Run the actual program with our arguments.
5183 # Backslashes separate directories on plain windows
5184 *-*-mingw | *-*-os2*)
5186 exec \$progdir\\\\\$program \${1+\"\$@\"}
5192 exec \$progdir/\$program \${1+\"\$@\"}
5197 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5201 # The program doesn't exist.
5202 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5203 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5204 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5215 # See if we need to build an old-fashioned archive.
5216 for oldlib in $oldlibs; do
5218 if test "$build_libtool_libs" = convenience; then
5219 oldobjs="$libobjs_save"
5220 addlibs="$convenience"
5221 build_libtool_libs=no
5223 if test "$build_libtool_libs" = module; then
5224 oldobjs="$libobjs_save"
5225 build_libtool_libs=no
5227 oldobjs="$old_deplibs $non_pic_objects"
5229 addlibs="$old_convenience"
5232 if test -n "$addlibs"; then
5233 gentop="$output_objdir/${outputname}x"
5234 $show "${rm}r $gentop"
5235 $run ${rm}r "$gentop"
5236 $show "$mkdir $gentop"
5237 $run $mkdir "$gentop"
5239 if test "$status" -ne 0 && test ! -d "$gentop"; then
5242 generated="$generated $gentop"
5244 # Add in members from convenience archives.
5245 for xlib in $addlibs; do
5246 # Extract the objects.
5248 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5249 *) xabs=`pwd`"/$xlib" ;;
5251 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5252 xdir="$gentop/$xlib"
5254 $show "${rm}r $xdir"
5256 $show "$mkdir $xdir"
5259 if test "$status" -ne 0 && test ! -d "$xdir"; then
5262 # We will extract separately just the conflicting names and we will no
5263 # longer touch any unique names. It is faster to leave these extract
5264 # automatically by $AR in one run.
5265 $show "(cd $xdir && $AR x $xabs)"
5266 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5267 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5270 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5271 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5272 $AR t "$xabs" | sort | uniq -cd | while read -r count name
5275 while test "$i" -le "$count"
5277 # Put our $i before any first dot (extension)
5278 # Never overwrite any file
5280 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5282 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5284 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5285 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5291 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5295 # Do each command in the archive commands.
5296 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5297 eval cmds=\"$old_archive_from_new_cmds\"
5299 eval cmds=\"$old_archive_cmds\"
5301 if len=`expr "X$cmds" : ".*"` &&
5302 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5305 # the command line is too long to link in one step, link in parts
5306 $echo "using piecewise archive linking..."
5311 save_oldobjs=$oldobjs
5312 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5313 # encoded into archives. This makes 'ar r' malfunction in
5314 # this piecewise linking case whenever conflicting object
5315 # names appear in distinct ar calls; check, warn and compensate.
5316 if (for obj in $save_oldobjs
5318 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5319 done | sort | sort -uc >/dev/null 2>&1); then
5322 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5323 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5326 # Is there a better way of finding the last object in the list?
5327 for obj in $save_oldobjs
5331 for obj in $save_oldobjs
5333 oldobjs="$objlist $obj"
5334 objlist="$objlist $obj"
5335 eval test_cmds=\"$old_archive_cmds\"
5336 if len=`expr "X$test_cmds" : ".*"` &&
5337 test "$len" -le "$max_cmd_len"; then
5340 # the above command should be used before it gets too long
5342 if test "$obj" = "$last_oldobj" ; then
5345 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5346 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5352 if test "X$oldobjs" = "X" ; then
5353 eval cmds=\"\$concat_cmds\"
5355 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5359 save_ifs="$IFS"; IFS='~'
5360 for cmd in $cmds; do
5363 $run eval "$cmd" || exit $?
5368 if test -n "$generated"; then
5369 $show "${rm}r$generated"
5370 $run ${rm}r$generated
5373 # Now create the libtool archive.
5377 test "$build_old_libs" = yes && old_library="$libname.$libext"
5378 $show "creating $output"
5380 # Preserve any variables that may affect compiler behavior
5381 for var in $variables_saved_for_relink; do
5382 if eval test -z \"\${$var+set}\"; then
5383 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5384 elif eval var_value=\$$var; test -z "$var_value"; then
5385 relink_command="$var=; export $var; $relink_command"
5387 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5388 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5391 # Quote the link command for shipping.
5392 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5393 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5395 # Only create the output if not a dry run.
5396 if test -z "$run"; then
5397 for installed in no yes; do
5398 if test "$installed" = yes; then
5399 if test -z "$install_libdir"; then
5402 output="$output_objdir/$outputname"i
5403 # Replace all uninstalled libtool libraries with the installed ones
5405 for deplib in $dependency_libs; do
5408 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5409 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5410 if test -z "$libdir"; then
5411 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5414 newdependency_libs="$newdependency_libs $libdir/$name"
5416 *) newdependency_libs="$newdependency_libs $deplib" ;;
5419 dependency_libs="$newdependency_libs"
5421 for lib in $dlfiles; do
5422 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5423 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5424 if test -z "$libdir"; then
5425 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5428 newdlfiles="$newdlfiles $libdir/$name"
5430 dlfiles="$newdlfiles"
5432 for lib in $dlprefiles; do
5433 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5434 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5435 if test -z "$libdir"; then
5436 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5439 newdlprefiles="$newdlprefiles $libdir/$name"
5441 dlprefiles="$newdlprefiles"
5444 # place dlname in correct position for cygwin
5446 case $host,$output,$installed,$module,$dlname in
5447 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5450 # $outputname - a libtool library file
5451 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5453 # Please DO NOT delete this file!
5454 # It is necessary for linking the library.
5456 # The name that we can dlopen(3).
5459 # Names of this library.
5460 library_names='$library_names'
5462 # The name of the static archive.
5463 old_library='$old_library'
5465 # Libraries that this one depends upon.
5466 dependency_libs='$dependency_libs'
5468 # Version information for $libname.
5473 # Is this an already installed library?
5474 installed=$installed
5476 # Should we warn about portability when linking against -modules?
5477 shouldnotlink=$module
5479 # Files to dlopen/dlpreopen
5481 dlpreopen='$dlprefiles'
5483 # Directory that this library needs to be installed in:
5484 libdir='$install_libdir'"
5485 if test "$installed" = no && test "$need_relink" = yes; then
5487 relink_command=\"$relink_command\""
5492 # Do a symbolic link so that the libtool archive can be found in
5493 # LD_LIBRARY_PATH before the program is installed.
5494 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5495 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5501 # libtool install mode
5503 modename="$modename: install"
5505 # There may be an optional sh(1) argument at the beginning of
5506 # install_prog (especially on Windows NT).
5507 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5508 # Allow the use of GNU shtool's install command.
5509 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5510 # Aesthetically quote it.
5511 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5513 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5517 install_prog="$arg "
5525 # The real first argument should be the name of the installation program.
5526 # Aesthetically quote it.
5527 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5529 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5533 install_prog="$install_prog$arg"
5535 # We need to accept at least all the BSD install flags.
5545 if test -n "$dest"; then
5546 files="$files $dest"
5564 # If the previous option needed an argument, then skip it.
5565 if test -n "$prev"; then
5574 # Aesthetically quote the argument.
5575 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5577 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5581 install_prog="$install_prog $arg"
5584 if test -z "$install_prog"; then
5585 $echo "$modename: you must specify an install program" 1>&2
5590 if test -n "$prev"; then
5591 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5596 if test -z "$files"; then
5597 if test -z "$dest"; then
5598 $echo "$modename: no file or destination specified" 1>&2
5600 $echo "$modename: you must specify a destination" 1>&2
5606 # Strip any trailing slash from the destination.
5607 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5609 # Check to see that the destination is a directory.
5610 test -d "$dest" && isdir=yes
5611 if test "$isdir" = yes; then
5615 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5616 test "X$destdir" = "X$dest" && destdir=.
5617 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5619 # Not a directory, so check to see that there is only one file specified.
5621 if test "$#" -gt 2; then
5622 $echo "$modename: \`$dest' is not a directory" 1>&2
5628 [\\/]* | [A-Za-z]:[\\/]*) ;;
5630 for file in $files; do
5634 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5643 # This variable tells wrapper scripts just to set variables rather
5644 # than running their programs.
5645 libtool_install_magic="$magic"
5650 for file in $files; do
5652 # Do each installation.
5655 # Do the static libraries later.
5656 staticlibs="$staticlibs $file"
5660 # Check to see that this really is a libtool archive.
5661 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5663 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5671 # If there is no directory component, then add one.
5673 */* | *\\*) . $file ;;
5677 # Add the libdir to current_libdirs if it is the destination.
5678 if test "X$destdir" = "X$libdir"; then
5679 case "$current_libdirs " in
5681 *) current_libdirs="$current_libdirs $libdir" ;;
5684 # Note the libdir as a future libdir.
5685 case "$future_libdirs " in
5687 *) future_libdirs="$future_libdirs $libdir" ;;
5691 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5692 test "X$dir" = "X$file/" && dir=
5695 if test -n "$relink_command"; then
5696 # Determine the prefix the user has applied to our future dir.
5697 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5699 # Don't allow the user to place us outside of our expected
5700 # location b/c this prevents finding dependent libraries that
5701 # are installed to the same prefix.
5702 # At present, this check doesn't affect windows .dll's that
5703 # are installed into $libdir/../bin (currently, that works fine)
5704 # but it's something to keep an eye on.
5705 if test "$inst_prefix_dir" = "$destdir"; then
5706 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5710 if test -n "$inst_prefix_dir"; then
5711 # Stick the inst_prefix_dir data into the link command.
5712 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5714 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5717 $echo "$modename: warning: relinking \`$file'" 1>&2
5718 $show "$relink_command"
5719 if $run eval "$relink_command"; then :
5721 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5726 # See the names of the shared library.
5727 set dummy $library_names
5728 if test -n "$2"; then
5734 test -n "$relink_command" && srcname="$realname"T
5736 # Install the shared library and build the symlinks.
5737 $show "$install_prog $dir/$srcname $destdir/$realname"
5738 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5739 if test -n "$stripme" && test -n "$striplib"; then
5740 $show "$striplib $destdir/$realname"
5741 $run eval "$striplib $destdir/$realname" || exit $?
5744 if test "$#" -gt 0; then
5745 # Delete the old symlinks, and create new ones.
5748 if test "$linkname" != "$realname"; then
5749 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5750 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5755 # Do each command in the postinstall commands.
5756 lib="$destdir/$realname"
5757 eval cmds=\"$postinstall_cmds\"
5758 save_ifs="$IFS"; IFS='~'
5759 for cmd in $cmds; do
5762 $run eval "$cmd" || exit $?
5767 # Install the pseudo-library for information purposes.
5768 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5769 instname="$dir/$name"i
5770 $show "$install_prog $instname $destdir/$name"
5771 $run eval "$install_prog $instname $destdir/$name" || exit $?
5773 # Maybe install the static library, too.
5774 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5778 # Install (i.e. copy) a libtool object.
5780 # Figure out destination file name, if it wasn't already specified.
5781 if test -n "$destname"; then
5782 destfile="$destdir/$destname"
5784 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5785 destfile="$destdir/$destfile"
5788 # Deduce the name of the destination old-style object file.
5791 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5794 staticdest="$destfile"
5798 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5804 # Install the libtool object if requested.
5805 if test -n "$destfile"; then
5806 $show "$install_prog $file $destfile"
5807 $run eval "$install_prog $file $destfile" || exit $?
5810 # Install the old object if enabled.
5811 if test "$build_old_libs" = yes; then
5812 # Deduce the name of the old-style object file.
5813 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5815 $show "$install_prog $staticobj $staticdest"
5816 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5822 # Figure out destination file name, if it wasn't already specified.
5823 if test -n "$destname"; then
5824 destfile="$destdir/$destname"
5826 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5827 destfile="$destdir/$destfile"
5830 # If the file is missing, and there is a .exe on the end, strip it
5831 # because it is most likely a libtool script we actually want to
5836 if test ! -f "$file"; then
5837 file=`$echo $file|${SED} 's,.exe$,,'`
5843 # Do a test to see if this is really a libtool program.
5846 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5852 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5856 # To insure that "foo" is sourced, and not "foo.exe",
5857 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5858 # which disallows the automatic-append-.exe behavior.
5860 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5861 *) wrapperdot=${wrapper} ;;
5863 # If there is no directory component, then add one.
5865 */* | *\\*) . ${wrapperdot} ;;
5866 *) . ./${wrapperdot} ;;
5869 # Check the variables that should have been set.
5870 if test -z "$notinst_deplibs"; then
5871 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5876 for lib in $notinst_deplibs; do
5877 # Check to see that each library is installed.
5879 if test -f "$lib"; then
5880 # If there is no directory component, then add one.
5882 */* | *\\*) . $lib ;;
5886 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5887 if test -n "$libdir" && test ! -f "$libfile"; then
5888 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5894 # To insure that "foo" is sourced, and not "foo.exe",
5895 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5896 # which disallows the automatic-append-.exe behavior.
5898 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5899 *) wrapperdot=${wrapper} ;;
5901 # If there is no directory component, then add one.
5903 */* | *\\*) . ${wrapperdot} ;;
5904 *) . ./${wrapperdot} ;;
5908 if test "$fast_install" = no && test -n "$relink_command"; then
5909 if test "$finalize" = yes && test -z "$run"; then
5911 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5912 tmpdir="$tmpdir/libtool-$$"
5913 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5915 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5918 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5919 outputname="$tmpdir/$file"
5920 # Replace the output file specification.
5921 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5923 $show "$relink_command"
5924 if $run eval "$relink_command"; then :
5926 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5932 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5935 # Install the binary that we compiled earlier.
5936 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5940 # remove .exe since cygwin /usr/bin/install will append another
5942 case $install_prog,$host in
5943 */usr/bin/install*,*cygwin*)
5944 case $file:$destfile in
5949 destfile=$destfile.exe
5952 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5957 $show "$install_prog$stripme $file $destfile"
5958 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5959 test -n "$outputname" && ${rm}r "$tmpdir"
5964 for file in $staticlibs; do
5965 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5967 # Set up the ranlib parameters.
5968 oldlib="$destdir/$name"
5970 $show "$install_prog $file $oldlib"
5971 $run eval "$install_prog \$file \$oldlib" || exit $?
5973 if test -n "$stripme" && test -n "$striplib"; then
5974 $show "$old_striplib $oldlib"
5975 $run eval "$old_striplib $oldlib" || exit $?
5978 # Do each command in the postinstall commands.
5979 eval cmds=\"$old_postinstall_cmds\"
5980 save_ifs="$IFS"; IFS='~'
5981 for cmd in $cmds; do
5984 $run eval "$cmd" || exit $?
5989 if test -n "$future_libdirs"; then
5990 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5993 if test -n "$current_libdirs"; then
5994 # Maybe just do a dry run.
5995 test -n "$run" && current_libdirs=" -n$current_libdirs"
5996 exec_cmd='$SHELL $0 --finish$current_libdirs'
6002 # libtool finish mode
6004 modename="$modename: finish"
6008 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6011 libdirs="$libdirs $dir"
6014 for libdir in $libdirs; do
6015 if test -n "$finish_cmds"; then
6016 # Do each command in the finish commands.
6017 eval cmds=\"$finish_cmds\"
6018 save_ifs="$IFS"; IFS='~'
6019 for cmd in $cmds; do
6022 $run eval "$cmd" || admincmds="$admincmds
6027 if test -n "$finish_eval"; then
6028 # Do the single finish_eval.
6029 eval cmds=\"$finish_eval\"
6030 $run eval "$cmds" || admincmds="$admincmds
6036 # Exit here if they wanted silent mode.
6037 test "$show" = : && exit 0
6039 $echo "----------------------------------------------------------------------"
6040 $echo "Libraries have been installed in:"
6041 for libdir in $libdirs; do
6045 $echo "If you ever happen to want to link against installed libraries"
6046 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6047 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6048 $echo "flag during linking and do at least one of the following:"
6049 if test -n "$shlibpath_var"; then
6050 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6051 $echo " during execution"
6053 if test -n "$runpath_var"; then
6054 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6055 $echo " during linking"
6057 if test -n "$hardcode_libdir_flag_spec"; then
6059 eval flag=\"$hardcode_libdir_flag_spec\"
6061 $echo " - use the \`$flag' linker flag"
6063 if test -n "$admincmds"; then
6064 $echo " - have your system administrator run these commands:$admincmds"
6066 if test -f /etc/ld.so.conf; then
6067 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6070 $echo "See any operating system documentation about shared libraries for"
6071 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6072 $echo "----------------------------------------------------------------------"
6076 # libtool execute mode
6078 modename="$modename: execute"
6080 # The first argument is the command name.
6082 if test -z "$cmd"; then
6083 $echo "$modename: you must specify a COMMAND" 1>&2
6088 # Handle -dlopen flags immediately.
6089 for file in $execute_dlfiles; do
6090 if test ! -f "$file"; then
6091 $echo "$modename: \`$file' is not a file" 1>&2
6099 # Check to see that this really is a libtool archive.
6100 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6102 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6107 # Read the libtool library.
6111 # If there is no directory component, then add one.
6113 */* | *\\*) . $file ;;
6117 # Skip this library if it cannot be dlopened.
6118 if test -z "$dlname"; then
6119 # Warn if it was a shared library.
6120 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6124 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6125 test "X$dir" = "X$file" && dir=.
6127 if test -f "$dir/$objdir/$dlname"; then
6130 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6136 # Just add the directory containing the .lo file.
6137 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6138 test "X$dir" = "X$file" && dir=.
6142 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6147 # Get the absolute pathname.
6148 absdir=`cd "$dir" && pwd`
6149 test -n "$absdir" && dir="$absdir"
6151 # Now add the directory to shlibpath_var.
6152 if eval "test -z \"\$$shlibpath_var\""; then
6153 eval "$shlibpath_var=\"\$dir\""
6155 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6159 # This variable tells wrapper scripts just to set shlibpath_var
6160 # rather than running their programs.
6161 libtool_execute_magic="$magic"
6163 # Check if any of the arguments is a wrapper script.
6170 # Do a test to see if this is really a libtool program.
6171 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6172 # If there is no directory component, then add one.
6174 */* | *\\*) . $file ;;
6178 # Transform arg to wrapped name.
6179 file="$progdir/$program"
6183 # Quote arguments (to preserve shell metacharacters).
6184 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6185 args="$args \"$file\""
6188 if test -z "$run"; then
6189 if test -n "$shlibpath_var"; then
6190 # Export the shlibpath_var.
6191 eval "export $shlibpath_var"
6194 # Restore saved environment variables
6195 if test "${save_LC_ALL+set}" = set; then
6196 LC_ALL="$save_LC_ALL"; export LC_ALL
6198 if test "${save_LANG+set}" = set; then
6199 LANG="$save_LANG"; export LANG
6202 # Now prepare to actually exec the command.
6203 exec_cmd="\$cmd$args"
6205 # Display what would be done.
6206 if test -n "$shlibpath_var"; then
6207 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6208 $echo "export $shlibpath_var"
6215 # libtool clean and uninstall mode
6217 modename="$modename: $mode"
6223 # This variable tells wrapper scripts just to set variables rather
6224 # than running their programs.
6225 libtool_install_magic="$magic"
6230 -f) rm="$rm $arg"; rmforce=yes ;;
6231 -*) rm="$rm $arg" ;;
6232 *) files="$files $arg" ;;
6236 if test -z "$rm"; then
6237 $echo "$modename: you must specify an RM program" 1>&2
6244 origobjdir="$objdir"
6245 for file in $files; do
6246 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6247 if test "X$dir" = "X$file"; then
6249 objdir="$origobjdir"
6251 objdir="$dir/$origobjdir"
6253 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6254 test "$mode" = uninstall && objdir="$dir"
6256 # Remember objdir for removal later, being careful to avoid duplicates
6257 if test "$mode" = clean; then
6260 *) rmdirs="$rmdirs $objdir" ;;
6264 # Don't error if the file doesn't exist and rm -f was used.
6265 if (test -L "$file") >/dev/null 2>&1 \
6266 || (test -h "$file") >/dev/null 2>&1 \
6267 || test -f "$file"; then
6269 elif test -d "$file"; then
6272 elif test "$rmforce" = yes; then
6280 # Possibly a libtool archive, so verify it.
6281 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6284 # Delete the libtool libraries and symlinks.
6285 for n in $library_names; do
6286 rmfiles="$rmfiles $objdir/$n"
6288 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6289 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6291 if test "$mode" = uninstall; then
6292 if test -n "$library_names"; then
6293 # Do each command in the postuninstall commands.
6294 eval cmds=\"$postuninstall_cmds\"
6295 save_ifs="$IFS"; IFS='~'
6296 for cmd in $cmds; do
6300 if test "$?" -ne 0 && test "$rmforce" != yes; then
6307 if test -n "$old_library"; then
6308 # Do each command in the old_postuninstall commands.
6309 eval cmds=\"$old_postuninstall_cmds\"
6310 save_ifs="$IFS"; IFS='~'
6311 for cmd in $cmds; do
6315 if test "$?" -ne 0 && test "$rmforce" != yes; then
6321 # FIXME: should reinstall the best remaining shared library.
6327 # Possibly a libtool object, so verify it.
6328 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6333 # Add PIC object to the list of files to remove.
6334 if test -n "$pic_object" \
6335 && test "$pic_object" != none; then
6336 rmfiles="$rmfiles $dir/$pic_object"
6339 # Add non-PIC object to the list of files to remove.
6340 if test -n "$non_pic_object" \
6341 && test "$non_pic_object" != none; then
6342 rmfiles="$rmfiles $dir/$non_pic_object"
6348 if test "$mode" = clean ; then
6352 file=`$echo $file|${SED} 's,.exe$,,'`
6353 noexename=`$echo $name|${SED} 's,.exe$,,'`
6354 # $file with .exe has already been added to rmfiles,
6355 # add $file without .exe
6356 rmfiles="$rmfiles $file"
6359 # Do a test to see if this is a libtool program.
6360 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6364 # note $name still contains .exe if it was in $file originally
6365 # as does the version of $file that was added into $rmfiles
6366 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6367 if test "$fast_install" = yes && test -n "$relink_command"; then
6368 rmfiles="$rmfiles $objdir/lt-$name"
6370 if test "X$noexename" != "X$name" ; then
6371 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6377 $show "$rm $rmfiles"
6378 $run $rm $rmfiles || exit_status=1
6380 objdir="$origobjdir"
6382 # Try to remove the ${objdir}s in the directories where we deleted files
6383 for dir in $rmdirs; do
6384 if test -d "$dir"; then
6386 $run rmdir $dir >/dev/null 2>&1
6394 $echo "$modename: you must specify a MODE" 1>&2
6395 $echo "$generic_help" 1>&2
6400 if test -z "$exec_cmd"; then
6401 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6402 $echo "$generic_help" 1>&2
6405 fi # test -z "$show_help"
6407 if test -n "$exec_cmd"; then
6412 # We need to display help for each of the modes.
6415 "Usage: $modename [OPTION]... [MODE-ARG]...
6417 Provide generalized library-building support services.
6419 --config show all configuration variables
6420 --debug enable verbose shell tracing
6421 -n, --dry-run display commands without modifying any files
6422 --features display basic configuration information and exit
6423 --finish same as \`--mode=finish'
6424 --help display this help message and exit
6425 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6426 --quiet same as \`--silent'
6427 --silent don't print informational messages
6428 --tag=TAG use configuration variables from tag TAG
6429 --version print version information
6431 MODE must be one of the following:
6433 clean remove files from the build directory
6434 compile compile a source file into a libtool object
6435 execute automatically set library path, then run a program
6436 finish complete the installation of libtool libraries
6437 install install libraries or executables
6438 link create a library or an executable
6439 uninstall remove libraries from an installed directory
6441 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6442 a more detailed description of MODE.
6444 Report bugs to <bug-libtool@gnu.org>."
6450 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6452 Remove files from the build directory.
6454 RM is the name of the program to use to delete files associated with each FILE
6455 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6458 If FILE is a libtool library, object or program, all the files associated
6459 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6464 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6466 Compile a source file into a libtool library object.
6468 This mode accepts the following additional options:
6470 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6471 -prefer-pic try to building PIC objects only
6472 -prefer-non-pic try to building non-PIC objects only
6473 -static always build a \`.o' file suitable for static linking
6475 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6476 from the given SOURCEFILE.
6478 The output file name is determined by removing the directory component from
6479 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6480 library object suffix, \`.lo'."
6485 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6487 Automatically set library path, then run a program.
6489 This mode accepts the following additional options:
6491 -dlopen FILE add the directory containing FILE to the library path
6493 This mode sets the library path environment variable according to \`-dlopen'
6496 If any of the ARGS are libtool executable wrappers, then they are translated
6497 into their corresponding uninstalled binary, and any of their required library
6498 directories are added to the library path.
6500 Then, COMMAND is executed, with ARGS as arguments."
6505 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6507 Complete the installation of libtool libraries.
6509 Each LIBDIR is a directory that contains libtool libraries.
6511 The commands that this mode executes may require superuser privileges. Use
6512 the \`--dry-run' option if you just want to see what would be executed."
6517 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6519 Install executables or libraries.
6521 INSTALL-COMMAND is the installation command. The first component should be
6522 either the \`install' or \`cp' program.
6524 The rest of the components are interpreted as arguments to that command (only
6525 BSD-compatible install options are recognized)."
6530 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6532 Link object files or libraries together to form another library, or to
6533 create an executable program.
6535 LINK-COMMAND is a command using the C compiler that you would use to create
6536 a program from several object files.
6538 The following components of LINK-COMMAND are treated specially:
6540 -all-static do not do any dynamic linking at all
6541 -avoid-version do not add a version suffix if possible
6542 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6543 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6544 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6545 -export-symbols SYMFILE
6546 try to export only the symbols listed in SYMFILE
6547 -export-symbols-regex REGEX
6548 try to export only the symbols matching REGEX
6549 -LLIBDIR search LIBDIR for required installed libraries
6550 -lNAME OUTPUT-FILE requires the installed library libNAME
6551 -module build a library that can dlopened
6552 -no-fast-install disable the fast-install mode
6553 -no-install link a not-installable executable
6554 -no-undefined declare that a library does not refer to external symbols
6555 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6556 -objectlist FILE Use a list of object files found in FILE to specify objects
6557 -release RELEASE specify package release information
6558 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6559 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6560 -static do not do any dynamic linking of libtool libraries
6561 -version-info CURRENT[:REVISION[:AGE]]
6562 specify library version info [each variable defaults to 0]
6564 All other options (arguments beginning with \`-') are ignored.
6566 Every other argument is treated as a filename. Files ending in \`.la' are
6567 treated as uninstalled libtool libraries, other files are standard or library
6570 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6571 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6572 required, except when creating a convenience library.
6574 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6575 using \`ar' and \`ranlib', or on Windows using \`lib'.
6577 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6578 is created, otherwise an executable program is created."
6583 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6585 Remove libraries from an installation directory.
6587 RM is the name of the program to use to delete files associated with each FILE
6588 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6591 If FILE is a libtool library, all the files associated with it are deleted.
6592 Otherwise, only FILE itself is deleted using RM."
6596 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6603 $echo "Try \`$modename --help' for more information about other modes."
6607 # The TAGs below are defined such that we never get into a situation
6608 # in which we disable both kinds of libraries. Given conflicting
6609 # choices, we go for a static library, that is the most portable,
6610 # since we can't tell whether shared libraries were disabled because
6611 # the user asked for that or because the platform doesn't support
6612 # them. This is particularly important on AIX, because we don't
6613 # support having both static and shared libraries enabled at the same
6614 # time on that platform, so we default to a shared-only configuration.
6615 # If a disable-shared tag is given, we'll fallback to a static-only
6616 # configuration. But we'll never go from static-only to shared-only.
6618 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6619 build_libtool_libs=no
6621 # ### END LIBTOOL TAG CONFIG: disable-shared
6623 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6624 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6625 # ### END LIBTOOL TAG CONFIG: disable-static
6631 # ### BEGIN LIBTOOL TAG CONFIG: CXX
6633 # Libtool was configured on host susan.mitocities.ne.jp:
6635 # Shell to use when invoking shell scripts.
6638 # Whether or not to build shared libraries.
6639 build_libtool_libs=yes
6641 # Whether or not to build static libraries.
6644 # Whether or not to add -lc for building shared libraries.
6645 build_libtool_need_lc=no
6647 # Whether or not to disallow shared libs when runtime libs are static
6648 allow_libtool_libs_with_static_runtimes=no
6650 # Whether or not to optimize for fast installation.
6651 fast_install=needless
6655 host=powerpc-apple-darwin7.0.0
6657 # An echo program that does not interpret backslashes.
6667 # A language-specific compiler.
6670 # Is the compiler the GNU C compiler?
6676 # The linker used to build libraries.
6679 # Whether we need hard or soft links.
6682 # A BSD-compatible nm program.
6685 # A symbol stripping program
6688 # Used to examine libraries when file_magic_cmd begins "file"
6691 # Used on cygwin: DLL creation program.
6694 # Used on cygwin: object dumper.
6697 # Used on cygwin: assembler.
6700 # The name of the directory that contains temporary libtool files.
6703 # How to create reloadable object files.
6705 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6707 # How to pass a linker flag through the compiler.
6710 # Object file suffix (normally "o").
6713 # Old archive suffix (normally "a").
6716 # Shared library suffix (normally ".so").
6717 shrext='$(test .$module = .yes && echo .so || echo .dylib)'
6719 # Executable file suffix (normally "").
6722 # Additional compiler flags for building library objects.
6723 pic_flag=" -fno-common -DPIC"
6726 # What is the maximum length of a command?
6729 # Does compiler simultaneously support -c and -o options?
6732 # Must we lock files when doing compilation ?
6735 # Do we need the lib prefix for modules?
6738 # Do we need a version for libraries?
6741 # Whether dlopen is supported.
6744 # Whether dlopen of programs is supported.
6747 # Whether dlopen of statically linked programs is supported.
6748 dlopen_self_static=yes
6750 # Compiler flag to prevent dynamic linking.
6751 link_static_flag="-static"
6753 # Compiler flag to turn off builtin functions.
6754 no_builtin_flag=" -fno-builtin"
6756 # Compiler flag to allow reflexive dlopens.
6757 export_dynamic_flag_spec=""
6759 # Compiler flag to generate shared objects directly from archives.
6760 whole_archive_flag_spec="-all_load \$convenience"
6762 # Compiler flag to generate thread-safe objects.
6763 thread_safe_flag_spec=""
6765 # Library versioning type.
6768 # Format of library name prefix.
6769 libname_spec="lib\$name"
6771 # List of archive names. First name is the real one, the rest are links.
6772 # The last name is the one that the linker finds with -lNAME.
6773 library_names_spec="\${libname}\${release}\${versuffix}\$shared_ext \${libname}\${release}\${major}\$shared_ext \${libname}\$shared_ext"
6775 # The coded name of the library, if different from the real name.
6776 soname_spec="\${libname}\${release}\${major}\$shared_ext"
6778 # Commands used to build and install an old-style archive.
6780 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
6781 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
6782 old_postuninstall_cmds=""
6784 # Create an old-style archive from a shared archive.
6785 old_archive_from_new_cmds=""
6787 # Create a temporary old-style archive to link instead of a shared archive.
6788 old_archive_from_expsyms_cmds=""
6790 # Commands used to build and install a shared archive.
6791 archive_cmds="\$CC -dynamiclib -single_module \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring"
6792 archive_expsym_cmds="sed -e \\\"s,#.*,,\\\" -e \\\"s,^[ ]*,,\\\" -e \\\"s,^\\\\(..*\\\\),_&,\\\" < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib -single_module \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring~nmedit -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
6794 postuninstall_cmds=""
6796 # Commands used to build a loadable module (assumed same as above if empty)
6797 module_cmds="\$CC -bundle \${wl}-bind_at_load \$allow_undefined_flag -o \$lib \$libobjs \$deplibs\$compiler_flags"
6798 module_expsym_cmds="sed -e \\\"s,#.*,,\\\" -e \\\"s,^[ ]*,,\\\" -e \\\"s,^\\\\(..*\\\\),_&,\\\" < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -bundle \$allow_undefined_flag -o \$lib \$libobjs \$deplibs\$compiler_flags~nmedit -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
6800 # Commands to strip libraries.
6804 # Dependencies to place before the objects being linked to create a
6808 # Dependencies to place after the objects being linked to create a
6812 # Dependencies to place before the objects being linked to create a
6816 # Dependencies to place after the objects being linked to create a
6820 # The library search path used internally by the compiler when linking
6822 compiler_lib_search_path=""
6824 # Method to check whether dependent libraries are shared objects.
6825 deplibs_check_method="pass_all"
6827 # Command to use when deplibs_check_method == file_magic.
6828 file_magic_cmd="/usr/bin/file -L"
6830 # Flag that allows shared libraries with undefined symbols to be built.
6831 allow_undefined_flag="-flat_namespace -undefined suppress"
6833 # Flag that forces no undefined symbols.
6834 no_undefined_flag=""
6836 # Commands used to finish a libtool library installation in a directory.
6839 # Same as above, but a single script fragment to be evaled but not shown.
6842 # Take the output of nm and produce a listing of raw symbols and C names.
6843 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([BCDEGRST][BCDEGRST]*\\)[ ][ ]*\\(_\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
6845 # Transform the output of nm in a proper C declaration
6846 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
6848 # Transform the output of nm in a C name address pair
6849 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
6851 # This is the shared library runtime path variable.
6854 # This is the shared library path variable.
6855 shlibpath_var=DYLD_LIBRARY_PATH
6857 # Is shlibpath searched before the hard-coded library search path?
6858 shlibpath_overrides_runpath=yes
6860 # How to hardcode a shared library path into an executable.
6861 hardcode_action=immediate
6863 # Whether we should hardcode library paths into libraries.
6864 hardcode_into_libs=no
6866 # Flag to hardcode $libdir into a binary during linking.
6867 # This must work even if $libdir does not exist.
6868 hardcode_libdir_flag_spec=""
6870 # If ld is used when linking, flag to hardcode $libdir into
6871 # a binary during linking. This must work even if $libdir does
6873 hardcode_libdir_flag_spec_ld=""
6875 # Whether we need a single -rpath flag with a separated argument.
6876 hardcode_libdir_separator=""
6878 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
6882 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
6886 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
6887 # the resulting binary.
6888 hardcode_shlibpath_var=unsupported
6890 # Set to yes if building a shared library automatically hardcodes DIR into the library
6891 # and all subsequent libraries and executables linked against it.
6892 hardcode_automatic=yes
6894 # Variables whose values should be saved in libtool wrapper scripts and
6895 # restored at relink time.
6896 variables_saved_for_relink="PATH DYLD_LIBRARY_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6898 # Whether libtool must link a program against all its dependency libraries.
6899 link_all_deplibs=yes
6901 # Compile-time system search path for libraries
6902 sys_lib_search_path_spec=" /usr/libexec/gcc/darwin/ppc/3.3/ /usr/local/libexec/gcc/darwin/ppc/3.3/ /usr/libexec/gcc/darwin/../../ppc-darwin/lib/ppc/3.3/ /usr/libexec/gcc/darwin/../../ppc-darwin/lib/ /usr/lib/gcc/darwin/ppc/3.3/ /usr/lib/gcc/darwin/ /usr/libexec/gcc/darwin/ppc/3.3/../../../ppc/3.3/ /usr/libexec/gcc/darwin/ppc/3.3/../../../ /lib/ppc/3.3/ /lib/ /usr/lib/ppc/3.3/ /usr/lib/ /lib /usr/lib /usr/local/lib"
6904 # Run-time system search path for libraries
6905 sys_lib_dlsearch_path_spec="/usr/local/lib /lib /usr/lib"
6907 # Fix the shell variable $srcfile for the compiler.
6910 # Set to yes if exported symbols are required.
6911 always_export_symbols=no
6913 # The commands to list exported symbols.
6914 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
6916 # The commands to extract the exported symbol list from a shared archive.
6917 extract_expsyms_cmds=""
6919 # Symbols that should not be listed in the preloaded symbols.
6922 # Symbols that must always be exported.
6925 # ### END LIBTOOL TAG CONFIG: CXX