started to fix the manuals for EBuf. Implemented a
[neuro.git] / libtool
blobab7828d09a8560f7a9c8f806aa43c88344535945
1 #! /bin/sh
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU neuro 0.49.5)
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.
33 SED="/usr/bin/sed"
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
39 # if CDPATH is set.
40 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
42 # The names of the tagged configurations supported by this script.
43 available_tags=" CXX"
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host nik.neuroponic.com:
49 # Shell to use when invoking shell scripts.
50 SHELL="/bin/sh"
52 # Whether or not to build shared libraries.
53 build_libtool_libs=yes
55 # Whether or not to build static libraries.
56 build_old_libs=yes
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.
65 fast_install=yes
67 # The host system.
68 host_alias=
69 host=i686-pc-linux-gnu
71 # An echo program that does not interpret backslashes.
72 echo="echo"
74 # The archiver.
75 AR="ar"
76 AR_FLAGS="cru"
78 # A C compiler.
79 LTCC="gcc"
81 # A language-specific compiler.
82 CC="gcc"
84 # Is the compiler the GNU C compiler?
85 with_gcc=yes
87 # An ERE matcher.
88 EGREP="grep -E"
90 # The linker used to build libraries.
91 LD="/usr/i486-slackware-linux/bin/ld"
93 # Whether we need hard or soft links.
94 LN_S="ln -s"
96 # A BSD-compatible nm program.
97 NM="/usr/bin/nm -B"
99 # A symbol stripping program
100 STRIP="strip"
102 # Used to examine libraries when file_magic_cmd begins "file"
103 MAGIC_CMD=file
105 # Used on cygwin: DLL creation program.
106 DLLTOOL="dlltool"
108 # Used on cygwin: object dumper.
109 OBJDUMP="objdump"
111 # Used on cygwin: assembler.
112 AS="as"
114 # The name of the directory that contains temporary libtool files.
115 objdir=.libs
117 # How to create reloadable object files.
118 reload_flag=" -r"
119 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
121 # How to pass a linker flag through the compiler.
122 wl="-Wl,"
124 # Object file suffix (normally "o").
125 objext="o"
127 # Old archive suffix (normally "a").
128 libext="a"
130 # Shared library suffix (normally ".so").
131 shrext_cmds='.so'
133 # Executable file suffix (normally "").
134 exeext=""
136 # Additional compiler flags for building library objects.
137 pic_flag=" -fPIC -DPIC"
138 pic_mode=default
140 # What is the maximum length of a command?
141 max_cmd_len=32768
143 # Does compiler simultaneously support -c and -o options?
144 compiler_c_o="yes"
146 # Must we lock files when doing compilation ?
147 need_locks="no"
149 # Do we need the lib prefix for modules?
150 need_lib_prefix=no
152 # Do we need a version for libraries?
153 need_version=no
155 # Whether dlopen is supported.
156 dlopen_support=unknown
158 # Whether dlopen of programs is supported.
159 dlopen_self=unknown
161 # Whether dlopen of statically linked programs is supported.
162 dlopen_self_static=unknown
164 # Compiler flag to prevent dynamic linking.
165 link_static_flag="-static"
167 # Compiler flag to turn off builtin functions.
168 no_builtin_flag=" -fno-builtin"
170 # Compiler flag to allow reflexive dlopens.
171 export_dynamic_flag_spec="\${wl}--export-dynamic"
173 # Compiler flag to generate shared objects directly from archives.
174 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
176 # Compiler flag to generate thread-safe objects.
177 thread_safe_flag_spec=""
179 # Library versioning type.
180 version_type=linux
182 # Format of library name prefix.
183 libname_spec="lib\$name"
185 # List of archive names. First name is the real one, the rest are links.
186 # The last name is the one that the linker finds with -lNAME.
187 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
189 # The coded name of the library, if different from the real name.
190 soname_spec="\${libname}\${release}\${shared_ext}\$major"
192 # Commands used to build and install an old-style archive.
193 RANLIB="ranlib"
194 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
195 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
196 old_postuninstall_cmds=""
198 # Create an old-style archive from a shared archive.
199 old_archive_from_new_cmds=""
201 # Create a temporary old-style archive to link instead of a shared archive.
202 old_archive_from_expsyms_cmds=""
204 # Commands used to build and install a shared archive.
205 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
206 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
207 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
208 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
209 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
210 postinstall_cmds=""
211 postuninstall_cmds=""
213 # Commands used to build a loadable module (assumed same as above if empty)
214 module_cmds=""
215 module_expsym_cmds=""
217 # Commands to strip libraries.
218 old_striplib="strip --strip-debug"
219 striplib="strip --strip-unneeded"
221 # Dependencies to place before the objects being linked to create a
222 # shared library.
223 predep_objects=""
225 # Dependencies to place after the objects being linked to create a
226 # shared library.
227 postdep_objects=""
229 # Dependencies to place before the objects being linked to create a
230 # shared library.
231 predeps=""
233 # Dependencies to place after the objects being linked to create a
234 # shared library.
235 postdeps=""
237 # The library search path used internally by the compiler when linking
238 # a shared library.
239 compiler_lib_search_path=""
241 # Method to check whether dependent libraries are shared objects.
242 deplibs_check_method="pass_all"
244 # Command to use when deplibs_check_method == file_magic.
245 file_magic_cmd="\$MAGIC_CMD"
247 # Flag that allows shared libraries with undefined symbols to be built.
248 allow_undefined_flag=""
250 # Flag that forces no undefined symbols.
251 no_undefined_flag=""
253 # Commands used to finish a libtool library installation in a directory.
254 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
256 # Same as above, but a single script fragment to be evaled but not shown.
257 finish_eval=""
259 # Take the output of nm and produce a listing of raw symbols and C names.
260 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
262 # Transform the output of nm in a proper C declaration
263 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
265 # Transform the output of nm in a C name address pair
266 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
268 # This is the shared library runtime path variable.
269 runpath_var=LD_RUN_PATH
271 # This is the shared library path variable.
272 shlibpath_var=LD_LIBRARY_PATH
274 # Is shlibpath searched before the hard-coded library search path?
275 shlibpath_overrides_runpath=no
277 # How to hardcode a shared library path into an executable.
278 hardcode_action=immediate
280 # Whether we should hardcode library paths into libraries.
281 hardcode_into_libs=yes
283 # Flag to hardcode $libdir into a binary during linking.
284 # This must work even if $libdir does not exist.
285 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
287 # If ld is used when linking, flag to hardcode $libdir into
288 # a binary during linking. This must work even if $libdir does
289 # not exist.
290 hardcode_libdir_flag_spec_ld=""
292 # Whether we need a single -rpath flag with a separated argument.
293 hardcode_libdir_separator=""
295 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
296 # resulting binary.
297 hardcode_direct=no
299 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
300 # resulting binary.
301 hardcode_minus_L=no
303 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
304 # the resulting binary.
305 hardcode_shlibpath_var=unsupported
307 # Set to yes if building a shared library automatically hardcodes DIR into the library
308 # and all subsequent libraries and executables linked against it.
309 hardcode_automatic=no
311 # Variables whose values should be saved in libtool wrapper scripts and
312 # restored at relink time.
313 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
315 # Whether libtool must link a program against all its dependency libraries.
316 link_all_deplibs=unknown
318 # Compile-time system search path for libraries
319 sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/ /usr/lib/gcc/i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib/i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../ /lib/i486-slackware-linux/3.3.4/ /lib/ /usr/lib/i486-slackware-linux/3.3.4/ /usr/lib/"
321 # Run-time system search path for libraries
322 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib /usr/lib /usr/X11R6/lib "
324 # Fix the shell variable $srcfile for the compiler.
325 fix_srcfile_path=""
327 # Set to yes if exported symbols are required.
328 always_export_symbols=no
330 # The commands to list exported symbols.
331 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
333 # The commands to extract the exported symbol list from a shared archive.
334 extract_expsyms_cmds=""
336 # Symbols that should not be listed in the preloaded symbols.
337 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
339 # Symbols that must always be exported.
340 include_expsyms=""
342 # ### END LIBTOOL CONFIG
344 # ltmain.sh - Provide generalized library-building support services.
345 # NOTE: Changing this file will not affect anything until you rerun configure.
347 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
348 # Free Software Foundation, Inc.
349 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
351 # This program is free software; you can redistribute it and/or modify
352 # it under the terms of the GNU General Public License as published by
353 # the Free Software Foundation; either version 2 of the License, or
354 # (at your option) any later version.
356 # This program is distributed in the hope that it will be useful, but
357 # WITHOUT ANY WARRANTY; without even the implied warranty of
358 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
359 # General Public License for more details.
361 # You should have received a copy of the GNU General Public License
362 # along with this program; if not, write to the Free Software
363 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
365 # As a special exception to the GNU General Public License, if you
366 # distribute this file as part of a program that contains a
367 # configuration script generated by Autoconf, you may include it under
368 # the same distribution terms that you use for the rest of that program.
370 basename="s,^.*/,,g"
372 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
373 # is ksh but when the shell is invoked as "sh" and the current value of
374 # the _XPG environment variable is not equal to 1 (one), the special
375 # positional parameter $0, within a function call, is the name of the
376 # function.
377 progpath="$0"
379 # The name of this program:
380 progname=`echo "$progpath" | $SED $basename`
381 modename="$progname"
383 # Global variables:
384 EXIT_SUCCESS=0
385 EXIT_FAILURE=1
387 PROGRAM=ltmain.sh
388 PACKAGE=libtool
389 VERSION=1.5.10
390 TIMESTAMP=" (1.1220.2.130 2004/09/19 12:13:49)"
392 # See if we are running on zsh, and set the options which allow our
393 # commands through without removal of \ escapes.
394 if test -n "${ZSH_VERSION+set}" ; then
395 setopt NO_GLOB_SUBST
398 # Check that we have a working $echo.
399 if test "X$1" = X--no-reexec; then
400 # Discard the --no-reexec flag, and continue.
401 shift
402 elif test "X$1" = X--fallback-echo; then
403 # Avoid inline document here, it may be left over
405 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
406 # Yippee, $echo works!
408 else
409 # Restart under the correct shell, and then maybe $echo will work.
410 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
413 if test "X$1" = X--fallback-echo; then
414 # used as fallback echo
415 shift
416 cat <<EOF
419 exit $EXIT_SUCCESS
422 default_mode=
423 help="Try \`$progname --help' for more information."
424 magic="%%%MAGIC variable%%%"
425 mkdir="mkdir"
426 mv="mv -f"
427 rm="rm -f"
429 # Sed substitution that helps us do robust quoting. It backslashifies
430 # metacharacters that are still active within double-quoted strings.
431 Xsed="${SED}"' -e 1s/^X//'
432 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
433 # test EBCDIC or ASCII
434 case `echo A|tr A '\301'` in
435 A) # EBCDIC based system
436 SP2NL="tr '\100' '\n'"
437 NL2SP="tr '\r\n' '\100\100'"
439 *) # Assume ASCII based system
440 SP2NL="tr '\040' '\012'"
441 NL2SP="tr '\015\012' '\040\040'"
443 esac
445 # NLS nuisances.
446 # Only set LANG and LC_ALL to C if already set.
447 # These must not be set unconditionally because not all systems understand
448 # e.g. LANG=C (notably SCO).
449 # We save the old values to restore during execute mode.
450 if test "${LC_ALL+set}" = set; then
451 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
453 if test "${LANG+set}" = set; then
454 save_LANG="$LANG"; LANG=C; export LANG
457 # Make sure IFS has a sensible default
458 : ${IFS="
461 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
462 $echo "$modename: not configured to build any kind of library" 1>&2
463 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
464 exit $EXIT_FAILURE
467 # Global variables.
468 mode=$default_mode
469 nonopt=
470 prev=
471 prevopt=
472 run=
473 show="$echo"
474 show_help=
475 execute_dlfiles=
476 lo2o="s/\\.lo\$/.${objext}/"
477 o2lo="s/\\.${objext}\$/.lo/"
479 #####################################
480 # Shell function definitions:
481 # This seems to be the best place for them
483 # func_win32_libid arg
484 # return the library type of file 'arg'
486 # Need a lot of goo to handle *both* DLLs and import libs
487 # Has to be a shell function in order to 'eat' the argument
488 # that is supplied when $file_magic_command is called.
489 func_win32_libid () {
490 win32_libid_type="unknown"
491 win32_fileres=`file -L $1 2>/dev/null`
492 case $win32_fileres in
493 *ar\ archive\ import\ library*) # definitely import
494 win32_libid_type="x86 archive import"
496 *ar\ archive*) # could be an import, or static
497 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
498 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
499 win32_nmres=`eval $NM -f posix -A $1 | \
500 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
501 if test "X$win32_nmres" = "Ximport" ; then
502 win32_libid_type="x86 archive import"
503 else
504 win32_libid_type="x86 archive static"
508 *DLL*)
509 win32_libid_type="x86 DLL"
511 *executable*) # but shell scripts are "executable" too...
512 case $win32_fileres in
513 *MS\ Windows\ PE\ Intel*)
514 win32_libid_type="x86 DLL"
516 esac
518 esac
519 $echo $win32_libid_type
523 # func_infer_tag arg
524 # Infer tagged configuration to use if any are available and
525 # if one wasn't chosen via the "--tag" command line option.
526 # Only attempt this if the compiler in the base compile
527 # command doesn't match the default compiler.
528 # arg is usually of the form 'gcc ...'
529 func_infer_tag () {
530 if test -n "$available_tags" && test -z "$tagname"; then
531 CC_quoted=
532 for arg in $CC; do
533 case $arg in
534 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
535 arg="\"$arg\""
537 esac
538 CC_quoted="$CC_quoted $arg"
539 done
540 case $@ in
541 # Blanks in the command may have been stripped by the calling shell,
542 # but not from the CC environment variable when configure was run.
543 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
544 # Blanks at the start of $base_compile will cause this to fail
545 # if we don't check for them as well.
547 for z in $available_tags; do
548 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
549 # Evaluate the configuration.
550 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
551 CC_quoted=
552 for arg in $CC; do
553 # Double-quote args containing other shell metacharacters.
554 case $arg in
555 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
556 arg="\"$arg\""
558 esac
559 CC_quoted="$CC_quoted $arg"
560 done
561 case "$@ " in
562 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
563 # The compiler in the base compile command matches
564 # the one in the tagged configuration.
565 # Assume this is the tagged configuration we want.
566 tagname=$z
567 break
569 esac
571 done
572 # If $tagname still isn't set, then no tagged configuration
573 # was found and let the user know that the "--tag" command
574 # line option must be used.
575 if test -z "$tagname"; then
576 $echo "$modename: unable to infer tagged configuration"
577 $echo "$modename: specify a tag with \`--tag'" 1>&2
578 exit $EXIT_FAILURE
579 # else
580 # $echo "$modename: using $tagname tagged configuration"
583 esac
588 # func_extract_archives gentop oldlib ...
589 func_extract_archives () {
590 my_gentop="$1"; shift
591 my_oldlibs=${1+"$@"}
592 my_oldobjs=""
593 my_xlib=""
594 my_xabs=""
595 my_xdir=""
596 my_status=""
598 $show "${rm}r $my_gentop"
599 $run ${rm}r "$my_gentop"
600 $show "$mkdir $my_gentop"
601 $run $mkdir "$my_gentop"
602 my_status=$?
603 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
604 exit $my_status
607 for my_xlib in $my_oldlibs; do
608 # Extract the objects.
609 case $my_xlib in
610 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
611 *) my_xabs=`pwd`"/$my_xlib" ;;
612 esac
613 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
614 my_xdir="$my_gentop/$my_xlib"
616 $show "${rm}r $my_xdir"
617 $run ${rm}r "$my_xdir"
618 $show "$mkdir $my_xdir"
619 $run $mkdir "$my_xdir"
620 status=$?
621 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
622 exit $status
624 case $host in
625 *-darwin*)
626 $show "Extracting $my_xabs"
627 # Do not bother doing anything if just a dry run
628 if test -z "$run"; then
629 darwin_orig_dir=`pwd`
630 cd $my_xdir || exit $?
631 darwin_archive=$my_xabs
632 darwin_curdir=`pwd`
633 darwin_base_archive=`basename $darwin_archive`
634 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
635 if test -n "$darwin_arches"; then
636 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
637 darwin_arch=
638 $show "$darwin_base_archive has multiple architectures $darwin_arches"
639 for darwin_arch in $darwin_arches ; do
640 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
641 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
642 # Remove the table of contents from the thin files.
643 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
644 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
645 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
646 $AR -xo "${darwin_base_archive}"
647 rm "${darwin_base_archive}"
648 cd "$darwin_curdir"
649 done # $darwin_arches
650 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
651 darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
652 darwin_file=
653 darwin_files=
654 for darwin_file in $darwin_filelist; do
655 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
656 lipo -create -output "$darwin_file" $darwin_files
657 done # $darwin_filelist
658 rm -rf unfat-$$
659 cd "$darwin_orig_dir"
660 else
661 cd $darwin_orig_dir
662 (cd $my_xdir && $AR x $my_xabs) || exit $?
663 fi # $darwin_arches
664 fi # $run
667 # We will extract separately just the conflicting names and we will
668 # no longer touch any unique names. It is faster to leave these
669 # extract automatically by $AR in one run.
670 $show "(cd $my_xdir && $AR x $my_xabs)"
671 $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
672 if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
674 else
675 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
676 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
677 $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
680 while test "$i" -le "$count"
682 # Put our $i before any first dot (extension)
683 # Never overwrite any file
684 name_to="$name"
685 while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
687 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
688 done
689 $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
690 $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
691 i=`expr $i + 1`
692 done
693 done
696 esac
697 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
698 done
700 func_extract_archives_result="$my_oldobjs"
702 # End of Shell function definitions
703 #####################################
705 # Darwin sucks
706 eval std_shrext=\"$shrext_cmds\"
708 # Parse our command line options once, thoroughly.
709 while test "$#" -gt 0
711 arg="$1"
712 shift
714 case $arg in
715 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
716 *) optarg= ;;
717 esac
719 # If the previous option needs an argument, assign it.
720 if test -n "$prev"; then
721 case $prev in
722 execute_dlfiles)
723 execute_dlfiles="$execute_dlfiles $arg"
725 tag)
726 tagname="$arg"
727 preserve_args="${preserve_args}=$arg"
729 # Check whether tagname contains only valid characters
730 case $tagname in
731 *[!-_A-Za-z0-9,/]*)
732 $echo "$progname: invalid tag name: $tagname" 1>&2
733 exit $EXIT_FAILURE
735 esac
737 case $tagname in
739 # Don't test for the "default" C tag, as we know, it's there, but
740 # not specially marked.
743 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
744 taglist="$taglist $tagname"
745 # Evaluate the configuration.
746 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
747 else
748 $echo "$progname: ignoring unknown tag $tagname" 1>&2
751 esac
754 eval "$prev=\$arg"
756 esac
758 prev=
759 prevopt=
760 continue
763 # Have we seen a non-optional argument yet?
764 case $arg in
765 --help)
766 show_help=yes
769 --version)
770 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
771 $echo
772 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
773 $echo "This is free software; see the source for copying conditions. There is NO"
774 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
775 exit $EXIT_SUCCESS
778 --config)
779 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
780 # Now print the configurations for the tags.
781 for tagname in $taglist; do
782 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
783 done
784 exit $EXIT_SUCCESS
787 --debug)
788 $echo "$progname: enabling shell trace mode"
789 set -x
790 preserve_args="$preserve_args $arg"
793 --dry-run | -n)
794 run=:
797 --features)
798 $echo "host: $host"
799 if test "$build_libtool_libs" = yes; then
800 $echo "enable shared libraries"
801 else
802 $echo "disable shared libraries"
804 if test "$build_old_libs" = yes; then
805 $echo "enable static libraries"
806 else
807 $echo "disable static libraries"
809 exit $EXIT_SUCCESS
812 --finish) mode="finish" ;;
814 --mode) prevopt="--mode" prev=mode ;;
815 --mode=*) mode="$optarg" ;;
817 --preserve-dup-deps) duplicate_deps="yes" ;;
819 --quiet | --silent)
820 show=:
821 preserve_args="$preserve_args $arg"
824 --tag) prevopt="--tag" prev=tag ;;
825 --tag=*)
826 set tag "$optarg" ${1+"$@"}
827 shift
828 prev=tag
829 preserve_args="$preserve_args --tag"
832 -dlopen)
833 prevopt="-dlopen"
834 prev=execute_dlfiles
838 $echo "$modename: unrecognized option \`$arg'" 1>&2
839 $echo "$help" 1>&2
840 exit $EXIT_FAILURE
844 nonopt="$arg"
845 break
847 esac
848 done
850 if test -n "$prevopt"; then
851 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
852 $echo "$help" 1>&2
853 exit $EXIT_FAILURE
856 # If this variable is set in any of the actions, the command in it
857 # will be execed at the end. This prevents here-documents from being
858 # left over by shells.
859 exec_cmd=
861 if test -z "$show_help"; then
863 # Infer the operation mode.
864 if test -z "$mode"; then
865 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
866 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
867 case $nonopt in
868 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
869 mode=link
870 for arg
872 case $arg in
874 mode=compile
875 break
877 esac
878 done
880 *db | *dbx | *strace | *truss)
881 mode=execute
883 *install*|cp|mv)
884 mode=install
886 *rm)
887 mode=uninstall
890 # If we have no mode, but dlfiles were specified, then do execute mode.
891 test -n "$execute_dlfiles" && mode=execute
893 # Just use the default operation mode.
894 if test -z "$mode"; then
895 if test -n "$nonopt"; then
896 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
897 else
898 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
902 esac
905 # Only execute mode is allowed to have -dlopen flags.
906 if test -n "$execute_dlfiles" && test "$mode" != execute; then
907 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
908 $echo "$help" 1>&2
909 exit $EXIT_FAILURE
912 # Change the help message to a mode-specific one.
913 generic_help="$help"
914 help="Try \`$modename --help --mode=$mode' for more information."
916 # These modes are in order of execution frequency so that they run quickly.
917 case $mode in
918 # libtool compile mode
919 compile)
920 modename="$modename: compile"
921 # Get the compilation command and the source file.
922 base_compile=
923 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
924 suppress_opt=yes
925 suppress_output=
926 arg_mode=normal
927 libobj=
928 later=
930 for arg
932 case "$arg_mode" in
933 arg )
934 # do not "continue". Instead, add this to base_compile
935 lastarg="$arg"
936 arg_mode=normal
939 target )
940 libobj="$arg"
941 arg_mode=normal
942 continue
945 normal )
946 # Accept any command-line options.
947 case $arg in
949 if test -n "$libobj" ; then
950 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
951 exit $EXIT_FAILURE
953 arg_mode=target
954 continue
957 -static | -prefer-pic | -prefer-non-pic)
958 later="$later $arg"
959 continue
962 -no-suppress)
963 suppress_opt=no
964 continue
967 -Xcompiler)
968 arg_mode=arg # the next one goes into the "base_compile" arg list
969 continue # The current "srcfile" will either be retained or
970 ;; # replaced later. I would guess that would be a bug.
972 -Wc,*)
973 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
974 lastarg=
975 save_ifs="$IFS"; IFS=','
976 for arg in $args; do
977 IFS="$save_ifs"
979 # Double-quote args containing other shell metacharacters.
980 # Many Bourne shells cannot handle close brackets correctly
981 # in scan sets, so we specify it separately.
982 case $arg in
983 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
984 arg="\"$arg\""
986 esac
987 lastarg="$lastarg $arg"
988 done
989 IFS="$save_ifs"
990 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
992 # Add the arguments to base_compile.
993 base_compile="$base_compile $lastarg"
994 continue
998 # Accept the current argument as the source file.
999 # The previous "srcfile" becomes the current argument.
1001 lastarg="$srcfile"
1002 srcfile="$arg"
1004 esac # case $arg
1006 esac # case $arg_mode
1008 # Aesthetically quote the previous argument.
1009 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1011 case $lastarg in
1012 # Double-quote args containing other shell metacharacters.
1013 # Many Bourne shells cannot handle close brackets correctly
1014 # in scan sets, so we specify it separately.
1015 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1016 lastarg="\"$lastarg\""
1018 esac
1020 base_compile="$base_compile $lastarg"
1021 done # for arg
1023 case $arg_mode in
1024 arg)
1025 $echo "$modename: you must specify an argument for -Xcompile"
1026 exit $EXIT_FAILURE
1028 target)
1029 $echo "$modename: you must specify a target with \`-o'" 1>&2
1030 exit $EXIT_FAILURE
1033 # Get the name of the library object.
1034 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1036 esac
1038 # Recognize several different file suffixes.
1039 # If the user specifies -o file.o, it is replaced with file.lo
1040 xform='[cCFSifmso]'
1041 case $libobj in
1042 *.ada) xform=ada ;;
1043 *.adb) xform=adb ;;
1044 *.ads) xform=ads ;;
1045 *.asm) xform=asm ;;
1046 *.c++) xform=c++ ;;
1047 *.cc) xform=cc ;;
1048 *.ii) xform=ii ;;
1049 *.class) xform=class ;;
1050 *.cpp) xform=cpp ;;
1051 *.cxx) xform=cxx ;;
1052 *.f90) xform=f90 ;;
1053 *.for) xform=for ;;
1054 *.java) xform=java ;;
1055 esac
1057 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1059 case $libobj in
1060 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1062 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1063 exit $EXIT_FAILURE
1065 esac
1067 func_infer_tag $base_compile
1069 for arg in $later; do
1070 case $arg in
1071 -static)
1072 build_old_libs=yes
1073 continue
1076 -prefer-pic)
1077 pic_mode=yes
1078 continue
1081 -prefer-non-pic)
1082 pic_mode=no
1083 continue
1085 esac
1086 done
1088 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1089 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1090 if test "X$xdir" = "X$obj"; then
1091 xdir=
1092 else
1093 xdir=$xdir/
1095 lobj=${xdir}$objdir/$objname
1097 if test -z "$base_compile"; then
1098 $echo "$modename: you must specify a compilation command" 1>&2
1099 $echo "$help" 1>&2
1100 exit $EXIT_FAILURE
1103 # Delete any leftover library objects.
1104 if test "$build_old_libs" = yes; then
1105 removelist="$obj $lobj $libobj ${libobj}T"
1106 else
1107 removelist="$lobj $libobj ${libobj}T"
1110 $run $rm $removelist
1111 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1113 # On Cygwin there's no "real" PIC flag so we must build both object types
1114 case $host_os in
1115 cygwin* | mingw* | pw32* | os2*)
1116 pic_mode=default
1118 esac
1119 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1120 # non-PIC code in shared libraries is not supported
1121 pic_mode=default
1124 # Calculate the filename of the output object if compiler does
1125 # not support -o with -c
1126 if test "$compiler_c_o" = no; then
1127 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1128 lockfile="$output_obj.lock"
1129 removelist="$removelist $output_obj $lockfile"
1130 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1131 else
1132 output_obj=
1133 need_locks=no
1134 lockfile=
1137 # Lock this critical section if it is needed
1138 # We use this script file to make the link, it avoids creating a new file
1139 if test "$need_locks" = yes; then
1140 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1141 $show "Waiting for $lockfile to be removed"
1142 sleep 2
1143 done
1144 elif test "$need_locks" = warn; then
1145 if test -f "$lockfile"; then
1146 $echo "\
1147 *** ERROR, $lockfile exists and contains:
1148 `cat $lockfile 2>/dev/null`
1150 This indicates that another process is trying to use the same
1151 temporary object file, and libtool could not work around it because
1152 your compiler does not support \`-c' and \`-o' together. If you
1153 repeat this compilation, it may succeed, by chance, but you had better
1154 avoid parallel builds (make -j) in this platform, or get a better
1155 compiler."
1157 $run $rm $removelist
1158 exit $EXIT_FAILURE
1160 $echo $srcfile > "$lockfile"
1163 if test -n "$fix_srcfile_path"; then
1164 eval srcfile=\"$fix_srcfile_path\"
1167 $run $rm "$libobj" "${libobj}T"
1169 # Create a libtool object file (analogous to a ".la" file),
1170 # but don't create it if we're doing a dry run.
1171 test -z "$run" && cat > ${libobj}T <<EOF
1172 # $libobj - a libtool object file
1173 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1175 # Please DO NOT delete this file!
1176 # It is necessary for linking the library.
1178 # Name of the PIC object.
1181 # Only build a PIC object if we are building libtool libraries.
1182 if test "$build_libtool_libs" = yes; then
1183 # Without this assignment, base_compile gets emptied.
1184 fbsd_hideous_sh_bug=$base_compile
1186 if test "$pic_mode" != no; then
1187 command="$base_compile $srcfile $pic_flag"
1188 else
1189 # Don't build PIC code
1190 command="$base_compile $srcfile"
1193 if test ! -d "${xdir}$objdir"; then
1194 $show "$mkdir ${xdir}$objdir"
1195 $run $mkdir ${xdir}$objdir
1196 status=$?
1197 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
1198 exit $status
1202 if test -z "$output_obj"; then
1203 # Place PIC objects in $objdir
1204 command="$command -o $lobj"
1207 $run $rm "$lobj" "$output_obj"
1209 $show "$command"
1210 if $run eval "$command"; then :
1211 else
1212 test -n "$output_obj" && $run $rm $removelist
1213 exit $EXIT_FAILURE
1216 if test "$need_locks" = warn &&
1217 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1218 $echo "\
1219 *** ERROR, $lockfile contains:
1220 `cat $lockfile 2>/dev/null`
1222 but it should contain:
1223 $srcfile
1225 This indicates that another process is trying to use the same
1226 temporary object file, and libtool could not work around it because
1227 your compiler does not support \`-c' and \`-o' together. If you
1228 repeat this compilation, it may succeed, by chance, but you had better
1229 avoid parallel builds (make -j) in this platform, or get a better
1230 compiler."
1232 $run $rm $removelist
1233 exit $EXIT_FAILURE
1236 # Just move the object if needed, then go on to compile the next one
1237 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1238 $show "$mv $output_obj $lobj"
1239 if $run $mv $output_obj $lobj; then :
1240 else
1241 error=$?
1242 $run $rm $removelist
1243 exit $error
1247 # Append the name of the PIC object to the libtool object file.
1248 test -z "$run" && cat >> ${libobj}T <<EOF
1249 pic_object='$objdir/$objname'
1253 # Allow error messages only from the first compilation.
1254 if test "$suppress_opt" = yes; then
1255 suppress_output=' >/dev/null 2>&1'
1257 else
1258 # No PIC object so indicate it doesn't exist in the libtool
1259 # object file.
1260 test -z "$run" && cat >> ${libobj}T <<EOF
1261 pic_object=none
1266 # Only build a position-dependent object if we build old libraries.
1267 if test "$build_old_libs" = yes; then
1268 if test "$pic_mode" != yes; then
1269 # Don't build PIC code
1270 command="$base_compile $srcfile"
1271 else
1272 command="$base_compile $srcfile $pic_flag"
1274 if test "$compiler_c_o" = yes; then
1275 command="$command -o $obj"
1278 # Suppress compiler output if we already did a PIC compilation.
1279 command="$command$suppress_output"
1280 $run $rm "$obj" "$output_obj"
1281 $show "$command"
1282 if $run eval "$command"; then :
1283 else
1284 $run $rm $removelist
1285 exit $EXIT_FAILURE
1288 if test "$need_locks" = warn &&
1289 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1290 $echo "\
1291 *** ERROR, $lockfile contains:
1292 `cat $lockfile 2>/dev/null`
1294 but it should contain:
1295 $srcfile
1297 This indicates that another process is trying to use the same
1298 temporary object file, and libtool could not work around it because
1299 your compiler does not support \`-c' and \`-o' together. If you
1300 repeat this compilation, it may succeed, by chance, but you had better
1301 avoid parallel builds (make -j) in this platform, or get a better
1302 compiler."
1304 $run $rm $removelist
1305 exit $EXIT_FAILURE
1308 # Just move the object if needed
1309 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1310 $show "$mv $output_obj $obj"
1311 if $run $mv $output_obj $obj; then :
1312 else
1313 error=$?
1314 $run $rm $removelist
1315 exit $error
1319 # Append the name of the non-PIC object the libtool object file.
1320 # Only append if the libtool object file exists.
1321 test -z "$run" && cat >> ${libobj}T <<EOF
1322 # Name of the non-PIC object.
1323 non_pic_object='$objname'
1326 else
1327 # Append the name of the non-PIC object the libtool object file.
1328 # Only append if the libtool object file exists.
1329 test -z "$run" && cat >> ${libobj}T <<EOF
1330 # Name of the non-PIC object.
1331 non_pic_object=none
1336 $run $mv "${libobj}T" "${libobj}"
1338 # Unlock the critical section if it was locked
1339 if test "$need_locks" != no; then
1340 $run $rm "$lockfile"
1343 exit $EXIT_SUCCESS
1346 # libtool link mode
1347 link | relink)
1348 modename="$modename: link"
1349 case $host in
1350 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1351 # It is impossible to link a dll without this setting, and
1352 # we shouldn't force the makefile maintainer to figure out
1353 # which system we are compiling for in order to pass an extra
1354 # flag for every libtool invocation.
1355 # allow_undefined=no
1357 # FIXME: Unfortunately, there are problems with the above when trying
1358 # to make a dll which has undefined symbols, in which case not
1359 # even a static library is built. For now, we need to specify
1360 # -no-undefined on the libtool link line when we can be certain
1361 # that all symbols are satisfied, otherwise we get a static library.
1362 allow_undefined=yes
1365 allow_undefined=yes
1367 esac
1368 libtool_args="$nonopt"
1369 base_compile="$nonopt $@"
1370 compile_command="$nonopt"
1371 finalize_command="$nonopt"
1373 compile_rpath=
1374 finalize_rpath=
1375 compile_shlibpath=
1376 finalize_shlibpath=
1377 convenience=
1378 old_convenience=
1379 deplibs=
1380 old_deplibs=
1381 compiler_flags=
1382 linker_flags=
1383 dllsearchpath=
1384 lib_search_path=`pwd`
1385 inst_prefix_dir=
1387 avoid_version=no
1388 dlfiles=
1389 dlprefiles=
1390 dlself=no
1391 export_dynamic=no
1392 export_symbols=
1393 export_symbols_regex=
1394 generated=
1395 libobjs=
1396 ltlibs=
1397 module=no
1398 no_install=no
1399 objs=
1400 non_pic_objects=
1401 precious_files_regex=
1402 prefer_static_libs=no
1403 preload=no
1404 prev=
1405 prevarg=
1406 release=
1407 rpath=
1408 xrpath=
1409 perm_rpath=
1410 temp_rpath=
1411 thread_safe=no
1412 vinfo=
1413 vinfo_number=no
1415 func_infer_tag $base_compile
1417 # We need to know -static, to get the right output filenames.
1418 for arg
1420 case $arg in
1421 -all-static | -static)
1422 if test "X$arg" = "X-all-static"; then
1423 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1424 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1426 if test -n "$link_static_flag"; then
1427 dlopen_self=$dlopen_self_static
1429 else
1430 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1431 dlopen_self=$dlopen_self_static
1434 build_libtool_libs=no
1435 build_old_libs=yes
1436 prefer_static_libs=yes
1437 break
1439 esac
1440 done
1442 # See if our shared archives depend on static archives.
1443 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1445 # Go through the arguments, transforming them on the way.
1446 while test "$#" -gt 0; do
1447 arg="$1"
1448 shift
1449 case $arg in
1450 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1451 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1453 *) qarg=$arg ;;
1454 esac
1455 libtool_args="$libtool_args $qarg"
1457 # If the previous option needs an argument, assign it.
1458 if test -n "$prev"; then
1459 case $prev in
1460 output)
1461 compile_command="$compile_command @OUTPUT@"
1462 finalize_command="$finalize_command @OUTPUT@"
1464 esac
1466 case $prev in
1467 dlfiles|dlprefiles)
1468 if test "$preload" = no; then
1469 # Add the symbol object into the linking commands.
1470 compile_command="$compile_command @SYMFILE@"
1471 finalize_command="$finalize_command @SYMFILE@"
1472 preload=yes
1474 case $arg in
1475 *.la | *.lo) ;; # We handle these cases below.
1476 force)
1477 if test "$dlself" = no; then
1478 dlself=needless
1479 export_dynamic=yes
1481 prev=
1482 continue
1484 self)
1485 if test "$prev" = dlprefiles; then
1486 dlself=yes
1487 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1488 dlself=yes
1489 else
1490 dlself=needless
1491 export_dynamic=yes
1493 prev=
1494 continue
1497 if test "$prev" = dlfiles; then
1498 dlfiles="$dlfiles $arg"
1499 else
1500 dlprefiles="$dlprefiles $arg"
1502 prev=
1503 continue
1505 esac
1507 expsyms)
1508 export_symbols="$arg"
1509 if test ! -f "$arg"; then
1510 $echo "$modename: symbol file \`$arg' does not exist"
1511 exit $EXIT_FAILURE
1513 prev=
1514 continue
1516 expsyms_regex)
1517 export_symbols_regex="$arg"
1518 prev=
1519 continue
1521 inst_prefix)
1522 inst_prefix_dir="$arg"
1523 prev=
1524 continue
1526 precious_regex)
1527 precious_files_regex="$arg"
1528 prev=
1529 continue
1531 release)
1532 release="-$arg"
1533 prev=
1534 continue
1536 objectlist)
1537 if test -f "$arg"; then
1538 save_arg=$arg
1539 moreargs=
1540 for fil in `cat $save_arg`
1542 # moreargs="$moreargs $fil"
1543 arg=$fil
1544 # A libtool-controlled object.
1546 # Check to see that this really is a libtool object.
1547 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1548 pic_object=
1549 non_pic_object=
1551 # Read the .lo file
1552 # If there is no directory component, then add one.
1553 case $arg in
1554 */* | *\\*) . $arg ;;
1555 *) . ./$arg ;;
1556 esac
1558 if test -z "$pic_object" || \
1559 test -z "$non_pic_object" ||
1560 test "$pic_object" = none && \
1561 test "$non_pic_object" = none; then
1562 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1563 exit $EXIT_FAILURE
1566 # Extract subdirectory from the argument.
1567 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1568 if test "X$xdir" = "X$arg"; then
1569 xdir=
1570 else
1571 xdir="$xdir/"
1574 if test "$pic_object" != none; then
1575 # Prepend the subdirectory the object is found in.
1576 pic_object="$xdir$pic_object"
1578 if test "$prev" = dlfiles; then
1579 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1580 dlfiles="$dlfiles $pic_object"
1581 prev=
1582 continue
1583 else
1584 # If libtool objects are unsupported, then we need to preload.
1585 prev=dlprefiles
1589 # CHECK ME: I think I busted this. -Ossama
1590 if test "$prev" = dlprefiles; then
1591 # Preload the old-style object.
1592 dlprefiles="$dlprefiles $pic_object"
1593 prev=
1596 # A PIC object.
1597 libobjs="$libobjs $pic_object"
1598 arg="$pic_object"
1601 # Non-PIC object.
1602 if test "$non_pic_object" != none; then
1603 # Prepend the subdirectory the object is found in.
1604 non_pic_object="$xdir$non_pic_object"
1606 # A standard non-PIC object
1607 non_pic_objects="$non_pic_objects $non_pic_object"
1608 if test -z "$pic_object" || test "$pic_object" = none ; then
1609 arg="$non_pic_object"
1612 else
1613 # Only an error if not doing a dry-run.
1614 if test -z "$run"; then
1615 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1616 exit $EXIT_FAILURE
1617 else
1618 # Dry-run case.
1620 # Extract subdirectory from the argument.
1621 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1622 if test "X$xdir" = "X$arg"; then
1623 xdir=
1624 else
1625 xdir="$xdir/"
1628 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1629 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1630 libobjs="$libobjs $pic_object"
1631 non_pic_objects="$non_pic_objects $non_pic_object"
1634 done
1635 else
1636 $echo "$modename: link input file \`$save_arg' does not exist"
1637 exit $EXIT_FAILURE
1639 arg=$save_arg
1640 prev=
1641 continue
1643 rpath | xrpath)
1644 # We need an absolute path.
1645 case $arg in
1646 [\\/]* | [A-Za-z]:[\\/]*) ;;
1648 $echo "$modename: only absolute run-paths are allowed" 1>&2
1649 exit $EXIT_FAILURE
1651 esac
1652 if test "$prev" = rpath; then
1653 case "$rpath " in
1654 *" $arg "*) ;;
1655 *) rpath="$rpath $arg" ;;
1656 esac
1657 else
1658 case "$xrpath " in
1659 *" $arg "*) ;;
1660 *) xrpath="$xrpath $arg" ;;
1661 esac
1663 prev=
1664 continue
1666 xcompiler)
1667 compiler_flags="$compiler_flags $qarg"
1668 prev=
1669 compile_command="$compile_command $qarg"
1670 finalize_command="$finalize_command $qarg"
1671 continue
1673 xlinker)
1674 linker_flags="$linker_flags $qarg"
1675 compiler_flags="$compiler_flags $wl$qarg"
1676 prev=
1677 compile_command="$compile_command $wl$qarg"
1678 finalize_command="$finalize_command $wl$qarg"
1679 continue
1681 xcclinker)
1682 linker_flags="$linker_flags $qarg"
1683 compiler_flags="$compiler_flags $qarg"
1684 prev=
1685 compile_command="$compile_command $qarg"
1686 finalize_command="$finalize_command $qarg"
1687 continue
1689 shrext)
1690 shrext_cmds="$arg"
1691 prev=
1692 continue
1695 eval "$prev=\"\$arg\""
1696 prev=
1697 continue
1699 esac
1700 fi # test -n "$prev"
1702 prevarg="$arg"
1704 case $arg in
1705 -all-static)
1706 if test -n "$link_static_flag"; then
1707 compile_command="$compile_command $link_static_flag"
1708 finalize_command="$finalize_command $link_static_flag"
1710 continue
1713 -allow-undefined)
1714 # FIXME: remove this flag sometime in the future.
1715 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1716 continue
1719 -avoid-version)
1720 avoid_version=yes
1721 continue
1724 -dlopen)
1725 prev=dlfiles
1726 continue
1729 -dlpreopen)
1730 prev=dlprefiles
1731 continue
1734 -export-dynamic)
1735 export_dynamic=yes
1736 continue
1739 -export-symbols | -export-symbols-regex)
1740 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1741 $echo "$modename: more than one -exported-symbols argument is not allowed"
1742 exit $EXIT_FAILURE
1744 if test "X$arg" = "X-export-symbols"; then
1745 prev=expsyms
1746 else
1747 prev=expsyms_regex
1749 continue
1752 -inst-prefix-dir)
1753 prev=inst_prefix
1754 continue
1757 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1758 # so, if we see these flags be careful not to treat them like -L
1759 -L[A-Z][A-Z]*:*)
1760 case $with_gcc/$host in
1761 no/*-*-irix* | /*-*-irix*)
1762 compile_command="$compile_command $arg"
1763 finalize_command="$finalize_command $arg"
1765 esac
1766 continue
1769 -L*)
1770 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1771 # We need an absolute path.
1772 case $dir in
1773 [\\/]* | [A-Za-z]:[\\/]*) ;;
1775 absdir=`cd "$dir" && pwd`
1776 if test -z "$absdir"; then
1777 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1778 exit $EXIT_FAILURE
1780 dir="$absdir"
1782 esac
1783 case "$deplibs " in
1784 *" -L$dir "*) ;;
1786 deplibs="$deplibs -L$dir"
1787 lib_search_path="$lib_search_path $dir"
1789 esac
1790 case $host in
1791 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1792 case :$dllsearchpath: in
1793 *":$dir:"*) ;;
1794 *) dllsearchpath="$dllsearchpath:$dir";;
1795 esac
1797 esac
1798 continue
1801 -l*)
1802 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1803 case $host in
1804 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1805 # These systems don't actually have a C or math library (as such)
1806 continue
1808 *-*-mingw* | *-*-os2*)
1809 # These systems don't actually have a C library (as such)
1810 test "X$arg" = "X-lc" && continue
1812 *-*-openbsd* | *-*-freebsd*)
1813 # Do not include libc due to us having libc/libc_r.
1814 test "X$arg" = "X-lc" && continue
1816 *-*-rhapsody* | *-*-darwin1.[012])
1817 # Rhapsody C and math libraries are in the System framework
1818 deplibs="$deplibs -framework System"
1819 continue
1820 esac
1821 elif test "X$arg" = "X-lc_r"; then
1822 case $host in
1823 *-*-openbsd* | *-*-freebsd*)
1824 # Do not include libc_r directly, use -pthread flag.
1825 continue
1827 esac
1829 deplibs="$deplibs $arg"
1830 continue
1833 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1834 deplibs="$deplibs $arg"
1835 continue
1838 -module)
1839 module=yes
1840 continue
1843 # gcc -m* arguments should be passed to the linker via $compiler_flags
1844 # in order to pass architecture information to the linker
1845 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1846 # but this is not reliable with gcc because gcc may use -mfoo to
1847 # select a different linker, different libraries, etc, while
1848 # -Wl,-mfoo simply passes -mfoo to the linker.
1849 -m*)
1850 # Unknown arguments in both finalize_command and compile_command need
1851 # to be aesthetically quoted because they are evaled later.
1852 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1853 case $arg in
1854 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1855 arg="\"$arg\""
1857 esac
1858 compile_command="$compile_command $arg"
1859 finalize_command="$finalize_command $arg"
1860 if test "$with_gcc" = "yes" ; then
1861 compiler_flags="$compiler_flags $arg"
1863 continue
1866 -shrext)
1867 prev=shrext
1868 continue
1871 -no-fast-install)
1872 fast_install=no
1873 continue
1876 -no-install)
1877 case $host in
1878 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1879 # The PATH hackery in wrapper scripts is required on Windows
1880 # in order for the loader to find any dlls it needs.
1881 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1882 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1883 fast_install=no
1885 *) no_install=yes ;;
1886 esac
1887 continue
1890 -no-undefined)
1891 allow_undefined=no
1892 continue
1895 -objectlist)
1896 prev=objectlist
1897 continue
1900 -o) prev=output ;;
1902 -precious-files-regex)
1903 prev=precious_regex
1904 continue
1907 -release)
1908 prev=release
1909 continue
1912 -rpath)
1913 prev=rpath
1914 continue
1918 prev=xrpath
1919 continue
1922 -R*)
1923 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1924 # We need an absolute path.
1925 case $dir in
1926 [\\/]* | [A-Za-z]:[\\/]*) ;;
1928 $echo "$modename: only absolute run-paths are allowed" 1>&2
1929 exit $EXIT_FAILURE
1931 esac
1932 case "$xrpath " in
1933 *" $dir "*) ;;
1934 *) xrpath="$xrpath $dir" ;;
1935 esac
1936 continue
1939 -static)
1940 # The effects of -static are defined in a previous loop.
1941 # We used to do the same as -all-static on platforms that
1942 # didn't have a PIC flag, but the assumption that the effects
1943 # would be equivalent was wrong. It would break on at least
1944 # Digital Unix and AIX.
1945 continue
1948 -thread-safe)
1949 thread_safe=yes
1950 continue
1953 -version-info)
1954 prev=vinfo
1955 continue
1957 -version-number)
1958 prev=vinfo
1959 vinfo_number=yes
1960 continue
1963 -Wc,*)
1964 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1965 arg=
1966 save_ifs="$IFS"; IFS=','
1967 for flag in $args; do
1968 IFS="$save_ifs"
1969 case $flag in
1970 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1971 flag="\"$flag\""
1973 esac
1974 arg="$arg $wl$flag"
1975 compiler_flags="$compiler_flags $flag"
1976 done
1977 IFS="$save_ifs"
1978 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1981 -Wl,*)
1982 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1983 arg=
1984 save_ifs="$IFS"; IFS=','
1985 for flag in $args; do
1986 IFS="$save_ifs"
1987 case $flag in
1988 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1989 flag="\"$flag\""
1991 esac
1992 arg="$arg $wl$flag"
1993 compiler_flags="$compiler_flags $wl$flag"
1994 linker_flags="$linker_flags $flag"
1995 done
1996 IFS="$save_ifs"
1997 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2000 -Xcompiler)
2001 prev=xcompiler
2002 continue
2005 -Xlinker)
2006 prev=xlinker
2007 continue
2010 -XCClinker)
2011 prev=xcclinker
2012 continue
2015 # Some other compiler flag.
2016 -* | +*)
2017 # Unknown arguments in both finalize_command and compile_command need
2018 # to be aesthetically quoted because they are evaled later.
2019 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2020 case $arg in
2021 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2022 arg="\"$arg\""
2024 esac
2027 *.$objext)
2028 # A standard object.
2029 objs="$objs $arg"
2032 *.lo)
2033 # A libtool-controlled object.
2035 # Check to see that this really is a libtool object.
2036 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2037 pic_object=
2038 non_pic_object=
2040 # Read the .lo file
2041 # If there is no directory component, then add one.
2042 case $arg in
2043 */* | *\\*) . $arg ;;
2044 *) . ./$arg ;;
2045 esac
2047 if test -z "$pic_object" || \
2048 test -z "$non_pic_object" ||
2049 test "$pic_object" = none && \
2050 test "$non_pic_object" = none; then
2051 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2052 exit $EXIT_FAILURE
2055 # Extract subdirectory from the argument.
2056 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2057 if test "X$xdir" = "X$arg"; then
2058 xdir=
2059 else
2060 xdir="$xdir/"
2063 if test "$pic_object" != none; then
2064 # Prepend the subdirectory the object is found in.
2065 pic_object="$xdir$pic_object"
2067 if test "$prev" = dlfiles; then
2068 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2069 dlfiles="$dlfiles $pic_object"
2070 prev=
2071 continue
2072 else
2073 # If libtool objects are unsupported, then we need to preload.
2074 prev=dlprefiles
2078 # CHECK ME: I think I busted this. -Ossama
2079 if test "$prev" = dlprefiles; then
2080 # Preload the old-style object.
2081 dlprefiles="$dlprefiles $pic_object"
2082 prev=
2085 # A PIC object.
2086 libobjs="$libobjs $pic_object"
2087 arg="$pic_object"
2090 # Non-PIC object.
2091 if test "$non_pic_object" != none; then
2092 # Prepend the subdirectory the object is found in.
2093 non_pic_object="$xdir$non_pic_object"
2095 # A standard non-PIC object
2096 non_pic_objects="$non_pic_objects $non_pic_object"
2097 if test -z "$pic_object" || test "$pic_object" = none ; then
2098 arg="$non_pic_object"
2101 else
2102 # Only an error if not doing a dry-run.
2103 if test -z "$run"; then
2104 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2105 exit $EXIT_FAILURE
2106 else
2107 # Dry-run case.
2109 # Extract subdirectory from the argument.
2110 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2111 if test "X$xdir" = "X$arg"; then
2112 xdir=
2113 else
2114 xdir="$xdir/"
2117 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2118 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2119 libobjs="$libobjs $pic_object"
2120 non_pic_objects="$non_pic_objects $non_pic_object"
2125 *.$libext)
2126 # An archive.
2127 deplibs="$deplibs $arg"
2128 old_deplibs="$old_deplibs $arg"
2129 continue
2132 *.la)
2133 # A libtool-controlled library.
2135 if test "$prev" = dlfiles; then
2136 # This library was specified with -dlopen.
2137 dlfiles="$dlfiles $arg"
2138 prev=
2139 elif test "$prev" = dlprefiles; then
2140 # The library was specified with -dlpreopen.
2141 dlprefiles="$dlprefiles $arg"
2142 prev=
2143 else
2144 deplibs="$deplibs $arg"
2146 continue
2149 # Some other compiler argument.
2151 # Unknown arguments in both finalize_command and compile_command need
2152 # to be aesthetically quoted because they are evaled later.
2153 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2154 case $arg in
2155 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2156 arg="\"$arg\""
2158 esac
2160 esac # arg
2162 # Now actually substitute the argument into the commands.
2163 if test -n "$arg"; then
2164 compile_command="$compile_command $arg"
2165 finalize_command="$finalize_command $arg"
2167 done # argument parsing loop
2169 if test -n "$prev"; then
2170 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2171 $echo "$help" 1>&2
2172 exit $EXIT_FAILURE
2175 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2176 eval arg=\"$export_dynamic_flag_spec\"
2177 compile_command="$compile_command $arg"
2178 finalize_command="$finalize_command $arg"
2181 oldlibs=
2182 # calculate the name of the file, without its directory
2183 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2184 libobjs_save="$libobjs"
2186 if test -n "$shlibpath_var"; then
2187 # get the directories listed in $shlibpath_var
2188 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2189 else
2190 shlib_search_path=
2192 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2193 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2195 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2196 if test "X$output_objdir" = "X$output"; then
2197 output_objdir="$objdir"
2198 else
2199 output_objdir="$output_objdir/$objdir"
2201 # Create the object directory.
2202 if test ! -d "$output_objdir"; then
2203 $show "$mkdir $output_objdir"
2204 $run $mkdir $output_objdir
2205 status=$?
2206 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
2207 exit $status
2211 # Determine the type of output
2212 case $output in
2214 $echo "$modename: you must specify an output file" 1>&2
2215 $echo "$help" 1>&2
2216 exit $EXIT_FAILURE
2218 *.$libext) linkmode=oldlib ;;
2219 *.lo | *.$objext) linkmode=obj ;;
2220 *.la) linkmode=lib ;;
2221 *) linkmode=prog ;; # Anything else should be a program.
2222 esac
2224 case $host in
2225 *cygwin* | *mingw* | *pw32*)
2226 # don't eliminate duplications in $postdeps and $predeps
2227 duplicate_compiler_generated_deps=yes
2230 duplicate_compiler_generated_deps=$duplicate_deps
2232 esac
2233 specialdeplibs=
2235 libs=
2236 # Find all interdependent deplibs by searching for libraries
2237 # that are linked more than once (e.g. -la -lb -la)
2238 for deplib in $deplibs; do
2239 if test "X$duplicate_deps" = "Xyes" ; then
2240 case "$libs " in
2241 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2242 esac
2244 libs="$libs $deplib"
2245 done
2247 if test "$linkmode" = lib; then
2248 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2250 # Compute libraries that are listed more than once in $predeps
2251 # $postdeps and mark them as special (i.e., whose duplicates are
2252 # not to be eliminated).
2253 pre_post_deps=
2254 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2255 for pre_post_dep in $predeps $postdeps; do
2256 case "$pre_post_deps " in
2257 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2258 esac
2259 pre_post_deps="$pre_post_deps $pre_post_dep"
2260 done
2262 pre_post_deps=
2265 deplibs=
2266 newdependency_libs=
2267 newlib_search_path=
2268 need_relink=no # whether we're linking any uninstalled libtool libraries
2269 notinst_deplibs= # not-installed libtool libraries
2270 notinst_path= # paths that contain not-installed libtool libraries
2271 case $linkmode in
2272 lib)
2273 passes="conv link"
2274 for file in $dlfiles $dlprefiles; do
2275 case $file in
2276 *.la) ;;
2278 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2279 exit $EXIT_FAILURE
2281 esac
2282 done
2284 prog)
2285 compile_deplibs=
2286 finalize_deplibs=
2287 alldeplibs=no
2288 newdlfiles=
2289 newdlprefiles=
2290 passes="conv scan dlopen dlpreopen link"
2292 *) passes="conv"
2294 esac
2295 for pass in $passes; do
2296 if test "$linkmode,$pass" = "lib,link" ||
2297 test "$linkmode,$pass" = "prog,scan"; then
2298 libs="$deplibs"
2299 deplibs=
2301 if test "$linkmode" = prog; then
2302 case $pass in
2303 dlopen) libs="$dlfiles" ;;
2304 dlpreopen) libs="$dlprefiles" ;;
2305 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2306 esac
2308 if test "$pass" = dlopen; then
2309 # Collect dlpreopened libraries
2310 save_deplibs="$deplibs"
2311 deplibs=
2313 for deplib in $libs; do
2314 lib=
2315 found=no
2316 case $deplib in
2317 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2318 if test "$linkmode,$pass" = "prog,link"; then
2319 compile_deplibs="$deplib $compile_deplibs"
2320 finalize_deplibs="$deplib $finalize_deplibs"
2321 else
2322 deplibs="$deplib $deplibs"
2324 continue
2326 -l*)
2327 if test "$linkmode" != lib && test "$linkmode" != prog; then
2328 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2329 continue
2331 if test "$pass" = conv; then
2332 deplibs="$deplib $deplibs"
2333 continue
2335 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2336 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2337 for search_ext in .la $std_shrext .so .a; do
2338 # Search the libtool library
2339 lib="$searchdir/lib${name}${search_ext}"
2340 if test -f "$lib"; then
2341 if test "$search_ext" = ".la"; then
2342 found=yes
2343 else
2344 found=no
2346 break 2
2348 done
2349 done
2350 if test "$found" != yes; then
2351 # deplib doesn't seem to be a libtool library
2352 if test "$linkmode,$pass" = "prog,link"; then
2353 compile_deplibs="$deplib $compile_deplibs"
2354 finalize_deplibs="$deplib $finalize_deplibs"
2355 else
2356 deplibs="$deplib $deplibs"
2357 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2359 continue
2360 else # deplib is a libtool library
2361 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2362 # We need to do some special things here, and not later.
2363 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2364 case " $predeps $postdeps " in
2365 *" $deplib "*)
2366 if (${SED} -e '2q' $lib |
2367 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2368 library_names=
2369 old_library=
2370 case $lib in
2371 */* | *\\*) . $lib ;;
2372 *) . ./$lib ;;
2373 esac
2374 for l in $old_library $library_names; do
2375 ll="$l"
2376 done
2377 if test "X$ll" = "X$old_library" ; then # only static version available
2378 found=no
2379 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2380 test "X$ladir" = "X$lib" && ladir="."
2381 lib=$ladir/$old_library
2382 if test "$linkmode,$pass" = "prog,link"; then
2383 compile_deplibs="$deplib $compile_deplibs"
2384 finalize_deplibs="$deplib $finalize_deplibs"
2385 else
2386 deplibs="$deplib $deplibs"
2387 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2389 continue
2393 *) ;;
2394 esac
2397 ;; # -l
2398 -L*)
2399 case $linkmode in
2400 lib)
2401 deplibs="$deplib $deplibs"
2402 test "$pass" = conv && continue
2403 newdependency_libs="$deplib $newdependency_libs"
2404 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2406 prog)
2407 if test "$pass" = conv; then
2408 deplibs="$deplib $deplibs"
2409 continue
2411 if test "$pass" = scan; then
2412 deplibs="$deplib $deplibs"
2413 else
2414 compile_deplibs="$deplib $compile_deplibs"
2415 finalize_deplibs="$deplib $finalize_deplibs"
2417 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2420 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2422 esac # linkmode
2423 continue
2424 ;; # -L
2425 -R*)
2426 if test "$pass" = link; then
2427 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2428 # Make sure the xrpath contains only unique directories.
2429 case "$xrpath " in
2430 *" $dir "*) ;;
2431 *) xrpath="$xrpath $dir" ;;
2432 esac
2434 deplibs="$deplib $deplibs"
2435 continue
2437 *.la) lib="$deplib" ;;
2438 *.$libext)
2439 if test "$pass" = conv; then
2440 deplibs="$deplib $deplibs"
2441 continue
2443 case $linkmode in
2444 lib)
2445 valid_a_lib=no
2446 case $deplibs_check_method in
2447 match_pattern*)
2448 set dummy $deplibs_check_method
2449 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2450 if eval $echo \"$deplib\" 2>/dev/null \
2451 | $SED 10q \
2452 | $EGREP "$match_pattern_regex" > /dev/null; then
2453 valid_a_lib=yes
2456 pass_all)
2457 valid_a_lib=yes
2459 esac
2460 if test "$valid_a_lib" != yes; then
2461 $echo
2462 $echo "*** Warning: Trying to link with static lib archive $deplib."
2463 $echo "*** I have the capability to make that library automatically link in when"
2464 $echo "*** you link to this library. But I can only do this if you have a"
2465 $echo "*** shared version of the library, which you do not appear to have"
2466 $echo "*** because the file extensions .$libext of this argument makes me believe"
2467 $echo "*** that it is just a static archive that I should not used here."
2468 else
2469 $echo
2470 $echo "*** Warning: Linking the shared library $output against the"
2471 $echo "*** static library $deplib is not portable!"
2472 deplibs="$deplib $deplibs"
2474 continue
2476 prog)
2477 if test "$pass" != link; then
2478 deplibs="$deplib $deplibs"
2479 else
2480 compile_deplibs="$deplib $compile_deplibs"
2481 finalize_deplibs="$deplib $finalize_deplibs"
2483 continue
2485 esac # linkmode
2486 ;; # *.$libext
2487 *.lo | *.$objext)
2488 if test "$pass" = conv; then
2489 deplibs="$deplib $deplibs"
2490 elif test "$linkmode" = prog; then
2491 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2492 # If there is no dlopen support or we're linking statically,
2493 # we need to preload.
2494 newdlprefiles="$newdlprefiles $deplib"
2495 compile_deplibs="$deplib $compile_deplibs"
2496 finalize_deplibs="$deplib $finalize_deplibs"
2497 else
2498 newdlfiles="$newdlfiles $deplib"
2501 continue
2503 %DEPLIBS%)
2504 alldeplibs=yes
2505 continue
2507 esac # case $deplib
2508 if test "$found" = yes || test -f "$lib"; then :
2509 else
2510 $echo "$modename: cannot find the library \`$lib'" 1>&2
2511 exit $EXIT_FAILURE
2514 # Check to see that this really is a libtool archive.
2515 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2516 else
2517 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2518 exit $EXIT_FAILURE
2521 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2522 test "X$ladir" = "X$lib" && ladir="."
2524 dlname=
2525 dlopen=
2526 dlpreopen=
2527 libdir=
2528 library_names=
2529 old_library=
2530 # If the library was installed with an old release of libtool,
2531 # it will not redefine variables installed, or shouldnotlink
2532 installed=yes
2533 shouldnotlink=no
2535 # Read the .la file
2536 case $lib in
2537 */* | *\\*) . $lib ;;
2538 *) . ./$lib ;;
2539 esac
2541 if test "$linkmode,$pass" = "lib,link" ||
2542 test "$linkmode,$pass" = "prog,scan" ||
2543 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2544 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2545 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2548 if test "$pass" = conv; then
2549 # Only check for convenience libraries
2550 deplibs="$lib $deplibs"
2551 if test -z "$libdir"; then
2552 if test -z "$old_library"; then
2553 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2554 exit $EXIT_FAILURE
2556 # It is a libtool convenience library, so add in its objects.
2557 convenience="$convenience $ladir/$objdir/$old_library"
2558 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2559 tmp_libs=
2560 for deplib in $dependency_libs; do
2561 deplibs="$deplib $deplibs"
2562 if test "X$duplicate_deps" = "Xyes" ; then
2563 case "$tmp_libs " in
2564 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2565 esac
2567 tmp_libs="$tmp_libs $deplib"
2568 done
2569 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2570 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2571 exit $EXIT_FAILURE
2573 continue
2574 fi # $pass = conv
2577 # Get the name of the library we link against.
2578 linklib=
2579 for l in $old_library $library_names; do
2580 linklib="$l"
2581 done
2582 if test -z "$linklib"; then
2583 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2584 exit $EXIT_FAILURE
2587 # This library was specified with -dlopen.
2588 if test "$pass" = dlopen; then
2589 if test -z "$libdir"; then
2590 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2591 exit $EXIT_FAILURE
2593 if test -z "$dlname" ||
2594 test "$dlopen_support" != yes ||
2595 test "$build_libtool_libs" = no; then
2596 # If there is no dlname, no dlopen support or we're linking
2597 # statically, we need to preload. We also need to preload any
2598 # dependent libraries so libltdl's deplib preloader doesn't
2599 # bomb out in the load deplibs phase.
2600 dlprefiles="$dlprefiles $lib $dependency_libs"
2601 else
2602 newdlfiles="$newdlfiles $lib"
2604 continue
2605 fi # $pass = dlopen
2607 # We need an absolute path.
2608 case $ladir in
2609 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2611 abs_ladir=`cd "$ladir" && pwd`
2612 if test -z "$abs_ladir"; then
2613 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2614 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2615 abs_ladir="$ladir"
2618 esac
2619 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2621 # Find the relevant object directory and library name.
2622 if test "X$installed" = Xyes; then
2623 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2624 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2625 dir="$ladir"
2626 absdir="$abs_ladir"
2627 libdir="$abs_ladir"
2628 else
2629 dir="$libdir"
2630 absdir="$libdir"
2632 else
2633 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2634 dir="$ladir"
2635 absdir="$abs_ladir"
2636 # Remove this search path later
2637 notinst_path="$notinst_path $abs_ladir"
2638 else
2639 dir="$ladir/$objdir"
2640 absdir="$abs_ladir/$objdir"
2641 # Remove this search path later
2642 notinst_path="$notinst_path $abs_ladir"
2644 fi # $installed = yes
2645 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2647 # This library was specified with -dlpreopen.
2648 if test "$pass" = dlpreopen; then
2649 if test -z "$libdir"; then
2650 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2651 exit $EXIT_FAILURE
2653 # Prefer using a static library (so that no silly _DYNAMIC symbols
2654 # are required to link).
2655 if test -n "$old_library"; then
2656 newdlprefiles="$newdlprefiles $dir/$old_library"
2657 # Otherwise, use the dlname, so that lt_dlopen finds it.
2658 elif test -n "$dlname"; then
2659 newdlprefiles="$newdlprefiles $dir/$dlname"
2660 else
2661 newdlprefiles="$newdlprefiles $dir/$linklib"
2663 fi # $pass = dlpreopen
2665 if test -z "$libdir"; then
2666 # Link the convenience library
2667 if test "$linkmode" = lib; then
2668 deplibs="$dir/$old_library $deplibs"
2669 elif test "$linkmode,$pass" = "prog,link"; then
2670 compile_deplibs="$dir/$old_library $compile_deplibs"
2671 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2672 else
2673 deplibs="$lib $deplibs" # used for prog,scan pass
2675 continue
2679 if test "$linkmode" = prog && test "$pass" != link; then
2680 newlib_search_path="$newlib_search_path $ladir"
2681 deplibs="$lib $deplibs"
2683 linkalldeplibs=no
2684 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2685 test "$build_libtool_libs" = no; then
2686 linkalldeplibs=yes
2689 tmp_libs=
2690 for deplib in $dependency_libs; do
2691 case $deplib in
2692 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2693 esac
2694 # Need to link against all dependency_libs?
2695 if test "$linkalldeplibs" = yes; then
2696 deplibs="$deplib $deplibs"
2697 else
2698 # Need to hardcode shared library paths
2699 # or/and link against static libraries
2700 newdependency_libs="$deplib $newdependency_libs"
2702 if test "X$duplicate_deps" = "Xyes" ; then
2703 case "$tmp_libs " in
2704 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2705 esac
2707 tmp_libs="$tmp_libs $deplib"
2708 done # for deplib
2709 continue
2710 fi # $linkmode = prog...
2712 if test "$linkmode,$pass" = "prog,link"; then
2713 if test -n "$library_names" &&
2714 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2715 # We need to hardcode the library path
2716 if test -n "$shlibpath_var"; then
2717 # Make sure the rpath contains only unique directories.
2718 case "$temp_rpath " in
2719 *" $dir "*) ;;
2720 *" $absdir "*) ;;
2721 *) temp_rpath="$temp_rpath $dir" ;;
2722 esac
2725 # Hardcode the library path.
2726 # Skip directories that are in the system default run-time
2727 # search path.
2728 case " $sys_lib_dlsearch_path " in
2729 *" $absdir "*) ;;
2731 case "$compile_rpath " in
2732 *" $absdir "*) ;;
2733 *) compile_rpath="$compile_rpath $absdir"
2734 esac
2736 esac
2737 case " $sys_lib_dlsearch_path " in
2738 *" $libdir "*) ;;
2740 case "$finalize_rpath " in
2741 *" $libdir "*) ;;
2742 *) finalize_rpath="$finalize_rpath $libdir"
2743 esac
2745 esac
2746 fi # $linkmode,$pass = prog,link...
2748 if test "$alldeplibs" = yes &&
2749 { test "$deplibs_check_method" = pass_all ||
2750 { test "$build_libtool_libs" = yes &&
2751 test -n "$library_names"; }; }; then
2752 # We only need to search for static libraries
2753 continue
2757 link_static=no # Whether the deplib will be linked statically
2758 if test -n "$library_names" &&
2759 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2760 if test "$installed" = no; then
2761 notinst_deplibs="$notinst_deplibs $lib"
2762 need_relink=yes
2764 # This is a shared library
2766 # Warn about portability, can't link against -module's on
2767 # some systems (darwin)
2768 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2769 $echo
2770 if test "$linkmode" = prog; then
2771 $echo "*** Warning: Linking the executable $output against the loadable module"
2772 else
2773 $echo "*** Warning: Linking the shared library $output against the loadable module"
2775 $echo "*** $linklib is not portable!"
2777 if test "$linkmode" = lib &&
2778 test "$hardcode_into_libs" = yes; then
2779 # Hardcode the library path.
2780 # Skip directories that are in the system default run-time
2781 # search path.
2782 case " $sys_lib_dlsearch_path " in
2783 *" $absdir "*) ;;
2785 case "$compile_rpath " in
2786 *" $absdir "*) ;;
2787 *) compile_rpath="$compile_rpath $absdir"
2788 esac
2790 esac
2791 case " $sys_lib_dlsearch_path " in
2792 *" $libdir "*) ;;
2794 case "$finalize_rpath " in
2795 *" $libdir "*) ;;
2796 *) finalize_rpath="$finalize_rpath $libdir"
2797 esac
2799 esac
2802 if test -n "$old_archive_from_expsyms_cmds"; then
2803 # figure out the soname
2804 set dummy $library_names
2805 realname="$2"
2806 shift; shift
2807 libname=`eval \\$echo \"$libname_spec\"`
2808 # use dlname if we got it. it's perfectly good, no?
2809 if test -n "$dlname"; then
2810 soname="$dlname"
2811 elif test -n "$soname_spec"; then
2812 # bleh windows
2813 case $host in
2814 *cygwin* | mingw*)
2815 major=`expr $current - $age`
2816 versuffix="-$major"
2818 esac
2819 eval soname=\"$soname_spec\"
2820 else
2821 soname="$realname"
2824 # Make a new name for the extract_expsyms_cmds to use
2825 soroot="$soname"
2826 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2827 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2829 # If the library has no export list, then create one now
2830 if test -f "$output_objdir/$soname-def"; then :
2831 else
2832 $show "extracting exported symbol list from \`$soname'"
2833 save_ifs="$IFS"; IFS='~'
2834 cmds=$extract_expsyms_cmds
2835 for cmd in $cmds; do
2836 IFS="$save_ifs"
2837 eval cmd=\"$cmd\"
2838 $show "$cmd"
2839 $run eval "$cmd" || exit $?
2840 done
2841 IFS="$save_ifs"
2844 # Create $newlib
2845 if test -f "$output_objdir/$newlib"; then :; else
2846 $show "generating import library for \`$soname'"
2847 save_ifs="$IFS"; IFS='~'
2848 cmds=$old_archive_from_expsyms_cmds
2849 for cmd in $cmds; do
2850 IFS="$save_ifs"
2851 eval cmd=\"$cmd\"
2852 $show "$cmd"
2853 $run eval "$cmd" || exit $?
2854 done
2855 IFS="$save_ifs"
2857 # make sure the library variables are pointing to the new library
2858 dir=$output_objdir
2859 linklib=$newlib
2860 fi # test -n "$old_archive_from_expsyms_cmds"
2862 if test "$linkmode" = prog || test "$mode" != relink; then
2863 add_shlibpath=
2864 add_dir=
2865 add=
2866 lib_linked=yes
2867 case $hardcode_action in
2868 immediate | unsupported)
2869 if test "$hardcode_direct" = no; then
2870 add="$dir/$linklib"
2871 case $host in
2872 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2873 *-*-darwin* )
2874 # if the lib is a module then we can not link against
2875 # it, someone is ignoring the new warnings I added
2876 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2877 $echo "** Warning, lib $linklib is a module, not a shared library"
2878 if test -z "$old_library" ; then
2879 $echo
2880 $echo "** And there doesn't seem to be a static archive available"
2881 $echo "** The link will probably fail, sorry"
2882 else
2883 add="$dir/$old_library"
2886 esac
2887 elif test "$hardcode_minus_L" = no; then
2888 case $host in
2889 *-*-sunos*) add_shlibpath="$dir" ;;
2890 esac
2891 add_dir="-L$dir"
2892 add="-l$name"
2893 elif test "$hardcode_shlibpath_var" = no; then
2894 add_shlibpath="$dir"
2895 add="-l$name"
2896 else
2897 lib_linked=no
2900 relink)
2901 if test "$hardcode_direct" = yes; then
2902 add="$dir/$linklib"
2903 elif test "$hardcode_minus_L" = yes; then
2904 add_dir="-L$dir"
2905 # Try looking first in the location we're being installed to.
2906 if test -n "$inst_prefix_dir"; then
2907 case "$libdir" in
2908 [\\/]*)
2909 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2911 esac
2913 add="-l$name"
2914 elif test "$hardcode_shlibpath_var" = yes; then
2915 add_shlibpath="$dir"
2916 add="-l$name"
2917 else
2918 lib_linked=no
2921 *) lib_linked=no ;;
2922 esac
2924 if test "$lib_linked" != yes; then
2925 $echo "$modename: configuration error: unsupported hardcode properties"
2926 exit $EXIT_FAILURE
2929 if test -n "$add_shlibpath"; then
2930 case :$compile_shlibpath: in
2931 *":$add_shlibpath:"*) ;;
2932 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2933 esac
2935 if test "$linkmode" = prog; then
2936 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2937 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2938 else
2939 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2940 test -n "$add" && deplibs="$add $deplibs"
2941 if test "$hardcode_direct" != yes && \
2942 test "$hardcode_minus_L" != yes && \
2943 test "$hardcode_shlibpath_var" = yes; then
2944 case :$finalize_shlibpath: in
2945 *":$libdir:"*) ;;
2946 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2947 esac
2952 if test "$linkmode" = prog || test "$mode" = relink; then
2953 add_shlibpath=
2954 add_dir=
2955 add=
2956 # Finalize command for both is simple: just hardcode it.
2957 if test "$hardcode_direct" = yes; then
2958 add="$libdir/$linklib"
2959 elif test "$hardcode_minus_L" = yes; then
2960 add_dir="-L$libdir"
2961 add="-l$name"
2962 elif test "$hardcode_shlibpath_var" = yes; then
2963 case :$finalize_shlibpath: in
2964 *":$libdir:"*) ;;
2965 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2966 esac
2967 add="-l$name"
2968 elif test "$hardcode_automatic" = yes; then
2969 if test -n "$inst_prefix_dir" &&
2970 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2971 add="$inst_prefix_dir$libdir/$linklib"
2972 else
2973 add="$libdir/$linklib"
2975 else
2976 # We cannot seem to hardcode it, guess we'll fake it.
2977 add_dir="-L$libdir"
2978 # Try looking first in the location we're being installed to.
2979 if test -n "$inst_prefix_dir"; then
2980 case "$libdir" in
2981 [\\/]*)
2982 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2984 esac
2986 add="-l$name"
2989 if test "$linkmode" = prog; then
2990 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2991 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2992 else
2993 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2994 test -n "$add" && deplibs="$add $deplibs"
2997 elif test "$linkmode" = prog; then
2998 # Here we assume that one of hardcode_direct or hardcode_minus_L
2999 # is not unsupported. This is valid on all known static and
3000 # shared platforms.
3001 if test "$hardcode_direct" != unsupported; then
3002 test -n "$old_library" && linklib="$old_library"
3003 compile_deplibs="$dir/$linklib $compile_deplibs"
3004 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3005 else
3006 compile_deplibs="-l$name -L$dir $compile_deplibs"
3007 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3009 elif test "$build_libtool_libs" = yes; then
3010 # Not a shared library
3011 if test "$deplibs_check_method" != pass_all; then
3012 # We're trying link a shared library against a static one
3013 # but the system doesn't support it.
3015 # Just print a warning and add the library to dependency_libs so
3016 # that the program can be linked against the static library.
3017 $echo
3018 $echo "*** Warning: This system can not link to static lib archive $lib."
3019 $echo "*** I have the capability to make that library automatically link in when"
3020 $echo "*** you link to this library. But I can only do this if you have a"
3021 $echo "*** shared version of the library, which you do not appear to have."
3022 if test "$module" = yes; then
3023 $echo "*** But as you try to build a module library, libtool will still create "
3024 $echo "*** a static module, that should work as long as the dlopening application"
3025 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3026 if test -z "$global_symbol_pipe"; then
3027 $echo
3028 $echo "*** However, this would only work if libtool was able to extract symbol"
3029 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3030 $echo "*** not find such a program. So, this module is probably useless."
3031 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3033 if test "$build_old_libs" = no; then
3034 build_libtool_libs=module
3035 build_old_libs=yes
3036 else
3037 build_libtool_libs=no
3040 else
3041 convenience="$convenience $dir/$old_library"
3042 old_convenience="$old_convenience $dir/$old_library"
3043 deplibs="$dir/$old_library $deplibs"
3044 link_static=yes
3046 fi # link shared/static library?
3048 if test "$linkmode" = lib; then
3049 if test -n "$dependency_libs" &&
3050 { test "$hardcode_into_libs" != yes ||
3051 test "$build_old_libs" = yes ||
3052 test "$link_static" = yes; }; then
3053 # Extract -R from dependency_libs
3054 temp_deplibs=
3055 for libdir in $dependency_libs; do
3056 case $libdir in
3057 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3058 case " $xrpath " in
3059 *" $temp_xrpath "*) ;;
3060 *) xrpath="$xrpath $temp_xrpath";;
3061 esac;;
3062 *) temp_deplibs="$temp_deplibs $libdir";;
3063 esac
3064 done
3065 dependency_libs="$temp_deplibs"
3068 newlib_search_path="$newlib_search_path $absdir"
3069 # Link against this library
3070 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3071 # ... and its dependency_libs
3072 tmp_libs=
3073 for deplib in $dependency_libs; do
3074 newdependency_libs="$deplib $newdependency_libs"
3075 if test "X$duplicate_deps" = "Xyes" ; then
3076 case "$tmp_libs " in
3077 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3078 esac
3080 tmp_libs="$tmp_libs $deplib"
3081 done
3083 if test "$link_all_deplibs" != no; then
3084 # Add the search paths of all dependency libraries
3085 for deplib in $dependency_libs; do
3086 case $deplib in
3087 -L*) path="$deplib" ;;
3088 *.la)
3089 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3090 test "X$dir" = "X$deplib" && dir="."
3091 # We need an absolute path.
3092 case $dir in
3093 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3095 absdir=`cd "$dir" && pwd`
3096 if test -z "$absdir"; then
3097 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3098 absdir="$dir"
3101 esac
3102 if grep "^installed=no" $deplib > /dev/null; then
3103 path="$absdir/$objdir"
3104 else
3105 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3106 if test -z "$libdir"; then
3107 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3108 exit $EXIT_FAILURE
3110 if test "$absdir" != "$libdir"; then
3111 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3113 path="$absdir"
3115 depdepl=
3116 case $host in
3117 *-*-darwin*)
3118 # we do not want to link against static libs,
3119 # but need to link against shared
3120 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3121 if test -n "$deplibrary_names" ; then
3122 for tmp in $deplibrary_names ; do
3123 depdepl=$tmp
3124 done
3125 if test -f "$path/$depdepl" ; then
3126 depdepl="$path/$depdepl"
3128 # do not add paths which are already there
3129 case " $newlib_search_path " in
3130 *" $path "*) ;;
3131 *) newlib_search_path="$newlib_search_path $path";;
3132 esac
3134 path=""
3137 path="-L$path"
3139 esac
3141 -l*)
3142 case $host in
3143 *-*-darwin*)
3144 # Again, we only want to link against shared libraries
3145 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3146 for tmp in $newlib_search_path ; do
3147 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3148 eval depdepl="$tmp/lib$tmp_libs.dylib"
3149 break
3151 done
3152 path=""
3154 *) continue ;;
3155 esac
3157 *) continue ;;
3158 esac
3159 case " $deplibs " in
3160 *" $depdepl "*) ;;
3161 *) deplibs="$depdepl $deplibs" ;;
3162 esac
3163 case " $deplibs " in
3164 *" $path "*) ;;
3165 *) deplibs="$deplibs $path" ;;
3166 esac
3167 done
3168 fi # link_all_deplibs != no
3169 fi # linkmode = lib
3170 done # for deplib in $libs
3171 dependency_libs="$newdependency_libs"
3172 if test "$pass" = dlpreopen; then
3173 # Link the dlpreopened libraries before other libraries
3174 for deplib in $save_deplibs; do
3175 deplibs="$deplib $deplibs"
3176 done
3178 if test "$pass" != dlopen; then
3179 if test "$pass" != conv; then
3180 # Make sure lib_search_path contains only unique directories.
3181 lib_search_path=
3182 for dir in $newlib_search_path; do
3183 case "$lib_search_path " in
3184 *" $dir "*) ;;
3185 *) lib_search_path="$lib_search_path $dir" ;;
3186 esac
3187 done
3188 newlib_search_path=
3191 if test "$linkmode,$pass" != "prog,link"; then
3192 vars="deplibs"
3193 else
3194 vars="compile_deplibs finalize_deplibs"
3196 for var in $vars dependency_libs; do
3197 # Add libraries to $var in reverse order
3198 eval tmp_libs=\"\$$var\"
3199 new_libs=
3200 for deplib in $tmp_libs; do
3201 # FIXME: Pedantically, this is the right thing to do, so
3202 # that some nasty dependency loop isn't accidentally
3203 # broken:
3204 #new_libs="$deplib $new_libs"
3205 # Pragmatically, this seems to cause very few problems in
3206 # practice:
3207 case $deplib in
3208 -L*) new_libs="$deplib $new_libs" ;;
3209 -R*) ;;
3211 # And here is the reason: when a library appears more
3212 # than once as an explicit dependence of a library, or
3213 # is implicitly linked in more than once by the
3214 # compiler, it is considered special, and multiple
3215 # occurrences thereof are not removed. Compare this
3216 # with having the same library being listed as a
3217 # dependency of multiple other libraries: in this case,
3218 # we know (pedantically, we assume) the library does not
3219 # need to be listed more than once, so we keep only the
3220 # last copy. This is not always right, but it is rare
3221 # enough that we require users that really mean to play
3222 # such unportable linking tricks to link the library
3223 # using -Wl,-lname, so that libtool does not consider it
3224 # for duplicate removal.
3225 case " $specialdeplibs " in
3226 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3228 case " $new_libs " in
3229 *" $deplib "*) ;;
3230 *) new_libs="$deplib $new_libs" ;;
3231 esac
3233 esac
3235 esac
3236 done
3237 tmp_libs=
3238 for deplib in $new_libs; do
3239 case $deplib in
3240 -L*)
3241 case " $tmp_libs " in
3242 *" $deplib "*) ;;
3243 *) tmp_libs="$tmp_libs $deplib" ;;
3244 esac
3246 *) tmp_libs="$tmp_libs $deplib" ;;
3247 esac
3248 done
3249 eval $var=\"$tmp_libs\"
3250 done # for var
3252 # Last step: remove runtime libs from dependency_libs
3253 # (they stay in deplibs)
3254 tmp_libs=
3255 for i in $dependency_libs ; do
3256 case " $predeps $postdeps $compiler_lib_search_path " in
3257 *" $i "*)
3258 i=""
3260 esac
3261 if test -n "$i" ; then
3262 tmp_libs="$tmp_libs $i"
3264 done
3265 dependency_libs=$tmp_libs
3266 done # for pass
3267 if test "$linkmode" = prog; then
3268 dlfiles="$newdlfiles"
3269 dlprefiles="$newdlprefiles"
3272 case $linkmode in
3273 oldlib)
3274 if test -n "$deplibs"; then
3275 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3278 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3279 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3282 if test -n "$rpath"; then
3283 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3286 if test -n "$xrpath"; then
3287 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3290 if test -n "$vinfo"; then
3291 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3294 if test -n "$release"; then
3295 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3298 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3299 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3302 # Now set the variables for building old libraries.
3303 build_libtool_libs=no
3304 oldlibs="$output"
3305 objs="$objs$old_deplibs"
3308 lib)
3309 # Make sure we only generate libraries of the form `libNAME.la'.
3310 case $outputname in
3311 lib*)
3312 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3313 eval shared_ext=\"$shrext_cmds\"
3314 eval libname=\"$libname_spec\"
3317 if test "$module" = no; then
3318 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3319 $echo "$help" 1>&2
3320 exit $EXIT_FAILURE
3322 if test "$need_lib_prefix" != no; then
3323 # Add the "lib" prefix for modules if required
3324 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3325 eval shared_ext=\"$shrext_cmds\"
3326 eval libname=\"$libname_spec\"
3327 else
3328 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3331 esac
3333 if test -n "$objs"; then
3334 if test "$deplibs_check_method" != pass_all; then
3335 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3336 exit $EXIT_FAILURE
3337 else
3338 $echo
3339 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3340 $echo "*** objects $objs is not portable!"
3341 libobjs="$libobjs $objs"
3345 if test "$dlself" != no; then
3346 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3349 set dummy $rpath
3350 if test "$#" -gt 2; then
3351 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3353 install_libdir="$2"
3355 oldlibs=
3356 if test -z "$rpath"; then
3357 if test "$build_libtool_libs" = yes; then
3358 # Building a libtool convenience library.
3359 # Some compilers have problems with a `.al' extension so
3360 # convenience libraries should have the same extension an
3361 # archive normally would.
3362 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3363 build_libtool_libs=convenience
3364 build_old_libs=yes
3367 if test -n "$vinfo"; then
3368 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3371 if test -n "$release"; then
3372 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3374 else
3376 # Parse the version information argument.
3377 save_ifs="$IFS"; IFS=':'
3378 set dummy $vinfo 0 0 0
3379 IFS="$save_ifs"
3381 if test -n "$8"; then
3382 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3383 $echo "$help" 1>&2
3384 exit $EXIT_FAILURE
3387 # convert absolute version numbers to libtool ages
3388 # this retains compatibility with .la files and attempts
3389 # to make the code below a bit more comprehensible
3391 case $vinfo_number in
3392 yes)
3393 number_major="$2"
3394 number_minor="$3"
3395 number_revision="$4"
3397 # There are really only two kinds -- those that
3398 # use the current revision as the major version
3399 # and those that subtract age and use age as
3400 # a minor version. But, then there is irix
3401 # which has an extra 1 added just for fun
3403 case $version_type in
3404 darwin|linux|osf|windows)
3405 current=`expr $number_major + $number_minor`
3406 age="$number_minor"
3407 revision="$number_revision"
3409 freebsd-aout|freebsd-elf|sunos)
3410 current="$number_major"
3411 revision="$number_minor"
3412 age="0"
3414 irix|nonstopux)
3415 current=`expr $number_major + $number_minor - 1`
3416 age="$number_minor"
3417 revision="$number_minor"
3419 esac
3422 current="$2"
3423 revision="$3"
3424 age="$4"
3426 esac
3428 # Check that each of the things are valid numbers.
3429 case $current in
3430 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3432 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3433 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3434 exit $EXIT_FAILURE
3436 esac
3438 case $revision in
3439 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3441 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3442 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3443 exit $EXIT_FAILURE
3445 esac
3447 case $age in
3448 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3450 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3451 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3452 exit $EXIT_FAILURE
3454 esac
3456 if test "$age" -gt "$current"; then
3457 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3458 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3459 exit $EXIT_FAILURE
3462 # Calculate the version variables.
3463 major=
3464 versuffix=
3465 verstring=
3466 case $version_type in
3467 none) ;;
3469 darwin)
3470 # Like Linux, but with the current version available in
3471 # verstring for coding it into the library header
3472 major=.`expr $current - $age`
3473 versuffix="$major.$age.$revision"
3474 # Darwin ld doesn't like 0 for these options...
3475 minor_current=`expr $current + 1`
3476 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3479 freebsd-aout)
3480 major=".$current"
3481 versuffix=".$current.$revision";
3484 freebsd-elf)
3485 major=".$current"
3486 versuffix=".$current";
3489 irix | nonstopux)
3490 major=`expr $current - $age + 1`
3492 case $version_type in
3493 nonstopux) verstring_prefix=nonstopux ;;
3494 *) verstring_prefix=sgi ;;
3495 esac
3496 verstring="$verstring_prefix$major.$revision"
3498 # Add in all the interfaces that we are compatible with.
3499 loop=$revision
3500 while test "$loop" -ne 0; do
3501 iface=`expr $revision - $loop`
3502 loop=`expr $loop - 1`
3503 verstring="$verstring_prefix$major.$iface:$verstring"
3504 done
3506 # Before this point, $major must not contain `.'.
3507 major=.$major
3508 versuffix="$major.$revision"
3511 linux)
3512 major=.`expr $current - $age`
3513 versuffix="$major.$age.$revision"
3516 osf)
3517 major=.`expr $current - $age`
3518 versuffix=".$current.$age.$revision"
3519 verstring="$current.$age.$revision"
3521 # Add in all the interfaces that we are compatible with.
3522 loop=$age
3523 while test "$loop" -ne 0; do
3524 iface=`expr $current - $loop`
3525 loop=`expr $loop - 1`
3526 verstring="$verstring:${iface}.0"
3527 done
3529 # Make executables depend on our current version.
3530 verstring="$verstring:${current}.0"
3533 sunos)
3534 major=".$current"
3535 versuffix=".$current.$revision"
3538 windows)
3539 # Use '-' rather than '.', since we only want one
3540 # extension on DOS 8.3 filesystems.
3541 major=`expr $current - $age`
3542 versuffix="-$major"
3546 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3547 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3548 exit $EXIT_FAILURE
3550 esac
3552 # Clear the version info if we defaulted, and they specified a release.
3553 if test -z "$vinfo" && test -n "$release"; then
3554 major=
3555 case $version_type in
3556 darwin)
3557 # we can't check for "0.0" in archive_cmds due to quoting
3558 # problems, so we reset it completely
3559 verstring=
3562 verstring="0.0"
3564 esac
3565 if test "$need_version" = no; then
3566 versuffix=
3567 else
3568 versuffix=".0.0"
3572 # Remove version info from name if versioning should be avoided
3573 if test "$avoid_version" = yes && test "$need_version" = no; then
3574 major=
3575 versuffix=
3576 verstring=""
3579 # Check to see if the archive will have undefined symbols.
3580 if test "$allow_undefined" = yes; then
3581 if test "$allow_undefined_flag" = unsupported; then
3582 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3583 build_libtool_libs=no
3584 build_old_libs=yes
3586 else
3587 # Don't allow undefined symbols.
3588 allow_undefined_flag="$no_undefined_flag"
3592 if test "$mode" != relink; then
3593 # Remove our outputs, but don't remove object files since they
3594 # may have been created when compiling PIC objects.
3595 removelist=
3596 tempremovelist=`$echo "$output_objdir/*"`
3597 for p in $tempremovelist; do
3598 case $p in
3599 *.$objext)
3601 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3602 if test "X$precious_files_regex" != "X"; then
3603 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3604 then
3605 continue
3608 removelist="$removelist $p"
3610 *) ;;
3611 esac
3612 done
3613 if test -n "$removelist"; then
3614 $show "${rm}r $removelist"
3615 $run ${rm}r $removelist
3619 # Now set the variables for building old libraries.
3620 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3621 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3623 # Transform .lo files to .o files.
3624 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3627 # Eliminate all temporary directories.
3628 for path in $notinst_path; do
3629 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3630 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3631 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3632 done
3634 if test -n "$xrpath"; then
3635 # If the user specified any rpath flags, then add them.
3636 temp_xrpath=
3637 for libdir in $xrpath; do
3638 temp_xrpath="$temp_xrpath -R$libdir"
3639 case "$finalize_rpath " in
3640 *" $libdir "*) ;;
3641 *) finalize_rpath="$finalize_rpath $libdir" ;;
3642 esac
3643 done
3644 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3645 dependency_libs="$temp_xrpath $dependency_libs"
3649 # Make sure dlfiles contains only unique files that won't be dlpreopened
3650 old_dlfiles="$dlfiles"
3651 dlfiles=
3652 for lib in $old_dlfiles; do
3653 case " $dlprefiles $dlfiles " in
3654 *" $lib "*) ;;
3655 *) dlfiles="$dlfiles $lib" ;;
3656 esac
3657 done
3659 # Make sure dlprefiles contains only unique files
3660 old_dlprefiles="$dlprefiles"
3661 dlprefiles=
3662 for lib in $old_dlprefiles; do
3663 case "$dlprefiles " in
3664 *" $lib "*) ;;
3665 *) dlprefiles="$dlprefiles $lib" ;;
3666 esac
3667 done
3669 if test "$build_libtool_libs" = yes; then
3670 if test -n "$rpath"; then
3671 case $host in
3672 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3673 # these systems don't actually have a c library (as such)!
3675 *-*-rhapsody* | *-*-darwin1.[012])
3676 # Rhapsody C library is in the System framework
3677 deplibs="$deplibs -framework System"
3679 *-*-netbsd*)
3680 # Don't link with libc until the a.out ld.so is fixed.
3682 *-*-openbsd* | *-*-freebsd*)
3683 # Do not include libc due to us having libc/libc_r.
3684 test "X$arg" = "X-lc" && continue
3687 # Add libc to deplibs on all other systems if necessary.
3688 if test "$build_libtool_need_lc" = "yes"; then
3689 deplibs="$deplibs -lc"
3692 esac
3695 # Transform deplibs into only deplibs that can be linked in shared.
3696 name_save=$name
3697 libname_save=$libname
3698 release_save=$release
3699 versuffix_save=$versuffix
3700 major_save=$major
3701 # I'm not sure if I'm treating the release correctly. I think
3702 # release should show up in the -l (ie -lgmp5) so we don't want to
3703 # add it in twice. Is that correct?
3704 release=""
3705 versuffix=""
3706 major=""
3707 newdeplibs=
3708 droppeddeps=no
3709 case $deplibs_check_method in
3710 pass_all)
3711 # Don't check for shared/static. Everything works.
3712 # This might be a little naive. We might want to check
3713 # whether the library exists or not. But this is on
3714 # osf3 & osf4 and I'm not really sure... Just
3715 # implementing what was already the behavior.
3716 newdeplibs=$deplibs
3718 test_compile)
3719 # This code stresses the "libraries are programs" paradigm to its
3720 # limits. Maybe even breaks it. We compile a program, linking it
3721 # against the deplibs as a proxy for the library. Then we can check
3722 # whether they linked in statically or dynamically with ldd.
3723 $rm conftest.c
3724 cat > conftest.c <<EOF
3725 int main() { return 0; }
3727 $rm conftest
3728 $LTCC -o conftest conftest.c $deplibs
3729 if test "$?" -eq 0 ; then
3730 ldd_output=`ldd conftest`
3731 for i in $deplibs; do
3732 name="`expr $i : '-l\(.*\)'`"
3733 # If $name is empty we are operating on a -L argument.
3734 if test "$name" != "" && test "$name" -ne "0"; then
3735 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3736 case " $predeps $postdeps " in
3737 *" $i "*)
3738 newdeplibs="$newdeplibs $i"
3739 i=""
3741 esac
3743 if test -n "$i" ; then
3744 libname=`eval \\$echo \"$libname_spec\"`
3745 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3746 set dummy $deplib_matches
3747 deplib_match=$2
3748 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3749 newdeplibs="$newdeplibs $i"
3750 else
3751 droppeddeps=yes
3752 $echo
3753 $echo "*** Warning: dynamic linker does not accept needed library $i."
3754 $echo "*** I have the capability to make that library automatically link in when"
3755 $echo "*** you link to this library. But I can only do this if you have a"
3756 $echo "*** shared version of the library, which I believe you do not have"
3757 $echo "*** because a test_compile did reveal that the linker did not use it for"
3758 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3761 else
3762 newdeplibs="$newdeplibs $i"
3764 done
3765 else
3766 # Error occurred in the first compile. Let's try to salvage
3767 # the situation: Compile a separate program for each library.
3768 for i in $deplibs; do
3769 name="`expr $i : '-l\(.*\)'`"
3770 # If $name is empty we are operating on a -L argument.
3771 if test "$name" != "" && test "$name" != "0"; then
3772 $rm conftest
3773 $LTCC -o conftest conftest.c $i
3774 # Did it work?
3775 if test "$?" -eq 0 ; then
3776 ldd_output=`ldd conftest`
3777 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3778 case " $predeps $postdeps " in
3779 *" $i "*)
3780 newdeplibs="$newdeplibs $i"
3781 i=""
3783 esac
3785 if test -n "$i" ; then
3786 libname=`eval \\$echo \"$libname_spec\"`
3787 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3788 set dummy $deplib_matches
3789 deplib_match=$2
3790 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3791 newdeplibs="$newdeplibs $i"
3792 else
3793 droppeddeps=yes
3794 $echo
3795 $echo "*** Warning: dynamic linker does not accept needed library $i."
3796 $echo "*** I have the capability to make that library automatically link in when"
3797 $echo "*** you link to this library. But I can only do this if you have a"
3798 $echo "*** shared version of the library, which you do not appear to have"
3799 $echo "*** because a test_compile did reveal that the linker did not use this one"
3800 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3803 else
3804 droppeddeps=yes
3805 $echo
3806 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3807 $echo "*** make it link in! You will probably need to install it or some"
3808 $echo "*** library that it depends on before this library will be fully"
3809 $echo "*** functional. Installing it before continuing would be even better."
3811 else
3812 newdeplibs="$newdeplibs $i"
3814 done
3817 file_magic*)
3818 set dummy $deplibs_check_method
3819 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3820 for a_deplib in $deplibs; do
3821 name="`expr $a_deplib : '-l\(.*\)'`"
3822 # If $name is empty we are operating on a -L argument.
3823 if test "$name" != "" && test "$name" != "0"; then
3824 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3825 case " $predeps $postdeps " in
3826 *" $a_deplib "*)
3827 newdeplibs="$newdeplibs $a_deplib"
3828 a_deplib=""
3830 esac
3832 if test -n "$a_deplib" ; then
3833 libname=`eval \\$echo \"$libname_spec\"`
3834 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3835 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3836 for potent_lib in $potential_libs; do
3837 # Follow soft links.
3838 if ls -lLd "$potent_lib" 2>/dev/null \
3839 | grep " -> " >/dev/null; then
3840 continue
3842 # The statement above tries to avoid entering an
3843 # endless loop below, in case of cyclic links.
3844 # We might still enter an endless loop, since a link
3845 # loop can be closed while we follow links,
3846 # but so what?
3847 potlib="$potent_lib"
3848 while test -h "$potlib" 2>/dev/null; do
3849 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3850 case $potliblink in
3851 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3852 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3853 esac
3854 done
3855 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3856 | ${SED} 10q \
3857 | $EGREP "$file_magic_regex" > /dev/null; then
3858 newdeplibs="$newdeplibs $a_deplib"
3859 a_deplib=""
3860 break 2
3862 done
3863 done
3865 if test -n "$a_deplib" ; then
3866 droppeddeps=yes
3867 $echo
3868 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3869 $echo "*** I have the capability to make that library automatically link in when"
3870 $echo "*** you link to this library. But I can only do this if you have a"
3871 $echo "*** shared version of the library, which you do not appear to have"
3872 $echo "*** because I did check the linker path looking for a file starting"
3873 if test -z "$potlib" ; then
3874 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3875 else
3876 $echo "*** with $libname and none of the candidates passed a file format test"
3877 $echo "*** using a file magic. Last file checked: $potlib"
3880 else
3881 # Add a -L argument.
3882 newdeplibs="$newdeplibs $a_deplib"
3884 done # Gone through all deplibs.
3886 match_pattern*)
3887 set dummy $deplibs_check_method
3888 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3889 for a_deplib in $deplibs; do
3890 name="`expr $a_deplib : '-l\(.*\)'`"
3891 # If $name is empty we are operating on a -L argument.
3892 if test -n "$name" && test "$name" != "0"; then
3893 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3894 case " $predeps $postdeps " in
3895 *" $a_deplib "*)
3896 newdeplibs="$newdeplibs $a_deplib"
3897 a_deplib=""
3899 esac
3901 if test -n "$a_deplib" ; then
3902 libname=`eval \\$echo \"$libname_spec\"`
3903 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3904 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3905 for potent_lib in $potential_libs; do
3906 potlib="$potent_lib" # see symlink-check above in file_magic test
3907 if eval $echo \"$potent_lib\" 2>/dev/null \
3908 | ${SED} 10q \
3909 | $EGREP "$match_pattern_regex" > /dev/null; then
3910 newdeplibs="$newdeplibs $a_deplib"
3911 a_deplib=""
3912 break 2
3914 done
3915 done
3917 if test -n "$a_deplib" ; then
3918 droppeddeps=yes
3919 $echo
3920 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3921 $echo "*** I have the capability to make that library automatically link in when"
3922 $echo "*** you link to this library. But I can only do this if you have a"
3923 $echo "*** shared version of the library, which you do not appear to have"
3924 $echo "*** because I did check the linker path looking for a file starting"
3925 if test -z "$potlib" ; then
3926 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3927 else
3928 $echo "*** with $libname and none of the candidates passed a file format test"
3929 $echo "*** using a regex pattern. Last file checked: $potlib"
3932 else
3933 # Add a -L argument.
3934 newdeplibs="$newdeplibs $a_deplib"
3936 done # Gone through all deplibs.
3938 none | unknown | *)
3939 newdeplibs=""
3940 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3941 -e 's/ -[LR][^ ]*//g'`
3942 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3943 for i in $predeps $postdeps ; do
3944 # can't use Xsed below, because $i might contain '/'
3945 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3946 done
3948 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3949 | grep . >/dev/null; then
3950 $echo
3951 if test "X$deplibs_check_method" = "Xnone"; then
3952 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3953 else
3954 $echo "*** Warning: inter-library dependencies are not known to be supported."
3956 $echo "*** All declared inter-library dependencies are being dropped."
3957 droppeddeps=yes
3960 esac
3961 versuffix=$versuffix_save
3962 major=$major_save
3963 release=$release_save
3964 libname=$libname_save
3965 name=$name_save
3967 case $host in
3968 *-*-rhapsody* | *-*-darwin1.[012])
3969 # On Rhapsody replace the C library is the System framework
3970 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3972 esac
3974 if test "$droppeddeps" = yes; then
3975 if test "$module" = yes; then
3976 $echo
3977 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3978 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3979 $echo "*** a static module, that should work as long as the dlopening"
3980 $echo "*** application is linked with the -dlopen flag."
3981 if test -z "$global_symbol_pipe"; then
3982 $echo
3983 $echo "*** However, this would only work if libtool was able to extract symbol"
3984 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3985 $echo "*** not find such a program. So, this module is probably useless."
3986 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3988 if test "$build_old_libs" = no; then
3989 oldlibs="$output_objdir/$libname.$libext"
3990 build_libtool_libs=module
3991 build_old_libs=yes
3992 else
3993 build_libtool_libs=no
3995 else
3996 $echo "*** The inter-library dependencies that have been dropped here will be"
3997 $echo "*** automatically added whenever a program is linked with this library"
3998 $echo "*** or is declared to -dlopen it."
4000 if test "$allow_undefined" = no; then
4001 $echo
4002 $echo "*** Since this library must not contain undefined symbols,"
4003 $echo "*** because either the platform does not support them or"
4004 $echo "*** it was explicitly requested with -no-undefined,"
4005 $echo "*** libtool will only create a static version of it."
4006 if test "$build_old_libs" = no; then
4007 oldlibs="$output_objdir/$libname.$libext"
4008 build_libtool_libs=module
4009 build_old_libs=yes
4010 else
4011 build_libtool_libs=no
4016 # Done checking deplibs!
4017 deplibs=$newdeplibs
4020 # All the library-specific variables (install_libdir is set above).
4021 library_names=
4022 old_library=
4023 dlname=
4025 # Test again, we may have decided not to build it any more
4026 if test "$build_libtool_libs" = yes; then
4027 if test "$hardcode_into_libs" = yes; then
4028 # Hardcode the library paths
4029 hardcode_libdirs=
4030 dep_rpath=
4031 rpath="$finalize_rpath"
4032 test "$mode" != relink && rpath="$compile_rpath$rpath"
4033 for libdir in $rpath; do
4034 if test -n "$hardcode_libdir_flag_spec"; then
4035 if test -n "$hardcode_libdir_separator"; then
4036 if test -z "$hardcode_libdirs"; then
4037 hardcode_libdirs="$libdir"
4038 else
4039 # Just accumulate the unique libdirs.
4040 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4041 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4044 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4046 esac
4048 else
4049 eval flag=\"$hardcode_libdir_flag_spec\"
4050 dep_rpath="$dep_rpath $flag"
4052 elif test -n "$runpath_var"; then
4053 case "$perm_rpath " in
4054 *" $libdir "*) ;;
4055 *) perm_rpath="$perm_rpath $libdir" ;;
4056 esac
4058 done
4059 # Substitute the hardcoded libdirs into the rpath.
4060 if test -n "$hardcode_libdir_separator" &&
4061 test -n "$hardcode_libdirs"; then
4062 libdir="$hardcode_libdirs"
4063 if test -n "$hardcode_libdir_flag_spec_ld"; then
4064 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4065 else
4066 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4069 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4070 # We should set the runpath_var.
4071 rpath=
4072 for dir in $perm_rpath; do
4073 rpath="$rpath$dir:"
4074 done
4075 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4077 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4080 shlibpath="$finalize_shlibpath"
4081 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4082 if test -n "$shlibpath"; then
4083 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4086 # Get the real and link names of the library.
4087 eval shared_ext=\"$shrext_cmds\"
4088 eval library_names=\"$library_names_spec\"
4089 set dummy $library_names
4090 realname="$2"
4091 shift; shift
4093 if test -n "$soname_spec"; then
4094 eval soname=\"$soname_spec\"
4095 else
4096 soname="$realname"
4098 if test -z "$dlname"; then
4099 dlname=$soname
4102 lib="$output_objdir/$realname"
4103 for link
4105 linknames="$linknames $link"
4106 done
4108 # Use standard objects if they are pic
4109 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4111 # Prepare the list of exported symbols
4112 if test -z "$export_symbols"; then
4113 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4114 $show "generating symbol list for \`$libname.la'"
4115 export_symbols="$output_objdir/$libname.exp"
4116 $run $rm $export_symbols
4117 cmds=$export_symbols_cmds
4118 save_ifs="$IFS"; IFS='~'
4119 for cmd in $cmds; do
4120 IFS="$save_ifs"
4121 eval cmd=\"$cmd\"
4122 if len=`expr "X$cmd" : ".*"` &&
4123 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4124 $show "$cmd"
4125 $run eval "$cmd" || exit $?
4126 skipped_export=false
4127 else
4128 # The command line is too long to execute in one step.
4129 $show "using reloadable object file for export list..."
4130 skipped_export=:
4132 done
4133 IFS="$save_ifs"
4134 if test -n "$export_symbols_regex"; then
4135 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4136 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4137 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4138 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4143 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4144 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4147 tmp_deplibs=
4148 for test_deplib in $deplibs; do
4149 case " $convenience " in
4150 *" $test_deplib "*) ;;
4152 tmp_deplibs="$tmp_deplibs $test_deplib"
4154 esac
4155 done
4156 deplibs="$tmp_deplibs"
4158 if test -n "$convenience"; then
4159 if test -n "$whole_archive_flag_spec"; then
4160 save_libobjs=$libobjs
4161 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4162 else
4163 gentop="$output_objdir/${outputname}x"
4164 generated="$generated $gentop"
4166 func_extract_archives $gentop $convenience
4167 libobjs="$libobjs $func_extract_archives_result"
4171 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4172 eval flag=\"$thread_safe_flag_spec\"
4173 linker_flags="$linker_flags $flag"
4176 # Make a backup of the uninstalled library when relinking
4177 if test "$mode" = relink; then
4178 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4181 # Do each of the archive commands.
4182 if test "$module" = yes && test -n "$module_cmds" ; then
4183 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4184 eval test_cmds=\"$module_expsym_cmds\"
4185 cmds=$module_expsym_cmds
4186 else
4187 eval test_cmds=\"$module_cmds\"
4188 cmds=$module_cmds
4190 else
4191 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4192 eval test_cmds=\"$archive_expsym_cmds\"
4193 cmds=$archive_expsym_cmds
4194 else
4195 eval test_cmds=\"$archive_cmds\"
4196 cmds=$archive_cmds
4200 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
4201 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4203 else
4204 # The command line is too long to link in one step, link piecewise.
4205 $echo "creating reloadable object files..."
4207 # Save the value of $output and $libobjs because we want to
4208 # use them later. If we have whole_archive_flag_spec, we
4209 # want to use save_libobjs as it was before
4210 # whole_archive_flag_spec was expanded, because we can't
4211 # assume the linker understands whole_archive_flag_spec.
4212 # This may have to be revisited, in case too many
4213 # convenience libraries get linked in and end up exceeding
4214 # the spec.
4215 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4216 save_libobjs=$libobjs
4218 save_output=$output
4220 # Clear the reloadable object creation command queue and
4221 # initialize k to one.
4222 test_cmds=
4223 concat_cmds=
4224 objlist=
4225 delfiles=
4226 last_robj=
4228 output=$output_objdir/$save_output-${k}.$objext
4229 # Loop over the list of objects to be linked.
4230 for obj in $save_libobjs
4232 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4233 if test "X$objlist" = X ||
4234 { len=`expr "X$test_cmds" : ".*"` &&
4235 test "$len" -le "$max_cmd_len"; }; then
4236 objlist="$objlist $obj"
4237 else
4238 # The command $test_cmds is almost too long, add a
4239 # command to the queue.
4240 if test "$k" -eq 1 ; then
4241 # The first file doesn't have a previous command to add.
4242 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4243 else
4244 # All subsequent reloadable object files will link in
4245 # the last one created.
4246 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4248 last_robj=$output_objdir/$save_output-${k}.$objext
4249 k=`expr $k + 1`
4250 output=$output_objdir/$save_output-${k}.$objext
4251 objlist=$obj
4252 len=1
4254 done
4255 # Handle the remaining objects by creating one last
4256 # reloadable object file. All subsequent reloadable object
4257 # files will link in the last one created.
4258 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4259 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4261 if ${skipped_export-false}; then
4262 $show "generating symbol list for \`$libname.la'"
4263 export_symbols="$output_objdir/$libname.exp"
4264 $run $rm $export_symbols
4265 libobjs=$output
4266 # Append the command to create the export file.
4267 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4270 # Set up a command to remove the reloadale object files
4271 # after they are used.
4273 while test "$i" -lt "$k"
4275 i=`expr $i + 1`
4276 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
4277 done
4279 $echo "creating a temporary reloadable object file: $output"
4281 # Loop through the commands generated above and execute them.
4282 save_ifs="$IFS"; IFS='~'
4283 for cmd in $concat_cmds; do
4284 IFS="$save_ifs"
4285 $show "$cmd"
4286 $run eval "$cmd" || exit $?
4287 done
4288 IFS="$save_ifs"
4290 libobjs=$output
4291 # Restore the value of output.
4292 output=$save_output
4294 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4295 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4297 # Expand the library linking commands again to reset the
4298 # value of $libobjs for piecewise linking.
4300 # Do each of the archive commands.
4301 if test "$module" = yes && test -n "$module_cmds" ; then
4302 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4303 cmds=$module_expsym_cmds
4304 else
4305 cmds=$module_cmds
4307 else
4308 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4309 cmds=$archive_expsym_cmds
4310 else
4311 cmds=$archive_cmds
4315 # Append the command to remove the reloadable object files
4316 # to the just-reset $cmds.
4317 eval cmds=\"\$cmds~\$rm $delfiles\"
4319 save_ifs="$IFS"; IFS='~'
4320 for cmd in $cmds; do
4321 IFS="$save_ifs"
4322 eval cmd=\"$cmd\"
4323 $show "$cmd"
4324 $run eval "$cmd" || exit $?
4325 done
4326 IFS="$save_ifs"
4328 # Restore the uninstalled library and exit
4329 if test "$mode" = relink; then
4330 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4331 exit $EXIT_SUCCESS
4334 # Create links to the real library.
4335 for linkname in $linknames; do
4336 if test "$realname" != "$linkname"; then
4337 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4338 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4340 done
4342 # If -module or -export-dynamic was specified, set the dlname.
4343 if test "$module" = yes || test "$export_dynamic" = yes; then
4344 # On all known operating systems, these are identical.
4345 dlname="$soname"
4350 obj)
4351 if test -n "$deplibs"; then
4352 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4355 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4356 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4359 if test -n "$rpath"; then
4360 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4363 if test -n "$xrpath"; then
4364 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4367 if test -n "$vinfo"; then
4368 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4371 if test -n "$release"; then
4372 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4375 case $output in
4376 *.lo)
4377 if test -n "$objs$old_deplibs"; then
4378 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4379 exit $EXIT_FAILURE
4381 libobj="$output"
4382 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4385 libobj=
4386 obj="$output"
4388 esac
4390 # Delete the old objects.
4391 $run $rm $obj $libobj
4393 # Objects from convenience libraries. This assumes
4394 # single-version convenience libraries. Whenever we create
4395 # different ones for PIC/non-PIC, this we'll have to duplicate
4396 # the extraction.
4397 reload_conv_objs=
4398 gentop=
4399 # reload_cmds runs $LD directly, so let us get rid of
4400 # -Wl from whole_archive_flag_spec
4403 if test -n "$convenience"; then
4404 if test -n "$whole_archive_flag_spec"; then
4405 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4406 else
4407 gentop="$output_objdir/${obj}x"
4408 generated="$generated $gentop"
4410 func_extract_archives $gentop $convenience
4411 reload_conv_objs="$reload_objs $func_extract_archives_result"
4415 # Create the old-style object.
4416 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
4418 output="$obj"
4419 cmds=$reload_cmds
4420 save_ifs="$IFS"; IFS='~'
4421 for cmd in $cmds; do
4422 IFS="$save_ifs"
4423 eval cmd=\"$cmd\"
4424 $show "$cmd"
4425 $run eval "$cmd" || exit $?
4426 done
4427 IFS="$save_ifs"
4429 # Exit if we aren't doing a library object file.
4430 if test -z "$libobj"; then
4431 if test -n "$gentop"; then
4432 $show "${rm}r $gentop"
4433 $run ${rm}r $gentop
4436 exit $EXIT_SUCCESS
4439 if test "$build_libtool_libs" != yes; then
4440 if test -n "$gentop"; then
4441 $show "${rm}r $gentop"
4442 $run ${rm}r $gentop
4445 # Create an invalid libtool object if no PIC, so that we don't
4446 # accidentally link it into a program.
4447 # $show "echo timestamp > $libobj"
4448 # $run eval "echo timestamp > $libobj" || exit $?
4449 exit $EXIT_SUCCESS
4452 if test -n "$pic_flag" || test "$pic_mode" != default; then
4453 # Only do commands if we really have different PIC objects.
4454 reload_objs="$libobjs $reload_conv_objs"
4455 output="$libobj"
4456 cmds=$reload_cmds
4457 save_ifs="$IFS"; IFS='~'
4458 for cmd in $cmds; do
4459 IFS="$save_ifs"
4460 eval cmd=\"$cmd\"
4461 $show "$cmd"
4462 $run eval "$cmd" || exit $?
4463 done
4464 IFS="$save_ifs"
4467 if test -n "$gentop"; then
4468 $show "${rm}r $gentop"
4469 $run ${rm}r $gentop
4472 exit $EXIT_SUCCESS
4475 prog)
4476 case $host in
4477 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4478 esac
4479 if test -n "$vinfo"; then
4480 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4483 if test -n "$release"; then
4484 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4487 if test "$preload" = yes; then
4488 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4489 test "$dlopen_self_static" = unknown; then
4490 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4494 case $host in
4495 *-*-rhapsody* | *-*-darwin1.[012])
4496 # On Rhapsody replace the C library is the System framework
4497 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4498 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4500 esac
4502 case $host in
4503 *darwin*)
4504 # Don't allow lazy linking, it breaks C++ global constructors
4505 if test "$tagname" = CXX ; then
4506 compile_command="$compile_command ${wl}-bind_at_load"
4507 finalize_command="$finalize_command ${wl}-bind_at_load"
4510 esac
4512 compile_command="$compile_command $compile_deplibs"
4513 finalize_command="$finalize_command $finalize_deplibs"
4515 if test -n "$rpath$xrpath"; then
4516 # If the user specified any rpath flags, then add them.
4517 for libdir in $rpath $xrpath; do
4518 # This is the magic to use -rpath.
4519 case "$finalize_rpath " in
4520 *" $libdir "*) ;;
4521 *) finalize_rpath="$finalize_rpath $libdir" ;;
4522 esac
4523 done
4526 # Now hardcode the library paths
4527 rpath=
4528 hardcode_libdirs=
4529 for libdir in $compile_rpath $finalize_rpath; do
4530 if test -n "$hardcode_libdir_flag_spec"; then
4531 if test -n "$hardcode_libdir_separator"; then
4532 if test -z "$hardcode_libdirs"; then
4533 hardcode_libdirs="$libdir"
4534 else
4535 # Just accumulate the unique libdirs.
4536 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4537 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4540 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4542 esac
4544 else
4545 eval flag=\"$hardcode_libdir_flag_spec\"
4546 rpath="$rpath $flag"
4548 elif test -n "$runpath_var"; then
4549 case "$perm_rpath " in
4550 *" $libdir "*) ;;
4551 *) perm_rpath="$perm_rpath $libdir" ;;
4552 esac
4554 case $host in
4555 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4556 case :$dllsearchpath: in
4557 *":$libdir:"*) ;;
4558 *) dllsearchpath="$dllsearchpath:$libdir";;
4559 esac
4561 esac
4562 done
4563 # Substitute the hardcoded libdirs into the rpath.
4564 if test -n "$hardcode_libdir_separator" &&
4565 test -n "$hardcode_libdirs"; then
4566 libdir="$hardcode_libdirs"
4567 eval rpath=\" $hardcode_libdir_flag_spec\"
4569 compile_rpath="$rpath"
4571 rpath=
4572 hardcode_libdirs=
4573 for libdir in $finalize_rpath; do
4574 if test -n "$hardcode_libdir_flag_spec"; then
4575 if test -n "$hardcode_libdir_separator"; then
4576 if test -z "$hardcode_libdirs"; then
4577 hardcode_libdirs="$libdir"
4578 else
4579 # Just accumulate the unique libdirs.
4580 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4581 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4584 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4586 esac
4588 else
4589 eval flag=\"$hardcode_libdir_flag_spec\"
4590 rpath="$rpath $flag"
4592 elif test -n "$runpath_var"; then
4593 case "$finalize_perm_rpath " in
4594 *" $libdir "*) ;;
4595 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4596 esac
4598 done
4599 # Substitute the hardcoded libdirs into the rpath.
4600 if test -n "$hardcode_libdir_separator" &&
4601 test -n "$hardcode_libdirs"; then
4602 libdir="$hardcode_libdirs"
4603 eval rpath=\" $hardcode_libdir_flag_spec\"
4605 finalize_rpath="$rpath"
4607 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4608 # Transform all the library objects into standard objects.
4609 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4610 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4613 dlsyms=
4614 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4615 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4616 dlsyms="${outputname}S.c"
4617 else
4618 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4622 if test -n "$dlsyms"; then
4623 case $dlsyms in
4624 "") ;;
4625 *.c)
4626 # Discover the nlist of each of the dlfiles.
4627 nlist="$output_objdir/${outputname}.nm"
4629 $show "$rm $nlist ${nlist}S ${nlist}T"
4630 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4632 # Parse the name list into a source file.
4633 $show "creating $output_objdir/$dlsyms"
4635 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4636 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4637 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4639 #ifdef __cplusplus
4640 extern \"C\" {
4641 #endif
4643 /* Prevent the only kind of declaration conflicts we can make. */
4644 #define lt_preloaded_symbols some_other_symbol
4646 /* External symbol declarations for the compiler. */\
4649 if test "$dlself" = yes; then
4650 $show "generating symbol list for \`$output'"
4652 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4654 # Add our own program objects to the symbol list.
4655 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4656 for arg in $progfiles; do
4657 $show "extracting global C symbols from \`$arg'"
4658 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4659 done
4661 if test -n "$exclude_expsyms"; then
4662 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4663 $run eval '$mv "$nlist"T "$nlist"'
4666 if test -n "$export_symbols_regex"; then
4667 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4668 $run eval '$mv "$nlist"T "$nlist"'
4671 # Prepare the list of exported symbols
4672 if test -z "$export_symbols"; then
4673 export_symbols="$output_objdir/$output.exp"
4674 $run $rm $export_symbols
4675 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4676 else
4677 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4678 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4679 $run eval 'mv "$nlist"T "$nlist"'
4683 for arg in $dlprefiles; do
4684 $show "extracting global C symbols from \`$arg'"
4685 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4686 $run eval '$echo ": $name " >> "$nlist"'
4687 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4688 done
4690 if test -z "$run"; then
4691 # Make sure we have at least an empty file.
4692 test -f "$nlist" || : > "$nlist"
4694 if test -n "$exclude_expsyms"; then
4695 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4696 $mv "$nlist"T "$nlist"
4699 # Try sorting and uniquifying the output.
4700 if grep -v "^: " < "$nlist" |
4701 if sort -k 3 </dev/null >/dev/null 2>&1; then
4702 sort -k 3
4703 else
4704 sort +2
4705 fi |
4706 uniq > "$nlist"S; then
4708 else
4709 grep -v "^: " < "$nlist" > "$nlist"S
4712 if test -f "$nlist"S; then
4713 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4714 else
4715 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4718 $echo >> "$output_objdir/$dlsyms" "\
4720 #undef lt_preloaded_symbols
4722 #if defined (__STDC__) && __STDC__
4723 # define lt_ptr void *
4724 #else
4725 # define lt_ptr char *
4726 # define const
4727 #endif
4729 /* The mapping between symbol names and symbols. */
4730 const struct {
4731 const char *name;
4732 lt_ptr address;
4734 lt_preloaded_symbols[] =
4738 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4740 $echo >> "$output_objdir/$dlsyms" "\
4741 {0, (lt_ptr) 0}
4744 /* This works around a problem in FreeBSD linker */
4745 #ifdef FREEBSD_WORKAROUND
4746 static const void *lt_preloaded_setup() {
4747 return lt_preloaded_symbols;
4749 #endif
4751 #ifdef __cplusplus
4753 #endif\
4757 pic_flag_for_symtable=
4758 case $host in
4759 # compiling the symbol table file with pic_flag works around
4760 # a FreeBSD bug that causes programs to crash when -lm is
4761 # linked before any other PIC object. But we must not use
4762 # pic_flag when linking with -static. The problem exists in
4763 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4764 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4765 case "$compile_command " in
4766 *" -static "*) ;;
4767 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4768 esac;;
4769 *-*-hpux*)
4770 case "$compile_command " in
4771 *" -static "*) ;;
4772 *) pic_flag_for_symtable=" $pic_flag";;
4773 esac
4774 esac
4776 # Now compile the dynamic symbol file.
4777 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4778 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4780 # Clean up the generated files.
4781 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4782 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4784 # Transform the symbol file into the correct name.
4785 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4786 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4789 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4790 exit $EXIT_FAILURE
4792 esac
4793 else
4794 # We keep going just in case the user didn't refer to
4795 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4796 # really was required.
4798 # Nullify the symbol file.
4799 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4800 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4803 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4804 # Replace the output file specification.
4805 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4806 link_command="$compile_command$compile_rpath"
4808 # We have no uninstalled library dependencies, so finalize right now.
4809 $show "$link_command"
4810 $run eval "$link_command"
4811 status=$?
4813 # Delete the generated files.
4814 if test -n "$dlsyms"; then
4815 $show "$rm $output_objdir/${outputname}S.${objext}"
4816 $run $rm "$output_objdir/${outputname}S.${objext}"
4819 exit $status
4822 if test -n "$shlibpath_var"; then
4823 # We should set the shlibpath_var
4824 rpath=
4825 for dir in $temp_rpath; do
4826 case $dir in
4827 [\\/]* | [A-Za-z]:[\\/]*)
4828 # Absolute path.
4829 rpath="$rpath$dir:"
4832 # Relative path: add a thisdir entry.
4833 rpath="$rpath\$thisdir/$dir:"
4835 esac
4836 done
4837 temp_rpath="$rpath"
4840 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4841 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4843 if test -n "$finalize_shlibpath"; then
4844 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4847 compile_var=
4848 finalize_var=
4849 if test -n "$runpath_var"; then
4850 if test -n "$perm_rpath"; then
4851 # We should set the runpath_var.
4852 rpath=
4853 for dir in $perm_rpath; do
4854 rpath="$rpath$dir:"
4855 done
4856 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4858 if test -n "$finalize_perm_rpath"; then
4859 # We should set the runpath_var.
4860 rpath=
4861 for dir in $finalize_perm_rpath; do
4862 rpath="$rpath$dir:"
4863 done
4864 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4868 if test "$no_install" = yes; then
4869 # We don't need to create a wrapper script.
4870 link_command="$compile_var$compile_command$compile_rpath"
4871 # Replace the output file specification.
4872 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4873 # Delete the old output file.
4874 $run $rm $output
4875 # Link the executable and exit
4876 $show "$link_command"
4877 $run eval "$link_command" || exit $?
4878 exit $EXIT_SUCCESS
4881 if test "$hardcode_action" = relink; then
4882 # Fast installation is not supported
4883 link_command="$compile_var$compile_command$compile_rpath"
4884 relink_command="$finalize_var$finalize_command$finalize_rpath"
4886 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4887 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4888 else
4889 if test "$fast_install" != no; then
4890 link_command="$finalize_var$compile_command$finalize_rpath"
4891 if test "$fast_install" = yes; then
4892 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4893 else
4894 # fast_install is set to needless
4895 relink_command=
4897 else
4898 link_command="$compile_var$compile_command$compile_rpath"
4899 relink_command="$finalize_var$finalize_command$finalize_rpath"
4903 # Replace the output file specification.
4904 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4906 # Delete the old output files.
4907 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4909 $show "$link_command"
4910 $run eval "$link_command" || exit $?
4912 # Now create the wrapper script.
4913 $show "creating $output"
4915 # Quote the relink command for shipping.
4916 if test -n "$relink_command"; then
4917 # Preserve any variables that may affect compiler behavior
4918 for var in $variables_saved_for_relink; do
4919 if eval test -z \"\${$var+set}\"; then
4920 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4921 elif eval var_value=\$$var; test -z "$var_value"; then
4922 relink_command="$var=; export $var; $relink_command"
4923 else
4924 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4925 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4927 done
4928 relink_command="(cd `pwd`; $relink_command)"
4929 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4932 # Quote $echo for shipping.
4933 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4934 case $progpath in
4935 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4936 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4937 esac
4938 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4939 else
4940 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4943 # Only actually do things if our run command is non-null.
4944 if test -z "$run"; then
4945 # win32 will think the script is a binary if it has
4946 # a .exe suffix, so we strip it off here.
4947 case $output in
4948 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4949 esac
4950 # test for cygwin because mv fails w/o .exe extensions
4951 case $host in
4952 *cygwin*)
4953 exeext=.exe
4954 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4955 *) exeext= ;;
4956 esac
4957 case $host in
4958 *cygwin* | *mingw* )
4959 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4960 cwrapper=`$echo ${output}.exe`
4961 $rm $cwrappersource $cwrapper
4962 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4964 cat > $cwrappersource <<EOF
4966 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4967 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4969 The $output program cannot be directly executed until all the libtool
4970 libraries that it depends on are installed.
4972 This wrapper executable should never be moved out of the build directory.
4973 If it is, it will not operate correctly.
4975 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4976 but could eventually absorb all of the scripts functionality and
4977 exec $objdir/$outputname directly.
4980 cat >> $cwrappersource<<"EOF"
4981 #include <stdio.h>
4982 #include <stdlib.h>
4983 #include <unistd.h>
4984 #include <malloc.h>
4985 #include <stdarg.h>
4986 #include <assert.h>
4988 #if defined(PATH_MAX)
4989 # define LT_PATHMAX PATH_MAX
4990 #elif defined(MAXPATHLEN)
4991 # define LT_PATHMAX MAXPATHLEN
4992 #else
4993 # define LT_PATHMAX 1024
4994 #endif
4996 #ifndef DIR_SEPARATOR
4997 #define DIR_SEPARATOR '/'
4998 #endif
5000 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5001 defined (__OS2__)
5002 #define HAVE_DOS_BASED_FILE_SYSTEM
5003 #ifndef DIR_SEPARATOR_2
5004 #define DIR_SEPARATOR_2 '\\'
5005 #endif
5006 #endif
5008 #ifndef DIR_SEPARATOR_2
5009 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5010 #else /* DIR_SEPARATOR_2 */
5011 # define IS_DIR_SEPARATOR(ch) \
5012 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5013 #endif /* DIR_SEPARATOR_2 */
5015 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5016 #define XFREE(stale) do { \
5017 if (stale) { free ((void *) stale); stale = 0; } \
5018 } while (0)
5020 const char *program_name = NULL;
5022 void * xmalloc (size_t num);
5023 char * xstrdup (const char *string);
5024 char * basename (const char *name);
5025 char * fnqualify(const char *path);
5026 char * strendzap(char *str, const char *pat);
5027 void lt_fatal (const char *message, ...);
5030 main (int argc, char *argv[])
5032 char **newargz;
5033 int i;
5035 program_name = (char *) xstrdup ((char *) basename (argv[0]));
5036 newargz = XMALLOC(char *, argc+2);
5039 cat >> $cwrappersource <<EOF
5040 newargz[0] = "$SHELL";
5043 cat >> $cwrappersource <<"EOF"
5044 newargz[1] = fnqualify(argv[0]);
5045 /* we know the script has the same name, without the .exe */
5046 /* so make sure newargz[1] doesn't end in .exe */
5047 strendzap(newargz[1],".exe");
5048 for (i = 1; i < argc; i++)
5049 newargz[i+1] = xstrdup(argv[i]);
5050 newargz[argc+1] = NULL;
5053 cat >> $cwrappersource <<EOF
5054 execv("$SHELL",newargz);
5057 cat >> $cwrappersource <<"EOF"
5060 void *
5061 xmalloc (size_t num)
5063 void * p = (void *) malloc (num);
5064 if (!p)
5065 lt_fatal ("Memory exhausted");
5067 return p;
5070 char *
5071 xstrdup (const char *string)
5073 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5077 char *
5078 basename (const char *name)
5080 const char *base;
5082 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5083 /* Skip over the disk name in MSDOS pathnames. */
5084 if (isalpha (name[0]) && name[1] == ':')
5085 name += 2;
5086 #endif
5088 for (base = name; *name; name++)
5089 if (IS_DIR_SEPARATOR (*name))
5090 base = name + 1;
5091 return (char *) base;
5094 char *
5095 fnqualify(const char *path)
5097 size_t size;
5098 char *p;
5099 char tmp[LT_PATHMAX + 1];
5101 assert(path != NULL);
5103 /* Is it qualified already? */
5104 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5105 if (isalpha (path[0]) && path[1] == ':')
5106 return xstrdup (path);
5107 #endif
5108 if (IS_DIR_SEPARATOR (path[0]))
5109 return xstrdup (path);
5111 /* prepend the current directory */
5112 /* doesn't handle '~' */
5113 if (getcwd (tmp, LT_PATHMAX) == NULL)
5114 lt_fatal ("getcwd failed");
5115 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
5116 p = XMALLOC(char, size);
5117 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5118 return p;
5121 char *
5122 strendzap(char *str, const char *pat)
5124 size_t len, patlen;
5126 assert(str != NULL);
5127 assert(pat != NULL);
5129 len = strlen(str);
5130 patlen = strlen(pat);
5132 if (patlen <= len)
5134 str += len - patlen;
5135 if (strcmp(str, pat) == 0)
5136 *str = '\0';
5138 return str;
5141 static void
5142 lt_error_core (int exit_status, const char * mode,
5143 const char * message, va_list ap)
5145 fprintf (stderr, "%s: %s: ", program_name, mode);
5146 vfprintf (stderr, message, ap);
5147 fprintf (stderr, ".\n");
5149 if (exit_status >= 0)
5150 exit (exit_status);
5153 void
5154 lt_fatal (const char *message, ...)
5156 va_list ap;
5157 va_start (ap, message);
5158 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5159 va_end (ap);
5162 # we should really use a build-platform specific compiler
5163 # here, but OTOH, the wrappers (shell script and this C one)
5164 # are only useful if you want to execute the "real" binary.
5165 # Since the "real" binary is built for $host, then this
5166 # wrapper might as well be built for $host, too.
5167 $run $LTCC -s -o $cwrapper $cwrappersource
5169 esac
5170 $rm $output
5171 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5173 $echo > $output "\
5174 #! $SHELL
5176 # $output - temporary wrapper script for $objdir/$outputname
5177 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5179 # The $output program cannot be directly executed until all the libtool
5180 # libraries that it depends on are installed.
5182 # This wrapper script should never be moved out of the build directory.
5183 # If it is, it will not operate correctly.
5185 # Sed substitution that helps us do robust quoting. It backslashifies
5186 # metacharacters that are still active within double-quoted strings.
5187 Xsed='${SED} -e 1s/^X//'
5188 sed_quote_subst='$sed_quote_subst'
5190 # The HP-UX ksh and POSIX shell print the target directory to stdout
5191 # if CDPATH is set.
5192 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5194 relink_command=\"$relink_command\"
5196 # This environment variable determines our operation mode.
5197 if test \"\$libtool_install_magic\" = \"$magic\"; then
5198 # install mode needs the following variable:
5199 notinst_deplibs='$notinst_deplibs'
5200 else
5201 # When we are sourced in execute mode, \$file and \$echo are already set.
5202 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5203 echo=\"$qecho\"
5204 file=\"\$0\"
5205 # Make sure echo works.
5206 if test \"X\$1\" = X--no-reexec; then
5207 # Discard the --no-reexec flag, and continue.
5208 shift
5209 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5210 # Yippee, \$echo works!
5212 else
5213 # Restart under the correct shell, and then maybe \$echo will work.
5214 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5218 $echo >> $output "\
5220 # Find the directory that this script lives in.
5221 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5222 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5224 # Follow symbolic links until we get to the real thisdir.
5225 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5226 while test -n \"\$file\"; do
5227 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5229 # If there was a directory component, then change thisdir.
5230 if test \"x\$destdir\" != \"x\$file\"; then
5231 case \"\$destdir\" in
5232 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5233 *) thisdir=\"\$thisdir/\$destdir\" ;;
5234 esac
5237 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5238 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5239 done
5241 # Try to get the absolute directory name.
5242 absdir=\`cd \"\$thisdir\" && pwd\`
5243 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5246 if test "$fast_install" = yes; then
5247 $echo >> $output "\
5248 program=lt-'$outputname'$exeext
5249 progdir=\"\$thisdir/$objdir\"
5251 if test ! -f \"\$progdir/\$program\" || \\
5252 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5253 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5255 file=\"\$\$-\$program\"
5257 if test ! -d \"\$progdir\"; then
5258 $mkdir \"\$progdir\"
5259 else
5260 $rm \"\$progdir/\$file\"
5263 $echo >> $output "\
5265 # relink executable if necessary
5266 if test -n \"\$relink_command\"; then
5267 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5268 else
5269 $echo \"\$relink_command_output\" >&2
5270 $rm \"\$progdir/\$file\"
5271 exit $EXIT_FAILURE
5275 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5276 { $rm \"\$progdir/\$program\";
5277 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5278 $rm \"\$progdir/\$file\"
5280 else
5281 $echo >> $output "\
5282 program='$outputname'
5283 progdir=\"\$thisdir/$objdir\"
5287 $echo >> $output "\
5289 if test -f \"\$progdir/\$program\"; then"
5291 # Export our shlibpath_var if we have one.
5292 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5293 $echo >> $output "\
5294 # Add our own library path to $shlibpath_var
5295 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5297 # Some systems cannot cope with colon-terminated $shlibpath_var
5298 # The second colon is a workaround for a bug in BeOS R4 sed
5299 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5301 export $shlibpath_var
5305 # fixup the dll searchpath if we need to.
5306 if test -n "$dllsearchpath"; then
5307 $echo >> $output "\
5308 # Add the dll search path components to the executable PATH
5309 PATH=$dllsearchpath:\$PATH
5313 $echo >> $output "\
5314 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5315 # Run the actual program with our arguments.
5317 case $host in
5318 # Backslashes separate directories on plain windows
5319 *-*-mingw | *-*-os2*)
5320 $echo >> $output "\
5321 exec \$progdir\\\\\$program \${1+\"\$@\"}
5326 $echo >> $output "\
5327 exec \$progdir/\$program \${1+\"\$@\"}
5330 esac
5331 $echo >> $output "\
5332 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5333 exit $EXIT_FAILURE
5335 else
5336 # The program doesn't exist.
5337 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5338 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5339 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5340 exit $EXIT_FAILURE
5344 chmod +x $output
5346 exit $EXIT_SUCCESS
5348 esac
5350 # See if we need to build an old-fashioned archive.
5351 for oldlib in $oldlibs; do
5353 if test "$build_libtool_libs" = convenience; then
5354 oldobjs="$libobjs_save"
5355 addlibs="$convenience"
5356 build_libtool_libs=no
5357 else
5358 if test "$build_libtool_libs" = module; then
5359 oldobjs="$libobjs_save"
5360 build_libtool_libs=no
5361 else
5362 oldobjs="$old_deplibs $non_pic_objects"
5364 addlibs="$old_convenience"
5367 if test -n "$addlibs"; then
5368 gentop="$output_objdir/${outputname}x"
5369 generated="$generated $gentop"
5371 func_extract_archives $gentop $addlibs
5372 oldobjs="$oldobjs $func_extract_archives_result"
5375 # Do each command in the archive commands.
5376 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5377 cmds=$old_archive_from_new_cmds
5378 else
5379 eval cmds=\"$old_archive_cmds\"
5381 if len=`expr "X$cmds" : ".*"` &&
5382 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5383 cmds=$old_archive_cmds
5384 else
5385 # the command line is too long to link in one step, link in parts
5386 $echo "using piecewise archive linking..."
5387 save_RANLIB=$RANLIB
5388 RANLIB=:
5389 objlist=
5390 concat_cmds=
5391 save_oldobjs=$oldobjs
5392 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5393 # encoded into archives. This makes 'ar r' malfunction in
5394 # this piecewise linking case whenever conflicting object
5395 # names appear in distinct ar calls; check, warn and compensate.
5396 if (for obj in $save_oldobjs
5398 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5399 done | sort | sort -uc >/dev/null 2>&1); then
5401 else
5402 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5403 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5404 AR_FLAGS=cq
5406 # Is there a better way of finding the last object in the list?
5407 for obj in $save_oldobjs
5409 last_oldobj=$obj
5410 done
5411 for obj in $save_oldobjs
5413 oldobjs="$objlist $obj"
5414 objlist="$objlist $obj"
5415 eval test_cmds=\"$old_archive_cmds\"
5416 if len=`expr "X$test_cmds" : ".*"` &&
5417 test "$len" -le "$max_cmd_len"; then
5419 else
5420 # the above command should be used before it gets too long
5421 oldobjs=$objlist
5422 if test "$obj" = "$last_oldobj" ; then
5423 RANLIB=$save_RANLIB
5425 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5426 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5427 objlist=
5429 done
5430 RANLIB=$save_RANLIB
5431 oldobjs=$objlist
5432 if test "X$oldobjs" = "X" ; then
5433 eval cmds=\"\$concat_cmds\"
5434 else
5435 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5439 save_ifs="$IFS"; IFS='~'
5440 for cmd in $cmds; do
5441 eval cmd=\"$cmd\"
5442 IFS="$save_ifs"
5443 $show "$cmd"
5444 $run eval "$cmd" || exit $?
5445 done
5446 IFS="$save_ifs"
5447 done
5449 if test -n "$generated"; then
5450 $show "${rm}r$generated"
5451 $run ${rm}r$generated
5454 # Now create the libtool archive.
5455 case $output in
5456 *.la)
5457 old_library=
5458 test "$build_old_libs" = yes && old_library="$libname.$libext"
5459 $show "creating $output"
5461 # Preserve any variables that may affect compiler behavior
5462 for var in $variables_saved_for_relink; do
5463 if eval test -z \"\${$var+set}\"; then
5464 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5465 elif eval var_value=\$$var; test -z "$var_value"; then
5466 relink_command="$var=; export $var; $relink_command"
5467 else
5468 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5469 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5471 done
5472 # Quote the link command for shipping.
5473 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5474 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5475 if test "$hardcode_automatic" = yes ; then
5476 relink_command=
5480 # Only create the output if not a dry run.
5481 if test -z "$run"; then
5482 for installed in no yes; do
5483 if test "$installed" = yes; then
5484 if test -z "$install_libdir"; then
5485 break
5487 output="$output_objdir/$outputname"i
5488 # Replace all uninstalled libtool libraries with the installed ones
5489 newdependency_libs=
5490 for deplib in $dependency_libs; do
5491 case $deplib in
5492 *.la)
5493 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5494 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5495 if test -z "$libdir"; then
5496 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5497 exit $EXIT_FAILURE
5499 newdependency_libs="$newdependency_libs $libdir/$name"
5501 *) newdependency_libs="$newdependency_libs $deplib" ;;
5502 esac
5503 done
5504 dependency_libs="$newdependency_libs"
5505 newdlfiles=
5506 for lib in $dlfiles; do
5507 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5508 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5509 if test -z "$libdir"; then
5510 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5511 exit $EXIT_FAILURE
5513 newdlfiles="$newdlfiles $libdir/$name"
5514 done
5515 dlfiles="$newdlfiles"
5516 newdlprefiles=
5517 for lib in $dlprefiles; do
5518 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5519 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5520 if test -z "$libdir"; then
5521 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5522 exit $EXIT_FAILURE
5524 newdlprefiles="$newdlprefiles $libdir/$name"
5525 done
5526 dlprefiles="$newdlprefiles"
5527 else
5528 newdlfiles=
5529 for lib in $dlfiles; do
5530 case $lib in
5531 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5532 *) abs=`pwd`"/$lib" ;;
5533 esac
5534 newdlfiles="$newdlfiles $abs"
5535 done
5536 dlfiles="$newdlfiles"
5537 newdlprefiles=
5538 for lib in $dlprefiles; do
5539 case $lib in
5540 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5541 *) abs=`pwd`"/$lib" ;;
5542 esac
5543 newdlprefiles="$newdlprefiles $abs"
5544 done
5545 dlprefiles="$newdlprefiles"
5547 $rm $output
5548 # place dlname in correct position for cygwin
5549 tdlname=$dlname
5550 case $host,$output,$installed,$module,$dlname in
5551 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5552 esac
5553 $echo > $output "\
5554 # $outputname - a libtool library file
5555 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5557 # Please DO NOT delete this file!
5558 # It is necessary for linking the library.
5560 # The name that we can dlopen(3).
5561 dlname='$tdlname'
5563 # Names of this library.
5564 library_names='$library_names'
5566 # The name of the static archive.
5567 old_library='$old_library'
5569 # Libraries that this one depends upon.
5570 dependency_libs='$dependency_libs'
5572 # Version information for $libname.
5573 current=$current
5574 age=$age
5575 revision=$revision
5577 # Is this an already installed library?
5578 installed=$installed
5580 # Should we warn about portability when linking against -modules?
5581 shouldnotlink=$module
5583 # Files to dlopen/dlpreopen
5584 dlopen='$dlfiles'
5585 dlpreopen='$dlprefiles'
5587 # Directory that this library needs to be installed in:
5588 libdir='$install_libdir'"
5589 if test "$installed" = no && test "$need_relink" = yes; then
5590 $echo >> $output "\
5591 relink_command=\"$relink_command\""
5593 done
5596 # Do a symbolic link so that the libtool archive can be found in
5597 # LD_LIBRARY_PATH before the program is installed.
5598 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5599 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5601 esac
5602 exit $EXIT_SUCCESS
5605 # libtool install mode
5606 install)
5607 modename="$modename: install"
5609 # There may be an optional sh(1) argument at the beginning of
5610 # install_prog (especially on Windows NT).
5611 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5612 # Allow the use of GNU shtool's install command.
5613 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5614 # Aesthetically quote it.
5615 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5616 case $arg in
5617 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5618 arg="\"$arg\""
5620 esac
5621 install_prog="$arg "
5622 arg="$1"
5623 shift
5624 else
5625 install_prog=
5626 arg="$nonopt"
5629 # The real first argument should be the name of the installation program.
5630 # Aesthetically quote it.
5631 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5632 case $arg in
5633 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5634 arg="\"$arg\""
5636 esac
5637 install_prog="$install_prog$arg"
5639 # We need to accept at least all the BSD install flags.
5640 dest=
5641 files=
5642 opts=
5643 prev=
5644 install_type=
5645 isdir=no
5646 stripme=
5647 for arg
5649 if test -n "$dest"; then
5650 files="$files $dest"
5651 dest="$arg"
5652 continue
5655 case $arg in
5656 -d) isdir=yes ;;
5657 -f) prev="-f" ;;
5658 -g) prev="-g" ;;
5659 -m) prev="-m" ;;
5660 -o) prev="-o" ;;
5662 stripme=" -s"
5663 continue
5665 -*) ;;
5668 # If the previous option needed an argument, then skip it.
5669 if test -n "$prev"; then
5670 prev=
5671 else
5672 dest="$arg"
5673 continue
5676 esac
5678 # Aesthetically quote the argument.
5679 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5680 case $arg in
5681 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5682 arg="\"$arg\""
5684 esac
5685 install_prog="$install_prog $arg"
5686 done
5688 if test -z "$install_prog"; then
5689 $echo "$modename: you must specify an install program" 1>&2
5690 $echo "$help" 1>&2
5691 exit $EXIT_FAILURE
5694 if test -n "$prev"; then
5695 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5696 $echo "$help" 1>&2
5697 exit $EXIT_FAILURE
5700 if test -z "$files"; then
5701 if test -z "$dest"; then
5702 $echo "$modename: no file or destination specified" 1>&2
5703 else
5704 $echo "$modename: you must specify a destination" 1>&2
5706 $echo "$help" 1>&2
5707 exit $EXIT_FAILURE
5710 # Strip any trailing slash from the destination.
5711 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5713 # Check to see that the destination is a directory.
5714 test -d "$dest" && isdir=yes
5715 if test "$isdir" = yes; then
5716 destdir="$dest"
5717 destname=
5718 else
5719 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5720 test "X$destdir" = "X$dest" && destdir=.
5721 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5723 # Not a directory, so check to see that there is only one file specified.
5724 set dummy $files
5725 if test "$#" -gt 2; then
5726 $echo "$modename: \`$dest' is not a directory" 1>&2
5727 $echo "$help" 1>&2
5728 exit $EXIT_FAILURE
5731 case $destdir in
5732 [\\/]* | [A-Za-z]:[\\/]*) ;;
5734 for file in $files; do
5735 case $file in
5736 *.lo) ;;
5738 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5739 $echo "$help" 1>&2
5740 exit $EXIT_FAILURE
5742 esac
5743 done
5745 esac
5747 # This variable tells wrapper scripts just to set variables rather
5748 # than running their programs.
5749 libtool_install_magic="$magic"
5751 staticlibs=
5752 future_libdirs=
5753 current_libdirs=
5754 for file in $files; do
5756 # Do each installation.
5757 case $file in
5758 *.$libext)
5759 # Do the static libraries later.
5760 staticlibs="$staticlibs $file"
5763 *.la)
5764 # Check to see that this really is a libtool archive.
5765 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5766 else
5767 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5768 $echo "$help" 1>&2
5769 exit $EXIT_FAILURE
5772 library_names=
5773 old_library=
5774 relink_command=
5775 # If there is no directory component, then add one.
5776 case $file in
5777 */* | *\\*) . $file ;;
5778 *) . ./$file ;;
5779 esac
5781 # Add the libdir to current_libdirs if it is the destination.
5782 if test "X$destdir" = "X$libdir"; then
5783 case "$current_libdirs " in
5784 *" $libdir "*) ;;
5785 *) current_libdirs="$current_libdirs $libdir" ;;
5786 esac
5787 else
5788 # Note the libdir as a future libdir.
5789 case "$future_libdirs " in
5790 *" $libdir "*) ;;
5791 *) future_libdirs="$future_libdirs $libdir" ;;
5792 esac
5795 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5796 test "X$dir" = "X$file/" && dir=
5797 dir="$dir$objdir"
5799 if test -n "$relink_command"; then
5800 # Determine the prefix the user has applied to our future dir.
5801 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5803 # Don't allow the user to place us outside of our expected
5804 # location b/c this prevents finding dependent libraries that
5805 # are installed to the same prefix.
5806 # At present, this check doesn't affect windows .dll's that
5807 # are installed into $libdir/../bin (currently, that works fine)
5808 # but it's something to keep an eye on.
5809 if test "$inst_prefix_dir" = "$destdir"; then
5810 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5811 exit $EXIT_FAILURE
5814 if test -n "$inst_prefix_dir"; then
5815 # Stick the inst_prefix_dir data into the link command.
5816 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5817 else
5818 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5821 $echo "$modename: warning: relinking \`$file'" 1>&2
5822 $show "$relink_command"
5823 if $run eval "$relink_command"; then :
5824 else
5825 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5826 exit $EXIT_FAILURE
5830 # See the names of the shared library.
5831 set dummy $library_names
5832 if test -n "$2"; then
5833 realname="$2"
5834 shift
5835 shift
5837 srcname="$realname"
5838 test -n "$relink_command" && srcname="$realname"T
5840 # Install the shared library and build the symlinks.
5841 $show "$install_prog $dir/$srcname $destdir/$realname"
5842 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5843 if test -n "$stripme" && test -n "$striplib"; then
5844 $show "$striplib $destdir/$realname"
5845 $run eval "$striplib $destdir/$realname" || exit $?
5848 if test "$#" -gt 0; then
5849 # Delete the old symlinks, and create new ones.
5850 for linkname
5852 if test "$linkname" != "$realname"; then
5853 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5854 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5856 done
5859 # Do each command in the postinstall commands.
5860 lib="$destdir/$realname"
5861 cmds=$postinstall_cmds
5862 save_ifs="$IFS"; IFS='~'
5863 for cmd in $cmds; do
5864 IFS="$save_ifs"
5865 eval cmd=\"$cmd\"
5866 $show "$cmd"
5867 $run eval "$cmd" || exit $?
5868 done
5869 IFS="$save_ifs"
5872 # Install the pseudo-library for information purposes.
5873 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5874 instname="$dir/$name"i
5875 $show "$install_prog $instname $destdir/$name"
5876 $run eval "$install_prog $instname $destdir/$name" || exit $?
5878 # Maybe install the static library, too.
5879 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5882 *.lo)
5883 # Install (i.e. copy) a libtool object.
5885 # Figure out destination file name, if it wasn't already specified.
5886 if test -n "$destname"; then
5887 destfile="$destdir/$destname"
5888 else
5889 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5890 destfile="$destdir/$destfile"
5893 # Deduce the name of the destination old-style object file.
5894 case $destfile in
5895 *.lo)
5896 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5898 *.$objext)
5899 staticdest="$destfile"
5900 destfile=
5903 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5904 $echo "$help" 1>&2
5905 exit $EXIT_FAILURE
5907 esac
5909 # Install the libtool object if requested.
5910 if test -n "$destfile"; then
5911 $show "$install_prog $file $destfile"
5912 $run eval "$install_prog $file $destfile" || exit $?
5915 # Install the old object if enabled.
5916 if test "$build_old_libs" = yes; then
5917 # Deduce the name of the old-style object file.
5918 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5920 $show "$install_prog $staticobj $staticdest"
5921 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5923 exit $EXIT_SUCCESS
5927 # Figure out destination file name, if it wasn't already specified.
5928 if test -n "$destname"; then
5929 destfile="$destdir/$destname"
5930 else
5931 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5932 destfile="$destdir/$destfile"
5935 # If the file is missing, and there is a .exe on the end, strip it
5936 # because it is most likely a libtool script we actually want to
5937 # install
5938 stripped_ext=""
5939 case $file in
5940 *.exe)
5941 if test ! -f "$file"; then
5942 file=`$echo $file|${SED} 's,.exe$,,'`
5943 stripped_ext=".exe"
5946 esac
5948 # Do a test to see if this is really a libtool program.
5949 case $host in
5950 *cygwin*|*mingw*)
5951 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5954 wrapper=$file
5956 esac
5957 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5958 notinst_deplibs=
5959 relink_command=
5961 # To insure that "foo" is sourced, and not "foo.exe",
5962 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5963 # which disallows the automatic-append-.exe behavior.
5964 case $build in
5965 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5966 *) wrapperdot=${wrapper} ;;
5967 esac
5968 # If there is no directory component, then add one.
5969 case $file in
5970 */* | *\\*) . ${wrapperdot} ;;
5971 *) . ./${wrapperdot} ;;
5972 esac
5974 # Check the variables that should have been set.
5975 if test -z "$notinst_deplibs"; then
5976 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5977 exit $EXIT_FAILURE
5980 finalize=yes
5981 for lib in $notinst_deplibs; do
5982 # Check to see that each library is installed.
5983 libdir=
5984 if test -f "$lib"; then
5985 # If there is no directory component, then add one.
5986 case $lib in
5987 */* | *\\*) . $lib ;;
5988 *) . ./$lib ;;
5989 esac
5991 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5992 if test -n "$libdir" && test ! -f "$libfile"; then
5993 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5994 finalize=no
5996 done
5998 relink_command=
5999 # To insure that "foo" is sourced, and not "foo.exe",
6000 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6001 # which disallows the automatic-append-.exe behavior.
6002 case $build in
6003 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
6004 *) wrapperdot=${wrapper} ;;
6005 esac
6006 # If there is no directory component, then add one.
6007 case $file in
6008 */* | *\\*) . ${wrapperdot} ;;
6009 *) . ./${wrapperdot} ;;
6010 esac
6012 outputname=
6013 if test "$fast_install" = no && test -n "$relink_command"; then
6014 if test "$finalize" = yes && test -z "$run"; then
6015 tmpdir="/tmp"
6016 test -n "$TMPDIR" && tmpdir="$TMPDIR"
6017 tmpdir="$tmpdir/libtool-$$"
6018 save_umask=`umask`
6019 umask 0077
6020 if $mkdir "$tmpdir"; then
6021 umask $save_umask
6022 else
6023 umask $save_umask
6024 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
6025 continue
6027 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6028 outputname="$tmpdir/$file"
6029 # Replace the output file specification.
6030 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6032 $show "$relink_command"
6033 if $run eval "$relink_command"; then :
6034 else
6035 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6036 ${rm}r "$tmpdir"
6037 continue
6039 file="$outputname"
6040 else
6041 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6043 else
6044 # Install the binary that we compiled earlier.
6045 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6049 # remove .exe since cygwin /usr/bin/install will append another
6050 # one anyways
6051 case $install_prog,$host in
6052 */usr/bin/install*,*cygwin*)
6053 case $file:$destfile in
6054 *.exe:*.exe)
6055 # this is ok
6057 *.exe:*)
6058 destfile=$destfile.exe
6060 *:*.exe)
6061 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6063 esac
6065 esac
6066 $show "$install_prog$stripme $file $destfile"
6067 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6068 test -n "$outputname" && ${rm}r "$tmpdir"
6070 esac
6071 done
6073 for file in $staticlibs; do
6074 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6076 # Set up the ranlib parameters.
6077 oldlib="$destdir/$name"
6079 $show "$install_prog $file $oldlib"
6080 $run eval "$install_prog \$file \$oldlib" || exit $?
6082 if test -n "$stripme" && test -n "$old_striplib"; then
6083 $show "$old_striplib $oldlib"
6084 $run eval "$old_striplib $oldlib" || exit $?
6087 # Do each command in the postinstall commands.
6088 cmds=$old_postinstall_cmds
6089 save_ifs="$IFS"; IFS='~'
6090 for cmd in $cmds; do
6091 IFS="$save_ifs"
6092 eval cmd=\"$cmd\"
6093 $show "$cmd"
6094 $run eval "$cmd" || exit $?
6095 done
6096 IFS="$save_ifs"
6097 done
6099 if test -n "$future_libdirs"; then
6100 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6103 if test -n "$current_libdirs"; then
6104 # Maybe just do a dry run.
6105 test -n "$run" && current_libdirs=" -n$current_libdirs"
6106 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6107 else
6108 exit $EXIT_SUCCESS
6112 # libtool finish mode
6113 finish)
6114 modename="$modename: finish"
6115 libdirs="$nonopt"
6116 admincmds=
6118 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6119 for dir
6121 libdirs="$libdirs $dir"
6122 done
6124 for libdir in $libdirs; do
6125 if test -n "$finish_cmds"; then
6126 # Do each command in the finish commands.
6127 cmds=$finish_cmds
6128 save_ifs="$IFS"; IFS='~'
6129 for cmd in $cmds; do
6130 IFS="$save_ifs"
6131 eval cmd=\"$cmd\"
6132 $show "$cmd"
6133 $run eval "$cmd" || admincmds="$admincmds
6134 $cmd"
6135 done
6136 IFS="$save_ifs"
6138 if test -n "$finish_eval"; then
6139 # Do the single finish_eval.
6140 eval cmds=\"$finish_eval\"
6141 $run eval "$cmds" || admincmds="$admincmds
6142 $cmds"
6144 done
6147 # Exit here if they wanted silent mode.
6148 test "$show" = : && exit $EXIT_SUCCESS
6150 $echo "----------------------------------------------------------------------"
6151 $echo "Libraries have been installed in:"
6152 for libdir in $libdirs; do
6153 $echo " $libdir"
6154 done
6155 $echo
6156 $echo "If you ever happen to want to link against installed libraries"
6157 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6158 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6159 $echo "flag during linking and do at least one of the following:"
6160 if test -n "$shlibpath_var"; then
6161 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6162 $echo " during execution"
6164 if test -n "$runpath_var"; then
6165 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6166 $echo " during linking"
6168 if test -n "$hardcode_libdir_flag_spec"; then
6169 libdir=LIBDIR
6170 eval flag=\"$hardcode_libdir_flag_spec\"
6172 $echo " - use the \`$flag' linker flag"
6174 if test -n "$admincmds"; then
6175 $echo " - have your system administrator run these commands:$admincmds"
6177 if test -f /etc/ld.so.conf; then
6178 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6180 $echo
6181 $echo "See any operating system documentation about shared libraries for"
6182 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6183 $echo "----------------------------------------------------------------------"
6184 exit $EXIT_SUCCESS
6187 # libtool execute mode
6188 execute)
6189 modename="$modename: execute"
6191 # The first argument is the command name.
6192 cmd="$nonopt"
6193 if test -z "$cmd"; then
6194 $echo "$modename: you must specify a COMMAND" 1>&2
6195 $echo "$help"
6196 exit $EXIT_FAILURE
6199 # Handle -dlopen flags immediately.
6200 for file in $execute_dlfiles; do
6201 if test ! -f "$file"; then
6202 $echo "$modename: \`$file' is not a file" 1>&2
6203 $echo "$help" 1>&2
6204 exit $EXIT_FAILURE
6207 dir=
6208 case $file in
6209 *.la)
6210 # Check to see that this really is a libtool archive.
6211 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6212 else
6213 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6214 $echo "$help" 1>&2
6215 exit $EXIT_FAILURE
6218 # Read the libtool library.
6219 dlname=
6220 library_names=
6222 # If there is no directory component, then add one.
6223 case $file in
6224 */* | *\\*) . $file ;;
6225 *) . ./$file ;;
6226 esac
6228 # Skip this library if it cannot be dlopened.
6229 if test -z "$dlname"; then
6230 # Warn if it was a shared library.
6231 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6232 continue
6235 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6236 test "X$dir" = "X$file" && dir=.
6238 if test -f "$dir/$objdir/$dlname"; then
6239 dir="$dir/$objdir"
6240 else
6241 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6242 exit $EXIT_FAILURE
6246 *.lo)
6247 # Just add the directory containing the .lo file.
6248 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6249 test "X$dir" = "X$file" && dir=.
6253 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6254 continue
6256 esac
6258 # Get the absolute pathname.
6259 absdir=`cd "$dir" && pwd`
6260 test -n "$absdir" && dir="$absdir"
6262 # Now add the directory to shlibpath_var.
6263 if eval "test -z \"\$$shlibpath_var\""; then
6264 eval "$shlibpath_var=\"\$dir\""
6265 else
6266 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6268 done
6270 # This variable tells wrapper scripts just to set shlibpath_var
6271 # rather than running their programs.
6272 libtool_execute_magic="$magic"
6274 # Check if any of the arguments is a wrapper script.
6275 args=
6276 for file
6278 case $file in
6279 -*) ;;
6281 # Do a test to see if this is really a libtool program.
6282 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6283 # If there is no directory component, then add one.
6284 case $file in
6285 */* | *\\*) . $file ;;
6286 *) . ./$file ;;
6287 esac
6289 # Transform arg to wrapped name.
6290 file="$progdir/$program"
6293 esac
6294 # Quote arguments (to preserve shell metacharacters).
6295 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6296 args="$args \"$file\""
6297 done
6299 if test -z "$run"; then
6300 if test -n "$shlibpath_var"; then
6301 # Export the shlibpath_var.
6302 eval "export $shlibpath_var"
6305 # Restore saved environment variables
6306 if test "${save_LC_ALL+set}" = set; then
6307 LC_ALL="$save_LC_ALL"; export LC_ALL
6309 if test "${save_LANG+set}" = set; then
6310 LANG="$save_LANG"; export LANG
6313 # Now prepare to actually exec the command.
6314 exec_cmd="\$cmd$args"
6315 else
6316 # Display what would be done.
6317 if test -n "$shlibpath_var"; then
6318 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6319 $echo "export $shlibpath_var"
6321 $echo "$cmd$args"
6322 exit $EXIT_SUCCESS
6326 # libtool clean and uninstall mode
6327 clean | uninstall)
6328 modename="$modename: $mode"
6329 rm="$nonopt"
6330 files=
6331 rmforce=
6332 exit_status=0
6334 # This variable tells wrapper scripts just to set variables rather
6335 # than running their programs.
6336 libtool_install_magic="$magic"
6338 for arg
6340 case $arg in
6341 -f) rm="$rm $arg"; rmforce=yes ;;
6342 -*) rm="$rm $arg" ;;
6343 *) files="$files $arg" ;;
6344 esac
6345 done
6347 if test -z "$rm"; then
6348 $echo "$modename: you must specify an RM program" 1>&2
6349 $echo "$help" 1>&2
6350 exit $EXIT_FAILURE
6353 rmdirs=
6355 origobjdir="$objdir"
6356 for file in $files; do
6357 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6358 if test "X$dir" = "X$file"; then
6359 dir=.
6360 objdir="$origobjdir"
6361 else
6362 objdir="$dir/$origobjdir"
6364 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6365 test "$mode" = uninstall && objdir="$dir"
6367 # Remember objdir for removal later, being careful to avoid duplicates
6368 if test "$mode" = clean; then
6369 case " $rmdirs " in
6370 *" $objdir "*) ;;
6371 *) rmdirs="$rmdirs $objdir" ;;
6372 esac
6375 # Don't error if the file doesn't exist and rm -f was used.
6376 if (test -L "$file") >/dev/null 2>&1 \
6377 || (test -h "$file") >/dev/null 2>&1 \
6378 || test -f "$file"; then
6380 elif test -d "$file"; then
6381 exit_status=1
6382 continue
6383 elif test "$rmforce" = yes; then
6384 continue
6387 rmfiles="$file"
6389 case $name in
6390 *.la)
6391 # Possibly a libtool archive, so verify it.
6392 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6393 . $dir/$name
6395 # Delete the libtool libraries and symlinks.
6396 for n in $library_names; do
6397 rmfiles="$rmfiles $objdir/$n"
6398 done
6399 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6400 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6402 if test "$mode" = uninstall; then
6403 if test -n "$library_names"; then
6404 # Do each command in the postuninstall commands.
6405 cmds=$postuninstall_cmds
6406 save_ifs="$IFS"; IFS='~'
6407 for cmd in $cmds; do
6408 IFS="$save_ifs"
6409 eval cmd=\"$cmd\"
6410 $show "$cmd"
6411 $run eval "$cmd"
6412 if test "$?" -ne 0 && test "$rmforce" != yes; then
6413 exit_status=1
6415 done
6416 IFS="$save_ifs"
6419 if test -n "$old_library"; then
6420 # Do each command in the old_postuninstall commands.
6421 cmds=$old_postuninstall_cmds
6422 save_ifs="$IFS"; IFS='~'
6423 for cmd in $cmds; do
6424 IFS="$save_ifs"
6425 eval cmd=\"$cmd\"
6426 $show "$cmd"
6427 $run eval "$cmd"
6428 if test "$?" -ne 0 && test "$rmforce" != yes; then
6429 exit_status=1
6431 done
6432 IFS="$save_ifs"
6434 # FIXME: should reinstall the best remaining shared library.
6439 *.lo)
6440 # Possibly a libtool object, so verify it.
6441 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6443 # Read the .lo file
6444 . $dir/$name
6446 # Add PIC object to the list of files to remove.
6447 if test -n "$pic_object" \
6448 && test "$pic_object" != none; then
6449 rmfiles="$rmfiles $dir/$pic_object"
6452 # Add non-PIC object to the list of files to remove.
6453 if test -n "$non_pic_object" \
6454 && test "$non_pic_object" != none; then
6455 rmfiles="$rmfiles $dir/$non_pic_object"
6461 if test "$mode" = clean ; then
6462 noexename=$name
6463 case $file in
6464 *.exe)
6465 file=`$echo $file|${SED} 's,.exe$,,'`
6466 noexename=`$echo $name|${SED} 's,.exe$,,'`
6467 # $file with .exe has already been added to rmfiles,
6468 # add $file without .exe
6469 rmfiles="$rmfiles $file"
6471 esac
6472 # Do a test to see if this is a libtool program.
6473 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6474 relink_command=
6475 . $dir/$noexename
6477 # note $name still contains .exe if it was in $file originally
6478 # as does the version of $file that was added into $rmfiles
6479 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6480 if test "$fast_install" = yes && test -n "$relink_command"; then
6481 rmfiles="$rmfiles $objdir/lt-$name"
6483 if test "X$noexename" != "X$name" ; then
6484 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6489 esac
6490 $show "$rm $rmfiles"
6491 $run $rm $rmfiles || exit_status=1
6492 done
6493 objdir="$origobjdir"
6495 # Try to remove the ${objdir}s in the directories where we deleted files
6496 for dir in $rmdirs; do
6497 if test -d "$dir"; then
6498 $show "rmdir $dir"
6499 $run rmdir $dir >/dev/null 2>&1
6501 done
6503 exit $exit_status
6507 $echo "$modename: you must specify a MODE" 1>&2
6508 $echo "$generic_help" 1>&2
6509 exit $EXIT_FAILURE
6511 esac
6513 if test -z "$exec_cmd"; then
6514 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6515 $echo "$generic_help" 1>&2
6516 exit $EXIT_FAILURE
6518 fi # test -z "$show_help"
6520 if test -n "$exec_cmd"; then
6521 eval exec $exec_cmd
6522 exit $EXIT_FAILURE
6525 # We need to display help for each of the modes.
6526 case $mode in
6527 "") $echo \
6528 "Usage: $modename [OPTION]... [MODE-ARG]...
6530 Provide generalized library-building support services.
6532 --config show all configuration variables
6533 --debug enable verbose shell tracing
6534 -n, --dry-run display commands without modifying any files
6535 --features display basic configuration information and exit
6536 --finish same as \`--mode=finish'
6537 --help display this help message and exit
6538 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6539 --quiet same as \`--silent'
6540 --silent don't print informational messages
6541 --tag=TAG use configuration variables from tag TAG
6542 --version print version information
6544 MODE must be one of the following:
6546 clean remove files from the build directory
6547 compile compile a source file into a libtool object
6548 execute automatically set library path, then run a program
6549 finish complete the installation of libtool libraries
6550 install install libraries or executables
6551 link create a library or an executable
6552 uninstall remove libraries from an installed directory
6554 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6555 a more detailed description of MODE.
6557 Report bugs to <bug-libtool@gnu.org>."
6558 exit $EXIT_SUCCESS
6561 clean)
6562 $echo \
6563 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6565 Remove files from the build directory.
6567 RM is the name of the program to use to delete files associated with each FILE
6568 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6569 to RM.
6571 If FILE is a libtool library, object or program, all the files associated
6572 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6575 compile)
6576 $echo \
6577 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6579 Compile a source file into a libtool library object.
6581 This mode accepts the following additional options:
6583 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6584 -prefer-pic try to building PIC objects only
6585 -prefer-non-pic try to building non-PIC objects only
6586 -static always build a \`.o' file suitable for static linking
6588 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6589 from the given SOURCEFILE.
6591 The output file name is determined by removing the directory component from
6592 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6593 library object suffix, \`.lo'."
6596 execute)
6597 $echo \
6598 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6600 Automatically set library path, then run a program.
6602 This mode accepts the following additional options:
6604 -dlopen FILE add the directory containing FILE to the library path
6606 This mode sets the library path environment variable according to \`-dlopen'
6607 flags.
6609 If any of the ARGS are libtool executable wrappers, then they are translated
6610 into their corresponding uninstalled binary, and any of their required library
6611 directories are added to the library path.
6613 Then, COMMAND is executed, with ARGS as arguments."
6616 finish)
6617 $echo \
6618 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6620 Complete the installation of libtool libraries.
6622 Each LIBDIR is a directory that contains libtool libraries.
6624 The commands that this mode executes may require superuser privileges. Use
6625 the \`--dry-run' option if you just want to see what would be executed."
6628 install)
6629 $echo \
6630 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6632 Install executables or libraries.
6634 INSTALL-COMMAND is the installation command. The first component should be
6635 either the \`install' or \`cp' program.
6637 The rest of the components are interpreted as arguments to that command (only
6638 BSD-compatible install options are recognized)."
6641 link)
6642 $echo \
6643 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6645 Link object files or libraries together to form another library, or to
6646 create an executable program.
6648 LINK-COMMAND is a command using the C compiler that you would use to create
6649 a program from several object files.
6651 The following components of LINK-COMMAND are treated specially:
6653 -all-static do not do any dynamic linking at all
6654 -avoid-version do not add a version suffix if possible
6655 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6656 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6657 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6658 -export-symbols SYMFILE
6659 try to export only the symbols listed in SYMFILE
6660 -export-symbols-regex REGEX
6661 try to export only the symbols matching REGEX
6662 -LLIBDIR search LIBDIR for required installed libraries
6663 -lNAME OUTPUT-FILE requires the installed library libNAME
6664 -module build a library that can dlopened
6665 -no-fast-install disable the fast-install mode
6666 -no-install link a not-installable executable
6667 -no-undefined declare that a library does not refer to external symbols
6668 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6669 -objectlist FILE Use a list of object files found in FILE to specify objects
6670 -precious-files-regex REGEX
6671 don't remove output files matching REGEX
6672 -release RELEASE specify package release information
6673 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6674 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6675 -static do not do any dynamic linking of libtool libraries
6676 -version-info CURRENT[:REVISION[:AGE]]
6677 specify library version info [each variable defaults to 0]
6679 All other options (arguments beginning with \`-') are ignored.
6681 Every other argument is treated as a filename. Files ending in \`.la' are
6682 treated as uninstalled libtool libraries, other files are standard or library
6683 object files.
6685 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6686 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6687 required, except when creating a convenience library.
6689 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6690 using \`ar' and \`ranlib', or on Windows using \`lib'.
6692 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6693 is created, otherwise an executable program is created."
6696 uninstall)
6697 $echo \
6698 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6700 Remove libraries from an installation directory.
6702 RM is the name of the program to use to delete files associated with each FILE
6703 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6704 to RM.
6706 If FILE is a libtool library, all the files associated with it are deleted.
6707 Otherwise, only FILE itself is deleted using RM."
6711 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6712 $echo "$help" 1>&2
6713 exit $EXIT_FAILURE
6715 esac
6717 $echo
6718 $echo "Try \`$modename --help' for more information about other modes."
6720 exit $EXIT_SUCCESS
6722 # The TAGs below are defined such that we never get into a situation
6723 # in which we disable both kinds of libraries. Given conflicting
6724 # choices, we go for a static library, that is the most portable,
6725 # since we can't tell whether shared libraries were disabled because
6726 # the user asked for that or because the platform doesn't support
6727 # them. This is particularly important on AIX, because we don't
6728 # support having both static and shared libraries enabled at the same
6729 # time on that platform, so we default to a shared-only configuration.
6730 # If a disable-shared tag is given, we'll fallback to a static-only
6731 # configuration. But we'll never go from static-only to shared-only.
6733 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6734 build_libtool_libs=no
6735 build_old_libs=yes
6736 # ### END LIBTOOL TAG CONFIG: disable-shared
6738 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6739 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6740 # ### END LIBTOOL TAG CONFIG: disable-static
6742 # Local Variables:
6743 # mode:shell-script
6744 # sh-indentation:2
6745 # End:
6746 # ### BEGIN LIBTOOL TAG CONFIG: CXX
6748 # Libtool was configured on host nik.neuroponic.com:
6750 # Shell to use when invoking shell scripts.
6751 SHELL="/bin/sh"
6753 # Whether or not to build shared libraries.
6754 build_libtool_libs=yes
6756 # Whether or not to build static libraries.
6757 build_old_libs=yes
6759 # Whether or not to add -lc for building shared libraries.
6760 build_libtool_need_lc=no
6762 # Whether or not to disallow shared libs when runtime libs are static
6763 allow_libtool_libs_with_static_runtimes=no
6765 # Whether or not to optimize for fast installation.
6766 fast_install=yes
6768 # The host system.
6769 host_alias=
6770 host=i686-pc-linux-gnu
6772 # An echo program that does not interpret backslashes.
6773 echo="echo"
6775 # The archiver.
6776 AR="ar"
6777 AR_FLAGS="cru"
6779 # A C compiler.
6780 LTCC="gcc"
6782 # A language-specific compiler.
6783 CC="g++"
6785 # Is the compiler the GNU C compiler?
6786 with_gcc=yes
6788 # An ERE matcher.
6789 EGREP="grep -E"
6791 # The linker used to build libraries.
6792 LD="/usr/i486-slackware-linux/bin/ld"
6794 # Whether we need hard or soft links.
6795 LN_S="ln -s"
6797 # A BSD-compatible nm program.
6798 NM="/usr/bin/nm -B"
6800 # A symbol stripping program
6801 STRIP="strip"
6803 # Used to examine libraries when file_magic_cmd begins "file"
6804 MAGIC_CMD=file
6806 # Used on cygwin: DLL creation program.
6807 DLLTOOL="dlltool"
6809 # Used on cygwin: object dumper.
6810 OBJDUMP="objdump"
6812 # Used on cygwin: assembler.
6813 AS="as"
6815 # The name of the directory that contains temporary libtool files.
6816 objdir=.libs
6818 # How to create reloadable object files.
6819 reload_flag=" -r"
6820 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6822 # How to pass a linker flag through the compiler.
6823 wl="-Wl,"
6825 # Object file suffix (normally "o").
6826 objext="o"
6828 # Old archive suffix (normally "a").
6829 libext="a"
6831 # Shared library suffix (normally ".so").
6832 shrext_cmds='.so'
6834 # Executable file suffix (normally "").
6835 exeext=""
6837 # Additional compiler flags for building library objects.
6838 pic_flag=" -fPIC -DPIC"
6839 pic_mode=default
6841 # What is the maximum length of a command?
6842 max_cmd_len=32768
6844 # Does compiler simultaneously support -c and -o options?
6845 compiler_c_o="yes"
6847 # Must we lock files when doing compilation ?
6848 need_locks="no"
6850 # Do we need the lib prefix for modules?
6851 need_lib_prefix=no
6853 # Do we need a version for libraries?
6854 need_version=no
6856 # Whether dlopen is supported.
6857 dlopen_support=unknown
6859 # Whether dlopen of programs is supported.
6860 dlopen_self=unknown
6862 # Whether dlopen of statically linked programs is supported.
6863 dlopen_self_static=unknown
6865 # Compiler flag to prevent dynamic linking.
6866 link_static_flag="-static"
6868 # Compiler flag to turn off builtin functions.
6869 no_builtin_flag=" -fno-builtin"
6871 # Compiler flag to allow reflexive dlopens.
6872 export_dynamic_flag_spec="\${wl}--export-dynamic"
6874 # Compiler flag to generate shared objects directly from archives.
6875 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
6877 # Compiler flag to generate thread-safe objects.
6878 thread_safe_flag_spec=""
6880 # Library versioning type.
6881 version_type=linux
6883 # Format of library name prefix.
6884 libname_spec="lib\$name"
6886 # List of archive names. First name is the real one, the rest are links.
6887 # The last name is the one that the linker finds with -lNAME.
6888 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
6890 # The coded name of the library, if different from the real name.
6891 soname_spec="\${libname}\${release}\${shared_ext}\$major"
6893 # Commands used to build and install an old-style archive.
6894 RANLIB="ranlib"
6895 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
6896 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
6897 old_postuninstall_cmds=""
6899 # Create an old-style archive from a shared archive.
6900 old_archive_from_new_cmds=""
6902 # Create a temporary old-style archive to link instead of a shared archive.
6903 old_archive_from_expsyms_cmds=""
6905 # Commands used to build and install a shared archive.
6906 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
6907 archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
6908 postinstall_cmds=""
6909 postuninstall_cmds=""
6911 # Commands used to build a loadable module (assumed same as above if empty)
6912 module_cmds=""
6913 module_expsym_cmds=""
6915 # Commands to strip libraries.
6916 old_striplib="strip --strip-debug"
6917 striplib="strip --strip-unneeded"
6919 # Dependencies to place before the objects being linked to create a
6920 # shared library.
6921 predep_objects="/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crti.o /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/crtbeginS.o"
6923 # Dependencies to place after the objects being linked to create a
6924 # shared library.
6925 postdep_objects="/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/crtendS.o /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crtn.o"
6927 # Dependencies to place before the objects being linked to create a
6928 # shared library.
6929 predeps=""
6931 # Dependencies to place after the objects being linked to create a
6932 # shared library.
6933 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
6935 # The library search path used internally by the compiler when linking
6936 # a shared library.
6937 compiler_lib_search_path="-L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4 -L/usr/lib/gcc/i486-slackware-linux/3.3.4 -L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib -L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../.."
6939 # Method to check whether dependent libraries are shared objects.
6940 deplibs_check_method="pass_all"
6942 # Command to use when deplibs_check_method == file_magic.
6943 file_magic_cmd="\$MAGIC_CMD"
6945 # Flag that allows shared libraries with undefined symbols to be built.
6946 allow_undefined_flag=""
6948 # Flag that forces no undefined symbols.
6949 no_undefined_flag=""
6951 # Commands used to finish a libtool library installation in a directory.
6952 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
6954 # Same as above, but a single script fragment to be evaled but not shown.
6955 finish_eval=""
6957 # Take the output of nm and produce a listing of raw symbols and C names.
6958 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
6960 # Transform the output of nm in a proper C declaration
6961 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
6963 # Transform the output of nm in a C name address pair
6964 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
6966 # This is the shared library runtime path variable.
6967 runpath_var=LD_RUN_PATH
6969 # This is the shared library path variable.
6970 shlibpath_var=LD_LIBRARY_PATH
6972 # Is shlibpath searched before the hard-coded library search path?
6973 shlibpath_overrides_runpath=no
6975 # How to hardcode a shared library path into an executable.
6976 hardcode_action=immediate
6978 # Whether we should hardcode library paths into libraries.
6979 hardcode_into_libs=yes
6981 # Flag to hardcode $libdir into a binary during linking.
6982 # This must work even if $libdir does not exist.
6983 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
6985 # If ld is used when linking, flag to hardcode $libdir into
6986 # a binary during linking. This must work even if $libdir does
6987 # not exist.
6988 hardcode_libdir_flag_spec_ld=""
6990 # Whether we need a single -rpath flag with a separated argument.
6991 hardcode_libdir_separator=""
6993 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
6994 # resulting binary.
6995 hardcode_direct=no
6997 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
6998 # resulting binary.
6999 hardcode_minus_L=no
7001 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7002 # the resulting binary.
7003 hardcode_shlibpath_var=
7005 # Set to yes if building a shared library automatically hardcodes DIR into the library
7006 # and all subsequent libraries and executables linked against it.
7007 hardcode_automatic=no
7009 # Variables whose values should be saved in libtool wrapper scripts and
7010 # restored at relink time.
7011 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7013 # Whether libtool must link a program against all its dependency libraries.
7014 link_all_deplibs=unknown
7016 # Compile-time system search path for libraries
7017 sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/ /usr/lib/gcc/i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib/i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../ /lib/i486-slackware-linux/3.3.4/ /lib/ /usr/lib/i486-slackware-linux/3.3.4/ /usr/lib/"
7019 # Run-time system search path for libraries
7020 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib /usr/lib /usr/X11R6/lib "
7022 # Fix the shell variable $srcfile for the compiler.
7023 fix_srcfile_path=""
7025 # Set to yes if exported symbols are required.
7026 always_export_symbols=no
7028 # The commands to list exported symbols.
7029 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7031 # The commands to extract the exported symbol list from a shared archive.
7032 extract_expsyms_cmds=""
7034 # Symbols that should not be listed in the preloaded symbols.
7035 exclude_expsyms=""
7037 # Symbols that must always be exported.
7038 include_expsyms=""
7040 # ### END LIBTOOL TAG CONFIG: CXX