[patch] ctags_db: Implemented update, add_file and remove_file
[vimicxx.git] / libtool
blob010c4af36b169c33818d35d897b832945957cb0d
1 #! /bin/sh
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU vimicxx 0.1)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
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="/usr/bin/sed"
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/usr/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=" CXX"
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host fireball:
49 # Shell to use when invoking shell scripts.
50 SHELL="/bin/sh"
52 # Whether or not to build shared libraries.
53 build_libtool_libs=yes
55 # Whether or not to build static libraries.
56 build_old_libs=yes
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc=no
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=no
64 # Whether or not to optimize for fast installation.
65 fast_install=yes
67 # The host system.
68 host_alias=
69 host=i686-suse-linux-gnu
70 host_os=linux-gnu
72 # The build system.
73 build_alias=
74 build=i686-suse-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 # LTCC compiler flags.
88 LTCFLAGS="-g -O2"
90 # A language-specific compiler.
91 CC="gcc"
93 # Is the compiler the GNU C compiler?
94 with_gcc=yes
96 # An ERE matcher.
97 EGREP="/usr/bin/grep -E"
99 # The linker used to build libraries.
100 LD="/usr/i586-suse-linux/bin/ld"
102 # Whether we need hard or soft links.
103 LN_S="ln -s"
105 # A BSD-compatible nm program.
106 NM="/usr/bin/nm -B"
108 # A symbol stripping program
109 STRIP="strip"
111 # Used to examine libraries when file_magic_cmd begins "file"
112 MAGIC_CMD=file
114 # Used on cygwin: DLL creation program.
115 DLLTOOL="dlltool"
117 # Used on cygwin: object dumper.
118 OBJDUMP="objdump"
120 # Used on cygwin: assembler.
121 AS="as"
123 # The name of the directory that contains temporary libtool files.
124 objdir=.libs
126 # How to create reloadable object files.
127 reload_flag=" -r"
128 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
130 # How to pass a linker flag through the compiler.
131 wl="-Wl,"
133 # Object file suffix (normally "o").
134 objext="o"
136 # Old archive suffix (normally "a").
137 libext="a"
139 # Shared library suffix (normally ".so").
140 shrext_cmds='.so'
142 # Executable file suffix (normally "").
143 exeext=""
145 # Additional compiler flags for building library objects.
146 pic_flag=" -fPIC -DPIC"
147 pic_mode=default
149 # What is the maximum length of a command?
150 max_cmd_len=1572864
152 # Does compiler simultaneously support -c and -o options?
153 compiler_c_o="yes"
155 # Must we lock files when doing compilation?
156 need_locks="no"
158 # Do we need the lib prefix for modules?
159 need_lib_prefix=no
161 # Do we need a version for libraries?
162 need_version=no
164 # Whether dlopen is supported.
165 dlopen_support=unknown
167 # Whether dlopen of programs is supported.
168 dlopen_self=unknown
170 # Whether dlopen of statically linked programs is supported.
171 dlopen_self_static=unknown
173 # Compiler flag to prevent dynamic linking.
174 link_static_flag="-static"
176 # Compiler flag to turn off builtin functions.
177 no_builtin_flag=" -fno-builtin"
179 # Compiler flag to allow reflexive dlopens.
180 export_dynamic_flag_spec="\${wl}--export-dynamic"
182 # Compiler flag to generate shared objects directly from archives.
183 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
185 # Compiler flag to generate thread-safe objects.
186 thread_safe_flag_spec=""
188 # Library versioning type.
189 version_type=linux
191 # Format of library name prefix.
192 libname_spec="lib\$name"
194 # List of archive names. First name is the real one, the rest are links.
195 # The last name is the one that the linker finds with -lNAME.
196 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
198 # The coded name of the library, if different from the real name.
199 soname_spec="\${libname}\${release}\${shared_ext}\$major"
201 # Commands used to build and install an old-style archive.
202 RANLIB="ranlib"
203 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
204 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205 old_postuninstall_cmds=""
207 # Create an old-style archive from a shared archive.
208 old_archive_from_new_cmds=""
210 # Create a temporary old-style archive to link instead of a shared archive.
211 old_archive_from_expsyms_cmds=""
213 # Commands used to build and install a shared archive.
214 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
215 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
216 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
217 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
218 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
219 postinstall_cmds=""
220 postuninstall_cmds=""
222 # Commands used to build a loadable module (assumed same as above if empty)
223 module_cmds=""
224 module_expsym_cmds=""
226 # Commands to strip libraries.
227 old_striplib="strip --strip-debug"
228 striplib="strip --strip-unneeded"
230 # Dependencies to place before the objects being linked to create a
231 # shared library.
232 predep_objects=""
234 # Dependencies to place after the objects being linked to create a
235 # shared library.
236 postdep_objects=""
238 # Dependencies to place before the objects being linked to create a
239 # shared library.
240 predeps=""
242 # Dependencies to place after the objects being linked to create a
243 # shared library.
244 postdeps=""
246 # The directories searched by this compiler when creating a shared
247 # library
248 compiler_lib_search_dirs=""
250 # The library search path used internally by the compiler when linking
251 # a shared library.
252 compiler_lib_search_path=""
254 # Method to check whether dependent libraries are shared objects.
255 deplibs_check_method="pass_all"
257 # Command to use when deplibs_check_method == file_magic.
258 file_magic_cmd="\$MAGIC_CMD"
260 # Flag that allows shared libraries with undefined symbols to be built.
261 allow_undefined_flag=""
263 # Flag that forces no undefined symbols.
264 no_undefined_flag=""
266 # Commands used to finish a libtool library installation in a directory.
267 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
269 # Same as above, but a single script fragment to be evaled but not shown.
270 finish_eval=""
272 # Take the output of nm and produce a listing of raw symbols and C names.
273 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
275 # Transform the output of nm in a proper C declaration
276 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
278 # Transform the output of nm in a C name address pair
279 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
281 # This is the shared library runtime path variable.
282 runpath_var=LD_RUN_PATH
284 # This is the shared library path variable.
285 shlibpath_var=LD_LIBRARY_PATH
287 # Is shlibpath searched before the hard-coded library search path?
288 shlibpath_overrides_runpath=no
290 # How to hardcode a shared library path into an executable.
291 hardcode_action=immediate
293 # Whether we should hardcode library paths into libraries.
294 hardcode_into_libs=yes
296 # Flag to hardcode $libdir into a binary during linking.
297 # This must work even if $libdir does not exist.
298 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
300 # If ld is used when linking, flag to hardcode $libdir into
301 # a binary during linking. This must work even if $libdir does
302 # not exist.
303 hardcode_libdir_flag_spec_ld=""
305 # Whether we need a single -rpath flag with a separated argument.
306 hardcode_libdir_separator=""
308 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
309 # resulting binary.
310 hardcode_direct=no
312 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
313 # resulting binary.
314 hardcode_minus_L=no
316 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
317 # the resulting binary.
318 hardcode_shlibpath_var=unsupported
320 # Set to yes if building a shared library automatically hardcodes DIR into the library
321 # and all subsequent libraries and executables linked against it.
322 hardcode_automatic=no
324 # Variables whose values should be saved in libtool wrapper scripts and
325 # restored at relink time.
326 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
328 # Whether libtool must link a program against all its dependency libraries.
329 link_all_deplibs=unknown
331 # Compile-time system search path for libraries
332 sys_lib_search_path_spec="/usr/lib/gcc/i586-suse-linux/4.3 /usr/i586-suse-linux/lib /usr/lib /lib"
334 # Run-time system search path for libraries
335 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/lib/Xaw3d /usr/i386-suse-linux/lib /usr/local/lib /opt/kde3/lib /usr/lib/graphviz /usr/lib/graphviz/sharp /usr/lib/graphviz/java /usr/lib/graphviz/perl /usr/lib/graphviz/php /usr/lib/graphviz/ocaml /usr/lib/graphviz/python /usr/lib/graphviz/lua /usr/lib/graphviz/tcl /usr/lib/graphviz/guile /usr/lib/graphviz/ruby "
337 # Fix the shell variable $srcfile for the compiler.
338 fix_srcfile_path=""
340 # Set to yes if exported symbols are required.
341 always_export_symbols=no
343 # The commands to list exported symbols.
344 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
346 # The commands to extract the exported symbol list from a shared archive.
347 extract_expsyms_cmds=""
349 # Symbols that should not be listed in the preloaded symbols.
350 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
352 # Symbols that must always be exported.
353 include_expsyms=""
355 # ### END LIBTOOL CONFIG
357 # ltmain.sh - Provide generalized library-building support services.
358 # NOTE: Changing this file will not affect anything until you rerun configure.
360 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
361 # 2007 Free Software Foundation, Inc.
362 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
364 # This program is free software; you can redistribute it and/or modify
365 # it under the terms of the GNU General Public License as published by
366 # the Free Software Foundation; either version 2 of the License, or
367 # (at your option) any later version.
369 # This program is distributed in the hope that it will be useful, but
370 # WITHOUT ANY WARRANTY; without even the implied warranty of
371 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
372 # General Public License for more details.
374 # You should have received a copy of the GNU General Public License
375 # along with this program; if not, write to the Free Software
376 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
378 # As a special exception to the GNU General Public License, if you
379 # distribute this file as part of a program that contains a
380 # configuration script generated by Autoconf, you may include it under
381 # the same distribution terms that you use for the rest of that program.
383 basename="s,^.*/,,g"
385 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
386 # is ksh but when the shell is invoked as "sh" and the current value of
387 # the _XPG environment variable is not equal to 1 (one), the special
388 # positional parameter $0, within a function call, is the name of the
389 # function.
390 progpath="$0"
392 # The name of this program:
393 progname=`echo "$progpath" | $SED $basename`
394 modename="$progname"
396 # Global variables:
397 EXIT_SUCCESS=0
398 EXIT_FAILURE=1
400 PROGRAM=ltmain.sh
401 PACKAGE=libtool
402 VERSION=1.5.24
403 TIMESTAMP=" (1.1220.2.455 2007/06/24 02:13:29)"
405 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
406 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
407 emulate sh
408 NULLCMD=:
409 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
410 # is contrary to our usage. Disable this feature.
411 alias -g '${1+"$@"}'='"$@"'
412 setopt NO_GLOB_SUBST
413 else
414 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
416 BIN_SH=xpg4; export BIN_SH # for Tru64
417 DUALCASE=1; export DUALCASE # for MKS sh
419 # Check that we have a working $echo.
420 if test "X$1" = X--no-reexec; then
421 # Discard the --no-reexec flag, and continue.
422 shift
423 elif test "X$1" = X--fallback-echo; then
424 # Avoid inline document here, it may be left over
426 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
427 # Yippee, $echo works!
429 else
430 # Restart under the correct shell, and then maybe $echo will work.
431 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
434 if test "X$1" = X--fallback-echo; then
435 # used as fallback echo
436 shift
437 cat <<EOF
440 exit $EXIT_SUCCESS
443 default_mode=
444 help="Try \`$progname --help' for more information."
445 magic="%%%MAGIC variable%%%"
446 mkdir="mkdir"
447 mv="mv -f"
448 rm="rm -f"
450 # Sed substitution that helps us do robust quoting. It backslashifies
451 # metacharacters that are still active within double-quoted strings.
452 Xsed="${SED}"' -e 1s/^X//'
453 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
454 # test EBCDIC or ASCII
455 case `echo X|tr X '\101'` in
456 A) # ASCII based system
457 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
458 SP2NL='tr \040 \012'
459 NL2SP='tr \015\012 \040\040'
461 *) # EBCDIC based system
462 SP2NL='tr \100 \n'
463 NL2SP='tr \r\n \100\100'
465 esac
467 # NLS nuisances.
468 # Only set LANG and LC_ALL to C if already set.
469 # These must not be set unconditionally because not all systems understand
470 # e.g. LANG=C (notably SCO).
471 # We save the old values to restore during execute mode.
472 for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
474 eval "if test \"\${$lt_var+set}\" = set; then
475 save_$lt_var=\$$lt_var
476 $lt_var=C
477 export $lt_var
479 done
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/"
505 extracted_archives=
506 extracted_serial=0
508 #####################################
509 # Shell function definitions:
510 # This seems to be the best place for them
512 # func_mktempdir [string]
513 # Make a temporary directory that won't clash with other running
514 # libtool processes, and avoids race conditions if possible. If
515 # given, STRING is the basename for that directory.
516 func_mktempdir ()
518 my_template="${TMPDIR-/tmp}/${1-$progname}"
520 if test "$run" = ":"; then
521 # Return a directory name, but don't create it in dry-run mode
522 my_tmpdir="${my_template}-$$"
523 else
525 # If mktemp works, use that first and foremost
526 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
528 if test ! -d "$my_tmpdir"; then
529 # Failing that, at least try and use $RANDOM to avoid a race
530 my_tmpdir="${my_template}-${RANDOM-0}$$"
532 save_mktempdir_umask=`umask`
533 umask 0077
534 $mkdir "$my_tmpdir"
535 umask $save_mktempdir_umask
538 # If we're not in dry-run mode, bomb out on failure
539 test -d "$my_tmpdir" || {
540 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
541 exit $EXIT_FAILURE
545 $echo "X$my_tmpdir" | $Xsed
549 # func_win32_libid arg
550 # return the library type of file 'arg'
552 # Need a lot of goo to handle *both* DLLs and import libs
553 # Has to be a shell function in order to 'eat' the argument
554 # that is supplied when $file_magic_command is called.
555 func_win32_libid ()
557 win32_libid_type="unknown"
558 win32_fileres=`file -L $1 2>/dev/null`
559 case $win32_fileres in
560 *ar\ archive\ import\ library*) # definitely import
561 win32_libid_type="x86 archive import"
563 *ar\ archive*) # could be an import, or static
564 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
565 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
566 win32_nmres=`eval $NM -f posix -A $1 | \
567 $SED -n -e '1,100{
568 / I /{
569 s,.*,import,
574 case $win32_nmres in
575 import*) win32_libid_type="x86 archive import";;
576 *) win32_libid_type="x86 archive static";;
577 esac
580 *DLL*)
581 win32_libid_type="x86 DLL"
583 *executable*) # but shell scripts are "executable" too...
584 case $win32_fileres in
585 *MS\ Windows\ PE\ Intel*)
586 win32_libid_type="x86 DLL"
588 esac
590 esac
591 $echo $win32_libid_type
595 # func_infer_tag arg
596 # Infer tagged configuration to use if any are available and
597 # if one wasn't chosen via the "--tag" command line option.
598 # Only attempt this if the compiler in the base compile
599 # command doesn't match the default compiler.
600 # arg is usually of the form 'gcc ...'
601 func_infer_tag ()
603 if test -n "$available_tags" && test -z "$tagname"; then
604 CC_quoted=
605 for arg in $CC; do
606 case $arg in
607 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
608 arg="\"$arg\""
610 esac
611 CC_quoted="$CC_quoted $arg"
612 done
613 case $@ in
614 # Blanks in the command may have been stripped by the calling shell,
615 # but not from the CC environment variable when configure was run.
616 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
617 # Blanks at the start of $base_compile will cause this to fail
618 # if we don't check for them as well.
620 for z in $available_tags; do
621 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
622 # Evaluate the configuration.
623 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
624 CC_quoted=
625 for arg in $CC; do
626 # Double-quote args containing other shell metacharacters.
627 case $arg in
628 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
629 arg="\"$arg\""
631 esac
632 CC_quoted="$CC_quoted $arg"
633 done
634 case "$@ " in
635 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
636 # The compiler in the base compile command matches
637 # the one in the tagged configuration.
638 # Assume this is the tagged configuration we want.
639 tagname=$z
640 break
642 esac
644 done
645 # If $tagname still isn't set, then no tagged configuration
646 # was found and let the user know that the "--tag" command
647 # line option must be used.
648 if test -z "$tagname"; then
649 $echo "$modename: unable to infer tagged configuration"
650 $echo "$modename: specify a tag with \`--tag'" 1>&2
651 exit $EXIT_FAILURE
652 # else
653 # $echo "$modename: using $tagname tagged configuration"
656 esac
661 # func_extract_an_archive dir oldlib
662 func_extract_an_archive ()
664 f_ex_an_ar_dir="$1"; shift
665 f_ex_an_ar_oldlib="$1"
667 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
668 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
669 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
671 else
672 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
673 exit $EXIT_FAILURE
677 # func_extract_archives gentop oldlib ...
678 func_extract_archives ()
680 my_gentop="$1"; shift
681 my_oldlibs=${1+"$@"}
682 my_oldobjs=""
683 my_xlib=""
684 my_xabs=""
685 my_xdir=""
686 my_status=""
688 $show "${rm}r $my_gentop"
689 $run ${rm}r "$my_gentop"
690 $show "$mkdir $my_gentop"
691 $run $mkdir "$my_gentop"
692 my_status=$?
693 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
694 exit $my_status
697 for my_xlib in $my_oldlibs; do
698 # Extract the objects.
699 case $my_xlib in
700 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
701 *) my_xabs=`pwd`"/$my_xlib" ;;
702 esac
703 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
704 my_xlib_u=$my_xlib
705 while :; do
706 case " $extracted_archives " in
707 *" $my_xlib_u "*)
708 extracted_serial=`expr $extracted_serial + 1`
709 my_xlib_u=lt$extracted_serial-$my_xlib ;;
710 *) break ;;
711 esac
712 done
713 extracted_archives="$extracted_archives $my_xlib_u"
714 my_xdir="$my_gentop/$my_xlib_u"
716 $show "${rm}r $my_xdir"
717 $run ${rm}r "$my_xdir"
718 $show "$mkdir $my_xdir"
719 $run $mkdir "$my_xdir"
720 exit_status=$?
721 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
722 exit $exit_status
724 case $host in
725 *-darwin*)
726 $show "Extracting $my_xabs"
727 # Do not bother doing anything if just a dry run
728 if test -z "$run"; then
729 darwin_orig_dir=`pwd`
730 cd $my_xdir || exit $?
731 darwin_archive=$my_xabs
732 darwin_curdir=`pwd`
733 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
734 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
735 if test -n "$darwin_arches"; then
736 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
737 darwin_arch=
738 $show "$darwin_base_archive has multiple architectures $darwin_arches"
739 for darwin_arch in $darwin_arches ; do
740 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
741 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
742 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
743 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
744 cd "$darwin_curdir"
745 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
746 done # $darwin_arches
747 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
748 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
749 darwin_file=
750 darwin_files=
751 for darwin_file in $darwin_filelist; do
752 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
753 lipo -create -output "$darwin_file" $darwin_files
754 done # $darwin_filelist
755 ${rm}r unfat-$$
756 cd "$darwin_orig_dir"
757 else
758 cd "$darwin_orig_dir"
759 func_extract_an_archive "$my_xdir" "$my_xabs"
760 fi # $darwin_arches
761 fi # $run
764 func_extract_an_archive "$my_xdir" "$my_xabs"
766 esac
767 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
768 done
769 func_extract_archives_result="$my_oldobjs"
771 # End of Shell function definitions
772 #####################################
774 # Darwin sucks
775 eval std_shrext=\"$shrext_cmds\"
777 disable_libs=no
779 # Parse our command line options once, thoroughly.
780 while test "$#" -gt 0
782 arg="$1"
783 shift
785 case $arg in
786 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
787 *) optarg= ;;
788 esac
790 # If the previous option needs an argument, assign it.
791 if test -n "$prev"; then
792 case $prev in
793 execute_dlfiles)
794 execute_dlfiles="$execute_dlfiles $arg"
796 tag)
797 tagname="$arg"
798 preserve_args="${preserve_args}=$arg"
800 # Check whether tagname contains only valid characters
801 case $tagname in
802 *[!-_A-Za-z0-9,/]*)
803 $echo "$progname: invalid tag name: $tagname" 1>&2
804 exit $EXIT_FAILURE
806 esac
808 case $tagname in
810 # Don't test for the "default" C tag, as we know, it's there, but
811 # not specially marked.
814 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
815 taglist="$taglist $tagname"
816 # Evaluate the configuration.
817 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
818 else
819 $echo "$progname: ignoring unknown tag $tagname" 1>&2
822 esac
825 eval "$prev=\$arg"
827 esac
829 prev=
830 prevopt=
831 continue
834 # Have we seen a non-optional argument yet?
835 case $arg in
836 --help)
837 show_help=yes
840 --version)
841 echo "\
842 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
844 Copyright (C) 2007 Free Software Foundation, Inc.
845 This is free software; see the source for copying conditions. There is NO
846 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
847 exit $?
850 --config)
851 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
852 # Now print the configurations for the tags.
853 for tagname in $taglist; do
854 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
855 done
856 exit $?
859 --debug)
860 $echo "$progname: enabling shell trace mode"
861 set -x
862 preserve_args="$preserve_args $arg"
865 --dry-run | -n)
866 run=:
869 --features)
870 $echo "host: $host"
871 if test "$build_libtool_libs" = yes; then
872 $echo "enable shared libraries"
873 else
874 $echo "disable shared libraries"
876 if test "$build_old_libs" = yes; then
877 $echo "enable static libraries"
878 else
879 $echo "disable static libraries"
881 exit $?
884 --finish) mode="finish" ;;
886 --mode) prevopt="--mode" prev=mode ;;
887 --mode=*) mode="$optarg" ;;
889 --preserve-dup-deps) duplicate_deps="yes" ;;
891 --quiet | --silent)
892 show=:
893 preserve_args="$preserve_args $arg"
896 --tag)
897 prevopt="--tag"
898 prev=tag
899 preserve_args="$preserve_args --tag"
901 --tag=*)
902 set tag "$optarg" ${1+"$@"}
903 shift
904 prev=tag
905 preserve_args="$preserve_args --tag"
908 -dlopen)
909 prevopt="-dlopen"
910 prev=execute_dlfiles
914 $echo "$modename: unrecognized option \`$arg'" 1>&2
915 $echo "$help" 1>&2
916 exit $EXIT_FAILURE
920 nonopt="$arg"
921 break
923 esac
924 done
926 if test -n "$prevopt"; then
927 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
928 $echo "$help" 1>&2
929 exit $EXIT_FAILURE
932 case $disable_libs in
933 no)
935 shared)
936 build_libtool_libs=no
937 build_old_libs=yes
939 static)
940 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
942 esac
944 # If this variable is set in any of the actions, the command in it
945 # will be execed at the end. This prevents here-documents from being
946 # left over by shells.
947 exec_cmd=
949 if test -z "$show_help"; then
951 # Infer the operation mode.
952 if test -z "$mode"; then
953 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
954 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
955 case $nonopt in
956 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
957 mode=link
958 for arg
960 case $arg in
962 mode=compile
963 break
965 esac
966 done
968 *db | *dbx | *strace | *truss)
969 mode=execute
971 *install*|cp|mv)
972 mode=install
974 *rm)
975 mode=uninstall
978 # If we have no mode, but dlfiles were specified, then do execute mode.
979 test -n "$execute_dlfiles" && mode=execute
981 # Just use the default operation mode.
982 if test -z "$mode"; then
983 if test -n "$nonopt"; then
984 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
985 else
986 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
990 esac
993 # Only execute mode is allowed to have -dlopen flags.
994 if test -n "$execute_dlfiles" && test "$mode" != execute; then
995 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
996 $echo "$help" 1>&2
997 exit $EXIT_FAILURE
1000 # Change the help message to a mode-specific one.
1001 generic_help="$help"
1002 help="Try \`$modename --help --mode=$mode' for more information."
1004 # These modes are in order of execution frequency so that they run quickly.
1005 case $mode in
1006 # libtool compile mode
1007 compile)
1008 modename="$modename: compile"
1009 # Get the compilation command and the source file.
1010 base_compile=
1011 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1012 suppress_opt=yes
1013 suppress_output=
1014 arg_mode=normal
1015 libobj=
1016 later=
1018 for arg
1020 case $arg_mode in
1021 arg )
1022 # do not "continue". Instead, add this to base_compile
1023 lastarg="$arg"
1024 arg_mode=normal
1027 target )
1028 libobj="$arg"
1029 arg_mode=normal
1030 continue
1033 normal )
1034 # Accept any command-line options.
1035 case $arg in
1037 if test -n "$libobj" ; then
1038 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1039 exit $EXIT_FAILURE
1041 arg_mode=target
1042 continue
1045 -static | -prefer-pic | -prefer-non-pic)
1046 later="$later $arg"
1047 continue
1050 -no-suppress)
1051 suppress_opt=no
1052 continue
1055 -Xcompiler)
1056 arg_mode=arg # the next one goes into the "base_compile" arg list
1057 continue # The current "srcfile" will either be retained or
1058 ;; # replaced later. I would guess that would be a bug.
1060 -Wc,*)
1061 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1062 lastarg=
1063 save_ifs="$IFS"; IFS=','
1064 for arg in $args; do
1065 IFS="$save_ifs"
1067 # Double-quote args containing other shell metacharacters.
1068 # Many Bourne shells cannot handle close brackets correctly
1069 # in scan sets, so we specify it separately.
1070 case $arg in
1071 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1072 arg="\"$arg\""
1074 esac
1075 lastarg="$lastarg $arg"
1076 done
1077 IFS="$save_ifs"
1078 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1080 # Add the arguments to base_compile.
1081 base_compile="$base_compile $lastarg"
1082 continue
1086 # Accept the current argument as the source file.
1087 # The previous "srcfile" becomes the current argument.
1089 lastarg="$srcfile"
1090 srcfile="$arg"
1092 esac # case $arg
1094 esac # case $arg_mode
1096 # Aesthetically quote the previous argument.
1097 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1099 case $lastarg in
1100 # Double-quote args containing other shell metacharacters.
1101 # Many Bourne shells cannot handle close brackets correctly
1102 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1103 # in scan sets (worked around with variable expansion),
1104 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1105 # at all, so we specify them separately.
1106 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1107 lastarg="\"$lastarg\""
1109 esac
1111 base_compile="$base_compile $lastarg"
1112 done # for arg
1114 case $arg_mode in
1115 arg)
1116 $echo "$modename: you must specify an argument for -Xcompile"
1117 exit $EXIT_FAILURE
1119 target)
1120 $echo "$modename: you must specify a target with \`-o'" 1>&2
1121 exit $EXIT_FAILURE
1124 # Get the name of the library object.
1125 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1127 esac
1129 # Recognize several different file suffixes.
1130 # If the user specifies -o file.o, it is replaced with file.lo
1131 xform='[cCFSifmso]'
1132 case $libobj in
1133 *.ada) xform=ada ;;
1134 *.adb) xform=adb ;;
1135 *.ads) xform=ads ;;
1136 *.asm) xform=asm ;;
1137 *.c++) xform=c++ ;;
1138 *.cc) xform=cc ;;
1139 *.ii) xform=ii ;;
1140 *.class) xform=class ;;
1141 *.cpp) xform=cpp ;;
1142 *.cxx) xform=cxx ;;
1143 *.[fF][09]?) xform=[fF][09]. ;;
1144 *.for) xform=for ;;
1145 *.java) xform=java ;;
1146 *.obj) xform=obj ;;
1147 esac
1149 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1151 case $libobj in
1152 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1154 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1155 exit $EXIT_FAILURE
1157 esac
1159 func_infer_tag $base_compile
1161 for arg in $later; do
1162 case $arg in
1163 -static)
1164 build_old_libs=yes
1165 continue
1168 -prefer-pic)
1169 pic_mode=yes
1170 continue
1173 -prefer-non-pic)
1174 pic_mode=no
1175 continue
1177 esac
1178 done
1180 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1181 case $qlibobj in
1182 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1183 qlibobj="\"$qlibobj\"" ;;
1184 esac
1185 test "X$libobj" != "X$qlibobj" \
1186 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1187 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1188 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1189 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1190 if test "X$xdir" = "X$obj"; then
1191 xdir=
1192 else
1193 xdir=$xdir/
1195 lobj=${xdir}$objdir/$objname
1197 if test -z "$base_compile"; then
1198 $echo "$modename: you must specify a compilation command" 1>&2
1199 $echo "$help" 1>&2
1200 exit $EXIT_FAILURE
1203 # Delete any leftover library objects.
1204 if test "$build_old_libs" = yes; then
1205 removelist="$obj $lobj $libobj ${libobj}T"
1206 else
1207 removelist="$lobj $libobj ${libobj}T"
1210 $run $rm $removelist
1211 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1213 # On Cygwin there's no "real" PIC flag so we must build both object types
1214 case $host_os in
1215 cygwin* | mingw* | pw32* | os2*)
1216 pic_mode=default
1218 esac
1219 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1220 # non-PIC code in shared libraries is not supported
1221 pic_mode=default
1224 # Calculate the filename of the output object if compiler does
1225 # not support -o with -c
1226 if test "$compiler_c_o" = no; then
1227 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1228 lockfile="$output_obj.lock"
1229 removelist="$removelist $output_obj $lockfile"
1230 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1231 else
1232 output_obj=
1233 need_locks=no
1234 lockfile=
1237 # Lock this critical section if it is needed
1238 # We use this script file to make the link, it avoids creating a new file
1239 if test "$need_locks" = yes; then
1240 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1241 $show "Waiting for $lockfile to be removed"
1242 sleep 2
1243 done
1244 elif test "$need_locks" = warn; then
1245 if test -f "$lockfile"; then
1246 $echo "\
1247 *** ERROR, $lockfile exists and contains:
1248 `cat $lockfile 2>/dev/null`
1250 This indicates that another process is trying to use the same
1251 temporary object file, and libtool could not work around it because
1252 your compiler does not support \`-c' and \`-o' together. If you
1253 repeat this compilation, it may succeed, by chance, but you had better
1254 avoid parallel builds (make -j) in this platform, or get a better
1255 compiler."
1257 $run $rm $removelist
1258 exit $EXIT_FAILURE
1260 $echo "$srcfile" > "$lockfile"
1263 if test -n "$fix_srcfile_path"; then
1264 eval srcfile=\"$fix_srcfile_path\"
1266 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1267 case $qsrcfile in
1268 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1269 qsrcfile="\"$qsrcfile\"" ;;
1270 esac
1272 $run $rm "$libobj" "${libobj}T"
1274 # Create a libtool object file (analogous to a ".la" file),
1275 # but don't create it if we're doing a dry run.
1276 test -z "$run" && cat > ${libobj}T <<EOF
1277 # $libobj - a libtool object file
1278 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1280 # Please DO NOT delete this file!
1281 # It is necessary for linking the library.
1283 # Name of the PIC object.
1286 # Only build a PIC object if we are building libtool libraries.
1287 if test "$build_libtool_libs" = yes; then
1288 # Without this assignment, base_compile gets emptied.
1289 fbsd_hideous_sh_bug=$base_compile
1291 if test "$pic_mode" != no; then
1292 command="$base_compile $qsrcfile $pic_flag"
1293 else
1294 # Don't build PIC code
1295 command="$base_compile $qsrcfile"
1298 if test ! -d "${xdir}$objdir"; then
1299 $show "$mkdir ${xdir}$objdir"
1300 $run $mkdir ${xdir}$objdir
1301 exit_status=$?
1302 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1303 exit $exit_status
1307 if test -z "$output_obj"; then
1308 # Place PIC objects in $objdir
1309 command="$command -o $lobj"
1312 $run $rm "$lobj" "$output_obj"
1314 $show "$command"
1315 if $run eval "$command"; then :
1316 else
1317 test -n "$output_obj" && $run $rm $removelist
1318 exit $EXIT_FAILURE
1321 if test "$need_locks" = warn &&
1322 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1323 $echo "\
1324 *** ERROR, $lockfile contains:
1325 `cat $lockfile 2>/dev/null`
1327 but it should contain:
1328 $srcfile
1330 This indicates that another process is trying to use the same
1331 temporary object file, and libtool could not work around it because
1332 your compiler does not support \`-c' and \`-o' together. If you
1333 repeat this compilation, it may succeed, by chance, but you had better
1334 avoid parallel builds (make -j) in this platform, or get a better
1335 compiler."
1337 $run $rm $removelist
1338 exit $EXIT_FAILURE
1341 # Just move the object if needed, then go on to compile the next one
1342 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1343 $show "$mv $output_obj $lobj"
1344 if $run $mv $output_obj $lobj; then :
1345 else
1346 error=$?
1347 $run $rm $removelist
1348 exit $error
1352 # Append the name of the PIC object to the libtool object file.
1353 test -z "$run" && cat >> ${libobj}T <<EOF
1354 pic_object='$objdir/$objname'
1358 # Allow error messages only from the first compilation.
1359 if test "$suppress_opt" = yes; then
1360 suppress_output=' >/dev/null 2>&1'
1362 else
1363 # No PIC object so indicate it doesn't exist in the libtool
1364 # object file.
1365 test -z "$run" && cat >> ${libobj}T <<EOF
1366 pic_object=none
1371 # Only build a position-dependent object if we build old libraries.
1372 if test "$build_old_libs" = yes; then
1373 if test "$pic_mode" != yes; then
1374 # Don't build PIC code
1375 command="$base_compile $qsrcfile"
1376 else
1377 command="$base_compile $qsrcfile $pic_flag"
1379 if test "$compiler_c_o" = yes; then
1380 command="$command -o $obj"
1383 # Suppress compiler output if we already did a PIC compilation.
1384 command="$command$suppress_output"
1385 $run $rm "$obj" "$output_obj"
1386 $show "$command"
1387 if $run eval "$command"; then :
1388 else
1389 $run $rm $removelist
1390 exit $EXIT_FAILURE
1393 if test "$need_locks" = warn &&
1394 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1395 $echo "\
1396 *** ERROR, $lockfile contains:
1397 `cat $lockfile 2>/dev/null`
1399 but it should contain:
1400 $srcfile
1402 This indicates that another process is trying to use the same
1403 temporary object file, and libtool could not work around it because
1404 your compiler does not support \`-c' and \`-o' together. If you
1405 repeat this compilation, it may succeed, by chance, but you had better
1406 avoid parallel builds (make -j) in this platform, or get a better
1407 compiler."
1409 $run $rm $removelist
1410 exit $EXIT_FAILURE
1413 # Just move the object if needed
1414 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1415 $show "$mv $output_obj $obj"
1416 if $run $mv $output_obj $obj; then :
1417 else
1418 error=$?
1419 $run $rm $removelist
1420 exit $error
1424 # Append the name of the non-PIC object the libtool object file.
1425 # Only append if the libtool object file exists.
1426 test -z "$run" && cat >> ${libobj}T <<EOF
1427 # Name of the non-PIC object.
1428 non_pic_object='$objname'
1431 else
1432 # Append the name of the non-PIC object the libtool object file.
1433 # Only append if the libtool object file exists.
1434 test -z "$run" && cat >> ${libobj}T <<EOF
1435 # Name of the non-PIC object.
1436 non_pic_object=none
1441 $run $mv "${libobj}T" "${libobj}"
1443 # Unlock the critical section if it was locked
1444 if test "$need_locks" != no; then
1445 $run $rm "$lockfile"
1448 exit $EXIT_SUCCESS
1451 # libtool link mode
1452 link | relink)
1453 modename="$modename: link"
1454 case $host in
1455 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1456 # It is impossible to link a dll without this setting, and
1457 # we shouldn't force the makefile maintainer to figure out
1458 # which system we are compiling for in order to pass an extra
1459 # flag for every libtool invocation.
1460 # allow_undefined=no
1462 # FIXME: Unfortunately, there are problems with the above when trying
1463 # to make a dll which has undefined symbols, in which case not
1464 # even a static library is built. For now, we need to specify
1465 # -no-undefined on the libtool link line when we can be certain
1466 # that all symbols are satisfied, otherwise we get a static library.
1467 allow_undefined=yes
1470 allow_undefined=yes
1472 esac
1473 libtool_args="$nonopt"
1474 base_compile="$nonopt $@"
1475 compile_command="$nonopt"
1476 finalize_command="$nonopt"
1478 compile_rpath=
1479 finalize_rpath=
1480 compile_shlibpath=
1481 finalize_shlibpath=
1482 convenience=
1483 old_convenience=
1484 deplibs=
1485 old_deplibs=
1486 compiler_flags=
1487 linker_flags=
1488 dllsearchpath=
1489 lib_search_path=`pwd`
1490 inst_prefix_dir=
1492 avoid_version=no
1493 dlfiles=
1494 dlprefiles=
1495 dlself=no
1496 export_dynamic=no
1497 export_symbols=
1498 export_symbols_regex=
1499 generated=
1500 libobjs=
1501 ltlibs=
1502 module=no
1503 no_install=no
1504 objs=
1505 non_pic_objects=
1506 notinst_path= # paths that contain not-installed libtool libraries
1507 precious_files_regex=
1508 prefer_static_libs=no
1509 preload=no
1510 prev=
1511 prevarg=
1512 release=
1513 rpath=
1514 xrpath=
1515 perm_rpath=
1516 temp_rpath=
1517 thread_safe=no
1518 vinfo=
1519 vinfo_number=no
1521 func_infer_tag $base_compile
1523 # We need to know -static, to get the right output filenames.
1524 for arg
1526 case $arg in
1527 -all-static | -static | -static-libtool-libs)
1528 case $arg in
1529 -all-static)
1530 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1531 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1533 if test -n "$link_static_flag"; then
1534 dlopen_self=$dlopen_self_static
1536 prefer_static_libs=yes
1538 -static)
1539 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1540 dlopen_self=$dlopen_self_static
1542 prefer_static_libs=built
1544 -static-libtool-libs)
1545 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1546 dlopen_self=$dlopen_self_static
1548 prefer_static_libs=yes
1550 esac
1551 build_libtool_libs=no
1552 build_old_libs=yes
1553 break
1555 esac
1556 done
1558 # See if our shared archives depend on static archives.
1559 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1561 # Go through the arguments, transforming them on the way.
1562 while test "$#" -gt 0; do
1563 arg="$1"
1564 shift
1565 case $arg in
1566 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1567 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1569 *) qarg=$arg ;;
1570 esac
1571 libtool_args="$libtool_args $qarg"
1573 # If the previous option needs an argument, assign it.
1574 if test -n "$prev"; then
1575 case $prev in
1576 output)
1577 compile_command="$compile_command @OUTPUT@"
1578 finalize_command="$finalize_command @OUTPUT@"
1580 esac
1582 case $prev in
1583 dlfiles|dlprefiles)
1584 if test "$preload" = no; then
1585 # Add the symbol object into the linking commands.
1586 compile_command="$compile_command @SYMFILE@"
1587 finalize_command="$finalize_command @SYMFILE@"
1588 preload=yes
1590 case $arg in
1591 *.la | *.lo) ;; # We handle these cases below.
1592 force)
1593 if test "$dlself" = no; then
1594 dlself=needless
1595 export_dynamic=yes
1597 prev=
1598 continue
1600 self)
1601 if test "$prev" = dlprefiles; then
1602 dlself=yes
1603 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1604 dlself=yes
1605 else
1606 dlself=needless
1607 export_dynamic=yes
1609 prev=
1610 continue
1613 if test "$prev" = dlfiles; then
1614 dlfiles="$dlfiles $arg"
1615 else
1616 dlprefiles="$dlprefiles $arg"
1618 prev=
1619 continue
1621 esac
1623 expsyms)
1624 export_symbols="$arg"
1625 if test ! -f "$arg"; then
1626 $echo "$modename: symbol file \`$arg' does not exist"
1627 exit $EXIT_FAILURE
1629 prev=
1630 continue
1632 expsyms_regex)
1633 export_symbols_regex="$arg"
1634 prev=
1635 continue
1637 inst_prefix)
1638 inst_prefix_dir="$arg"
1639 prev=
1640 continue
1642 precious_regex)
1643 precious_files_regex="$arg"
1644 prev=
1645 continue
1647 release)
1648 release="-$arg"
1649 prev=
1650 continue
1652 objectlist)
1653 if test -f "$arg"; then
1654 save_arg=$arg
1655 moreargs=
1656 for fil in `cat $save_arg`
1658 # moreargs="$moreargs $fil"
1659 arg=$fil
1660 # A libtool-controlled object.
1662 # Check to see that this really is a libtool object.
1663 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1664 pic_object=
1665 non_pic_object=
1667 # Read the .lo file
1668 # If there is no directory component, then add one.
1669 case $arg in
1670 */* | *\\*) . $arg ;;
1671 *) . ./$arg ;;
1672 esac
1674 if test -z "$pic_object" || \
1675 test -z "$non_pic_object" ||
1676 test "$pic_object" = none && \
1677 test "$non_pic_object" = none; then
1678 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1679 exit $EXIT_FAILURE
1682 # Extract subdirectory from the argument.
1683 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1684 if test "X$xdir" = "X$arg"; then
1685 xdir=
1686 else
1687 xdir="$xdir/"
1690 if test "$pic_object" != none; then
1691 # Prepend the subdirectory the object is found in.
1692 pic_object="$xdir$pic_object"
1694 if test "$prev" = dlfiles; then
1695 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1696 dlfiles="$dlfiles $pic_object"
1697 prev=
1698 continue
1699 else
1700 # If libtool objects are unsupported, then we need to preload.
1701 prev=dlprefiles
1705 # CHECK ME: I think I busted this. -Ossama
1706 if test "$prev" = dlprefiles; then
1707 # Preload the old-style object.
1708 dlprefiles="$dlprefiles $pic_object"
1709 prev=
1712 # A PIC object.
1713 libobjs="$libobjs $pic_object"
1714 arg="$pic_object"
1717 # Non-PIC object.
1718 if test "$non_pic_object" != none; then
1719 # Prepend the subdirectory the object is found in.
1720 non_pic_object="$xdir$non_pic_object"
1722 # A standard non-PIC object
1723 non_pic_objects="$non_pic_objects $non_pic_object"
1724 if test -z "$pic_object" || test "$pic_object" = none ; then
1725 arg="$non_pic_object"
1727 else
1728 # If the PIC object exists, use it instead.
1729 # $xdir was prepended to $pic_object above.
1730 non_pic_object="$pic_object"
1731 non_pic_objects="$non_pic_objects $non_pic_object"
1733 else
1734 # Only an error if not doing a dry-run.
1735 if test -z "$run"; then
1736 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1737 exit $EXIT_FAILURE
1738 else
1739 # Dry-run case.
1741 # Extract subdirectory from the argument.
1742 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1743 if test "X$xdir" = "X$arg"; then
1744 xdir=
1745 else
1746 xdir="$xdir/"
1749 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1750 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1751 libobjs="$libobjs $pic_object"
1752 non_pic_objects="$non_pic_objects $non_pic_object"
1755 done
1756 else
1757 $echo "$modename: link input file \`$save_arg' does not exist"
1758 exit $EXIT_FAILURE
1760 arg=$save_arg
1761 prev=
1762 continue
1764 rpath | xrpath)
1765 # We need an absolute path.
1766 case $arg in
1767 [\\/]* | [A-Za-z]:[\\/]*) ;;
1769 $echo "$modename: only absolute run-paths are allowed" 1>&2
1770 exit $EXIT_FAILURE
1772 esac
1773 if test "$prev" = rpath; then
1774 case "$rpath " in
1775 *" $arg "*) ;;
1776 *) rpath="$rpath $arg" ;;
1777 esac
1778 else
1779 case "$xrpath " in
1780 *" $arg "*) ;;
1781 *) xrpath="$xrpath $arg" ;;
1782 esac
1784 prev=
1785 continue
1787 xcompiler)
1788 compiler_flags="$compiler_flags $qarg"
1789 prev=
1790 compile_command="$compile_command $qarg"
1791 finalize_command="$finalize_command $qarg"
1792 continue
1794 xlinker)
1795 linker_flags="$linker_flags $qarg"
1796 compiler_flags="$compiler_flags $wl$qarg"
1797 prev=
1798 compile_command="$compile_command $wl$qarg"
1799 finalize_command="$finalize_command $wl$qarg"
1800 continue
1802 xcclinker)
1803 linker_flags="$linker_flags $qarg"
1804 compiler_flags="$compiler_flags $qarg"
1805 prev=
1806 compile_command="$compile_command $qarg"
1807 finalize_command="$finalize_command $qarg"
1808 continue
1810 shrext)
1811 shrext_cmds="$arg"
1812 prev=
1813 continue
1815 darwin_framework|darwin_framework_skip)
1816 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1817 compile_command="$compile_command $arg"
1818 finalize_command="$finalize_command $arg"
1819 prev=
1820 continue
1823 eval "$prev=\"\$arg\""
1824 prev=
1825 continue
1827 esac
1828 fi # test -n "$prev"
1830 prevarg="$arg"
1832 case $arg in
1833 -all-static)
1834 if test -n "$link_static_flag"; then
1835 compile_command="$compile_command $link_static_flag"
1836 finalize_command="$finalize_command $link_static_flag"
1838 continue
1841 -allow-undefined)
1842 # FIXME: remove this flag sometime in the future.
1843 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1844 continue
1847 -avoid-version)
1848 avoid_version=yes
1849 continue
1852 -dlopen)
1853 prev=dlfiles
1854 continue
1857 -dlpreopen)
1858 prev=dlprefiles
1859 continue
1862 -export-dynamic)
1863 export_dynamic=yes
1864 continue
1867 -export-symbols | -export-symbols-regex)
1868 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1869 $echo "$modename: more than one -exported-symbols argument is not allowed"
1870 exit $EXIT_FAILURE
1872 if test "X$arg" = "X-export-symbols"; then
1873 prev=expsyms
1874 else
1875 prev=expsyms_regex
1877 continue
1880 -framework|-arch|-isysroot)
1881 case " $CC " in
1882 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1883 prev=darwin_framework_skip ;;
1884 *) compiler_flags="$compiler_flags $arg"
1885 prev=darwin_framework ;;
1886 esac
1887 compile_command="$compile_command $arg"
1888 finalize_command="$finalize_command $arg"
1889 continue
1892 -inst-prefix-dir)
1893 prev=inst_prefix
1894 continue
1897 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1898 # so, if we see these flags be careful not to treat them like -L
1899 -L[A-Z][A-Z]*:*)
1900 case $with_gcc/$host in
1901 no/*-*-irix* | /*-*-irix*)
1902 compile_command="$compile_command $arg"
1903 finalize_command="$finalize_command $arg"
1905 esac
1906 continue
1909 -L*)
1910 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1911 # We need an absolute path.
1912 case $dir in
1913 [\\/]* | [A-Za-z]:[\\/]*) ;;
1915 absdir=`cd "$dir" && pwd`
1916 if test -z "$absdir"; then
1917 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1918 absdir="$dir"
1919 notinst_path="$notinst_path $dir"
1921 dir="$absdir"
1923 esac
1924 case "$deplibs " in
1925 *" -L$dir "*) ;;
1927 deplibs="$deplibs -L$dir"
1928 lib_search_path="$lib_search_path $dir"
1930 esac
1931 case $host in
1932 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1933 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1934 case :$dllsearchpath: in
1935 *":$dir:"*) ;;
1936 *) dllsearchpath="$dllsearchpath:$dir";;
1937 esac
1938 case :$dllsearchpath: in
1939 *":$testbindir:"*) ;;
1940 *) dllsearchpath="$dllsearchpath:$testbindir";;
1941 esac
1943 esac
1944 continue
1947 -l*)
1948 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1949 case $host in
1950 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1951 # These systems don't actually have a C or math library (as such)
1952 continue
1954 *-*-os2*)
1955 # These systems don't actually have a C library (as such)
1956 test "X$arg" = "X-lc" && continue
1958 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1959 # Do not include libc due to us having libc/libc_r.
1960 test "X$arg" = "X-lc" && continue
1962 *-*-rhapsody* | *-*-darwin1.[012])
1963 # Rhapsody C and math libraries are in the System framework
1964 deplibs="$deplibs -framework System"
1965 continue
1967 *-*-sco3.2v5* | *-*-sco5v6*)
1968 # Causes problems with __ctype
1969 test "X$arg" = "X-lc" && continue
1971 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1972 # Compiler inserts libc in the correct place for threads to work
1973 test "X$arg" = "X-lc" && continue
1975 esac
1976 elif test "X$arg" = "X-lc_r"; then
1977 case $host in
1978 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1979 # Do not include libc_r directly, use -pthread flag.
1980 continue
1982 esac
1984 deplibs="$deplibs $arg"
1985 continue
1988 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1989 # classes, name mangling, and exception handling.
1990 -model)
1991 compile_command="$compile_command $arg"
1992 compiler_flags="$compiler_flags $arg"
1993 finalize_command="$finalize_command $arg"
1994 prev=xcompiler
1995 continue
1998 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
1999 compiler_flags="$compiler_flags $arg"
2000 compile_command="$compile_command $arg"
2001 finalize_command="$finalize_command $arg"
2002 continue
2005 -module)
2006 module=yes
2007 continue
2010 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2011 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2012 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2013 # +DA*, +DD* enable 64-bit mode on the HP compiler
2014 # -q* pass through compiler args for the IBM compiler
2015 # -m* pass through architecture-specific compiler args for GCC
2016 # -m*, -t[45]*, -txscale* pass through architecture-specific
2017 # compiler args for GCC
2018 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
2019 # -F/path gives path to uninstalled frameworks, gcc on darwin
2020 # @file GCC response files
2021 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
2022 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
2024 # Unknown arguments in both finalize_command and compile_command need
2025 # to be aesthetically quoted because they are evaled later.
2026 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2027 case $arg in
2028 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2029 arg="\"$arg\""
2031 esac
2032 compile_command="$compile_command $arg"
2033 finalize_command="$finalize_command $arg"
2034 compiler_flags="$compiler_flags $arg"
2035 continue
2038 -shrext)
2039 prev=shrext
2040 continue
2043 -no-fast-install)
2044 fast_install=no
2045 continue
2048 -no-install)
2049 case $host in
2050 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
2051 # The PATH hackery in wrapper scripts is required on Windows
2052 # and Darwin in order for the loader to find any dlls it needs.
2053 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2054 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2055 fast_install=no
2057 *) no_install=yes ;;
2058 esac
2059 continue
2062 -no-undefined)
2063 allow_undefined=no
2064 continue
2067 -objectlist)
2068 prev=objectlist
2069 continue
2072 -o) prev=output ;;
2074 -precious-files-regex)
2075 prev=precious_regex
2076 continue
2079 -release)
2080 prev=release
2081 continue
2084 -rpath)
2085 prev=rpath
2086 continue
2090 prev=xrpath
2091 continue
2094 -R*)
2095 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2096 # We need an absolute path.
2097 case $dir in
2098 [\\/]* | [A-Za-z]:[\\/]*) ;;
2100 $echo "$modename: only absolute run-paths are allowed" 1>&2
2101 exit $EXIT_FAILURE
2103 esac
2104 case "$xrpath " in
2105 *" $dir "*) ;;
2106 *) xrpath="$xrpath $dir" ;;
2107 esac
2108 continue
2111 -static | -static-libtool-libs)
2112 # The effects of -static are defined in a previous loop.
2113 # We used to do the same as -all-static on platforms that
2114 # didn't have a PIC flag, but the assumption that the effects
2115 # would be equivalent was wrong. It would break on at least
2116 # Digital Unix and AIX.
2117 continue
2120 -thread-safe)
2121 thread_safe=yes
2122 continue
2125 -version-info)
2126 prev=vinfo
2127 continue
2129 -version-number)
2130 prev=vinfo
2131 vinfo_number=yes
2132 continue
2135 -Wc,*)
2136 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2137 arg=
2138 save_ifs="$IFS"; IFS=','
2139 for flag in $args; do
2140 IFS="$save_ifs"
2141 case $flag in
2142 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2143 flag="\"$flag\""
2145 esac
2146 arg="$arg $wl$flag"
2147 compiler_flags="$compiler_flags $flag"
2148 done
2149 IFS="$save_ifs"
2150 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2153 -Wl,*)
2154 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2155 arg=
2156 save_ifs="$IFS"; IFS=','
2157 for flag in $args; do
2158 IFS="$save_ifs"
2159 case $flag in
2160 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2161 flag="\"$flag\""
2163 esac
2164 arg="$arg $wl$flag"
2165 compiler_flags="$compiler_flags $wl$flag"
2166 linker_flags="$linker_flags $flag"
2167 done
2168 IFS="$save_ifs"
2169 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2172 -Xcompiler)
2173 prev=xcompiler
2174 continue
2177 -Xlinker)
2178 prev=xlinker
2179 continue
2182 -XCClinker)
2183 prev=xcclinker
2184 continue
2187 # Some other compiler flag.
2188 -* | +*)
2189 # Unknown arguments in both finalize_command and compile_command need
2190 # to be aesthetically quoted because they are evaled later.
2191 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2192 case $arg in
2193 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2194 arg="\"$arg\""
2196 esac
2199 *.$objext)
2200 # A standard object.
2201 objs="$objs $arg"
2204 *.lo)
2205 # A libtool-controlled object.
2207 # Check to see that this really is a libtool object.
2208 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2209 pic_object=
2210 non_pic_object=
2212 # Read the .lo file
2213 # If there is no directory component, then add one.
2214 case $arg in
2215 */* | *\\*) . $arg ;;
2216 *) . ./$arg ;;
2217 esac
2219 if test -z "$pic_object" || \
2220 test -z "$non_pic_object" ||
2221 test "$pic_object" = none && \
2222 test "$non_pic_object" = none; then
2223 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2224 exit $EXIT_FAILURE
2227 # Extract subdirectory from the argument.
2228 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2229 if test "X$xdir" = "X$arg"; then
2230 xdir=
2231 else
2232 xdir="$xdir/"
2235 if test "$pic_object" != none; then
2236 # Prepend the subdirectory the object is found in.
2237 pic_object="$xdir$pic_object"
2239 if test "$prev" = dlfiles; then
2240 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2241 dlfiles="$dlfiles $pic_object"
2242 prev=
2243 continue
2244 else
2245 # If libtool objects are unsupported, then we need to preload.
2246 prev=dlprefiles
2250 # CHECK ME: I think I busted this. -Ossama
2251 if test "$prev" = dlprefiles; then
2252 # Preload the old-style object.
2253 dlprefiles="$dlprefiles $pic_object"
2254 prev=
2257 # A PIC object.
2258 libobjs="$libobjs $pic_object"
2259 arg="$pic_object"
2262 # Non-PIC object.
2263 if test "$non_pic_object" != none; then
2264 # Prepend the subdirectory the object is found in.
2265 non_pic_object="$xdir$non_pic_object"
2267 # A standard non-PIC object
2268 non_pic_objects="$non_pic_objects $non_pic_object"
2269 if test -z "$pic_object" || test "$pic_object" = none ; then
2270 arg="$non_pic_object"
2272 else
2273 # If the PIC object exists, use it instead.
2274 # $xdir was prepended to $pic_object above.
2275 non_pic_object="$pic_object"
2276 non_pic_objects="$non_pic_objects $non_pic_object"
2278 else
2279 # Only an error if not doing a dry-run.
2280 if test -z "$run"; then
2281 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2282 exit $EXIT_FAILURE
2283 else
2284 # Dry-run case.
2286 # Extract subdirectory from the argument.
2287 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2288 if test "X$xdir" = "X$arg"; then
2289 xdir=
2290 else
2291 xdir="$xdir/"
2294 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2295 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2296 libobjs="$libobjs $pic_object"
2297 non_pic_objects="$non_pic_objects $non_pic_object"
2302 *.$libext)
2303 # An archive.
2304 deplibs="$deplibs $arg"
2305 old_deplibs="$old_deplibs $arg"
2306 continue
2309 *.la)
2310 # A libtool-controlled library.
2312 if test "$prev" = dlfiles; then
2313 # This library was specified with -dlopen.
2314 dlfiles="$dlfiles $arg"
2315 prev=
2316 elif test "$prev" = dlprefiles; then
2317 # The library was specified with -dlpreopen.
2318 dlprefiles="$dlprefiles $arg"
2319 prev=
2320 else
2321 deplibs="$deplibs $arg"
2323 continue
2326 # Some other compiler argument.
2328 # Unknown arguments in both finalize_command and compile_command need
2329 # to be aesthetically quoted because they are evaled later.
2330 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2331 case $arg in
2332 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2333 arg="\"$arg\""
2335 esac
2337 esac # arg
2339 # Now actually substitute the argument into the commands.
2340 if test -n "$arg"; then
2341 compile_command="$compile_command $arg"
2342 finalize_command="$finalize_command $arg"
2344 done # argument parsing loop
2346 if test -n "$prev"; then
2347 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2348 $echo "$help" 1>&2
2349 exit $EXIT_FAILURE
2352 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2353 eval arg=\"$export_dynamic_flag_spec\"
2354 compile_command="$compile_command $arg"
2355 finalize_command="$finalize_command $arg"
2358 oldlibs=
2359 # calculate the name of the file, without its directory
2360 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2361 libobjs_save="$libobjs"
2363 if test -n "$shlibpath_var"; then
2364 # get the directories listed in $shlibpath_var
2365 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2366 else
2367 shlib_search_path=
2369 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2370 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2372 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2373 if test "X$output_objdir" = "X$output"; then
2374 output_objdir="$objdir"
2375 else
2376 output_objdir="$output_objdir/$objdir"
2378 # Create the object directory.
2379 if test ! -d "$output_objdir"; then
2380 $show "$mkdir $output_objdir"
2381 $run $mkdir $output_objdir
2382 exit_status=$?
2383 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2384 exit $exit_status
2388 # Determine the type of output
2389 case $output in
2391 $echo "$modename: you must specify an output file" 1>&2
2392 $echo "$help" 1>&2
2393 exit $EXIT_FAILURE
2395 *.$libext) linkmode=oldlib ;;
2396 *.lo | *.$objext) linkmode=obj ;;
2397 *.la) linkmode=lib ;;
2398 *) linkmode=prog ;; # Anything else should be a program.
2399 esac
2401 case $host in
2402 *cygwin* | *mingw* | *pw32*)
2403 # don't eliminate duplications in $postdeps and $predeps
2404 duplicate_compiler_generated_deps=yes
2407 duplicate_compiler_generated_deps=$duplicate_deps
2409 esac
2410 specialdeplibs=
2412 libs=
2413 # Find all interdependent deplibs by searching for libraries
2414 # that are linked more than once (e.g. -la -lb -la)
2415 for deplib in $deplibs; do
2416 if test "X$duplicate_deps" = "Xyes" ; then
2417 case "$libs " in
2418 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2419 esac
2421 libs="$libs $deplib"
2422 done
2424 if test "$linkmode" = lib; then
2425 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2427 # Compute libraries that are listed more than once in $predeps
2428 # $postdeps and mark them as special (i.e., whose duplicates are
2429 # not to be eliminated).
2430 pre_post_deps=
2431 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2432 for pre_post_dep in $predeps $postdeps; do
2433 case "$pre_post_deps " in
2434 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2435 esac
2436 pre_post_deps="$pre_post_deps $pre_post_dep"
2437 done
2439 pre_post_deps=
2442 deplibs=
2443 newdependency_libs=
2444 newlib_search_path=
2445 need_relink=no # whether we're linking any uninstalled libtool libraries
2446 notinst_deplibs= # not-installed libtool libraries
2447 case $linkmode in
2448 lib)
2449 passes="conv link"
2450 for file in $dlfiles $dlprefiles; do
2451 case $file in
2452 *.la) ;;
2454 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2455 exit $EXIT_FAILURE
2457 esac
2458 done
2460 prog)
2461 compile_deplibs=
2462 finalize_deplibs=
2463 alldeplibs=no
2464 newdlfiles=
2465 newdlprefiles=
2466 passes="conv scan dlopen dlpreopen link"
2468 *) passes="conv"
2470 esac
2471 for pass in $passes; do
2472 if test "$linkmode,$pass" = "lib,link" ||
2473 test "$linkmode,$pass" = "prog,scan"; then
2474 libs="$deplibs"
2475 deplibs=
2477 if test "$linkmode" = prog; then
2478 case $pass in
2479 dlopen) libs="$dlfiles" ;;
2480 dlpreopen) libs="$dlprefiles" ;;
2481 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2482 esac
2484 if test "$pass" = dlopen; then
2485 # Collect dlpreopened libraries
2486 save_deplibs="$deplibs"
2487 deplibs=
2489 for deplib in $libs; do
2490 lib=
2491 found=no
2492 case $deplib in
2493 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2494 if test "$linkmode,$pass" = "prog,link"; then
2495 compile_deplibs="$deplib $compile_deplibs"
2496 finalize_deplibs="$deplib $finalize_deplibs"
2497 else
2498 compiler_flags="$compiler_flags $deplib"
2500 continue
2502 -l*)
2503 if test "$linkmode" != lib && test "$linkmode" != prog; then
2504 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2505 continue
2507 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2508 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2509 for search_ext in .la $std_shrext .so .a; do
2510 # Search the libtool library
2511 lib="$searchdir/lib${name}${search_ext}"
2512 if test -f "$lib"; then
2513 if test "$search_ext" = ".la"; then
2514 found=yes
2515 else
2516 found=no
2518 break 2
2520 done
2521 done
2522 if test "$found" != yes; then
2523 # deplib doesn't seem to be a libtool library
2524 if test "$linkmode,$pass" = "prog,link"; then
2525 compile_deplibs="$deplib $compile_deplibs"
2526 finalize_deplibs="$deplib $finalize_deplibs"
2527 else
2528 deplibs="$deplib $deplibs"
2529 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2531 continue
2532 else # deplib is a libtool library
2533 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2534 # We need to do some special things here, and not later.
2535 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2536 case " $predeps $postdeps " in
2537 *" $deplib "*)
2538 if (${SED} -e '2q' $lib |
2539 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2540 library_names=
2541 old_library=
2542 case $lib in
2543 */* | *\\*) . $lib ;;
2544 *) . ./$lib ;;
2545 esac
2546 for l in $old_library $library_names; do
2547 ll="$l"
2548 done
2549 if test "X$ll" = "X$old_library" ; then # only static version available
2550 found=no
2551 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2552 test "X$ladir" = "X$lib" && ladir="."
2553 lib=$ladir/$old_library
2554 if test "$linkmode,$pass" = "prog,link"; then
2555 compile_deplibs="$deplib $compile_deplibs"
2556 finalize_deplibs="$deplib $finalize_deplibs"
2557 else
2558 deplibs="$deplib $deplibs"
2559 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2561 continue
2565 *) ;;
2566 esac
2569 ;; # -l
2570 -L*)
2571 case $linkmode in
2572 lib)
2573 deplibs="$deplib $deplibs"
2574 test "$pass" = conv && continue
2575 newdependency_libs="$deplib $newdependency_libs"
2576 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2578 prog)
2579 if test "$pass" = conv; then
2580 deplibs="$deplib $deplibs"
2581 continue
2583 if test "$pass" = scan; then
2584 deplibs="$deplib $deplibs"
2585 else
2586 compile_deplibs="$deplib $compile_deplibs"
2587 finalize_deplibs="$deplib $finalize_deplibs"
2589 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2592 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2594 esac # linkmode
2595 continue
2596 ;; # -L
2597 -R*)
2598 if test "$pass" = link; then
2599 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2600 # Make sure the xrpath contains only unique directories.
2601 case "$xrpath " in
2602 *" $dir "*) ;;
2603 *) xrpath="$xrpath $dir" ;;
2604 esac
2606 deplibs="$deplib $deplibs"
2607 continue
2609 *.la) lib="$deplib" ;;
2610 *.$libext)
2611 if test "$pass" = conv; then
2612 deplibs="$deplib $deplibs"
2613 continue
2615 case $linkmode in
2616 lib)
2617 valid_a_lib=no
2618 case $deplibs_check_method in
2619 match_pattern*)
2620 set dummy $deplibs_check_method
2621 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2622 if eval $echo \"$deplib\" 2>/dev/null \
2623 | $SED 10q \
2624 | $EGREP "$match_pattern_regex" > /dev/null; then
2625 valid_a_lib=yes
2628 pass_all)
2629 valid_a_lib=yes
2631 esac
2632 if test "$valid_a_lib" != yes; then
2633 $echo
2634 $echo "*** Warning: Trying to link with static lib archive $deplib."
2635 $echo "*** I have the capability to make that library automatically link in when"
2636 $echo "*** you link to this library. But I can only do this if you have a"
2637 $echo "*** shared version of the library, which you do not appear to have"
2638 $echo "*** because the file extensions .$libext of this argument makes me believe"
2639 $echo "*** that it is just a static archive that I should not used here."
2640 else
2641 $echo
2642 $echo "*** Warning: Linking the shared library $output against the"
2643 $echo "*** static library $deplib is not portable!"
2644 deplibs="$deplib $deplibs"
2646 continue
2648 prog)
2649 if test "$pass" != link; then
2650 deplibs="$deplib $deplibs"
2651 else
2652 compile_deplibs="$deplib $compile_deplibs"
2653 finalize_deplibs="$deplib $finalize_deplibs"
2655 continue
2657 esac # linkmode
2658 ;; # *.$libext
2659 *.lo | *.$objext)
2660 if test "$pass" = conv; then
2661 deplibs="$deplib $deplibs"
2662 elif test "$linkmode" = prog; then
2663 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2664 # If there is no dlopen support or we're linking statically,
2665 # we need to preload.
2666 newdlprefiles="$newdlprefiles $deplib"
2667 compile_deplibs="$deplib $compile_deplibs"
2668 finalize_deplibs="$deplib $finalize_deplibs"
2669 else
2670 newdlfiles="$newdlfiles $deplib"
2673 continue
2675 %DEPLIBS%)
2676 alldeplibs=yes
2677 continue
2679 esac # case $deplib
2680 if test "$found" = yes || test -f "$lib"; then :
2681 else
2682 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2683 exit $EXIT_FAILURE
2686 # Check to see that this really is a libtool archive.
2687 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2688 else
2689 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2690 exit $EXIT_FAILURE
2693 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2694 test "X$ladir" = "X$lib" && ladir="."
2696 dlname=
2697 dlopen=
2698 dlpreopen=
2699 libdir=
2700 library_names=
2701 old_library=
2702 # If the library was installed with an old release of libtool,
2703 # it will not redefine variables installed, or shouldnotlink
2704 installed=yes
2705 shouldnotlink=no
2706 avoidtemprpath=
2709 # Read the .la file
2710 case $lib in
2711 */* | *\\*) . $lib ;;
2712 *) . ./$lib ;;
2713 esac
2715 if test "$linkmode,$pass" = "lib,link" ||
2716 test "$linkmode,$pass" = "prog,scan" ||
2717 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2718 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2719 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2722 if test "$pass" = conv; then
2723 # Only check for convenience libraries
2724 deplibs="$lib $deplibs"
2725 if test -z "$libdir"; then
2726 if test -z "$old_library"; then
2727 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2728 exit $EXIT_FAILURE
2730 # It is a libtool convenience library, so add in its objects.
2731 convenience="$convenience $ladir/$objdir/$old_library"
2732 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2733 tmp_libs=
2734 for deplib in $dependency_libs; do
2735 deplibs="$deplib $deplibs"
2736 if test "X$duplicate_deps" = "Xyes" ; then
2737 case "$tmp_libs " in
2738 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2739 esac
2741 tmp_libs="$tmp_libs $deplib"
2742 done
2743 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2744 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2745 exit $EXIT_FAILURE
2747 continue
2748 fi # $pass = conv
2751 # Get the name of the library we link against.
2752 linklib=
2753 for l in $old_library $library_names; do
2754 linklib="$l"
2755 done
2756 if test -z "$linklib"; then
2757 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2758 exit $EXIT_FAILURE
2761 # This library was specified with -dlopen.
2762 if test "$pass" = dlopen; then
2763 if test -z "$libdir"; then
2764 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2765 exit $EXIT_FAILURE
2767 if test -z "$dlname" ||
2768 test "$dlopen_support" != yes ||
2769 test "$build_libtool_libs" = no; then
2770 # If there is no dlname, no dlopen support or we're linking
2771 # statically, we need to preload. We also need to preload any
2772 # dependent libraries so libltdl's deplib preloader doesn't
2773 # bomb out in the load deplibs phase.
2774 dlprefiles="$dlprefiles $lib $dependency_libs"
2775 else
2776 newdlfiles="$newdlfiles $lib"
2778 continue
2779 fi # $pass = dlopen
2781 # We need an absolute path.
2782 case $ladir in
2783 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2785 abs_ladir=`cd "$ladir" && pwd`
2786 if test -z "$abs_ladir"; then
2787 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2788 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2789 abs_ladir="$ladir"
2792 esac
2793 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2795 # Find the relevant object directory and library name.
2796 if test "X$installed" = Xyes; then
2797 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2798 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2799 dir="$ladir"
2800 absdir="$abs_ladir"
2801 libdir="$abs_ladir"
2802 else
2803 dir="$libdir"
2804 absdir="$libdir"
2806 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2807 else
2808 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2809 dir="$ladir"
2810 absdir="$abs_ladir"
2811 # Remove this search path later
2812 notinst_path="$notinst_path $abs_ladir"
2813 else
2814 dir="$ladir/$objdir"
2815 absdir="$abs_ladir/$objdir"
2816 # Remove this search path later
2817 notinst_path="$notinst_path $abs_ladir"
2819 fi # $installed = yes
2820 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2822 # This library was specified with -dlpreopen.
2823 if test "$pass" = dlpreopen; then
2824 if test -z "$libdir"; then
2825 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2826 exit $EXIT_FAILURE
2828 # Prefer using a static library (so that no silly _DYNAMIC symbols
2829 # are required to link).
2830 if test -n "$old_library"; then
2831 newdlprefiles="$newdlprefiles $dir/$old_library"
2832 # Otherwise, use the dlname, so that lt_dlopen finds it.
2833 elif test -n "$dlname"; then
2834 newdlprefiles="$newdlprefiles $dir/$dlname"
2835 else
2836 newdlprefiles="$newdlprefiles $dir/$linklib"
2838 fi # $pass = dlpreopen
2840 if test -z "$libdir"; then
2841 # Link the convenience library
2842 if test "$linkmode" = lib; then
2843 deplibs="$dir/$old_library $deplibs"
2844 elif test "$linkmode,$pass" = "prog,link"; then
2845 compile_deplibs="$dir/$old_library $compile_deplibs"
2846 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2847 else
2848 deplibs="$lib $deplibs" # used for prog,scan pass
2850 continue
2854 if test "$linkmode" = prog && test "$pass" != link; then
2855 newlib_search_path="$newlib_search_path $ladir"
2856 deplibs="$lib $deplibs"
2858 linkalldeplibs=no
2859 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2860 test "$build_libtool_libs" = no; then
2861 linkalldeplibs=yes
2864 tmp_libs=
2865 for deplib in $dependency_libs; do
2866 case $deplib in
2867 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2868 esac
2869 # Need to link against all dependency_libs?
2870 if test "$linkalldeplibs" = yes; then
2871 deplibs="$deplib $deplibs"
2872 else
2873 # Need to hardcode shared library paths
2874 # or/and link against static libraries
2875 newdependency_libs="$deplib $newdependency_libs"
2877 if test "X$duplicate_deps" = "Xyes" ; then
2878 case "$tmp_libs " in
2879 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2880 esac
2882 tmp_libs="$tmp_libs $deplib"
2883 done # for deplib
2884 continue
2885 fi # $linkmode = prog...
2887 if test "$linkmode,$pass" = "prog,link"; then
2888 if test -n "$library_names" &&
2889 { { test "$prefer_static_libs" = no ||
2890 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2891 test -z "$old_library"; }; then
2892 # We need to hardcode the library path
2893 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2894 # Make sure the rpath contains only unique directories.
2895 case "$temp_rpath " in
2896 *" $dir "*) ;;
2897 *" $absdir "*) ;;
2898 *) temp_rpath="$temp_rpath $absdir" ;;
2899 esac
2902 # Hardcode the library path.
2903 # Skip directories that are in the system default run-time
2904 # search path.
2905 case " $sys_lib_dlsearch_path " in
2906 *" $absdir "*) ;;
2908 case "$compile_rpath " in
2909 *" $absdir "*) ;;
2910 *) compile_rpath="$compile_rpath $absdir"
2911 esac
2913 esac
2914 case " $sys_lib_dlsearch_path " in
2915 *" $libdir "*) ;;
2917 case "$finalize_rpath " in
2918 *" $libdir "*) ;;
2919 *) finalize_rpath="$finalize_rpath $libdir"
2920 esac
2922 esac
2923 fi # $linkmode,$pass = prog,link...
2925 if test "$alldeplibs" = yes &&
2926 { test "$deplibs_check_method" = pass_all ||
2927 { test "$build_libtool_libs" = yes &&
2928 test -n "$library_names"; }; }; then
2929 # We only need to search for static libraries
2930 continue
2934 link_static=no # Whether the deplib will be linked statically
2935 use_static_libs=$prefer_static_libs
2936 if test "$use_static_libs" = built && test "$installed" = yes ; then
2937 use_static_libs=no
2939 if test -n "$library_names" &&
2940 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2941 if test "$installed" = no; then
2942 notinst_deplibs="$notinst_deplibs $lib"
2943 need_relink=yes
2945 # This is a shared library
2947 # Warn about portability, can't link against -module's on
2948 # some systems (darwin)
2949 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2950 $echo
2951 if test "$linkmode" = prog; then
2952 $echo "*** Warning: Linking the executable $output against the loadable module"
2953 else
2954 $echo "*** Warning: Linking the shared library $output against the loadable module"
2956 $echo "*** $linklib is not portable!"
2958 if test "$linkmode" = lib &&
2959 test "$hardcode_into_libs" = yes; then
2960 # Hardcode the library path.
2961 # Skip directories that are in the system default run-time
2962 # search path.
2963 case " $sys_lib_dlsearch_path " in
2964 *" $absdir "*) ;;
2966 case "$compile_rpath " in
2967 *" $absdir "*) ;;
2968 *) compile_rpath="$compile_rpath $absdir"
2969 esac
2971 esac
2972 case " $sys_lib_dlsearch_path " in
2973 *" $libdir "*) ;;
2975 case "$finalize_rpath " in
2976 *" $libdir "*) ;;
2977 *) finalize_rpath="$finalize_rpath $libdir"
2978 esac
2980 esac
2983 if test -n "$old_archive_from_expsyms_cmds"; then
2984 # figure out the soname
2985 set dummy $library_names
2986 realname="$2"
2987 shift; shift
2988 libname=`eval \\$echo \"$libname_spec\"`
2989 # use dlname if we got it. it's perfectly good, no?
2990 if test -n "$dlname"; then
2991 soname="$dlname"
2992 elif test -n "$soname_spec"; then
2993 # bleh windows
2994 case $host in
2995 *cygwin* | mingw*)
2996 major=`expr $current - $age`
2997 versuffix="-$major"
2999 esac
3000 eval soname=\"$soname_spec\"
3001 else
3002 soname="$realname"
3005 # Make a new name for the extract_expsyms_cmds to use
3006 soroot="$soname"
3007 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3008 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3010 # If the library has no export list, then create one now
3011 if test -f "$output_objdir/$soname-def"; then :
3012 else
3013 $show "extracting exported symbol list from \`$soname'"
3014 save_ifs="$IFS"; IFS='~'
3015 cmds=$extract_expsyms_cmds
3016 for cmd in $cmds; do
3017 IFS="$save_ifs"
3018 eval cmd=\"$cmd\"
3019 $show "$cmd"
3020 $run eval "$cmd" || exit $?
3021 done
3022 IFS="$save_ifs"
3025 # Create $newlib
3026 if test -f "$output_objdir/$newlib"; then :; else
3027 $show "generating import library for \`$soname'"
3028 save_ifs="$IFS"; IFS='~'
3029 cmds=$old_archive_from_expsyms_cmds
3030 for cmd in $cmds; do
3031 IFS="$save_ifs"
3032 eval cmd=\"$cmd\"
3033 $show "$cmd"
3034 $run eval "$cmd" || exit $?
3035 done
3036 IFS="$save_ifs"
3038 # make sure the library variables are pointing to the new library
3039 dir=$output_objdir
3040 linklib=$newlib
3041 fi # test -n "$old_archive_from_expsyms_cmds"
3043 if test "$linkmode" = prog || test "$mode" != relink; then
3044 add_shlibpath=
3045 add_dir=
3046 add=
3047 lib_linked=yes
3048 case $hardcode_action in
3049 immediate | unsupported)
3050 if test "$hardcode_direct" = no; then
3051 add="$dir/$linklib"
3052 case $host in
3053 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3054 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3055 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3056 *-*-unixware7*) add_dir="-L$dir" ;;
3057 *-*-darwin* )
3058 # if the lib is a module then we can not link against
3059 # it, someone is ignoring the new warnings I added
3060 if /usr/bin/file -L $add 2> /dev/null |
3061 $EGREP ": [^:]* bundle" >/dev/null ; then
3062 $echo "** Warning, lib $linklib is a module, not a shared library"
3063 if test -z "$old_library" ; then
3064 $echo
3065 $echo "** And there doesn't seem to be a static archive available"
3066 $echo "** The link will probably fail, sorry"
3067 else
3068 add="$dir/$old_library"
3071 esac
3072 elif test "$hardcode_minus_L" = no; then
3073 case $host in
3074 *-*-sunos*) add_shlibpath="$dir" ;;
3075 esac
3076 add_dir="-L$dir"
3077 add="-l$name"
3078 elif test "$hardcode_shlibpath_var" = no; then
3079 add_shlibpath="$dir"
3080 add="-l$name"
3081 else
3082 lib_linked=no
3085 relink)
3086 if test "$hardcode_direct" = yes; then
3087 add="$dir/$linklib"
3088 elif test "$hardcode_minus_L" = yes; then
3089 add_dir="-L$dir"
3090 # Try looking first in the location we're being installed to.
3091 if test -n "$inst_prefix_dir"; then
3092 case $libdir in
3093 [\\/]*)
3094 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3096 esac
3098 add="-l$name"
3099 elif test "$hardcode_shlibpath_var" = yes; then
3100 add_shlibpath="$dir"
3101 add="-l$name"
3102 else
3103 lib_linked=no
3106 *) lib_linked=no ;;
3107 esac
3109 if test "$lib_linked" != yes; then
3110 $echo "$modename: configuration error: unsupported hardcode properties"
3111 exit $EXIT_FAILURE
3114 if test -n "$add_shlibpath"; then
3115 case :$compile_shlibpath: in
3116 *":$add_shlibpath:"*) ;;
3117 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3118 esac
3120 if test "$linkmode" = prog; then
3121 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3122 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3123 else
3124 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3125 test -n "$add" && deplibs="$add $deplibs"
3126 if test "$hardcode_direct" != yes && \
3127 test "$hardcode_minus_L" != yes && \
3128 test "$hardcode_shlibpath_var" = yes; then
3129 case :$finalize_shlibpath: in
3130 *":$libdir:"*) ;;
3131 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3132 esac
3137 if test "$linkmode" = prog || test "$mode" = relink; then
3138 add_shlibpath=
3139 add_dir=
3140 add=
3141 # Finalize command for both is simple: just hardcode it.
3142 if test "$hardcode_direct" = yes; then
3143 add="$libdir/$linklib"
3144 elif test "$hardcode_minus_L" = yes; then
3145 add_dir="-L$libdir"
3146 add="-l$name"
3147 elif test "$hardcode_shlibpath_var" = yes; then
3148 case :$finalize_shlibpath: in
3149 *":$libdir:"*) ;;
3150 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3151 esac
3152 add="-l$name"
3153 elif test "$hardcode_automatic" = yes; then
3154 if test -n "$inst_prefix_dir" &&
3155 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3156 add="$inst_prefix_dir$libdir/$linklib"
3157 else
3158 add="$libdir/$linklib"
3160 else
3161 # We cannot seem to hardcode it, guess we'll fake it.
3162 add_dir="-L$libdir"
3163 # Try looking first in the location we're being installed to.
3164 if test -n "$inst_prefix_dir"; then
3165 case $libdir in
3166 [\\/]*)
3167 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3169 esac
3171 add="-l$name"
3174 if test "$linkmode" = prog; then
3175 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3176 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3177 else
3178 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3179 test -n "$add" && deplibs="$add $deplibs"
3182 elif test "$linkmode" = prog; then
3183 # Here we assume that one of hardcode_direct or hardcode_minus_L
3184 # is not unsupported. This is valid on all known static and
3185 # shared platforms.
3186 if test "$hardcode_direct" != unsupported; then
3187 test -n "$old_library" && linklib="$old_library"
3188 compile_deplibs="$dir/$linklib $compile_deplibs"
3189 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3190 else
3191 compile_deplibs="-l$name -L$dir $compile_deplibs"
3192 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3194 elif test "$build_libtool_libs" = yes; then
3195 # Not a shared library
3196 if test "$deplibs_check_method" != pass_all; then
3197 # We're trying link a shared library against a static one
3198 # but the system doesn't support it.
3200 # Just print a warning and add the library to dependency_libs so
3201 # that the program can be linked against the static library.
3202 $echo
3203 $echo "*** Warning: This system can not link to static lib archive $lib."
3204 $echo "*** I have the capability to make that library automatically link in when"
3205 $echo "*** you link to this library. But I can only do this if you have a"
3206 $echo "*** shared version of the library, which you do not appear to have."
3207 if test "$module" = yes; then
3208 $echo "*** But as you try to build a module library, libtool will still create "
3209 $echo "*** a static module, that should work as long as the dlopening application"
3210 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3211 if test -z "$global_symbol_pipe"; then
3212 $echo
3213 $echo "*** However, this would only work if libtool was able to extract symbol"
3214 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3215 $echo "*** not find such a program. So, this module is probably useless."
3216 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3218 if test "$build_old_libs" = no; then
3219 build_libtool_libs=module
3220 build_old_libs=yes
3221 else
3222 build_libtool_libs=no
3225 else
3226 deplibs="$dir/$old_library $deplibs"
3227 link_static=yes
3229 fi # link shared/static library?
3231 if test "$linkmode" = lib; then
3232 if test -n "$dependency_libs" &&
3233 { test "$hardcode_into_libs" != yes ||
3234 test "$build_old_libs" = yes ||
3235 test "$link_static" = yes; }; then
3236 # Extract -R from dependency_libs
3237 temp_deplibs=
3238 for libdir in $dependency_libs; do
3239 case $libdir in
3240 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3241 case " $xrpath " in
3242 *" $temp_xrpath "*) ;;
3243 *) xrpath="$xrpath $temp_xrpath";;
3244 esac;;
3245 *) temp_deplibs="$temp_deplibs $libdir";;
3246 esac
3247 done
3248 dependency_libs="$temp_deplibs"
3251 newlib_search_path="$newlib_search_path $absdir"
3252 # Link against this library
3253 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3254 # ... and its dependency_libs
3255 tmp_libs=
3256 for deplib in $dependency_libs; do
3257 newdependency_libs="$deplib $newdependency_libs"
3258 if test "X$duplicate_deps" = "Xyes" ; then
3259 case "$tmp_libs " in
3260 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3261 esac
3263 tmp_libs="$tmp_libs $deplib"
3264 done
3266 if test "$link_all_deplibs" != no; then
3267 # Add the search paths of all dependency libraries
3268 for deplib in $dependency_libs; do
3269 case $deplib in
3270 -L*) path="$deplib" ;;
3271 *.la)
3272 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3273 test "X$dir" = "X$deplib" && dir="."
3274 # We need an absolute path.
3275 case $dir in
3276 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3278 absdir=`cd "$dir" && pwd`
3279 if test -z "$absdir"; then
3280 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3281 absdir="$dir"
3284 esac
3285 if grep "^installed=no" $deplib > /dev/null; then
3286 path="$absdir/$objdir"
3287 else
3288 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3289 if test -z "$libdir"; then
3290 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3291 exit $EXIT_FAILURE
3293 if test "$absdir" != "$libdir"; then
3294 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3296 path="$absdir"
3298 depdepl=
3299 case $host in
3300 *-*-darwin*)
3301 # we do not want to link against static libs,
3302 # but need to link against shared
3303 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3304 if test -n "$deplibrary_names" ; then
3305 for tmp in $deplibrary_names ; do
3306 depdepl=$tmp
3307 done
3308 if test -f "$path/$depdepl" ; then
3309 depdepl="$path/$depdepl"
3311 # do not add paths which are already there
3312 case " $newlib_search_path " in
3313 *" $path "*) ;;
3314 *) newlib_search_path="$newlib_search_path $path";;
3315 esac
3317 path=""
3320 path="-L$path"
3322 esac
3324 -l*)
3325 case $host in
3326 *-*-darwin*)
3327 # Again, we only want to link against shared libraries
3328 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3329 for tmp in $newlib_search_path ; do
3330 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3331 eval depdepl="$tmp/lib$tmp_libs.dylib"
3332 break
3334 done
3335 path=""
3337 *) continue ;;
3338 esac
3340 *) continue ;;
3341 esac
3342 case " $deplibs " in
3343 *" $path "*) ;;
3344 *) deplibs="$path $deplibs" ;;
3345 esac
3346 case " $deplibs " in
3347 *" $depdepl "*) ;;
3348 *) deplibs="$depdepl $deplibs" ;;
3349 esac
3350 done
3351 fi # link_all_deplibs != no
3352 fi # linkmode = lib
3353 done # for deplib in $libs
3354 dependency_libs="$newdependency_libs"
3355 if test "$pass" = dlpreopen; then
3356 # Link the dlpreopened libraries before other libraries
3357 for deplib in $save_deplibs; do
3358 deplibs="$deplib $deplibs"
3359 done
3361 if test "$pass" != dlopen; then
3362 if test "$pass" != conv; then
3363 # Make sure lib_search_path contains only unique directories.
3364 lib_search_path=
3365 for dir in $newlib_search_path; do
3366 case "$lib_search_path " in
3367 *" $dir "*) ;;
3368 *) lib_search_path="$lib_search_path $dir" ;;
3369 esac
3370 done
3371 newlib_search_path=
3374 if test "$linkmode,$pass" != "prog,link"; then
3375 vars="deplibs"
3376 else
3377 vars="compile_deplibs finalize_deplibs"
3379 for var in $vars dependency_libs; do
3380 # Add libraries to $var in reverse order
3381 eval tmp_libs=\"\$$var\"
3382 new_libs=
3383 for deplib in $tmp_libs; do
3384 # FIXME: Pedantically, this is the right thing to do, so
3385 # that some nasty dependency loop isn't accidentally
3386 # broken:
3387 #new_libs="$deplib $new_libs"
3388 # Pragmatically, this seems to cause very few problems in
3389 # practice:
3390 case $deplib in
3391 -L*) new_libs="$deplib $new_libs" ;;
3392 -R*) ;;
3394 # And here is the reason: when a library appears more
3395 # than once as an explicit dependence of a library, or
3396 # is implicitly linked in more than once by the
3397 # compiler, it is considered special, and multiple
3398 # occurrences thereof are not removed. Compare this
3399 # with having the same library being listed as a
3400 # dependency of multiple other libraries: in this case,
3401 # we know (pedantically, we assume) the library does not
3402 # need to be listed more than once, so we keep only the
3403 # last copy. This is not always right, but it is rare
3404 # enough that we require users that really mean to play
3405 # such unportable linking tricks to link the library
3406 # using -Wl,-lname, so that libtool does not consider it
3407 # for duplicate removal.
3408 case " $specialdeplibs " in
3409 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3411 case " $new_libs " in
3412 *" $deplib "*) ;;
3413 *) new_libs="$deplib $new_libs" ;;
3414 esac
3416 esac
3418 esac
3419 done
3420 tmp_libs=
3421 for deplib in $new_libs; do
3422 case $deplib in
3423 -L*)
3424 case " $tmp_libs " in
3425 *" $deplib "*) ;;
3426 *) tmp_libs="$tmp_libs $deplib" ;;
3427 esac
3429 *) tmp_libs="$tmp_libs $deplib" ;;
3430 esac
3431 done
3432 eval $var=\"$tmp_libs\"
3433 done # for var
3435 # Last step: remove runtime libs from dependency_libs
3436 # (they stay in deplibs)
3437 tmp_libs=
3438 for i in $dependency_libs ; do
3439 case " $predeps $postdeps $compiler_lib_search_path " in
3440 *" $i "*)
3441 i=""
3443 esac
3444 if test -n "$i" ; then
3445 tmp_libs="$tmp_libs $i"
3447 done
3448 dependency_libs=$tmp_libs
3449 done # for pass
3450 if test "$linkmode" = prog; then
3451 dlfiles="$newdlfiles"
3452 dlprefiles="$newdlprefiles"
3455 case $linkmode in
3456 oldlib)
3457 if test -n "$deplibs"; then
3458 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3461 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3462 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3465 if test -n "$rpath"; then
3466 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3469 if test -n "$xrpath"; then
3470 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3473 if test -n "$vinfo"; then
3474 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3477 if test -n "$release"; then
3478 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3481 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3482 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3485 # Now set the variables for building old libraries.
3486 build_libtool_libs=no
3487 oldlibs="$output"
3488 objs="$objs$old_deplibs"
3491 lib)
3492 # Make sure we only generate libraries of the form `libNAME.la'.
3493 case $outputname in
3494 lib*)
3495 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3496 eval shared_ext=\"$shrext_cmds\"
3497 eval libname=\"$libname_spec\"
3500 if test "$module" = no; then
3501 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3502 $echo "$help" 1>&2
3503 exit $EXIT_FAILURE
3505 if test "$need_lib_prefix" != no; then
3506 # Add the "lib" prefix for modules if required
3507 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3508 eval shared_ext=\"$shrext_cmds\"
3509 eval libname=\"$libname_spec\"
3510 else
3511 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3514 esac
3516 if test -n "$objs"; then
3517 if test "$deplibs_check_method" != pass_all; then
3518 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3519 exit $EXIT_FAILURE
3520 else
3521 $echo
3522 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3523 $echo "*** objects $objs is not portable!"
3524 libobjs="$libobjs $objs"
3528 if test "$dlself" != no; then
3529 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3532 set dummy $rpath
3533 if test "$#" -gt 2; then
3534 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3536 install_libdir="$2"
3538 oldlibs=
3539 if test -z "$rpath"; then
3540 if test "$build_libtool_libs" = yes; then
3541 # Building a libtool convenience library.
3542 # Some compilers have problems with a `.al' extension so
3543 # convenience libraries should have the same extension an
3544 # archive normally would.
3545 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3546 build_libtool_libs=convenience
3547 build_old_libs=yes
3550 if test -n "$vinfo"; then
3551 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3554 if test -n "$release"; then
3555 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3557 else
3559 # Parse the version information argument.
3560 save_ifs="$IFS"; IFS=':'
3561 set dummy $vinfo 0 0 0
3562 IFS="$save_ifs"
3564 if test -n "$8"; then
3565 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3566 $echo "$help" 1>&2
3567 exit $EXIT_FAILURE
3570 # convert absolute version numbers to libtool ages
3571 # this retains compatibility with .la files and attempts
3572 # to make the code below a bit more comprehensible
3574 case $vinfo_number in
3575 yes)
3576 number_major="$2"
3577 number_minor="$3"
3578 number_revision="$4"
3580 # There are really only two kinds -- those that
3581 # use the current revision as the major version
3582 # and those that subtract age and use age as
3583 # a minor version. But, then there is irix
3584 # which has an extra 1 added just for fun
3586 case $version_type in
3587 darwin|linux|osf|windows|none)
3588 current=`expr $number_major + $number_minor`
3589 age="$number_minor"
3590 revision="$number_revision"
3592 freebsd-aout|freebsd-elf|sunos)
3593 current="$number_major"
3594 revision="$number_minor"
3595 age="0"
3597 irix|nonstopux)
3598 current=`expr $number_major + $number_minor`
3599 age="$number_minor"
3600 revision="$number_minor"
3601 lt_irix_increment=no
3603 esac
3606 current="$2"
3607 revision="$3"
3608 age="$4"
3610 esac
3612 # Check that each of the things are valid numbers.
3613 case $current in
3614 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]) ;;
3616 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3617 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3618 exit $EXIT_FAILURE
3620 esac
3622 case $revision in
3623 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]) ;;
3625 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3626 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3627 exit $EXIT_FAILURE
3629 esac
3631 case $age in
3632 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]) ;;
3634 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3635 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3636 exit $EXIT_FAILURE
3638 esac
3640 if test "$age" -gt "$current"; then
3641 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3642 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3643 exit $EXIT_FAILURE
3646 # Calculate the version variables.
3647 major=
3648 versuffix=
3649 verstring=
3650 case $version_type in
3651 none) ;;
3653 darwin)
3654 # Like Linux, but with the current version available in
3655 # verstring for coding it into the library header
3656 major=.`expr $current - $age`
3657 versuffix="$major.$age.$revision"
3658 # Darwin ld doesn't like 0 for these options...
3659 minor_current=`expr $current + 1`
3660 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3661 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3664 freebsd-aout)
3665 major=".$current"
3666 versuffix=".$current.$revision";
3669 freebsd-elf)
3670 major=".$current"
3671 versuffix=".$current";
3674 irix | nonstopux)
3675 if test "X$lt_irix_increment" = "Xno"; then
3676 major=`expr $current - $age`
3677 else
3678 major=`expr $current - $age + 1`
3680 case $version_type in
3681 nonstopux) verstring_prefix=nonstopux ;;
3682 *) verstring_prefix=sgi ;;
3683 esac
3684 verstring="$verstring_prefix$major.$revision"
3686 # Add in all the interfaces that we are compatible with.
3687 loop=$revision
3688 while test "$loop" -ne 0; do
3689 iface=`expr $revision - $loop`
3690 loop=`expr $loop - 1`
3691 verstring="$verstring_prefix$major.$iface:$verstring"
3692 done
3694 # Before this point, $major must not contain `.'.
3695 major=.$major
3696 versuffix="$major.$revision"
3699 linux)
3700 major=.`expr $current - $age`
3701 versuffix="$major.$age.$revision"
3704 osf)
3705 major=.`expr $current - $age`
3706 versuffix=".$current.$age.$revision"
3707 verstring="$current.$age.$revision"
3709 # Add in all the interfaces that we are compatible with.
3710 loop=$age
3711 while test "$loop" -ne 0; do
3712 iface=`expr $current - $loop`
3713 loop=`expr $loop - 1`
3714 verstring="$verstring:${iface}.0"
3715 done
3717 # Make executables depend on our current version.
3718 verstring="$verstring:${current}.0"
3721 sunos)
3722 major=".$current"
3723 versuffix=".$current.$revision"
3726 windows)
3727 # Use '-' rather than '.', since we only want one
3728 # extension on DOS 8.3 filesystems.
3729 major=`expr $current - $age`
3730 versuffix="-$major"
3734 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3735 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3736 exit $EXIT_FAILURE
3738 esac
3740 # Clear the version info if we defaulted, and they specified a release.
3741 if test -z "$vinfo" && test -n "$release"; then
3742 major=
3743 case $version_type in
3744 darwin)
3745 # we can't check for "0.0" in archive_cmds due to quoting
3746 # problems, so we reset it completely
3747 verstring=
3750 verstring="0.0"
3752 esac
3753 if test "$need_version" = no; then
3754 versuffix=
3755 else
3756 versuffix=".0.0"
3760 # Remove version info from name if versioning should be avoided
3761 if test "$avoid_version" = yes && test "$need_version" = no; then
3762 major=
3763 versuffix=
3764 verstring=""
3767 # Check to see if the archive will have undefined symbols.
3768 if test "$allow_undefined" = yes; then
3769 if test "$allow_undefined_flag" = unsupported; then
3770 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3771 build_libtool_libs=no
3772 build_old_libs=yes
3774 else
3775 # Don't allow undefined symbols.
3776 allow_undefined_flag="$no_undefined_flag"
3780 if test "$mode" != relink; then
3781 # Remove our outputs, but don't remove object files since they
3782 # may have been created when compiling PIC objects.
3783 removelist=
3784 tempremovelist=`$echo "$output_objdir/*"`
3785 for p in $tempremovelist; do
3786 case $p in
3787 *.$objext)
3789 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3790 if test "X$precious_files_regex" != "X"; then
3791 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3792 then
3793 continue
3796 removelist="$removelist $p"
3798 *) ;;
3799 esac
3800 done
3801 if test -n "$removelist"; then
3802 $show "${rm}r $removelist"
3803 $run ${rm}r $removelist
3807 # Now set the variables for building old libraries.
3808 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3809 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3811 # Transform .lo files to .o files.
3812 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3815 # Eliminate all temporary directories.
3816 #for path in $notinst_path; do
3817 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3818 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3819 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3820 #done
3822 if test -n "$xrpath"; then
3823 # If the user specified any rpath flags, then add them.
3824 temp_xrpath=
3825 for libdir in $xrpath; do
3826 temp_xrpath="$temp_xrpath -R$libdir"
3827 case "$finalize_rpath " in
3828 *" $libdir "*) ;;
3829 *) finalize_rpath="$finalize_rpath $libdir" ;;
3830 esac
3831 done
3832 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3833 dependency_libs="$temp_xrpath $dependency_libs"
3837 # Make sure dlfiles contains only unique files that won't be dlpreopened
3838 old_dlfiles="$dlfiles"
3839 dlfiles=
3840 for lib in $old_dlfiles; do
3841 case " $dlprefiles $dlfiles " in
3842 *" $lib "*) ;;
3843 *) dlfiles="$dlfiles $lib" ;;
3844 esac
3845 done
3847 # Make sure dlprefiles contains only unique files
3848 old_dlprefiles="$dlprefiles"
3849 dlprefiles=
3850 for lib in $old_dlprefiles; do
3851 case "$dlprefiles " in
3852 *" $lib "*) ;;
3853 *) dlprefiles="$dlprefiles $lib" ;;
3854 esac
3855 done
3857 if test "$build_libtool_libs" = yes; then
3858 if test -n "$rpath"; then
3859 case $host in
3860 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3861 # these systems don't actually have a c library (as such)!
3863 *-*-rhapsody* | *-*-darwin1.[012])
3864 # Rhapsody C library is in the System framework
3865 deplibs="$deplibs -framework System"
3867 *-*-netbsd*)
3868 # Don't link with libc until the a.out ld.so is fixed.
3870 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3871 # Do not include libc due to us having libc/libc_r.
3873 *-*-sco3.2v5* | *-*-sco5v6*)
3874 # Causes problems with __ctype
3876 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3877 # Compiler inserts libc in the correct place for threads to work
3880 # Add libc to deplibs on all other systems if necessary.
3881 if test "$build_libtool_need_lc" = "yes"; then
3882 deplibs="$deplibs -lc"
3885 esac
3888 # Transform deplibs into only deplibs that can be linked in shared.
3889 name_save=$name
3890 libname_save=$libname
3891 release_save=$release
3892 versuffix_save=$versuffix
3893 major_save=$major
3894 # I'm not sure if I'm treating the release correctly. I think
3895 # release should show up in the -l (ie -lgmp5) so we don't want to
3896 # add it in twice. Is that correct?
3897 release=""
3898 versuffix=""
3899 major=""
3900 newdeplibs=
3901 droppeddeps=no
3902 case $deplibs_check_method in
3903 pass_all)
3904 # Don't check for shared/static. Everything works.
3905 # This might be a little naive. We might want to check
3906 # whether the library exists or not. But this is on
3907 # osf3 & osf4 and I'm not really sure... Just
3908 # implementing what was already the behavior.
3909 newdeplibs=$deplibs
3911 test_compile)
3912 # This code stresses the "libraries are programs" paradigm to its
3913 # limits. Maybe even breaks it. We compile a program, linking it
3914 # against the deplibs as a proxy for the library. Then we can check
3915 # whether they linked in statically or dynamically with ldd.
3916 $rm conftest.c
3917 cat > conftest.c <<EOF
3918 int main() { return 0; }
3920 $rm conftest
3921 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3922 ldd_output=`ldd conftest`
3923 for i in $deplibs; do
3924 name=`expr $i : '-l\(.*\)'`
3925 # If $name is empty we are operating on a -L argument.
3926 if test "$name" != "" && test "$name" != "0"; then
3927 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3928 case " $predeps $postdeps " in
3929 *" $i "*)
3930 newdeplibs="$newdeplibs $i"
3931 i=""
3933 esac
3935 if test -n "$i" ; then
3936 libname=`eval \\$echo \"$libname_spec\"`
3937 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3938 set dummy $deplib_matches
3939 deplib_match=$2
3940 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3941 newdeplibs="$newdeplibs $i"
3942 else
3943 droppeddeps=yes
3944 $echo
3945 $echo "*** Warning: dynamic linker does not accept needed library $i."
3946 $echo "*** I have the capability to make that library automatically link in when"
3947 $echo "*** you link to this library. But I can only do this if you have a"
3948 $echo "*** shared version of the library, which I believe you do not have"
3949 $echo "*** because a test_compile did reveal that the linker did not use it for"
3950 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3953 else
3954 newdeplibs="$newdeplibs $i"
3956 done
3957 else
3958 # Error occurred in the first compile. Let's try to salvage
3959 # the situation: Compile a separate program for each library.
3960 for i in $deplibs; do
3961 name=`expr $i : '-l\(.*\)'`
3962 # If $name is empty we are operating on a -L argument.
3963 if test "$name" != "" && test "$name" != "0"; then
3964 $rm conftest
3965 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3966 ldd_output=`ldd conftest`
3967 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3968 case " $predeps $postdeps " in
3969 *" $i "*)
3970 newdeplibs="$newdeplibs $i"
3971 i=""
3973 esac
3975 if test -n "$i" ; then
3976 libname=`eval \\$echo \"$libname_spec\"`
3977 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3978 set dummy $deplib_matches
3979 deplib_match=$2
3980 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3981 newdeplibs="$newdeplibs $i"
3982 else
3983 droppeddeps=yes
3984 $echo
3985 $echo "*** Warning: dynamic linker does not accept needed library $i."
3986 $echo "*** I have the capability to make that library automatically link in when"
3987 $echo "*** you link to this library. But I can only do this if you have a"
3988 $echo "*** shared version of the library, which you do not appear to have"
3989 $echo "*** because a test_compile did reveal that the linker did not use this one"
3990 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3993 else
3994 droppeddeps=yes
3995 $echo
3996 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3997 $echo "*** make it link in! You will probably need to install it or some"
3998 $echo "*** library that it depends on before this library will be fully"
3999 $echo "*** functional. Installing it before continuing would be even better."
4001 else
4002 newdeplibs="$newdeplibs $i"
4004 done
4007 file_magic*)
4008 set dummy $deplibs_check_method
4009 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4010 for a_deplib in $deplibs; do
4011 name=`expr $a_deplib : '-l\(.*\)'`
4012 # If $name is empty we are operating on a -L argument.
4013 if test "$name" != "" && test "$name" != "0"; then
4014 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4015 case " $predeps $postdeps " in
4016 *" $a_deplib "*)
4017 newdeplibs="$newdeplibs $a_deplib"
4018 a_deplib=""
4020 esac
4022 if test -n "$a_deplib" ; then
4023 libname=`eval \\$echo \"$libname_spec\"`
4024 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4025 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4026 for potent_lib in $potential_libs; do
4027 # Follow soft links.
4028 if ls -lLd "$potent_lib" 2>/dev/null \
4029 | grep " -> " >/dev/null; then
4030 continue
4032 # The statement above tries to avoid entering an
4033 # endless loop below, in case of cyclic links.
4034 # We might still enter an endless loop, since a link
4035 # loop can be closed while we follow links,
4036 # but so what?
4037 potlib="$potent_lib"
4038 while test -h "$potlib" 2>/dev/null; do
4039 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4040 case $potliblink in
4041 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4042 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4043 esac
4044 done
4045 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4046 | ${SED} 10q \
4047 | $EGREP "$file_magic_regex" > /dev/null; then
4048 newdeplibs="$newdeplibs $a_deplib"
4049 a_deplib=""
4050 break 2
4052 done
4053 done
4055 if test -n "$a_deplib" ; then
4056 droppeddeps=yes
4057 $echo
4058 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4059 $echo "*** I have the capability to make that library automatically link in when"
4060 $echo "*** you link to this library. But I can only do this if you have a"
4061 $echo "*** shared version of the library, which you do not appear to have"
4062 $echo "*** because I did check the linker path looking for a file starting"
4063 if test -z "$potlib" ; then
4064 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4065 else
4066 $echo "*** with $libname and none of the candidates passed a file format test"
4067 $echo "*** using a file magic. Last file checked: $potlib"
4070 else
4071 # Add a -L argument.
4072 newdeplibs="$newdeplibs $a_deplib"
4074 done # Gone through all deplibs.
4076 match_pattern*)
4077 set dummy $deplibs_check_method
4078 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4079 for a_deplib in $deplibs; do
4080 name=`expr $a_deplib : '-l\(.*\)'`
4081 # If $name is empty we are operating on a -L argument.
4082 if test -n "$name" && test "$name" != "0"; then
4083 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4084 case " $predeps $postdeps " in
4085 *" $a_deplib "*)
4086 newdeplibs="$newdeplibs $a_deplib"
4087 a_deplib=""
4089 esac
4091 if test -n "$a_deplib" ; then
4092 libname=`eval \\$echo \"$libname_spec\"`
4093 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4094 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4095 for potent_lib in $potential_libs; do
4096 potlib="$potent_lib" # see symlink-check above in file_magic test
4097 if eval $echo \"$potent_lib\" 2>/dev/null \
4098 | ${SED} 10q \
4099 | $EGREP "$match_pattern_regex" > /dev/null; then
4100 newdeplibs="$newdeplibs $a_deplib"
4101 a_deplib=""
4102 break 2
4104 done
4105 done
4107 if test -n "$a_deplib" ; then
4108 droppeddeps=yes
4109 $echo
4110 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4111 $echo "*** I have the capability to make that library automatically link in when"
4112 $echo "*** you link to this library. But I can only do this if you have a"
4113 $echo "*** shared version of the library, which you do not appear to have"
4114 $echo "*** because I did check the linker path looking for a file starting"
4115 if test -z "$potlib" ; then
4116 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4117 else
4118 $echo "*** with $libname and none of the candidates passed a file format test"
4119 $echo "*** using a regex pattern. Last file checked: $potlib"
4122 else
4123 # Add a -L argument.
4124 newdeplibs="$newdeplibs $a_deplib"
4126 done # Gone through all deplibs.
4128 none | unknown | *)
4129 newdeplibs=""
4130 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4131 -e 's/ -[LR][^ ]*//g'`
4132 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4133 for i in $predeps $postdeps ; do
4134 # can't use Xsed below, because $i might contain '/'
4135 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4136 done
4138 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4139 | grep . >/dev/null; then
4140 $echo
4141 if test "X$deplibs_check_method" = "Xnone"; then
4142 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4143 else
4144 $echo "*** Warning: inter-library dependencies are not known to be supported."
4146 $echo "*** All declared inter-library dependencies are being dropped."
4147 droppeddeps=yes
4150 esac
4151 versuffix=$versuffix_save
4152 major=$major_save
4153 release=$release_save
4154 libname=$libname_save
4155 name=$name_save
4157 case $host in
4158 *-*-rhapsody* | *-*-darwin1.[012])
4159 # On Rhapsody replace the C library is the System framework
4160 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4162 esac
4164 if test "$droppeddeps" = yes; then
4165 if test "$module" = yes; then
4166 $echo
4167 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4168 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4169 $echo "*** a static module, that should work as long as the dlopening"
4170 $echo "*** application is linked with the -dlopen flag."
4171 if test -z "$global_symbol_pipe"; then
4172 $echo
4173 $echo "*** However, this would only work if libtool was able to extract symbol"
4174 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4175 $echo "*** not find such a program. So, this module is probably useless."
4176 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4178 if test "$build_old_libs" = no; then
4179 oldlibs="$output_objdir/$libname.$libext"
4180 build_libtool_libs=module
4181 build_old_libs=yes
4182 else
4183 build_libtool_libs=no
4185 else
4186 $echo "*** The inter-library dependencies that have been dropped here will be"
4187 $echo "*** automatically added whenever a program is linked with this library"
4188 $echo "*** or is declared to -dlopen it."
4190 if test "$allow_undefined" = no; then
4191 $echo
4192 $echo "*** Since this library must not contain undefined symbols,"
4193 $echo "*** because either the platform does not support them or"
4194 $echo "*** it was explicitly requested with -no-undefined,"
4195 $echo "*** libtool will only create a static version of it."
4196 if test "$build_old_libs" = no; then
4197 oldlibs="$output_objdir/$libname.$libext"
4198 build_libtool_libs=module
4199 build_old_libs=yes
4200 else
4201 build_libtool_libs=no
4206 # Done checking deplibs!
4207 deplibs=$newdeplibs
4211 # move library search paths that coincide with paths to not yet
4212 # installed libraries to the beginning of the library search list
4213 new_libs=
4214 for path in $notinst_path; do
4215 case " $new_libs " in
4216 *" -L$path/$objdir "*) ;;
4218 case " $deplibs " in
4219 *" -L$path/$objdir "*)
4220 new_libs="$new_libs -L$path/$objdir" ;;
4221 esac
4223 esac
4224 done
4225 for deplib in $deplibs; do
4226 case $deplib in
4227 -L*)
4228 case " $new_libs " in
4229 *" $deplib "*) ;;
4230 *) new_libs="$new_libs $deplib" ;;
4231 esac
4233 *) new_libs="$new_libs $deplib" ;;
4234 esac
4235 done
4236 deplibs="$new_libs"
4239 # All the library-specific variables (install_libdir is set above).
4240 library_names=
4241 old_library=
4242 dlname=
4244 # Test again, we may have decided not to build it any more
4245 if test "$build_libtool_libs" = yes; then
4246 if test "$hardcode_into_libs" = yes; then
4247 # Hardcode the library paths
4248 hardcode_libdirs=
4249 dep_rpath=
4250 rpath="$finalize_rpath"
4251 test "$mode" != relink && rpath="$compile_rpath$rpath"
4252 for libdir in $rpath; do
4253 if test -n "$hardcode_libdir_flag_spec"; then
4254 if test -n "$hardcode_libdir_separator"; then
4255 if test -z "$hardcode_libdirs"; then
4256 hardcode_libdirs="$libdir"
4257 else
4258 # Just accumulate the unique libdirs.
4259 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4260 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4263 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4265 esac
4267 else
4268 eval flag=\"$hardcode_libdir_flag_spec\"
4269 dep_rpath="$dep_rpath $flag"
4271 elif test -n "$runpath_var"; then
4272 case "$perm_rpath " in
4273 *" $libdir "*) ;;
4274 *) perm_rpath="$perm_rpath $libdir" ;;
4275 esac
4277 done
4278 # Substitute the hardcoded libdirs into the rpath.
4279 if test -n "$hardcode_libdir_separator" &&
4280 test -n "$hardcode_libdirs"; then
4281 libdir="$hardcode_libdirs"
4282 if test -n "$hardcode_libdir_flag_spec_ld"; then
4283 case $archive_cmds in
4284 *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
4285 *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
4286 esac
4287 else
4288 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4291 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4292 # We should set the runpath_var.
4293 rpath=
4294 for dir in $perm_rpath; do
4295 rpath="$rpath$dir:"
4296 done
4297 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4299 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4302 shlibpath="$finalize_shlibpath"
4303 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4304 if test -n "$shlibpath"; then
4305 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4308 # Get the real and link names of the library.
4309 eval shared_ext=\"$shrext_cmds\"
4310 eval library_names=\"$library_names_spec\"
4311 set dummy $library_names
4312 realname="$2"
4313 shift; shift
4315 if test -n "$soname_spec"; then
4316 eval soname=\"$soname_spec\"
4317 else
4318 soname="$realname"
4320 if test -z "$dlname"; then
4321 dlname=$soname
4324 lib="$output_objdir/$realname"
4325 linknames=
4326 for link
4328 linknames="$linknames $link"
4329 done
4331 # Use standard objects if they are pic
4332 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4334 # Prepare the list of exported symbols
4335 if test -z "$export_symbols"; then
4336 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4337 $show "generating symbol list for \`$libname.la'"
4338 export_symbols="$output_objdir/$libname.exp"
4339 $run $rm $export_symbols
4340 cmds=$export_symbols_cmds
4341 save_ifs="$IFS"; IFS='~'
4342 for cmd in $cmds; do
4343 IFS="$save_ifs"
4344 eval cmd=\"$cmd\"
4345 if len=`expr "X$cmd" : ".*"` &&
4346 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4347 $show "$cmd"
4348 $run eval "$cmd" || exit $?
4349 skipped_export=false
4350 else
4351 # The command line is too long to execute in one step.
4352 $show "using reloadable object file for export list..."
4353 skipped_export=:
4354 # Break out early, otherwise skipped_export may be
4355 # set to false by a later but shorter cmd.
4356 break
4358 done
4359 IFS="$save_ifs"
4360 if test -n "$export_symbols_regex"; then
4361 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4362 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4363 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4364 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4369 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4370 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4373 tmp_deplibs=
4374 for test_deplib in $deplibs; do
4375 case " $convenience " in
4376 *" $test_deplib "*) ;;
4378 tmp_deplibs="$tmp_deplibs $test_deplib"
4380 esac
4381 done
4382 deplibs="$tmp_deplibs"
4384 if test -n "$convenience"; then
4385 if test -n "$whole_archive_flag_spec"; then
4386 save_libobjs=$libobjs
4387 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4388 else
4389 gentop="$output_objdir/${outputname}x"
4390 generated="$generated $gentop"
4392 func_extract_archives $gentop $convenience
4393 libobjs="$libobjs $func_extract_archives_result"
4397 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4398 eval flag=\"$thread_safe_flag_spec\"
4399 linker_flags="$linker_flags $flag"
4402 # Make a backup of the uninstalled library when relinking
4403 if test "$mode" = relink; then
4404 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4407 # Do each of the archive commands.
4408 if test "$module" = yes && test -n "$module_cmds" ; then
4409 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4410 eval test_cmds=\"$module_expsym_cmds\"
4411 cmds=$module_expsym_cmds
4412 else
4413 eval test_cmds=\"$module_cmds\"
4414 cmds=$module_cmds
4416 else
4417 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4418 eval test_cmds=\"$archive_expsym_cmds\"
4419 cmds=$archive_expsym_cmds
4420 else
4421 eval test_cmds=\"$archive_cmds\"
4422 cmds=$archive_cmds
4426 if test "X$skipped_export" != "X:" &&
4427 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4428 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4430 else
4431 # The command line is too long to link in one step, link piecewise.
4432 $echo "creating reloadable object files..."
4434 # Save the value of $output and $libobjs because we want to
4435 # use them later. If we have whole_archive_flag_spec, we
4436 # want to use save_libobjs as it was before
4437 # whole_archive_flag_spec was expanded, because we can't
4438 # assume the linker understands whole_archive_flag_spec.
4439 # This may have to be revisited, in case too many
4440 # convenience libraries get linked in and end up exceeding
4441 # the spec.
4442 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4443 save_libobjs=$libobjs
4445 save_output=$output
4446 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4448 # Clear the reloadable object creation command queue and
4449 # initialize k to one.
4450 test_cmds=
4451 concat_cmds=
4452 objlist=
4453 delfiles=
4454 last_robj=
4456 output=$output_objdir/$output_la-${k}.$objext
4457 # Loop over the list of objects to be linked.
4458 for obj in $save_libobjs
4460 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4461 if test "X$objlist" = X ||
4462 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4463 test "$len" -le "$max_cmd_len"; }; then
4464 objlist="$objlist $obj"
4465 else
4466 # The command $test_cmds is almost too long, add a
4467 # command to the queue.
4468 if test "$k" -eq 1 ; then
4469 # The first file doesn't have a previous command to add.
4470 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4471 else
4472 # All subsequent reloadable object files will link in
4473 # the last one created.
4474 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4476 last_robj=$output_objdir/$output_la-${k}.$objext
4477 k=`expr $k + 1`
4478 output=$output_objdir/$output_la-${k}.$objext
4479 objlist=$obj
4480 len=1
4482 done
4483 # Handle the remaining objects by creating one last
4484 # reloadable object file. All subsequent reloadable object
4485 # files will link in the last one created.
4486 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4487 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4489 if ${skipped_export-false}; then
4490 $show "generating symbol list for \`$libname.la'"
4491 export_symbols="$output_objdir/$libname.exp"
4492 $run $rm $export_symbols
4493 libobjs=$output
4494 # Append the command to create the export file.
4495 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4498 # Set up a command to remove the reloadable object files
4499 # after they are used.
4501 while test "$i" -lt "$k"
4503 i=`expr $i + 1`
4504 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4505 done
4507 $echo "creating a temporary reloadable object file: $output"
4509 # Loop through the commands generated above and execute them.
4510 save_ifs="$IFS"; IFS='~'
4511 for cmd in $concat_cmds; do
4512 IFS="$save_ifs"
4513 $show "$cmd"
4514 $run eval "$cmd" || exit $?
4515 done
4516 IFS="$save_ifs"
4518 libobjs=$output
4519 # Restore the value of output.
4520 output=$save_output
4522 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4523 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4525 # Expand the library linking commands again to reset the
4526 # value of $libobjs for piecewise linking.
4528 # Do each of the archive commands.
4529 if test "$module" = yes && test -n "$module_cmds" ; then
4530 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4531 cmds=$module_expsym_cmds
4532 else
4533 cmds=$module_cmds
4535 else
4536 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4537 cmds=$archive_expsym_cmds
4538 else
4539 cmds=$archive_cmds
4543 # Append the command to remove the reloadable object files
4544 # to the just-reset $cmds.
4545 eval cmds=\"\$cmds~\$rm $delfiles\"
4547 save_ifs="$IFS"; IFS='~'
4548 for cmd in $cmds; do
4549 IFS="$save_ifs"
4550 eval cmd=\"$cmd\"
4551 $show "$cmd"
4552 $run eval "$cmd" || {
4553 lt_exit=$?
4555 # Restore the uninstalled library and exit
4556 if test "$mode" = relink; then
4557 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4560 exit $lt_exit
4562 done
4563 IFS="$save_ifs"
4565 # Restore the uninstalled library and exit
4566 if test "$mode" = relink; then
4567 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4569 if test -n "$convenience"; then
4570 if test -z "$whole_archive_flag_spec"; then
4571 $show "${rm}r $gentop"
4572 $run ${rm}r "$gentop"
4576 exit $EXIT_SUCCESS
4579 # Create links to the real library.
4580 for linkname in $linknames; do
4581 if test "$realname" != "$linkname"; then
4582 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4583 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4585 done
4587 # If -module or -export-dynamic was specified, set the dlname.
4588 if test "$module" = yes || test "$export_dynamic" = yes; then
4589 # On all known operating systems, these are identical.
4590 dlname="$soname"
4595 obj)
4596 if test -n "$deplibs"; then
4597 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4600 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4601 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4604 if test -n "$rpath"; then
4605 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4608 if test -n "$xrpath"; then
4609 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4612 if test -n "$vinfo"; then
4613 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4616 if test -n "$release"; then
4617 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4620 case $output in
4621 *.lo)
4622 if test -n "$objs$old_deplibs"; then
4623 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4624 exit $EXIT_FAILURE
4626 libobj="$output"
4627 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4630 libobj=
4631 obj="$output"
4633 esac
4635 # Delete the old objects.
4636 $run $rm $obj $libobj
4638 # Objects from convenience libraries. This assumes
4639 # single-version convenience libraries. Whenever we create
4640 # different ones for PIC/non-PIC, this we'll have to duplicate
4641 # the extraction.
4642 reload_conv_objs=
4643 gentop=
4644 # reload_cmds runs $LD directly, so let us get rid of
4645 # -Wl from whole_archive_flag_spec and hope we can get by with
4646 # turning comma into space..
4649 if test -n "$convenience"; then
4650 if test -n "$whole_archive_flag_spec"; then
4651 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4652 reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4653 else
4654 gentop="$output_objdir/${obj}x"
4655 generated="$generated $gentop"
4657 func_extract_archives $gentop $convenience
4658 reload_conv_objs="$reload_objs $func_extract_archives_result"
4662 # Create the old-style object.
4663 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
4665 output="$obj"
4666 cmds=$reload_cmds
4667 save_ifs="$IFS"; IFS='~'
4668 for cmd in $cmds; do
4669 IFS="$save_ifs"
4670 eval cmd=\"$cmd\"
4671 $show "$cmd"
4672 $run eval "$cmd" || exit $?
4673 done
4674 IFS="$save_ifs"
4676 # Exit if we aren't doing a library object file.
4677 if test -z "$libobj"; then
4678 if test -n "$gentop"; then
4679 $show "${rm}r $gentop"
4680 $run ${rm}r $gentop
4683 exit $EXIT_SUCCESS
4686 if test "$build_libtool_libs" != yes; then
4687 if test -n "$gentop"; then
4688 $show "${rm}r $gentop"
4689 $run ${rm}r $gentop
4692 # Create an invalid libtool object if no PIC, so that we don't
4693 # accidentally link it into a program.
4694 # $show "echo timestamp > $libobj"
4695 # $run eval "echo timestamp > $libobj" || exit $?
4696 exit $EXIT_SUCCESS
4699 if test -n "$pic_flag" || test "$pic_mode" != default; then
4700 # Only do commands if we really have different PIC objects.
4701 reload_objs="$libobjs $reload_conv_objs"
4702 output="$libobj"
4703 cmds=$reload_cmds
4704 save_ifs="$IFS"; IFS='~'
4705 for cmd in $cmds; do
4706 IFS="$save_ifs"
4707 eval cmd=\"$cmd\"
4708 $show "$cmd"
4709 $run eval "$cmd" || exit $?
4710 done
4711 IFS="$save_ifs"
4714 if test -n "$gentop"; then
4715 $show "${rm}r $gentop"
4716 $run ${rm}r $gentop
4719 exit $EXIT_SUCCESS
4722 prog)
4723 case $host in
4724 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4725 esac
4726 if test -n "$vinfo"; then
4727 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4730 if test -n "$release"; then
4731 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4734 if test "$preload" = yes; then
4735 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4736 test "$dlopen_self_static" = unknown; then
4737 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4741 case $host in
4742 *-*-rhapsody* | *-*-darwin1.[012])
4743 # On Rhapsody replace the C library is the System framework
4744 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4745 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4747 esac
4749 case $host in
4750 *darwin*)
4751 # Don't allow lazy linking, it breaks C++ global constructors
4752 if test "$tagname" = CXX ; then
4753 compile_command="$compile_command ${wl}-bind_at_load"
4754 finalize_command="$finalize_command ${wl}-bind_at_load"
4757 esac
4760 # move library search paths that coincide with paths to not yet
4761 # installed libraries to the beginning of the library search list
4762 new_libs=
4763 for path in $notinst_path; do
4764 case " $new_libs " in
4765 *" -L$path/$objdir "*) ;;
4767 case " $compile_deplibs " in
4768 *" -L$path/$objdir "*)
4769 new_libs="$new_libs -L$path/$objdir" ;;
4770 esac
4772 esac
4773 done
4774 for deplib in $compile_deplibs; do
4775 case $deplib in
4776 -L*)
4777 case " $new_libs " in
4778 *" $deplib "*) ;;
4779 *) new_libs="$new_libs $deplib" ;;
4780 esac
4782 *) new_libs="$new_libs $deplib" ;;
4783 esac
4784 done
4785 compile_deplibs="$new_libs"
4788 compile_command="$compile_command $compile_deplibs"
4789 finalize_command="$finalize_command $finalize_deplibs"
4791 if test -n "$rpath$xrpath"; then
4792 # If the user specified any rpath flags, then add them.
4793 for libdir in $rpath $xrpath; do
4794 # This is the magic to use -rpath.
4795 case "$finalize_rpath " in
4796 *" $libdir "*) ;;
4797 *) finalize_rpath="$finalize_rpath $libdir" ;;
4798 esac
4799 done
4802 # Now hardcode the library paths
4803 rpath=
4804 hardcode_libdirs=
4805 for libdir in $compile_rpath $finalize_rpath; do
4806 if test -n "$hardcode_libdir_flag_spec"; then
4807 if test -n "$hardcode_libdir_separator"; then
4808 if test -z "$hardcode_libdirs"; then
4809 hardcode_libdirs="$libdir"
4810 else
4811 # Just accumulate the unique libdirs.
4812 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4813 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4816 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4818 esac
4820 else
4821 eval flag=\"$hardcode_libdir_flag_spec\"
4822 rpath="$rpath $flag"
4824 elif test -n "$runpath_var"; then
4825 case "$perm_rpath " in
4826 *" $libdir "*) ;;
4827 *) perm_rpath="$perm_rpath $libdir" ;;
4828 esac
4830 case $host in
4831 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4832 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4833 case :$dllsearchpath: in
4834 *":$libdir:"*) ;;
4835 *) dllsearchpath="$dllsearchpath:$libdir";;
4836 esac
4837 case :$dllsearchpath: in
4838 *":$testbindir:"*) ;;
4839 *) dllsearchpath="$dllsearchpath:$testbindir";;
4840 esac
4842 esac
4843 done
4844 # Substitute the hardcoded libdirs into the rpath.
4845 if test -n "$hardcode_libdir_separator" &&
4846 test -n "$hardcode_libdirs"; then
4847 libdir="$hardcode_libdirs"
4848 eval rpath=\" $hardcode_libdir_flag_spec\"
4850 compile_rpath="$rpath"
4852 rpath=
4853 hardcode_libdirs=
4854 for libdir in $finalize_rpath; do
4855 if test -n "$hardcode_libdir_flag_spec"; then
4856 if test -n "$hardcode_libdir_separator"; then
4857 if test -z "$hardcode_libdirs"; then
4858 hardcode_libdirs="$libdir"
4859 else
4860 # Just accumulate the unique libdirs.
4861 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4862 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4865 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4867 esac
4869 else
4870 eval flag=\"$hardcode_libdir_flag_spec\"
4871 rpath="$rpath $flag"
4873 elif test -n "$runpath_var"; then
4874 case "$finalize_perm_rpath " in
4875 *" $libdir "*) ;;
4876 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4877 esac
4879 done
4880 # Substitute the hardcoded libdirs into the rpath.
4881 if test -n "$hardcode_libdir_separator" &&
4882 test -n "$hardcode_libdirs"; then
4883 libdir="$hardcode_libdirs"
4884 eval rpath=\" $hardcode_libdir_flag_spec\"
4886 finalize_rpath="$rpath"
4888 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4889 # Transform all the library objects into standard objects.
4890 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4891 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4894 dlsyms=
4895 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4896 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4897 dlsyms="${outputname}S.c"
4898 else
4899 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4903 if test -n "$dlsyms"; then
4904 case $dlsyms in
4905 "") ;;
4906 *.c)
4907 # Discover the nlist of each of the dlfiles.
4908 nlist="$output_objdir/${outputname}.nm"
4910 $show "$rm $nlist ${nlist}S ${nlist}T"
4911 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4913 # Parse the name list into a source file.
4914 $show "creating $output_objdir/$dlsyms"
4916 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4917 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4918 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4920 #ifdef __cplusplus
4921 extern \"C\" {
4922 #endif
4924 /* Prevent the only kind of declaration conflicts we can make. */
4925 #define lt_preloaded_symbols some_other_symbol
4927 /* External symbol declarations for the compiler. */\
4930 if test "$dlself" = yes; then
4931 $show "generating symbol list for \`$output'"
4933 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4935 # Add our own program objects to the symbol list.
4936 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4937 for arg in $progfiles; do
4938 $show "extracting global C symbols from \`$arg'"
4939 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4940 done
4942 if test -n "$exclude_expsyms"; then
4943 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4944 $run eval '$mv "$nlist"T "$nlist"'
4947 if test -n "$export_symbols_regex"; then
4948 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4949 $run eval '$mv "$nlist"T "$nlist"'
4952 # Prepare the list of exported symbols
4953 if test -z "$export_symbols"; then
4954 export_symbols="$output_objdir/$outputname.exp"
4955 $run $rm $export_symbols
4956 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4957 case $host in
4958 *cygwin* | *mingw* )
4959 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4960 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4962 esac
4963 else
4964 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4965 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4966 $run eval 'mv "$nlist"T "$nlist"'
4967 case $host in
4968 *cygwin* | *mingw* )
4969 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4970 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4972 esac
4976 for arg in $dlprefiles; do
4977 $show "extracting global C symbols from \`$arg'"
4978 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4979 $run eval '$echo ": $name " >> "$nlist"'
4980 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4981 done
4983 if test -z "$run"; then
4984 # Make sure we have at least an empty file.
4985 test -f "$nlist" || : > "$nlist"
4987 if test -n "$exclude_expsyms"; then
4988 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4989 $mv "$nlist"T "$nlist"
4992 # Try sorting and uniquifying the output.
4993 if grep -v "^: " < "$nlist" |
4994 if sort -k 3 </dev/null >/dev/null 2>&1; then
4995 sort -k 3
4996 else
4997 sort +2
4998 fi |
4999 uniq > "$nlist"S; then
5001 else
5002 grep -v "^: " < "$nlist" > "$nlist"S
5005 if test -f "$nlist"S; then
5006 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5007 else
5008 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5011 $echo >> "$output_objdir/$dlsyms" "\
5013 #undef lt_preloaded_symbols
5015 #if defined (__STDC__) && __STDC__
5016 # define lt_ptr void *
5017 #else
5018 # define lt_ptr char *
5019 # define const
5020 #endif
5022 /* The mapping between symbol names and symbols. */
5025 case $host in
5026 *cygwin* | *mingw* )
5027 $echo >> "$output_objdir/$dlsyms" "\
5028 /* DATA imports from DLLs on WIN32 can't be const, because
5029 runtime relocations are performed -- see ld's documentation
5030 on pseudo-relocs */
5031 struct {
5035 $echo >> "$output_objdir/$dlsyms" "\
5036 const struct {
5039 esac
5042 $echo >> "$output_objdir/$dlsyms" "\
5043 const char *name;
5044 lt_ptr address;
5046 lt_preloaded_symbols[] =
5050 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5052 $echo >> "$output_objdir/$dlsyms" "\
5053 {0, (lt_ptr) 0}
5056 /* This works around a problem in FreeBSD linker */
5057 #ifdef FREEBSD_WORKAROUND
5058 static const void *lt_preloaded_setup() {
5059 return lt_preloaded_symbols;
5061 #endif
5063 #ifdef __cplusplus
5065 #endif\
5069 pic_flag_for_symtable=
5070 case $host in
5071 # compiling the symbol table file with pic_flag works around
5072 # a FreeBSD bug that causes programs to crash when -lm is
5073 # linked before any other PIC object. But we must not use
5074 # pic_flag when linking with -static. The problem exists in
5075 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5076 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5077 case "$compile_command " in
5078 *" -static "*) ;;
5079 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5080 esac;;
5081 *-*-hpux*)
5082 case "$compile_command " in
5083 *" -static "*) ;;
5084 *) pic_flag_for_symtable=" $pic_flag";;
5085 esac
5086 esac
5088 # Now compile the dynamic symbol file.
5089 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5090 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5092 # Clean up the generated files.
5093 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5094 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5096 # Transform the symbol file into the correct name.
5097 case $host in
5098 *cygwin* | *mingw* )
5099 if test -f "$output_objdir/${outputname}.def" ; then
5100 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5101 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5102 else
5103 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5104 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5108 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5109 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5111 esac
5114 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5115 exit $EXIT_FAILURE
5117 esac
5118 else
5119 # We keep going just in case the user didn't refer to
5120 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5121 # really was required.
5123 # Nullify the symbol file.
5124 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5125 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5128 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5129 # Replace the output file specification.
5130 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
5131 link_command="$compile_command$compile_rpath"
5133 # We have no uninstalled library dependencies, so finalize right now.
5134 $show "$link_command"
5135 $run eval "$link_command"
5136 exit_status=$?
5138 # Delete the generated files.
5139 if test -n "$dlsyms"; then
5140 $show "$rm $output_objdir/${outputname}S.${objext}"
5141 $run $rm "$output_objdir/${outputname}S.${objext}"
5144 exit $exit_status
5147 if test -n "$shlibpath_var"; then
5148 # We should set the shlibpath_var
5149 rpath=
5150 for dir in $temp_rpath; do
5151 case $dir in
5152 [\\/]* | [A-Za-z]:[\\/]*)
5153 # Absolute path.
5154 rpath="$rpath$dir:"
5157 # Relative path: add a thisdir entry.
5158 rpath="$rpath\$thisdir/$dir:"
5160 esac
5161 done
5162 temp_rpath="$rpath"
5165 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5166 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5168 if test -n "$finalize_shlibpath"; then
5169 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5172 compile_var=
5173 finalize_var=
5174 if test -n "$runpath_var"; then
5175 if test -n "$perm_rpath"; then
5176 # We should set the runpath_var.
5177 rpath=
5178 for dir in $perm_rpath; do
5179 rpath="$rpath$dir:"
5180 done
5181 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5183 if test -n "$finalize_perm_rpath"; then
5184 # We should set the runpath_var.
5185 rpath=
5186 for dir in $finalize_perm_rpath; do
5187 rpath="$rpath$dir:"
5188 done
5189 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5193 if test "$no_install" = yes; then
5194 # We don't need to create a wrapper script.
5195 link_command="$compile_var$compile_command$compile_rpath"
5196 # Replace the output file specification.
5197 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5198 # Delete the old output file.
5199 $run $rm $output
5200 # Link the executable and exit
5201 $show "$link_command"
5202 $run eval "$link_command" || exit $?
5203 exit $EXIT_SUCCESS
5206 if test "$hardcode_action" = relink; then
5207 # Fast installation is not supported
5208 link_command="$compile_var$compile_command$compile_rpath"
5209 relink_command="$finalize_var$finalize_command$finalize_rpath"
5211 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5212 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5213 else
5214 if test "$fast_install" != no; then
5215 link_command="$finalize_var$compile_command$finalize_rpath"
5216 if test "$fast_install" = yes; then
5217 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
5218 else
5219 # fast_install is set to needless
5220 relink_command=
5222 else
5223 link_command="$compile_var$compile_command$compile_rpath"
5224 relink_command="$finalize_var$finalize_command$finalize_rpath"
5228 # Replace the output file specification.
5229 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5231 # Delete the old output files.
5232 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5234 $show "$link_command"
5235 $run eval "$link_command" || exit $?
5237 # Now create the wrapper script.
5238 $show "creating $output"
5240 # Quote the relink command for shipping.
5241 if test -n "$relink_command"; then
5242 # Preserve any variables that may affect compiler behavior
5243 for var in $variables_saved_for_relink; do
5244 if eval test -z \"\${$var+set}\"; then
5245 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5246 elif eval var_value=\$$var; test -z "$var_value"; then
5247 relink_command="$var=; export $var; $relink_command"
5248 else
5249 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5250 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5252 done
5253 relink_command="(cd `pwd`; $relink_command)"
5254 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5257 # Quote $echo for shipping.
5258 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5259 case $progpath in
5260 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5261 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5262 esac
5263 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5264 else
5265 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5268 # Only actually do things if our run command is non-null.
5269 if test -z "$run"; then
5270 # win32 will think the script is a binary if it has
5271 # a .exe suffix, so we strip it off here.
5272 case $output in
5273 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5274 esac
5275 # test for cygwin because mv fails w/o .exe extensions
5276 case $host in
5277 *cygwin*)
5278 exeext=.exe
5279 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5280 *) exeext= ;;
5281 esac
5282 case $host in
5283 *cygwin* | *mingw* )
5284 output_name=`basename $output`
5285 output_path=`dirname $output`
5286 cwrappersource="$output_path/$objdir/lt-$output_name.c"
5287 cwrapper="$output_path/$output_name.exe"
5288 $rm $cwrappersource $cwrapper
5289 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5291 cat > $cwrappersource <<EOF
5293 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5294 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5296 The $output program cannot be directly executed until all the libtool
5297 libraries that it depends on are installed.
5299 This wrapper executable should never be moved out of the build directory.
5300 If it is, it will not operate correctly.
5302 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5303 but could eventually absorb all of the scripts functionality and
5304 exec $objdir/$outputname directly.
5307 cat >> $cwrappersource<<"EOF"
5308 #include <stdio.h>
5309 #include <stdlib.h>
5310 #include <unistd.h>
5311 #include <malloc.h>
5312 #include <stdarg.h>
5313 #include <assert.h>
5314 #include <string.h>
5315 #include <ctype.h>
5316 #include <sys/stat.h>
5318 #if defined(PATH_MAX)
5319 # define LT_PATHMAX PATH_MAX
5320 #elif defined(MAXPATHLEN)
5321 # define LT_PATHMAX MAXPATHLEN
5322 #else
5323 # define LT_PATHMAX 1024
5324 #endif
5326 #ifndef DIR_SEPARATOR
5327 # define DIR_SEPARATOR '/'
5328 # define PATH_SEPARATOR ':'
5329 #endif
5331 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5332 defined (__OS2__)
5333 # define HAVE_DOS_BASED_FILE_SYSTEM
5334 # ifndef DIR_SEPARATOR_2
5335 # define DIR_SEPARATOR_2 '\\'
5336 # endif
5337 # ifndef PATH_SEPARATOR_2
5338 # define PATH_SEPARATOR_2 ';'
5339 # endif
5340 #endif
5342 #ifndef DIR_SEPARATOR_2
5343 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5344 #else /* DIR_SEPARATOR_2 */
5345 # define IS_DIR_SEPARATOR(ch) \
5346 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5347 #endif /* DIR_SEPARATOR_2 */
5349 #ifndef PATH_SEPARATOR_2
5350 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5351 #else /* PATH_SEPARATOR_2 */
5352 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5353 #endif /* PATH_SEPARATOR_2 */
5355 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5356 #define XFREE(stale) do { \
5357 if (stale) { free ((void *) stale); stale = 0; } \
5358 } while (0)
5360 /* -DDEBUG is fairly common in CFLAGS. */
5361 #undef DEBUG
5362 #if defined DEBUGWRAPPER
5363 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5364 #else
5365 # define DEBUG(format, ...)
5366 #endif
5368 const char *program_name = NULL;
5370 void * xmalloc (size_t num);
5371 char * xstrdup (const char *string);
5372 const char * base_name (const char *name);
5373 char * find_executable(const char *wrapper);
5374 int check_executable(const char *path);
5375 char * strendzap(char *str, const char *pat);
5376 void lt_fatal (const char *message, ...);
5379 main (int argc, char *argv[])
5381 char **newargz;
5382 int i;
5384 program_name = (char *) xstrdup (base_name (argv[0]));
5385 DEBUG("(main) argv[0] : %s\n",argv[0]);
5386 DEBUG("(main) program_name : %s\n",program_name);
5387 newargz = XMALLOC(char *, argc+2);
5390 cat >> $cwrappersource <<EOF
5391 newargz[0] = (char *) xstrdup("$SHELL");
5394 cat >> $cwrappersource <<"EOF"
5395 newargz[1] = find_executable(argv[0]);
5396 if (newargz[1] == NULL)
5397 lt_fatal("Couldn't find %s", argv[0]);
5398 DEBUG("(main) found exe at : %s\n",newargz[1]);
5399 /* we know the script has the same name, without the .exe */
5400 /* so make sure newargz[1] doesn't end in .exe */
5401 strendzap(newargz[1],".exe");
5402 for (i = 1; i < argc; i++)
5403 newargz[i+1] = xstrdup(argv[i]);
5404 newargz[argc+1] = NULL;
5406 for (i=0; i<argc+1; i++)
5408 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5414 case $host_os in
5415 mingw*)
5416 cat >> $cwrappersource <<EOF
5417 execv("$SHELL",(char const **)newargz);
5421 cat >> $cwrappersource <<EOF
5422 execv("$SHELL",newargz);
5425 esac
5427 cat >> $cwrappersource <<"EOF"
5428 return 127;
5431 void *
5432 xmalloc (size_t num)
5434 void * p = (void *) malloc (num);
5435 if (!p)
5436 lt_fatal ("Memory exhausted");
5438 return p;
5441 char *
5442 xstrdup (const char *string)
5444 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5448 const char *
5449 base_name (const char *name)
5451 const char *base;
5453 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5454 /* Skip over the disk name in MSDOS pathnames. */
5455 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5456 name += 2;
5457 #endif
5459 for (base = name; *name; name++)
5460 if (IS_DIR_SEPARATOR (*name))
5461 base = name + 1;
5462 return base;
5466 check_executable(const char * path)
5468 struct stat st;
5470 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5471 if ((!path) || (!*path))
5472 return 0;
5474 if ((stat (path, &st) >= 0) &&
5476 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5477 #if defined (S_IXOTH)
5478 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5479 #endif
5480 #if defined (S_IXGRP)
5481 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5482 #endif
5483 ((st.st_mode & S_IXUSR) == S_IXUSR))
5485 return 1;
5486 else
5487 return 0;
5490 /* Searches for the full path of the wrapper. Returns
5491 newly allocated full path name if found, NULL otherwise */
5492 char *
5493 find_executable (const char* wrapper)
5495 int has_slash = 0;
5496 const char* p;
5497 const char* p_next;
5498 /* static buffer for getcwd */
5499 char tmp[LT_PATHMAX + 1];
5500 int tmp_len;
5501 char* concat_name;
5503 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5505 if ((wrapper == NULL) || (*wrapper == '\0'))
5506 return NULL;
5508 /* Absolute path? */
5509 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5510 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5512 concat_name = xstrdup (wrapper);
5513 if (check_executable(concat_name))
5514 return concat_name;
5515 XFREE(concat_name);
5517 else
5519 #endif
5520 if (IS_DIR_SEPARATOR (wrapper[0]))
5522 concat_name = xstrdup (wrapper);
5523 if (check_executable(concat_name))
5524 return concat_name;
5525 XFREE(concat_name);
5527 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5529 #endif
5531 for (p = wrapper; *p; p++)
5532 if (*p == '/')
5534 has_slash = 1;
5535 break;
5537 if (!has_slash)
5539 /* no slashes; search PATH */
5540 const char* path = getenv ("PATH");
5541 if (path != NULL)
5543 for (p = path; *p; p = p_next)
5545 const char* q;
5546 size_t p_len;
5547 for (q = p; *q; q++)
5548 if (IS_PATH_SEPARATOR(*q))
5549 break;
5550 p_len = q - p;
5551 p_next = (*q == '\0' ? q : q + 1);
5552 if (p_len == 0)
5554 /* empty path: current directory */
5555 if (getcwd (tmp, LT_PATHMAX) == NULL)
5556 lt_fatal ("getcwd failed");
5557 tmp_len = strlen(tmp);
5558 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5559 memcpy (concat_name, tmp, tmp_len);
5560 concat_name[tmp_len] = '/';
5561 strcpy (concat_name + tmp_len + 1, wrapper);
5563 else
5565 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5566 memcpy (concat_name, p, p_len);
5567 concat_name[p_len] = '/';
5568 strcpy (concat_name + p_len + 1, wrapper);
5570 if (check_executable(concat_name))
5571 return concat_name;
5572 XFREE(concat_name);
5575 /* not found in PATH; assume curdir */
5577 /* Relative path | not found in path: prepend cwd */
5578 if (getcwd (tmp, LT_PATHMAX) == NULL)
5579 lt_fatal ("getcwd failed");
5580 tmp_len = strlen(tmp);
5581 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5582 memcpy (concat_name, tmp, tmp_len);
5583 concat_name[tmp_len] = '/';
5584 strcpy (concat_name + tmp_len + 1, wrapper);
5586 if (check_executable(concat_name))
5587 return concat_name;
5588 XFREE(concat_name);
5589 return NULL;
5592 char *
5593 strendzap(char *str, const char *pat)
5595 size_t len, patlen;
5597 assert(str != NULL);
5598 assert(pat != NULL);
5600 len = strlen(str);
5601 patlen = strlen(pat);
5603 if (patlen <= len)
5605 str += len - patlen;
5606 if (strcmp(str, pat) == 0)
5607 *str = '\0';
5609 return str;
5612 static void
5613 lt_error_core (int exit_status, const char * mode,
5614 const char * message, va_list ap)
5616 fprintf (stderr, "%s: %s: ", program_name, mode);
5617 vfprintf (stderr, message, ap);
5618 fprintf (stderr, ".\n");
5620 if (exit_status >= 0)
5621 exit (exit_status);
5624 void
5625 lt_fatal (const char *message, ...)
5627 va_list ap;
5628 va_start (ap, message);
5629 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5630 va_end (ap);
5633 # we should really use a build-platform specific compiler
5634 # here, but OTOH, the wrappers (shell script and this C one)
5635 # are only useful if you want to execute the "real" binary.
5636 # Since the "real" binary is built for $host, then this
5637 # wrapper might as well be built for $host, too.
5638 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5640 esac
5641 $rm $output
5642 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5644 $echo > $output "\
5645 #! $SHELL
5647 # $output - temporary wrapper script for $objdir/$outputname
5648 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5650 # The $output program cannot be directly executed until all the libtool
5651 # libraries that it depends on are installed.
5653 # This wrapper script should never be moved out of the build directory.
5654 # If it is, it will not operate correctly.
5656 # Sed substitution that helps us do robust quoting. It backslashifies
5657 # metacharacters that are still active within double-quoted strings.
5658 Xsed='${SED} -e 1s/^X//'
5659 sed_quote_subst='$sed_quote_subst'
5661 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5662 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5663 emulate sh
5664 NULLCMD=:
5665 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5666 # is contrary to our usage. Disable this feature.
5667 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5668 setopt NO_GLOB_SUBST
5669 else
5670 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5672 BIN_SH=xpg4; export BIN_SH # for Tru64
5673 DUALCASE=1; export DUALCASE # for MKS sh
5675 # The HP-UX ksh and POSIX shell print the target directory to stdout
5676 # if CDPATH is set.
5677 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5679 relink_command=\"$relink_command\"
5681 # This environment variable determines our operation mode.
5682 if test \"\$libtool_install_magic\" = \"$magic\"; then
5683 # install mode needs the following variable:
5684 notinst_deplibs='$notinst_deplibs'
5685 else
5686 # When we are sourced in execute mode, \$file and \$echo are already set.
5687 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5688 echo=\"$qecho\"
5689 file=\"\$0\"
5690 # Make sure echo works.
5691 if test \"X\$1\" = X--no-reexec; then
5692 # Discard the --no-reexec flag, and continue.
5693 shift
5694 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5695 # Yippee, \$echo works!
5697 else
5698 # Restart under the correct shell, and then maybe \$echo will work.
5699 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5703 $echo >> $output "\
5705 # Find the directory that this script lives in.
5706 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5707 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5709 # Follow symbolic links until we get to the real thisdir.
5710 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5711 while test -n \"\$file\"; do
5712 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5714 # If there was a directory component, then change thisdir.
5715 if test \"x\$destdir\" != \"x\$file\"; then
5716 case \"\$destdir\" in
5717 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5718 *) thisdir=\"\$thisdir/\$destdir\" ;;
5719 esac
5722 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5723 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5724 done
5726 # Try to get the absolute directory name.
5727 absdir=\`cd \"\$thisdir\" && pwd\`
5728 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5731 if test "$fast_install" = yes; then
5732 $echo >> $output "\
5733 program=lt-'$outputname'$exeext
5734 progdir=\"\$thisdir/$objdir\"
5736 if test ! -f \"\$progdir/\$program\" || \\
5737 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5738 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5740 file=\"\$\$-\$program\"
5742 if test ! -d \"\$progdir\"; then
5743 $mkdir \"\$progdir\"
5744 else
5745 $rm \"\$progdir/\$file\"
5748 $echo >> $output "\
5750 # relink executable if necessary
5751 if test -n \"\$relink_command\"; then
5752 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5753 else
5754 $echo \"\$relink_command_output\" >&2
5755 $rm \"\$progdir/\$file\"
5756 exit $EXIT_FAILURE
5760 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5761 { $rm \"\$progdir/\$program\";
5762 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5763 $rm \"\$progdir/\$file\"
5765 else
5766 $echo >> $output "\
5767 program='$outputname'
5768 progdir=\"\$thisdir/$objdir\"
5772 $echo >> $output "\
5774 if test -f \"\$progdir/\$program\"; then"
5776 # Export our shlibpath_var if we have one.
5777 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5778 $echo >> $output "\
5779 # Add our own library path to $shlibpath_var
5780 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5782 # Some systems cannot cope with colon-terminated $shlibpath_var
5783 # The second colon is a workaround for a bug in BeOS R4 sed
5784 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5786 export $shlibpath_var
5790 # fixup the dll searchpath if we need to.
5791 if test -n "$dllsearchpath"; then
5792 $echo >> $output "\
5793 # Add the dll search path components to the executable PATH
5794 PATH=$dllsearchpath:\$PATH
5798 $echo >> $output "\
5799 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5800 # Run the actual program with our arguments.
5802 case $host in
5803 # Backslashes separate directories on plain windows
5804 *-*-mingw | *-*-os2*)
5805 $echo >> $output "\
5806 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5811 $echo >> $output "\
5812 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5815 esac
5816 $echo >> $output "\
5817 \$echo \"\$0: cannot exec \$program \$*\"
5818 exit $EXIT_FAILURE
5820 else
5821 # The program doesn't exist.
5822 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5823 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5824 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5825 exit $EXIT_FAILURE
5829 chmod +x $output
5831 exit $EXIT_SUCCESS
5833 esac
5835 # See if we need to build an old-fashioned archive.
5836 for oldlib in $oldlibs; do
5838 if test "$build_libtool_libs" = convenience; then
5839 oldobjs="$libobjs_save"
5840 addlibs="$convenience"
5841 build_libtool_libs=no
5842 else
5843 if test "$build_libtool_libs" = module; then
5844 oldobjs="$libobjs_save"
5845 build_libtool_libs=no
5846 else
5847 oldobjs="$old_deplibs $non_pic_objects"
5849 addlibs="$old_convenience"
5852 if test -n "$addlibs"; then
5853 gentop="$output_objdir/${outputname}x"
5854 generated="$generated $gentop"
5856 func_extract_archives $gentop $addlibs
5857 oldobjs="$oldobjs $func_extract_archives_result"
5860 # Do each command in the archive commands.
5861 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5862 cmds=$old_archive_from_new_cmds
5863 else
5864 # POSIX demands no paths to be encoded in archives. We have
5865 # to avoid creating archives with duplicate basenames if we
5866 # might have to extract them afterwards, e.g., when creating a
5867 # static archive out of a convenience library, or when linking
5868 # the entirety of a libtool archive into another (currently
5869 # not supported by libtool).
5870 if (for obj in $oldobjs
5872 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5873 done | sort | sort -uc >/dev/null 2>&1); then
5875 else
5876 $echo "copying selected object files to avoid basename conflicts..."
5878 if test -z "$gentop"; then
5879 gentop="$output_objdir/${outputname}x"
5880 generated="$generated $gentop"
5882 $show "${rm}r $gentop"
5883 $run ${rm}r "$gentop"
5884 $show "$mkdir $gentop"
5885 $run $mkdir "$gentop"
5886 exit_status=$?
5887 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5888 exit $exit_status
5892 save_oldobjs=$oldobjs
5893 oldobjs=
5894 counter=1
5895 for obj in $save_oldobjs
5897 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5898 case " $oldobjs " in
5899 " ") oldobjs=$obj ;;
5900 *[\ /]"$objbase "*)
5901 while :; do
5902 # Make sure we don't pick an alternate name that also
5903 # overlaps.
5904 newobj=lt$counter-$objbase
5905 counter=`expr $counter + 1`
5906 case " $oldobjs " in
5907 *[\ /]"$newobj "*) ;;
5908 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5909 esac
5910 done
5911 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5912 $run ln "$obj" "$gentop/$newobj" ||
5913 $run cp "$obj" "$gentop/$newobj"
5914 oldobjs="$oldobjs $gentop/$newobj"
5916 *) oldobjs="$oldobjs $obj" ;;
5917 esac
5918 done
5921 eval cmds=\"$old_archive_cmds\"
5923 if len=`expr "X$cmds" : ".*"` &&
5924 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5925 cmds=$old_archive_cmds
5926 else
5927 # the command line is too long to link in one step, link in parts
5928 $echo "using piecewise archive linking..."
5929 save_RANLIB=$RANLIB
5930 RANLIB=:
5931 objlist=
5932 concat_cmds=
5933 save_oldobjs=$oldobjs
5935 # Is there a better way of finding the last object in the list?
5936 for obj in $save_oldobjs
5938 last_oldobj=$obj
5939 done
5940 for obj in $save_oldobjs
5942 oldobjs="$objlist $obj"
5943 objlist="$objlist $obj"
5944 eval test_cmds=\"$old_archive_cmds\"
5945 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5946 test "$len" -le "$max_cmd_len"; then
5948 else
5949 # the above command should be used before it gets too long
5950 oldobjs=$objlist
5951 if test "$obj" = "$last_oldobj" ; then
5952 RANLIB=$save_RANLIB
5954 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5955 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5956 objlist=
5958 done
5959 RANLIB=$save_RANLIB
5960 oldobjs=$objlist
5961 if test "X$oldobjs" = "X" ; then
5962 eval cmds=\"\$concat_cmds\"
5963 else
5964 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5968 save_ifs="$IFS"; IFS='~'
5969 for cmd in $cmds; do
5970 eval cmd=\"$cmd\"
5971 IFS="$save_ifs"
5972 $show "$cmd"
5973 $run eval "$cmd" || exit $?
5974 done
5975 IFS="$save_ifs"
5976 done
5978 if test -n "$generated"; then
5979 $show "${rm}r$generated"
5980 $run ${rm}r$generated
5983 # Now create the libtool archive.
5984 case $output in
5985 *.la)
5986 old_library=
5987 test "$build_old_libs" = yes && old_library="$libname.$libext"
5988 $show "creating $output"
5990 # Preserve any variables that may affect compiler behavior
5991 for var in $variables_saved_for_relink; do
5992 if eval test -z \"\${$var+set}\"; then
5993 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5994 elif eval var_value=\$$var; test -z "$var_value"; then
5995 relink_command="$var=; export $var; $relink_command"
5996 else
5997 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5998 relink_command="$var=\"$var_value\"; export $var; $relink_command"
6000 done
6001 # Quote the link command for shipping.
6002 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6003 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
6004 if test "$hardcode_automatic" = yes ; then
6005 relink_command=
6009 # Only create the output if not a dry run.
6010 if test -z "$run"; then
6011 for installed in no yes; do
6012 if test "$installed" = yes; then
6013 if test -z "$install_libdir"; then
6014 break
6016 output="$output_objdir/$outputname"i
6017 # Replace all uninstalled libtool libraries with the installed ones
6018 newdependency_libs=
6019 for deplib in $dependency_libs; do
6020 case $deplib in
6021 *.la)
6022 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
6023 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6024 if test -z "$libdir"; then
6025 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6026 exit $EXIT_FAILURE
6028 newdependency_libs="$newdependency_libs $libdir/$name"
6030 *) newdependency_libs="$newdependency_libs $deplib" ;;
6031 esac
6032 done
6033 dependency_libs="$newdependency_libs"
6034 newdlfiles=
6035 for lib in $dlfiles; do
6036 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6037 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6038 if test -z "$libdir"; then
6039 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6040 exit $EXIT_FAILURE
6042 newdlfiles="$newdlfiles $libdir/$name"
6043 done
6044 dlfiles="$newdlfiles"
6045 newdlprefiles=
6046 for lib in $dlprefiles; do
6047 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6048 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6049 if test -z "$libdir"; then
6050 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6051 exit $EXIT_FAILURE
6053 newdlprefiles="$newdlprefiles $libdir/$name"
6054 done
6055 dlprefiles="$newdlprefiles"
6056 else
6057 newdlfiles=
6058 for lib in $dlfiles; do
6059 case $lib in
6060 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6061 *) abs=`pwd`"/$lib" ;;
6062 esac
6063 newdlfiles="$newdlfiles $abs"
6064 done
6065 dlfiles="$newdlfiles"
6066 newdlprefiles=
6067 for lib in $dlprefiles; do
6068 case $lib in
6069 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6070 *) abs=`pwd`"/$lib" ;;
6071 esac
6072 newdlprefiles="$newdlprefiles $abs"
6073 done
6074 dlprefiles="$newdlprefiles"
6076 $rm $output
6077 # place dlname in correct position for cygwin
6078 tdlname=$dlname
6079 case $host,$output,$installed,$module,$dlname in
6080 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6081 esac
6082 $echo > $output "\
6083 # $outputname - a libtool library file
6084 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6086 # Please DO NOT delete this file!
6087 # It is necessary for linking the library.
6089 # The name that we can dlopen(3).
6090 dlname='$tdlname'
6092 # Names of this library.
6093 library_names='$library_names'
6095 # The name of the static archive.
6096 old_library='$old_library'
6098 # Libraries that this one depends upon.
6099 dependency_libs='$dependency_libs'
6101 # Version information for $libname.
6102 current=$current
6103 age=$age
6104 revision=$revision
6106 # Is this an already installed library?
6107 installed=$installed
6109 # Should we warn about portability when linking against -modules?
6110 shouldnotlink=$module
6112 # Files to dlopen/dlpreopen
6113 dlopen='$dlfiles'
6114 dlpreopen='$dlprefiles'
6116 # Directory that this library needs to be installed in:
6117 libdir='$install_libdir'"
6118 if test "$installed" = no && test "$need_relink" = yes; then
6119 $echo >> $output "\
6120 relink_command=\"$relink_command\""
6122 done
6125 # Do a symbolic link so that the libtool archive can be found in
6126 # LD_LIBRARY_PATH before the program is installed.
6127 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6128 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6130 esac
6131 exit $EXIT_SUCCESS
6134 # libtool install mode
6135 install)
6136 modename="$modename: install"
6138 # There may be an optional sh(1) argument at the beginning of
6139 # install_prog (especially on Windows NT).
6140 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6141 # Allow the use of GNU shtool's install command.
6142 $echo "X$nonopt" | grep shtool > /dev/null; then
6143 # Aesthetically quote it.
6144 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6145 case $arg in
6146 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6147 arg="\"$arg\""
6149 esac
6150 install_prog="$arg "
6151 arg="$1"
6152 shift
6153 else
6154 install_prog=
6155 arg=$nonopt
6158 # The real first argument should be the name of the installation program.
6159 # Aesthetically quote it.
6160 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6161 case $arg in
6162 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6163 arg="\"$arg\""
6165 esac
6166 install_prog="$install_prog$arg"
6168 # We need to accept at least all the BSD install flags.
6169 dest=
6170 files=
6171 opts=
6172 prev=
6173 install_type=
6174 isdir=no
6175 stripme=
6176 for arg
6178 if test -n "$dest"; then
6179 files="$files $dest"
6180 dest=$arg
6181 continue
6184 case $arg in
6185 -d) isdir=yes ;;
6186 -f)
6187 case " $install_prog " in
6188 *[\\\ /]cp\ *) ;;
6189 *) prev=$arg ;;
6190 esac
6192 -g | -m | -o) prev=$arg ;;
6194 stripme=" -s"
6195 continue
6200 # If the previous option needed an argument, then skip it.
6201 if test -n "$prev"; then
6202 prev=
6203 else
6204 dest=$arg
6205 continue
6208 esac
6210 # Aesthetically quote the argument.
6211 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6212 case $arg in
6213 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6214 arg="\"$arg\""
6216 esac
6217 install_prog="$install_prog $arg"
6218 done
6220 if test -z "$install_prog"; then
6221 $echo "$modename: you must specify an install program" 1>&2
6222 $echo "$help" 1>&2
6223 exit $EXIT_FAILURE
6226 if test -n "$prev"; then
6227 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6228 $echo "$help" 1>&2
6229 exit $EXIT_FAILURE
6232 if test -z "$files"; then
6233 if test -z "$dest"; then
6234 $echo "$modename: no file or destination specified" 1>&2
6235 else
6236 $echo "$modename: you must specify a destination" 1>&2
6238 $echo "$help" 1>&2
6239 exit $EXIT_FAILURE
6242 # Strip any trailing slash from the destination.
6243 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6245 # Check to see that the destination is a directory.
6246 test -d "$dest" && isdir=yes
6247 if test "$isdir" = yes; then
6248 destdir="$dest"
6249 destname=
6250 else
6251 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6252 test "X$destdir" = "X$dest" && destdir=.
6253 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6255 # Not a directory, so check to see that there is only one file specified.
6256 set dummy $files
6257 if test "$#" -gt 2; then
6258 $echo "$modename: \`$dest' is not a directory" 1>&2
6259 $echo "$help" 1>&2
6260 exit $EXIT_FAILURE
6263 case $destdir in
6264 [\\/]* | [A-Za-z]:[\\/]*) ;;
6266 for file in $files; do
6267 case $file in
6268 *.lo) ;;
6270 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6271 $echo "$help" 1>&2
6272 exit $EXIT_FAILURE
6274 esac
6275 done
6277 esac
6279 # This variable tells wrapper scripts just to set variables rather
6280 # than running their programs.
6281 libtool_install_magic="$magic"
6283 staticlibs=
6284 future_libdirs=
6285 current_libdirs=
6286 for file in $files; do
6288 # Do each installation.
6289 case $file in
6290 *.$libext)
6291 # Do the static libraries later.
6292 staticlibs="$staticlibs $file"
6295 *.la)
6296 # Check to see that this really is a libtool archive.
6297 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6298 else
6299 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6300 $echo "$help" 1>&2
6301 exit $EXIT_FAILURE
6304 library_names=
6305 old_library=
6306 relink_command=
6307 # If there is no directory component, then add one.
6308 case $file in
6309 */* | *\\*) . $file ;;
6310 *) . ./$file ;;
6311 esac
6313 # Add the libdir to current_libdirs if it is the destination.
6314 if test "X$destdir" = "X$libdir"; then
6315 case "$current_libdirs " in
6316 *" $libdir "*) ;;
6317 *) current_libdirs="$current_libdirs $libdir" ;;
6318 esac
6319 else
6320 # Note the libdir as a future libdir.
6321 case "$future_libdirs " in
6322 *" $libdir "*) ;;
6323 *) future_libdirs="$future_libdirs $libdir" ;;
6324 esac
6327 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6328 test "X$dir" = "X$file/" && dir=
6329 dir="$dir$objdir"
6331 if test -n "$relink_command"; then
6332 # Determine the prefix the user has applied to our future dir.
6333 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6335 # Don't allow the user to place us outside of our expected
6336 # location b/c this prevents finding dependent libraries that
6337 # are installed to the same prefix.
6338 # At present, this check doesn't affect windows .dll's that
6339 # are installed into $libdir/../bin (currently, that works fine)
6340 # but it's something to keep an eye on.
6341 if test "$inst_prefix_dir" = "$destdir"; then
6342 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6343 exit $EXIT_FAILURE
6346 if test -n "$inst_prefix_dir"; then
6347 # Stick the inst_prefix_dir data into the link command.
6348 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6349 else
6350 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6353 $echo "$modename: warning: relinking \`$file'" 1>&2
6354 $show "$relink_command"
6355 if $run eval "$relink_command"; then :
6356 else
6357 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6358 exit $EXIT_FAILURE
6362 # See the names of the shared library.
6363 set dummy $library_names
6364 if test -n "$2"; then
6365 realname="$2"
6366 shift
6367 shift
6369 srcname="$realname"
6370 test -n "$relink_command" && srcname="$realname"T
6372 # Install the shared library and build the symlinks.
6373 $show "$install_prog $dir/$srcname $destdir/$realname"
6374 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6375 if test -n "$stripme" && test -n "$striplib"; then
6376 $show "$striplib $destdir/$realname"
6377 $run eval "$striplib $destdir/$realname" || exit $?
6380 if test "$#" -gt 0; then
6381 # Delete the old symlinks, and create new ones.
6382 # Try `ln -sf' first, because the `ln' binary might depend on
6383 # the symlink we replace! Solaris /bin/ln does not understand -f,
6384 # so we also need to try rm && ln -s.
6385 for linkname
6387 if test "$linkname" != "$realname"; then
6388 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6389 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6391 done
6394 # Do each command in the postinstall commands.
6395 lib="$destdir/$realname"
6396 cmds=$postinstall_cmds
6397 save_ifs="$IFS"; IFS='~'
6398 for cmd in $cmds; do
6399 IFS="$save_ifs"
6400 eval cmd=\"$cmd\"
6401 $show "$cmd"
6402 $run eval "$cmd" || {
6403 lt_exit=$?
6405 # Restore the uninstalled library and exit
6406 if test "$mode" = relink; then
6407 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6410 exit $lt_exit
6412 done
6413 IFS="$save_ifs"
6416 # Install the pseudo-library for information purposes.
6417 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6418 instname="$dir/$name"i
6419 $show "$install_prog $instname $destdir/$name"
6420 $run eval "$install_prog $instname $destdir/$name" || exit $?
6422 # Maybe install the static library, too.
6423 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6426 *.lo)
6427 # Install (i.e. copy) a libtool object.
6429 # Figure out destination file name, if it wasn't already specified.
6430 if test -n "$destname"; then
6431 destfile="$destdir/$destname"
6432 else
6433 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6434 destfile="$destdir/$destfile"
6437 # Deduce the name of the destination old-style object file.
6438 case $destfile in
6439 *.lo)
6440 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6442 *.$objext)
6443 staticdest="$destfile"
6444 destfile=
6447 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6448 $echo "$help" 1>&2
6449 exit $EXIT_FAILURE
6451 esac
6453 # Install the libtool object if requested.
6454 if test -n "$destfile"; then
6455 $show "$install_prog $file $destfile"
6456 $run eval "$install_prog $file $destfile" || exit $?
6459 # Install the old object if enabled.
6460 if test "$build_old_libs" = yes; then
6461 # Deduce the name of the old-style object file.
6462 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6464 $show "$install_prog $staticobj $staticdest"
6465 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6467 exit $EXIT_SUCCESS
6471 # Figure out destination file name, if it wasn't already specified.
6472 if test -n "$destname"; then
6473 destfile="$destdir/$destname"
6474 else
6475 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6476 destfile="$destdir/$destfile"
6479 # If the file is missing, and there is a .exe on the end, strip it
6480 # because it is most likely a libtool script we actually want to
6481 # install
6482 stripped_ext=""
6483 case $file in
6484 *.exe)
6485 if test ! -f "$file"; then
6486 file=`$echo $file|${SED} 's,.exe$,,'`
6487 stripped_ext=".exe"
6490 esac
6492 # Do a test to see if this is really a libtool program.
6493 case $host in
6494 *cygwin*|*mingw*)
6495 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6498 wrapper=$file
6500 esac
6501 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6502 notinst_deplibs=
6503 relink_command=
6505 # Note that it is not necessary on cygwin/mingw to append a dot to
6506 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6507 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6508 # `FILE.' does not work on cygwin managed mounts.
6510 # If there is no directory component, then add one.
6511 case $wrapper in
6512 */* | *\\*) . ${wrapper} ;;
6513 *) . ./${wrapper} ;;
6514 esac
6516 # Check the variables that should have been set.
6517 if test -z "$notinst_deplibs"; then
6518 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6519 exit $EXIT_FAILURE
6522 finalize=yes
6523 for lib in $notinst_deplibs; do
6524 # Check to see that each library is installed.
6525 libdir=
6526 if test -f "$lib"; then
6527 # If there is no directory component, then add one.
6528 case $lib in
6529 */* | *\\*) . $lib ;;
6530 *) . ./$lib ;;
6531 esac
6533 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6534 if test -n "$libdir" && test ! -f "$libfile"; then
6535 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6536 finalize=no
6538 done
6540 relink_command=
6541 # Note that it is not necessary on cygwin/mingw to append a dot to
6542 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6543 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6544 # `FILE.' does not work on cygwin managed mounts.
6546 # If there is no directory component, then add one.
6547 case $wrapper in
6548 */* | *\\*) . ${wrapper} ;;
6549 *) . ./${wrapper} ;;
6550 esac
6552 outputname=
6553 if test "$fast_install" = no && test -n "$relink_command"; then
6554 if test "$finalize" = yes && test -z "$run"; then
6555 tmpdir=`func_mktempdir`
6556 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6557 outputname="$tmpdir/$file"
6558 # Replace the output file specification.
6559 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6561 $show "$relink_command"
6562 if $run eval "$relink_command"; then :
6563 else
6564 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6565 ${rm}r "$tmpdir"
6566 continue
6568 file="$outputname"
6569 else
6570 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6572 else
6573 # Install the binary that we compiled earlier.
6574 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6578 # remove .exe since cygwin /usr/bin/install will append another
6579 # one anyway
6580 case $install_prog,$host in
6581 */usr/bin/install*,*cygwin*)
6582 case $file:$destfile in
6583 *.exe:*.exe)
6584 # this is ok
6586 *.exe:*)
6587 destfile=$destfile.exe
6589 *:*.exe)
6590 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6592 esac
6594 esac
6595 $show "$install_prog$stripme $file $destfile"
6596 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6597 test -n "$outputname" && ${rm}r "$tmpdir"
6599 esac
6600 done
6602 for file in $staticlibs; do
6603 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6605 # Set up the ranlib parameters.
6606 oldlib="$destdir/$name"
6608 $show "$install_prog $file $oldlib"
6609 $run eval "$install_prog \$file \$oldlib" || exit $?
6611 if test -n "$stripme" && test -n "$old_striplib"; then
6612 $show "$old_striplib $oldlib"
6613 $run eval "$old_striplib $oldlib" || exit $?
6616 # Do each command in the postinstall commands.
6617 cmds=$old_postinstall_cmds
6618 save_ifs="$IFS"; IFS='~'
6619 for cmd in $cmds; do
6620 IFS="$save_ifs"
6621 eval cmd=\"$cmd\"
6622 $show "$cmd"
6623 $run eval "$cmd" || exit $?
6624 done
6625 IFS="$save_ifs"
6626 done
6628 if test -n "$future_libdirs"; then
6629 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6632 if test -n "$current_libdirs"; then
6633 # Maybe just do a dry run.
6634 test -n "$run" && current_libdirs=" -n$current_libdirs"
6635 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6636 else
6637 exit $EXIT_SUCCESS
6641 # libtool finish mode
6642 finish)
6643 modename="$modename: finish"
6644 libdirs="$nonopt"
6645 admincmds=
6647 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6648 for dir
6650 libdirs="$libdirs $dir"
6651 done
6653 for libdir in $libdirs; do
6654 if test -n "$finish_cmds"; then
6655 # Do each command in the finish commands.
6656 cmds=$finish_cmds
6657 save_ifs="$IFS"; IFS='~'
6658 for cmd in $cmds; do
6659 IFS="$save_ifs"
6660 eval cmd=\"$cmd\"
6661 $show "$cmd"
6662 $run eval "$cmd" || admincmds="$admincmds
6663 $cmd"
6664 done
6665 IFS="$save_ifs"
6667 if test -n "$finish_eval"; then
6668 # Do the single finish_eval.
6669 eval cmds=\"$finish_eval\"
6670 $run eval "$cmds" || admincmds="$admincmds
6671 $cmds"
6673 done
6676 # Exit here if they wanted silent mode.
6677 test "$show" = : && exit $EXIT_SUCCESS
6679 $echo "X----------------------------------------------------------------------" | $Xsed
6680 $echo "Libraries have been installed in:"
6681 for libdir in $libdirs; do
6682 $echo " $libdir"
6683 done
6684 $echo
6685 $echo "If you ever happen to want to link against installed libraries"
6686 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6687 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6688 $echo "flag during linking and do at least one of the following:"
6689 if test -n "$shlibpath_var"; then
6690 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6691 $echo " during execution"
6693 if test -n "$runpath_var"; then
6694 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6695 $echo " during linking"
6697 if test -n "$hardcode_libdir_flag_spec"; then
6698 libdir=LIBDIR
6699 eval flag=\"$hardcode_libdir_flag_spec\"
6701 $echo " - use the \`$flag' linker flag"
6703 if test -n "$admincmds"; then
6704 $echo " - have your system administrator run these commands:$admincmds"
6706 if test -f /etc/ld.so.conf; then
6707 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6709 $echo
6710 $echo "See any operating system documentation about shared libraries for"
6711 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6712 $echo "X----------------------------------------------------------------------" | $Xsed
6713 exit $EXIT_SUCCESS
6716 # libtool execute mode
6717 execute)
6718 modename="$modename: execute"
6720 # The first argument is the command name.
6721 cmd="$nonopt"
6722 if test -z "$cmd"; then
6723 $echo "$modename: you must specify a COMMAND" 1>&2
6724 $echo "$help"
6725 exit $EXIT_FAILURE
6728 # Handle -dlopen flags immediately.
6729 for file in $execute_dlfiles; do
6730 if test ! -f "$file"; then
6731 $echo "$modename: \`$file' is not a file" 1>&2
6732 $echo "$help" 1>&2
6733 exit $EXIT_FAILURE
6736 dir=
6737 case $file in
6738 *.la)
6739 # Check to see that this really is a libtool archive.
6740 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6741 else
6742 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6743 $echo "$help" 1>&2
6744 exit $EXIT_FAILURE
6747 # Read the libtool library.
6748 dlname=
6749 library_names=
6751 # If there is no directory component, then add one.
6752 case $file in
6753 */* | *\\*) . $file ;;
6754 *) . ./$file ;;
6755 esac
6757 # Skip this library if it cannot be dlopened.
6758 if test -z "$dlname"; then
6759 # Warn if it was a shared library.
6760 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6761 continue
6764 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6765 test "X$dir" = "X$file" && dir=.
6767 if test -f "$dir/$objdir/$dlname"; then
6768 dir="$dir/$objdir"
6769 else
6770 if test ! -f "$dir/$dlname"; then
6771 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6772 exit $EXIT_FAILURE
6777 *.lo)
6778 # Just add the directory containing the .lo file.
6779 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6780 test "X$dir" = "X$file" && dir=.
6784 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6785 continue
6787 esac
6789 # Get the absolute pathname.
6790 absdir=`cd "$dir" && pwd`
6791 test -n "$absdir" && dir="$absdir"
6793 # Now add the directory to shlibpath_var.
6794 if eval "test -z \"\$$shlibpath_var\""; then
6795 eval "$shlibpath_var=\"\$dir\""
6796 else
6797 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6799 done
6801 # This variable tells wrapper scripts just to set shlibpath_var
6802 # rather than running their programs.
6803 libtool_execute_magic="$magic"
6805 # Check if any of the arguments is a wrapper script.
6806 args=
6807 for file
6809 case $file in
6810 -*) ;;
6812 # Do a test to see if this is really a libtool program.
6813 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6814 # If there is no directory component, then add one.
6815 case $file in
6816 */* | *\\*) . $file ;;
6817 *) . ./$file ;;
6818 esac
6820 # Transform arg to wrapped name.
6821 file="$progdir/$program"
6824 esac
6825 # Quote arguments (to preserve shell metacharacters).
6826 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6827 args="$args \"$file\""
6828 done
6830 if test -z "$run"; then
6831 if test -n "$shlibpath_var"; then
6832 # Export the shlibpath_var.
6833 eval "export $shlibpath_var"
6836 # Restore saved environment variables
6837 for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6839 eval "if test \"\${save_$lt_var+set}\" = set; then
6840 $lt_var=\$save_$lt_var; export $lt_var
6842 done
6844 # Now prepare to actually exec the command.
6845 exec_cmd="\$cmd$args"
6846 else
6847 # Display what would be done.
6848 if test -n "$shlibpath_var"; then
6849 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6850 $echo "export $shlibpath_var"
6852 $echo "$cmd$args"
6853 exit $EXIT_SUCCESS
6857 # libtool clean and uninstall mode
6858 clean | uninstall)
6859 modename="$modename: $mode"
6860 rm="$nonopt"
6861 files=
6862 rmforce=
6863 exit_status=0
6865 # This variable tells wrapper scripts just to set variables rather
6866 # than running their programs.
6867 libtool_install_magic="$magic"
6869 for arg
6871 case $arg in
6872 -f) rm="$rm $arg"; rmforce=yes ;;
6873 -*) rm="$rm $arg" ;;
6874 *) files="$files $arg" ;;
6875 esac
6876 done
6878 if test -z "$rm"; then
6879 $echo "$modename: you must specify an RM program" 1>&2
6880 $echo "$help" 1>&2
6881 exit $EXIT_FAILURE
6884 rmdirs=
6886 origobjdir="$objdir"
6887 for file in $files; do
6888 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6889 if test "X$dir" = "X$file"; then
6890 dir=.
6891 objdir="$origobjdir"
6892 else
6893 objdir="$dir/$origobjdir"
6895 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6896 test "$mode" = uninstall && objdir="$dir"
6898 # Remember objdir for removal later, being careful to avoid duplicates
6899 if test "$mode" = clean; then
6900 case " $rmdirs " in
6901 *" $objdir "*) ;;
6902 *) rmdirs="$rmdirs $objdir" ;;
6903 esac
6906 # Don't error if the file doesn't exist and rm -f was used.
6907 if (test -L "$file") >/dev/null 2>&1 \
6908 || (test -h "$file") >/dev/null 2>&1 \
6909 || test -f "$file"; then
6911 elif test -d "$file"; then
6912 exit_status=1
6913 continue
6914 elif test "$rmforce" = yes; then
6915 continue
6918 rmfiles="$file"
6920 case $name in
6921 *.la)
6922 # Possibly a libtool archive, so verify it.
6923 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6924 . $dir/$name
6926 # Delete the libtool libraries and symlinks.
6927 for n in $library_names; do
6928 rmfiles="$rmfiles $objdir/$n"
6929 done
6930 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6932 case "$mode" in
6933 clean)
6934 case " $library_names " in
6935 # " " in the beginning catches empty $dlname
6936 *" $dlname "*) ;;
6937 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6938 esac
6939 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6941 uninstall)
6942 if test -n "$library_names"; then
6943 # Do each command in the postuninstall commands.
6944 cmds=$postuninstall_cmds
6945 save_ifs="$IFS"; IFS='~'
6946 for cmd in $cmds; do
6947 IFS="$save_ifs"
6948 eval cmd=\"$cmd\"
6949 $show "$cmd"
6950 $run eval "$cmd"
6951 if test "$?" -ne 0 && test "$rmforce" != yes; then
6952 exit_status=1
6954 done
6955 IFS="$save_ifs"
6958 if test -n "$old_library"; then
6959 # Do each command in the old_postuninstall commands.
6960 cmds=$old_postuninstall_cmds
6961 save_ifs="$IFS"; IFS='~'
6962 for cmd in $cmds; do
6963 IFS="$save_ifs"
6964 eval cmd=\"$cmd\"
6965 $show "$cmd"
6966 $run eval "$cmd"
6967 if test "$?" -ne 0 && test "$rmforce" != yes; then
6968 exit_status=1
6970 done
6971 IFS="$save_ifs"
6973 # FIXME: should reinstall the best remaining shared library.
6975 esac
6979 *.lo)
6980 # Possibly a libtool object, so verify it.
6981 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6983 # Read the .lo file
6984 . $dir/$name
6986 # Add PIC object to the list of files to remove.
6987 if test -n "$pic_object" \
6988 && test "$pic_object" != none; then
6989 rmfiles="$rmfiles $dir/$pic_object"
6992 # Add non-PIC object to the list of files to remove.
6993 if test -n "$non_pic_object" \
6994 && test "$non_pic_object" != none; then
6995 rmfiles="$rmfiles $dir/$non_pic_object"
7001 if test "$mode" = clean ; then
7002 noexename=$name
7003 case $file in
7004 *.exe)
7005 file=`$echo $file|${SED} 's,.exe$,,'`
7006 noexename=`$echo $name|${SED} 's,.exe$,,'`
7007 # $file with .exe has already been added to rmfiles,
7008 # add $file without .exe
7009 rmfiles="$rmfiles $file"
7011 esac
7012 # Do a test to see if this is a libtool program.
7013 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7014 relink_command=
7015 . $dir/$noexename
7017 # note $name still contains .exe if it was in $file originally
7018 # as does the version of $file that was added into $rmfiles
7019 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7020 if test "$fast_install" = yes && test -n "$relink_command"; then
7021 rmfiles="$rmfiles $objdir/lt-$name"
7023 if test "X$noexename" != "X$name" ; then
7024 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7029 esac
7030 $show "$rm $rmfiles"
7031 $run $rm $rmfiles || exit_status=1
7032 done
7033 objdir="$origobjdir"
7035 # Try to remove the ${objdir}s in the directories where we deleted files
7036 for dir in $rmdirs; do
7037 if test -d "$dir"; then
7038 $show "rmdir $dir"
7039 $run rmdir $dir >/dev/null 2>&1
7041 done
7043 exit $exit_status
7047 $echo "$modename: you must specify a MODE" 1>&2
7048 $echo "$generic_help" 1>&2
7049 exit $EXIT_FAILURE
7051 esac
7053 if test -z "$exec_cmd"; then
7054 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7055 $echo "$generic_help" 1>&2
7056 exit $EXIT_FAILURE
7058 fi # test -z "$show_help"
7060 if test -n "$exec_cmd"; then
7061 eval exec $exec_cmd
7062 exit $EXIT_FAILURE
7065 # We need to display help for each of the modes.
7066 case $mode in
7067 "") $echo \
7068 "Usage: $modename [OPTION]... [MODE-ARG]...
7070 Provide generalized library-building support services.
7072 --config show all configuration variables
7073 --debug enable verbose shell tracing
7074 -n, --dry-run display commands without modifying any files
7075 --features display basic configuration information and exit
7076 --finish same as \`--mode=finish'
7077 --help display this help message and exit
7078 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7079 --quiet same as \`--silent'
7080 --silent don't print informational messages
7081 --tag=TAG use configuration variables from tag TAG
7082 --version print version information
7084 MODE must be one of the following:
7086 clean remove files from the build directory
7087 compile compile a source file into a libtool object
7088 execute automatically set library path, then run a program
7089 finish complete the installation of libtool libraries
7090 install install libraries or executables
7091 link create a library or an executable
7092 uninstall remove libraries from an installed directory
7094 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7095 a more detailed description of MODE.
7097 Report bugs to <bug-libtool@gnu.org>."
7098 exit $EXIT_SUCCESS
7101 clean)
7102 $echo \
7103 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7105 Remove files from the build directory.
7107 RM is the name of the program to use to delete files associated with each FILE
7108 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7109 to RM.
7111 If FILE is a libtool library, object or program, all the files associated
7112 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7115 compile)
7116 $echo \
7117 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7119 Compile a source file into a libtool library object.
7121 This mode accepts the following additional options:
7123 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7124 -prefer-pic try to building PIC objects only
7125 -prefer-non-pic try to building non-PIC objects only
7126 -static always build a \`.o' file suitable for static linking
7128 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7129 from the given SOURCEFILE.
7131 The output file name is determined by removing the directory component from
7132 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7133 library object suffix, \`.lo'."
7136 execute)
7137 $echo \
7138 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7140 Automatically set library path, then run a program.
7142 This mode accepts the following additional options:
7144 -dlopen FILE add the directory containing FILE to the library path
7146 This mode sets the library path environment variable according to \`-dlopen'
7147 flags.
7149 If any of the ARGS are libtool executable wrappers, then they are translated
7150 into their corresponding uninstalled binary, and any of their required library
7151 directories are added to the library path.
7153 Then, COMMAND is executed, with ARGS as arguments."
7156 finish)
7157 $echo \
7158 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7160 Complete the installation of libtool libraries.
7162 Each LIBDIR is a directory that contains libtool libraries.
7164 The commands that this mode executes may require superuser privileges. Use
7165 the \`--dry-run' option if you just want to see what would be executed."
7168 install)
7169 $echo \
7170 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7172 Install executables or libraries.
7174 INSTALL-COMMAND is the installation command. The first component should be
7175 either the \`install' or \`cp' program.
7177 The rest of the components are interpreted as arguments to that command (only
7178 BSD-compatible install options are recognized)."
7181 link)
7182 $echo \
7183 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7185 Link object files or libraries together to form another library, or to
7186 create an executable program.
7188 LINK-COMMAND is a command using the C compiler that you would use to create
7189 a program from several object files.
7191 The following components of LINK-COMMAND are treated specially:
7193 -all-static do not do any dynamic linking at all
7194 -avoid-version do not add a version suffix if possible
7195 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7196 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7197 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7198 -export-symbols SYMFILE
7199 try to export only the symbols listed in SYMFILE
7200 -export-symbols-regex REGEX
7201 try to export only the symbols matching REGEX
7202 -LLIBDIR search LIBDIR for required installed libraries
7203 -lNAME OUTPUT-FILE requires the installed library libNAME
7204 -module build a library that can dlopened
7205 -no-fast-install disable the fast-install mode
7206 -no-install link a not-installable executable
7207 -no-undefined declare that a library does not refer to external symbols
7208 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7209 -objectlist FILE Use a list of object files found in FILE to specify objects
7210 -precious-files-regex REGEX
7211 don't remove output files matching REGEX
7212 -release RELEASE specify package release information
7213 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7214 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7215 -static do not do any dynamic linking of uninstalled libtool libraries
7216 -static-libtool-libs
7217 do not do any dynamic linking of libtool libraries
7218 -version-info CURRENT[:REVISION[:AGE]]
7219 specify library version info [each variable defaults to 0]
7221 All other options (arguments beginning with \`-') are ignored.
7223 Every other argument is treated as a filename. Files ending in \`.la' are
7224 treated as uninstalled libtool libraries, other files are standard or library
7225 object files.
7227 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7228 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7229 required, except when creating a convenience library.
7231 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7232 using \`ar' and \`ranlib', or on Windows using \`lib'.
7234 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7235 is created, otherwise an executable program is created."
7238 uninstall)
7239 $echo \
7240 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7242 Remove libraries from an installation directory.
7244 RM is the name of the program to use to delete files associated with each FILE
7245 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7246 to RM.
7248 If FILE is a libtool library, all the files associated with it are deleted.
7249 Otherwise, only FILE itself is deleted using RM."
7253 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7254 $echo "$help" 1>&2
7255 exit $EXIT_FAILURE
7257 esac
7259 $echo
7260 $echo "Try \`$modename --help' for more information about other modes."
7262 exit $?
7264 # The TAGs below are defined such that we never get into a situation
7265 # in which we disable both kinds of libraries. Given conflicting
7266 # choices, we go for a static library, that is the most portable,
7267 # since we can't tell whether shared libraries were disabled because
7268 # the user asked for that or because the platform doesn't support
7269 # them. This is particularly important on AIX, because we don't
7270 # support having both static and shared libraries enabled at the same
7271 # time on that platform, so we default to a shared-only configuration.
7272 # If a disable-shared tag is given, we'll fallback to a static-only
7273 # configuration. But we'll never go from static-only to shared-only.
7275 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7276 disable_libs=shared
7277 # ### END LIBTOOL TAG CONFIG: disable-shared
7279 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7280 disable_libs=static
7281 # ### END LIBTOOL TAG CONFIG: disable-static
7283 # Local Variables:
7284 # mode:shell-script
7285 # sh-indentation:2
7286 # End:
7287 # ### BEGIN LIBTOOL TAG CONFIG: CXX
7289 # Libtool was configured on host fireball:
7291 # Shell to use when invoking shell scripts.
7292 SHELL="/bin/sh"
7294 # Whether or not to build shared libraries.
7295 build_libtool_libs=yes
7297 # Whether or not to build static libraries.
7298 build_old_libs=yes
7300 # Whether or not to add -lc for building shared libraries.
7301 build_libtool_need_lc=no
7303 # Whether or not to disallow shared libs when runtime libs are static
7304 allow_libtool_libs_with_static_runtimes=no
7306 # Whether or not to optimize for fast installation.
7307 fast_install=yes
7309 # The host system.
7310 host_alias=
7311 host=i686-suse-linux-gnu
7312 host_os=linux-gnu
7314 # The build system.
7315 build_alias=
7316 build=i686-suse-linux-gnu
7317 build_os=linux-gnu
7319 # An echo program that does not interpret backslashes.
7320 echo="echo"
7322 # The archiver.
7323 AR="ar"
7324 AR_FLAGS="cru"
7326 # A C compiler.
7327 LTCC="gcc"
7329 # LTCC compiler flags.
7330 LTCFLAGS="-g -O2"
7332 # A language-specific compiler.
7333 CC="g++"
7335 # Is the compiler the GNU C compiler?
7336 with_gcc=yes
7338 # An ERE matcher.
7339 EGREP="/usr/bin/grep -E"
7341 # The linker used to build libraries.
7342 LD="/usr/i586-suse-linux/bin/ld"
7344 # Whether we need hard or soft links.
7345 LN_S="ln -s"
7347 # A BSD-compatible nm program.
7348 NM="/usr/bin/nm -B"
7350 # A symbol stripping program
7351 STRIP="strip"
7353 # Used to examine libraries when file_magic_cmd begins "file"
7354 MAGIC_CMD=file
7356 # Used on cygwin: DLL creation program.
7357 DLLTOOL="dlltool"
7359 # Used on cygwin: object dumper.
7360 OBJDUMP="objdump"
7362 # Used on cygwin: assembler.
7363 AS="as"
7365 # The name of the directory that contains temporary libtool files.
7366 objdir=.libs
7368 # How to create reloadable object files.
7369 reload_flag=" -r"
7370 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7372 # How to pass a linker flag through the compiler.
7373 wl="-Wl,"
7375 # Object file suffix (normally "o").
7376 objext="o"
7378 # Old archive suffix (normally "a").
7379 libext="a"
7381 # Shared library suffix (normally ".so").
7382 shrext_cmds='.so'
7384 # Executable file suffix (normally "").
7385 exeext=""
7387 # Additional compiler flags for building library objects.
7388 pic_flag=" -fPIC -DPIC"
7389 pic_mode=default
7391 # What is the maximum length of a command?
7392 max_cmd_len=1572864
7394 # Does compiler simultaneously support -c and -o options?
7395 compiler_c_o="yes"
7397 # Must we lock files when doing compilation?
7398 need_locks="no"
7400 # Do we need the lib prefix for modules?
7401 need_lib_prefix=no
7403 # Do we need a version for libraries?
7404 need_version=no
7406 # Whether dlopen is supported.
7407 dlopen_support=unknown
7409 # Whether dlopen of programs is supported.
7410 dlopen_self=unknown
7412 # Whether dlopen of statically linked programs is supported.
7413 dlopen_self_static=unknown
7415 # Compiler flag to prevent dynamic linking.
7416 link_static_flag="-static"
7418 # Compiler flag to turn off builtin functions.
7419 no_builtin_flag=" -fno-builtin"
7421 # Compiler flag to allow reflexive dlopens.
7422 export_dynamic_flag_spec="\${wl}--export-dynamic"
7424 # Compiler flag to generate shared objects directly from archives.
7425 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7427 # Compiler flag to generate thread-safe objects.
7428 thread_safe_flag_spec=""
7430 # Library versioning type.
7431 version_type=linux
7433 # Format of library name prefix.
7434 libname_spec="lib\$name"
7436 # List of archive names. First name is the real one, the rest are links.
7437 # The last name is the one that the linker finds with -lNAME.
7438 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
7440 # The coded name of the library, if different from the real name.
7441 soname_spec="\${libname}\${release}\${shared_ext}\$major"
7443 # Commands used to build and install an old-style archive.
7444 RANLIB="ranlib"
7445 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
7446 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7447 old_postuninstall_cmds=""
7449 # Create an old-style archive from a shared archive.
7450 old_archive_from_new_cmds=""
7452 # Create a temporary old-style archive to link instead of a shared archive.
7453 old_archive_from_expsyms_cmds=""
7455 # Commands used to build and install a shared archive.
7456 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7457 archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
7458 postinstall_cmds=""
7459 postuninstall_cmds=""
7461 # Commands used to build a loadable module (assumed same as above if empty)
7462 module_cmds=""
7463 module_expsym_cmds=""
7465 # Commands to strip libraries.
7466 old_striplib="strip --strip-debug"
7467 striplib="strip --strip-unneeded"
7469 # Dependencies to place before the objects being linked to create a
7470 # shared library.
7471 predep_objects="/usr/lib/gcc/i586-suse-linux/4.3/../../../crti.o /usr/lib/gcc/i586-suse-linux/4.3/crtbeginS.o"
7473 # Dependencies to place after the objects being linked to create a
7474 # shared library.
7475 postdep_objects="/usr/lib/gcc/i586-suse-linux/4.3/crtendS.o /usr/lib/gcc/i586-suse-linux/4.3/../../../crtn.o"
7477 # Dependencies to place before the objects being linked to create a
7478 # shared library.
7479 predeps=""
7481 # Dependencies to place after the objects being linked to create a
7482 # shared library.
7483 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7485 # The directories searched by this compiler when creating a shared
7486 # library
7487 compiler_lib_search_dirs="/usr/lib/gcc/i586-suse-linux/4.3 /usr/lib/gcc/i586-suse-linux/4.3 /usr/lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/lib /usr/lib/gcc/i586-suse-linux/4.3/../../.."
7489 # The library search path used internally by the compiler when linking
7490 # a shared library.
7491 compiler_lib_search_path="-L/usr/lib/gcc/i586-suse-linux/4.3 -L/usr/lib/gcc/i586-suse-linux/4.3 -L/usr/lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/lib -L/usr/lib/gcc/i586-suse-linux/4.3/../../.."
7493 # Method to check whether dependent libraries are shared objects.
7494 deplibs_check_method="pass_all"
7496 # Command to use when deplibs_check_method == file_magic.
7497 file_magic_cmd="\$MAGIC_CMD"
7499 # Flag that allows shared libraries with undefined symbols to be built.
7500 allow_undefined_flag=""
7502 # Flag that forces no undefined symbols.
7503 no_undefined_flag=""
7505 # Commands used to finish a libtool library installation in a directory.
7506 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7508 # Same as above, but a single script fragment to be evaled but not shown.
7509 finish_eval=""
7511 # Take the output of nm and produce a listing of raw symbols and C names.
7512 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7514 # Transform the output of nm in a proper C declaration
7515 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7517 # Transform the output of nm in a C name address pair
7518 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7520 # This is the shared library runtime path variable.
7521 runpath_var=LD_RUN_PATH
7523 # This is the shared library path variable.
7524 shlibpath_var=LD_LIBRARY_PATH
7526 # Is shlibpath searched before the hard-coded library search path?
7527 shlibpath_overrides_runpath=no
7529 # How to hardcode a shared library path into an executable.
7530 hardcode_action=immediate
7532 # Whether we should hardcode library paths into libraries.
7533 hardcode_into_libs=yes
7535 # Flag to hardcode $libdir into a binary during linking.
7536 # This must work even if $libdir does not exist.
7537 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
7539 # If ld is used when linking, flag to hardcode $libdir into
7540 # a binary during linking. This must work even if $libdir does
7541 # not exist.
7542 hardcode_libdir_flag_spec_ld=""
7544 # Whether we need a single -rpath flag with a separated argument.
7545 hardcode_libdir_separator=""
7547 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7548 # resulting binary.
7549 hardcode_direct=no
7551 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7552 # resulting binary.
7553 hardcode_minus_L=no
7555 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7556 # the resulting binary.
7557 hardcode_shlibpath_var=unsupported
7559 # Set to yes if building a shared library automatically hardcodes DIR into the library
7560 # and all subsequent libraries and executables linked against it.
7561 hardcode_automatic=no
7563 # Variables whose values should be saved in libtool wrapper scripts and
7564 # restored at relink time.
7565 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7567 # Whether libtool must link a program against all its dependency libraries.
7568 link_all_deplibs=unknown
7570 # Compile-time system search path for libraries
7571 sys_lib_search_path_spec="/usr/lib/gcc/i586-suse-linux/4.3 /usr/i586-suse-linux/lib /usr/lib /lib"
7573 # Run-time system search path for libraries
7574 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/lib/Xaw3d /usr/i386-suse-linux/lib /usr/local/lib /opt/kde3/lib /usr/lib/graphviz /usr/lib/graphviz/sharp /usr/lib/graphviz/java /usr/lib/graphviz/perl /usr/lib/graphviz/php /usr/lib/graphviz/ocaml /usr/lib/graphviz/python /usr/lib/graphviz/lua /usr/lib/graphviz/tcl /usr/lib/graphviz/guile /usr/lib/graphviz/ruby "
7576 # Fix the shell variable $srcfile for the compiler.
7577 fix_srcfile_path=""
7579 # Set to yes if exported symbols are required.
7580 always_export_symbols=no
7582 # The commands to list exported symbols.
7583 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7585 # The commands to extract the exported symbol list from a shared archive.
7586 extract_expsyms_cmds=""
7588 # Symbols that should not be listed in the preloaded symbols.
7589 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
7591 # Symbols that must always be exported.
7592 include_expsyms=""
7594 # ### END LIBTOOL TAG CONFIG: CXX