3
# libtoolT - Provide generalized library-building support services.
4
# Generated automatically by (GNU libXfont 1.3.0)
5
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8
# Free Software Foundation, Inc.
10
# This file is part of GNU Libtool:
11
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13
# This program is free software; you can redistribute it and/or modify
14
# it under the terms of the GNU General Public License as published by
15
# the Free Software Foundation; either version 2 of the License, or
16
# (at your option) any later version.
18
# This program is distributed in the hope that it will be useful, but
19
# WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
# General Public License for more details.
23
# You should have received a copy of the GNU General Public License
24
# along with this program; if not, write to the Free Software
25
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
# As a special exception to the GNU General Public License, if you
28
# distribute this file as part of a program that contains a
29
# configuration script generated by Autoconf, you may include it under
30
# the same distribution terms that you use for the rest of that program.
32
# A sed program that does not truncate output.
35
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
36
Xsed="/bin/sed -e 1s/^X//"
38
# The HP-UX ksh and POSIX shell print the target directory to stdout
40
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
42
# The names of the tagged configurations supported by this script.
45
# ### BEGIN LIBTOOL CONFIG
47
# Libtool was configured on host blackwold:
49
# Shell to use when invoking shell scripts.
52
# Whether or not to build shared libraries.
53
build_libtool_libs=yes
55
# Whether or not to build static libraries.
58
# Whether or not to add -lc for building shared libraries.
59
build_libtool_need_lc=no
61
# Whether or not to disallow shared libs when runtime libs are static
62
allow_libtool_libs_with_static_runtimes=no
64
# Whether or not to optimize for fast installation.
69
host=i686-pc-linux-gnu
74
build=i686-pc-linux-gnu
77
# An echo program that does not interpret backslashes.
87
# LTCC compiler flags.
90
# A language-specific compiler.
93
# Is the compiler the GNU C compiler?
99
# The linker used to build libraries.
102
# Whether we need hard or soft links.
105
# A BSD-compatible nm program.
108
# A symbol stripping program
111
# Used to examine libraries when file_magic_cmd begins "file"
114
# Used on cygwin: DLL creation program.
117
# Used on cygwin: object dumper.
120
# Used on cygwin: assembler.
123
# The name of the directory that contains temporary libtool files.
126
# How to create reloadable object files.
128
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
130
# How to pass a linker flag through the compiler.
133
# Object file suffix (normally "o").
136
# Old archive suffix (normally "a").
139
# Shared library suffix (normally ".so").
142
# Executable file suffix (normally "").
145
# Additional compiler flags for building library objects.
146
pic_flag=" -fPIC -DPIC"
149
# What is the maximum length of a command?
152
# Does compiler simultaneously support -c and -o options?
155
# Must we lock files when doing compilation?
158
# Do we need the lib prefix for modules?
161
# Do we need a version for libraries?
164
# Whether dlopen is supported.
165
dlopen_support=unknown
167
# Whether dlopen of programs is supported.
170
# Whether dlopen of statically linked programs is supported.
171
dlopen_self_static=unknown
173
# Compiler flag to prevent dynamic linking.
174
link_static_flag="-static"
176
# Compiler flag to turn off builtin functions.
177
no_builtin_flag=" -fno-builtin"
179
# Compiler flag to allow reflexive dlopens.
180
export_dynamic_flag_spec="\${wl}--export-dynamic"
182
# Compiler flag to generate shared objects directly from archives.
183
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
185
# Compiler flag to generate thread-safe objects.
186
thread_safe_flag_spec=""
188
# Library versioning type.
191
# Format of library name prefix.
192
libname_spec="lib\$name"
194
# List of archive names. First name is the real one, the rest are links.
195
# The last name is the one that the linker finds with -lNAME.
196
library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
198
# The coded name of the library, if different from the real name.
199
soname_spec="\${libname}\${release}\${shared_ext}\$major"
201
# Commands used to build and install an old-style archive.
203
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
204
old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205
old_postuninstall_cmds=""
207
# Create an old-style archive from a shared archive.
208
old_archive_from_new_cmds=""
210
# Create a temporary old-style archive to link instead of a shared archive.
211
old_archive_from_expsyms_cmds=""
213
# Commands used to build and install a shared archive.
214
archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
215
archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
216
cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
217
\$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
218
\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
220
postuninstall_cmds=""
222
# Commands used to build a loadable module (assumed same as above if empty)
224
module_expsym_cmds=""
226
# Commands to strip libraries.
227
old_striplib="strip --strip-debug"
228
striplib="strip --strip-unneeded"
230
# Dependencies to place before the objects being linked to create a
234
# Dependencies to place after the objects being linked to create a
238
# Dependencies to place before the objects being linked to create a
242
# Dependencies to place after the objects being linked to create a
246
# The library search path used internally by the compiler when linking
248
compiler_lib_search_path=""
250
# Method to check whether dependent libraries are shared objects.
251
deplibs_check_method="pass_all"
253
# Command to use when deplibs_check_method == file_magic.
254
file_magic_cmd="\$MAGIC_CMD"
256
# Flag that allows shared libraries with undefined symbols to be built.
257
allow_undefined_flag=""
259
# Flag that forces no undefined symbols.
262
# Commands used to finish a libtool library installation in a directory.
263
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
265
# Same as above, but a single script fragment to be evaled but not shown.
268
# Take the output of nm and produce a listing of raw symbols and C names.
269
global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
271
# Transform the output of nm in a proper C declaration
272
global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
274
# Transform the output of nm in a C name address pair
275
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
277
# This is the shared library runtime path variable.
278
runpath_var=LD_RUN_PATH
280
# This is the shared library path variable.
281
shlibpath_var=LD_LIBRARY_PATH
283
# Is shlibpath searched before the hard-coded library search path?
284
shlibpath_overrides_runpath=no
286
# How to hardcode a shared library path into an executable.
287
hardcode_action=immediate
289
# Whether we should hardcode library paths into libraries.
290
hardcode_into_libs=yes
292
# Flag to hardcode $libdir into a binary during linking.
293
# This must work even if $libdir does not exist.
294
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
296
# If ld is used when linking, flag to hardcode $libdir into
297
# a binary during linking. This must work even if $libdir does
299
hardcode_libdir_flag_spec_ld=""
301
# Whether we need a single -rpath flag with a separated argument.
302
hardcode_libdir_separator=""
304
# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
308
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
312
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
313
# the resulting binary.
314
hardcode_shlibpath_var=unsupported
316
# Set to yes if building a shared library automatically hardcodes DIR into the library
317
# and all subsequent libraries and executables linked against it.
318
hardcode_automatic=no
320
# Variables whose values should be saved in libtool wrapper scripts and
321
# restored at relink time.
322
variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
324
# Whether libtool must link a program against all its dependency libraries.
327
# Compile-time system search path for libraries
328
sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../ /lib/i486-linux-gnu/4.1.2/ /lib/ /usr/lib/i486-linux-gnu/4.1.2/ /usr/lib/"
330
# Run-time system search path for libraries
331
sys_lib_dlsearch_path_spec="/lib /usr/lib "
333
# Fix the shell variable $srcfile for the compiler.
336
# Set to yes if exported symbols are required.
337
always_export_symbols=no
339
# The commands to list exported symbols.
340
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
342
# The commands to extract the exported symbol list from a shared archive.
343
extract_expsyms_cmds=""
345
# Symbols that should not be listed in the preloaded symbols.
346
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
348
# Symbols that must always be exported.
351
# ### END LIBTOOL CONFIG
353
# ltmain.sh - Provide generalized library-building support services.
354
# NOTE: Changing this file will not affect anything until you rerun configure.
356
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
357
# Free Software Foundation, Inc.
358
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
360
# This program is free software; you can redistribute it and/or modify
361
# it under the terms of the GNU General Public License as published by
362
# the Free Software Foundation; either version 2 of the License, or
363
# (at your option) any later version.
365
# This program is distributed in the hope that it will be useful, but
366
# WITHOUT ANY WARRANTY; without even the implied warranty of
367
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
368
# General Public License for more details.
370
# You should have received a copy of the GNU General Public License
371
# along with this program; if not, write to the Free Software
372
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
374
# As a special exception to the GNU General Public License, if you
375
# distribute this file as part of a program that contains a
376
# configuration script generated by Autoconf, you may include it under
377
# the same distribution terms that you use for the rest of that program.
381
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
382
# is ksh but when the shell is invoked as "sh" and the current value of
383
# the _XPG environment variable is not equal to 1 (one), the special
384
# positional parameter $0, within a function call, is the name of the
388
# The name of this program:
389
progname=`echo "$progpath" | $SED $basename`
398
VERSION="1.5.22 Debian 1.5.22-4"
399
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
401
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
402
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
405
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
406
# is contrary to our usage. Disable this feature.
407
alias -g '${1+"$@"}'='"$@"'
410
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
413
# Check that we have a working $echo.
414
if test "X$1" = X--no-reexec; then
415
# Discard the --no-reexec flag, and continue.
417
elif test "X$1" = X--fallback-echo; then
418
# Avoid inline document here, it may be left over
420
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
421
# Yippee, $echo works!
424
# Restart under the correct shell, and then maybe $echo will work.
425
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
428
if test "X$1" = X--fallback-echo; then
429
# used as fallback echo
438
help="Try \`$progname --help' for more information."
439
magic="%%%MAGIC variable%%%"
444
# Sed substitution that helps us do robust quoting. It backslashifies
445
# metacharacters that are still active within double-quoted strings.
446
Xsed="${SED}"' -e 1s/^X//'
447
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
448
# test EBCDIC or ASCII
449
case `echo X|tr X '\101'` in
450
A) # ASCII based system
451
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
453
NL2SP='tr \015\012 \040\040'
455
*) # EBCDIC based system
457
NL2SP='tr \r\n \100\100'
462
# Only set LANG and LC_ALL to C if already set.
463
# These must not be set unconditionally because not all systems understand
464
# e.g. LANG=C (notably SCO).
465
# We save the old values to restore during execute mode.
466
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
468
eval "if test \"\${$lt_var+set}\" = set; then
469
save_$lt_var=\$$lt_var
475
# Make sure IFS has a sensible default
480
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
481
$echo "$modename: not configured to build any kind of library" 1>&2
482
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
497
lo2o="s/\\.lo\$/.${objext}/"
498
o2lo="s/\\.${objext}\$/.lo/"
502
#####################################
503
# Shell function definitions:
504
# This seems to be the best place for them
506
# func_mktempdir [string]
507
# Make a temporary directory that won't clash with other running
508
# libtool processes, and avoids race conditions if possible. If
509
# given, STRING is the basename for that directory.
512
my_template="${TMPDIR-/tmp}/${1-$progname}"
514
if test "$run" = ":"; then
515
# Return a directory name, but don't create it in dry-run mode
516
my_tmpdir="${my_template}-$$"
519
# If mktemp works, use that first and foremost
520
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
522
if test ! -d "$my_tmpdir"; then
523
# Failing that, at least try and use $RANDOM to avoid a race
524
my_tmpdir="${my_template}-${RANDOM-0}$$"
526
save_mktempdir_umask=`umask`
529
umask $save_mktempdir_umask
532
# If we're not in dry-run mode, bomb out on failure
533
test -d "$my_tmpdir" || {
534
$echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
539
$echo "X$my_tmpdir" | $Xsed
543
# func_win32_libid arg
544
# return the library type of file 'arg'
546
# Need a lot of goo to handle *both* DLLs and import libs
547
# Has to be a shell function in order to 'eat' the argument
548
# that is supplied when $file_magic_command is called.
551
win32_libid_type="unknown"
552
win32_fileres=`file -L $1 2>/dev/null`
553
case $win32_fileres in
554
*ar\ archive\ import\ library*) # definitely import
555
win32_libid_type="x86 archive import"
557
*ar\ archive*) # could be an import, or static
558
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
559
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
560
win32_nmres=`eval $NM -f posix -A $1 | \
561
$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
563
import*) win32_libid_type="x86 archive import";;
564
*) win32_libid_type="x86 archive static";;
569
win32_libid_type="x86 DLL"
571
*executable*) # but shell scripts are "executable" too...
572
case $win32_fileres in
573
*MS\ Windows\ PE\ Intel*)
574
win32_libid_type="x86 DLL"
579
$echo $win32_libid_type
584
# Infer tagged configuration to use if any are available and
585
# if one wasn't chosen via the "--tag" command line option.
586
# Only attempt this if the compiler in the base compile
587
# command doesn't match the default compiler.
588
# arg is usually of the form 'gcc ...'
591
if test -n "$available_tags" && test -z "$tagname"; then
595
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
599
CC_quoted="$CC_quoted $arg"
602
# Blanks in the command may have been stripped by the calling shell,
603
# but not from the CC environment variable when configure was run.
604
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
605
# Blanks at the start of $base_compile will cause this to fail
606
# if we don't check for them as well.
608
for z in $available_tags; do
609
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
610
# Evaluate the configuration.
611
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
614
# Double-quote args containing other shell metacharacters.
616
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
620
CC_quoted="$CC_quoted $arg"
623
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
624
# The compiler in the base compile command matches
625
# the one in the tagged configuration.
626
# Assume this is the tagged configuration we want.
633
# If $tagname still isn't set, then no tagged configuration
634
# was found and let the user know that the "--tag" command
635
# line option must be used.
636
if test -z "$tagname"; then
637
$echo "$modename: unable to infer tagged configuration"
638
$echo "$modename: specify a tag with \`--tag'" 1>&2
641
# $echo "$modename: using $tagname tagged configuration"
649
# func_extract_an_archive dir oldlib
650
func_extract_an_archive ()
652
f_ex_an_ar_dir="$1"; shift
653
f_ex_an_ar_oldlib="$1"
655
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
656
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
657
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
660
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
665
# func_extract_archives gentop oldlib ...
666
func_extract_archives ()
668
my_gentop="$1"; shift
676
$show "${rm}r $my_gentop"
677
$run ${rm}r "$my_gentop"
678
$show "$mkdir $my_gentop"
679
$run $mkdir "$my_gentop"
681
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
685
for my_xlib in $my_oldlibs; do
686
# Extract the objects.
688
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
689
*) my_xabs=`pwd`"/$my_xlib" ;;
691
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
694
case " $extracted_archives " in
696
extracted_serial=`expr $extracted_serial + 1`
697
my_xlib_u=lt$extracted_serial-$my_xlib ;;
701
extracted_archives="$extracted_archives $my_xlib_u"
702
my_xdir="$my_gentop/$my_xlib_u"
704
$show "${rm}r $my_xdir"
705
$run ${rm}r "$my_xdir"
706
$show "$mkdir $my_xdir"
707
$run $mkdir "$my_xdir"
709
if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
714
$show "Extracting $my_xabs"
715
# Do not bother doing anything if just a dry run
716
if test -z "$run"; then
717
darwin_orig_dir=`pwd`
718
cd $my_xdir || exit $?
719
darwin_archive=$my_xabs
721
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
722
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
723
if test -n "$darwin_arches"; then
724
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
726
$show "$darwin_base_archive has multiple architectures $darwin_arches"
727
for darwin_arch in $darwin_arches ; do
728
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
729
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
730
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
731
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
733
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
734
done # $darwin_arches
735
## Okay now we have a bunch of thin objects, gotta fatten them up :)
736
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
739
for darwin_file in $darwin_filelist; do
740
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
741
lipo -create -output "$darwin_file" $darwin_files
742
done # $darwin_filelist
744
cd "$darwin_orig_dir"
746
cd "$darwin_orig_dir"
747
func_extract_an_archive "$my_xdir" "$my_xabs"
752
func_extract_an_archive "$my_xdir" "$my_xabs"
755
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
757
func_extract_archives_result="$my_oldobjs"
759
# End of Shell function definitions
760
#####################################
763
eval std_shrext=\"$shrext_cmds\"
767
# Parse our command line options once, thoroughly.
768
while test "$#" -gt 0
774
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
778
# If the previous option needs an argument, assign it.
779
if test -n "$prev"; then
782
execute_dlfiles="$execute_dlfiles $arg"
786
preserve_args="${preserve_args}=$arg"
788
# Check whether tagname contains only valid characters
791
$echo "$progname: invalid tag name: $tagname" 1>&2
798
# Don't test for the "default" C tag, as we know, it's there, but
799
# not specially marked.
802
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
803
taglist="$taglist $tagname"
804
# Evaluate the configuration.
805
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
807
$echo "$progname: ignoring unknown tag $tagname" 1>&2
822
# Have we seen a non-optional argument yet?
829
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
831
$echo "Copyright (C) 2005 Free Software Foundation, Inc."
832
$echo "This is free software; see the source for copying conditions. There is NO"
833
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
838
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
839
# Now print the configurations for the tags.
840
for tagname in $taglist; do
841
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
847
$echo "$progname: enabling shell trace mode"
849
preserve_args="$preserve_args $arg"
858
if test "$build_libtool_libs" = yes; then
859
$echo "enable shared libraries"
861
$echo "disable shared libraries"
863
if test "$build_old_libs" = yes; then
864
$echo "enable static libraries"
866
$echo "disable static libraries"
871
--finish) mode="finish" ;;
873
--mode) prevopt="--mode" prev=mode ;;
874
--mode=*) mode="$optarg" ;;
876
--preserve-dup-deps) duplicate_deps="yes" ;;
880
preserve_args="$preserve_args $arg"
886
preserve_args="$preserve_args --tag"
889
set tag "$optarg" ${1+"$@"}
892
preserve_args="$preserve_args --tag"
901
$echo "$modename: unrecognized option \`$arg'" 1>&2
913
if test -n "$prevopt"; then
914
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
919
case $disable_libs in
923
build_libtool_libs=no
927
build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
931
# If this variable is set in any of the actions, the command in it
932
# will be execed at the end. This prevents here-documents from being
933
# left over by shells.
936
if test -z "$show_help"; then
938
# Infer the operation mode.
939
if test -z "$mode"; then
940
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
941
$echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
943
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
955
*db | *dbx | *strace | *truss)
965
# If we have no mode, but dlfiles were specified, then do execute mode.
966
test -n "$execute_dlfiles" && mode=execute
968
# Just use the default operation mode.
969
if test -z "$mode"; then
970
if test -n "$nonopt"; then
971
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
973
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
980
# Only execute mode is allowed to have -dlopen flags.
981
if test -n "$execute_dlfiles" && test "$mode" != execute; then
982
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
987
# Change the help message to a mode-specific one.
989
help="Try \`$modename --help --mode=$mode' for more information."
991
# These modes are in order of execution frequency so that they run quickly.
993
# libtool compile mode
995
modename="$modename: compile"
996
# Get the compilation command and the source file.
998
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1009
# do not "continue". Instead, add this to base_compile
1021
# Accept any command-line options.
1024
if test -n "$libobj" ; then
1025
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
1032
-static | -prefer-pic | -prefer-non-pic)
1043
arg_mode=arg # the next one goes into the "base_compile" arg list
1044
continue # The current "srcfile" will either be retained or
1045
;; # replaced later. I would guess that would be a bug.
1048
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1050
save_ifs="$IFS"; IFS=','
1051
for arg in $args; do
1054
# Double-quote args containing other shell metacharacters.
1055
# Many Bourne shells cannot handle close brackets correctly
1056
# in scan sets, so we specify it separately.
1058
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1062
lastarg="$lastarg $arg"
1065
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1067
# Add the arguments to base_compile.
1068
base_compile="$base_compile $lastarg"
1073
# Accept the current argument as the source file.
1074
# The previous "srcfile" becomes the current argument.
1081
esac # case $arg_mode
1083
# Aesthetically quote the previous argument.
1084
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1087
# Double-quote args containing other shell metacharacters.
1088
# Many Bourne shells cannot handle close brackets correctly
1089
# in scan sets, and some SunOS ksh mistreat backslash-escaping
1090
# in scan sets (worked around with variable expansion),
1091
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
1092
# at all, so we specify them separately.
1093
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1094
lastarg="\"$lastarg\""
1098
base_compile="$base_compile $lastarg"
1103
$echo "$modename: you must specify an argument for -Xcompile"
1107
$echo "$modename: you must specify a target with \`-o'" 1>&2
1111
# Get the name of the library object.
1112
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1116
# Recognize several different file suffixes.
1117
# If the user specifies -o file.o, it is replaced with file.lo
1127
*.class) xform=class ;;
1132
*.java) xform=java ;;
1136
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1139
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1141
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1146
func_infer_tag $base_compile
1148
for arg in $later; do
1167
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1169
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1170
qlibobj="\"$qlibobj\"" ;;
1172
test "X$libobj" != "X$qlibobj" \
1173
&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1174
&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1175
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1176
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1177
if test "X$xdir" = "X$obj"; then
1182
lobj=${xdir}$objdir/$objname
1184
if test -z "$base_compile"; then
1185
$echo "$modename: you must specify a compilation command" 1>&2
1190
# Delete any leftover library objects.
1191
if test "$build_old_libs" = yes; then
1192
removelist="$obj $lobj $libobj ${libobj}T"
1194
removelist="$lobj $libobj ${libobj}T"
1197
$run $rm $removelist
1198
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1200
# On Cygwin there's no "real" PIC flag so we must build both object types
1202
cygwin* | mingw* | pw32* | os2*)
1206
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1207
# non-PIC code in shared libraries is not supported
1211
# Calculate the filename of the output object if compiler does
1212
# not support -o with -c
1213
if test "$compiler_c_o" = no; then
1214
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1215
lockfile="$output_obj.lock"
1216
removelist="$removelist $output_obj $lockfile"
1217
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1224
# Lock this critical section if it is needed
1225
# We use this script file to make the link, it avoids creating a new file
1226
if test "$need_locks" = yes; then
1227
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1228
$show "Waiting for $lockfile to be removed"
1231
elif test "$need_locks" = warn; then
1232
if test -f "$lockfile"; then
1234
*** ERROR, $lockfile exists and contains:
1235
`cat $lockfile 2>/dev/null`
1237
This indicates that another process is trying to use the same
1238
temporary object file, and libtool could not work around it because
1239
your compiler does not support \`-c' and \`-o' together. If you
1240
repeat this compilation, it may succeed, by chance, but you had better
1241
avoid parallel builds (make -j) in this platform, or get a better
1244
$run $rm $removelist
1247
$echo "$srcfile" > "$lockfile"
1250
if test -n "$fix_srcfile_path"; then
1251
eval srcfile=\"$fix_srcfile_path\"
1253
qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1255
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1256
qsrcfile="\"$qsrcfile\"" ;;
1259
$run $rm "$libobj" "${libobj}T"
1261
# Create a libtool object file (analogous to a ".la" file),
1262
# but don't create it if we're doing a dry run.
1263
test -z "$run" && cat > ${libobj}T <<EOF
1264
# $libobj - a libtool object file
1265
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1267
# Please DO NOT delete this file!
1268
# It is necessary for linking the library.
1270
# Name of the PIC object.
1273
# Only build a PIC object if we are building libtool libraries.
1274
if test "$build_libtool_libs" = yes; then
1275
# Without this assignment, base_compile gets emptied.
1276
fbsd_hideous_sh_bug=$base_compile
1278
if test "$pic_mode" != no; then
1279
command="$base_compile $qsrcfile $pic_flag"
1281
# Don't build PIC code
1282
command="$base_compile $qsrcfile"
1285
if test ! -d "${xdir}$objdir"; then
1286
$show "$mkdir ${xdir}$objdir"
1287
$run $mkdir ${xdir}$objdir
1289
if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1294
if test -z "$output_obj"; then
1295
# Place PIC objects in $objdir
1296
command="$command -o $lobj"
1299
$run $rm "$lobj" "$output_obj"
1302
if $run eval "$command"; then :
1304
test -n "$output_obj" && $run $rm $removelist
1308
if test "$need_locks" = warn &&
1309
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1311
*** ERROR, $lockfile contains:
1312
`cat $lockfile 2>/dev/null`
1314
but it should contain:
1317
This indicates that another process is trying to use the same
1318
temporary object file, and libtool could not work around it because
1319
your compiler does not support \`-c' and \`-o' together. If you
1320
repeat this compilation, it may succeed, by chance, but you had better
1321
avoid parallel builds (make -j) in this platform, or get a better
1324
$run $rm $removelist
1328
# Just move the object if needed, then go on to compile the next one
1329
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1330
$show "$mv $output_obj $lobj"
1331
if $run $mv $output_obj $lobj; then :
1334
$run $rm $removelist
1339
# Append the name of the PIC object to the libtool object file.
1340
test -z "$run" && cat >> ${libobj}T <<EOF
1341
pic_object='$objdir/$objname'
1345
# Allow error messages only from the first compilation.
1346
if test "$suppress_opt" = yes; then
1347
suppress_output=' >/dev/null 2>&1'
1350
# No PIC object so indicate it doesn't exist in the libtool
1352
test -z "$run" && cat >> ${libobj}T <<EOF
1358
# Only build a position-dependent object if we build old libraries.
1359
if test "$build_old_libs" = yes; then
1360
if test "$pic_mode" != yes; then
1361
# Don't build PIC code
1362
command="$base_compile $qsrcfile"
1364
command="$base_compile $qsrcfile $pic_flag"
1366
if test "$compiler_c_o" = yes; then
1367
command="$command -o $obj"
1370
# Suppress compiler output if we already did a PIC compilation.
1371
command="$command$suppress_output"
1372
$run $rm "$obj" "$output_obj"
1374
if $run eval "$command"; then :
1376
$run $rm $removelist
1380
if test "$need_locks" = warn &&
1381
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1383
*** ERROR, $lockfile contains:
1384
`cat $lockfile 2>/dev/null`
1386
but it should contain:
1389
This indicates that another process is trying to use the same
1390
temporary object file, and libtool could not work around it because
1391
your compiler does not support \`-c' and \`-o' together. If you
1392
repeat this compilation, it may succeed, by chance, but you had better
1393
avoid parallel builds (make -j) in this platform, or get a better
1396
$run $rm $removelist
1400
# Just move the object if needed
1401
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1402
$show "$mv $output_obj $obj"
1403
if $run $mv $output_obj $obj; then :
1406
$run $rm $removelist
1411
# Append the name of the non-PIC object the libtool object file.
1412
# Only append if the libtool object file exists.
1413
test -z "$run" && cat >> ${libobj}T <<EOF
1414
# Name of the non-PIC object.
1415
non_pic_object='$objname'
1419
# Append the name of the non-PIC object the libtool object file.
1420
# Only append if the libtool object file exists.
1421
test -z "$run" && cat >> ${libobj}T <<EOF
1422
# Name of the non-PIC object.
1428
$run $mv "${libobj}T" "${libobj}"
1430
# Unlock the critical section if it was locked
1431
if test "$need_locks" != no; then
1432
$run $rm "$lockfile"
1440
modename="$modename: link"
1442
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1443
# It is impossible to link a dll without this setting, and
1444
# we shouldn't force the makefile maintainer to figure out
1445
# which system we are compiling for in order to pass an extra
1446
# flag for every libtool invocation.
1447
# allow_undefined=no
1449
# FIXME: Unfortunately, there are problems with the above when trying
1450
# to make a dll which has undefined symbols, in which case not
1451
# even a static library is built. For now, we need to specify
1452
# -no-undefined on the libtool link line when we can be certain
1453
# that all symbols are satisfied, otherwise we get a static library.
1460
libtool_args="$nonopt"
1461
base_compile="$nonopt $@"
1462
compile_command="$nonopt"
1463
finalize_command="$nonopt"
1476
lib_search_path=`pwd`
1485
export_symbols_regex=
1493
notinst_path= # paths that contain not-installed libtool libraries
1494
precious_files_regex=
1495
prefer_static_libs=no
1508
func_infer_tag $base_compile
1510
# We need to know -static, to get the right output filenames.
1514
-all-static | -static | -static-libtool-libs)
1517
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1518
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1520
if test -n "$link_static_flag"; then
1521
dlopen_self=$dlopen_self_static
1523
prefer_static_libs=yes
1526
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1527
dlopen_self=$dlopen_self_static
1529
prefer_static_libs=built
1531
-static-libtool-libs)
1532
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1533
dlopen_self=$dlopen_self_static
1535
prefer_static_libs=yes
1538
build_libtool_libs=no
1545
# See if our shared archives depend on static archives.
1546
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1548
# Go through the arguments, transforming them on the way.
1549
while test "$#" -gt 0; do
1553
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1554
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1558
libtool_args="$libtool_args $qarg"
1560
# If the previous option needs an argument, assign it.
1561
if test -n "$prev"; then
1564
compile_command="$compile_command @OUTPUT@"
1565
finalize_command="$finalize_command @OUTPUT@"
1571
if test "$preload" = no; then
1572
# Add the symbol object into the linking commands.
1573
compile_command="$compile_command @SYMFILE@"
1574
finalize_command="$finalize_command @SYMFILE@"
1578
*.la | *.lo) ;; # We handle these cases below.
1580
if test "$dlself" = no; then
1588
if test "$prev" = dlprefiles; then
1590
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1600
if test "$prev" = dlfiles; then
1601
dlfiles="$dlfiles $arg"
1603
dlprefiles="$dlprefiles $arg"
1611
export_symbols="$arg"
1612
if test ! -f "$arg"; then
1613
$echo "$modename: symbol file \`$arg' does not exist"
1620
export_symbols_regex="$arg"
1625
inst_prefix_dir="$arg"
1630
precious_files_regex="$arg"
1640
if test -f "$arg"; then
1643
for fil in `cat $save_arg`
1645
# moreargs="$moreargs $fil"
1647
# A libtool-controlled object.
1649
# Check to see that this really is a libtool object.
1650
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1655
# If there is no directory component, then add one.
1657
*/* | *\\*) . $arg ;;
1661
if test -z "$pic_object" || \
1662
test -z "$non_pic_object" ||
1663
test "$pic_object" = none && \
1664
test "$non_pic_object" = none; then
1665
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1669
# Extract subdirectory from the argument.
1670
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1671
if test "X$xdir" = "X$arg"; then
1677
if test "$pic_object" != none; then
1678
# Prepend the subdirectory the object is found in.
1679
pic_object="$xdir$pic_object"
1681
if test "$prev" = dlfiles; then
1682
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1683
dlfiles="$dlfiles $pic_object"
1687
# If libtool objects are unsupported, then we need to preload.
1692
# CHECK ME: I think I busted this. -Ossama
1693
if test "$prev" = dlprefiles; then
1694
# Preload the old-style object.
1695
dlprefiles="$dlprefiles $pic_object"
1700
libobjs="$libobjs $pic_object"
1705
if test "$non_pic_object" != none; then
1706
# Prepend the subdirectory the object is found in.
1707
non_pic_object="$xdir$non_pic_object"
1709
# A standard non-PIC object
1710
non_pic_objects="$non_pic_objects $non_pic_object"
1711
if test -z "$pic_object" || test "$pic_object" = none ; then
1712
arg="$non_pic_object"
1715
# If the PIC object exists, use it instead.
1716
# $xdir was prepended to $pic_object above.
1717
non_pic_object="$pic_object"
1718
non_pic_objects="$non_pic_objects $non_pic_object"
1721
# Only an error if not doing a dry-run.
1722
if test -z "$run"; then
1723
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1728
# Extract subdirectory from the argument.
1729
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1730
if test "X$xdir" = "X$arg"; then
1736
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1737
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1738
libobjs="$libobjs $pic_object"
1739
non_pic_objects="$non_pic_objects $non_pic_object"
1744
$echo "$modename: link input file \`$save_arg' does not exist"
1752
# We need an absolute path.
1754
[\\/]* | [A-Za-z]:[\\/]*) ;;
1756
$echo "$modename: only absolute run-paths are allowed" 1>&2
1760
if test "$prev" = rpath; then
1763
*) rpath="$rpath $arg" ;;
1768
*) xrpath="$xrpath $arg" ;;
1775
compiler_flags="$compiler_flags $qarg"
1777
compile_command="$compile_command $qarg"
1778
finalize_command="$finalize_command $qarg"
1782
linker_flags="$linker_flags $qarg"
1783
compiler_flags="$compiler_flags $wl$qarg"
1785
compile_command="$compile_command $wl$qarg"
1786
finalize_command="$finalize_command $wl$qarg"
1790
linker_flags="$linker_flags $qarg"
1791
compiler_flags="$compiler_flags $qarg"
1793
compile_command="$compile_command $qarg"
1794
finalize_command="$finalize_command $qarg"
1802
darwin_framework|darwin_framework_skip)
1803
test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1804
compile_command="$compile_command $arg"
1805
finalize_command="$finalize_command $arg"
1810
eval "$prev=\"\$arg\""
1815
fi # test -n "$prev"
1821
if test -n "$link_static_flag"; then
1822
compile_command="$compile_command $link_static_flag"
1823
finalize_command="$finalize_command $link_static_flag"
1829
# FIXME: remove this flag sometime in the future.
1830
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1854
-export-symbols | -export-symbols-regex)
1855
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1856
$echo "$modename: more than one -exported-symbols argument is not allowed"
1859
if test "X$arg" = "X-export-symbols"; then
1867
-framework|-arch|-isysroot)
1869
*" ${arg} ${1} "* | *" ${arg} ${1} "*)
1870
prev=darwin_framework_skip ;;
1871
*) compiler_flags="$compiler_flags $arg"
1872
prev=darwin_framework ;;
1874
compile_command="$compile_command $arg"
1875
finalize_command="$finalize_command $arg"
1884
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1885
# so, if we see these flags be careful not to treat them like -L
1887
case $with_gcc/$host in
1888
no/*-*-irix* | /*-*-irix*)
1889
compile_command="$compile_command $arg"
1890
finalize_command="$finalize_command $arg"
1897
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1898
# We need an absolute path.
1900
[\\/]* | [A-Za-z]:[\\/]*) ;;
1902
absdir=`cd "$dir" && pwd`
1903
if test -z "$absdir"; then
1904
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1906
notinst_path="$notinst_path $dir"
1914
deplibs="$deplibs -L$dir"
1915
lib_search_path="$lib_search_path $dir"
1919
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1920
testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1921
case :$dllsearchpath: in
1923
*) dllsearchpath="$dllsearchpath:$dir";;
1925
case :$dllsearchpath: in
1926
*":$testbindir:"*) ;;
1927
*) dllsearchpath="$dllsearchpath:$testbindir";;
1935
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1937
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1938
# These systems don't actually have a C or math library (as such)
1942
# These systems don't actually have a C library (as such)
1943
test "X$arg" = "X-lc" && continue
1945
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1946
# Do not include libc due to us having libc/libc_r.
1947
test "X$arg" = "X-lc" && continue
1949
*-*-rhapsody* | *-*-darwin1.[012])
1950
# Rhapsody C and math libraries are in the System framework
1951
deplibs="$deplibs -framework System"
1954
*-*-sco3.2v5* | *-*-sco5v6*)
1955
# Causes problems with __ctype
1956
test "X$arg" = "X-lc" && continue
1958
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1959
# Compiler inserts libc in the correct place for threads to work
1960
test "X$arg" = "X-lc" && continue
1963
elif test "X$arg" = "X-lc_r"; then
1965
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1966
# Do not include libc_r directly, use -pthread flag.
1971
deplibs="$deplibs $arg"
1975
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1976
# classes, name mangling, and exception handling.
1978
compile_command="$compile_command $arg"
1979
compiler_flags="$compiler_flags $arg"
1980
finalize_command="$finalize_command $arg"
1985
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1986
compiler_flags="$compiler_flags $arg"
1987
compile_command="$compile_command $arg"
1988
finalize_command="$finalize_command $arg"
1997
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1998
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1999
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2000
# +DA*, +DD* enable 64-bit mode on the HP compiler
2001
# -q* pass through compiler args for the IBM compiler
2002
# -m* pass through architecture-specific compiler args for GCC
2003
# -m*, -t[45]*, -txscale* pass through architecture-specific
2004
# compiler args for GCC
2005
# -pg pass through profiling flag for GCC
2006
# @file GCC response files
2007
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
2008
-t[45]*|-txscale*|@*)
2010
# Unknown arguments in both finalize_command and compile_command need
2011
# to be aesthetically quoted because they are evaled later.
2012
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2014
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2018
compile_command="$compile_command $arg"
2019
finalize_command="$finalize_command $arg"
2020
compiler_flags="$compiler_flags $arg"
2036
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
2037
# The PATH hackery in wrapper scripts is required on Windows
2038
# in order for the loader to find any dlls it needs.
2039
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2040
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2043
*) no_install=yes ;;
2060
-precious-files-regex)
2081
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2082
# We need an absolute path.
2084
[\\/]* | [A-Za-z]:[\\/]*) ;;
2086
$echo "$modename: only absolute run-paths are allowed" 1>&2
2092
*) xrpath="$xrpath $dir" ;;
2097
-static | -static-libtool-libs)
2098
# The effects of -static are defined in a previous loop.
2099
# We used to do the same as -all-static on platforms that
2100
# didn't have a PIC flag, but the assumption that the effects
2101
# would be equivalent was wrong. It would break on at least
2102
# Digital Unix and AIX.
2122
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2124
save_ifs="$IFS"; IFS=','
2125
for flag in $args; do
2128
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2133
compiler_flags="$compiler_flags $flag"
2136
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2140
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2142
save_ifs="$IFS"; IFS=','
2143
for flag in $args; do
2146
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2151
compiler_flags="$compiler_flags $wl$flag"
2152
linker_flags="$linker_flags $flag"
2155
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2173
# Some other compiler flag.
2175
# Unknown arguments in both finalize_command and compile_command need
2176
# to be aesthetically quoted because they are evaled later.
2177
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2179
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2186
# A standard object.
2191
# A libtool-controlled object.
2193
# Check to see that this really is a libtool object.
2194
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2199
# If there is no directory component, then add one.
2201
*/* | *\\*) . $arg ;;
2205
if test -z "$pic_object" || \
2206
test -z "$non_pic_object" ||
2207
test "$pic_object" = none && \
2208
test "$non_pic_object" = none; then
2209
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
2213
# Extract subdirectory from the argument.
2214
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2215
if test "X$xdir" = "X$arg"; then
2221
if test "$pic_object" != none; then
2222
# Prepend the subdirectory the object is found in.
2223
pic_object="$xdir$pic_object"
2225
if test "$prev" = dlfiles; then
2226
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2227
dlfiles="$dlfiles $pic_object"
2231
# If libtool objects are unsupported, then we need to preload.
2236
# CHECK ME: I think I busted this. -Ossama
2237
if test "$prev" = dlprefiles; then
2238
# Preload the old-style object.
2239
dlprefiles="$dlprefiles $pic_object"
2244
libobjs="$libobjs $pic_object"
2249
if test "$non_pic_object" != none; then
2250
# Prepend the subdirectory the object is found in.
2251
non_pic_object="$xdir$non_pic_object"
2253
# A standard non-PIC object
2254
non_pic_objects="$non_pic_objects $non_pic_object"
2255
if test -z "$pic_object" || test "$pic_object" = none ; then
2256
arg="$non_pic_object"
2259
# If the PIC object exists, use it instead.
2260
# $xdir was prepended to $pic_object above.
2261
non_pic_object="$pic_object"
2262
non_pic_objects="$non_pic_objects $non_pic_object"
2265
# Only an error if not doing a dry-run.
2266
if test -z "$run"; then
2267
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2272
# Extract subdirectory from the argument.
2273
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2274
if test "X$xdir" = "X$arg"; then
2280
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2281
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2282
libobjs="$libobjs $pic_object"
2283
non_pic_objects="$non_pic_objects $non_pic_object"
2290
deplibs="$deplibs $arg"
2291
old_deplibs="$old_deplibs $arg"
2296
# A libtool-controlled library.
2298
if test "$prev" = dlfiles; then
2299
# This library was specified with -dlopen.
2300
dlfiles="$dlfiles $arg"
2302
elif test "$prev" = dlprefiles; then
2303
# The library was specified with -dlpreopen.
2304
dlprefiles="$dlprefiles $arg"
2307
deplibs="$deplibs $arg"
2312
# Some other compiler argument.
2314
# Unknown arguments in both finalize_command and compile_command need
2315
# to be aesthetically quoted because they are evaled later.
2316
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2318
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2325
# Now actually substitute the argument into the commands.
2326
if test -n "$arg"; then
2327
compile_command="$compile_command $arg"
2328
finalize_command="$finalize_command $arg"
2330
done # argument parsing loop
2332
if test -n "$prev"; then
2333
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2338
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2339
eval arg=\"$export_dynamic_flag_spec\"
2340
compile_command="$compile_command $arg"
2341
finalize_command="$finalize_command $arg"
2345
# calculate the name of the file, without its directory
2346
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2347
libobjs_save="$libobjs"
2349
if test -n "$shlibpath_var"; then
2350
# get the directories listed in $shlibpath_var
2351
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2355
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2356
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2358
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2359
if test "X$output_objdir" = "X$output"; then
2360
output_objdir="$objdir"
2362
output_objdir="$output_objdir/$objdir"
2364
# Create the object directory.
2365
if test ! -d "$output_objdir"; then
2366
$show "$mkdir $output_objdir"
2367
$run $mkdir $output_objdir
2369
if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2374
# Determine the type of output
2377
$echo "$modename: you must specify an output file" 1>&2
2381
*.$libext) linkmode=oldlib ;;
2382
*.lo | *.$objext) linkmode=obj ;;
2383
*.la) linkmode=lib ;;
2384
*) linkmode=prog ;; # Anything else should be a program.
2388
*cygwin* | *mingw* | *pw32*)
2389
# don't eliminate duplications in $postdeps and $predeps
2390
duplicate_compiler_generated_deps=yes
2393
duplicate_compiler_generated_deps=$duplicate_deps
2399
# Find all interdependent deplibs by searching for libraries
2400
# that are linked more than once (e.g. -la -lb -la)
2401
for deplib in $deplibs; do
2402
if test "X$duplicate_deps" = "Xyes" ; then
2404
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2407
libs="$libs $deplib"
2410
if test "$linkmode" = lib; then
2411
libs="$predeps $libs $compiler_lib_search_path $postdeps"
2413
# Compute libraries that are listed more than once in $predeps
2414
# $postdeps and mark them as special (i.e., whose duplicates are
2415
# not to be eliminated).
2417
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2418
for pre_post_dep in $predeps $postdeps; do
2419
case "$pre_post_deps " in
2420
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2422
pre_post_deps="$pre_post_deps $pre_post_dep"
2431
need_relink=no # whether we're linking any uninstalled libtool libraries
2432
notinst_deplibs= # not-installed libtool libraries
2436
for file in $dlfiles $dlprefiles; do
2440
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2452
passes="conv scan dlopen dlpreopen link"
2457
for pass in $passes; do
2458
if test "$linkmode,$pass" = "lib,link" ||
2459
test "$linkmode,$pass" = "prog,scan"; then
2463
if test "$linkmode" = prog; then
2465
dlopen) libs="$dlfiles" ;;
2466
dlpreopen) libs="$dlprefiles" ;;
2468
libs="$deplibs %DEPLIBS%"
2469
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2473
if test "$pass" = dlopen; then
2474
# Collect dlpreopened libraries
2475
save_deplibs="$deplibs"
2478
for deplib in $libs; do
2482
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2483
if test "$linkmode,$pass" = "prog,link"; then
2484
compile_deplibs="$deplib $compile_deplibs"
2485
finalize_deplibs="$deplib $finalize_deplibs"
2487
compiler_flags="$compiler_flags $deplib"
2492
if test "$linkmode" != lib && test "$linkmode" != prog; then
2493
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2496
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2497
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2498
for search_ext in .la $std_shrext .so .a; do
2499
# Search the libtool library
2500
lib="$searchdir/lib${name}${search_ext}"
2501
if test -f "$lib"; then
2502
if test "$search_ext" = ".la"; then
2511
if test "$found" != yes; then
2512
# deplib doesn't seem to be a libtool library
2513
if test "$linkmode,$pass" = "prog,link"; then
2514
compile_deplibs="$deplib $compile_deplibs"
2515
finalize_deplibs="$deplib $finalize_deplibs"
2517
deplibs="$deplib $deplibs"
2518
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2521
else # deplib is a libtool library
2522
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2523
# We need to do some special things here, and not later.
2524
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2525
case " $predeps $postdeps " in
2527
if (${SED} -e '2q' $lib |
2528
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2532
*/* | *\\*) . $lib ;;
2535
for l in $old_library $library_names; do
2538
if test "X$ll" = "X$old_library" ; then # only static version available
2540
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2541
test "X$ladir" = "X$lib" && ladir="."
2542
lib=$ladir/$old_library
2543
if test "$linkmode,$pass" = "prog,link"; then
2544
compile_deplibs="$deplib $compile_deplibs"
2545
finalize_deplibs="$deplib $finalize_deplibs"
2547
deplibs="$deplib $deplibs"
2548
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2562
deplibs="$deplib $deplibs"
2563
test "$pass" = conv && continue
2564
newdependency_libs="$deplib $newdependency_libs"
2565
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2568
if test "$pass" = conv; then
2569
deplibs="$deplib $deplibs"
2572
if test "$pass" = scan; then
2573
deplibs="$deplib $deplibs"
2575
compile_deplibs="$deplib $compile_deplibs"
2576
finalize_deplibs="$deplib $finalize_deplibs"
2578
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2581
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2587
if test "$pass" = link; then
2588
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2589
# Make sure the xrpath contains only unique directories.
2592
*) xrpath="$xrpath $dir" ;;
2595
deplibs="$deplib $deplibs"
2598
*.la) lib="$deplib" ;;
2600
if test "$pass" = conv; then
2601
deplibs="$deplib $deplibs"
2607
case $deplibs_check_method in
2609
set dummy $deplibs_check_method
2610
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2611
if eval $echo \"$deplib\" 2>/dev/null \
2613
| $EGREP "$match_pattern_regex" > /dev/null; then
2621
if test "$valid_a_lib" != yes; then
2623
$echo "*** Warning: Trying to link with static lib archive $deplib."
2624
$echo "*** I have the capability to make that library automatically link in when"
2625
$echo "*** you link to this library. But I can only do this if you have a"
2626
$echo "*** shared version of the library, which you do not appear to have"
2627
$echo "*** because the file extensions .$libext of this argument makes me believe"
2628
$echo "*** that it is just a static archive that I should not used here."
2631
$echo "*** Warning: Linking the shared library $output against the"
2632
$echo "*** static library $deplib is not portable!"
2633
deplibs="$deplib $deplibs"
2638
if test "$pass" != link; then
2639
deplibs="$deplib $deplibs"
2641
compile_deplibs="$deplib $compile_deplibs"
2642
finalize_deplibs="$deplib $finalize_deplibs"
2649
if test "$pass" = conv; then
2650
deplibs="$deplib $deplibs"
2651
elif test "$linkmode" = prog; then
2652
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2653
# If there is no dlopen support or we're linking statically,
2654
# we need to preload.
2655
newdlprefiles="$newdlprefiles $deplib"
2656
compile_deplibs="$deplib $compile_deplibs"
2657
finalize_deplibs="$deplib $finalize_deplibs"
2659
newdlfiles="$newdlfiles $deplib"
2669
if test "$found" = yes || test -f "$lib"; then :
2671
$echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2675
# Check to see that this really is a libtool archive.
2676
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2678
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2682
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2683
test "X$ladir" = "X$lib" && ladir="."
2691
# If the library was installed with an old release of libtool,
2692
# it will not redefine variables installed, or shouldnotlink
2700
*/* | *\\*) . $lib ;;
2704
if test "$linkmode,$pass" = "lib,link" ||
2705
test "$linkmode,$pass" = "prog,scan" ||
2706
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
2707
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2708
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2711
if test "$pass" = conv; then
2712
# Only check for convenience libraries
2713
deplibs="$lib $deplibs"
2714
if test -z "$libdir"; then
2715
if test -z "$old_library"; then
2716
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2719
# It is a libtool convenience library, so add in its objects.
2720
convenience="$convenience $ladir/$objdir/$old_library"
2721
old_convenience="$old_convenience $ladir/$objdir/$old_library"
2723
for deplib in $dependency_libs; do
2724
deplibs="$deplib $deplibs"
2725
if test "X$duplicate_deps" = "Xyes" ; then
2726
case "$tmp_libs " in
2727
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2730
tmp_libs="$tmp_libs $deplib"
2732
elif test "$linkmode" != prog && test "$linkmode" != lib; then
2733
$echo "$modename: \`$lib' is not a convenience library" 1>&2
2740
# Get the name of the library we link against.
2742
for l in $old_library $library_names; do
2745
if test -z "$linklib"; then
2746
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2750
# This library was specified with -dlopen.
2751
if test "$pass" = dlopen; then
2752
if test -z "$libdir"; then
2753
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2756
if test -z "$dlname" ||
2757
test "$dlopen_support" != yes ||
2758
test "$build_libtool_libs" = no; then
2759
# If there is no dlname, no dlopen support or we're linking
2760
# statically, we need to preload. We also need to preload any
2761
# dependent libraries so libltdl's deplib preloader doesn't
2762
# bomb out in the load deplibs phase.
2763
dlprefiles="$dlprefiles $lib $dependency_libs"
2765
newdlfiles="$newdlfiles $lib"
2770
# We need an absolute path.
2772
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2774
abs_ladir=`cd "$ladir" && pwd`
2775
if test -z "$abs_ladir"; then
2776
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2777
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2782
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2784
# Find the relevant object directory and library name.
2785
if test "X$installed" = Xyes; then
2786
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2787
$echo "$modename: warning: library \`$lib' was moved." 1>&2
2795
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2797
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2800
# Remove this search path later
2801
notinst_path="$notinst_path $abs_ladir"
2803
dir="$ladir/$objdir"
2804
absdir="$abs_ladir/$objdir"
2805
# Remove this search path later
2806
notinst_path="$notinst_path $abs_ladir"
2808
fi # $installed = yes
2809
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2811
# This library was specified with -dlpreopen.
2812
if test "$pass" = dlpreopen; then
2813
if test -z "$libdir"; then
2814
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2817
# Prefer using a static library (so that no silly _DYNAMIC symbols
2818
# are required to link).
2819
if test -n "$old_library"; then
2820
newdlprefiles="$newdlprefiles $dir/$old_library"
2821
# Otherwise, use the dlname, so that lt_dlopen finds it.
2822
elif test -n "$dlname"; then
2823
newdlprefiles="$newdlprefiles $dir/$dlname"
2825
newdlprefiles="$newdlprefiles $dir/$linklib"
2827
fi # $pass = dlpreopen
2829
if test -z "$libdir"; then
2830
# Link the convenience library
2831
if test "$linkmode" = lib; then
2832
deplibs="$dir/$old_library $deplibs"
2833
elif test "$linkmode,$pass" = "prog,link"; then
2834
compile_deplibs="$dir/$old_library $compile_deplibs"
2835
finalize_deplibs="$dir/$old_library $finalize_deplibs"
2837
deplibs="$lib $deplibs" # used for prog,scan pass
2843
if test "$linkmode" = prog && test "$pass" != link; then
2844
newlib_search_path="$newlib_search_path $ladir"
2845
deplibs="$lib $deplibs"
2848
if test "$link_all_deplibs" != no || test -z "$library_names" ||
2849
test "$build_libtool_libs" = no; then
2854
for deplib in $dependency_libs; do
2856
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2858
# Need to link against all dependency_libs?
2859
if test "$linkalldeplibs" = yes; then
2860
deplibs="$deplib $deplibs"
2862
# Need to hardcode shared library paths
2863
# or/and link against static libraries
2864
newdependency_libs="$deplib $newdependency_libs"
2866
if test "X$duplicate_deps" = "Xyes" ; then
2867
case "$tmp_libs " in
2868
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2871
tmp_libs="$tmp_libs $deplib"
2874
fi # $linkmode = prog...
2876
if test "$linkmode,$pass" = "prog,link"; then
2877
if test -n "$library_names" &&
2878
{ { test "$prefer_static_libs" = no ||
2879
test "$prefer_static_libs,$installed" = "built,yes"; } ||
2880
test -z "$old_library"; }; then
2881
# We need to hardcode the library path
2882
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2883
# Make sure the rpath contains only unique directories.
2884
case "$temp_rpath " in
2887
*) temp_rpath="$temp_rpath $absdir" ;;
2891
# Hardcode the library path.
2892
# Skip directories that are in the system default run-time
2894
case " $sys_lib_dlsearch_path " in
2897
case "$compile_rpath " in
2899
*) compile_rpath="$compile_rpath $absdir"
2903
case " $sys_lib_dlsearch_path " in
2906
case "$finalize_rpath " in
2908
*) finalize_rpath="$finalize_rpath $libdir"
2912
fi # $linkmode,$pass = prog,link...
2914
if test "$alldeplibs" = yes &&
2915
{ test "$deplibs_check_method" = pass_all ||
2916
{ test "$build_libtool_libs" = yes &&
2917
test -n "$library_names"; }; }; then
2918
# We only need to search for static libraries
2923
link_static=no # Whether the deplib will be linked statically
2924
use_static_libs=$prefer_static_libs
2925
if test "$use_static_libs" = built && test "$installed" = yes ; then
2928
if test -n "$library_names" &&
2929
{ test "$use_static_libs" = no || test -z "$old_library"; }; then
2930
if test "$installed" = no; then
2931
notinst_deplibs="$notinst_deplibs $lib"
2934
# This is a shared library
2936
# Warn about portability, can't link against -module's on
2937
# some systems (darwin)
2938
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2940
if test "$linkmode" = prog; then
2941
$echo "*** Warning: Linking the executable $output against the loadable module"
2943
$echo "*** Warning: Linking the shared library $output against the loadable module"
2945
$echo "*** $linklib is not portable!"
2947
if test "$linkmode" = lib &&
2948
test "$hardcode_into_libs" = yes; then
2949
# Hardcode the library path.
2950
# Skip directories that are in the system default run-time
2952
case " $sys_lib_dlsearch_path " in
2955
case "$compile_rpath " in
2957
*) compile_rpath="$compile_rpath $absdir"
2961
case " $sys_lib_dlsearch_path " in
2964
case "$finalize_rpath " in
2966
*) finalize_rpath="$finalize_rpath $libdir"
2972
if test -n "$old_archive_from_expsyms_cmds"; then
2973
# figure out the soname
2974
set dummy $library_names
2977
libname=`eval \\$echo \"$libname_spec\"`
2978
# use dlname if we got it. it's perfectly good, no?
2979
if test -n "$dlname"; then
2981
elif test -n "$soname_spec"; then
2985
major=`expr $current - $age`
2989
eval soname=\"$soname_spec\"
2994
# Make a new name for the extract_expsyms_cmds to use
2996
soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2997
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2999
# If the library has no export list, then create one now
3000
if test -f "$output_objdir/$soname-def"; then :
3002
$show "extracting exported symbol list from \`$soname'"
3003
save_ifs="$IFS"; IFS='~'
3004
cmds=$extract_expsyms_cmds
3005
for cmd in $cmds; do
3009
$run eval "$cmd" || exit $?
3015
if test -f "$output_objdir/$newlib"; then :; else
3016
$show "generating import library for \`$soname'"
3017
save_ifs="$IFS"; IFS='~'
3018
cmds=$old_archive_from_expsyms_cmds
3019
for cmd in $cmds; do
3023
$run eval "$cmd" || exit $?
3027
# make sure the library variables are pointing to the new library
3030
fi # test -n "$old_archive_from_expsyms_cmds"
3032
if test "$linkmode" = prog || test "$mode" != relink; then
3037
case $hardcode_action in
3038
immediate | unsupported)
3039
if test "$hardcode_direct" = no; then
3042
*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3043
*-*-sysv4*uw2*) add_dir="-L$dir" ;;
3044
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3045
*-*-unixware7*) add_dir="-L$dir" ;;
3047
# if the lib is a module then we can not link against
3048
# it, someone is ignoring the new warnings I added
3049
if /usr/bin/file -L $add 2> /dev/null |
3050
$EGREP ": [^:]* bundle" >/dev/null ; then
3051
$echo "** Warning, lib $linklib is a module, not a shared library"
3052
if test -z "$old_library" ; then
3054
$echo "** And there doesn't seem to be a static archive available"
3055
$echo "** The link will probably fail, sorry"
3057
add="$dir/$old_library"
3061
elif test "$hardcode_minus_L" = no; then
3063
*-*-sunos*) add_shlibpath="$dir" ;;
3067
elif test "$hardcode_shlibpath_var" = no; then
3068
add_shlibpath="$dir"
3075
if test "$hardcode_direct" = yes; then
3077
elif test "$hardcode_minus_L" = yes; then
3079
# Try looking first in the location we're being installed to.
3080
if test -n "$inst_prefix_dir"; then
3083
add_dir="$add_dir -L$inst_prefix_dir$libdir"
3088
elif test "$hardcode_shlibpath_var" = yes; then
3089
add_shlibpath="$dir"
3098
if test "$lib_linked" != yes; then
3099
$echo "$modename: configuration error: unsupported hardcode properties"
3103
if test -n "$add_shlibpath"; then
3104
case :$compile_shlibpath: in
3105
*":$add_shlibpath:"*) ;;
3106
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3109
if test "$linkmode" = prog; then
3110
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3111
test -n "$add" && compile_deplibs="$add $compile_deplibs"
3113
test -n "$add_dir" && deplibs="$add_dir $deplibs"
3114
test -n "$add" && deplibs="$add $deplibs"
3115
if test "$hardcode_direct" != yes && \
3116
test "$hardcode_minus_L" != yes && \
3117
test "$hardcode_shlibpath_var" = yes; then
3118
case :$finalize_shlibpath: in
3120
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3126
if test "$linkmode" = prog || test "$mode" = relink; then
3130
# Finalize command for both is simple: just hardcode it.
3131
if test "$hardcode_direct" = yes; then
3132
add="$libdir/$linklib"
3133
elif test "$hardcode_minus_L" = yes; then
3136
elif test "$hardcode_shlibpath_var" = yes; then
3137
case :$finalize_shlibpath: in
3139
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3142
elif test "$hardcode_automatic" = yes; then
3143
if test -n "$inst_prefix_dir" &&
3144
test -f "$inst_prefix_dir$libdir/$linklib" ; then
3145
add="$inst_prefix_dir$libdir/$linklib"
3147
add="$libdir/$linklib"
3150
# We cannot seem to hardcode it, guess we'll fake it.
3152
# Try looking first in the location we're being installed to.
3153
if test -n "$inst_prefix_dir"; then
3156
add_dir="$add_dir -L$inst_prefix_dir$libdir"
3163
if test "$linkmode" = prog; then
3164
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3165
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3167
test -n "$add_dir" && deplibs="$add_dir $deplibs"
3168
test -n "$add" && deplibs="$add $deplibs"
3171
elif test "$linkmode" = prog; then
3172
# Here we assume that one of hardcode_direct or hardcode_minus_L
3173
# is not unsupported. This is valid on all known static and
3175
if test "$hardcode_direct" != unsupported; then
3176
test -n "$old_library" && linklib="$old_library"
3177
compile_deplibs="$dir/$linklib $compile_deplibs"
3178
finalize_deplibs="$dir/$linklib $finalize_deplibs"
3180
compile_deplibs="-l$name -L$dir $compile_deplibs"
3181
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3183
elif test "$build_libtool_libs" = yes; then
3184
# Not a shared library
3185
if test "$deplibs_check_method" != pass_all; then
3186
# We're trying link a shared library against a static one
3187
# but the system doesn't support it.
3189
# Just print a warning and add the library to dependency_libs so
3190
# that the program can be linked against the static library.
3192
$echo "*** Warning: This system can not link to static lib archive $lib."
3193
$echo "*** I have the capability to make that library automatically link in when"
3194
$echo "*** you link to this library. But I can only do this if you have a"
3195
$echo "*** shared version of the library, which you do not appear to have."
3196
if test "$module" = yes; then
3197
$echo "*** But as you try to build a module library, libtool will still create "
3198
$echo "*** a static module, that should work as long as the dlopening application"
3199
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3200
if test -z "$global_symbol_pipe"; then
3202
$echo "*** However, this would only work if libtool was able to extract symbol"
3203
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3204
$echo "*** not find such a program. So, this module is probably useless."
3205
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
3207
if test "$build_old_libs" = no; then
3208
build_libtool_libs=module
3211
build_libtool_libs=no
3215
deplibs="$dir/$old_library $deplibs"
3218
fi # link shared/static library?
3220
if test "$linkmode" = lib; then
3221
if test -n "$dependency_libs" &&
3222
{ test "$hardcode_into_libs" != yes ||
3223
test "$build_old_libs" = yes ||
3224
test "$link_static" = yes; }; then
3225
# Extract -R from dependency_libs
3227
for libdir in $dependency_libs; do
3229
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3231
*" $temp_xrpath "*) ;;
3232
*) xrpath="$xrpath $temp_xrpath";;
3234
*) temp_deplibs="$temp_deplibs $libdir";;
3237
dependency_libs="$temp_deplibs"
3240
newlib_search_path="$newlib_search_path $absdir"
3241
# Link against this library
3242
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3243
# ... and its dependency_libs
3245
for deplib in $dependency_libs; do
3246
newdependency_libs="$deplib $newdependency_libs"
3247
if test "X$duplicate_deps" = "Xyes" ; then
3248
case "$tmp_libs " in
3249
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3252
tmp_libs="$tmp_libs $deplib"
3255
if test "$link_all_deplibs" != no; then
3256
# Add the search paths of all dependency libraries
3257
for deplib in $dependency_libs; do
3259
-L*) path="$deplib" ;;
3261
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3262
test "X$dir" = "X$deplib" && dir="."
3263
# We need an absolute path.
3265
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3267
absdir=`cd "$dir" && pwd`
3268
if test -z "$absdir"; then
3269
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3274
if grep "^installed=no" $deplib > /dev/null; then
3275
path="$absdir/$objdir"
3277
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3278
if test -z "$libdir"; then
3279
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3282
if test "$absdir" != "$libdir"; then
3283
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3290
# we do not want to link against static libs,
3291
# but need to link against shared
3292
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3293
if test -n "$deplibrary_names" ; then
3294
for tmp in $deplibrary_names ; do
3297
if test -f "$path/$depdepl" ; then
3298
depdepl="$path/$depdepl"
3300
# do not add paths which are already there
3301
case " $newlib_search_path " in
3303
*) newlib_search_path="$newlib_search_path $path";;
3316
# Again, we only want to link against shared libraries
3317
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3318
for tmp in $newlib_search_path ; do
3319
if test -f "$tmp/lib$tmp_libs.dylib" ; then
3320
eval depdepl="$tmp/lib$tmp_libs.dylib"
3331
case " $deplibs " in
3333
*) deplibs="$path $deplibs" ;;
3335
case " $deplibs " in
3337
*) deplibs="$depdepl $deplibs" ;;
3340
fi # link_all_deplibs != no
3342
done # for deplib in $libs
3343
dependency_libs="$newdependency_libs"
3344
if test "$pass" = dlpreopen; then
3345
# Link the dlpreopened libraries before other libraries
3346
for deplib in $save_deplibs; do
3347
deplibs="$deplib $deplibs"
3350
if test "$pass" != dlopen; then
3351
if test "$pass" != conv; then
3352
# Make sure lib_search_path contains only unique directories.
3354
for dir in $newlib_search_path; do
3355
case "$lib_search_path " in
3357
*) lib_search_path="$lib_search_path $dir" ;;
3363
if test "$linkmode,$pass" != "prog,link"; then
3366
vars="compile_deplibs finalize_deplibs"
3368
for var in $vars dependency_libs; do
3369
# Add libraries to $var in reverse order
3370
eval tmp_libs=\"\$$var\"
3372
for deplib in $tmp_libs; do
3373
# FIXME: Pedantically, this is the right thing to do, so
3374
# that some nasty dependency loop isn't accidentally
3376
#new_libs="$deplib $new_libs"
3377
# Pragmatically, this seems to cause very few problems in
3380
-L*) new_libs="$deplib $new_libs" ;;
3383
# And here is the reason: when a library appears more
3384
# than once as an explicit dependence of a library, or
3385
# is implicitly linked in more than once by the
3386
# compiler, it is considered special, and multiple
3387
# occurrences thereof are not removed. Compare this
3388
# with having the same library being listed as a
3389
# dependency of multiple other libraries: in this case,
3390
# we know (pedantically, we assume) the library does not
3391
# need to be listed more than once, so we keep only the
3392
# last copy. This is not always right, but it is rare
3393
# enough that we require users that really mean to play
3394
# such unportable linking tricks to link the library
3395
# using -Wl,-lname, so that libtool does not consider it
3396
# for duplicate removal.
3397
case " $specialdeplibs " in
3398
*" $deplib "*) new_libs="$deplib $new_libs" ;;
3400
case " $new_libs " in
3402
*) new_libs="$deplib $new_libs" ;;
3410
for deplib in $new_libs; do
3413
case " $tmp_libs " in
3415
*) tmp_libs="$tmp_libs $deplib" ;;
3418
*) tmp_libs="$tmp_libs $deplib" ;;
3421
eval $var=\"$tmp_libs\"
3424
# Last step: remove runtime libs from dependency_libs
3425
# (they stay in deplibs)
3427
for i in $dependency_libs ; do
3428
case " $predeps $postdeps $compiler_lib_search_path " in
3433
if test -n "$i" ; then
3434
tmp_libs="$tmp_libs $i"
3437
dependency_libs=$tmp_libs
3439
if test "$linkmode" = prog; then
3440
dlfiles="$newdlfiles"
3441
dlprefiles="$newdlprefiles"
3446
if test -n "$deplibs"; then
3447
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3450
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3451
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3454
if test -n "$rpath"; then
3455
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3458
if test -n "$xrpath"; then
3459
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3462
if test -n "$vinfo"; then
3463
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3466
if test -n "$release"; then
3467
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3470
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3471
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3474
# Now set the variables for building old libraries.
3475
build_libtool_libs=no
3477
objs="$objs$old_deplibs"
3481
# Make sure we only generate libraries of the form `libNAME.la'.
3484
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3485
eval shared_ext=\"$shrext_cmds\"
3486
eval libname=\"$libname_spec\"
3489
if test "$module" = no; then
3490
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3494
if test "$need_lib_prefix" != no; then
3495
# Add the "lib" prefix for modules if required
3496
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3497
eval shared_ext=\"$shrext_cmds\"
3498
eval libname=\"$libname_spec\"
3500
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3505
if test -n "$objs"; then
3506
if test "$deplibs_check_method" != pass_all; then
3507
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3511
$echo "*** Warning: Linking the shared library $output against the non-libtool"
3512
$echo "*** objects $objs is not portable!"
3513
libobjs="$libobjs $objs"
3517
if test "$dlself" != no; then
3518
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3522
if test "$#" -gt 2; then
3523
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3528
if test -z "$rpath"; then
3529
if test "$build_libtool_libs" = yes; then
3530
# Building a libtool convenience library.
3531
# Some compilers have problems with a `.al' extension so
3532
# convenience libraries should have the same extension an
3533
# archive normally would.
3534
oldlibs="$output_objdir/$libname.$libext $oldlibs"
3535
build_libtool_libs=convenience
3539
if test -n "$vinfo"; then
3540
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3543
if test -n "$release"; then
3544
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3548
# Parse the version information argument.
3549
save_ifs="$IFS"; IFS=':'
3550
set dummy $vinfo 0 0 0
3553
if test -n "$8"; then
3554
$echo "$modename: too many parameters to \`-version-info'" 1>&2
3559
# convert absolute version numbers to libtool ages
3560
# this retains compatibility with .la files and attempts
3561
# to make the code below a bit more comprehensible
3563
case $vinfo_number in
3567
number_revision="$4"
3569
# There are really only two kinds -- those that
3570
# use the current revision as the major version
3571
# and those that subtract age and use age as
3572
# a minor version. But, then there is irix
3573
# which has an extra 1 added just for fun
3575
case $version_type in
3576
darwin|linux|osf|windows|none)
3577
current=`expr $number_major + $number_minor`
3579
revision="$number_revision"
3581
freebsd-aout|freebsd-elf|sunos)
3582
current="$number_major"
3583
revision="$number_minor"
3587
current=`expr $number_major + $number_minor - 1`
3589
revision="$number_minor"
3592
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3593
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3605
# Check that each of the things are valid numbers.
3607
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]) ;;
3609
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3610
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3616
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]) ;;
3618
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3619
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3625
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]) ;;
3627
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3628
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3633
if test "$age" -gt "$current"; then
3634
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3635
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3639
# Calculate the version variables.
3643
case $version_type in
3647
# Like Linux, but with the current version available in
3648
# verstring for coding it into the library header
3649
major=.`expr $current - $age`
3650
versuffix="$major.$age.$revision"
3651
# Darwin ld doesn't like 0 for these options...
3652
minor_current=`expr $current + 1`
3653
verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3658
versuffix=".$current.$revision";
3663
versuffix=".$current";
3667
major=`expr $current - $age + 1`
3669
case $version_type in
3670
nonstopux) verstring_prefix=nonstopux ;;
3671
*) verstring_prefix=sgi ;;
3673
verstring="$verstring_prefix$major.$revision"
3675
# Add in all the interfaces that we are compatible with.
3677
while test "$loop" -ne 0; do
3678
iface=`expr $revision - $loop`
3679
loop=`expr $loop - 1`
3680
verstring="$verstring_prefix$major.$iface:$verstring"
3683
# Before this point, $major must not contain `.'.
3685
versuffix="$major.$revision"
3689
major=.`expr $current - $age`
3690
versuffix="$major.$age.$revision"
3694
major=.`expr $current - $age`
3695
versuffix=".$current.$age.$revision"
3696
verstring="$current.$age.$revision"
3698
# Add in all the interfaces that we are compatible with.
3700
while test "$loop" -ne 0; do
3701
iface=`expr $current - $loop`
3702
loop=`expr $loop - 1`
3703
verstring="$verstring:${iface}.0"
3706
# Make executables depend on our current version.
3707
verstring="$verstring:${current}.0"
3712
versuffix=".$current.$revision"
3716
# Use '-' rather than '.', since we only want one
3717
# extension on DOS 8.3 filesystems.
3718
major=`expr $current - $age`
3723
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3724
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3729
# Clear the version info if we defaulted, and they specified a release.
3730
if test -z "$vinfo" && test -n "$release"; then
3732
case $version_type in
3734
# we can't check for "0.0" in archive_cmds due to quoting
3735
# problems, so we reset it completely
3742
if test "$need_version" = no; then
3749
# Remove version info from name if versioning should be avoided
3750
if test "$avoid_version" = yes && test "$need_version" = no; then
3756
# Check to see if the archive will have undefined symbols.
3757
if test "$allow_undefined" = yes; then
3758
if test "$allow_undefined_flag" = unsupported; then
3759
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3760
build_libtool_libs=no
3764
# Don't allow undefined symbols.
3765
allow_undefined_flag="$no_undefined_flag"
3769
if test "$mode" != relink; then
3770
# Remove our outputs, but don't remove object files since they
3771
# may have been created when compiling PIC objects.
3773
tempremovelist=`$echo "$output_objdir/*"`
3774
for p in $tempremovelist; do
3778
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3779
if test "X$precious_files_regex" != "X"; then
3780
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3785
removelist="$removelist $p"
3790
if test -n "$removelist"; then
3791
$show "${rm}r $removelist"
3792
$run ${rm}r $removelist
3796
# Now set the variables for building old libraries.
3797
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3798
oldlibs="$oldlibs $output_objdir/$libname.$libext"
3800
# Transform .lo files to .o files.
3801
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3804
# Eliminate all temporary directories.
3805
# for path in $notinst_path; do
3806
# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3807
# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3808
# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3811
if test -n "$xrpath"; then
3812
# If the user specified any rpath flags, then add them.
3814
for libdir in $xrpath; do
3815
temp_xrpath="$temp_xrpath -R$libdir"
3816
case "$finalize_rpath " in
3818
*) finalize_rpath="$finalize_rpath $libdir" ;;
3821
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3822
dependency_libs="$temp_xrpath $dependency_libs"
3826
# Make sure dlfiles contains only unique files that won't be dlpreopened
3827
old_dlfiles="$dlfiles"
3829
for lib in $old_dlfiles; do
3830
case " $dlprefiles $dlfiles " in
3832
*) dlfiles="$dlfiles $lib" ;;
3836
# Make sure dlprefiles contains only unique files
3837
old_dlprefiles="$dlprefiles"
3839
for lib in $old_dlprefiles; do
3840
case "$dlprefiles " in
3842
*) dlprefiles="$dlprefiles $lib" ;;
3846
if test "$build_libtool_libs" = yes; then
3847
if test -n "$rpath"; then
3849
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3850
# these systems don't actually have a c library (as such)!
3852
*-*-rhapsody* | *-*-darwin1.[012])
3853
# Rhapsody C library is in the System framework
3854
deplibs="$deplibs -framework System"
3857
# Don't link with libc until the a.out ld.so is fixed.
3859
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3860
# Do not include libc due to us having libc/libc_r.
3862
*-*-sco3.2v5* | *-*-sco5v6*)
3863
# Causes problems with __ctype
3865
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3866
# Compiler inserts libc in the correct place for threads to work
3869
# Add libc to deplibs on all other systems if necessary.
3870
if test "$build_libtool_need_lc" = "yes"; then
3871
deplibs="$deplibs -lc"
3877
# Transform deplibs into only deplibs that can be linked in shared.
3879
libname_save=$libname
3880
release_save=$release
3881
versuffix_save=$versuffix
3883
# I'm not sure if I'm treating the release correctly. I think
3884
# release should show up in the -l (ie -lgmp5) so we don't want to
3885
# add it in twice. Is that correct?
3891
case $deplibs_check_method in
3893
# Don't check for shared/static. Everything works.
3894
# This might be a little naive. We might want to check
3895
# whether the library exists or not. But this is on
3896
# osf3 & osf4 and I'm not really sure... Just
3897
# implementing what was already the behavior.
3901
# This code stresses the "libraries are programs" paradigm to its
3902
# limits. Maybe even breaks it. We compile a program, linking it
3903
# against the deplibs as a proxy for the library. Then we can check
3904
# whether they linked in statically or dynamically with ldd.
3906
cat > conftest.c <<EOF
3907
int main() { return 0; }
3910
if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3911
ldd_output=`ldd conftest`
3912
for i in $deplibs; do
3913
name=`expr $i : '-l\(.*\)'`
3914
# If $name is empty we are operating on a -L argument.
3915
if test "$name" != "" && test "$name" != "0"; then
3916
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3917
case " $predeps $postdeps " in
3919
newdeplibs="$newdeplibs $i"
3924
if test -n "$i" ; then
3925
libname=`eval \\$echo \"$libname_spec\"`
3926
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3927
set dummy $deplib_matches
3929
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3930
newdeplibs="$newdeplibs $i"
3934
$echo "*** Warning: dynamic linker does not accept needed library $i."
3935
$echo "*** I have the capability to make that library automatically link in when"
3936
$echo "*** you link to this library. But I can only do this if you have a"
3937
$echo "*** shared version of the library, which I believe you do not have"
3938
$echo "*** because a test_compile did reveal that the linker did not use it for"
3939
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3943
newdeplibs="$newdeplibs $i"
3947
# Error occurred in the first compile. Let's try to salvage
3948
# the situation: Compile a separate program for each library.
3949
for i in $deplibs; do
3950
name=`expr $i : '-l\(.*\)'`
3951
# If $name is empty we are operating on a -L argument.
3952
if test "$name" != "" && test "$name" != "0"; then
3954
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3955
ldd_output=`ldd conftest`
3956
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3957
case " $predeps $postdeps " in
3959
newdeplibs="$newdeplibs $i"
3964
if test -n "$i" ; then
3965
libname=`eval \\$echo \"$libname_spec\"`
3966
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3967
set dummy $deplib_matches
3969
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3970
newdeplibs="$newdeplibs $i"
3974
$echo "*** Warning: dynamic linker does not accept needed library $i."
3975
$echo "*** I have the capability to make that library automatically link in when"
3976
$echo "*** you link to this library. But I can only do this if you have a"
3977
$echo "*** shared version of the library, which you do not appear to have"
3978
$echo "*** because a test_compile did reveal that the linker did not use this one"
3979
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3985
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3986
$echo "*** make it link in! You will probably need to install it or some"
3987
$echo "*** library that it depends on before this library will be fully"
3988
$echo "*** functional. Installing it before continuing would be even better."
3991
newdeplibs="$newdeplibs $i"
3997
set dummy $deplibs_check_method
3998
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3999
for a_deplib in $deplibs; do
4000
name=`expr $a_deplib : '-l\(.*\)'`
4001
# If $name is empty we are operating on a -L argument.
4002
if test "$name" != "" && test "$name" != "0"; then
4003
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4004
case " $predeps $postdeps " in
4006
newdeplibs="$newdeplibs $a_deplib"
4011
if test -n "$a_deplib" ; then
4012
libname=`eval \\$echo \"$libname_spec\"`
4013
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4014
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4015
for potent_lib in $potential_libs; do
4016
# Follow soft links.
4017
if ls -lLd "$potent_lib" 2>/dev/null \
4018
| grep " -> " >/dev/null; then
4021
# The statement above tries to avoid entering an
4022
# endless loop below, in case of cyclic links.
4023
# We might still enter an endless loop, since a link
4024
# loop can be closed while we follow links,
4026
potlib="$potent_lib"
4027
while test -h "$potlib" 2>/dev/null; do
4028
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4030
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4031
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4034
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4036
| $EGREP "$file_magic_regex" > /dev/null; then
4037
newdeplibs="$newdeplibs $a_deplib"
4044
if test -n "$a_deplib" ; then
4047
$echo "*** Warning: linker path does not have real file for library $a_deplib."
4048
$echo "*** I have the capability to make that library automatically link in when"
4049
$echo "*** you link to this library. But I can only do this if you have a"
4050
$echo "*** shared version of the library, which you do not appear to have"
4051
$echo "*** because I did check the linker path looking for a file starting"
4052
if test -z "$potlib" ; then
4053
$echo "*** with $libname but no candidates were found. (...for file magic test)"
4055
$echo "*** with $libname and none of the candidates passed a file format test"
4056
$echo "*** using a file magic. Last file checked: $potlib"
4060
# Add a -L argument.
4061
newdeplibs="$newdeplibs $a_deplib"
4063
done # Gone through all deplibs.
4066
set dummy $deplibs_check_method
4067
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4068
for a_deplib in $deplibs; do
4069
name=`expr $a_deplib : '-l\(.*\)'`
4070
# If $name is empty we are operating on a -L argument.
4071
if test -n "$name" && test "$name" != "0"; then
4072
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4073
case " $predeps $postdeps " in
4075
newdeplibs="$newdeplibs $a_deplib"
4080
if test -n "$a_deplib" ; then
4081
libname=`eval \\$echo \"$libname_spec\"`
4082
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4083
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4084
for potent_lib in $potential_libs; do
4085
potlib="$potent_lib" # see symlink-check above in file_magic test
4086
if eval $echo \"$potent_lib\" 2>/dev/null \
4088
| $EGREP "$match_pattern_regex" > /dev/null; then
4089
newdeplibs="$newdeplibs $a_deplib"
4096
if test -n "$a_deplib" ; then
4099
$echo "*** Warning: linker path does not have real file for library $a_deplib."
4100
$echo "*** I have the capability to make that library automatically link in when"
4101
$echo "*** you link to this library. But I can only do this if you have a"
4102
$echo "*** shared version of the library, which you do not appear to have"
4103
$echo "*** because I did check the linker path looking for a file starting"
4104
if test -z "$potlib" ; then
4105
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4107
$echo "*** with $libname and none of the candidates passed a file format test"
4108
$echo "*** using a regex pattern. Last file checked: $potlib"
4112
# Add a -L argument.
4113
newdeplibs="$newdeplibs $a_deplib"
4115
done # Gone through all deplibs.
4119
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4120
-e 's/ -[LR][^ ]*//g'`
4121
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4122
for i in $predeps $postdeps ; do
4123
# can't use Xsed below, because $i might contain '/'
4124
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4127
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4128
| grep . >/dev/null; then
4130
if test "X$deplibs_check_method" = "Xnone"; then
4131
$echo "*** Warning: inter-library dependencies are not supported in this platform."
4133
$echo "*** Warning: inter-library dependencies are not known to be supported."
4135
$echo "*** All declared inter-library dependencies are being dropped."
4140
versuffix=$versuffix_save
4142
release=$release_save
4143
libname=$libname_save
4147
*-*-rhapsody* | *-*-darwin1.[012])
4148
# On Rhapsody replace the C library is the System framework
4149
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4153
if test "$droppeddeps" = yes; then
4154
if test "$module" = yes; then
4156
$echo "*** Warning: libtool could not satisfy all declared inter-library"
4157
$echo "*** dependencies of module $libname. Therefore, libtool will create"
4158
$echo "*** a static module, that should work as long as the dlopening"
4159
$echo "*** application is linked with the -dlopen flag."
4160
if test -z "$global_symbol_pipe"; then
4162
$echo "*** However, this would only work if libtool was able to extract symbol"
4163
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4164
$echo "*** not find such a program. So, this module is probably useless."
4165
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
4167
if test "$build_old_libs" = no; then
4168
oldlibs="$output_objdir/$libname.$libext"
4169
build_libtool_libs=module
4172
build_libtool_libs=no
4175
$echo "*** The inter-library dependencies that have been dropped here will be"
4176
$echo "*** automatically added whenever a program is linked with this library"
4177
$echo "*** or is declared to -dlopen it."
4179
if test "$allow_undefined" = no; then
4181
$echo "*** Since this library must not contain undefined symbols,"
4182
$echo "*** because either the platform does not support them or"
4183
$echo "*** it was explicitly requested with -no-undefined,"
4184
$echo "*** libtool will only create a static version of it."
4185
if test "$build_old_libs" = no; then
4186
oldlibs="$output_objdir/$libname.$libext"
4187
build_libtool_libs=module
4190
build_libtool_libs=no
4195
# Done checking deplibs!
4200
# move library search paths that coincide with paths to not yet
4201
# installed libraries to the beginning of the library search list
4203
for path in $notinst_path; do
4204
case " $new_libs " in
4205
*" -L$path/$objdir "*) ;;
4207
case " $deplibs " in
4208
*" -L$path/$objdir "*)
4209
new_libs="$new_libs -L$path/$objdir" ;;
4214
for deplib in $deplibs; do
4217
case " $new_libs " in
4219
*) new_libs="$new_libs $deplib" ;;
4222
*) new_libs="$new_libs $deplib" ;;
4228
# All the library-specific variables (install_libdir is set above).
4233
# Test again, we may have decided not to build it any more
4234
if test "$build_libtool_libs" = yes; then
4235
if test "$hardcode_into_libs" = yes; then
4236
# Hardcode the library paths
4239
rpath="$finalize_rpath"
4240
test "$mode" != relink && rpath="$compile_rpath$rpath"
4241
for libdir in $rpath; do
4242
if test -n "$hardcode_libdir_flag_spec"; then
4243
if test -n "$hardcode_libdir_separator"; then
4244
if test -z "$hardcode_libdirs"; then
4245
hardcode_libdirs="$libdir"
4247
# Just accumulate the unique libdirs.
4248
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4249
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4252
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4257
eval flag=\"$hardcode_libdir_flag_spec\"
4258
dep_rpath="$dep_rpath $flag"
4260
elif test -n "$runpath_var"; then
4261
case "$perm_rpath " in
4263
*) perm_rpath="$perm_rpath $libdir" ;;
4267
# Substitute the hardcoded libdirs into the rpath.
4268
if test -n "$hardcode_libdir_separator" &&
4269
test -n "$hardcode_libdirs"; then
4270
libdir="$hardcode_libdirs"
4271
if test -n "$hardcode_libdir_flag_spec_ld"; then
4272
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4274
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4277
if test -n "$runpath_var" && test -n "$perm_rpath"; then
4278
# We should set the runpath_var.
4280
for dir in $perm_rpath; do
4283
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4285
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4288
shlibpath="$finalize_shlibpath"
4289
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4290
if test -n "$shlibpath"; then
4291
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4294
# Get the real and link names of the library.
4295
eval shared_ext=\"$shrext_cmds\"
4296
eval library_names=\"$library_names_spec\"
4297
set dummy $library_names
4301
if test -n "$soname_spec"; then
4302
eval soname=\"$soname_spec\"
4306
if test -z "$dlname"; then
4310
lib="$output_objdir/$realname"
4314
linknames="$linknames $link"
4317
# Use standard objects if they are pic
4318
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4320
# Prepare the list of exported symbols
4321
if test -z "$export_symbols"; then
4322
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4323
$show "generating symbol list for \`$libname.la'"
4324
export_symbols="$output_objdir/$libname.exp"
4325
$run $rm $export_symbols
4326
cmds=$export_symbols_cmds
4327
save_ifs="$IFS"; IFS='~'
4328
for cmd in $cmds; do
4331
if len=`expr "X$cmd" : ".*"` &&
4332
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4334
$run eval "$cmd" || exit $?
4335
skipped_export=false
4337
# The command line is too long to execute in one step.
4338
$show "using reloadable object file for export list..."
4340
# Break out early, otherwise skipped_export may be
4341
# set to false by a later but shorter cmd.
4346
if test -n "$export_symbols_regex"; then
4347
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4348
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4349
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
4350
$run eval '$mv "${export_symbols}T" "$export_symbols"'
4355
if test -n "$export_symbols" && test -n "$include_expsyms"; then
4356
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4360
for test_deplib in $deplibs; do
4361
case " $convenience " in
4362
*" $test_deplib "*) ;;
4364
tmp_deplibs="$tmp_deplibs $test_deplib"
4368
deplibs="$tmp_deplibs"
4370
if test -n "$convenience"; then
4371
if test -n "$whole_archive_flag_spec"; then
4372
save_libobjs=$libobjs
4373
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4375
gentop="$output_objdir/${outputname}x"
4376
generated="$generated $gentop"
4378
func_extract_archives $gentop $convenience
4379
libobjs="$libobjs $func_extract_archives_result"
4383
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4384
eval flag=\"$thread_safe_flag_spec\"
4385
linker_flags="$linker_flags $flag"
4388
# Make a backup of the uninstalled library when relinking
4389
if test "$mode" = relink; then
4390
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4393
# Do each of the archive commands.
4394
if test "$module" = yes && test -n "$module_cmds" ; then
4395
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4396
eval test_cmds=\"$module_expsym_cmds\"
4397
cmds=$module_expsym_cmds
4399
eval test_cmds=\"$module_cmds\"
4403
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4404
eval test_cmds=\"$archive_expsym_cmds\"
4405
cmds=$archive_expsym_cmds
4407
eval test_cmds=\"$archive_cmds\"
4412
if test "X$skipped_export" != "X:" &&
4413
len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4414
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4417
# The command line is too long to link in one step, link piecewise.
4418
$echo "creating reloadable object files..."
4420
# Save the value of $output and $libobjs because we want to
4421
# use them later. If we have whole_archive_flag_spec, we
4422
# want to use save_libobjs as it was before
4423
# whole_archive_flag_spec was expanded, because we can't
4424
# assume the linker understands whole_archive_flag_spec.
4425
# This may have to be revisited, in case too many
4426
# convenience libraries get linked in and end up exceeding
4428
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4429
save_libobjs=$libobjs
4432
output_la=`$echo "X$output" | $Xsed -e "$basename"`
4434
# Clear the reloadable object creation command queue and
4435
# initialize k to one.
4442
output=$output_objdir/$output_la-${k}.$objext
4443
# Loop over the list of objects to be linked.
4444
for obj in $save_libobjs
4446
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4447
if test "X$objlist" = X ||
4448
{ len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4449
test "$len" -le "$max_cmd_len"; }; then
4450
objlist="$objlist $obj"
4452
# The command $test_cmds is almost too long, add a
4453
# command to the queue.
4454
if test "$k" -eq 1 ; then
4455
# The first file doesn't have a previous command to add.
4456
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4458
# All subsequent reloadable object files will link in
4459
# the last one created.
4460
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4462
last_robj=$output_objdir/$output_la-${k}.$objext
4464
output=$output_objdir/$output_la-${k}.$objext
4469
# Handle the remaining objects by creating one last
4470
# reloadable object file. All subsequent reloadable object
4471
# files will link in the last one created.
4472
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4473
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4475
if ${skipped_export-false}; then
4476
$show "generating symbol list for \`$libname.la'"
4477
export_symbols="$output_objdir/$libname.exp"
4478
$run $rm $export_symbols
4480
# Append the command to create the export file.
4481
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4484
# Set up a command to remove the reloadable object files
4485
# after they are used.
4487
while test "$i" -lt "$k"
4490
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4493
$echo "creating a temporary reloadable object file: $output"
4495
# Loop through the commands generated above and execute them.
4496
save_ifs="$IFS"; IFS='~'
4497
for cmd in $concat_cmds; do
4500
$run eval "$cmd" || exit $?
4505
# Restore the value of output.
4508
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4509
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4511
# Expand the library linking commands again to reset the
4512
# value of $libobjs for piecewise linking.
4514
# Do each of the archive commands.
4515
if test "$module" = yes && test -n "$module_cmds" ; then
4516
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4517
cmds=$module_expsym_cmds
4522
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4523
cmds=$archive_expsym_cmds
4529
# Append the command to remove the reloadable object files
4530
# to the just-reset $cmds.
4531
eval cmds=\"\$cmds~\$rm $delfiles\"
4533
save_ifs="$IFS"; IFS='~'
4534
for cmd in $cmds; do
4538
$run eval "$cmd" || {
4541
# Restore the uninstalled library and exit
4542
if test "$mode" = relink; then
4543
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4551
# Restore the uninstalled library and exit
4552
if test "$mode" = relink; then
4553
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4555
if test -n "$convenience"; then
4556
if test -z "$whole_archive_flag_spec"; then
4557
$show "${rm}r $gentop"
4558
$run ${rm}r "$gentop"
4565
# Create links to the real library.
4566
for linkname in $linknames; do
4567
if test "$realname" != "$linkname"; then
4568
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4569
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4573
# If -module or -export-dynamic was specified, set the dlname.
4574
if test "$module" = yes || test "$export_dynamic" = yes; then
4575
# On all known operating systems, these are identical.
4582
if test -n "$deplibs"; then
4583
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4586
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4587
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4590
if test -n "$rpath"; then
4591
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4594
if test -n "$xrpath"; then
4595
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4598
if test -n "$vinfo"; then
4599
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4602
if test -n "$release"; then
4603
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4608
if test -n "$objs$old_deplibs"; then
4609
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4613
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4621
# Delete the old objects.
4622
$run $rm $obj $libobj
4624
# Objects from convenience libraries. This assumes
4625
# single-version convenience libraries. Whenever we create
4626
# different ones for PIC/non-PIC, this we'll have to duplicate
4630
# reload_cmds runs $LD directly, so let us get rid of
4631
# -Wl from whole_archive_flag_spec and hope we can get by with
4632
# turning comma into space..
4635
if test -n "$convenience"; then
4636
if test -n "$whole_archive_flag_spec"; then
4637
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4638
reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4640
gentop="$output_objdir/${obj}x"
4641
generated="$generated $gentop"
4643
func_extract_archives $gentop $convenience
4644
reload_conv_objs="$reload_objs $func_extract_archives_result"
4648
# Create the old-style object.
4649
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
4653
save_ifs="$IFS"; IFS='~'
4654
for cmd in $cmds; do
4658
$run eval "$cmd" || exit $?
4662
# Exit if we aren't doing a library object file.
4663
if test -z "$libobj"; then
4664
if test -n "$gentop"; then
4665
$show "${rm}r $gentop"
4672
if test "$build_libtool_libs" != yes; then
4673
if test -n "$gentop"; then
4674
$show "${rm}r $gentop"
4678
# Create an invalid libtool object if no PIC, so that we don't
4679
# accidentally link it into a program.
4680
# $show "echo timestamp > $libobj"
4681
# $run eval "echo timestamp > $libobj" || exit $?
4685
if test -n "$pic_flag" || test "$pic_mode" != default; then
4686
# Only do commands if we really have different PIC objects.
4687
reload_objs="$libobjs $reload_conv_objs"
4690
save_ifs="$IFS"; IFS='~'
4691
for cmd in $cmds; do
4695
$run eval "$cmd" || exit $?
4700
if test -n "$gentop"; then
4701
$show "${rm}r $gentop"
4710
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4712
if test -n "$vinfo"; then
4713
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4716
if test -n "$release"; then
4717
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4720
if test "$preload" = yes; then
4721
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4722
test "$dlopen_self_static" = unknown; then
4723
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4728
*-*-rhapsody* | *-*-darwin1.[012])
4729
# On Rhapsody replace the C library is the System framework
4730
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4731
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4737
# Don't allow lazy linking, it breaks C++ global constructors
4738
if test "$tagname" = CXX ; then
4739
compile_command="$compile_command ${wl}-bind_at_load"
4740
finalize_command="$finalize_command ${wl}-bind_at_load"
4746
# move library search paths that coincide with paths to not yet
4747
# installed libraries to the beginning of the library search list
4749
for path in $notinst_path; do
4750
case " $new_libs " in
4751
*" -L$path/$objdir "*) ;;
4753
case " $compile_deplibs " in
4754
*" -L$path/$objdir "*)
4755
new_libs="$new_libs -L$path/$objdir" ;;
4760
for deplib in $compile_deplibs; do
4763
case " $new_libs " in
4765
*) new_libs="$new_libs $deplib" ;;
4768
*) new_libs="$new_libs $deplib" ;;
4771
compile_deplibs="$new_libs"
4774
compile_command="$compile_command $compile_deplibs"
4775
finalize_command="$finalize_command $finalize_deplibs"
4777
if test -n "$rpath$xrpath"; then
4778
# If the user specified any rpath flags, then add them.
4779
for libdir in $rpath $xrpath; do
4780
# This is the magic to use -rpath.
4781
case "$finalize_rpath " in
4783
*) finalize_rpath="$finalize_rpath $libdir" ;;
4788
# Now hardcode the library paths
4791
for libdir in $compile_rpath $finalize_rpath; do
4792
if test -n "$hardcode_libdir_flag_spec"; then
4793
if test -n "$hardcode_libdir_separator"; then
4794
if test -z "$hardcode_libdirs"; then
4795
hardcode_libdirs="$libdir"
4797
# Just accumulate the unique libdirs.
4798
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4799
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4802
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4807
eval flag=\"$hardcode_libdir_flag_spec\"
4808
rpath="$rpath $flag"
4810
elif test -n "$runpath_var"; then
4811
case "$perm_rpath " in
4813
*) perm_rpath="$perm_rpath $libdir" ;;
4817
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4818
testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4819
case :$dllsearchpath: in
4821
*) dllsearchpath="$dllsearchpath:$libdir";;
4823
case :$dllsearchpath: in
4824
*":$testbindir:"*) ;;
4825
*) dllsearchpath="$dllsearchpath:$testbindir";;
4830
# Substitute the hardcoded libdirs into the rpath.
4831
if test -n "$hardcode_libdir_separator" &&
4832
test -n "$hardcode_libdirs"; then
4833
libdir="$hardcode_libdirs"
4834
eval rpath=\" $hardcode_libdir_flag_spec\"
4836
compile_rpath="$rpath"
4840
for libdir in $finalize_rpath; do
4841
if test -n "$hardcode_libdir_flag_spec"; then
4842
if test -n "$hardcode_libdir_separator"; then
4843
if test -z "$hardcode_libdirs"; then
4844
hardcode_libdirs="$libdir"
4846
# Just accumulate the unique libdirs.
4847
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4848
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4851
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4856
eval flag=\"$hardcode_libdir_flag_spec\"
4857
rpath="$rpath $flag"
4859
elif test -n "$runpath_var"; then
4860
case "$finalize_perm_rpath " in
4862
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4866
# Substitute the hardcoded libdirs into the rpath.
4867
if test -n "$hardcode_libdir_separator" &&
4868
test -n "$hardcode_libdirs"; then
4869
libdir="$hardcode_libdirs"
4870
eval rpath=\" $hardcode_libdir_flag_spec\"
4872
finalize_rpath="$rpath"
4874
if test -n "$libobjs" && test "$build_old_libs" = yes; then
4875
# Transform all the library objects into standard objects.
4876
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4877
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4881
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4882
if test -n "$NM" && test -n "$global_symbol_pipe"; then
4883
dlsyms="${outputname}S.c"
4885
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4889
if test -n "$dlsyms"; then
4893
# Discover the nlist of each of the dlfiles.
4894
nlist="$output_objdir/${outputname}.nm"
4896
$show "$rm $nlist ${nlist}S ${nlist}T"
4897
$run $rm "$nlist" "${nlist}S" "${nlist}T"
4899
# Parse the name list into a source file.
4900
$show "creating $output_objdir/$dlsyms"
4902
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4903
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4904
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4910
/* Prevent the only kind of declaration conflicts we can make. */
4911
#define lt_preloaded_symbols some_other_symbol
4913
/* External symbol declarations for the compiler. */\
4916
if test "$dlself" = yes; then
4917
$show "generating symbol list for \`$output'"
4919
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4921
# Add our own program objects to the symbol list.
4922
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4923
for arg in $progfiles; do
4924
$show "extracting global C symbols from \`$arg'"
4925
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4928
if test -n "$exclude_expsyms"; then
4929
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4930
$run eval '$mv "$nlist"T "$nlist"'
4933
if test -n "$export_symbols_regex"; then
4934
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4935
$run eval '$mv "$nlist"T "$nlist"'
4938
# Prepare the list of exported symbols
4939
if test -z "$export_symbols"; then
4940
export_symbols="$output_objdir/$outputname.exp"
4941
$run $rm $export_symbols
4942
$run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4944
*cygwin* | *mingw* )
4945
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4946
$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4950
$run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4951
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4952
$run eval 'mv "$nlist"T "$nlist"'
4954
*cygwin* | *mingw* )
4955
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4956
$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4962
for arg in $dlprefiles; do
4963
$show "extracting global C symbols from \`$arg'"
4964
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4965
$run eval '$echo ": $name " >> "$nlist"'
4966
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4969
if test -z "$run"; then
4970
# Make sure we have at least an empty file.
4971
test -f "$nlist" || : > "$nlist"
4973
if test -n "$exclude_expsyms"; then
4974
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4975
$mv "$nlist"T "$nlist"
4978
# Try sorting and uniquifying the output.
4979
if grep -v "^: " < "$nlist" |
4980
if sort -k 3 </dev/null >/dev/null 2>&1; then
4985
uniq > "$nlist"S; then
4988
grep -v "^: " < "$nlist" > "$nlist"S
4991
if test -f "$nlist"S; then
4992
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4994
$echo '/* NONE */' >> "$output_objdir/$dlsyms"
4997
$echo >> "$output_objdir/$dlsyms" "\
4999
#undef lt_preloaded_symbols
5001
#if defined (__STDC__) && __STDC__
5002
# define lt_ptr void *
5004
# define lt_ptr char *
5008
/* The mapping between symbol names and symbols. */
5012
*cygwin* | *mingw* )
5013
$echo >> "$output_objdir/$dlsyms" "\
5014
/* DATA imports from DLLs on WIN32 can't be const, because
5015
runtime relocations are performed -- see ld's documentation
5021
$echo >> "$output_objdir/$dlsyms" "\
5028
$echo >> "$output_objdir/$dlsyms" "\
5032
lt_preloaded_symbols[] =
5036
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5038
$echo >> "$output_objdir/$dlsyms" "\
5042
/* This works around a problem in FreeBSD linker */
5043
#ifdef FREEBSD_WORKAROUND
5044
static const void *lt_preloaded_setup() {
5045
return lt_preloaded_symbols;
5055
pic_flag_for_symtable=
5057
# compiling the symbol table file with pic_flag works around
5058
# a FreeBSD bug that causes programs to crash when -lm is
5059
# linked before any other PIC object. But we must not use
5060
# pic_flag when linking with -static. The problem exists in
5061
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5062
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5063
case "$compile_command " in
5065
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5068
case "$compile_command " in
5070
*) pic_flag_for_symtable=" $pic_flag";;
5074
# Now compile the dynamic symbol file.
5075
$show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5076
$run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5078
# Clean up the generated files.
5079
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5080
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5082
# Transform the symbol file into the correct name.
5084
*cygwin* | *mingw* )
5085
if test -f "$output_objdir/${outputname}.def" ; then
5086
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5087
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5089
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5090
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5094
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5095
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5100
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5105
# We keep going just in case the user didn't refer to
5106
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5107
# really was required.
5109
# Nullify the symbol file.
5110
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5111
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5114
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5115
# Replace the output file specification.
5116
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
5117
link_command="$compile_command$compile_rpath"
5119
# We have no uninstalled library dependencies, so finalize right now.
5120
$show "$link_command"
5121
$run eval "$link_command"
5124
# Delete the generated files.
5125
if test -n "$dlsyms"; then
5126
$show "$rm $output_objdir/${outputname}S.${objext}"
5127
$run $rm "$output_objdir/${outputname}S.${objext}"
5133
if test -n "$shlibpath_var"; then
5134
# We should set the shlibpath_var
5136
for dir in $temp_rpath; do
5138
[\\/]* | [A-Za-z]:[\\/]*)
5143
# Relative path: add a thisdir entry.
5144
rpath="$rpath\$thisdir/$dir:"
5151
if test -n "$compile_shlibpath$finalize_shlibpath"; then
5152
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5154
if test -n "$finalize_shlibpath"; then
5155
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5160
if test -n "$runpath_var"; then
5161
if test -n "$perm_rpath"; then
5162
# We should set the runpath_var.
5164
for dir in $perm_rpath; do
5167
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5169
if test -n "$finalize_perm_rpath"; then
5170
# We should set the runpath_var.
5172
for dir in $finalize_perm_rpath; do
5175
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5179
if test "$no_install" = yes; then
5180
# We don't need to create a wrapper script.
5181
link_command="$compile_var$compile_command$compile_rpath"
5182
# Replace the output file specification.
5183
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5184
# Delete the old output file.
5186
# Link the executable and exit
5187
$show "$link_command"
5188
$run eval "$link_command" || exit $?
5192
if test "$hardcode_action" = relink; then
5193
# Fast installation is not supported
5194
link_command="$compile_var$compile_command$compile_rpath"
5195
relink_command="$finalize_var$finalize_command$finalize_rpath"
5197
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5198
$echo "$modename: \`$output' will be relinked during installation" 1>&2
5200
if test "$fast_install" != no; then
5201
link_command="$finalize_var$compile_command$finalize_rpath"
5202
if test "$fast_install" = yes; then
5203
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
5205
# fast_install is set to needless
5209
link_command="$compile_var$compile_command$compile_rpath"
5210
relink_command="$finalize_var$finalize_command$finalize_rpath"
5214
# Replace the output file specification.
5215
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5217
# Delete the old output files.
5218
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5220
$show "$link_command"
5221
$run eval "$link_command" || exit $?
5223
# Now create the wrapper script.
5224
$show "creating $output"
5226
# Quote the relink command for shipping.
5227
if test -n "$relink_command"; then
5228
# Preserve any variables that may affect compiler behavior
5229
for var in $variables_saved_for_relink; do
5230
if eval test -z \"\${$var+set}\"; then
5231
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5232
elif eval var_value=\$$var; test -z "$var_value"; then
5233
relink_command="$var=; export $var; $relink_command"
5235
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5236
relink_command="$var=\"$var_value\"; export $var; $relink_command"
5239
relink_command="(cd `pwd`; $relink_command)"
5240
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5243
# Quote $echo for shipping.
5244
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5246
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5247
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5249
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5251
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5254
# Only actually do things if our run command is non-null.
5255
if test -z "$run"; then
5256
# win32 will think the script is a binary if it has
5257
# a .exe suffix, so we strip it off here.
5259
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5261
# test for cygwin because mv fails w/o .exe extensions
5265
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5269
*cygwin* | *mingw* )
5270
output_name=`basename $output`
5271
output_path=`dirname $output`
5272
cwrappersource="$output_path/$objdir/lt-$output_name.c"
5273
cwrapper="$output_path/$output_name.exe"
5274
$rm $cwrappersource $cwrapper
5275
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5277
cat > $cwrappersource <<EOF
5279
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5280
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5282
The $output program cannot be directly executed until all the libtool
5283
libraries that it depends on are installed.
5285
This wrapper executable should never be moved out of the build directory.
5286
If it is, it will not operate correctly.
5288
Currently, it simply execs the wrapper *script* "/bin/sh $output",
5289
but could eventually absorb all of the scripts functionality and
5290
exec $objdir/$outputname directly.
5293
cat >> $cwrappersource<<"EOF"
5302
#include <sys/stat.h>
5304
#if defined(PATH_MAX)
5305
# define LT_PATHMAX PATH_MAX
5306
#elif defined(MAXPATHLEN)
5307
# define LT_PATHMAX MAXPATHLEN
5309
# define LT_PATHMAX 1024
5312
#ifndef DIR_SEPARATOR
5313
# define DIR_SEPARATOR '/'
5314
# define PATH_SEPARATOR ':'
5317
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5319
# define HAVE_DOS_BASED_FILE_SYSTEM
5320
# ifndef DIR_SEPARATOR_2
5321
# define DIR_SEPARATOR_2 '\\'
5323
# ifndef PATH_SEPARATOR_2
5324
# define PATH_SEPARATOR_2 ';'
5328
#ifndef DIR_SEPARATOR_2
5329
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5330
#else /* DIR_SEPARATOR_2 */
5331
# define IS_DIR_SEPARATOR(ch) \
5332
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5333
#endif /* DIR_SEPARATOR_2 */
5335
#ifndef PATH_SEPARATOR_2
5336
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5337
#else /* PATH_SEPARATOR_2 */
5338
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5339
#endif /* PATH_SEPARATOR_2 */
5341
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5342
#define XFREE(stale) do { \
5343
if (stale) { free ((void *) stale); stale = 0; } \
5346
/* -DDEBUG is fairly common in CFLAGS. */
5348
#if defined DEBUGWRAPPER
5349
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5351
# define DEBUG(format, ...)
5354
const char *program_name = NULL;
5356
void * xmalloc (size_t num);
5357
char * xstrdup (const char *string);
5358
const char * base_name (const char *name);
5359
char * find_executable(const char *wrapper);
5360
int check_executable(const char *path);
5361
char * strendzap(char *str, const char *pat);
5362
void lt_fatal (const char *message, ...);
5365
main (int argc, char *argv[])
5370
program_name = (char *) xstrdup (base_name (argv[0]));
5371
DEBUG("(main) argv[0] : %s\n",argv[0]);
5372
DEBUG("(main) program_name : %s\n",program_name);
5373
newargz = XMALLOC(char *, argc+2);
5376
cat >> $cwrappersource <<EOF
5377
newargz[0] = (char *) xstrdup("$SHELL");
5380
cat >> $cwrappersource <<"EOF"
5381
newargz[1] = find_executable(argv[0]);
5382
if (newargz[1] == NULL)
5383
lt_fatal("Couldn't find %s", argv[0]);
5384
DEBUG("(main) found exe at : %s\n",newargz[1]);
5385
/* we know the script has the same name, without the .exe */
5386
/* so make sure newargz[1] doesn't end in .exe */
5387
strendzap(newargz[1],".exe");
5388
for (i = 1; i < argc; i++)
5389
newargz[i+1] = xstrdup(argv[i]);
5390
newargz[argc+1] = NULL;
5392
for (i=0; i<argc+1; i++)
5394
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5402
cat >> $cwrappersource <<EOF
5403
execv("$SHELL",(char const **)newargz);
5407
cat >> $cwrappersource <<EOF
5408
execv("$SHELL",newargz);
5413
cat >> $cwrappersource <<"EOF"
5418
xmalloc (size_t num)
5420
void * p = (void *) malloc (num);
5422
lt_fatal ("Memory exhausted");
5428
xstrdup (const char *string)
5430
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5435
base_name (const char *name)
5439
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5440
/* Skip over the disk name in MSDOS pathnames. */
5441
if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5445
for (base = name; *name; name++)
5446
if (IS_DIR_SEPARATOR (*name))
5452
check_executable(const char * path)
5456
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5457
if ((!path) || (!*path))
5460
if ((stat (path, &st) >= 0) &&
5462
/* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5463
#if defined (S_IXOTH)
5464
((st.st_mode & S_IXOTH) == S_IXOTH) ||
5466
#if defined (S_IXGRP)
5467
((st.st_mode & S_IXGRP) == S_IXGRP) ||
5469
((st.st_mode & S_IXUSR) == S_IXUSR))
5476
/* Searches for the full path of the wrapper. Returns
5477
newly allocated full path name if found, NULL otherwise */
5479
find_executable (const char* wrapper)
5484
/* static buffer for getcwd */
5485
char tmp[LT_PATHMAX + 1];
5489
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5491
if ((wrapper == NULL) || (*wrapper == '\0'))
5494
/* Absolute path? */
5495
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5496
if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5498
concat_name = xstrdup (wrapper);
5499
if (check_executable(concat_name))
5506
if (IS_DIR_SEPARATOR (wrapper[0]))
5508
concat_name = xstrdup (wrapper);
5509
if (check_executable(concat_name))
5513
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5517
for (p = wrapper; *p; p++)
5525
/* no slashes; search PATH */
5526
const char* path = getenv ("PATH");
5529
for (p = path; *p; p = p_next)
5533
for (q = p; *q; q++)
5534
if (IS_PATH_SEPARATOR(*q))
5537
p_next = (*q == '\0' ? q : q + 1);
5540
/* empty path: current directory */
5541
if (getcwd (tmp, LT_PATHMAX) == NULL)
5542
lt_fatal ("getcwd failed");
5543
tmp_len = strlen(tmp);
5544
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5545
memcpy (concat_name, tmp, tmp_len);
5546
concat_name[tmp_len] = '/';
5547
strcpy (concat_name + tmp_len + 1, wrapper);
5551
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5552
memcpy (concat_name, p, p_len);
5553
concat_name[p_len] = '/';
5554
strcpy (concat_name + p_len + 1, wrapper);
5556
if (check_executable(concat_name))
5561
/* not found in PATH; assume curdir */
5563
/* Relative path | not found in path: prepend cwd */
5564
if (getcwd (tmp, LT_PATHMAX) == NULL)
5565
lt_fatal ("getcwd failed");
5566
tmp_len = strlen(tmp);
5567
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5568
memcpy (concat_name, tmp, tmp_len);
5569
concat_name[tmp_len] = '/';
5570
strcpy (concat_name + tmp_len + 1, wrapper);
5572
if (check_executable(concat_name))
5579
strendzap(char *str, const char *pat)
5583
assert(str != NULL);
5584
assert(pat != NULL);
5587
patlen = strlen(pat);
5591
str += len - patlen;
5592
if (strcmp(str, pat) == 0)
5599
lt_error_core (int exit_status, const char * mode,
5600
const char * message, va_list ap)
5602
fprintf (stderr, "%s: %s: ", program_name, mode);
5603
vfprintf (stderr, message, ap);
5604
fprintf (stderr, ".\n");
5606
if (exit_status >= 0)
5611
lt_fatal (const char *message, ...)
5614
va_start (ap, message);
5615
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5619
# we should really use a build-platform specific compiler
5620
# here, but OTOH, the wrappers (shell script and this C one)
5621
# are only useful if you want to execute the "real" binary.
5622
# Since the "real" binary is built for $host, then this
5623
# wrapper might as well be built for $host, too.
5624
$run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5628
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5633
# $output - temporary wrapper script for $objdir/$outputname
5634
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5636
# The $output program cannot be directly executed until all the libtool
5637
# libraries that it depends on are installed.
5639
# This wrapper script should never be moved out of the build directory.
5640
# If it is, it will not operate correctly.
5642
# Sed substitution that helps us do robust quoting. It backslashifies
5643
# metacharacters that are still active within double-quoted strings.
5644
Xsed='${SED} -e 1s/^X//'
5645
sed_quote_subst='$sed_quote_subst'
5647
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5648
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5651
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5652
# is contrary to our usage. Disable this feature.
5653
alias -g '\${1+\"\$@\"}'='\"\$@\"'
5654
setopt NO_GLOB_SUBST
5656
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5659
# The HP-UX ksh and POSIX shell print the target directory to stdout
5661
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5663
relink_command=\"$relink_command\"
5665
# This environment variable determines our operation mode.
5666
if test \"\$libtool_install_magic\" = \"$magic\"; then
5667
# install mode needs the following variable:
5668
notinst_deplibs='$notinst_deplibs'
5670
# When we are sourced in execute mode, \$file and \$echo are already set.
5671
if test \"\$libtool_execute_magic\" != \"$magic\"; then
5674
# Make sure echo works.
5675
if test \"X\$1\" = X--no-reexec; then
5676
# Discard the --no-reexec flag, and continue.
5678
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5679
# Yippee, \$echo works!
5682
# Restart under the correct shell, and then maybe \$echo will work.
5683
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5689
# Find the directory that this script lives in.
5690
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5691
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5693
# Follow symbolic links until we get to the real thisdir.
5694
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5695
while test -n \"\$file\"; do
5696
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5698
# If there was a directory component, then change thisdir.
5699
if test \"x\$destdir\" != \"x\$file\"; then
5700
case \"\$destdir\" in
5701
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5702
*) thisdir=\"\$thisdir/\$destdir\" ;;
5706
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5707
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5710
# Try to get the absolute directory name.
5711
absdir=\`cd \"\$thisdir\" && pwd\`
5712
test -n \"\$absdir\" && thisdir=\"\$absdir\"
5715
if test "$fast_install" = yes; then
5717
program=lt-'$outputname'$exeext
5718
progdir=\"\$thisdir/$objdir\"
5720
if test ! -f \"\$progdir/\$program\" || \\
5721
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5722
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5724
file=\"\$\$-\$program\"
5726
if test ! -d \"\$progdir\"; then
5727
$mkdir \"\$progdir\"
5729
$rm \"\$progdir/\$file\"
5734
# relink executable if necessary
5735
if test -n \"\$relink_command\"; then
5736
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5738
$echo \"\$relink_command_output\" >&2
5739
$rm \"\$progdir/\$file\"
5744
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5745
{ $rm \"\$progdir/\$program\";
5746
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5747
$rm \"\$progdir/\$file\"
5751
program='$outputname'
5752
progdir=\"\$thisdir/$objdir\"
5758
if test -f \"\$progdir/\$program\"; then"
5760
# Export our shlibpath_var if we have one.
5761
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5763
# Add our own library path to $shlibpath_var
5764
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5766
# Some systems cannot cope with colon-terminated $shlibpath_var
5767
# The second colon is a workaround for a bug in BeOS R4 sed
5768
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5770
export $shlibpath_var
5774
# fixup the dll searchpath if we need to.
5775
if test -n "$dllsearchpath"; then
5777
# Add the dll search path components to the executable PATH
5778
PATH=$dllsearchpath:\$PATH
5783
if test \"\$libtool_execute_magic\" != \"$magic\"; then
5784
# Run the actual program with our arguments.
5787
# Backslashes separate directories on plain windows
5788
*-*-mingw | *-*-os2*)
5790
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5796
exec \"\$progdir/\$program\" \${1+\"\$@\"}
5801
\$echo \"\$0: cannot exec \$program \$*\"
5805
# The program doesn't exist.
5806
\$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5807
\$echo \"This script is just a wrapper for \$program.\" 1>&2
5808
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
5819
# See if we need to build an old-fashioned archive.
5820
for oldlib in $oldlibs; do
5822
if test "$build_libtool_libs" = convenience; then
5823
oldobjs="$libobjs_save"
5824
addlibs="$convenience"
5825
build_libtool_libs=no
5827
if test "$build_libtool_libs" = module; then
5828
oldobjs="$libobjs_save"
5829
build_libtool_libs=no
5831
oldobjs="$old_deplibs $non_pic_objects"
5833
addlibs="$old_convenience"
5836
if test -n "$addlibs"; then
5837
gentop="$output_objdir/${outputname}x"
5838
generated="$generated $gentop"
5840
func_extract_archives $gentop $addlibs
5841
oldobjs="$oldobjs $func_extract_archives_result"
5844
# Do each command in the archive commands.
5845
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5846
cmds=$old_archive_from_new_cmds
5848
# POSIX demands no paths to be encoded in archives. We have
5849
# to avoid creating archives with duplicate basenames if we
5850
# might have to extract them afterwards, e.g., when creating a
5851
# static archive out of a convenience library, or when linking
5852
# the entirety of a libtool archive into another (currently
5853
# not supported by libtool).
5854
if (for obj in $oldobjs
5856
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5857
done | sort | sort -uc >/dev/null 2>&1); then
5860
$echo "copying selected object files to avoid basename conflicts..."
5862
if test -z "$gentop"; then
5863
gentop="$output_objdir/${outputname}x"
5864
generated="$generated $gentop"
5866
$show "${rm}r $gentop"
5867
$run ${rm}r "$gentop"
5868
$show "$mkdir $gentop"
5869
$run $mkdir "$gentop"
5871
if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5876
save_oldobjs=$oldobjs
5879
for obj in $save_oldobjs
5881
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5882
case " $oldobjs " in
5883
" ") oldobjs=$obj ;;
5886
# Make sure we don't pick an alternate name that also
5888
newobj=lt$counter-$objbase
5889
counter=`expr $counter + 1`
5890
case " $oldobjs " in
5891
*[\ /]"$newobj "*) ;;
5892
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5895
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5896
$run ln "$obj" "$gentop/$newobj" ||
5897
$run cp "$obj" "$gentop/$newobj"
5898
oldobjs="$oldobjs $gentop/$newobj"
5900
*) oldobjs="$oldobjs $obj" ;;
5905
eval cmds=\"$old_archive_cmds\"
5907
if len=`expr "X$cmds" : ".*"` &&
5908
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5909
cmds=$old_archive_cmds
5911
# the command line is too long to link in one step, link in parts
5912
$echo "using piecewise archive linking..."
5917
save_oldobjs=$oldobjs
5919
# Is there a better way of finding the last object in the list?
5920
for obj in $save_oldobjs
5924
for obj in $save_oldobjs
5926
oldobjs="$objlist $obj"
5927
objlist="$objlist $obj"
5928
eval test_cmds=\"$old_archive_cmds\"
5929
if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5930
test "$len" -le "$max_cmd_len"; then
5933
# the above command should be used before it gets too long
5935
if test "$obj" = "$last_oldobj" ; then
5938
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5939
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5945
if test "X$oldobjs" = "X" ; then
5946
eval cmds=\"\$concat_cmds\"
5948
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5952
save_ifs="$IFS"; IFS='~'
5953
for cmd in $cmds; do
5957
$run eval "$cmd" || exit $?
5962
if test -n "$generated"; then
5963
$show "${rm}r$generated"
5964
$run ${rm}r$generated
5967
# Now create the libtool archive.
5971
test "$build_old_libs" = yes && old_library="$libname.$libext"
5972
$show "creating $output"
5974
# Preserve any variables that may affect compiler behavior
5975
for var in $variables_saved_for_relink; do
5976
if eval test -z \"\${$var+set}\"; then
5977
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5978
elif eval var_value=\$$var; test -z "$var_value"; then
5979
relink_command="$var=; export $var; $relink_command"
5981
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5982
relink_command="$var=\"$var_value\"; export $var; $relink_command"
5985
# Quote the link command for shipping.
5986
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5987
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5988
if test "$hardcode_automatic" = yes ; then
5993
# Only create the output if not a dry run.
5994
if test -z "$run"; then
5995
for installed in no yes; do
5996
if test "$installed" = yes; then
5997
if test -z "$install_libdir"; then
6000
output="$output_objdir/$outputname"i
6001
# Replace all uninstalled libtool libraries with the installed ones
6003
for deplib in $dependency_libs; do
6006
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
6007
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6008
if test -z "$libdir"; then
6009
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6012
newdependency_libs="$newdependency_libs $libdir/$name"
6014
*) newdependency_libs="$newdependency_libs $deplib" ;;
6017
dependency_libs="$newdependency_libs"
6019
for lib in $dlfiles; do
6020
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6021
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6022
if test -z "$libdir"; then
6023
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6026
newdlfiles="$newdlfiles $libdir/$name"
6028
dlfiles="$newdlfiles"
6030
for lib in $dlprefiles; do
6031
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6032
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6033
if test -z "$libdir"; then
6034
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6037
newdlprefiles="$newdlprefiles $libdir/$name"
6039
dlprefiles="$newdlprefiles"
6042
for lib in $dlfiles; do
6044
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6045
*) abs=`pwd`"/$lib" ;;
6047
newdlfiles="$newdlfiles $abs"
6049
dlfiles="$newdlfiles"
6051
for lib in $dlprefiles; do
6053
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6054
*) abs=`pwd`"/$lib" ;;
6056
newdlprefiles="$newdlprefiles $abs"
6058
dlprefiles="$newdlprefiles"
6061
# place dlname in correct position for cygwin
6063
case $host,$output,$installed,$module,$dlname in
6064
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6067
# $outputname - a libtool library file
6068
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6070
# Please DO NOT delete this file!
6071
# It is necessary for linking the library.
6073
# The name that we can dlopen(3).
6076
# Names of this library.
6077
library_names='$library_names'
6079
# The name of the static archive.
6080
old_library='$old_library'
6082
# Libraries that this one depends upon.
6083
dependency_libs='$dependency_libs'
6085
# Version information for $libname.
6090
# Is this an already installed library?
6091
installed=$installed
6093
# Should we warn about portability when linking against -modules?
6094
shouldnotlink=$module
6096
# Files to dlopen/dlpreopen
6098
dlpreopen='$dlprefiles'
6100
# Directory that this library needs to be installed in:
6101
libdir='$install_libdir'"
6102
if test "$installed" = no && test "$need_relink" = yes; then
6104
relink_command=\"$relink_command\""
6109
# Do a symbolic link so that the libtool archive can be found in
6110
# LD_LIBRARY_PATH before the program is installed.
6111
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6112
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6118
# libtool install mode
6120
modename="$modename: install"
6122
# There may be an optional sh(1) argument at the beginning of
6123
# install_prog (especially on Windows NT).
6124
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6125
# Allow the use of GNU shtool's install command.
6126
$echo "X$nonopt" | grep shtool > /dev/null; then
6127
# Aesthetically quote it.
6128
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6130
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6134
install_prog="$arg "
6142
# The real first argument should be the name of the installation program.
6143
# Aesthetically quote it.
6144
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6146
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6150
install_prog="$install_prog$arg"
6152
# We need to accept at least all the BSD install flags.
6162
if test -n "$dest"; then
6163
files="$files $dest"
6171
case " $install_prog " in
6176
-g | -m | -o) prev=$arg ;;
6184
# If the previous option needed an argument, then skip it.
6185
if test -n "$prev"; then
6194
# Aesthetically quote the argument.
6195
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6197
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6201
install_prog="$install_prog $arg"
6204
if test -z "$install_prog"; then
6205
$echo "$modename: you must specify an install program" 1>&2
6210
if test -n "$prev"; then
6211
$echo "$modename: the \`$prev' option requires an argument" 1>&2
6216
if test -z "$files"; then
6217
if test -z "$dest"; then
6218
$echo "$modename: no file or destination specified" 1>&2
6220
$echo "$modename: you must specify a destination" 1>&2
6226
# Strip any trailing slash from the destination.
6227
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6229
# Check to see that the destination is a directory.
6230
test -d "$dest" && isdir=yes
6231
if test "$isdir" = yes; then
6235
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6236
test "X$destdir" = "X$dest" && destdir=.
6237
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6239
# Not a directory, so check to see that there is only one file specified.
6241
if test "$#" -gt 2; then
6242
$echo "$modename: \`$dest' is not a directory" 1>&2
6248
[\\/]* | [A-Za-z]:[\\/]*) ;;
6250
for file in $files; do
6254
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6263
# This variable tells wrapper scripts just to set variables rather
6264
# than running their programs.
6265
libtool_install_magic="$magic"
6270
for file in $files; do
6272
# Do each installation.
6275
# Do the static libraries later.
6276
staticlibs="$staticlibs $file"
6280
# Check to see that this really is a libtool archive.
6281
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6283
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6291
# If there is no directory component, then add one.
6293
*/* | *\\*) . $file ;;
6297
# Add the libdir to current_libdirs if it is the destination.
6298
if test "X$destdir" = "X$libdir"; then
6299
case "$current_libdirs " in
6301
*) current_libdirs="$current_libdirs $libdir" ;;
6304
# Note the libdir as a future libdir.
6305
case "$future_libdirs " in
6307
*) future_libdirs="$future_libdirs $libdir" ;;
6311
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6312
test "X$dir" = "X$file/" && dir=
6315
if test -n "$relink_command"; then
6316
# Determine the prefix the user has applied to our future dir.
6317
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6319
# Don't allow the user to place us outside of our expected
6320
# location b/c this prevents finding dependent libraries that
6321
# are installed to the same prefix.
6322
# At present, this check doesn't affect windows .dll's that
6323
# are installed into $libdir/../bin (currently, that works fine)
6324
# but it's something to keep an eye on.
6325
if test "$inst_prefix_dir" = "$destdir"; then
6326
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6330
if test -n "$inst_prefix_dir"; then
6331
# Stick the inst_prefix_dir data into the link command.
6332
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6334
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6337
$echo "$modename: warning: relinking \`$file'" 1>&2
6338
$show "$relink_command"
6339
if $run eval "$relink_command"; then :
6341
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6346
# See the names of the shared library.
6347
set dummy $library_names
6348
if test -n "$2"; then
6354
test -n "$relink_command" && srcname="$realname"T
6356
# Install the shared library and build the symlinks.
6357
$show "$install_prog $dir/$srcname $destdir/$realname"
6358
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6359
if test -n "$stripme" && test -n "$striplib"; then
6360
$show "$striplib $destdir/$realname"
6361
$run eval "$striplib $destdir/$realname" || exit $?
6364
if test "$#" -gt 0; then
6365
# Delete the old symlinks, and create new ones.
6366
# Try `ln -sf' first, because the `ln' binary might depend on
6367
# the symlink we replace! Solaris /bin/ln does not understand -f,
6368
# so we also need to try rm && ln -s.
6371
if test "$linkname" != "$realname"; then
6372
$show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6373
$run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6378
# Do each command in the postinstall commands.
6379
lib="$destdir/$realname"
6380
cmds=$postinstall_cmds
6381
save_ifs="$IFS"; IFS='~'
6382
for cmd in $cmds; do
6386
$run eval "$cmd" || {
6389
# Restore the uninstalled library and exit
6390
if test "$mode" = relink; then
6391
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6400
# Install the pseudo-library for information purposes.
6401
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6402
instname="$dir/$name"i
6403
$show "$install_prog $instname $destdir/$name"
6404
$run eval "$install_prog $instname $destdir/$name" || exit $?
6406
# Maybe install the static library, too.
6407
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6411
# Install (i.e. copy) a libtool object.
6413
# Figure out destination file name, if it wasn't already specified.
6414
if test -n "$destname"; then
6415
destfile="$destdir/$destname"
6417
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6418
destfile="$destdir/$destfile"
6421
# Deduce the name of the destination old-style object file.
6424
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6427
staticdest="$destfile"
6431
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6437
# Install the libtool object if requested.
6438
if test -n "$destfile"; then
6439
$show "$install_prog $file $destfile"
6440
$run eval "$install_prog $file $destfile" || exit $?
6443
# Install the old object if enabled.
6444
if test "$build_old_libs" = yes; then
6445
# Deduce the name of the old-style object file.
6446
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6448
$show "$install_prog $staticobj $staticdest"
6449
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
6455
# Figure out destination file name, if it wasn't already specified.
6456
if test -n "$destname"; then
6457
destfile="$destdir/$destname"
6459
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6460
destfile="$destdir/$destfile"
6463
# If the file is missing, and there is a .exe on the end, strip it
6464
# because it is most likely a libtool script we actually want to
6469
if test ! -f "$file"; then
6470
file=`$echo $file|${SED} 's,.exe$,,'`
6476
# Do a test to see if this is really a libtool program.
6479
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6485
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6489
# Note that it is not necessary on cygwin/mingw to append a dot to
6490
# foo even if both foo and FILE.exe exist: automatic-append-.exe
6491
# behavior happens only for exec(3), not for open(2)! Also, sourcing
6492
# `FILE.' does not work on cygwin managed mounts.
6494
# If there is no directory component, then add one.
6496
*/* | *\\*) . ${wrapper} ;;
6497
*) . ./${wrapper} ;;
6500
# Check the variables that should have been set.
6501
if test -z "$notinst_deplibs"; then
6502
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6507
for lib in $notinst_deplibs; do
6508
# Check to see that each library is installed.
6510
if test -f "$lib"; then
6511
# If there is no directory component, then add one.
6513
*/* | *\\*) . $lib ;;
6517
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6518
if test -n "$libdir" && test ! -f "$libfile"; then
6519
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6525
# Note that it is not necessary on cygwin/mingw to append a dot to
6526
# foo even if both foo and FILE.exe exist: automatic-append-.exe
6527
# behavior happens only for exec(3), not for open(2)! Also, sourcing
6528
# `FILE.' does not work on cygwin managed mounts.
6530
# If there is no directory component, then add one.
6532
*/* | *\\*) . ${wrapper} ;;
6533
*) . ./${wrapper} ;;
6537
if test "$fast_install" = no && test -n "$relink_command"; then
6538
if test "$finalize" = yes && test -z "$run"; then
6539
tmpdir=`func_mktempdir`
6540
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6541
outputname="$tmpdir/$file"
6542
# Replace the output file specification.
6543
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6545
$show "$relink_command"
6546
if $run eval "$relink_command"; then :
6548
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6554
$echo "$modename: warning: cannot relink \`$file'" 1>&2
6557
# Install the binary that we compiled earlier.
6558
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6562
# remove .exe since cygwin /usr/bin/install will append another
6564
case $install_prog,$host in
6565
*/usr/bin/install*,*cygwin*)
6566
case $file:$destfile in
6571
destfile=$destfile.exe
6574
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6579
$show "$install_prog$stripme $file $destfile"
6580
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6581
test -n "$outputname" && ${rm}r "$tmpdir"
6586
for file in $staticlibs; do
6587
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6589
# Set up the ranlib parameters.
6590
oldlib="$destdir/$name"
6592
$show "$install_prog $file $oldlib"
6593
$run eval "$install_prog \$file \$oldlib" || exit $?
6595
if test -n "$stripme" && test -n "$old_striplib"; then
6596
$show "$old_striplib $oldlib"
6597
$run eval "$old_striplib $oldlib" || exit $?
6600
# Do each command in the postinstall commands.
6601
cmds=$old_postinstall_cmds
6602
save_ifs="$IFS"; IFS='~'
6603
for cmd in $cmds; do
6607
$run eval "$cmd" || exit $?
6612
if test -n "$future_libdirs"; then
6613
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6616
if test -n "$current_libdirs"; then
6617
# Maybe just do a dry run.
6618
test -n "$run" && current_libdirs=" -n$current_libdirs"
6619
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6625
# libtool finish mode
6627
modename="$modename: finish"
6631
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6634
libdirs="$libdirs $dir"
6637
for libdir in $libdirs; do
6638
if test -n "$finish_cmds"; then
6639
# Do each command in the finish commands.
6641
save_ifs="$IFS"; IFS='~'
6642
for cmd in $cmds; do
6646
$run eval "$cmd" || admincmds="$admincmds
6651
if test -n "$finish_eval"; then
6652
# Do the single finish_eval.
6653
eval cmds=\"$finish_eval\"
6654
$run eval "$cmds" || admincmds="$admincmds
6660
# Exit here if they wanted silent mode.
6661
test "$show" = : && exit $EXIT_SUCCESS
6663
$echo "X----------------------------------------------------------------------" | $Xsed
6664
$echo "Libraries have been installed in:"
6665
for libdir in $libdirs; do
6669
$echo "If you ever happen to want to link against installed libraries"
6670
$echo "in a given directory, LIBDIR, you must either use libtool, and"
6671
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6672
$echo "flag during linking and do at least one of the following:"
6673
if test -n "$shlibpath_var"; then
6674
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6675
$echo " during execution"
6677
if test -n "$runpath_var"; then
6678
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
6679
$echo " during linking"
6681
if test -n "$hardcode_libdir_flag_spec"; then
6683
eval flag=\"$hardcode_libdir_flag_spec\"
6685
$echo " - use the \`$flag' linker flag"
6687
if test -n "$admincmds"; then
6688
$echo " - have your system administrator run these commands:$admincmds"
6690
if test -f /etc/ld.so.conf; then
6691
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6694
$echo "See any operating system documentation about shared libraries for"
6695
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
6696
$echo "X----------------------------------------------------------------------" | $Xsed
6700
# libtool execute mode
6702
modename="$modename: execute"
6704
# The first argument is the command name.
6706
if test -z "$cmd"; then
6707
$echo "$modename: you must specify a COMMAND" 1>&2
6712
# Handle -dlopen flags immediately.
6713
for file in $execute_dlfiles; do
6714
if test ! -f "$file"; then
6715
$echo "$modename: \`$file' is not a file" 1>&2
6723
# Check to see that this really is a libtool archive.
6724
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6726
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6731
# Read the libtool library.
6735
# If there is no directory component, then add one.
6737
*/* | *\\*) . $file ;;
6741
# Skip this library if it cannot be dlopened.
6742
if test -z "$dlname"; then
6743
# Warn if it was a shared library.
6744
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6748
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6749
test "X$dir" = "X$file" && dir=.
6751
if test -f "$dir/$objdir/$dlname"; then
6754
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6760
# Just add the directory containing the .lo file.
6761
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6762
test "X$dir" = "X$file" && dir=.
6766
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6771
# Get the absolute pathname.
6772
absdir=`cd "$dir" && pwd`
6773
test -n "$absdir" && dir="$absdir"
6775
# Now add the directory to shlibpath_var.
6776
if eval "test -z \"\$$shlibpath_var\""; then
6777
eval "$shlibpath_var=\"\$dir\""
6779
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6783
# This variable tells wrapper scripts just to set shlibpath_var
6784
# rather than running their programs.
6785
libtool_execute_magic="$magic"
6787
# Check if any of the arguments is a wrapper script.
6794
# Do a test to see if this is really a libtool program.
6795
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6796
# If there is no directory component, then add one.
6798
*/* | *\\*) . $file ;;
6802
# Transform arg to wrapped name.
6803
file="$progdir/$program"
6807
# Quote arguments (to preserve shell metacharacters).
6808
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6809
args="$args \"$file\""
6812
if test -z "$run"; then
6813
if test -n "$shlibpath_var"; then
6814
# Export the shlibpath_var.
6815
eval "export $shlibpath_var"
6818
# Restore saved environment variables
6819
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6821
eval "if test \"\${save_$lt_var+set}\" = set; then
6822
$lt_var=\$save_$lt_var; export $lt_var
6827
# Now prepare to actually exec the command.
6828
exec_cmd="\$cmd$args"
6830
# Display what would be done.
6831
if test -n "$shlibpath_var"; then
6832
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6833
$echo "export $shlibpath_var"
6840
# libtool clean and uninstall mode
6842
modename="$modename: $mode"
6848
# This variable tells wrapper scripts just to set variables rather
6849
# than running their programs.
6850
libtool_install_magic="$magic"
6855
-f) rm="$rm $arg"; rmforce=yes ;;
6856
-*) rm="$rm $arg" ;;
6857
*) files="$files $arg" ;;
6861
if test -z "$rm"; then
6862
$echo "$modename: you must specify an RM program" 1>&2
6869
origobjdir="$objdir"
6870
for file in $files; do
6871
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6872
if test "X$dir" = "X$file"; then
6874
objdir="$origobjdir"
6876
objdir="$dir/$origobjdir"
6878
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6879
test "$mode" = uninstall && objdir="$dir"
6881
# Remember objdir for removal later, being careful to avoid duplicates
6882
if test "$mode" = clean; then
6885
*) rmdirs="$rmdirs $objdir" ;;
6889
# Don't error if the file doesn't exist and rm -f was used.
6890
if (test -L "$file") >/dev/null 2>&1 \
6891
|| (test -h "$file") >/dev/null 2>&1 \
6892
|| test -f "$file"; then
6894
elif test -d "$file"; then
6897
elif test "$rmforce" = yes; then
6905
# Possibly a libtool archive, so verify it.
6906
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6909
# Delete the libtool libraries and symlinks.
6910
for n in $library_names; do
6911
rmfiles="$rmfiles $objdir/$n"
6913
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6917
case " $library_names " in
6918
# " " in the beginning catches empty $dlname
6920
*) rmfiles="$rmfiles $objdir/$dlname" ;;
6922
test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6925
if test -n "$library_names"; then
6926
# Do each command in the postuninstall commands.
6927
cmds=$postuninstall_cmds
6928
save_ifs="$IFS"; IFS='~'
6929
for cmd in $cmds; do
6934
if test "$?" -ne 0 && test "$rmforce" != yes; then
6941
if test -n "$old_library"; then
6942
# Do each command in the old_postuninstall commands.
6943
cmds=$old_postuninstall_cmds
6944
save_ifs="$IFS"; IFS='~'
6945
for cmd in $cmds; do
6950
if test "$?" -ne 0 && test "$rmforce" != yes; then
6956
# FIXME: should reinstall the best remaining shared library.
6963
# Possibly a libtool object, so verify it.
6964
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6969
# Add PIC object to the list of files to remove.
6970
if test -n "$pic_object" \
6971
&& test "$pic_object" != none; then
6972
rmfiles="$rmfiles $dir/$pic_object"
6975
# Add non-PIC object to the list of files to remove.
6976
if test -n "$non_pic_object" \
6977
&& test "$non_pic_object" != none; then
6978
rmfiles="$rmfiles $dir/$non_pic_object"
6984
if test "$mode" = clean ; then
6988
file=`$echo $file|${SED} 's,.exe$,,'`
6989
noexename=`$echo $name|${SED} 's,.exe$,,'`
6990
# $file with .exe has already been added to rmfiles,
6991
# add $file without .exe
6992
rmfiles="$rmfiles $file"
6995
# Do a test to see if this is a libtool program.
6996
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7000
# note $name still contains .exe if it was in $file originally
7001
# as does the version of $file that was added into $rmfiles
7002
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7003
if test "$fast_install" = yes && test -n "$relink_command"; then
7004
rmfiles="$rmfiles $objdir/lt-$name"
7006
if test "X$noexename" != "X$name" ; then
7007
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7013
$show "$rm $rmfiles"
7014
$run $rm $rmfiles || exit_status=1
7016
objdir="$origobjdir"
7018
# Try to remove the ${objdir}s in the directories where we deleted files
7019
for dir in $rmdirs; do
7020
if test -d "$dir"; then
7022
$run rmdir $dir >/dev/null 2>&1
7030
$echo "$modename: you must specify a MODE" 1>&2
7031
$echo "$generic_help" 1>&2
7036
if test -z "$exec_cmd"; then
7037
$echo "$modename: invalid operation mode \`$mode'" 1>&2
7038
$echo "$generic_help" 1>&2
7041
fi # test -z "$show_help"
7043
if test -n "$exec_cmd"; then
7048
# We need to display help for each of the modes.
7051
"Usage: $modename [OPTION]... [MODE-ARG]...
7053
Provide generalized library-building support services.
7055
--config show all configuration variables
7056
--debug enable verbose shell tracing
7057
-n, --dry-run display commands without modifying any files
7058
--features display basic configuration information and exit
7059
--finish same as \`--mode=finish'
7060
--help display this help message and exit
7061
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7062
--quiet same as \`--silent'
7063
--silent don't print informational messages
7064
--tag=TAG use configuration variables from tag TAG
7065
--version print version information
7067
MODE must be one of the following:
7069
clean remove files from the build directory
7070
compile compile a source file into a libtool object
7071
execute automatically set library path, then run a program
7072
finish complete the installation of libtool libraries
7073
install install libraries or executables
7074
link create a library or an executable
7075
uninstall remove libraries from an installed directory
7077
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7078
a more detailed description of MODE.
7080
Report bugs to <bug-libtool@gnu.org>."
7086
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7088
Remove files from the build directory.
7090
RM is the name of the program to use to delete files associated with each FILE
7091
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7094
If FILE is a libtool library, object or program, all the files associated
7095
with it are deleted. Otherwise, only FILE itself is deleted using RM."
7100
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7102
Compile a source file into a libtool library object.
7104
This mode accepts the following additional options:
7106
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
7107
-prefer-pic try to building PIC objects only
7108
-prefer-non-pic try to building non-PIC objects only
7109
-static always build a \`.o' file suitable for static linking
7111
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7112
from the given SOURCEFILE.
7114
The output file name is determined by removing the directory component from
7115
SOURCEFILE, then substituting the C source code suffix \`.c' with the
7116
library object suffix, \`.lo'."
7121
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7123
Automatically set library path, then run a program.
7125
This mode accepts the following additional options:
7127
-dlopen FILE add the directory containing FILE to the library path
7129
This mode sets the library path environment variable according to \`-dlopen'
7132
If any of the ARGS are libtool executable wrappers, then they are translated
7133
into their corresponding uninstalled binary, and any of their required library
7134
directories are added to the library path.
7136
Then, COMMAND is executed, with ARGS as arguments."
7141
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7143
Complete the installation of libtool libraries.
7145
Each LIBDIR is a directory that contains libtool libraries.
7147
The commands that this mode executes may require superuser privileges. Use
7148
the \`--dry-run' option if you just want to see what would be executed."
7153
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7155
Install executables or libraries.
7157
INSTALL-COMMAND is the installation command. The first component should be
7158
either the \`install' or \`cp' program.
7160
The rest of the components are interpreted as arguments to that command (only
7161
BSD-compatible install options are recognized)."
7166
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7168
Link object files or libraries together to form another library, or to
7169
create an executable program.
7171
LINK-COMMAND is a command using the C compiler that you would use to create
7172
a program from several object files.
7174
The following components of LINK-COMMAND are treated specially:
7176
-all-static do not do any dynamic linking at all
7177
-avoid-version do not add a version suffix if possible
7178
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7179
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7180
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7181
-export-symbols SYMFILE
7182
try to export only the symbols listed in SYMFILE
7183
-export-symbols-regex REGEX
7184
try to export only the symbols matching REGEX
7185
-LLIBDIR search LIBDIR for required installed libraries
7186
-lNAME OUTPUT-FILE requires the installed library libNAME
7187
-module build a library that can dlopened
7188
-no-fast-install disable the fast-install mode
7189
-no-install link a not-installable executable
7190
-no-undefined declare that a library does not refer to external symbols
7191
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7192
-objectlist FILE Use a list of object files found in FILE to specify objects
7193
-precious-files-regex REGEX
7194
don't remove output files matching REGEX
7195
-release RELEASE specify package release information
7196
-rpath LIBDIR the created library will eventually be installed in LIBDIR
7197
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7198
-static do not do any dynamic linking of uninstalled libtool libraries
7199
-static-libtool-libs
7200
do not do any dynamic linking of libtool libraries
7201
-version-info CURRENT[:REVISION[:AGE]]
7202
specify library version info [each variable defaults to 0]
7204
All other options (arguments beginning with \`-') are ignored.
7206
Every other argument is treated as a filename. Files ending in \`.la' are
7207
treated as uninstalled libtool libraries, other files are standard or library
7210
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7211
only library objects (\`.lo' files) may be specified, and \`-rpath' is
7212
required, except when creating a convenience library.
7214
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7215
using \`ar' and \`ranlib', or on Windows using \`lib'.
7217
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7218
is created, otherwise an executable program is created."
7223
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7225
Remove libraries from an installation directory.
7227
RM is the name of the program to use to delete files associated with each FILE
7228
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7231
If FILE is a libtool library, all the files associated with it are deleted.
7232
Otherwise, only FILE itself is deleted using RM."
7236
$echo "$modename: invalid operation mode \`$mode'" 1>&2
7243
$echo "Try \`$modename --help' for more information about other modes."
7247
# The TAGs below are defined such that we never get into a situation
7248
# in which we disable both kinds of libraries. Given conflicting
7249
# choices, we go for a static library, that is the most portable,
7250
# since we can't tell whether shared libraries were disabled because
7251
# the user asked for that or because the platform doesn't support
7252
# them. This is particularly important on AIX, because we don't
7253
# support having both static and shared libraries enabled at the same
7254
# time on that platform, so we default to a shared-only configuration.
7255
# If a disable-shared tag is given, we'll fallback to a static-only
7256
# configuration. But we'll never go from static-only to shared-only.
7258
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7260
# ### END LIBTOOL TAG CONFIG: disable-shared
7262
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
7264
# ### END LIBTOOL TAG CONFIG: disable-static
7270
# ### BEGIN LIBTOOL TAG CONFIG: CXX
7272
# Libtool was configured on host blackwold:
7274
# Shell to use when invoking shell scripts.
7277
# Whether or not to build shared libraries.
7278
build_libtool_libs=yes
7280
# Whether or not to build static libraries.
7283
# Whether or not to add -lc for building shared libraries.
7284
build_libtool_need_lc=no
7286
# Whether or not to disallow shared libs when runtime libs are static
7287
allow_libtool_libs_with_static_runtimes=no
7289
# Whether or not to optimize for fast installation.
7294
host=i686-pc-linux-gnu
7299
build=i686-pc-linux-gnu
7302
# An echo program that does not interpret backslashes.
7312
# LTCC compiler flags.
7315
# A language-specific compiler.
7318
# Is the compiler the GNU C compiler?
7322
EGREP="/bin/grep -E"
7324
# The linker used to build libraries.
7327
# Whether we need hard or soft links.
7330
# A BSD-compatible nm program.
7333
# A symbol stripping program
7336
# Used to examine libraries when file_magic_cmd begins "file"
7339
# Used on cygwin: DLL creation program.
7342
# Used on cygwin: object dumper.
7345
# Used on cygwin: assembler.
7348
# The name of the directory that contains temporary libtool files.
7351
# How to create reloadable object files.
7353
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7355
# How to pass a linker flag through the compiler.
7358
# Object file suffix (normally "o").
7361
# Old archive suffix (normally "a").
7364
# Shared library suffix (normally ".so").
7367
# Executable file suffix (normally "").
7370
# Additional compiler flags for building library objects.
7371
pic_flag=" -fPIC -DPIC"
7374
# What is the maximum length of a command?
7377
# Does compiler simultaneously support -c and -o options?
7380
# Must we lock files when doing compilation?
7383
# Do we need the lib prefix for modules?
7386
# Do we need a version for libraries?
7389
# Whether dlopen is supported.
7390
dlopen_support=unknown
7392
# Whether dlopen of programs is supported.
7395
# Whether dlopen of statically linked programs is supported.
7396
dlopen_self_static=unknown
7398
# Compiler flag to prevent dynamic linking.
7399
link_static_flag="-static"
7401
# Compiler flag to turn off builtin functions.
7402
no_builtin_flag=" -fno-builtin"
7404
# Compiler flag to allow reflexive dlopens.
7405
export_dynamic_flag_spec="\${wl}--export-dynamic"
7407
# Compiler flag to generate shared objects directly from archives.
7408
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7410
# Compiler flag to generate thread-safe objects.
7411
thread_safe_flag_spec=""
7413
# Library versioning type.
7416
# Format of library name prefix.
7417
libname_spec="lib\$name"
7419
# List of archive names. First name is the real one, the rest are links.
7420
# The last name is the one that the linker finds with -lNAME.
7421
library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
7423
# The coded name of the library, if different from the real name.
7424
soname_spec="\${libname}\${release}\${shared_ext}\$major"
7426
# Commands used to build and install an old-style archive.
7428
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
7429
old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7430
old_postuninstall_cmds=""
7432
# Create an old-style archive from a shared archive.
7433
old_archive_from_new_cmds=""
7435
# Create a temporary old-style archive to link instead of a shared archive.
7436
old_archive_from_expsyms_cmds=""
7438
# Commands used to build and install a shared archive.
7439
archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7440
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"
7442
postuninstall_cmds=""
7444
# Commands used to build a loadable module (assumed same as above if empty)
7446
module_expsym_cmds=""
7448
# Commands to strip libraries.
7449
old_striplib="strip --strip-debug"
7450
striplib="strip --strip-unneeded"
7452
# Dependencies to place before the objects being linked to create a
7454
predep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.1.2/crtbeginS.o"
7456
# Dependencies to place after the objects being linked to create a
7458
postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.2/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crtn.o"
7460
# Dependencies to place before the objects being linked to create a
7464
# Dependencies to place after the objects being linked to create a
7466
postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7468
# The library search path used internally by the compiler when linking
7470
compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.1.2 -L/usr/lib/gcc/i486-linux-gnu/4.1.2 -L/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib"
7472
# Method to check whether dependent libraries are shared objects.
7473
deplibs_check_method="pass_all"
7475
# Command to use when deplibs_check_method == file_magic.
7476
file_magic_cmd="\$MAGIC_CMD"
7478
# Flag that allows shared libraries with undefined symbols to be built.
7479
allow_undefined_flag=""
7481
# Flag that forces no undefined symbols.
7482
no_undefined_flag=""
7484
# Commands used to finish a libtool library installation in a directory.
7485
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7487
# Same as above, but a single script fragment to be evaled but not shown.
7490
# Take the output of nm and produce a listing of raw symbols and C names.
7491
global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7493
# Transform the output of nm in a proper C declaration
7494
global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7496
# Transform the output of nm in a C name address pair
7497
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7499
# This is the shared library runtime path variable.
7500
runpath_var=LD_RUN_PATH
7502
# This is the shared library path variable.
7503
shlibpath_var=LD_LIBRARY_PATH
7505
# Is shlibpath searched before the hard-coded library search path?
7506
shlibpath_overrides_runpath=no
7508
# How to hardcode a shared library path into an executable.
7509
hardcode_action=immediate
7511
# Whether we should hardcode library paths into libraries.
7512
hardcode_into_libs=yes
7514
# Flag to hardcode $libdir into a binary during linking.
7515
# This must work even if $libdir does not exist.
7516
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
7518
# If ld is used when linking, flag to hardcode $libdir into
7519
# a binary during linking. This must work even if $libdir does
7521
hardcode_libdir_flag_spec_ld=""
7523
# Whether we need a single -rpath flag with a separated argument.
7524
hardcode_libdir_separator=""
7526
# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7530
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7534
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7535
# the resulting binary.
7536
hardcode_shlibpath_var=unsupported
7538
# Set to yes if building a shared library automatically hardcodes DIR into the library
7539
# and all subsequent libraries and executables linked against it.
7540
hardcode_automatic=no
7542
# Variables whose values should be saved in libtool wrapper scripts and
7543
# restored at relink time.
7544
variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7546
# Whether libtool must link a program against all its dependency libraries.
7549
# Compile-time system search path for libraries
7550
sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../ /lib/i486-linux-gnu/4.1.2/ /lib/ /usr/lib/i486-linux-gnu/4.1.2/ /usr/lib/"
7552
# Run-time system search path for libraries
7553
sys_lib_dlsearch_path_spec="/lib /usr/lib "
7555
# Fix the shell variable $srcfile for the compiler.
7558
# Set to yes if exported symbols are required.
7559
always_export_symbols=no
7561
# The commands to list exported symbols.
7562
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7564
# The commands to extract the exported symbol list from a shared archive.
7565
extract_expsyms_cmds=""
7567
# Symbols that should not be listed in the preloaded symbols.
7570
# Symbols that must always be exported.
7573
# ### END LIBTOOL TAG CONFIG: CXX