Changed the names to match the PECL nomenclature
[phpCairo.git] / src / cairo / libtool
bloba5805a2f458a9e02b233ccbe67f50553992142bc
1 #! /bin/sh
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU )
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
32 # A sed program that does not truncate output.
33 SED="/bin/sed"
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/bin/sed -e 1s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
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=""
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host scorpion:
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=no
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=i686-pc-linux-gnu
69 host=i686-pc-linux-gnu
70 host_os=linux-gnu
72 # The build system.
73 build_alias=
74 build=i686-pc-linux-gnu
75 build_os=linux-gnu
77 # An echo program that does not interpret backslashes.
78 echo="echo"
80 # The archiver.
81 AR="ar"
82 AR_FLAGS="cru"
84 # A C compiler.
85 LTCC="gcc"
87 # A language-specific compiler.
88 CC="gcc"
90 # Is the compiler the GNU C compiler?
91 with_gcc=yes
93 # An ERE matcher.
94 EGREP="/bin/grep -E"
96 # The linker used to build libraries.
97 LD="/usr/i686-pc-linux-gnu/bin/ld"
99 # Whether we need hard or soft links.
100 LN_S="ln -s"
102 # A BSD-compatible nm program.
103 NM="/usr/bin/nm -B"
105 # A symbol stripping program
106 STRIP="strip"
108 # Used to examine libraries when file_magic_cmd begins "file"
109 MAGIC_CMD=file
111 # Used on cygwin: DLL creation program.
112 DLLTOOL="dlltool"
114 # Used on cygwin: object dumper.
115 OBJDUMP="objdump"
117 # Used on cygwin: assembler.
118 AS="as"
120 # The name of the directory that contains temporary libtool files.
121 objdir=.libs
123 # How to create reloadable object files.
124 reload_flag=" -r"
125 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
127 # How to pass a linker flag through the compiler.
128 wl="-Wl,"
130 # Object file suffix (normally "o").
131 objext="o"
133 # Old archive suffix (normally "a").
134 libext="a"
136 # Shared library suffix (normally ".so").
137 shrext_cmds='.so'
139 # Executable file suffix (normally "").
140 exeext=""
142 # Additional compiler flags for building library objects.
143 pic_flag=" -fPIC -DPIC"
144 pic_mode=default
146 # What is the maximum length of a command?
147 max_cmd_len=32768
149 # Does compiler simultaneously support -c and -o options?
150 compiler_c_o="yes"
152 # Must we lock files when doing compilation?
153 need_locks="no"
155 # Do we need the lib prefix for modules?
156 need_lib_prefix=no
158 # Do we need a version for libraries?
159 need_version=no
161 # Whether dlopen is supported.
162 dlopen_support=unknown
164 # Whether dlopen of programs is supported.
165 dlopen_self=unknown
167 # Whether dlopen of statically linked programs is supported.
168 dlopen_self_static=unknown
170 # Compiler flag to prevent dynamic linking.
171 link_static_flag="-static"
173 # Compiler flag to turn off builtin functions.
174 no_builtin_flag=" -fno-builtin"
176 # Compiler flag to allow reflexive dlopens.
177 export_dynamic_flag_spec="\${wl}--export-dynamic"
179 # Compiler flag to generate shared objects directly from archives.
180 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
182 # Compiler flag to generate thread-safe objects.
183 thread_safe_flag_spec=""
185 # Library versioning type.
186 version_type=linux
188 # Format of library name prefix.
189 libname_spec="lib\$name"
191 # List of archive names. First name is the real one, the rest are links.
192 # The last name is the one that the linker finds with -lNAME.
193 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
195 # The coded name of the library, if different from the real name.
196 soname_spec="\${libname}\${release}\${shared_ext}\$major"
198 # Commands used to build and install an old-style archive.
199 RANLIB="ranlib"
200 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
201 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
202 old_postuninstall_cmds=""
204 # Create an old-style archive from a shared archive.
205 old_archive_from_new_cmds=""
207 # Create a temporary old-style archive to link instead of a shared archive.
208 old_archive_from_expsyms_cmds=""
210 # Commands used to build and install a shared archive.
211 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
212 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
213 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
214 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
215 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
216 postinstall_cmds=""
217 postuninstall_cmds=""
219 # Commands used to build a loadable module (assumed same as above if empty)
220 module_cmds=""
221 module_expsym_cmds=""
223 # Commands to strip libraries.
224 old_striplib="strip --strip-debug"
225 striplib="strip --strip-unneeded"
227 # Dependencies to place before the objects being linked to create a
228 # shared library.
229 predep_objects=""
231 # Dependencies to place after the objects being linked to create a
232 # shared library.
233 postdep_objects=""
235 # Dependencies to place before the objects being linked to create a
236 # shared library.
237 predeps=""
239 # Dependencies to place after the objects being linked to create a
240 # shared library.
241 postdeps=""
243 # The library search path used internally by the compiler when linking
244 # a shared library.
245 compiler_lib_search_path=""
247 # Method to check whether dependent libraries are shared objects.
248 deplibs_check_method="pass_all"
250 # Command to use when deplibs_check_method == file_magic.
251 file_magic_cmd="\$MAGIC_CMD"
253 # Flag that allows shared libraries with undefined symbols to be built.
254 allow_undefined_flag=""
256 # Flag that forces no undefined symbols.
257 no_undefined_flag=""
259 # Commands used to finish a libtool library installation in a directory.
260 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
262 # Same as above, but a single script fragment to be evaled but not shown.
263 finish_eval=""
265 # Take the output of nm and produce a listing of raw symbols and C names.
266 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
268 # Transform the output of nm in a proper C declaration
269 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
271 # Transform the output of nm in a C name address pair
272 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
274 # This is the shared library runtime path variable.
275 runpath_var=LD_RUN_PATH
277 # This is the shared library path variable.
278 shlibpath_var=LD_LIBRARY_PATH
280 # Is shlibpath searched before the hard-coded library search path?
281 shlibpath_overrides_runpath=no
283 # How to hardcode a shared library path into an executable.
284 hardcode_action=immediate
286 # Whether we should hardcode library paths into libraries.
287 hardcode_into_libs=yes
289 # Flag to hardcode $libdir into a binary during linking.
290 # This must work even if $libdir does not exist.
291 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
293 # If ld is used when linking, flag to hardcode $libdir into
294 # a binary during linking. This must work even if $libdir does
295 # not exist.
296 hardcode_libdir_flag_spec_ld=""
298 # Whether we need a single -rpath flag with a separated argument.
299 hardcode_libdir_separator=""
301 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
302 # resulting binary.
303 hardcode_direct=no
305 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
306 # resulting binary.
307 hardcode_minus_L=no
309 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
310 # the resulting binary.
311 hardcode_shlibpath_var=unsupported
313 # Set to yes if building a shared library automatically hardcodes DIR into the library
314 # and all subsequent libraries and executables linked against it.
315 hardcode_automatic=no
317 # Variables whose values should be saved in libtool wrapper scripts and
318 # restored at relink time.
319 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
321 # Whether libtool must link a program against all its dependency libraries.
322 link_all_deplibs=unknown
324 # Compile-time system search path for libraries
325 sys_lib_search_path_spec=" /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/lib/i686-pc-linux-gnu/3.4.6/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/lib/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../i686-pc-linux-gnu/3.4.6/ /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../ /lib/i686-pc-linux-gnu/3.4.6/ /lib/ /usr/lib/i686-pc-linux-gnu/3.4.6/ /usr/lib/"
327 # Run-time system search path for libraries
328 sys_lib_dlsearch_path_spec="/lib /usr/lib # ld.so.conf autogenerated by env-update; make all changes to # contents of /etc/env.d directory /usr/local/lib //usr//lib/opengl/xorg-x11/lib /usr/i686-pc-linux-gnu/lib /usr/lib/gcc/i686-pc-linux-gnu/3.4.6 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6 /usr/lib/gcc/i686-pc-linux-gnu/4.1.1 /usr/lib/nspr /usr/lib/nss /usr/lib/qt4 /usr/kde/3.5/lib /usr/qt/3/lib "
330 # Fix the shell variable $srcfile for the compiler.
331 fix_srcfile_path=""
333 # Set to yes if exported symbols are required.
334 always_export_symbols=no
336 # The commands to list exported symbols.
337 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
339 # The commands to extract the exported symbol list from a shared archive.
340 extract_expsyms_cmds=""
342 # Symbols that should not be listed in the preloaded symbols.
343 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
345 # Symbols that must always be exported.
346 include_expsyms=""
348 # ### END LIBTOOL CONFIG
350 # ltmain.sh - Provide generalized library-building support services.
351 # NOTE: Changing this file will not affect anything until you rerun configure.
353 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
354 # Free Software Foundation, Inc.
355 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
357 # This program is free software; you can redistribute it and/or modify
358 # it under the terms of the GNU General Public License as published by
359 # the Free Software Foundation; either version 2 of the License, or
360 # (at your option) any later version.
362 # This program is distributed in the hope that it will be useful, but
363 # WITHOUT ANY WARRANTY; without even the implied warranty of
364 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
365 # General Public License for more details.
367 # You should have received a copy of the GNU General Public License
368 # along with this program; if not, write to the Free Software
369 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
371 # As a special exception to the GNU General Public License, if you
372 # distribute this file as part of a program that contains a
373 # configuration script generated by Autoconf, you may include it under
374 # the same distribution terms that you use for the rest of that program.
376 basename="s,^.*/,,g"
378 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
379 # is ksh but when the shell is invoked as "sh" and the current value of
380 # the _XPG environment variable is not equal to 1 (one), the special
381 # positional parameter $0, within a function call, is the name of the
382 # function.
383 progpath="$0"
385 # define SED for historic ltconfig's generated by Libtool 1.3
386 test -z "$SED" && SED=sed
388 # The name of this program:
389 progname=`echo "$progpath" | $SED $basename`
390 modename="$progname"
392 # Global variables:
393 EXIT_SUCCESS=0
394 EXIT_FAILURE=1
396 PROGRAM=ltmain.sh
397 PACKAGE=libtool
398 VERSION=1.5.22
399 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
401 # See if we are running on zsh, and set the options which allow our
402 # commands through without removal of \ escapes.
403 if test -n "${ZSH_VERSION+set}" ; then
404 setopt NO_GLOB_SUBST
406 # Same for EGREP, and just to be sure, do LTCC as well
407 if test "X$EGREP" = X ; then
408 EGREP=egrep
410 if test "X$LTCC" = X ; then
411 LTCC=${CC-gcc}
413 # Same for EGREP, and just to be sure, do LTCC as well
414 if test "x$EGREP" = x ; then
415 EGREP=egrep
417 if test "x$LTCC" = x ; then
418 LTCC=${CC-gcc}
421 # Check that we have a working $echo.
422 if test "X$1" = X--no-reexec; then
423 # Discard the --no-reexec flag, and continue.
424 shift
425 elif test "X$1" = X--fallback-echo; then
426 # Avoid inline document here, it may be left over
428 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
429 # Yippee, $echo works!
431 else
432 # Restart under the correct shell, and then maybe $echo will work.
433 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
436 if test "X$1" = X--fallback-echo; then
437 # used as fallback echo
438 shift
439 cat <<EOF
442 exit $EXIT_SUCCESS
445 default_mode=
446 help="Try \`$progname --help' for more information."
447 magic="%%%MAGIC variable%%%"
448 mkdir="mkdir"
449 mv="mv -f"
450 rm="rm -f"
452 # Sed substitution that helps us do robust quoting. It backslashifies
453 # metacharacters that are still active within double-quoted strings.
454 Xsed="${SED}"' -e 1s/^X//'
455 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
456 # test EBCDIC or ASCII
457 case `echo X|tr X '\101'` in
458 A) # ASCII based system
459 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
460 SP2NL='tr \040 \012'
461 NL2SP='tr \015\012 \040\040'
463 *) # EBCDIC based system
464 SP2NL='tr \100 \n'
465 NL2SP='tr \r\n \100\100'
467 esac
469 # NLS nuisances.
470 # Only set LANG and LC_ALL to C if already set.
471 # These must not be set unconditionally because not all systems understand
472 # e.g. LANG=C (notably SCO).
473 # We save the old values to restore during execute mode.
474 if test "${LC_ALL+set}" = set; then
475 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
477 if test "${LANG+set}" = set; then
478 save_LANG="$LANG"; LANG=C; export LANG
481 # Make sure IFS has a sensible default
482 lt_nl='
484 IFS=" $lt_nl"
486 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
487 $echo "$modename: not configured to build any kind of library" 1>&2
488 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
489 exit $EXIT_FAILURE
492 # Global variables.
493 mode=$default_mode
494 nonopt=
495 prev=
496 prevopt=
497 run=
498 show="$echo"
499 show_help=
500 execute_dlfiles=
501 duplicate_deps=no
502 preserve_args=
503 lo2o="s/\\.lo\$/.${objext}/"
504 o2lo="s/\\.${objext}\$/.lo/"
506 if test -z "$max_cmd_len"; then
508 testring="ABCD"
509 new_result=
511 # If test is not a shell built-in, we'll probably end up computing a
512 # maximum length that is only half of the actual maximum length, but
513 # we can't tell.
514 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
515 = "XX$testring") >/dev/null 2>&1 &&
516 new_result=`expr "X$testring" : ".*" 2>&1` &&
517 max_cmd_len="$new_result" &&
518 test $i != 17 # 1/2 MB should be enough
520 i=`expr $i + 1`
521 testring="$testring$testring"
522 done
523 testring=
524 # Add a significant safety factor because C++ compilers can tack on massive
525 # amounts of additional arguments before passing them to the linker.
526 # It appears as though 1/2 is a usable value.
527 max_cmd_len=`expr $max_cmd_len \/ 2`
530 if test -z "$max_cmd_len"; then
532 testring="ABCD"
533 new_result=
535 # If test is not a shell built-in, we'll probably end up computing a
536 # maximum length that is only half of the actual maximum length, but
537 # we can't tell.
538 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
539 = "XX$testring") >/dev/null 2>&1 &&
540 new_result=`expr "X$testring" : ".*" 2>&1` &&
541 max_cmd_len="$new_result" &&
542 test "$i" != 17 # 1/2 MB should be enough
544 i=`expr $i + 1`
545 testring="$testring$testring"
546 done
547 testring=
548 # Add a significant safety factor because C++ compilers can tack on massive
549 # amounts of additional arguments before passing them to the linker.
550 # It appears as though 1/2 is a usable value.
551 max_cmd_len=`expr $max_cmd_len \/ 2`
554 #####################################
555 # Shell function definitions:
556 # This seems to be the best place for them
558 # func_mktempdir [string]
559 # Make a temporary directory that won't clash with other running
560 # libtool processes, and avoids race conditions if possible. If
561 # given, STRING is the basename for that directory.
562 func_mktempdir ()
564 my_template="${TMPDIR-/tmp}/${1-$progname}"
566 if test "$run" = ":"; then
567 # Return a directory name, but don't create it in dry-run mode
568 my_tmpdir="${my_template}-$$"
569 else
571 # If mktemp works, use that first and foremost
572 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
574 if test ! -d "$my_tmpdir"; then
575 # Failing that, at least try and use $RANDOM to avoid a race
576 my_tmpdir="${my_template}-${RANDOM-0}$$"
578 save_mktempdir_umask=`umask`
579 umask 0077
580 $mkdir "$my_tmpdir"
581 umask $save_mktempdir_umask
584 # If we're not in dry-run mode, bomb out on failure
585 test -d "$my_tmpdir" || {
586 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
587 exit $EXIT_FAILURE
591 $echo "X$my_tmpdir" | $Xsed
595 # func_win32_libid arg
596 # return the library type of file 'arg'
598 # Need a lot of goo to handle *both* DLLs and import libs
599 # Has to be a shell function in order to 'eat' the argument
600 # that is supplied when $file_magic_command is called.
601 func_win32_libid ()
603 win32_libid_type="unknown"
604 win32_fileres=`file -L $1 2>/dev/null`
605 case $win32_fileres in
606 *ar\ archive\ import\ library*) # definitely import
607 win32_libid_type="x86 archive import"
609 *ar\ archive*) # could be an import, or static
610 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
611 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
612 win32_nmres=`eval $NM -f posix -A $1 | \
613 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
614 case $win32_nmres in
615 import*) win32_libid_type="x86 archive import";;
616 *) win32_libid_type="x86 archive static";;
617 esac
620 *DLL*)
621 win32_libid_type="x86 DLL"
623 *executable*) # but shell scripts are "executable" too...
624 case $win32_fileres in
625 *MS\ Windows\ PE\ Intel*)
626 win32_libid_type="x86 DLL"
628 esac
630 esac
631 $echo $win32_libid_type
635 # func_infer_tag arg
636 # Infer tagged configuration to use if any are available and
637 # if one wasn't chosen via the "--tag" command line option.
638 # Only attempt this if the compiler in the base compile
639 # command doesn't match the default compiler.
640 # arg is usually of the form 'gcc ...'
641 func_infer_tag ()
643 if test -n "$available_tags" && test -z "$tagname"; then
644 CC_quoted=
645 for arg in $CC; do
646 case $arg in
647 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
648 arg="\"$arg\""
650 esac
651 CC_quoted="$CC_quoted $arg"
652 done
653 case $@ in
654 # Blanks in the command may have been stripped by the calling shell,
655 # but not from the CC environment variable when configure was run.
656 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
657 # Blanks at the start of $base_compile will cause this to fail
658 # if we don't check for them as well.
660 for z in $available_tags; do
661 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
662 # Evaluate the configuration.
663 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
664 CC_quoted=
665 for arg in $CC; do
666 # Double-quote args containing other shell metacharacters.
667 case $arg in
668 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
669 arg="\"$arg\""
671 esac
672 CC_quoted="$CC_quoted $arg"
673 done
674 # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
675 trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
676 # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
677 extendcc=${host}-${CC}
678 # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
679 # (Gentoo-specific hack because we always export $CHOST)
680 mungedcc=${CHOST-${host}}-${trimedcc}
681 case "$@ " in
682 "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
683 "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
684 tagname=CC
685 break ;;
686 "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
687 "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
688 "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
689 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
690 # The compiler in the base compile command matches
691 # the one in the tagged configuration.
692 # Assume this is the tagged configuration we want.
693 tagname=$z
694 break
696 esac
698 done
699 # If $tagname still isn't set, then no tagged configuration
700 # was found and let the user know that the "--tag" command
701 # line option must be used.
702 if test -z "$tagname"; then
703 $echo "$modename: unable to infer tagged configuration"
704 $echo "$modename: specify a tag with \`--tag'" 1>&2
705 exit $EXIT_FAILURE
706 # else
707 # $echo "$modename: using $tagname tagged configuration"
710 esac
715 # func_extract_an_archive dir oldlib
716 func_extract_an_archive ()
718 f_ex_an_ar_dir="$1"; shift
719 f_ex_an_ar_oldlib="$1"
721 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
722 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
723 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
725 else
726 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
727 exit $EXIT_FAILURE
731 # func_extract_archives gentop oldlib ...
732 func_extract_archives ()
734 my_gentop="$1"; shift
735 my_oldlibs=${1+"$@"}
736 my_oldobjs=""
737 my_xlib=""
738 my_xabs=""
739 my_xdir=""
740 my_status=""
742 $show "${rm}r $my_gentop"
743 $run ${rm}r "$my_gentop"
744 $show "$mkdir $my_gentop"
745 $run $mkdir "$my_gentop"
746 my_status=$?
747 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
748 exit $my_status
751 for my_xlib in $my_oldlibs; do
752 # Extract the objects.
753 case $my_xlib in
754 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
755 *) my_xabs=`pwd`"/$my_xlib" ;;
756 esac
757 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
758 my_xdir="$my_gentop/$my_xlib"
760 $show "${rm}r $my_xdir"
761 $run ${rm}r "$my_xdir"
762 $show "$mkdir $my_xdir"
763 $run $mkdir "$my_xdir"
764 exit_status=$?
765 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
766 exit $exit_status
768 case $host in
769 *-darwin*)
770 $show "Extracting $my_xabs"
771 # Do not bother doing anything if just a dry run
772 if test -z "$run"; then
773 darwin_orig_dir=`pwd`
774 cd $my_xdir || exit $?
775 darwin_archive=$my_xabs
776 darwin_curdir=`pwd`
777 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
778 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
779 if test -n "$darwin_arches"; then
780 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
781 darwin_arch=
782 $show "$darwin_base_archive has multiple architectures $darwin_arches"
783 for darwin_arch in $darwin_arches ; do
784 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
785 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
786 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
787 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
788 cd "$darwin_curdir"
789 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
790 done # $darwin_arches
791 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
792 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
793 darwin_file=
794 darwin_files=
795 for darwin_file in $darwin_filelist; do
796 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
797 lipo -create -output "$darwin_file" $darwin_files
798 done # $darwin_filelist
799 ${rm}r unfat-$$
800 cd "$darwin_orig_dir"
801 else
802 cd "$darwin_orig_dir"
803 func_extract_an_archive "$my_xdir" "$my_xabs"
804 fi # $darwin_arches
805 fi # $run
808 func_extract_an_archive "$my_xdir" "$my_xabs"
810 esac
811 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
812 done
813 func_extract_archives_result="$my_oldobjs"
815 # End of Shell function definitions
816 #####################################
818 # Darwin sucks
819 eval std_shrext=\"$shrext_cmds\"
821 disable_libs=no
823 # Parse our command line options once, thoroughly.
824 while test "$#" -gt 0
826 arg="$1"
827 shift
829 case $arg in
830 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
831 *) optarg= ;;
832 esac
834 # If the previous option needs an argument, assign it.
835 if test -n "$prev"; then
836 case $prev in
837 execute_dlfiles)
838 execute_dlfiles="$execute_dlfiles $arg"
840 tag)
841 tagname="$arg"
842 preserve_args="${preserve_args}=$arg"
844 # Check whether tagname contains only valid characters
845 case $tagname in
846 *[!-_A-Za-z0-9,/]*)
847 $echo "$progname: invalid tag name: $tagname" 1>&2
848 exit $EXIT_FAILURE
850 esac
852 case $tagname in
854 # Don't test for the "default" C tag, as we know, it's there, but
855 # not specially marked.
858 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
859 taglist="$taglist $tagname"
860 # Evaluate the configuration.
861 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
862 else
863 $echo "$progname: ignoring unknown tag $tagname" 1>&2
866 esac
869 eval "$prev=\$arg"
871 esac
873 prev=
874 prevopt=
875 continue
878 # Have we seen a non-optional argument yet?
879 case $arg in
880 --help)
881 show_help=yes
884 --version)
885 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
886 $echo
887 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
888 $echo "This is free software; see the source for copying conditions. There is NO"
889 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
890 exit $?
893 --config)
894 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
895 # Now print the configurations for the tags.
896 for tagname in $taglist; do
897 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
898 done
899 exit $?
902 --debug)
903 $echo "$progname: enabling shell trace mode"
904 set -x
905 preserve_args="$preserve_args $arg"
908 --dry-run | -n)
909 run=:
912 --features)
913 $echo "host: $host"
914 if test "$build_libtool_libs" = yes; then
915 $echo "enable shared libraries"
916 else
917 $echo "disable shared libraries"
919 if test "$build_old_libs" = yes; then
920 $echo "enable static libraries"
921 else
922 $echo "disable static libraries"
924 exit $?
927 --finish) mode="finish" ;;
929 --mode) prevopt="--mode" prev=mode ;;
930 --mode=*) mode="$optarg" ;;
932 --preserve-dup-deps) duplicate_deps="yes" ;;
934 --quiet | --silent)
935 show=:
936 preserve_args="$preserve_args $arg"
939 --tag)
940 prevopt="--tag"
941 prev=tag
942 preserve_args="$preserve_args --tag"
944 --tag=*)
945 set tag "$optarg" ${1+"$@"}
946 shift
947 prev=tag
948 preserve_args="$preserve_args --tag"
951 -dlopen)
952 prevopt="-dlopen"
953 prev=execute_dlfiles
957 $echo "$modename: unrecognized option \`$arg'" 1>&2
958 $echo "$help" 1>&2
959 exit $EXIT_FAILURE
963 nonopt="$arg"
964 break
966 esac
967 done
969 if test -n "$prevopt"; then
970 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
971 $echo "$help" 1>&2
972 exit $EXIT_FAILURE
975 case $disable_libs in
976 no)
978 shared)
979 build_libtool_libs=no
980 build_old_libs=yes
982 static)
983 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
985 esac
987 # If this variable is set in any of the actions, the command in it
988 # will be execed at the end. This prevents here-documents from being
989 # left over by shells.
990 exec_cmd=
992 if test -z "$show_help"; then
994 # Infer the operation mode.
995 if test -z "$mode"; then
996 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
997 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
998 case $nonopt in
999 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
1000 mode=link
1001 for arg
1003 case $arg in
1005 mode=compile
1006 break
1008 esac
1009 done
1011 *db | *dbx | *strace | *truss)
1012 mode=execute
1014 *install*|cp|mv)
1015 mode=install
1017 *rm)
1018 mode=uninstall
1021 # If we have no mode, but dlfiles were specified, then do execute mode.
1022 test -n "$execute_dlfiles" && mode=execute
1024 # Just use the default operation mode.
1025 if test -z "$mode"; then
1026 if test -n "$nonopt"; then
1027 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
1028 else
1029 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
1033 esac
1036 # Only execute mode is allowed to have -dlopen flags.
1037 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1038 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1039 $echo "$help" 1>&2
1040 exit $EXIT_FAILURE
1043 # Change the help message to a mode-specific one.
1044 generic_help="$help"
1045 help="Try \`$modename --help --mode=$mode' for more information."
1047 # These modes are in order of execution frequency so that they run quickly.
1048 case $mode in
1049 # libtool compile mode
1050 compile)
1051 modename="$modename: compile"
1052 # Get the compilation command and the source file.
1053 base_compile=
1054 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1055 suppress_opt=yes
1056 suppress_output=
1057 arg_mode=normal
1058 libobj=
1059 later=
1061 for arg
1063 case $arg_mode in
1064 arg )
1065 # do not "continue". Instead, add this to base_compile
1066 lastarg="$arg"
1067 arg_mode=normal
1070 target )
1071 libobj="$arg"
1072 arg_mode=normal
1073 continue
1076 normal )
1077 # Accept any command-line options.
1078 case $arg in
1080 if test -n "$libobj" ; then
1081 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1082 exit $EXIT_FAILURE
1084 arg_mode=target
1085 continue
1088 -static | -prefer-pic | -prefer-non-pic)
1089 later="$later $arg"
1090 continue
1093 -no-suppress)
1094 suppress_opt=no
1095 continue
1098 -Xcompiler)
1099 arg_mode=arg # the next one goes into the "base_compile" arg list
1100 continue # The current "srcfile" will either be retained or
1101 ;; # replaced later. I would guess that would be a bug.
1103 -Wc,*)
1104 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1105 lastarg=
1106 save_ifs="$IFS"; IFS=','
1107 for arg in $args; do
1108 IFS="$save_ifs"
1110 # Double-quote args containing other shell metacharacters.
1111 # Many Bourne shells cannot handle close brackets correctly
1112 # in scan sets, so we specify it separately.
1113 case $arg in
1114 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1115 arg="\"$arg\""
1117 esac
1118 lastarg="$lastarg $arg"
1119 done
1120 IFS="$save_ifs"
1121 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1123 # Add the arguments to base_compile.
1124 base_compile="$base_compile $lastarg"
1125 continue
1129 # Accept the current argument as the source file.
1130 # The previous "srcfile" becomes the current argument.
1132 lastarg="$srcfile"
1133 srcfile="$arg"
1135 esac # case $arg
1137 esac # case $arg_mode
1139 # Aesthetically quote the previous argument.
1140 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1142 case $lastarg in
1143 # Double-quote args containing other shell metacharacters.
1144 # Many Bourne shells cannot handle close brackets correctly
1145 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1146 # in scan sets (worked around with variable expansion),
1147 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1148 # at all, so we specify them separately.
1149 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1150 lastarg="\"$lastarg\""
1152 esac
1154 base_compile="$base_compile $lastarg"
1155 done # for arg
1157 case $arg_mode in
1158 arg)
1159 $echo "$modename: you must specify an argument for -Xcompile"
1160 exit $EXIT_FAILURE
1162 target)
1163 $echo "$modename: you must specify a target with \`-o'" 1>&2
1164 exit $EXIT_FAILURE
1167 # Get the name of the library object.
1168 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1170 esac
1172 # Recognize several different file suffixes.
1173 # If the user specifies -o file.o, it is replaced with file.lo
1174 xform='[cCFSifmso]'
1175 case $libobj in
1176 *.ada) xform=ada ;;
1177 *.adb) xform=adb ;;
1178 *.ads) xform=ads ;;
1179 *.asm) xform=asm ;;
1180 *.c++) xform=c++ ;;
1181 *.cc) xform=cc ;;
1182 *.ii) xform=ii ;;
1183 *.class) xform=class ;;
1184 *.cpp) xform=cpp ;;
1185 *.cxx) xform=cxx ;;
1186 *.f90) xform=f90 ;;
1187 *.for) xform=for ;;
1188 *.java) xform=java ;;
1189 esac
1191 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1193 case $libobj in
1194 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1196 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1197 exit $EXIT_FAILURE
1199 esac
1201 func_infer_tag $base_compile
1203 for arg in $later; do
1204 case $arg in
1205 -static)
1206 build_old_libs=yes
1207 continue
1210 -prefer-pic)
1211 pic_mode=yes
1212 continue
1215 -prefer-non-pic)
1216 pic_mode=no
1217 continue
1219 esac
1220 done
1222 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1223 case $qlibobj in
1224 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1225 qlibobj="\"$qlibobj\"" ;;
1226 esac
1227 test "X$libobj" != "X$qlibobj" \
1228 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1229 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1230 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1231 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1232 if test "X$xdir" = "X$obj"; then
1233 xdir=
1234 else
1235 xdir=$xdir/
1237 lobj=${xdir}$objdir/$objname
1239 if test -z "$base_compile"; then
1240 $echo "$modename: you must specify a compilation command" 1>&2
1241 $echo "$help" 1>&2
1242 exit $EXIT_FAILURE
1245 # Delete any leftover library objects.
1246 if test "$build_old_libs" = yes; then
1247 removelist="$obj $lobj $libobj ${libobj}T"
1248 else
1249 removelist="$lobj $libobj ${libobj}T"
1252 $run $rm $removelist
1253 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1255 # On Cygwin there's no "real" PIC flag so we must build both object types
1256 case $host_os in
1257 cygwin* | mingw* | pw32* | os2*)
1258 pic_mode=default
1260 esac
1261 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1262 # non-PIC code in shared libraries is not supported
1263 pic_mode=default
1266 # Calculate the filename of the output object if compiler does
1267 # not support -o with -c
1268 if test "$compiler_c_o" = no; then
1269 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1270 lockfile="$output_obj.lock"
1271 removelist="$removelist $output_obj $lockfile"
1272 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1273 else
1274 output_obj=
1275 need_locks=no
1276 lockfile=
1279 # Lock this critical section if it is needed
1280 # We use this script file to make the link, it avoids creating a new file
1281 if test "$need_locks" = yes; then
1282 until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
1283 $show "Waiting for $lockfile to be removed"
1284 sleep 2
1285 done
1286 elif test "$need_locks" = warn; then
1287 if test -f "$lockfile"; then
1288 $echo "\
1289 *** ERROR, $lockfile exists and contains:
1290 `cat $lockfile 2>/dev/null`
1292 This indicates that another process is trying to use the same
1293 temporary object file, and libtool could not work around it because
1294 your compiler does not support \`-c' and \`-o' together. If you
1295 repeat this compilation, it may succeed, by chance, but you had better
1296 avoid parallel builds (make -j) in this platform, or get a better
1297 compiler."
1299 $run $rm $removelist
1300 exit $EXIT_FAILURE
1302 $echo "$srcfile" > "$lockfile"
1305 if test -n "$fix_srcfile_path"; then
1306 eval srcfile=\"$fix_srcfile_path\"
1308 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1309 case $qsrcfile in
1310 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1311 qsrcfile="\"$qsrcfile\"" ;;
1312 esac
1314 $run $rm "$libobj" "${libobj}T"
1316 # Create a libtool object file (analogous to a ".la" file),
1317 # but don't create it if we're doing a dry run.
1318 test -z "$run" && cat > ${libobj}T <<EOF
1319 # $libobj - a libtool object file
1320 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1322 # Please DO NOT delete this file!
1323 # It is necessary for linking the library.
1325 # Name of the PIC object.
1328 # Only build a PIC object if we are building libtool libraries.
1329 if test "$build_libtool_libs" = yes; then
1330 # Without this assignment, base_compile gets emptied.
1331 fbsd_hideous_sh_bug=$base_compile
1333 if test "$pic_mode" != no; then
1334 command="$base_compile $qsrcfile $pic_flag"
1335 else
1336 # Don't build PIC code
1337 command="$base_compile $qsrcfile"
1340 if test ! -d "${xdir}$objdir"; then
1341 $show "$mkdir ${xdir}$objdir"
1342 $run $mkdir ${xdir}$objdir
1343 exit_status=$?
1344 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1345 exit $exit_status
1349 if test -z "$output_obj"; then
1350 # Place PIC objects in $objdir
1351 command="$command -o $lobj"
1354 $run $rm "$lobj" "$output_obj"
1356 $show "$command"
1357 if $run eval "$command"; then :
1358 else
1359 test -n "$output_obj" && $run $rm $removelist
1360 exit $EXIT_FAILURE
1363 if test "$need_locks" = warn &&
1364 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1365 $echo "\
1366 *** ERROR, $lockfile contains:
1367 `cat $lockfile 2>/dev/null`
1369 but it should contain:
1370 $srcfile
1372 This indicates that another process is trying to use the same
1373 temporary object file, and libtool could not work around it because
1374 your compiler does not support \`-c' and \`-o' together. If you
1375 repeat this compilation, it may succeed, by chance, but you had better
1376 avoid parallel builds (make -j) in this platform, or get a better
1377 compiler."
1379 $run $rm $removelist
1380 exit $EXIT_FAILURE
1383 # Just move the object if needed, then go on to compile the next one
1384 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1385 $show "$mv $output_obj $lobj"
1386 if $run $mv $output_obj $lobj; then :
1387 else
1388 error=$?
1389 $run $rm $removelist
1390 exit $error
1394 # Append the name of the PIC object to the libtool object file.
1395 test -z "$run" && cat >> ${libobj}T <<EOF
1396 pic_object='$objdir/$objname'
1400 # Allow error messages only from the first compilation.
1401 if test "$suppress_opt" = yes; then
1402 suppress_output=' >/dev/null 2>&1'
1404 else
1405 # No PIC object so indicate it doesn't exist in the libtool
1406 # object file.
1407 test -z "$run" && cat >> ${libobj}T <<EOF
1408 pic_object=none
1413 # Only build a position-dependent object if we build old libraries.
1414 if test "$build_old_libs" = yes; then
1415 if test "$pic_mode" != yes; then
1416 # Don't build PIC code
1417 command="$base_compile $qsrcfile"
1418 else
1419 command="$base_compile $qsrcfile $pic_flag"
1421 if test "$compiler_c_o" = yes; then
1422 command="$command -o $obj"
1425 # Suppress compiler output if we already did a PIC compilation.
1426 command="$command$suppress_output"
1427 $run $rm "$obj" "$output_obj"
1428 $show "$command"
1429 if $run eval "$command"; then :
1430 else
1431 $run $rm $removelist
1432 exit $EXIT_FAILURE
1435 if test "$need_locks" = warn &&
1436 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1437 $echo "\
1438 *** ERROR, $lockfile contains:
1439 `cat $lockfile 2>/dev/null`
1441 but it should contain:
1442 $srcfile
1444 This indicates that another process is trying to use the same
1445 temporary object file, and libtool could not work around it because
1446 your compiler does not support \`-c' and \`-o' together. If you
1447 repeat this compilation, it may succeed, by chance, but you had better
1448 avoid parallel builds (make -j) in this platform, or get a better
1449 compiler."
1451 $run $rm $removelist
1452 exit $EXIT_FAILURE
1455 # Just move the object if needed
1456 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1457 $show "$mv $output_obj $obj"
1458 if $run $mv $output_obj $obj; then :
1459 else
1460 error=$?
1461 $run $rm $removelist
1462 exit $error
1466 # Append the name of the non-PIC object the libtool object file.
1467 # Only append if the libtool object file exists.
1468 test -z "$run" && cat >> ${libobj}T <<EOF
1469 # Name of the non-PIC object.
1470 non_pic_object='$objname'
1473 else
1474 # Append the name of the non-PIC object the libtool object file.
1475 # Only append if the libtool object file exists.
1476 test -z "$run" && cat >> ${libobj}T <<EOF
1477 # Name of the non-PIC object.
1478 non_pic_object=none
1483 $run $mv "${libobj}T" "${libobj}"
1485 # Unlock the critical section if it was locked
1486 if test "$need_locks" != no; then
1487 $run $rm "$lockfile"
1490 exit $EXIT_SUCCESS
1493 # libtool link mode
1494 link | relink)
1495 modename="$modename: link"
1496 case $host in
1497 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1498 # It is impossible to link a dll without this setting, and
1499 # we shouldn't force the makefile maintainer to figure out
1500 # which system we are compiling for in order to pass an extra
1501 # flag for every libtool invocation.
1502 # allow_undefined=no
1504 # FIXME: Unfortunately, there are problems with the above when trying
1505 # to make a dll which has undefined symbols, in which case not
1506 # even a static library is built. For now, we need to specify
1507 # -no-undefined on the libtool link line when we can be certain
1508 # that all symbols are satisfied, otherwise we get a static library.
1509 allow_undefined=yes
1512 allow_undefined=yes
1514 esac
1515 libtool_args="$nonopt"
1516 base_compile="$nonopt $@"
1517 compile_command="$nonopt"
1518 finalize_command="$nonopt"
1520 compile_rpath=
1521 finalize_rpath=
1522 compile_shlibpath=
1523 finalize_shlibpath=
1524 convenience=
1525 old_convenience=
1526 deplibs=
1527 old_deplibs=
1528 compiler_flags=
1529 linker_flags=
1530 dllsearchpath=
1531 lib_search_path=`pwd`
1532 inst_prefix_dir=
1534 avoid_version=no
1535 dlfiles=
1536 dlprefiles=
1537 dlself=no
1538 export_dynamic=no
1539 export_symbols=
1540 export_symbols_regex=
1541 generated=
1542 libobjs=
1543 ltlibs=
1544 module=no
1545 no_install=no
1546 objs=
1547 non_pic_objects=
1548 notinst_path= # paths that contain not-installed libtool libraries
1549 precious_files_regex=
1550 prefer_static_libs=no
1551 preload=no
1552 prev=
1553 prevarg=
1554 release=
1555 rpath=
1556 xrpath=
1557 perm_rpath=
1558 temp_rpath=
1559 thread_safe=no
1560 vinfo=
1561 vinfo_number=no
1563 func_infer_tag $base_compile
1565 # We need to know -static, to get the right output filenames.
1566 for arg
1568 case $arg in
1569 -all-static | -static)
1570 if test "X$arg" = "X-all-static"; then
1571 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1572 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1574 if test -n "$link_static_flag"; then
1575 dlopen_self=$dlopen_self_static
1577 prefer_static_libs=yes
1578 else
1579 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1580 dlopen_self=$dlopen_self_static
1582 prefer_static_libs=built
1584 build_libtool_libs=no
1585 build_old_libs=yes
1586 break
1588 esac
1589 done
1591 # See if our shared archives depend on static archives.
1592 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1594 # Go through the arguments, transforming them on the way.
1595 while test "$#" -gt 0; do
1596 arg="$1"
1597 shift
1598 case $arg in
1599 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1600 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1602 *) qarg=$arg ;;
1603 esac
1604 libtool_args="$libtool_args $qarg"
1606 # If the previous option needs an argument, assign it.
1607 if test -n "$prev"; then
1608 case $prev in
1609 output)
1610 compile_command="$compile_command @OUTPUT@"
1611 finalize_command="$finalize_command @OUTPUT@"
1613 esac
1615 case $prev in
1616 dlfiles|dlprefiles)
1617 if test "$preload" = no; then
1618 # Add the symbol object into the linking commands.
1619 compile_command="$compile_command @SYMFILE@"
1620 finalize_command="$finalize_command @SYMFILE@"
1621 preload=yes
1623 case $arg in
1624 *.la | *.lo) ;; # We handle these cases below.
1625 force)
1626 if test "$dlself" = no; then
1627 dlself=needless
1628 export_dynamic=yes
1630 prev=
1631 continue
1633 self)
1634 if test "$prev" = dlprefiles; then
1635 dlself=yes
1636 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1637 dlself=yes
1638 else
1639 dlself=needless
1640 export_dynamic=yes
1642 prev=
1643 continue
1646 if test "$prev" = dlfiles; then
1647 dlfiles="$dlfiles $arg"
1648 else
1649 dlprefiles="$dlprefiles $arg"
1651 prev=
1652 continue
1654 esac
1656 expsyms)
1657 export_symbols="$arg"
1658 if test ! -f "$arg"; then
1659 $echo "$modename: symbol file \`$arg' does not exist"
1660 exit $EXIT_FAILURE
1662 prev=
1663 continue
1665 expsyms_regex)
1666 export_symbols_regex="$arg"
1667 prev=
1668 continue
1670 inst_prefix)
1671 inst_prefix_dir="$arg"
1672 prev=
1673 continue
1675 precious_regex)
1676 precious_files_regex="$arg"
1677 prev=
1678 continue
1680 release)
1681 release="-$arg"
1682 prev=
1683 continue
1685 objectlist)
1686 if test -f "$arg"; then
1687 save_arg=$arg
1688 moreargs=
1689 for fil in `cat $save_arg`
1691 # moreargs="$moreargs $fil"
1692 arg=$fil
1693 # A libtool-controlled object.
1695 # Check to see that this really is a libtool object.
1696 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1697 pic_object=
1698 non_pic_object=
1700 # Read the .lo file
1701 # If there is no directory component, then add one.
1702 case $arg in
1703 */* | *\\*) . $arg ;;
1704 *) . ./$arg ;;
1705 esac
1707 if test -z "$pic_object" || \
1708 test -z "$non_pic_object" ||
1709 test "$pic_object" = none && \
1710 test "$non_pic_object" = none; then
1711 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1712 exit $EXIT_FAILURE
1715 # Extract subdirectory from the argument.
1716 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1717 if test "X$xdir" = "X$arg"; then
1718 xdir=
1719 else
1720 xdir="$xdir/"
1723 if test "$pic_object" != none; then
1724 # Prepend the subdirectory the object is found in.
1725 pic_object="$xdir$pic_object"
1727 if test "$prev" = dlfiles; then
1728 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1729 dlfiles="$dlfiles $pic_object"
1730 prev=
1731 continue
1732 else
1733 # If libtool objects are unsupported, then we need to preload.
1734 prev=dlprefiles
1738 # CHECK ME: I think I busted this. -Ossama
1739 if test "$prev" = dlprefiles; then
1740 # Preload the old-style object.
1741 dlprefiles="$dlprefiles $pic_object"
1742 prev=
1745 # A PIC object.
1746 libobjs="$libobjs $pic_object"
1747 arg="$pic_object"
1750 # Non-PIC object.
1751 if test "$non_pic_object" != none; then
1752 # Prepend the subdirectory the object is found in.
1753 non_pic_object="$xdir$non_pic_object"
1755 # A standard non-PIC object
1756 non_pic_objects="$non_pic_objects $non_pic_object"
1757 if test -z "$pic_object" || test "$pic_object" = none ; then
1758 arg="$non_pic_object"
1760 else
1761 # If the PIC object exists, use it instead.
1762 # $xdir was prepended to $pic_object above.
1763 non_pic_object="$pic_object"
1764 non_pic_objects="$non_pic_objects $non_pic_object"
1766 else
1767 # Only an error if not doing a dry-run.
1768 if test -z "$run"; then
1769 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1770 exit $EXIT_FAILURE
1771 else
1772 # Dry-run case.
1774 # Extract subdirectory from the argument.
1775 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1776 if test "X$xdir" = "X$arg"; then
1777 xdir=
1778 else
1779 xdir="$xdir/"
1782 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1783 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1784 libobjs="$libobjs $pic_object"
1785 non_pic_objects="$non_pic_objects $non_pic_object"
1788 done
1789 else
1790 $echo "$modename: link input file \`$save_arg' does not exist"
1791 exit $EXIT_FAILURE
1793 arg=$save_arg
1794 prev=
1795 continue
1797 rpath | xrpath)
1798 # We need an absolute path.
1799 case $arg in
1800 [\\/]* | [A-Za-z]:[\\/]*) ;;
1802 $echo "$modename: only absolute run-paths are allowed" 1>&2
1803 exit $EXIT_FAILURE
1805 esac
1806 if test "$prev" = rpath; then
1807 case "$rpath " in
1808 *" $arg "*) ;;
1809 *) rpath="$rpath $arg" ;;
1810 esac
1811 else
1812 case "$xrpath " in
1813 *" $arg "*) ;;
1814 *) xrpath="$xrpath $arg" ;;
1815 esac
1817 prev=
1818 continue
1820 xcompiler)
1821 compiler_flags="$compiler_flags $qarg"
1822 prev=
1823 compile_command="$compile_command $qarg"
1824 finalize_command="$finalize_command $qarg"
1825 continue
1827 xlinker)
1828 linker_flags="$linker_flags $qarg"
1829 compiler_flags="$compiler_flags $wl$qarg"
1830 prev=
1831 compile_command="$compile_command $wl$qarg"
1832 finalize_command="$finalize_command $wl$qarg"
1833 continue
1835 xcclinker)
1836 linker_flags="$linker_flags $qarg"
1837 compiler_flags="$compiler_flags $qarg"
1838 prev=
1839 compile_command="$compile_command $qarg"
1840 finalize_command="$finalize_command $qarg"
1841 continue
1843 shrext)
1844 shrext_cmds="$arg"
1845 prev=
1846 continue
1848 darwin_framework|darwin_framework_skip)
1849 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1850 compile_command="$compile_command $arg"
1851 finalize_command="$finalize_command $arg"
1852 prev=
1853 continue
1856 eval "$prev=\"\$arg\""
1857 prev=
1858 continue
1860 esac
1861 fi # test -n "$prev"
1863 prevarg="$arg"
1865 case $arg in
1866 -all-static)
1867 if test -n "$link_static_flag"; then
1868 compile_command="$compile_command $link_static_flag"
1869 finalize_command="$finalize_command $link_static_flag"
1871 continue
1874 -allow-undefined)
1875 # FIXME: remove this flag sometime in the future.
1876 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1877 continue
1880 -avoid-version)
1881 avoid_version=yes
1882 continue
1885 -dlopen)
1886 prev=dlfiles
1887 continue
1890 -dlpreopen)
1891 prev=dlprefiles
1892 continue
1895 -export-dynamic)
1896 export_dynamic=yes
1897 continue
1900 -export-symbols | -export-symbols-regex)
1901 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1902 $echo "$modename: more than one -exported-symbols argument is not allowed"
1903 exit $EXIT_FAILURE
1905 if test "X$arg" = "X-export-symbols"; then
1906 prev=expsyms
1907 else
1908 prev=expsyms_regex
1910 continue
1913 -framework|-arch|-isysroot)
1914 case " $CC " in
1915 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1916 prev=darwin_framework_skip ;;
1917 *) compiler_flags="$compiler_flags $arg"
1918 prev=darwin_framework ;;
1919 esac
1920 compile_command="$compile_command $arg"
1921 finalize_command="$finalize_command $arg"
1922 continue
1925 -inst-prefix-dir)
1926 prev=inst_prefix
1927 continue
1930 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1931 # so, if we see these flags be careful not to treat them like -L
1932 -L[A-Z][A-Z]*:*)
1933 case $with_gcc/$host in
1934 no/*-*-irix* | /*-*-irix*)
1935 compile_command="$compile_command $arg"
1936 finalize_command="$finalize_command $arg"
1938 esac
1939 continue
1942 -L*)
1943 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1944 # We need an absolute path.
1945 case $dir in
1946 [\\/]* | [A-Za-z]:[\\/]*) ;;
1948 absdir=`cd "$dir" && pwd`
1949 if test -z "$absdir"; then
1950 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1951 absdir="$dir"
1952 notinst_path="$notinst_path $dir"
1954 dir="$absdir"
1956 esac
1957 case "$deplibs " in
1958 *" -L$dir "*) ;;
1960 deplibs="$deplibs -L$dir"
1961 lib_search_path="$lib_search_path $dir"
1963 esac
1964 case $host in
1965 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1966 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1967 case :$dllsearchpath: in
1968 *":$dir:"*) ;;
1969 *) dllsearchpath="$dllsearchpath:$dir";;
1970 esac
1971 case :$dllsearchpath: in
1972 *":$testbindir:"*) ;;
1973 *) dllsearchpath="$dllsearchpath:$testbindir";;
1974 esac
1976 esac
1977 continue
1980 -l*)
1981 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1982 case $host in
1983 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1984 # These systems don't actually have a C or math library (as such)
1985 continue
1987 *-*-os2*)
1988 # These systems don't actually have a C library (as such)
1989 test "X$arg" = "X-lc" && continue
1991 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1992 # Do not include libc due to us having libc/libc_r.
1993 test "X$arg" = "X-lc" && continue
1995 *-*-rhapsody* | *-*-darwin1.[012])
1996 # Rhapsody C and math libraries are in the System framework
1997 deplibs="$deplibs -framework System"
1998 continue
2000 *-*-sco3.2v5* | *-*-sco5v6*)
2001 # Causes problems with __ctype
2002 test "X$arg" = "X-lc" && continue
2004 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
2005 # Compiler inserts libc in the correct place for threads to work
2006 test "X$arg" = "X-lc" && continue
2008 esac
2009 elif test "X$arg" = "X-lc_r"; then
2010 case $host in
2011 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
2012 # Do not include libc_r directly, use -pthread flag.
2013 continue
2015 esac
2017 deplibs="$deplibs $arg"
2018 continue
2021 # Tru64 UNIX uses -model [arg] to determine the layout of C++
2022 # classes, name mangling, and exception handling.
2023 -model)
2024 compile_command="$compile_command $arg"
2025 compiler_flags="$compiler_flags $arg"
2026 finalize_command="$finalize_command $arg"
2027 prev=xcompiler
2028 continue
2031 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2032 compiler_flags="$compiler_flags $arg"
2033 compile_command="$compile_command $arg"
2034 finalize_command="$finalize_command $arg"
2035 continue
2038 -module)
2039 module=yes
2040 continue
2043 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2044 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2045 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2046 # +DA*, +DD* enable 64-bit mode on the HP compiler
2047 # -q* pass through compiler args for the IBM compiler
2048 # -m* pass through architecture-specific compiler args for GCC
2049 # -m*, -t[45]*, -txscale* pass through architecture-specific
2050 # compiler args for GCC
2051 # -pg pass through profiling flag for GCC
2052 # @file GCC response files
2053 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
2054 -t[45]*|-txscale*|@*)
2056 # Unknown arguments in both finalize_command and compile_command need
2057 # to be aesthetically quoted because they are evaled later.
2058 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2059 case $arg in
2060 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2061 arg="\"$arg\""
2063 esac
2064 compile_command="$compile_command $arg"
2065 finalize_command="$finalize_command $arg"
2066 compiler_flags="$compiler_flags $arg"
2067 continue
2070 -shrext)
2071 prev=shrext
2072 continue
2075 -no-fast-install)
2076 fast_install=no
2077 continue
2080 -no-install)
2081 case $host in
2082 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
2083 # The PATH hackery in wrapper scripts is required on Windows
2084 # in order for the loader to find any dlls it needs.
2085 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2086 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2087 fast_install=no
2089 *) no_install=yes ;;
2090 esac
2091 continue
2094 -no-undefined)
2095 allow_undefined=no
2096 continue
2099 -objectlist)
2100 prev=objectlist
2101 continue
2104 -o) prev=output ;;
2106 -precious-files-regex)
2107 prev=precious_regex
2108 continue
2111 -release)
2112 prev=release
2113 continue
2116 -rpath)
2117 prev=rpath
2118 continue
2122 prev=xrpath
2123 continue
2126 -R*)
2127 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2128 # We need an absolute path.
2129 case $dir in
2130 [\\/]* | [A-Za-z]:[\\/]*) ;;
2132 $echo "$modename: only absolute run-paths are allowed" 1>&2
2133 exit $EXIT_FAILURE
2135 esac
2136 case "$xrpath " in
2137 *" $dir "*) ;;
2138 *) xrpath="$xrpath $dir" ;;
2139 esac
2140 continue
2143 -static)
2144 # The effects of -static are defined in a previous loop.
2145 # We used to do the same as -all-static on platforms that
2146 # didn't have a PIC flag, but the assumption that the effects
2147 # would be equivalent was wrong. It would break on at least
2148 # Digital Unix and AIX.
2149 continue
2152 -thread-safe)
2153 thread_safe=yes
2154 continue
2157 -version-info)
2158 prev=vinfo
2159 continue
2161 -version-number)
2162 prev=vinfo
2163 vinfo_number=yes
2164 continue
2167 -Wc,*)
2168 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2169 arg=
2170 save_ifs="$IFS"; IFS=','
2171 for flag in $args; do
2172 IFS="$save_ifs"
2173 case $flag in
2174 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2175 flag="\"$flag\""
2177 esac
2178 arg="$arg $wl$flag"
2179 compiler_flags="$compiler_flags $flag"
2180 done
2181 IFS="$save_ifs"
2182 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2185 -Wl,*)
2186 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2187 arg=
2188 save_ifs="$IFS"; IFS=','
2189 for flag in $args; do
2190 IFS="$save_ifs"
2191 case $flag in
2192 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2193 flag="\"$flag\""
2195 esac
2196 arg="$arg $wl$flag"
2197 compiler_flags="$compiler_flags $wl$flag"
2198 linker_flags="$linker_flags $flag"
2199 done
2200 IFS="$save_ifs"
2201 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2204 -Xcompiler)
2205 prev=xcompiler
2206 continue
2209 -Xlinker)
2210 prev=xlinker
2211 continue
2214 -XCClinker)
2215 prev=xcclinker
2216 continue
2219 # Some other compiler flag.
2220 -* | +*)
2221 # Unknown arguments in both finalize_command and compile_command need
2222 # to be aesthetically quoted because they are evaled later.
2223 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2224 case $arg in
2225 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2226 arg="\"$arg\""
2228 esac
2231 *.$objext)
2232 # A standard object.
2233 objs="$objs $arg"
2236 *.lo)
2237 # A libtool-controlled object.
2239 # Check to see that this really is a libtool object.
2240 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2241 pic_object=
2242 non_pic_object=
2244 # Read the .lo file
2245 # If there is no directory component, then add one.
2246 case $arg in
2247 */* | *\\*) . $arg ;;
2248 *) . ./$arg ;;
2249 esac
2251 if test -z "$pic_object" || \
2252 test -z "$non_pic_object" ||
2253 test "$pic_object" = none && \
2254 test "$non_pic_object" = none; then
2255 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2256 exit $EXIT_FAILURE
2259 # Extract subdirectory from the argument.
2260 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2261 if test "X$xdir" = "X$arg"; then
2262 xdir=
2263 else
2264 xdir="$xdir/"
2267 if test "$pic_object" != none; then
2268 # Prepend the subdirectory the object is found in.
2269 pic_object="$xdir$pic_object"
2271 if test "$prev" = dlfiles; then
2272 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2273 dlfiles="$dlfiles $pic_object"
2274 prev=
2275 continue
2276 else
2277 # If libtool objects are unsupported, then we need to preload.
2278 prev=dlprefiles
2282 # CHECK ME: I think I busted this. -Ossama
2283 if test "$prev" = dlprefiles; then
2284 # Preload the old-style object.
2285 dlprefiles="$dlprefiles $pic_object"
2286 prev=
2289 # A PIC object.
2290 libobjs="$libobjs $pic_object"
2291 arg="$pic_object"
2294 # Non-PIC object.
2295 if test "$non_pic_object" != none; then
2296 # Prepend the subdirectory the object is found in.
2297 non_pic_object="$xdir$non_pic_object"
2299 # A standard non-PIC object
2300 non_pic_objects="$non_pic_objects $non_pic_object"
2301 if test -z "$pic_object" || test "$pic_object" = none ; then
2302 arg="$non_pic_object"
2304 else
2305 # If the PIC object exists, use it instead.
2306 # $xdir was prepended to $pic_object above.
2307 non_pic_object="$pic_object"
2308 non_pic_objects="$non_pic_objects $non_pic_object"
2310 else
2311 # Only an error if not doing a dry-run.
2312 if test -z "$run"; then
2313 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2314 exit $EXIT_FAILURE
2315 else
2316 # Dry-run case.
2318 # Extract subdirectory from the argument.
2319 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2320 if test "X$xdir" = "X$arg"; then
2321 xdir=
2322 else
2323 xdir="$xdir/"
2326 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2327 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2328 libobjs="$libobjs $pic_object"
2329 non_pic_objects="$non_pic_objects $non_pic_object"
2334 *.$libext)
2335 # An archive.
2336 deplibs="$deplibs $arg"
2337 old_deplibs="$old_deplibs $arg"
2338 continue
2341 *.la)
2342 # A libtool-controlled library.
2344 if test "$prev" = dlfiles; then
2345 # This library was specified with -dlopen.
2346 dlfiles="$dlfiles $arg"
2347 prev=
2348 elif test "$prev" = dlprefiles; then
2349 # The library was specified with -dlpreopen.
2350 dlprefiles="$dlprefiles $arg"
2351 prev=
2352 else
2353 deplibs="$deplibs $arg"
2355 continue
2358 # Some other compiler argument.
2360 # Unknown arguments in both finalize_command and compile_command need
2361 # to be aesthetically quoted because they are evaled later.
2362 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2363 case $arg in
2364 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2365 arg="\"$arg\""
2367 esac
2369 esac # arg
2371 # Now actually substitute the argument into the commands.
2372 if test -n "$arg"; then
2373 compile_command="$compile_command $arg"
2374 finalize_command="$finalize_command $arg"
2376 done # argument parsing loop
2378 if test -n "$prev"; then
2379 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2380 $echo "$help" 1>&2
2381 exit $EXIT_FAILURE
2384 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2385 eval arg=\"$export_dynamic_flag_spec\"
2386 compile_command="$compile_command $arg"
2387 finalize_command="$finalize_command $arg"
2390 oldlibs=
2391 # calculate the name of the file, without its directory
2392 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2393 libobjs_save="$libobjs"
2395 if test -n "$shlibpath_var"; then
2396 # get the directories listed in $shlibpath_var
2397 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2398 else
2399 shlib_search_path=
2401 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2402 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2404 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2405 if test "X$output_objdir" = "X$output"; then
2406 output_objdir="$objdir"
2407 else
2408 output_objdir="$output_objdir/$objdir"
2410 # Create the object directory.
2411 if test ! -d "$output_objdir"; then
2412 $show "$mkdir $output_objdir"
2413 $run $mkdir $output_objdir
2414 exit_status=$?
2415 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2416 exit $exit_status
2420 # Determine the type of output
2421 case $output in
2423 $echo "$modename: you must specify an output file" 1>&2
2424 $echo "$help" 1>&2
2425 exit $EXIT_FAILURE
2427 *.$libext) linkmode=oldlib ;;
2428 *.lo | *.$objext) linkmode=obj ;;
2429 *.la) linkmode=lib ;;
2430 *) linkmode=prog ;; # Anything else should be a program.
2431 esac
2433 case $host in
2434 *cygwin* | *mingw* | *pw32*)
2435 # don't eliminate duplications in $postdeps and $predeps
2436 duplicate_compiler_generated_deps=yes
2439 duplicate_compiler_generated_deps=$duplicate_deps
2441 esac
2442 specialdeplibs=
2444 libs=
2445 # Find all interdependent deplibs by searching for libraries
2446 # that are linked more than once (e.g. -la -lb -la)
2447 for deplib in $deplibs; do
2448 if test "X$duplicate_deps" = "Xyes" ; then
2449 case "$libs " in
2450 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2451 esac
2453 libs="$libs $deplib"
2454 done
2456 if test "$linkmode" = lib; then
2457 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2459 # Compute libraries that are listed more than once in $predeps
2460 # $postdeps and mark them as special (i.e., whose duplicates are
2461 # not to be eliminated).
2462 pre_post_deps=
2463 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2464 for pre_post_dep in $predeps $postdeps; do
2465 case "$pre_post_deps " in
2466 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2467 esac
2468 pre_post_deps="$pre_post_deps $pre_post_dep"
2469 done
2471 pre_post_deps=
2474 deplibs=
2475 newdependency_libs=
2476 newlib_search_path=
2477 need_relink=no # whether we're linking any uninstalled libtool libraries
2478 notinst_deplibs= # not-installed libtool libraries
2479 case $linkmode in
2480 lib)
2481 passes="conv link"
2482 for file in $dlfiles $dlprefiles; do
2483 case $file in
2484 *.la) ;;
2486 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2487 exit $EXIT_FAILURE
2489 esac
2490 done
2492 prog)
2493 compile_deplibs=
2494 finalize_deplibs=
2495 alldeplibs=no
2496 newdlfiles=
2497 newdlprefiles=
2498 passes="conv scan dlopen dlpreopen link"
2500 *) passes="conv"
2502 esac
2503 for pass in $passes; do
2504 if test "$linkmode,$pass" = "lib,link" ||
2505 test "$linkmode,$pass" = "prog,scan"; then
2506 libs="$deplibs"
2507 deplibs=
2509 if test "$linkmode" = prog; then
2510 case $pass in
2511 dlopen) libs="$dlfiles" ;;
2512 dlpreopen) libs="$dlprefiles" ;;
2513 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2514 esac
2516 if test "$pass" = dlopen; then
2517 # Collect dlpreopened libraries
2518 save_deplibs="$deplibs"
2519 deplibs=
2521 for deplib in $libs; do
2522 lib=
2523 found=no
2524 case $deplib in
2525 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2526 if test "$linkmode,$pass" = "prog,link"; then
2527 compile_deplibs="$deplib $compile_deplibs"
2528 finalize_deplibs="$deplib $finalize_deplibs"
2529 else
2530 compiler_flags="$compiler_flags $deplib"
2532 continue
2534 -l*)
2535 if test "$linkmode" != lib && test "$linkmode" != prog; then
2536 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2537 continue
2539 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2540 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2541 for search_ext in .la $std_shrext .so .a; do
2542 # Search the libtool library
2543 lib="$searchdir/lib${name}${search_ext}"
2544 if test -f "$lib"; then
2545 if test "$search_ext" = ".la"; then
2546 found=yes
2547 else
2548 found=no
2550 break 2
2552 done
2553 done
2554 if test "$found" != yes; then
2555 # deplib doesn't seem to be a libtool library
2556 if test "$linkmode,$pass" = "prog,link"; then
2557 compile_deplibs="$deplib $compile_deplibs"
2558 finalize_deplibs="$deplib $finalize_deplibs"
2559 else
2560 deplibs="$deplib $deplibs"
2561 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2563 continue
2564 else # deplib is a libtool library
2565 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2566 # We need to do some special things here, and not later.
2567 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2568 case " $predeps $postdeps " in
2569 *" $deplib "*)
2570 if (${SED} -e '2q' $lib |
2571 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2572 library_names=
2573 old_library=
2574 case $lib in
2575 */* | *\\*) . $lib ;;
2576 *) . ./$lib ;;
2577 esac
2578 for l in $old_library $library_names; do
2579 ll="$l"
2580 done
2581 if test "X$ll" = "X$old_library" ; then # only static version available
2582 found=no
2583 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2584 test "X$ladir" = "X$lib" && ladir="."
2585 lib=$ladir/$old_library
2586 if test "$linkmode,$pass" = "prog,link"; then
2587 compile_deplibs="$deplib $compile_deplibs"
2588 finalize_deplibs="$deplib $finalize_deplibs"
2589 else
2590 deplibs="$deplib $deplibs"
2591 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2593 continue
2597 *) ;;
2598 esac
2601 ;; # -l
2602 -L*)
2603 case $linkmode in
2604 lib)
2605 deplibs="$deplib $deplibs"
2606 test "$pass" = conv && continue
2607 newdependency_libs="$deplib $newdependency_libs"
2608 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2610 prog)
2611 if test "$pass" = conv; then
2612 deplibs="$deplib $deplibs"
2613 continue
2615 if test "$pass" = scan; then
2616 deplibs="$deplib $deplibs"
2617 else
2618 compile_deplibs="$deplib $compile_deplibs"
2619 finalize_deplibs="$deplib $finalize_deplibs"
2621 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2624 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2626 esac # linkmode
2627 continue
2628 ;; # -L
2629 -R*)
2630 if test "$pass" = link; then
2631 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2632 # Make sure the xrpath contains only unique directories.
2633 case "$xrpath " in
2634 *" $dir "*) ;;
2635 *) xrpath="$xrpath $dir" ;;
2636 esac
2638 deplibs="$deplib $deplibs"
2639 continue
2641 *.la) lib="$deplib" ;;
2642 *.$libext)
2643 if test "$pass" = conv; then
2644 deplibs="$deplib $deplibs"
2645 continue
2647 case $linkmode in
2648 lib)
2649 valid_a_lib=no
2650 case $deplibs_check_method in
2651 match_pattern*)
2652 set dummy $deplibs_check_method
2653 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2654 if eval $echo \"$deplib\" 2>/dev/null \
2655 | $SED 10q \
2656 | $EGREP "$match_pattern_regex" > /dev/null; then
2657 valid_a_lib=yes
2660 pass_all)
2661 valid_a_lib=yes
2663 esac
2664 if test "$valid_a_lib" != yes; then
2665 $echo
2666 $echo "*** Warning: Trying to link with static lib archive $deplib."
2667 $echo "*** I have the capability to make that library automatically link in when"
2668 $echo "*** you link to this library. But I can only do this if you have a"
2669 $echo "*** shared version of the library, which you do not appear to have"
2670 $echo "*** because the file extensions .$libext of this argument makes me believe"
2671 $echo "*** that it is just a static archive that I should not used here."
2672 else
2673 $echo
2674 $echo "*** Warning: Linking the shared library $output against the"
2675 $echo "*** static library $deplib is not portable!"
2676 deplibs="$deplib $deplibs"
2678 continue
2680 prog)
2681 if test "$pass" != link; then
2682 deplibs="$deplib $deplibs"
2683 else
2684 compile_deplibs="$deplib $compile_deplibs"
2685 finalize_deplibs="$deplib $finalize_deplibs"
2687 continue
2689 esac # linkmode
2690 ;; # *.$libext
2691 *.lo | *.$objext)
2692 if test "$pass" = conv; then
2693 deplibs="$deplib $deplibs"
2694 elif test "$linkmode" = prog; then
2695 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2696 # If there is no dlopen support or we're linking statically,
2697 # we need to preload.
2698 newdlprefiles="$newdlprefiles $deplib"
2699 compile_deplibs="$deplib $compile_deplibs"
2700 finalize_deplibs="$deplib $finalize_deplibs"
2701 else
2702 newdlfiles="$newdlfiles $deplib"
2705 continue
2707 %DEPLIBS%)
2708 alldeplibs=yes
2709 continue
2711 esac # case $deplib
2712 if test "$found" = yes || test -f "$lib"; then :
2713 else
2714 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2715 exit $EXIT_FAILURE
2718 # Check to see that this really is a libtool archive.
2719 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2720 else
2721 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2722 exit $EXIT_FAILURE
2725 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2726 test "X$ladir" = "X$lib" && ladir="."
2728 dlname=
2729 dlopen=
2730 dlpreopen=
2731 libdir=
2732 library_names=
2733 old_library=
2734 # If the library was installed with an old release of libtool,
2735 # it will not redefine variables installed, or shouldnotlink
2736 installed=yes
2737 shouldnotlink=no
2738 avoidtemprpath=
2741 # Read the .la file
2742 case $lib in
2743 */* | *\\*) . $lib ;;
2744 *) . ./$lib ;;
2745 esac
2747 if test "$linkmode,$pass" = "lib,link" ||
2748 test "$linkmode,$pass" = "prog,scan" ||
2749 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2750 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2751 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2754 if test "$pass" = conv; then
2755 # Only check for convenience libraries
2756 deplibs="$lib $deplibs"
2757 if test -z "$libdir"; then
2758 if test -z "$old_library"; then
2759 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2760 exit $EXIT_FAILURE
2762 # It is a libtool convenience library, so add in its objects.
2763 convenience="$convenience $ladir/$objdir/$old_library"
2764 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2765 tmp_libs=
2766 for deplib in $dependency_libs; do
2767 deplibs="$deplib $deplibs"
2768 if test "X$duplicate_deps" = "Xyes" ; then
2769 case "$tmp_libs " in
2770 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2771 esac
2773 tmp_libs="$tmp_libs $deplib"
2774 done
2775 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2776 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2777 exit $EXIT_FAILURE
2779 continue
2780 fi # $pass = conv
2783 # Get the name of the library we link against.
2784 linklib=
2785 for l in $old_library $library_names; do
2786 linklib="$l"
2787 done
2788 if test -z "$linklib"; then
2789 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2790 exit $EXIT_FAILURE
2793 # This library was specified with -dlopen.
2794 if test "$pass" = dlopen; then
2795 if test -z "$libdir"; then
2796 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2797 exit $EXIT_FAILURE
2799 if test -z "$dlname" ||
2800 test "$dlopen_support" != yes ||
2801 test "$build_libtool_libs" = no; then
2802 # If there is no dlname, no dlopen support or we're linking
2803 # statically, we need to preload. We also need to preload any
2804 # dependent libraries so libltdl's deplib preloader doesn't
2805 # bomb out in the load deplibs phase.
2806 dlprefiles="$dlprefiles $lib $dependency_libs"
2807 else
2808 newdlfiles="$newdlfiles $lib"
2810 continue
2811 fi # $pass = dlopen
2813 # We need an absolute path.
2814 case $ladir in
2815 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2817 abs_ladir=`cd "$ladir" && pwd`
2818 if test -z "$abs_ladir"; then
2819 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2820 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2821 abs_ladir="$ladir"
2824 esac
2825 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2827 # Find the relevant object directory and library name.
2828 if test "X$installed" = Xyes; then
2829 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2830 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2831 dir="$ladir"
2832 absdir="$abs_ladir"
2833 libdir="$abs_ladir"
2834 else
2835 dir="$libdir"
2836 absdir="$libdir"
2838 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2839 else
2840 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2841 dir="$ladir"
2842 absdir="$abs_ladir"
2843 # Remove this search path later
2844 notinst_path="$notinst_path $abs_ladir"
2845 else
2846 dir="$ladir/$objdir"
2847 absdir="$abs_ladir/$objdir"
2848 # Remove this search path later
2849 notinst_path="$notinst_path $abs_ladir"
2851 fi # $installed = yes
2852 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2854 # This library was specified with -dlpreopen.
2855 if test "$pass" = dlpreopen; then
2856 if test -z "$libdir"; then
2857 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2858 exit $EXIT_FAILURE
2860 # Prefer using a static library (so that no silly _DYNAMIC symbols
2861 # are required to link).
2862 if test -n "$old_library"; then
2863 newdlprefiles="$newdlprefiles $dir/$old_library"
2864 # Otherwise, use the dlname, so that lt_dlopen finds it.
2865 elif test -n "$dlname"; then
2866 newdlprefiles="$newdlprefiles $dir/$dlname"
2867 else
2868 newdlprefiles="$newdlprefiles $dir/$linklib"
2870 fi # $pass = dlpreopen
2872 if test -z "$libdir"; then
2873 # Link the convenience library
2874 if test "$linkmode" = lib; then
2875 deplibs="$dir/$old_library $deplibs"
2876 elif test "$linkmode,$pass" = "prog,link"; then
2877 compile_deplibs="$dir/$old_library $compile_deplibs"
2878 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2879 else
2880 deplibs="$lib $deplibs" # used for prog,scan pass
2882 continue
2886 if test "$linkmode" = prog && test "$pass" != link; then
2887 newlib_search_path="$newlib_search_path $ladir"
2888 deplibs="$lib $deplibs"
2890 linkalldeplibs=no
2891 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2892 test "$build_libtool_libs" = no; then
2893 linkalldeplibs=yes
2896 tmp_libs=
2897 for deplib in $dependency_libs; do
2898 case $deplib in
2899 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2900 esac
2901 # Need to link against all dependency_libs?
2902 if test "$linkalldeplibs" = yes; then
2903 deplibs="$deplib $deplibs"
2904 else
2905 # Need to hardcode shared library paths
2906 # or/and link against static libraries
2907 newdependency_libs="$deplib $newdependency_libs"
2909 if test "X$duplicate_deps" = "Xyes" ; then
2910 case "$tmp_libs " in
2911 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2912 esac
2914 tmp_libs="$tmp_libs $deplib"
2915 done # for deplib
2916 continue
2917 fi # $linkmode = prog...
2919 if test "$linkmode,$pass" = "prog,link"; then
2920 if test -n "$library_names" &&
2921 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2922 # We need to hardcode the library path
2923 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2924 # Make sure the rpath contains only unique directories.
2925 case "$temp_rpath " in
2926 *" $dir "*) ;;
2927 *" $absdir "*) ;;
2928 *) temp_rpath="$temp_rpath $absdir" ;;
2929 esac
2932 # Hardcode the library path.
2933 # Skip directories that are in the system default run-time
2934 # search path.
2935 case " $sys_lib_dlsearch_path " in
2936 *" $absdir "*) ;;
2938 case "$compile_rpath " in
2939 *" $absdir "*) ;;
2940 *) compile_rpath="$compile_rpath $absdir"
2941 esac
2943 esac
2944 case " $sys_lib_dlsearch_path " in
2945 *" $libdir "*) ;;
2947 case "$finalize_rpath " in
2948 *" $libdir "*) ;;
2949 *) finalize_rpath="$finalize_rpath $libdir"
2950 esac
2952 esac
2953 fi # $linkmode,$pass = prog,link...
2955 if test "$alldeplibs" = yes &&
2956 { test "$deplibs_check_method" = pass_all ||
2957 { test "$build_libtool_libs" = yes &&
2958 test -n "$library_names"; }; }; then
2959 # We only need to search for static libraries
2960 continue
2964 link_static=no # Whether the deplib will be linked statically
2965 use_static_libs=$prefer_static_libs
2966 if test "$use_static_libs" = built && test "$installed" = yes ; then
2967 use_static_libs=no
2969 if test -n "$library_names" &&
2970 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2971 if test "$installed" = no; then
2972 notinst_deplibs="$notinst_deplibs $lib"
2973 need_relink=yes
2975 # This is a shared library
2977 # Warn about portability, can't link against -module's on
2978 # some systems (darwin)
2979 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2980 $echo
2981 if test "$linkmode" = prog; then
2982 $echo "*** Warning: Linking the executable $output against the loadable module"
2983 else
2984 $echo "*** Warning: Linking the shared library $output against the loadable module"
2986 $echo "*** $linklib is not portable!"
2988 if test "$linkmode" = lib &&
2989 test "$hardcode_into_libs" = yes; then
2990 # Hardcode the library path.
2991 # Skip directories that are in the system default run-time
2992 # search path.
2993 case " $sys_lib_dlsearch_path " in
2994 *" $absdir "*) ;;
2996 case "$compile_rpath " in
2997 *" $absdir "*) ;;
2998 *) compile_rpath="$compile_rpath $absdir"
2999 esac
3001 esac
3002 case " $sys_lib_dlsearch_path " in
3003 *" $libdir "*) ;;
3005 case "$finalize_rpath " in
3006 *" $libdir "*) ;;
3007 *) finalize_rpath="$finalize_rpath $libdir"
3008 esac
3010 esac
3013 if test -n "$old_archive_from_expsyms_cmds"; then
3014 # figure out the soname
3015 set dummy $library_names
3016 realname="$2"
3017 shift; shift
3018 libname=`eval \\$echo \"$libname_spec\"`
3019 # use dlname if we got it. it's perfectly good, no?
3020 if test -n "$dlname"; then
3021 soname="$dlname"
3022 elif test -n "$soname_spec"; then
3023 # bleh windows
3024 case $host in
3025 *cygwin* | mingw*)
3026 major=`expr $current - $age`
3027 versuffix="-$major"
3029 esac
3030 eval soname=\"$soname_spec\"
3031 else
3032 soname="$realname"
3035 # Make a new name for the extract_expsyms_cmds to use
3036 soroot="$soname"
3037 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3038 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3040 # If the library has no export list, then create one now
3041 if test -f "$output_objdir/$soname-def"; then :
3042 else
3043 $show "extracting exported symbol list from \`$soname'"
3044 save_ifs="$IFS"; IFS='~'
3045 cmds=$extract_expsyms_cmds
3046 for cmd in $cmds; do
3047 IFS="$save_ifs"
3048 eval cmd=\"$cmd\"
3049 $show "$cmd"
3050 $run eval "$cmd" || exit $?
3051 done
3052 IFS="$save_ifs"
3055 # Create $newlib
3056 if test -f "$output_objdir/$newlib"; then :; else
3057 $show "generating import library for \`$soname'"
3058 save_ifs="$IFS"; IFS='~'
3059 cmds=$old_archive_from_expsyms_cmds
3060 for cmd in $cmds; do
3061 IFS="$save_ifs"
3062 eval cmd=\"$cmd\"
3063 $show "$cmd"
3064 $run eval "$cmd" || exit $?
3065 done
3066 IFS="$save_ifs"
3068 # make sure the library variables are pointing to the new library
3069 dir=$output_objdir
3070 linklib=$newlib
3071 fi # test -n "$old_archive_from_expsyms_cmds"
3073 if test "$linkmode" = prog || test "$mode" != relink; then
3074 add_shlibpath=
3075 add_dir=
3076 add=
3077 lib_linked=yes
3078 case $hardcode_action in
3079 immediate | unsupported)
3080 if test "$hardcode_direct" = no; then
3081 add="$dir/$linklib"
3082 case $host in
3083 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3084 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3085 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3086 *-*-unixware7*) add_dir="-L$dir" ;;
3087 *-*-darwin* )
3088 # if the lib is a module then we can not link against
3089 # it, someone is ignoring the new warnings I added
3090 if /usr/bin/file -L $add 2> /dev/null |
3091 $EGREP ": [^:]* bundle" >/dev/null ; then
3092 $echo "** Warning, lib $linklib is a module, not a shared library"
3093 if test -z "$old_library" ; then
3094 $echo
3095 $echo "** And there doesn't seem to be a static archive available"
3096 $echo "** The link will probably fail, sorry"
3097 else
3098 add="$dir/$old_library"
3101 esac
3102 elif test "$hardcode_minus_L" = no; then
3103 case $host in
3104 *-*-sunos*) add_shlibpath="$dir" ;;
3105 esac
3106 add_dir="-L$dir"
3107 add="-l$name"
3108 elif test "$hardcode_shlibpath_var" = no; then
3109 add_shlibpath="$dir"
3110 add="-l$name"
3111 else
3112 lib_linked=no
3115 relink)
3116 if test "$hardcode_direct" = yes; then
3117 add="$dir/$linklib"
3118 elif test "$hardcode_minus_L" = yes; then
3119 add_dir="-L$dir"
3120 # Try looking first in the location we're being installed to.
3121 if test -n "$inst_prefix_dir"; then
3122 case $libdir in
3123 [\\/]*)
3124 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3126 esac
3128 add="-l$name"
3129 elif test "$hardcode_shlibpath_var" = yes; then
3130 add_shlibpath="$dir"
3131 add="-l$name"
3132 else
3133 lib_linked=no
3136 *) lib_linked=no ;;
3137 esac
3139 if test "$lib_linked" != yes; then
3140 $echo "$modename: configuration error: unsupported hardcode properties"
3141 exit $EXIT_FAILURE
3144 if test -n "$add_shlibpath"; then
3145 case :$compile_shlibpath: in
3146 *":$add_shlibpath:"*) ;;
3147 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3148 esac
3150 if test "$linkmode" = prog; then
3151 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3152 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3153 else
3154 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3155 test -n "$add" && deplibs="$add $deplibs"
3156 if test "$hardcode_direct" != yes && \
3157 test "$hardcode_minus_L" != yes && \
3158 test "$hardcode_shlibpath_var" = yes; then
3159 case :$finalize_shlibpath: in
3160 *":$libdir:"*) ;;
3161 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3162 esac
3167 if test "$linkmode" = prog || test "$mode" = relink; then
3168 add_shlibpath=
3169 add_dir=
3170 add=
3171 # Finalize command for both is simple: just hardcode it.
3172 if test "$hardcode_direct" = yes; then
3173 add="$libdir/$linklib"
3174 elif test "$hardcode_minus_L" = yes; then
3175 add_dir="-L$libdir"
3176 add="-l$name"
3177 elif test "$hardcode_shlibpath_var" = yes; then
3178 case :$finalize_shlibpath: in
3179 *":$libdir:"*) ;;
3180 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3181 esac
3182 add="-l$name"
3183 elif test "$hardcode_automatic" = yes; then
3184 if test -n "$inst_prefix_dir" &&
3185 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3186 add="$inst_prefix_dir$libdir/$linklib"
3187 else
3188 add="$libdir/$linklib"
3190 else
3191 # We cannot seem to hardcode it, guess we'll fake it.
3192 add_dir="-L$libdir"
3193 # Try looking first in the location we're being installed to.
3194 if test -n "$inst_prefix_dir"; then
3195 case $libdir in
3196 [\\/]*)
3197 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3199 esac
3201 add="-l$name"
3204 if test "$linkmode" = prog; then
3205 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3206 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3207 else
3208 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3209 test -n "$add" && deplibs="$add $deplibs"
3212 elif test "$linkmode" = prog; then
3213 # Here we assume that one of hardcode_direct or hardcode_minus_L
3214 # is not unsupported. This is valid on all known static and
3215 # shared platforms.
3216 if test "$hardcode_direct" != unsupported; then
3217 test -n "$old_library" && linklib="$old_library"
3218 compile_deplibs="$dir/$linklib $compile_deplibs"
3219 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3220 else
3221 compile_deplibs="-l$name -L$dir $compile_deplibs"
3222 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3224 elif test "$build_libtool_libs" = yes; then
3225 # Not a shared library
3226 if test "$deplibs_check_method" != pass_all; then
3227 # We're trying link a shared library against a static one
3228 # but the system doesn't support it.
3230 # Just print a warning and add the library to dependency_libs so
3231 # that the program can be linked against the static library.
3232 $echo
3233 $echo "*** Warning: This system can not link to static lib archive $lib."
3234 $echo "*** I have the capability to make that library automatically link in when"
3235 $echo "*** you link to this library. But I can only do this if you have a"
3236 $echo "*** shared version of the library, which you do not appear to have."
3237 if test "$module" = yes; then
3238 $echo "*** But as you try to build a module library, libtool will still create "
3239 $echo "*** a static module, that should work as long as the dlopening application"
3240 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3241 if test -z "$global_symbol_pipe"; then
3242 $echo
3243 $echo "*** However, this would only work if libtool was able to extract symbol"
3244 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3245 $echo "*** not find such a program. So, this module is probably useless."
3246 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3248 if test "$build_old_libs" = no; then
3249 build_libtool_libs=module
3250 build_old_libs=yes
3251 else
3252 build_libtool_libs=no
3255 else
3256 deplibs="$dir/$old_library $deplibs"
3257 link_static=yes
3259 fi # link shared/static library?
3261 if test "$linkmode" = lib; then
3262 if test -n "$dependency_libs" &&
3263 { test "$hardcode_into_libs" != yes ||
3264 test "$build_old_libs" = yes ||
3265 test "$link_static" = yes; }; then
3266 # Extract -R from dependency_libs
3267 temp_deplibs=
3268 for libdir in $dependency_libs; do
3269 case $libdir in
3270 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3271 case " $xrpath " in
3272 *" $temp_xrpath "*) ;;
3273 *) xrpath="$xrpath $temp_xrpath";;
3274 esac;;
3275 *) temp_deplibs="$temp_deplibs $libdir";;
3276 esac
3277 done
3278 dependency_libs="$temp_deplibs"
3281 newlib_search_path="$newlib_search_path $absdir"
3282 # Link against this library
3283 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3284 # ... and its dependency_libs
3285 tmp_libs=
3286 for deplib in $dependency_libs; do
3287 newdependency_libs="$deplib $newdependency_libs"
3288 if test "X$duplicate_deps" = "Xyes" ; then
3289 case "$tmp_libs " in
3290 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3291 esac
3293 tmp_libs="$tmp_libs $deplib"
3294 done
3296 if test "$link_all_deplibs" != no; then
3297 # Add the search paths of all dependency libraries
3298 for deplib in $dependency_libs; do
3299 case $deplib in
3300 -L*) path="$deplib" ;;
3301 *.la)
3302 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3303 test "X$dir" = "X$deplib" && dir="."
3304 # We need an absolute path.
3305 case $dir in
3306 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3308 absdir=`cd "$dir" && pwd`
3309 if test -z "$absdir"; then
3310 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3311 absdir="$dir"
3314 esac
3315 if grep "^installed=no" $deplib > /dev/null; then
3316 path="$absdir/$objdir"
3317 else
3318 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3319 if test -z "$libdir"; then
3320 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3321 exit $EXIT_FAILURE
3323 if test "$absdir" != "$libdir"; then
3324 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3326 path="$absdir"
3328 depdepl=
3329 case $host in
3330 *-*-darwin*)
3331 # we do not want to link against static libs,
3332 # but need to link against shared
3333 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3334 if test -n "$deplibrary_names" ; then
3335 for tmp in $deplibrary_names ; do
3336 depdepl=$tmp
3337 done
3338 if test -f "$path/$depdepl" ; then
3339 depdepl="$path/$depdepl"
3341 # do not add paths which are already there
3342 case " $newlib_search_path " in
3343 *" $path "*) ;;
3344 *) newlib_search_path="$newlib_search_path $path";;
3345 esac
3347 path=""
3350 path="-L$path"
3352 esac
3354 -l*)
3355 case $host in
3356 *-*-darwin*)
3357 # Again, we only want to link against shared libraries
3358 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3359 for tmp in $newlib_search_path ; do
3360 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3361 eval depdepl="$tmp/lib$tmp_libs.dylib"
3362 break
3364 done
3365 path=""
3367 *) continue ;;
3368 esac
3370 *) continue ;;
3371 esac
3372 case " $deplibs " in
3373 *" $path "*) ;;
3374 *) deplibs="$path $deplibs" ;;
3375 esac
3376 case " $deplibs " in
3377 *" $depdepl "*) ;;
3378 *) deplibs="$depdepl $deplibs" ;;
3379 esac
3380 done
3381 fi # link_all_deplibs != no
3382 fi # linkmode = lib
3383 done # for deplib in $libs
3384 dependency_libs="$newdependency_libs"
3385 if test "$pass" = dlpreopen; then
3386 # Link the dlpreopened libraries before other libraries
3387 for deplib in $save_deplibs; do
3388 deplibs="$deplib $deplibs"
3389 done
3391 if test "$pass" != dlopen; then
3392 if test "$pass" != conv; then
3393 # Make sure lib_search_path contains only unique directories.
3394 lib_search_path=
3395 for dir in $newlib_search_path; do
3396 case "$lib_search_path " in
3397 *" $dir "*) ;;
3398 *) lib_search_path="$lib_search_path $dir" ;;
3399 esac
3400 done
3401 newlib_search_path=
3404 if test "$linkmode,$pass" != "prog,link"; then
3405 vars="deplibs"
3406 else
3407 vars="compile_deplibs finalize_deplibs"
3409 for var in $vars dependency_libs; do
3410 # Add libraries to $var in reverse order
3411 eval tmp_libs=\"\$$var\"
3412 new_libs=
3413 for deplib in $tmp_libs; do
3414 # FIXME: Pedantically, this is the right thing to do, so
3415 # that some nasty dependency loop isn't accidentally
3416 # broken:
3417 #new_libs="$deplib $new_libs"
3418 # Pragmatically, this seems to cause very few problems in
3419 # practice:
3420 case $deplib in
3421 -L*) new_libs="$deplib $new_libs" ;;
3422 -R*) ;;
3424 # And here is the reason: when a library appears more
3425 # than once as an explicit dependence of a library, or
3426 # is implicitly linked in more than once by the
3427 # compiler, it is considered special, and multiple
3428 # occurrences thereof are not removed. Compare this
3429 # with having the same library being listed as a
3430 # dependency of multiple other libraries: in this case,
3431 # we know (pedantically, we assume) the library does not
3432 # need to be listed more than once, so we keep only the
3433 # last copy. This is not always right, but it is rare
3434 # enough that we require users that really mean to play
3435 # such unportable linking tricks to link the library
3436 # using -Wl,-lname, so that libtool does not consider it
3437 # for duplicate removal.
3438 case " $specialdeplibs " in
3439 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3441 case " $new_libs " in
3442 *" $deplib "*) ;;
3443 *) new_libs="$deplib $new_libs" ;;
3444 esac
3446 esac
3448 esac
3449 done
3450 tmp_libs=
3451 for deplib in $new_libs; do
3452 case $deplib in
3453 -L*)
3454 case " $tmp_libs " in
3455 *" $deplib "*) ;;
3456 *) tmp_libs="$tmp_libs $deplib" ;;
3457 esac
3459 *) tmp_libs="$tmp_libs $deplib" ;;
3460 esac
3461 done
3462 eval $var=\"$tmp_libs\"
3463 done # for var
3465 # Last step: remove runtime libs from dependency_libs
3466 # (they stay in deplibs)
3467 tmp_libs=
3468 for i in $dependency_libs ; do
3469 case " $predeps $postdeps $compiler_lib_search_path " in
3470 *" $i "*)
3471 i=""
3473 esac
3474 if test -n "$i" ; then
3475 tmp_libs="$tmp_libs $i"
3477 done
3478 dependency_libs=$tmp_libs
3479 done # for pass
3480 if test "$linkmode" = prog; then
3481 dlfiles="$newdlfiles"
3482 dlprefiles="$newdlprefiles"
3485 case $linkmode in
3486 oldlib)
3487 if test -n "$deplibs"; then
3488 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3491 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3492 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3495 if test -n "$rpath"; then
3496 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3499 if test -n "$xrpath"; then
3500 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3503 if test -n "$vinfo"; then
3504 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3507 if test -n "$release"; then
3508 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3511 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3512 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3515 # Now set the variables for building old libraries.
3516 build_libtool_libs=no
3517 oldlibs="$output"
3518 objs="$objs$old_deplibs"
3521 lib)
3522 # Make sure we only generate libraries of the form `libNAME.la'.
3523 case $outputname in
3524 lib*)
3525 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3526 eval shared_ext=\"$shrext_cmds\"
3527 eval libname=\"$libname_spec\"
3530 if test "$module" = no; then
3531 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3532 $echo "$help" 1>&2
3533 exit $EXIT_FAILURE
3535 if test "$need_lib_prefix" != no; then
3536 # Add the "lib" prefix for modules if required
3537 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3538 eval shared_ext=\"$shrext_cmds\"
3539 eval libname=\"$libname_spec\"
3540 else
3541 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3544 esac
3546 if test -n "$objs"; then
3547 if test "$deplibs_check_method" != pass_all; then
3548 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3549 exit $EXIT_FAILURE
3550 else
3551 $echo
3552 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3553 $echo "*** objects $objs is not portable!"
3554 libobjs="$libobjs $objs"
3558 if test "$dlself" != no; then
3559 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3562 set dummy $rpath
3563 if test "$#" -gt 2; then
3564 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3566 install_libdir="$2"
3568 oldlibs=
3569 if test -z "$rpath"; then
3570 if test "$build_libtool_libs" = yes; then
3571 # Building a libtool convenience library.
3572 # Some compilers have problems with a `.al' extension so
3573 # convenience libraries should have the same extension an
3574 # archive normally would.
3575 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3576 build_libtool_libs=convenience
3577 build_old_libs=yes
3580 if test -n "$vinfo"; then
3581 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3584 if test -n "$release"; then
3585 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3587 else
3589 # Parse the version information argument.
3590 save_ifs="$IFS"; IFS=':'
3591 set dummy $vinfo 0 0 0
3592 IFS="$save_ifs"
3594 if test -n "$8"; then
3595 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3596 $echo "$help" 1>&2
3597 exit $EXIT_FAILURE
3600 # convert absolute version numbers to libtool ages
3601 # this retains compatibility with .la files and attempts
3602 # to make the code below a bit more comprehensible
3604 case $vinfo_number in
3605 yes)
3606 number_major="$2"
3607 number_minor="$3"
3608 number_revision="$4"
3610 # There are really only two kinds -- those that
3611 # use the current revision as the major version
3612 # and those that subtract age and use age as
3613 # a minor version. But, then there is irix
3614 # which has an extra 1 added just for fun
3616 case $version_type in
3617 darwin|linux|osf|windows)
3618 current=`expr $number_major + $number_minor`
3619 age="$number_minor"
3620 revision="$number_revision"
3622 freebsd-aout|freebsd-elf|sunos)
3623 current="$number_major"
3624 revision="$number_minor"
3625 age="0"
3627 irix|nonstopux)
3628 current=`expr $number_major + $number_minor - 1`
3629 age="$number_minor"
3630 revision="$number_minor"
3632 esac
3635 current="$2"
3636 revision="$3"
3637 age="$4"
3639 esac
3641 # Check that each of the things are valid numbers.
3642 case $current in
3643 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3645 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3646 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3647 exit $EXIT_FAILURE
3649 esac
3651 case $revision in
3652 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3654 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3655 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3656 exit $EXIT_FAILURE
3658 esac
3660 case $age in
3661 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3663 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3664 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3665 exit $EXIT_FAILURE
3667 esac
3669 if test "$age" -gt "$current"; then
3670 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3671 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3672 exit $EXIT_FAILURE
3675 # Calculate the version variables.
3676 major=
3677 versuffix=
3678 verstring=
3679 case $version_type in
3680 none) ;;
3682 darwin)
3683 # Like Linux, but with the current version available in
3684 # verstring for coding it into the library header
3685 major=.`expr $current - $age`
3686 versuffix="$major.$age.$revision"
3687 # Darwin ld doesn't like 0 for these options...
3688 minor_current=`expr $current + 1`
3689 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3692 freebsd-aout)
3693 major=".$current"
3694 versuffix=".$current.$revision";
3697 freebsd-elf)
3698 major=".$current"
3699 versuffix=".$current";
3702 irix | nonstopux)
3703 major=`expr $current - $age + 1`
3705 case $version_type in
3706 nonstopux) verstring_prefix=nonstopux ;;
3707 *) verstring_prefix=sgi ;;
3708 esac
3709 verstring="$verstring_prefix$major.$revision"
3711 # Add in all the interfaces that we are compatible with.
3712 loop=$revision
3713 while test "$loop" -ne 0; do
3714 iface=`expr $revision - $loop`
3715 loop=`expr $loop - 1`
3716 verstring="$verstring_prefix$major.$iface:$verstring"
3717 done
3719 # Before this point, $major must not contain `.'.
3720 major=.$major
3721 versuffix="$major.$revision"
3724 linux)
3725 major=.`expr $current - $age`
3726 versuffix="$major.$age.$revision"
3729 osf)
3730 major=.`expr $current - $age`
3731 versuffix=".$current.$age.$revision"
3732 verstring="$current.$age.$revision"
3734 # Add in all the interfaces that we are compatible with.
3735 loop=$age
3736 while test "$loop" -ne 0; do
3737 iface=`expr $current - $loop`
3738 loop=`expr $loop - 1`
3739 verstring="$verstring:${iface}.0"
3740 done
3742 # Make executables depend on our current version.
3743 verstring="$verstring:${current}.0"
3746 sunos)
3747 major=".$current"
3748 versuffix=".$current.$revision"
3751 windows)
3752 # Use '-' rather than '.', since we only want one
3753 # extension on DOS 8.3 filesystems.
3754 major=`expr $current - $age`
3755 versuffix="-$major"
3759 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3760 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3761 exit $EXIT_FAILURE
3763 esac
3765 # Clear the version info if we defaulted, and they specified a release.
3766 if test -z "$vinfo" && test -n "$release"; then
3767 major=
3768 case $version_type in
3769 darwin)
3770 # we can't check for "0.0" in archive_cmds due to quoting
3771 # problems, so we reset it completely
3772 verstring=
3775 verstring="0.0"
3777 esac
3778 if test "$need_version" = no; then
3779 versuffix=
3780 else
3781 versuffix=".0.0"
3785 # Remove version info from name if versioning should be avoided
3786 if test "$avoid_version" = yes && test "$need_version" = no; then
3787 major=
3788 versuffix=
3789 verstring=""
3792 # Check to see if the archive will have undefined symbols.
3793 if test "$allow_undefined" = yes; then
3794 if test "$allow_undefined_flag" = unsupported; then
3795 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3796 build_libtool_libs=no
3797 build_old_libs=yes
3799 else
3800 # Don't allow undefined symbols.
3801 allow_undefined_flag="$no_undefined_flag"
3805 if test "$mode" != relink; then
3806 # Remove our outputs, but don't remove object files since they
3807 # may have been created when compiling PIC objects.
3808 removelist=
3809 tempremovelist=`$echo "$output_objdir/*"`
3810 for p in $tempremovelist; do
3811 case $p in
3812 *.$objext)
3814 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3815 if test "X$precious_files_regex" != "X"; then
3816 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3817 then
3818 continue
3821 removelist="$removelist $p"
3823 *) ;;
3824 esac
3825 done
3826 if test -n "$removelist"; then
3827 $show "${rm}r $removelist"
3828 $run ${rm}r $removelist
3832 # Now set the variables for building old libraries.
3833 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3834 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3836 # Transform .lo files to .o files.
3837 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3840 # Eliminate all temporary directories.
3841 for path in $notinst_path; do
3842 lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3843 deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3844 dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3845 done
3847 if test -n "$xrpath"; then
3848 # If the user specified any rpath flags, then add them.
3849 temp_xrpath=
3850 for libdir in $xrpath; do
3851 temp_xrpath="$temp_xrpath -R$libdir"
3852 case "$finalize_rpath " in
3853 *" $libdir "*) ;;
3854 *) finalize_rpath="$finalize_rpath $libdir" ;;
3855 esac
3856 done
3857 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3858 dependency_libs="$temp_xrpath $dependency_libs"
3862 # Make sure dlfiles contains only unique files that won't be dlpreopened
3863 old_dlfiles="$dlfiles"
3864 dlfiles=
3865 for lib in $old_dlfiles; do
3866 case " $dlprefiles $dlfiles " in
3867 *" $lib "*) ;;
3868 *) dlfiles="$dlfiles $lib" ;;
3869 esac
3870 done
3872 # Make sure dlprefiles contains only unique files
3873 old_dlprefiles="$dlprefiles"
3874 dlprefiles=
3875 for lib in $old_dlprefiles; do
3876 case "$dlprefiles " in
3877 *" $lib "*) ;;
3878 *) dlprefiles="$dlprefiles $lib" ;;
3879 esac
3880 done
3882 if test "$build_libtool_libs" = yes; then
3883 if test -n "$rpath"; then
3884 case $host in
3885 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3886 # these systems don't actually have a c library (as such)!
3888 *-*-rhapsody* | *-*-darwin1.[012])
3889 # Rhapsody C library is in the System framework
3890 deplibs="$deplibs -framework System"
3892 *-*-netbsd*)
3893 # Don't link with libc until the a.out ld.so is fixed.
3895 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3896 # Do not include libc due to us having libc/libc_r.
3898 *-*-sco3.2v5* | *-*-sco5v6*)
3899 # Causes problems with __ctype
3901 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3902 # Compiler inserts libc in the correct place for threads to work
3905 # Add libc to deplibs on all other systems if necessary.
3906 if test "$build_libtool_need_lc" = "yes"; then
3907 deplibs="$deplibs -lc"
3910 esac
3913 # Transform deplibs into only deplibs that can be linked in shared.
3914 name_save=$name
3915 libname_save=$libname
3916 release_save=$release
3917 versuffix_save=$versuffix
3918 major_save=$major
3919 # I'm not sure if I'm treating the release correctly. I think
3920 # release should show up in the -l (ie -lgmp5) so we don't want to
3921 # add it in twice. Is that correct?
3922 release=""
3923 versuffix=""
3924 major=""
3925 newdeplibs=
3926 droppeddeps=no
3927 case $deplibs_check_method in
3928 pass_all)
3929 # Don't check for shared/static. Everything works.
3930 # This might be a little naive. We might want to check
3931 # whether the library exists or not. But this is on
3932 # osf3 & osf4 and I'm not really sure... Just
3933 # implementing what was already the behavior.
3934 newdeplibs=$deplibs
3936 test_compile)
3937 # This code stresses the "libraries are programs" paradigm to its
3938 # limits. Maybe even breaks it. We compile a program, linking it
3939 # against the deplibs as a proxy for the library. Then we can check
3940 # whether they linked in statically or dynamically with ldd.
3941 $rm conftest.c
3942 cat > conftest.c <<EOF
3943 int main() { return 0; }
3945 $rm conftest
3946 $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
3947 if test "$?" -eq 0 ; then
3948 ldd_output=`ldd conftest`
3949 for i in $deplibs; do
3950 name=`expr $i : '-l\(.*\)'`
3951 # If $name is empty we are operating on a -L argument.
3952 if test "$name" != "" && test "$name" -ne "0"; then
3953 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3954 case " $predeps $postdeps " in
3955 *" $i "*)
3956 newdeplibs="$newdeplibs $i"
3957 i=""
3959 esac
3961 if test -n "$i" ; then
3962 libname=`eval \\$echo \"$libname_spec\"`
3963 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3964 set dummy $deplib_matches
3965 deplib_match=$2
3966 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3967 newdeplibs="$newdeplibs $i"
3968 else
3969 droppeddeps=yes
3970 $echo
3971 $echo "*** Warning: dynamic linker does not accept needed library $i."
3972 $echo "*** I have the capability to make that library automatically link in when"
3973 $echo "*** you link to this library. But I can only do this if you have a"
3974 $echo "*** shared version of the library, which I believe you do not have"
3975 $echo "*** because a test_compile did reveal that the linker did not use it for"
3976 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3979 else
3980 newdeplibs="$newdeplibs $i"
3982 done
3983 else
3984 # Error occurred in the first compile. Let's try to salvage
3985 # the situation: Compile a separate program for each library.
3986 for i in $deplibs; do
3987 name=`expr $i : '-l\(.*\)'`
3988 # If $name is empty we are operating on a -L argument.
3989 if test "$name" != "" && test "$name" != "0"; then
3990 $rm conftest
3991 $LTCC $LTCFLAGS -o conftest conftest.c $i
3992 # Did it work?
3993 if test "$?" -eq 0 ; then
3994 ldd_output=`ldd conftest`
3995 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3996 case " $predeps $postdeps " in
3997 *" $i "*)
3998 newdeplibs="$newdeplibs $i"
3999 i=""
4001 esac
4003 if test -n "$i" ; then
4004 libname=`eval \\$echo \"$libname_spec\"`
4005 deplib_matches=`eval \\$echo \"$library_names_spec\"`
4006 set dummy $deplib_matches
4007 deplib_match=$2
4008 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
4009 newdeplibs="$newdeplibs $i"
4010 else
4011 droppeddeps=yes
4012 $echo
4013 $echo "*** Warning: dynamic linker does not accept needed library $i."
4014 $echo "*** I have the capability to make that library automatically link in when"
4015 $echo "*** you link to this library. But I can only do this if you have a"
4016 $echo "*** shared version of the library, which you do not appear to have"
4017 $echo "*** because a test_compile did reveal that the linker did not use this one"
4018 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
4021 else
4022 droppeddeps=yes
4023 $echo
4024 $echo "*** Warning! Library $i is needed by this library but I was not able to"
4025 $echo "*** make it link in! You will probably need to install it or some"
4026 $echo "*** library that it depends on before this library will be fully"
4027 $echo "*** functional. Installing it before continuing would be even better."
4029 else
4030 newdeplibs="$newdeplibs $i"
4032 done
4035 file_magic*)
4036 set dummy $deplibs_check_method
4037 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4038 for a_deplib in $deplibs; do
4039 name=`expr $a_deplib : '-l\(.*\)'`
4040 # If $name is empty we are operating on a -L argument.
4041 if test "$name" != "" && test "$name" != "0"; then
4042 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4043 case " $predeps $postdeps " in
4044 *" $a_deplib "*)
4045 newdeplibs="$newdeplibs $a_deplib"
4046 a_deplib=""
4048 esac
4050 if test -n "$a_deplib" ; then
4051 libname=`eval \\$echo \"$libname_spec\"`
4052 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4053 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4054 for potent_lib in $potential_libs; do
4055 # Follow soft links.
4056 if ls -lLd "$potent_lib" 2>/dev/null \
4057 | grep " -> " >/dev/null; then
4058 continue
4060 # The statement above tries to avoid entering an
4061 # endless loop below, in case of cyclic links.
4062 # We might still enter an endless loop, since a link
4063 # loop can be closed while we follow links,
4064 # but so what?
4065 potlib="$potent_lib"
4066 while test -h "$potlib" 2>/dev/null; do
4067 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4068 case $potliblink in
4069 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4070 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4071 esac
4072 done
4073 # It is ok to link against an archive when
4074 # building a shared library.
4075 if $AR -t $potlib > /dev/null 2>&1; then
4076 newdeplibs="$newdeplibs $a_deplib"
4077 a_deplib=""
4078 break 2
4080 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4081 | ${SED} 10q \
4082 | $EGREP "$file_magic_regex" > /dev/null; then
4083 newdeplibs="$newdeplibs $a_deplib"
4084 a_deplib=""
4085 break 2
4087 done
4088 done
4090 if test -n "$a_deplib" ; then
4091 droppeddeps=yes
4092 $echo
4093 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4094 $echo "*** I have the capability to make that library automatically link in when"
4095 $echo "*** you link to this library. But I can only do this if you have a"
4096 $echo "*** shared version of the library, which you do not appear to have"
4097 $echo "*** because I did check the linker path looking for a file starting"
4098 if test -z "$potlib" ; then
4099 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4100 else
4101 $echo "*** with $libname and none of the candidates passed a file format test"
4102 $echo "*** using a file magic. Last file checked: $potlib"
4105 else
4106 # Add a -L argument.
4107 newdeplibs="$newdeplibs $a_deplib"
4109 done # Gone through all deplibs.
4111 match_pattern*)
4112 set dummy $deplibs_check_method
4113 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4114 for a_deplib in $deplibs; do
4115 name=`expr $a_deplib : '-l\(.*\)'`
4116 # If $name is empty we are operating on a -L argument.
4117 if test -n "$name" && test "$name" != "0"; then
4118 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4119 case " $predeps $postdeps " in
4120 *" $a_deplib "*)
4121 newdeplibs="$newdeplibs $a_deplib"
4122 a_deplib=""
4124 esac
4126 if test -n "$a_deplib" ; then
4127 libname=`eval \\$echo \"$libname_spec\"`
4128 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4129 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4130 for potent_lib in $potential_libs; do
4131 potlib="$potent_lib" # see symlink-check above in file_magic test
4132 if eval $echo \"$potent_lib\" 2>/dev/null \
4133 | ${SED} 10q \
4134 | $EGREP "$match_pattern_regex" > /dev/null; then
4135 newdeplibs="$newdeplibs $a_deplib"
4136 a_deplib=""
4137 break 2
4139 done
4140 done
4142 if test -n "$a_deplib" ; then
4143 droppeddeps=yes
4144 $echo
4145 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4146 $echo "*** I have the capability to make that library automatically link in when"
4147 $echo "*** you link to this library. But I can only do this if you have a"
4148 $echo "*** shared version of the library, which you do not appear to have"
4149 $echo "*** because I did check the linker path looking for a file starting"
4150 if test -z "$potlib" ; then
4151 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4152 else
4153 $echo "*** with $libname and none of the candidates passed a file format test"
4154 $echo "*** using a regex pattern. Last file checked: $potlib"
4157 else
4158 # Add a -L argument.
4159 newdeplibs="$newdeplibs $a_deplib"
4161 done # Gone through all deplibs.
4163 none | unknown | *)
4164 newdeplibs=""
4165 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4166 -e 's/ -[LR][^ ]*//g'`
4167 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4168 for i in $predeps $postdeps ; do
4169 # can't use Xsed below, because $i might contain '/'
4170 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4171 done
4173 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4174 | grep . >/dev/null; then
4175 $echo
4176 if test "X$deplibs_check_method" = "Xnone"; then
4177 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4178 else
4179 $echo "*** Warning: inter-library dependencies are not known to be supported."
4181 $echo "*** All declared inter-library dependencies are being dropped."
4182 droppeddeps=yes
4185 esac
4186 versuffix=$versuffix_save
4187 major=$major_save
4188 release=$release_save
4189 libname=$libname_save
4190 name=$name_save
4192 case $host in
4193 *-*-rhapsody* | *-*-darwin1.[012])
4194 # On Rhapsody replace the C library is the System framework
4195 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4197 esac
4199 if test "$droppeddeps" = yes; then
4200 if test "$module" = yes; then
4201 $echo
4202 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4203 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4204 $echo "*** a static module, that should work as long as the dlopening"
4205 $echo "*** application is linked with the -dlopen flag."
4206 if test -z "$global_symbol_pipe"; then
4207 $echo
4208 $echo "*** However, this would only work if libtool was able to extract symbol"
4209 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4210 $echo "*** not find such a program. So, this module is probably useless."
4211 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4213 if test "$build_old_libs" = no; then
4214 oldlibs="$output_objdir/$libname.$libext"
4215 build_libtool_libs=module
4216 build_old_libs=yes
4217 else
4218 build_libtool_libs=no
4220 else
4221 $echo "*** The inter-library dependencies that have been dropped here will be"
4222 $echo "*** automatically added whenever a program is linked with this library"
4223 $echo "*** or is declared to -dlopen it."
4225 if test "$allow_undefined" = no; then
4226 $echo
4227 $echo "*** Since this library must not contain undefined symbols,"
4228 $echo "*** because either the platform does not support them or"
4229 $echo "*** it was explicitly requested with -no-undefined,"
4230 $echo "*** libtool will only create a static version of it."
4231 if test "$build_old_libs" = no; then
4232 oldlibs="$output_objdir/$libname.$libext"
4233 build_libtool_libs=module
4234 build_old_libs=yes
4235 else
4236 build_libtool_libs=no
4241 # Done checking deplibs!
4242 deplibs=$newdeplibs
4246 # move library search paths that coincide with paths to not yet
4247 # installed libraries to the beginning of the library search list
4248 new_libs=
4249 for path in $notinst_path; do
4250 case " $new_libs " in
4251 *" -L$path/$objdir "*) ;;
4253 case " $deplibs " in
4254 *" -L$path/$objdir "*)
4255 new_libs="$new_libs -L$path/$objdir" ;;
4256 esac
4258 esac
4259 done
4260 for deplib in $deplibs; do
4261 case $deplib in
4262 -L*)
4263 case " $new_libs " in
4264 *" $deplib "*) ;;
4265 *) new_libs="$new_libs $deplib" ;;
4266 esac
4268 *) new_libs="$new_libs $deplib" ;;
4269 esac
4270 done
4271 deplibs="$new_libs"
4274 # All the library-specific variables (install_libdir is set above).
4275 library_names=
4276 old_library=
4277 dlname=
4279 # Test again, we may have decided not to build it any more
4280 if test "$build_libtool_libs" = yes; then
4281 if test "$hardcode_into_libs" = yes; then
4282 # Hardcode the library paths
4283 hardcode_libdirs=
4284 dep_rpath=
4285 rpath="$finalize_rpath"
4286 test "$mode" != relink && rpath="$compile_rpath$rpath"
4287 for libdir in $rpath; do
4288 if test -n "$hardcode_libdir_flag_spec"; then
4289 if test -n "$hardcode_libdir_separator"; then
4290 if test -z "$hardcode_libdirs"; then
4291 hardcode_libdirs="$libdir"
4292 else
4293 # Just accumulate the unique libdirs.
4294 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4295 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4298 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4300 esac
4302 else
4303 eval flag=\"$hardcode_libdir_flag_spec\"
4304 dep_rpath="$dep_rpath $flag"
4306 elif test -n "$runpath_var"; then
4307 case "$perm_rpath " in
4308 *" $libdir "*) ;;
4309 *) perm_rpath="$perm_rpath $libdir" ;;
4310 esac
4312 done
4313 # Substitute the hardcoded libdirs into the rpath.
4314 if test -n "$hardcode_libdir_separator" &&
4315 test -n "$hardcode_libdirs"; then
4316 libdir="$hardcode_libdirs"
4317 if test -n "$hardcode_libdir_flag_spec_ld"; then
4318 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4319 else
4320 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4323 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4324 # We should set the runpath_var.
4325 rpath=
4326 for dir in $perm_rpath; do
4327 rpath="$rpath$dir:"
4328 done
4329 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4331 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4334 shlibpath="$finalize_shlibpath"
4335 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4336 if test -n "$shlibpath"; then
4337 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4340 # Get the real and link names of the library.
4341 eval shared_ext=\"$shrext_cmds\"
4342 eval library_names=\"$library_names_spec\"
4343 set dummy $library_names
4344 realname="$2"
4345 shift; shift
4347 if test -n "$soname_spec"; then
4348 eval soname=\"$soname_spec\"
4349 else
4350 soname="$realname"
4352 if test -z "$dlname"; then
4353 dlname=$soname
4356 lib="$output_objdir/$realname"
4357 linknames=
4358 for link
4360 linknames="$linknames $link"
4361 done
4363 # Use standard objects if they are pic
4364 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4366 # Prepare the list of exported symbols
4367 if test -z "$export_symbols"; then
4368 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4369 $show "generating symbol list for \`$libname.la'"
4370 export_symbols="$output_objdir/$libname.exp"
4371 $run $rm $export_symbols
4372 cmds=$export_symbols_cmds
4373 save_ifs="$IFS"; IFS='~'
4374 for cmd in $cmds; do
4375 IFS="$save_ifs"
4376 eval cmd=\"$cmd\"
4377 if len=`expr "X$cmd" : ".*"` &&
4378 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4379 $show "$cmd"
4380 $run eval "$cmd" || exit $?
4381 skipped_export=false
4382 else
4383 # The command line is too long to execute in one step.
4384 $show "using reloadable object file for export list..."
4385 skipped_export=:
4386 # Break out early, otherwise skipped_export may be
4387 # set to false by a later but shorter cmd.
4388 break
4390 done
4391 IFS="$save_ifs"
4392 if test -n "$export_symbols_regex"; then
4393 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4394 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4395 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4396 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4401 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4402 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4405 tmp_deplibs=
4406 for test_deplib in $deplibs; do
4407 case " $convenience " in
4408 *" $test_deplib "*) ;;
4410 tmp_deplibs="$tmp_deplibs $test_deplib"
4412 esac
4413 done
4414 deplibs="$tmp_deplibs"
4416 if test -n "$convenience"; then
4417 if test -n "$whole_archive_flag_spec"; then
4418 save_libobjs=$libobjs
4419 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4420 else
4421 gentop="$output_objdir/${outputname}x"
4422 generated="$generated $gentop"
4424 func_extract_archives $gentop $convenience
4425 libobjs="$libobjs $func_extract_archives_result"
4429 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4430 eval flag=\"$thread_safe_flag_spec\"
4431 linker_flags="$linker_flags $flag"
4434 # Make a backup of the uninstalled library when relinking
4435 if test "$mode" = relink; then
4436 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4439 # Do each of the archive commands.
4440 if test "$module" = yes && test -n "$module_cmds" ; then
4441 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4442 eval test_cmds=\"$module_expsym_cmds\"
4443 cmds=$module_expsym_cmds
4444 else
4445 eval test_cmds=\"$module_cmds\"
4446 cmds=$module_cmds
4448 else
4449 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4450 eval test_cmds=\"$archive_expsym_cmds\"
4451 cmds=$archive_expsym_cmds
4452 else
4453 eval test_cmds=\"$archive_cmds\"
4454 cmds=$archive_cmds
4458 if test "X$skipped_export" != "X:" &&
4459 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4460 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4462 else
4463 # The command line is too long to link in one step, link piecewise.
4464 $echo "creating reloadable object files..."
4466 # Save the value of $output and $libobjs because we want to
4467 # use them later. If we have whole_archive_flag_spec, we
4468 # want to use save_libobjs as it was before
4469 # whole_archive_flag_spec was expanded, because we can't
4470 # assume the linker understands whole_archive_flag_spec.
4471 # This may have to be revisited, in case too many
4472 # convenience libraries get linked in and end up exceeding
4473 # the spec.
4474 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4475 save_libobjs=$libobjs
4477 save_output=$output
4478 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4480 # Clear the reloadable object creation command queue and
4481 # initialize k to one.
4482 test_cmds=
4483 concat_cmds=
4484 objlist=
4485 delfiles=
4486 last_robj=
4488 output=$output_objdir/$output_la-${k}.$objext
4489 # Loop over the list of objects to be linked.
4490 for obj in $save_libobjs
4492 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4493 if test "X$objlist" = X ||
4494 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4495 test "$len" -le "$max_cmd_len"; }; then
4496 objlist="$objlist $obj"
4497 else
4498 # The command $test_cmds is almost too long, add a
4499 # command to the queue.
4500 if test "$k" -eq 1 ; then
4501 # The first file doesn't have a previous command to add.
4502 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4503 else
4504 # All subsequent reloadable object files will link in
4505 # the last one created.
4506 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4508 last_robj=$output_objdir/$output_la-${k}.$objext
4509 k=`expr $k + 1`
4510 output=$output_objdir/$output_la-${k}.$objext
4511 objlist=$obj
4512 len=1
4514 done
4515 # Handle the remaining objects by creating one last
4516 # reloadable object file. All subsequent reloadable object
4517 # files will link in the last one created.
4518 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4519 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4521 if ${skipped_export-false}; then
4522 $show "generating symbol list for \`$libname.la'"
4523 export_symbols="$output_objdir/$libname.exp"
4524 $run $rm $export_symbols
4525 libobjs=$output
4526 # Append the command to create the export file.
4527 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4530 # Set up a command to remove the reloadable object files
4531 # after they are used.
4533 while test "$i" -lt "$k"
4535 i=`expr $i + 1`
4536 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4537 done
4539 $echo "creating a temporary reloadable object file: $output"
4541 # Loop through the commands generated above and execute them.
4542 save_ifs="$IFS"; IFS='~'
4543 for cmd in $concat_cmds; do
4544 IFS="$save_ifs"
4545 $show "$cmd"
4546 $run eval "$cmd" || exit $?
4547 done
4548 IFS="$save_ifs"
4550 libobjs=$output
4551 # Restore the value of output.
4552 output=$save_output
4554 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4555 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4557 # Expand the library linking commands again to reset the
4558 # value of $libobjs for piecewise linking.
4560 # Do each of the archive commands.
4561 if test "$module" = yes && test -n "$module_cmds" ; then
4562 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4563 cmds=$module_expsym_cmds
4564 else
4565 cmds=$module_cmds
4567 else
4568 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4569 cmds=$archive_expsym_cmds
4570 else
4571 cmds=$archive_cmds
4575 # Append the command to remove the reloadable object files
4576 # to the just-reset $cmds.
4577 eval cmds=\"\$cmds~\$rm $delfiles\"
4579 save_ifs="$IFS"; IFS='~'
4580 for cmd in $cmds; do
4581 IFS="$save_ifs"
4582 eval cmd=\"$cmd\"
4583 $show "$cmd"
4584 $run eval "$cmd" || {
4585 lt_exit=$?
4587 # Restore the uninstalled library and exit
4588 if test "$mode" = relink; then
4589 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4592 exit $lt_exit
4594 done
4595 IFS="$save_ifs"
4597 # Restore the uninstalled library and exit
4598 if test "$mode" = relink; then
4599 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4601 if test -n "$convenience"; then
4602 if test -z "$whole_archive_flag_spec"; then
4603 $show "${rm}r $gentop"
4604 $run ${rm}r "$gentop"
4608 exit $EXIT_SUCCESS
4611 # Create links to the real library.
4612 for linkname in $linknames; do
4613 if test "$realname" != "$linkname"; then
4614 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4615 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4617 done
4619 # If -module or -export-dynamic was specified, set the dlname.
4620 if test "$module" = yes || test "$export_dynamic" = yes; then
4621 # On all known operating systems, these are identical.
4622 dlname="$soname"
4627 obj)
4628 if test -n "$deplibs"; then
4629 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4632 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4633 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4636 if test -n "$rpath"; then
4637 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4640 if test -n "$xrpath"; then
4641 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4644 if test -n "$vinfo"; then
4645 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4648 if test -n "$release"; then
4649 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4652 case $output in
4653 *.lo)
4654 if test -n "$objs$old_deplibs"; then
4655 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4656 exit $EXIT_FAILURE
4658 libobj="$output"
4659 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4662 libobj=
4663 obj="$output"
4665 esac
4667 # Delete the old objects.
4668 $run $rm $obj $libobj
4670 # Objects from convenience libraries. This assumes
4671 # single-version convenience libraries. Whenever we create
4672 # different ones for PIC/non-PIC, this we'll have to duplicate
4673 # the extraction.
4674 reload_conv_objs=
4675 gentop=
4676 # reload_cmds runs $LD directly, so let us get rid of
4677 # -Wl from whole_archive_flag_spec
4680 if test -n "$convenience"; then
4681 if test -n "$whole_archive_flag_spec"; then
4682 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4683 else
4684 gentop="$output_objdir/${obj}x"
4685 generated="$generated $gentop"
4687 func_extract_archives $gentop $convenience
4688 reload_conv_objs="$reload_objs $func_extract_archives_result"
4692 # Create the old-style object.
4693 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
4695 output="$obj"
4696 cmds=$reload_cmds
4697 save_ifs="$IFS"; IFS='~'
4698 for cmd in $cmds; do
4699 IFS="$save_ifs"
4700 eval cmd=\"$cmd\"
4701 $show "$cmd"
4702 $run eval "$cmd" || exit $?
4703 done
4704 IFS="$save_ifs"
4706 # Exit if we aren't doing a library object file.
4707 if test -z "$libobj"; then
4708 if test -n "$gentop"; then
4709 $show "${rm}r $gentop"
4710 $run ${rm}r $gentop
4713 exit $EXIT_SUCCESS
4716 if test "$build_libtool_libs" != yes; then
4717 if test -n "$gentop"; then
4718 $show "${rm}r $gentop"
4719 $run ${rm}r $gentop
4722 # Create an invalid libtool object if no PIC, so that we don't
4723 # accidentally link it into a program.
4724 # $show "echo timestamp > $libobj"
4725 # $run eval "echo timestamp > $libobj" || exit $?
4726 exit $EXIT_SUCCESS
4729 if test -n "$pic_flag" || test "$pic_mode" != default; then
4730 # Only do commands if we really have different PIC objects.
4731 reload_objs="$libobjs $reload_conv_objs"
4732 output="$libobj"
4733 cmds=$reload_cmds
4734 save_ifs="$IFS"; IFS='~'
4735 for cmd in $cmds; do
4736 IFS="$save_ifs"
4737 eval cmd=\"$cmd\"
4738 $show "$cmd"
4739 $run eval "$cmd" || exit $?
4740 done
4741 IFS="$save_ifs"
4744 if test -n "$gentop"; then
4745 $show "${rm}r $gentop"
4746 $run ${rm}r $gentop
4749 exit $EXIT_SUCCESS
4752 prog)
4753 case $host in
4754 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4755 esac
4756 if test -n "$vinfo"; then
4757 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4760 if test -n "$release"; then
4761 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4764 if test "$preload" = yes; then
4765 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4766 test "$dlopen_self_static" = unknown; then
4767 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4771 case $host in
4772 *-*-rhapsody* | *-*-darwin1.[012])
4773 # On Rhapsody replace the C library is the System framework
4774 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4775 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4777 esac
4779 case $host in
4780 *darwin*)
4781 # Don't allow lazy linking, it breaks C++ global constructors
4782 if test "$tagname" = CXX ; then
4783 compile_command="$compile_command ${wl}-bind_at_load"
4784 finalize_command="$finalize_command ${wl}-bind_at_load"
4787 esac
4790 # move library search paths that coincide with paths to not yet
4791 # installed libraries to the beginning of the library search list
4792 new_libs=
4793 for path in $notinst_path; do
4794 case " $new_libs " in
4795 *" -L$path/$objdir "*) ;;
4797 case " $compile_deplibs " in
4798 *" -L$path/$objdir "*)
4799 new_libs="$new_libs -L$path/$objdir" ;;
4800 esac
4802 esac
4803 done
4804 for deplib in $compile_deplibs; do
4805 case $deplib in
4806 -L*)
4807 case " $new_libs " in
4808 *" $deplib "*) ;;
4809 *) new_libs="$new_libs $deplib" ;;
4810 esac
4812 *) new_libs="$new_libs $deplib" ;;
4813 esac
4814 done
4815 compile_deplibs="$new_libs"
4818 compile_command="$compile_command $compile_deplibs"
4819 finalize_command="$finalize_command $finalize_deplibs"
4821 if test -n "$rpath$xrpath"; then
4822 # If the user specified any rpath flags, then add them.
4823 for libdir in $rpath $xrpath; do
4824 # This is the magic to use -rpath.
4825 case "$finalize_rpath " in
4826 *" $libdir "*) ;;
4827 *) finalize_rpath="$finalize_rpath $libdir" ;;
4828 esac
4829 done
4832 # Now hardcode the library paths
4833 rpath=
4834 hardcode_libdirs=
4835 for libdir in $compile_rpath $finalize_rpath; do
4836 if test -n "$hardcode_libdir_flag_spec"; then
4837 if test -n "$hardcode_libdir_separator"; then
4838 if test -z "$hardcode_libdirs"; then
4839 hardcode_libdirs="$libdir"
4840 else
4841 # Just accumulate the unique libdirs.
4842 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4843 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4846 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4848 esac
4850 else
4851 eval flag=\"$hardcode_libdir_flag_spec\"
4852 rpath="$rpath $flag"
4854 elif test -n "$runpath_var"; then
4855 case "$perm_rpath " in
4856 *" $libdir "*) ;;
4857 *) perm_rpath="$perm_rpath $libdir" ;;
4858 esac
4860 case $host in
4861 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4862 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4863 case :$dllsearchpath: in
4864 *":$libdir:"*) ;;
4865 *) dllsearchpath="$dllsearchpath:$libdir";;
4866 esac
4867 case :$dllsearchpath: in
4868 *":$testbindir:"*) ;;
4869 *) dllsearchpath="$dllsearchpath:$testbindir";;
4870 esac
4872 esac
4873 done
4874 # Substitute the hardcoded libdirs into the rpath.
4875 if test -n "$hardcode_libdir_separator" &&
4876 test -n "$hardcode_libdirs"; then
4877 libdir="$hardcode_libdirs"
4878 eval rpath=\" $hardcode_libdir_flag_spec\"
4880 compile_rpath="$rpath"
4882 rpath=
4883 hardcode_libdirs=
4884 for libdir in $finalize_rpath; do
4885 if test -n "$hardcode_libdir_flag_spec"; then
4886 if test -n "$hardcode_libdir_separator"; then
4887 if test -z "$hardcode_libdirs"; then
4888 hardcode_libdirs="$libdir"
4889 else
4890 # Just accumulate the unique libdirs.
4891 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4892 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4895 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4897 esac
4899 else
4900 eval flag=\"$hardcode_libdir_flag_spec\"
4901 rpath="$rpath $flag"
4903 elif test -n "$runpath_var"; then
4904 case "$finalize_perm_rpath " in
4905 *" $libdir "*) ;;
4906 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4907 esac
4909 done
4910 # Substitute the hardcoded libdirs into the rpath.
4911 if test -n "$hardcode_libdir_separator" &&
4912 test -n "$hardcode_libdirs"; then
4913 libdir="$hardcode_libdirs"
4914 eval rpath=\" $hardcode_libdir_flag_spec\"
4916 finalize_rpath="$rpath"
4918 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4919 # Transform all the library objects into standard objects.
4920 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4921 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4924 dlsyms=
4925 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4926 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4927 dlsyms="${outputname}S.c"
4928 else
4929 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4933 if test -n "$dlsyms"; then
4934 case $dlsyms in
4935 "") ;;
4936 *.c)
4937 # Discover the nlist of each of the dlfiles.
4938 nlist="$output_objdir/${outputname}.nm"
4940 $show "$rm $nlist ${nlist}S ${nlist}T"
4941 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4943 # Parse the name list into a source file.
4944 $show "creating $output_objdir/$dlsyms"
4946 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4947 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4948 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4950 #ifdef __cplusplus
4951 extern \"C\" {
4952 #endif
4954 /* Prevent the only kind of declaration conflicts we can make. */
4955 #define lt_preloaded_symbols some_other_symbol
4957 /* External symbol declarations for the compiler. */\
4960 if test "$dlself" = yes; then
4961 $show "generating symbol list for \`$output'"
4963 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4965 # Add our own program objects to the symbol list.
4966 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4967 for arg in $progfiles; do
4968 $show "extracting global C symbols from \`$arg'"
4969 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4970 done
4972 if test -n "$exclude_expsyms"; then
4973 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4974 $run eval '$mv "$nlist"T "$nlist"'
4977 if test -n "$export_symbols_regex"; then
4978 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4979 $run eval '$mv "$nlist"T "$nlist"'
4982 # Prepare the list of exported symbols
4983 if test -z "$export_symbols"; then
4984 export_symbols="$output_objdir/$outputname.exp"
4985 $run $rm $export_symbols
4986 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4987 case $host in
4988 *cygwin* | *mingw* )
4989 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4990 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4992 esac
4993 else
4994 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4995 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4996 $run eval 'mv "$nlist"T "$nlist"'
4997 case $host in
4998 *cygwin* | *mingw* )
4999 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
5000 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
5002 esac
5006 for arg in $dlprefiles; do
5007 $show "extracting global C symbols from \`$arg'"
5008 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
5009 $run eval '$echo ": $name " >> "$nlist"'
5010 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
5011 done
5013 if test -z "$run"; then
5014 # Make sure we have at least an empty file.
5015 test -f "$nlist" || : > "$nlist"
5017 if test -n "$exclude_expsyms"; then
5018 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
5019 $mv "$nlist"T "$nlist"
5022 # Try sorting and uniquifying the output.
5023 if grep -v "^: " < "$nlist" |
5024 if sort -k 3 </dev/null >/dev/null 2>&1; then
5025 sort -k 3
5026 else
5027 sort +2
5028 fi |
5029 uniq > "$nlist"S; then
5031 else
5032 grep -v "^: " < "$nlist" > "$nlist"S
5035 if test -f "$nlist"S; then
5036 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5037 else
5038 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5041 $echo >> "$output_objdir/$dlsyms" "\
5043 #undef lt_preloaded_symbols
5045 #if defined (__STDC__) && __STDC__
5046 # define lt_ptr void *
5047 #else
5048 # define lt_ptr char *
5049 # define const
5050 #endif
5052 /* The mapping between symbol names and symbols. */
5055 case $host in
5056 *cygwin* | *mingw* )
5057 $echo >> "$output_objdir/$dlsyms" "\
5058 /* DATA imports from DLLs on WIN32 can't be const, because
5059 runtime relocations are performed -- see ld's documentation
5060 on pseudo-relocs */
5061 struct {
5065 $echo >> "$output_objdir/$dlsyms" "\
5066 const struct {
5069 esac
5072 $echo >> "$output_objdir/$dlsyms" "\
5073 const char *name;
5074 lt_ptr address;
5076 lt_preloaded_symbols[] =
5080 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5082 $echo >> "$output_objdir/$dlsyms" "\
5083 {0, (lt_ptr) 0}
5086 /* This works around a problem in FreeBSD linker */
5087 #ifdef FREEBSD_WORKAROUND
5088 static const void *lt_preloaded_setup() {
5089 return lt_preloaded_symbols;
5091 #endif
5093 #ifdef __cplusplus
5095 #endif\
5099 pic_flag_for_symtable=
5100 case $host in
5101 # compiling the symbol table file with pic_flag works around
5102 # a FreeBSD bug that causes programs to crash when -lm is
5103 # linked before any other PIC object. But we must not use
5104 # pic_flag when linking with -static. The problem exists in
5105 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5106 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5107 case "$compile_command " in
5108 *" -static "*) ;;
5109 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5110 esac;;
5111 *-*-hpux*)
5112 case "$compile_command " in
5113 *" -static "*) ;;
5114 *) pic_flag_for_symtable=" $pic_flag";;
5115 esac
5116 esac
5118 # Now compile the dynamic symbol file.
5119 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5120 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5122 # Clean up the generated files.
5123 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5124 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5126 # Transform the symbol file into the correct name.
5127 case $host in
5128 *cygwin* | *mingw* )
5129 if test -f "$output_objdir/${outputname}.def" ; then
5130 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5131 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5132 else
5133 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5134 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5138 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5139 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5141 esac
5144 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5145 exit $EXIT_FAILURE
5147 esac
5148 else
5149 # We keep going just in case the user didn't refer to
5150 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5151 # really was required.
5153 # Nullify the symbol file.
5154 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
5155 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
5158 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5159 # Replace the output file specification.
5160 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5161 link_command="$compile_command$compile_rpath"
5163 # We have no uninstalled library dependencies, so finalize right now.
5164 $show "$link_command"
5165 $run eval "$link_command"
5166 exit_status=$?
5168 # Delete the generated files.
5169 if test -n "$dlsyms"; then
5170 $show "$rm $output_objdir/${outputname}S.${objext}"
5171 $run $rm "$output_objdir/${outputname}S.${objext}"
5174 exit $exit_status
5177 if test -n "$shlibpath_var"; then
5178 # We should set the shlibpath_var
5179 rpath=
5180 for dir in $temp_rpath; do
5181 case $dir in
5182 [\\/]* | [A-Za-z]:[\\/]*)
5183 # Absolute path.
5184 rpath="$rpath$dir:"
5187 # Relative path: add a thisdir entry.
5188 rpath="$rpath\$thisdir/$dir:"
5190 esac
5191 done
5192 temp_rpath="$rpath"
5195 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5196 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5198 if test -n "$finalize_shlibpath"; then
5199 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5202 compile_var=
5203 finalize_var=
5204 if test -n "$runpath_var"; then
5205 if test -n "$perm_rpath"; then
5206 # We should set the runpath_var.
5207 rpath=
5208 for dir in $perm_rpath; do
5209 rpath="$rpath$dir:"
5210 done
5211 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5213 if test -n "$finalize_perm_rpath"; then
5214 # We should set the runpath_var.
5215 rpath=
5216 for dir in $finalize_perm_rpath; do
5217 rpath="$rpath$dir:"
5218 done
5219 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5223 if test "$no_install" = yes; then
5224 # We don't need to create a wrapper script.
5225 link_command="$compile_var$compile_command$compile_rpath"
5226 # Replace the output file specification.
5227 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5228 # Delete the old output file.
5229 $run $rm $output
5230 # Link the executable and exit
5231 $show "$link_command"
5232 $run eval "$link_command" || exit $?
5233 exit $EXIT_SUCCESS
5236 if test "$hardcode_action" = relink; then
5237 # Fast installation is not supported
5238 link_command="$compile_var$compile_command$compile_rpath"
5239 relink_command="$finalize_var$finalize_command$finalize_rpath"
5241 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5242 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5243 else
5244 if test "$fast_install" != no; then
5245 link_command="$finalize_var$compile_command$finalize_rpath"
5246 if test "$fast_install" = yes; then
5247 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
5248 else
5249 # fast_install is set to needless
5250 relink_command=
5252 else
5253 link_command="$compile_var$compile_command$compile_rpath"
5254 relink_command="$finalize_var$finalize_command$finalize_rpath"
5258 # Replace the output file specification.
5259 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5261 # Delete the old output files.
5262 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5264 $show "$link_command"
5265 $run eval "$link_command" || exit $?
5267 # Now create the wrapper script.
5268 $show "creating $output"
5270 # Quote the relink command for shipping.
5271 if test -n "$relink_command"; then
5272 # Preserve any variables that may affect compiler behavior
5273 for var in $variables_saved_for_relink; do
5274 if eval test -z \"\${$var+set}\"; then
5275 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5276 elif eval var_value=\$$var; test -z "$var_value"; then
5277 relink_command="$var=; export $var; $relink_command"
5278 else
5279 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5280 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5282 done
5283 relink_command="(cd `pwd`; $relink_command)"
5284 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5287 # Quote $echo for shipping.
5288 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5289 case $progpath in
5290 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5291 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5292 esac
5293 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5294 else
5295 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5298 # Only actually do things if our run command is non-null.
5299 if test -z "$run"; then
5300 # win32 will think the script is a binary if it has
5301 # a .exe suffix, so we strip it off here.
5302 case $output in
5303 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5304 esac
5305 # test for cygwin because mv fails w/o .exe extensions
5306 case $host in
5307 *cygwin*)
5308 exeext=.exe
5309 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5310 *) exeext= ;;
5311 esac
5312 case $host in
5313 *cygwin* | *mingw* )
5314 output_name=`basename $output`
5315 output_path=`dirname $output`
5316 cwrappersource="$output_path/$objdir/lt-$output_name.c"
5317 cwrapper="$output_path/$output_name.exe"
5318 $rm $cwrappersource $cwrapper
5319 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5321 cat > $cwrappersource <<EOF
5323 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5324 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5326 The $output program cannot be directly executed until all the libtool
5327 libraries that it depends on are installed.
5329 This wrapper executable should never be moved out of the build directory.
5330 If it is, it will not operate correctly.
5332 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5333 but could eventually absorb all of the scripts functionality and
5334 exec $objdir/$outputname directly.
5337 cat >> $cwrappersource<<"EOF"
5338 #include <stdio.h>
5339 #include <stdlib.h>
5340 #include <unistd.h>
5341 #include <malloc.h>
5342 #include <stdarg.h>
5343 #include <assert.h>
5344 #include <string.h>
5345 #include <ctype.h>
5346 #include <sys/stat.h>
5348 #if defined(PATH_MAX)
5349 # define LT_PATHMAX PATH_MAX
5350 #elif defined(MAXPATHLEN)
5351 # define LT_PATHMAX MAXPATHLEN
5352 #else
5353 # define LT_PATHMAX 1024
5354 #endif
5356 #ifndef DIR_SEPARATOR
5357 # define DIR_SEPARATOR '/'
5358 # define PATH_SEPARATOR ':'
5359 #endif
5361 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5362 defined (__OS2__)
5363 # define HAVE_DOS_BASED_FILE_SYSTEM
5364 # ifndef DIR_SEPARATOR_2
5365 # define DIR_SEPARATOR_2 '\\'
5366 # endif
5367 # ifndef PATH_SEPARATOR_2
5368 # define PATH_SEPARATOR_2 ';'
5369 # endif
5370 #endif
5372 #ifndef DIR_SEPARATOR_2
5373 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5374 #else /* DIR_SEPARATOR_2 */
5375 # define IS_DIR_SEPARATOR(ch) \
5376 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5377 #endif /* DIR_SEPARATOR_2 */
5379 #ifndef PATH_SEPARATOR_2
5380 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5381 #else /* PATH_SEPARATOR_2 */
5382 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5383 #endif /* PATH_SEPARATOR_2 */
5385 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5386 #define XFREE(stale) do { \
5387 if (stale) { free ((void *) stale); stale = 0; } \
5388 } while (0)
5390 /* -DDEBUG is fairly common in CFLAGS. */
5391 #undef DEBUG
5392 #if defined DEBUGWRAPPER
5393 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5394 #else
5395 # define DEBUG(format, ...)
5396 #endif
5398 const char *program_name = NULL;
5400 void * xmalloc (size_t num);
5401 char * xstrdup (const char *string);
5402 const char * base_name (const char *name);
5403 char * find_executable(const char *wrapper);
5404 int check_executable(const char *path);
5405 char * strendzap(char *str, const char *pat);
5406 void lt_fatal (const char *message, ...);
5409 main (int argc, char *argv[])
5411 char **newargz;
5412 int i;
5414 program_name = (char *) xstrdup (base_name (argv[0]));
5415 DEBUG("(main) argv[0] : %s\n",argv[0]);
5416 DEBUG("(main) program_name : %s\n",program_name);
5417 newargz = XMALLOC(char *, argc+2);
5420 cat >> $cwrappersource <<EOF
5421 newargz[0] = (char *) xstrdup("$SHELL");
5424 cat >> $cwrappersource <<"EOF"
5425 newargz[1] = find_executable(argv[0]);
5426 if (newargz[1] == NULL)
5427 lt_fatal("Couldn't find %s", argv[0]);
5428 DEBUG("(main) found exe at : %s\n",newargz[1]);
5429 /* we know the script has the same name, without the .exe */
5430 /* so make sure newargz[1] doesn't end in .exe */
5431 strendzap(newargz[1],".exe");
5432 for (i = 1; i < argc; i++)
5433 newargz[i+1] = xstrdup(argv[i]);
5434 newargz[argc+1] = NULL;
5436 for (i=0; i<argc+1; i++)
5438 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5444 case $host_os in
5445 mingw*)
5446 cat >> $cwrappersource <<EOF
5447 execv("$SHELL",(char const **)newargz);
5451 cat >> $cwrappersource <<EOF
5452 execv("$SHELL",newargz);
5455 esac
5457 cat >> $cwrappersource <<"EOF"
5458 return 127;
5461 void *
5462 xmalloc (size_t num)
5464 void * p = (void *) malloc (num);
5465 if (!p)
5466 lt_fatal ("Memory exhausted");
5468 return p;
5471 char *
5472 xstrdup (const char *string)
5474 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5478 const char *
5479 base_name (const char *name)
5481 const char *base;
5483 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5484 /* Skip over the disk name in MSDOS pathnames. */
5485 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5486 name += 2;
5487 #endif
5489 for (base = name; *name; name++)
5490 if (IS_DIR_SEPARATOR (*name))
5491 base = name + 1;
5492 return base;
5496 check_executable(const char * path)
5498 struct stat st;
5500 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5501 if ((!path) || (!*path))
5502 return 0;
5504 if ((stat (path, &st) >= 0) &&
5506 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5507 #if defined (S_IXOTH)
5508 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5509 #endif
5510 #if defined (S_IXGRP)
5511 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5512 #endif
5513 ((st.st_mode & S_IXUSR) == S_IXUSR))
5515 return 1;
5516 else
5517 return 0;
5520 /* Searches for the full path of the wrapper. Returns
5521 newly allocated full path name if found, NULL otherwise */
5522 char *
5523 find_executable (const char* wrapper)
5525 int has_slash = 0;
5526 const char* p;
5527 const char* p_next;
5528 /* static buffer for getcwd */
5529 char tmp[LT_PATHMAX + 1];
5530 int tmp_len;
5531 char* concat_name;
5533 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5535 if ((wrapper == NULL) || (*wrapper == '\0'))
5536 return NULL;
5538 /* Absolute path? */
5539 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5540 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5542 concat_name = xstrdup (wrapper);
5543 if (check_executable(concat_name))
5544 return concat_name;
5545 XFREE(concat_name);
5547 else
5549 #endif
5550 if (IS_DIR_SEPARATOR (wrapper[0]))
5552 concat_name = xstrdup (wrapper);
5553 if (check_executable(concat_name))
5554 return concat_name;
5555 XFREE(concat_name);
5557 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5559 #endif
5561 for (p = wrapper; *p; p++)
5562 if (*p == '/')
5564 has_slash = 1;
5565 break;
5567 if (!has_slash)
5569 /* no slashes; search PATH */
5570 const char* path = getenv ("PATH");
5571 if (path != NULL)
5573 for (p = path; *p; p = p_next)
5575 const char* q;
5576 size_t p_len;
5577 for (q = p; *q; q++)
5578 if (IS_PATH_SEPARATOR(*q))
5579 break;
5580 p_len = q - p;
5581 p_next = (*q == '\0' ? q : q + 1);
5582 if (p_len == 0)
5584 /* empty path: current directory */
5585 if (getcwd (tmp, LT_PATHMAX) == NULL)
5586 lt_fatal ("getcwd failed");
5587 tmp_len = strlen(tmp);
5588 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5589 memcpy (concat_name, tmp, tmp_len);
5590 concat_name[tmp_len] = '/';
5591 strcpy (concat_name + tmp_len + 1, wrapper);
5593 else
5595 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5596 memcpy (concat_name, p, p_len);
5597 concat_name[p_len] = '/';
5598 strcpy (concat_name + p_len + 1, wrapper);
5600 if (check_executable(concat_name))
5601 return concat_name;
5602 XFREE(concat_name);
5605 /* not found in PATH; assume curdir */
5607 /* Relative path | not found in path: prepend cwd */
5608 if (getcwd (tmp, LT_PATHMAX) == NULL)
5609 lt_fatal ("getcwd failed");
5610 tmp_len = strlen(tmp);
5611 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5612 memcpy (concat_name, tmp, tmp_len);
5613 concat_name[tmp_len] = '/';
5614 strcpy (concat_name + tmp_len + 1, wrapper);
5616 if (check_executable(concat_name))
5617 return concat_name;
5618 XFREE(concat_name);
5619 return NULL;
5622 char *
5623 strendzap(char *str, const char *pat)
5625 size_t len, patlen;
5627 assert(str != NULL);
5628 assert(pat != NULL);
5630 len = strlen(str);
5631 patlen = strlen(pat);
5633 if (patlen <= len)
5635 str += len - patlen;
5636 if (strcmp(str, pat) == 0)
5637 *str = '\0';
5639 return str;
5642 static void
5643 lt_error_core (int exit_status, const char * mode,
5644 const char * message, va_list ap)
5646 fprintf (stderr, "%s: %s: ", program_name, mode);
5647 vfprintf (stderr, message, ap);
5648 fprintf (stderr, ".\n");
5650 if (exit_status >= 0)
5651 exit (exit_status);
5654 void
5655 lt_fatal (const char *message, ...)
5657 va_list ap;
5658 va_start (ap, message);
5659 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5660 va_end (ap);
5663 # we should really use a build-platform specific compiler
5664 # here, but OTOH, the wrappers (shell script and this C one)
5665 # are only useful if you want to execute the "real" binary.
5666 # Since the "real" binary is built for $host, then this
5667 # wrapper might as well be built for $host, too.
5668 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5670 esac
5671 $rm $output
5672 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5674 $echo > $output "\
5675 #! $SHELL
5677 # $output - temporary wrapper script for $objdir/$outputname
5678 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5680 # The $output program cannot be directly executed until all the libtool
5681 # libraries that it depends on are installed.
5683 # This wrapper script should never be moved out of the build directory.
5684 # If it is, it will not operate correctly.
5686 # Sed substitution that helps us do robust quoting. It backslashifies
5687 # metacharacters that are still active within double-quoted strings.
5688 Xsed='${SED} -e 1s/^X//'
5689 sed_quote_subst='$sed_quote_subst'
5691 # The HP-UX ksh and POSIX shell print the target directory to stdout
5692 # if CDPATH is set.
5693 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5695 relink_command=\"$relink_command\"
5697 # This environment variable determines our operation mode.
5698 if test \"\$libtool_install_magic\" = \"$magic\"; then
5699 # install mode needs the following variable:
5700 notinst_deplibs='$notinst_deplibs'
5701 else
5702 # When we are sourced in execute mode, \$file and \$echo are already set.
5703 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5704 echo=\"$qecho\"
5705 file=\"\$0\"
5706 # Make sure echo works.
5707 if test \"X\$1\" = X--no-reexec; then
5708 # Discard the --no-reexec flag, and continue.
5709 shift
5710 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5711 # Yippee, \$echo works!
5713 else
5714 # Restart under the correct shell, and then maybe \$echo will work.
5715 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5719 $echo >> $output "\
5721 # Find the directory that this script lives in.
5722 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5723 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5725 # Follow symbolic links until we get to the real thisdir.
5726 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5727 while test -n \"\$file\"; do
5728 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5730 # If there was a directory component, then change thisdir.
5731 if test \"x\$destdir\" != \"x\$file\"; then
5732 case \"\$destdir\" in
5733 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5734 *) thisdir=\"\$thisdir/\$destdir\" ;;
5735 esac
5738 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5739 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5740 done
5742 # Try to get the absolute directory name.
5743 absdir=\`cd \"\$thisdir\" && pwd\`
5744 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5747 if test "$fast_install" = yes; then
5748 $echo >> $output "\
5749 program=lt-'$outputname'$exeext
5750 progdir=\"\$thisdir/$objdir\"
5752 if test ! -f \"\$progdir/\$program\" || \\
5753 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5754 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5756 file=\"\$\$-\$program\"
5758 if test ! -d \"\$progdir\"; then
5759 $mkdir \"\$progdir\"
5760 else
5761 $rm \"\$progdir/\$file\"
5764 $echo >> $output "\
5766 # relink executable if necessary
5767 if test -n \"\$relink_command\"; then
5768 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5769 else
5770 $echo \"\$relink_command_output\" >&2
5771 $rm \"\$progdir/\$file\"
5772 exit $EXIT_FAILURE
5776 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5777 { $rm \"\$progdir/\$program\";
5778 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5779 $rm \"\$progdir/\$file\"
5781 else
5782 $echo >> $output "\
5783 program='$outputname'
5784 progdir=\"\$thisdir/$objdir\"
5788 $echo >> $output "\
5790 if test -f \"\$progdir/\$program\"; then"
5792 # Export our shlibpath_var if we have one.
5793 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5794 $echo >> $output "\
5795 # Add our own library path to $shlibpath_var
5796 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5798 # Some systems cannot cope with colon-terminated $shlibpath_var
5799 # The second colon is a workaround for a bug in BeOS R4 sed
5800 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5802 export $shlibpath_var
5806 # fixup the dll searchpath if we need to.
5807 if test -n "$dllsearchpath"; then
5808 $echo >> $output "\
5809 # Add the dll search path components to the executable PATH
5810 PATH=$dllsearchpath:\$PATH
5814 $echo >> $output "\
5815 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5816 # Run the actual program with our arguments.
5818 # Make sure env LD_LIBRARY_PATH does not mess us up
5819 if test -n \"\${LD_LIBRARY_PATH+set}\"; then
5820 export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
5823 case $host in
5824 # Backslashes separate directories on plain windows
5825 *-*-mingw | *-*-os2*)
5826 $echo >> $output "\
5827 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5832 $echo >> $output "\
5833 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5836 esac
5837 $echo >> $output "\
5838 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5839 exit $EXIT_FAILURE
5841 else
5842 # The program doesn't exist.
5843 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5844 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5845 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5846 exit $EXIT_FAILURE
5850 chmod +x $output
5852 exit $EXIT_SUCCESS
5854 esac
5856 # See if we need to build an old-fashioned archive.
5857 for oldlib in $oldlibs; do
5859 if test "$build_libtool_libs" = convenience; then
5860 oldobjs="$libobjs_save"
5861 addlibs="$convenience"
5862 build_libtool_libs=no
5863 else
5864 if test "$build_libtool_libs" = module; then
5865 oldobjs="$libobjs_save"
5866 build_libtool_libs=no
5867 else
5868 oldobjs="$old_deplibs $non_pic_objects"
5870 addlibs="$old_convenience"
5873 if test -n "$addlibs"; then
5874 gentop="$output_objdir/${outputname}x"
5875 generated="$generated $gentop"
5877 func_extract_archives $gentop $addlibs
5878 oldobjs="$oldobjs $func_extract_archives_result"
5881 # Do each command in the archive commands.
5882 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5883 cmds=$old_archive_from_new_cmds
5884 else
5885 # POSIX demands no paths to be encoded in archives. We have
5886 # to avoid creating archives with duplicate basenames if we
5887 # might have to extract them afterwards, e.g., when creating a
5888 # static archive out of a convenience library, or when linking
5889 # the entirety of a libtool archive into another (currently
5890 # not supported by libtool).
5891 if (for obj in $oldobjs
5893 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5894 done | sort | sort -uc >/dev/null 2>&1); then
5896 else
5897 $echo "copying selected object files to avoid basename conflicts..."
5899 if test -z "$gentop"; then
5900 gentop="$output_objdir/${outputname}x"
5901 generated="$generated $gentop"
5903 $show "${rm}r $gentop"
5904 $run ${rm}r "$gentop"
5905 $show "$mkdir $gentop"
5906 $run $mkdir "$gentop"
5907 exit_status=$?
5908 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5909 exit $exit_status
5913 save_oldobjs=$oldobjs
5914 oldobjs=
5915 counter=1
5916 for obj in $save_oldobjs
5918 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5919 case " $oldobjs " in
5920 " ") oldobjs=$obj ;;
5921 *[\ /]"$objbase "*)
5922 while :; do
5923 # Make sure we don't pick an alternate name that also
5924 # overlaps.
5925 newobj=lt$counter-$objbase
5926 counter=`expr $counter + 1`
5927 case " $oldobjs " in
5928 *[\ /]"$newobj "*) ;;
5929 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5930 esac
5931 done
5932 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5933 $run ln "$obj" "$gentop/$newobj" ||
5934 $run cp "$obj" "$gentop/$newobj"
5935 oldobjs="$oldobjs $gentop/$newobj"
5937 *) oldobjs="$oldobjs $obj" ;;
5938 esac
5939 done
5942 eval cmds=\"$old_archive_cmds\"
5944 if len=`expr "X$cmds" : ".*"` &&
5945 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5946 cmds=$old_archive_cmds
5947 else
5948 # the command line is too long to link in one step, link in parts
5949 $echo "using piecewise archive linking..."
5950 save_RANLIB=$RANLIB
5951 RANLIB=:
5952 objlist=
5953 concat_cmds=
5954 save_oldobjs=$oldobjs
5956 # Is there a better way of finding the last object in the list?
5957 for obj in $save_oldobjs
5959 last_oldobj=$obj
5960 done
5961 for obj in $save_oldobjs
5963 oldobjs="$objlist $obj"
5964 objlist="$objlist $obj"
5965 eval test_cmds=\"$old_archive_cmds\"
5966 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5967 test "$len" -le "$max_cmd_len"; then
5969 else
5970 # the above command should be used before it gets too long
5971 oldobjs=$objlist
5972 if test "$obj" = "$last_oldobj" ; then
5973 RANLIB=$save_RANLIB
5975 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5976 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5977 objlist=
5979 done
5980 RANLIB=$save_RANLIB
5981 oldobjs=$objlist
5982 if test "X$oldobjs" = "X" ; then
5983 eval cmds=\"\$concat_cmds\"
5984 else
5985 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5989 save_ifs="$IFS"; IFS='~'
5990 for cmd in $cmds; do
5991 eval cmd=\"$cmd\"
5992 IFS="$save_ifs"
5993 $show "$cmd"
5994 $run eval "$cmd" || exit $?
5995 done
5996 IFS="$save_ifs"
5997 done
5999 if test -n "$generated"; then
6000 $show "${rm}r$generated"
6001 $run ${rm}r$generated
6004 # Now create the libtool archive.
6005 case $output in
6006 *.la)
6007 old_library=
6008 test "$build_old_libs" = yes && old_library="$libname.$libext"
6009 $show "creating $output"
6011 # Preserve any variables that may affect compiler behavior
6012 for var in $variables_saved_for_relink; do
6013 if eval test -z \"\${$var+set}\"; then
6014 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
6015 elif eval var_value=\$$var; test -z "$var_value"; then
6016 relink_command="$var=; export $var; $relink_command"
6017 else
6018 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
6019 relink_command="$var=\"$var_value\"; export $var; $relink_command"
6021 done
6022 # Quote the link command for shipping.
6023 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6024 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
6025 if test "$hardcode_automatic" = yes ; then
6026 relink_command=
6030 # Only create the output if not a dry run.
6031 if test -z "$run"; then
6032 for installed in no yes; do
6033 if test "$installed" = yes; then
6034 if test -z "$install_libdir"; then
6035 break
6037 output="$output_objdir/$outputname"i
6038 # Replace all uninstalled libtool libraries with the installed ones
6039 newdependency_libs=
6040 for deplib in $dependency_libs; do
6041 case $deplib in
6042 *.la)
6043 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
6044 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6045 if test -z "$libdir"; then
6046 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6047 exit $EXIT_FAILURE
6049 if test "X$EGREP" = X ; then
6050 EGREP=egrep
6052 # We do not want portage's install root ($D) present. Check only for
6053 # this if the .la is being installed.
6054 if test "$installed" = yes && test "$D"; then
6055 eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6056 else
6057 mynewdependency_lib="$libdir/$name"
6059 # Do not add duplicates
6060 if test "$mynewdependency_lib"; then
6061 my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6062 if test -z "$my_little_ninja_foo_1"; then
6063 newdependency_libs="$newdependency_libs $mynewdependency_lib"
6068 if test "$installed" = yes; then
6069 # Rather use S=WORKDIR if our version of portage supports it.
6070 # This is because some ebuild (gcc) do not use $S as buildroot.
6071 if test "$PWORKDIR"; then
6072 S="$PWORKDIR"
6074 # We do not want portage's build root ($S) present.
6075 my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
6076 # We do not want portage's install root ($D) present.
6077 my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
6078 if test -n "$my_little_ninja_foo_2" && test "$S"; then
6079 mynewdependency_lib=""
6080 elif test -n "$my_little_ninja_foo_3" && test "$D"; then
6081 eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6082 else
6083 mynewdependency_lib="$deplib"
6085 else
6086 mynewdependency_lib="$deplib"
6088 # Do not add duplicates
6089 if test "$mynewdependency_lib"; then
6090 my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6091 if test -z "$my_little_ninja_foo_4"; then
6092 newdependency_libs="$newdependency_libs $mynewdependency_lib"
6096 esac
6097 done
6098 dependency_libs="$newdependency_libs"
6099 newdlfiles=
6100 for lib in $dlfiles; do
6101 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6102 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6103 if test -z "$libdir"; then
6104 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6105 exit $EXIT_FAILURE
6107 newdlfiles="$newdlfiles $libdir/$name"
6108 done
6109 dlfiles="$newdlfiles"
6110 newdlprefiles=
6111 for lib in $dlprefiles; do
6112 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6113 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6114 if test -z "$libdir"; then
6115 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6116 exit $EXIT_FAILURE
6118 newdlprefiles="$newdlprefiles $libdir/$name"
6119 done
6120 dlprefiles="$newdlprefiles"
6121 else
6122 newdlfiles=
6123 for lib in $dlfiles; do
6124 case $lib in
6125 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6126 *) abs=`pwd`"/$lib" ;;
6127 esac
6128 newdlfiles="$newdlfiles $abs"
6129 done
6130 dlfiles="$newdlfiles"
6131 newdlprefiles=
6132 for lib in $dlprefiles; do
6133 case $lib in
6134 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6135 *) abs=`pwd`"/$lib" ;;
6136 esac
6137 newdlprefiles="$newdlprefiles $abs"
6138 done
6139 dlprefiles="$newdlprefiles"
6141 $rm $output
6142 # place dlname in correct position for cygwin
6143 tdlname=$dlname
6144 case $host,$output,$installed,$module,$dlname in
6145 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6146 esac
6147 # Do not add duplicates
6148 if test "$installed" = yes && test "$D"; then
6149 install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6151 $echo > $output "\
6152 # $outputname - a libtool library file
6153 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6155 # Please DO NOT delete this file!
6156 # It is necessary for linking the library.
6158 # The name that we can dlopen(3).
6159 dlname='$tdlname'
6161 # Names of this library.
6162 library_names='$library_names'
6164 # The name of the static archive.
6165 old_library='$old_library'
6167 # Libraries that this one depends upon.
6168 dependency_libs='$dependency_libs'
6170 # Version information for $libname.
6171 current=$current
6172 age=$age
6173 revision=$revision
6175 # Is this an already installed library?
6176 installed=$installed
6178 # Should we warn about portability when linking against -modules?
6179 shouldnotlink=$module
6181 # Files to dlopen/dlpreopen
6182 dlopen='$dlfiles'
6183 dlpreopen='$dlprefiles'
6185 # Directory that this library needs to be installed in:
6186 libdir='$install_libdir'"
6187 if test "$installed" = no && test "$need_relink" = yes; then
6188 $echo >> $output "\
6189 relink_command=\"$relink_command\""
6191 done
6194 # Do a symbolic link so that the libtool archive can be found in
6195 # LD_LIBRARY_PATH before the program is installed.
6196 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6197 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6199 esac
6200 exit $EXIT_SUCCESS
6203 # libtool install mode
6204 install)
6205 modename="$modename: install"
6207 # There may be an optional sh(1) argument at the beginning of
6208 # install_prog (especially on Windows NT).
6209 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6210 # Allow the use of GNU shtool's install command.
6211 $echo "X$nonopt" | grep shtool > /dev/null; then
6212 # Aesthetically quote it.
6213 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6214 case $arg in
6215 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6216 arg="\"$arg\""
6218 esac
6219 install_prog="$arg "
6220 arg="$1"
6221 shift
6222 else
6223 install_prog=
6224 arg=$nonopt
6227 # The real first argument should be the name of the installation program.
6228 # Aesthetically quote it.
6229 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6230 case $arg in
6231 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6232 arg="\"$arg\""
6234 esac
6235 install_prog="$install_prog$arg"
6237 # We need to accept at least all the BSD install flags.
6238 dest=
6239 files=
6240 opts=
6241 prev=
6242 install_type=
6243 isdir=no
6244 stripme=
6245 for arg
6247 if test -n "$dest"; then
6248 files="$files $dest"
6249 dest=$arg
6250 continue
6253 case $arg in
6254 -d) isdir=yes ;;
6255 -f)
6256 case " $install_prog " in
6257 *[\\\ /]cp\ *) ;;
6258 *) prev=$arg ;;
6259 esac
6261 -g | -m | -o) prev=$arg ;;
6263 stripme=" -s"
6264 continue
6269 # If the previous option needed an argument, then skip it.
6270 if test -n "$prev"; then
6271 prev=
6272 else
6273 dest=$arg
6274 continue
6277 esac
6279 # Aesthetically quote the argument.
6280 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6281 case $arg in
6282 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6283 arg="\"$arg\""
6285 esac
6286 install_prog="$install_prog $arg"
6287 done
6289 if test -z "$install_prog"; then
6290 $echo "$modename: you must specify an install program" 1>&2
6291 $echo "$help" 1>&2
6292 exit $EXIT_FAILURE
6295 if test -n "$prev"; then
6296 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6297 $echo "$help" 1>&2
6298 exit $EXIT_FAILURE
6301 if test -z "$files"; then
6302 if test -z "$dest"; then
6303 $echo "$modename: no file or destination specified" 1>&2
6304 else
6305 $echo "$modename: you must specify a destination" 1>&2
6307 $echo "$help" 1>&2
6308 exit $EXIT_FAILURE
6311 # Strip any trailing slash from the destination.
6312 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6314 # Check to see that the destination is a directory.
6315 test -d "$dest" && isdir=yes
6316 if test "$isdir" = yes; then
6317 destdir="$dest"
6318 destname=
6319 else
6320 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6321 test "X$destdir" = "X$dest" && destdir=.
6322 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6324 # Not a directory, so check to see that there is only one file specified.
6325 set dummy $files
6326 if test "$#" -gt 2; then
6327 $echo "$modename: \`$dest' is not a directory" 1>&2
6328 $echo "$help" 1>&2
6329 exit $EXIT_FAILURE
6332 case $destdir in
6333 [\\/]* | [A-Za-z]:[\\/]*) ;;
6335 for file in $files; do
6336 case $file in
6337 *.lo) ;;
6339 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6340 $echo "$help" 1>&2
6341 exit $EXIT_FAILURE
6343 esac
6344 done
6346 esac
6348 # This variable tells wrapper scripts just to set variables rather
6349 # than running their programs.
6350 libtool_install_magic="$magic"
6352 staticlibs=
6353 future_libdirs=
6354 current_libdirs=
6355 for file in $files; do
6357 # Do each installation.
6358 case $file in
6359 *.$libext)
6360 # Do the static libraries later.
6361 staticlibs="$staticlibs $file"
6364 *.la)
6365 # Check to see that this really is a libtool archive.
6366 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6367 else
6368 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6369 $echo "$help" 1>&2
6370 exit $EXIT_FAILURE
6373 library_names=
6374 old_library=
6375 relink_command=
6376 # If there is no directory component, then add one.
6377 case $file in
6378 */* | *\\*) . $file ;;
6379 *) . ./$file ;;
6380 esac
6382 # Add the libdir to current_libdirs if it is the destination.
6383 if test "X$destdir" = "X$libdir"; then
6384 case "$current_libdirs " in
6385 *" $libdir "*) ;;
6386 *) current_libdirs="$current_libdirs $libdir" ;;
6387 esac
6388 else
6389 # Note the libdir as a future libdir.
6390 case "$future_libdirs " in
6391 *" $libdir "*) ;;
6392 *) future_libdirs="$future_libdirs $libdir" ;;
6393 esac
6396 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6397 test "X$dir" = "X$file/" && dir=
6398 dir="$dir$objdir"
6400 if test -n "$relink_command"; then
6401 # Determine the prefix the user has applied to our future dir.
6402 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6404 # Don't allow the user to place us outside of our expected
6405 # location b/c this prevents finding dependent libraries that
6406 # are installed to the same prefix.
6407 # At present, this check doesn't affect windows .dll's that
6408 # are installed into $libdir/../bin (currently, that works fine)
6409 # but it's something to keep an eye on.
6410 if test "$inst_prefix_dir" = "$destdir"; then
6411 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6412 exit $EXIT_FAILURE
6415 if test -n "$inst_prefix_dir"; then
6416 # Stick the inst_prefix_dir data into the link command.
6417 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
6418 else
6419 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
6422 $echo "$modename: warning: relinking \`$file'" 1>&2
6423 $show "$relink_command"
6424 if $run eval "$relink_command"; then :
6425 else
6426 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6427 exit $EXIT_FAILURE
6431 # See the names of the shared library.
6432 set dummy $library_names
6433 if test -n "$2"; then
6434 realname="$2"
6435 shift
6436 shift
6438 srcname="$realname"
6439 test -n "$relink_command" && srcname="$realname"T
6441 # Install the shared library and build the symlinks.
6442 $show "$install_prog $dir/$srcname $destdir/$realname"
6443 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6444 if test -n "$stripme" && test -n "$striplib"; then
6445 $show "$striplib $destdir/$realname"
6446 $run eval "$striplib $destdir/$realname" || exit $?
6449 if test "$#" -gt 0; then
6450 # Delete the old symlinks, and create new ones.
6451 # Try `ln -sf' first, because the `ln' binary might depend on
6452 # the symlink we replace! Solaris /bin/ln does not understand -f,
6453 # so we also need to try rm && ln -s.
6454 for linkname
6456 if test "$linkname" != "$realname"; then
6457 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6458 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6460 done
6463 # Do each command in the postinstall commands.
6464 lib="$destdir/$realname"
6465 cmds=$postinstall_cmds
6466 save_ifs="$IFS"; IFS='~'
6467 for cmd in $cmds; do
6468 IFS="$save_ifs"
6469 eval cmd=\"$cmd\"
6470 $show "$cmd"
6471 $run eval "$cmd" || {
6472 lt_exit=$?
6474 # Restore the uninstalled library and exit
6475 if test "$mode" = relink; then
6476 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6479 exit $lt_exit
6481 done
6482 IFS="$save_ifs"
6485 # Install the pseudo-library for information purposes.
6486 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6487 instname="$dir/$name"i
6488 $show "$install_prog $instname $destdir/$name"
6489 $run eval "$install_prog $instname $destdir/$name" || exit $?
6491 # Maybe install the static library, too.
6492 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6495 *.lo)
6496 # Install (i.e. copy) a libtool object.
6498 # Figure out destination file name, if it wasn't already specified.
6499 if test -n "$destname"; then
6500 destfile="$destdir/$destname"
6501 else
6502 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6503 destfile="$destdir/$destfile"
6506 # Deduce the name of the destination old-style object file.
6507 case $destfile in
6508 *.lo)
6509 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6511 *.$objext)
6512 staticdest="$destfile"
6513 destfile=
6516 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6517 $echo "$help" 1>&2
6518 exit $EXIT_FAILURE
6520 esac
6522 # Install the libtool object if requested.
6523 if test -n "$destfile"; then
6524 $show "$install_prog $file $destfile"
6525 $run eval "$install_prog $file $destfile" || exit $?
6528 # Install the old object if enabled.
6529 if test "$build_old_libs" = yes; then
6530 # Deduce the name of the old-style object file.
6531 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6533 $show "$install_prog $staticobj $staticdest"
6534 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6536 exit $EXIT_SUCCESS
6540 # Figure out destination file name, if it wasn't already specified.
6541 if test -n "$destname"; then
6542 destfile="$destdir/$destname"
6543 else
6544 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6545 destfile="$destdir/$destfile"
6548 # If the file is missing, and there is a .exe on the end, strip it
6549 # because it is most likely a libtool script we actually want to
6550 # install
6551 stripped_ext=""
6552 case $file in
6553 *.exe)
6554 if test ! -f "$file"; then
6555 file=`$echo $file|${SED} 's,.exe$,,'`
6556 stripped_ext=".exe"
6559 esac
6561 # Do a test to see if this is really a libtool program.
6562 case $host in
6563 *cygwin*|*mingw*)
6564 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6567 wrapper=$file
6569 esac
6570 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6571 notinst_deplibs=
6572 relink_command=
6574 # Note that it is not necessary on cygwin/mingw to append a dot to
6575 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6576 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6577 # `FILE.' does not work on cygwin managed mounts.
6579 # If there is no directory component, then add one.
6580 case $wrapper in
6581 */* | *\\*) . ${wrapper} ;;
6582 *) . ./${wrapper} ;;
6583 esac
6585 # Check the variables that should have been set.
6586 if test -z "$notinst_deplibs"; then
6587 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6588 exit $EXIT_FAILURE
6591 finalize=yes
6592 for lib in $notinst_deplibs; do
6593 # Check to see that each library is installed.
6594 libdir=
6595 if test -f "$lib"; then
6596 # If there is no directory component, then add one.
6597 case $lib in
6598 */* | *\\*) . $lib ;;
6599 *) . ./$lib ;;
6600 esac
6602 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6603 if test -n "$libdir" && test ! -f "$libfile"; then
6604 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6605 finalize=no
6607 done
6609 relink_command=
6610 # Note that it is not necessary on cygwin/mingw to append a dot to
6611 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6612 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6613 # `FILE.' does not work on cygwin managed mounts.
6615 # If there is no directory component, then add one.
6616 case $wrapper in
6617 */* | *\\*) . ${wrapper} ;;
6618 *) . ./${wrapper} ;;
6619 esac
6621 outputname=
6622 if test "$fast_install" = no && test -n "$relink_command"; then
6623 if test "$finalize" = yes && test -z "$run"; then
6624 tmpdir=`func_mktempdir`
6625 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6626 outputname="$tmpdir/$file"
6627 # Replace the output file specification.
6628 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6630 $show "$relink_command"
6631 if $run eval "$relink_command"; then :
6632 else
6633 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6634 ${rm}r "$tmpdir"
6635 continue
6637 file="$outputname"
6638 else
6639 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6641 else
6642 # Install the binary that we compiled earlier.
6643 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6647 # remove .exe since cygwin /usr/bin/install will append another
6648 # one anyway
6649 case $install_prog,$host in
6650 */usr/bin/install*,*cygwin*)
6651 case $file:$destfile in
6652 *.exe:*.exe)
6653 # this is ok
6655 *.exe:*)
6656 destfile=$destfile.exe
6658 *:*.exe)
6659 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6661 esac
6663 esac
6664 $show "$install_prog$stripme $file $destfile"
6665 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6666 test -n "$outputname" && ${rm}r "$tmpdir"
6668 esac
6669 done
6671 for file in $staticlibs; do
6672 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6674 # Set up the ranlib parameters.
6675 oldlib="$destdir/$name"
6677 $show "$install_prog $file $oldlib"
6678 $run eval "$install_prog \$file \$oldlib" || exit $?
6680 if test -n "$stripme" && test -n "$old_striplib"; then
6681 $show "$old_striplib $oldlib"
6682 $run eval "$old_striplib $oldlib" || exit $?
6685 # Do each command in the postinstall commands.
6686 cmds=$old_postinstall_cmds
6687 save_ifs="$IFS"; IFS='~'
6688 for cmd in $cmds; do
6689 IFS="$save_ifs"
6690 eval cmd=\"$cmd\"
6691 $show "$cmd"
6692 $run eval "$cmd" || exit $?
6693 done
6694 IFS="$save_ifs"
6695 done
6697 if test -n "$future_libdirs"; then
6698 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6701 if test -n "$current_libdirs"; then
6702 # Maybe just do a dry run.
6703 test -n "$run" && current_libdirs=" -n$current_libdirs"
6704 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6705 else
6706 exit $EXIT_SUCCESS
6710 # libtool finish mode
6711 finish)
6712 modename="$modename: finish"
6713 libdirs="$nonopt"
6714 admincmds=
6716 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6717 for dir
6719 libdirs="$libdirs $dir"
6720 done
6722 for libdir in $libdirs; do
6723 if test -n "$finish_cmds"; then
6724 # Do each command in the finish commands.
6725 cmds=$finish_cmds
6726 save_ifs="$IFS"; IFS='~'
6727 for cmd in $cmds; do
6728 IFS="$save_ifs"
6729 eval cmd=\"$cmd\"
6730 $show "$cmd"
6731 $run eval "$cmd" || admincmds="$admincmds
6732 $cmd"
6733 done
6734 IFS="$save_ifs"
6736 if test -n "$finish_eval"; then
6737 # Do the single finish_eval.
6738 eval cmds=\"$finish_eval\"
6739 $run eval "$cmds" || admincmds="$admincmds
6740 $cmds"
6742 done
6745 # Exit here if they wanted silent mode.
6746 test "$show" = : && exit $EXIT_SUCCESS
6748 $echo "X----------------------------------------------------------------------" | $Xsed
6749 $echo "Libraries have been installed in:"
6750 for libdir in $libdirs; do
6751 $echo " $libdir"
6752 done
6753 $echo
6754 $echo "If you ever happen to want to link against installed libraries"
6755 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6756 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6757 $echo "flag during linking and do at least one of the following:"
6758 if test -n "$shlibpath_var"; then
6759 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6760 $echo " during execution"
6762 if test -n "$runpath_var"; then
6763 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6764 $echo " during linking"
6766 if test -n "$hardcode_libdir_flag_spec"; then
6767 libdir=LIBDIR
6768 eval flag=\"$hardcode_libdir_flag_spec\"
6770 $echo " - use the \`$flag' linker flag"
6772 if test -n "$admincmds"; then
6773 $echo " - have your system administrator run these commands:$admincmds"
6775 if test -f /etc/ld.so.conf; then
6776 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6778 $echo
6779 $echo "See any operating system documentation about shared libraries for"
6780 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6781 $echo "X----------------------------------------------------------------------" | $Xsed
6782 exit $EXIT_SUCCESS
6785 # libtool execute mode
6786 execute)
6787 modename="$modename: execute"
6789 # The first argument is the command name.
6790 cmd="$nonopt"
6791 if test -z "$cmd"; then
6792 $echo "$modename: you must specify a COMMAND" 1>&2
6793 $echo "$help"
6794 exit $EXIT_FAILURE
6797 # Handle -dlopen flags immediately.
6798 for file in $execute_dlfiles; do
6799 if test ! -f "$file"; then
6800 $echo "$modename: \`$file' is not a file" 1>&2
6801 $echo "$help" 1>&2
6802 exit $EXIT_FAILURE
6805 dir=
6806 case $file in
6807 *.la)
6808 # Check to see that this really is a libtool archive.
6809 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6810 else
6811 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6812 $echo "$help" 1>&2
6813 exit $EXIT_FAILURE
6816 # Read the libtool library.
6817 dlname=
6818 library_names=
6820 # If there is no directory component, then add one.
6821 case $file in
6822 */* | *\\*) . $file ;;
6823 *) . ./$file ;;
6824 esac
6826 # Skip this library if it cannot be dlopened.
6827 if test -z "$dlname"; then
6828 # Warn if it was a shared library.
6829 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6830 continue
6833 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6834 test "X$dir" = "X$file" && dir=.
6836 if test -f "$dir/$objdir/$dlname"; then
6837 dir="$dir/$objdir"
6838 else
6839 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6840 exit $EXIT_FAILURE
6844 *.lo)
6845 # Just add the directory containing the .lo file.
6846 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6847 test "X$dir" = "X$file" && dir=.
6851 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6852 continue
6854 esac
6856 # Get the absolute pathname.
6857 absdir=`cd "$dir" && pwd`
6858 test -n "$absdir" && dir="$absdir"
6860 # Now add the directory to shlibpath_var.
6861 if eval "test -z \"\$$shlibpath_var\""; then
6862 eval "$shlibpath_var=\"\$dir\""
6863 else
6864 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6866 done
6868 # This variable tells wrapper scripts just to set shlibpath_var
6869 # rather than running their programs.
6870 libtool_execute_magic="$magic"
6872 # Check if any of the arguments is a wrapper script.
6873 args=
6874 for file
6876 case $file in
6877 -*) ;;
6879 # Do a test to see if this is really a libtool program.
6880 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6881 # If there is no directory component, then add one.
6882 case $file in
6883 */* | *\\*) . $file ;;
6884 *) . ./$file ;;
6885 esac
6887 # Transform arg to wrapped name.
6888 file="$progdir/$program"
6891 esac
6892 # Quote arguments (to preserve shell metacharacters).
6893 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6894 args="$args \"$file\""
6895 done
6897 if test -z "$run"; then
6898 if test -n "$shlibpath_var"; then
6899 # Export the shlibpath_var.
6900 eval "export $shlibpath_var"
6903 # Restore saved environment variables
6904 if test "${save_LC_ALL+set}" = set; then
6905 LC_ALL="$save_LC_ALL"; export LC_ALL
6907 if test "${save_LANG+set}" = set; then
6908 LANG="$save_LANG"; export LANG
6911 # Now prepare to actually exec the command.
6912 exec_cmd="\$cmd$args"
6913 else
6914 # Display what would be done.
6915 if test -n "$shlibpath_var"; then
6916 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6917 $echo "export $shlibpath_var"
6919 $echo "$cmd$args"
6920 exit $EXIT_SUCCESS
6924 # libtool clean and uninstall mode
6925 clean | uninstall)
6926 modename="$modename: $mode"
6927 rm="$nonopt"
6928 files=
6929 rmforce=
6930 exit_status=0
6932 # This variable tells wrapper scripts just to set variables rather
6933 # than running their programs.
6934 libtool_install_magic="$magic"
6936 for arg
6938 case $arg in
6939 -f) rm="$rm $arg"; rmforce=yes ;;
6940 -*) rm="$rm $arg" ;;
6941 *) files="$files $arg" ;;
6942 esac
6943 done
6945 if test -z "$rm"; then
6946 $echo "$modename: you must specify an RM program" 1>&2
6947 $echo "$help" 1>&2
6948 exit $EXIT_FAILURE
6951 rmdirs=
6953 origobjdir="$objdir"
6954 for file in $files; do
6955 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6956 if test "X$dir" = "X$file"; then
6957 dir=.
6958 objdir="$origobjdir"
6959 else
6960 objdir="$dir/$origobjdir"
6962 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6963 test "$mode" = uninstall && objdir="$dir"
6965 # Remember objdir for removal later, being careful to avoid duplicates
6966 if test "$mode" = clean; then
6967 case " $rmdirs " in
6968 *" $objdir "*) ;;
6969 *) rmdirs="$rmdirs $objdir" ;;
6970 esac
6973 # Don't error if the file doesn't exist and rm -f was used.
6974 if (test -L "$file") >/dev/null 2>&1 \
6975 || (test -h "$file") >/dev/null 2>&1 \
6976 || test -f "$file"; then
6978 elif test -d "$file"; then
6979 exit_status=1
6980 continue
6981 elif test "$rmforce" = yes; then
6982 continue
6985 rmfiles="$file"
6987 case $name in
6988 *.la)
6989 # Possibly a libtool archive, so verify it.
6990 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6991 . $dir/$name
6993 # Delete the libtool libraries and symlinks.
6994 for n in $library_names; do
6995 rmfiles="$rmfiles $objdir/$n"
6996 done
6997 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6999 case "$mode" in
7000 clean)
7001 case " $library_names " in
7002 # " " in the beginning catches empty $dlname
7003 *" $dlname "*) ;;
7004 *) rmfiles="$rmfiles $objdir/$dlname" ;;
7005 esac
7006 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
7008 uninstall)
7009 if test -n "$library_names"; then
7010 # Do each command in the postuninstall commands.
7011 cmds=$postuninstall_cmds
7012 save_ifs="$IFS"; IFS='~'
7013 for cmd in $cmds; do
7014 IFS="$save_ifs"
7015 eval cmd=\"$cmd\"
7016 $show "$cmd"
7017 $run eval "$cmd"
7018 if test "$?" -ne 0 && test "$rmforce" != yes; then
7019 exit_status=1
7021 done
7022 IFS="$save_ifs"
7025 if test -n "$old_library"; then
7026 # Do each command in the old_postuninstall commands.
7027 cmds=$old_postuninstall_cmds
7028 save_ifs="$IFS"; IFS='~'
7029 for cmd in $cmds; do
7030 IFS="$save_ifs"
7031 eval cmd=\"$cmd\"
7032 $show "$cmd"
7033 $run eval "$cmd"
7034 if test "$?" -ne 0 && test "$rmforce" != yes; then
7035 exit_status=1
7037 done
7038 IFS="$save_ifs"
7040 # FIXME: should reinstall the best remaining shared library.
7042 esac
7046 *.lo)
7047 # Possibly a libtool object, so verify it.
7048 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7050 # Read the .lo file
7051 . $dir/$name
7053 # Add PIC object to the list of files to remove.
7054 if test -n "$pic_object" \
7055 && test "$pic_object" != none; then
7056 rmfiles="$rmfiles $dir/$pic_object"
7059 # Add non-PIC object to the list of files to remove.
7060 if test -n "$non_pic_object" \
7061 && test "$non_pic_object" != none; then
7062 rmfiles="$rmfiles $dir/$non_pic_object"
7068 if test "$mode" = clean ; then
7069 noexename=$name
7070 case $file in
7071 *.exe)
7072 file=`$echo $file|${SED} 's,.exe$,,'`
7073 noexename=`$echo $name|${SED} 's,.exe$,,'`
7074 # $file with .exe has already been added to rmfiles,
7075 # add $file without .exe
7076 rmfiles="$rmfiles $file"
7078 esac
7079 # Do a test to see if this is a libtool program.
7080 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7081 relink_command=
7082 . $dir/$noexename
7084 # note $name still contains .exe if it was in $file originally
7085 # as does the version of $file that was added into $rmfiles
7086 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7087 if test "$fast_install" = yes && test -n "$relink_command"; then
7088 rmfiles="$rmfiles $objdir/lt-$name"
7090 if test "X$noexename" != "X$name" ; then
7091 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7096 esac
7097 $show "$rm $rmfiles"
7098 $run $rm $rmfiles || exit_status=1
7099 done
7100 objdir="$origobjdir"
7102 # Try to remove the ${objdir}s in the directories where we deleted files
7103 for dir in $rmdirs; do
7104 if test -d "$dir"; then
7105 $show "rmdir $dir"
7106 $run rmdir $dir >/dev/null 2>&1
7108 done
7110 exit $exit_status
7114 $echo "$modename: you must specify a MODE" 1>&2
7115 $echo "$generic_help" 1>&2
7116 exit $EXIT_FAILURE
7118 esac
7120 if test -z "$exec_cmd"; then
7121 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7122 $echo "$generic_help" 1>&2
7123 exit $EXIT_FAILURE
7125 fi # test -z "$show_help"
7127 if test -n "$exec_cmd"; then
7128 eval exec $exec_cmd
7129 exit $EXIT_FAILURE
7132 # We need to display help for each of the modes.
7133 case $mode in
7134 "") $echo \
7135 "Usage: $modename [OPTION]... [MODE-ARG]...
7137 Provide generalized library-building support services.
7139 --config show all configuration variables
7140 --debug enable verbose shell tracing
7141 -n, --dry-run display commands without modifying any files
7142 --features display basic configuration information and exit
7143 --finish same as \`--mode=finish'
7144 --help display this help message and exit
7145 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7146 --quiet same as \`--silent'
7147 --silent don't print informational messages
7148 --tag=TAG use configuration variables from tag TAG
7149 --version print version information
7151 MODE must be one of the following:
7153 clean remove files from the build directory
7154 compile compile a source file into a libtool object
7155 execute automatically set library path, then run a program
7156 finish complete the installation of libtool libraries
7157 install install libraries or executables
7158 link create a library or an executable
7159 uninstall remove libraries from an installed directory
7161 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7162 a more detailed description of MODE.
7164 Report bugs to <bug-libtool@gnu.org>."
7165 exit $EXIT_SUCCESS
7168 clean)
7169 $echo \
7170 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7172 Remove files from the build directory.
7174 RM is the name of the program to use to delete files associated with each FILE
7175 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7176 to RM.
7178 If FILE is a libtool library, object or program, all the files associated
7179 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7182 compile)
7183 $echo \
7184 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7186 Compile a source file into a libtool library object.
7188 This mode accepts the following additional options:
7190 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7191 -prefer-pic try to building PIC objects only
7192 -prefer-non-pic try to building non-PIC objects only
7193 -static always build a \`.o' file suitable for static linking
7195 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7196 from the given SOURCEFILE.
7198 The output file name is determined by removing the directory component from
7199 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7200 library object suffix, \`.lo'."
7203 execute)
7204 $echo \
7205 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7207 Automatically set library path, then run a program.
7209 This mode accepts the following additional options:
7211 -dlopen FILE add the directory containing FILE to the library path
7213 This mode sets the library path environment variable according to \`-dlopen'
7214 flags.
7216 If any of the ARGS are libtool executable wrappers, then they are translated
7217 into their corresponding uninstalled binary, and any of their required library
7218 directories are added to the library path.
7220 Then, COMMAND is executed, with ARGS as arguments."
7223 finish)
7224 $echo \
7225 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7227 Complete the installation of libtool libraries.
7229 Each LIBDIR is a directory that contains libtool libraries.
7231 The commands that this mode executes may require superuser privileges. Use
7232 the \`--dry-run' option if you just want to see what would be executed."
7235 install)
7236 $echo \
7237 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7239 Install executables or libraries.
7241 INSTALL-COMMAND is the installation command. The first component should be
7242 either the \`install' or \`cp' program.
7244 The rest of the components are interpreted as arguments to that command (only
7245 BSD-compatible install options are recognized)."
7248 link)
7249 $echo \
7250 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7252 Link object files or libraries together to form another library, or to
7253 create an executable program.
7255 LINK-COMMAND is a command using the C compiler that you would use to create
7256 a program from several object files.
7258 The following components of LINK-COMMAND are treated specially:
7260 -all-static do not do any dynamic linking at all
7261 -avoid-version do not add a version suffix if possible
7262 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7263 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7264 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7265 -export-symbols SYMFILE
7266 try to export only the symbols listed in SYMFILE
7267 -export-symbols-regex REGEX
7268 try to export only the symbols matching REGEX
7269 -LLIBDIR search LIBDIR for required installed libraries
7270 -lNAME OUTPUT-FILE requires the installed library libNAME
7271 -module build a library that can dlopened
7272 -no-fast-install disable the fast-install mode
7273 -no-install link a not-installable executable
7274 -no-undefined declare that a library does not refer to external symbols
7275 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7276 -objectlist FILE Use a list of object files found in FILE to specify objects
7277 -precious-files-regex REGEX
7278 don't remove output files matching REGEX
7279 -release RELEASE specify package release information
7280 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7281 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7282 -static do not do any dynamic linking of libtool libraries
7283 -version-info CURRENT[:REVISION[:AGE]]
7284 specify library version info [each variable defaults to 0]
7286 All other options (arguments beginning with \`-') are ignored.
7288 Every other argument is treated as a filename. Files ending in \`.la' are
7289 treated as uninstalled libtool libraries, other files are standard or library
7290 object files.
7292 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7293 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7294 required, except when creating a convenience library.
7296 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7297 using \`ar' and \`ranlib', or on Windows using \`lib'.
7299 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7300 is created, otherwise an executable program is created."
7303 uninstall)
7304 $echo \
7305 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7307 Remove libraries from an installation directory.
7309 RM is the name of the program to use to delete files associated with each FILE
7310 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7311 to RM.
7313 If FILE is a libtool library, all the files associated with it are deleted.
7314 Otherwise, only FILE itself is deleted using RM."
7318 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7319 $echo "$help" 1>&2
7320 exit $EXIT_FAILURE
7322 esac
7324 $echo
7325 $echo "Try \`$modename --help' for more information about other modes."
7327 exit $?
7329 # The TAGs below are defined such that we never get into a situation
7330 # in which we disable both kinds of libraries. Given conflicting
7331 # choices, we go for a static library, that is the most portable,
7332 # since we can't tell whether shared libraries were disabled because
7333 # the user asked for that or because the platform doesn't support
7334 # them. This is particularly important on AIX, because we don't
7335 # support having both static and shared libraries enabled at the same
7336 # time on that platform, so we default to a shared-only configuration.
7337 # If a disable-shared tag is given, we'll fallback to a static-only
7338 # configuration. But we'll never go from static-only to shared-only.
7340 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7341 disable_libs=shared
7342 # ### END LIBTOOL TAG CONFIG: disable-shared
7344 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7345 disable_libs=static
7346 # ### END LIBTOOL TAG CONFIG: disable-static
7348 # Local Variables:
7349 # mode:shell-script
7350 # sh-indentation:2
7351 # End: