3
# libtoolT - Provide generalized library-building support services.
4
# Generated automatically by (GNU cd-powermanager 1.0.0)
5
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
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 ubu-necropotame:
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~\$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.3 /usr/lib /lib"
330
# Run-time system search path for libraries
331
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/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, 2006,
357
# 2007 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.24 Debian 1.5.24-1ubuntu1"
399
TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)"
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
412
BIN_SH=xpg4; export BIN_SH # for Tru64
413
DUALCASE=1; export DUALCASE # for MKS sh
415
# Check that we have a working $echo.
416
if test "X$1" = X--no-reexec; then
417
# Discard the --no-reexec flag, and continue.
419
elif test "X$1" = X--fallback-echo; then
420
# Avoid inline document here, it may be left over
422
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
423
# Yippee, $echo works!
426
# Restart under the correct shell, and then maybe $echo will work.
427
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
430
if test "X$1" = X--fallback-echo; then
431
# used as fallback echo
440
help="Try \`$progname --help' for more information."
441
magic="%%%MAGIC variable%%%"
446
# Sed substitution that helps us do robust quoting. It backslashifies
447
# metacharacters that are still active within double-quoted strings.
448
Xsed="${SED}"' -e 1s/^X//'
449
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
450
# test EBCDIC or ASCII
451
case `echo X|tr X '\101'` in
452
A) # ASCII based system
453
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
455
NL2SP='tr \015\012 \040\040'
457
*) # EBCDIC based system
459
NL2SP='tr \r\n \100\100'
464
# Only set LANG and LC_ALL to C if already set.
465
# These must not be set unconditionally because not all systems understand
466
# e.g. LANG=C (notably SCO).
467
# We save the old values to restore during execute mode.
468
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
470
eval "if test \"\${$lt_var+set}\" = set; then
471
save_$lt_var=\$$lt_var
477
# Make sure IFS has a sensible default
482
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
483
$echo "$modename: not configured to build any kind of library" 1>&2
484
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
499
lo2o="s/\\.lo\$/.${objext}/"
500
o2lo="s/\\.${objext}\$/.lo/"
504
#####################################
505
# Shell function definitions:
506
# This seems to be the best place for them
508
# func_mktempdir [string]
509
# Make a temporary directory that won't clash with other running
510
# libtool processes, and avoids race conditions if possible. If
511
# given, STRING is the basename for that directory.
514
my_template="${TMPDIR-/tmp}/${1-$progname}"
516
if test "$run" = ":"; then
517
# Return a directory name, but don't create it in dry-run mode
518
my_tmpdir="${my_template}-$$"
521
# If mktemp works, use that first and foremost
522
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
524
if test ! -d "$my_tmpdir"; then
525
# Failing that, at least try and use $RANDOM to avoid a race
526
my_tmpdir="${my_template}-${RANDOM-0}$$"
528
save_mktempdir_umask=`umask`
531
umask $save_mktempdir_umask
534
# If we're not in dry-run mode, bomb out on failure
535
test -d "$my_tmpdir" || {
536
$echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
541
$echo "X$my_tmpdir" | $Xsed
545
# func_win32_libid arg
546
# return the library type of file 'arg'
548
# Need a lot of goo to handle *both* DLLs and import libs
549
# Has to be a shell function in order to 'eat' the argument
550
# that is supplied when $file_magic_command is called.
553
win32_libid_type="unknown"
554
win32_fileres=`file -L $1 2>/dev/null`
555
case $win32_fileres in
556
*ar\ archive\ import\ library*) # definitely import
557
win32_libid_type="x86 archive import"
559
*ar\ archive*) # could be an import, or static
560
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
561
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
562
win32_nmres=`eval $NM -f posix -A $1 | \
571
import*) win32_libid_type="x86 archive import";;
572
*) win32_libid_type="x86 archive static";;
577
win32_libid_type="x86 DLL"
579
*executable*) # but shell scripts are "executable" too...
580
case $win32_fileres in
581
*MS\ Windows\ PE\ Intel*)
582
win32_libid_type="x86 DLL"
587
$echo $win32_libid_type
592
# Infer tagged configuration to use if any are available and
593
# if one wasn't chosen via the "--tag" command line option.
594
# Only attempt this if the compiler in the base compile
595
# command doesn't match the default compiler.
596
# arg is usually of the form 'gcc ...'
599
if test -n "$available_tags" && test -z "$tagname"; then
603
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
607
CC_quoted="$CC_quoted $arg"
610
# Blanks in the command may have been stripped by the calling shell,
611
# but not from the CC environment variable when configure was run.
612
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
613
# Blanks at the start of $base_compile will cause this to fail
614
# if we don't check for them as well.
616
for z in $available_tags; do
617
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
618
# Evaluate the configuration.
619
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
622
# Double-quote args containing other shell metacharacters.
624
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
628
CC_quoted="$CC_quoted $arg"
631
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
632
# The compiler in the base compile command matches
633
# the one in the tagged configuration.
634
# Assume this is the tagged configuration we want.
641
# If $tagname still isn't set, then no tagged configuration
642
# was found and let the user know that the "--tag" command
643
# line option must be used.
644
if test -z "$tagname"; then
645
$echo "$modename: unable to infer tagged configuration"
646
$echo "$modename: specify a tag with \`--tag'" 1>&2
649
# $echo "$modename: using $tagname tagged configuration"
657
# func_extract_an_archive dir oldlib
658
func_extract_an_archive ()
660
f_ex_an_ar_dir="$1"; shift
661
f_ex_an_ar_oldlib="$1"
663
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
664
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
665
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
668
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
673
# func_extract_archives gentop oldlib ...
674
func_extract_archives ()
676
my_gentop="$1"; shift
684
$show "${rm}r $my_gentop"
685
$run ${rm}r "$my_gentop"
686
$show "$mkdir $my_gentop"
687
$run $mkdir "$my_gentop"
689
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
693
for my_xlib in $my_oldlibs; do
694
# Extract the objects.
696
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
697
*) my_xabs=`pwd`"/$my_xlib" ;;
699
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
702
case " $extracted_archives " in
704
extracted_serial=`expr $extracted_serial + 1`
705
my_xlib_u=lt$extracted_serial-$my_xlib ;;
709
extracted_archives="$extracted_archives $my_xlib_u"
710
my_xdir="$my_gentop/$my_xlib_u"
712
$show "${rm}r $my_xdir"
713
$run ${rm}r "$my_xdir"
714
$show "$mkdir $my_xdir"
715
$run $mkdir "$my_xdir"
717
if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
722
$show "Extracting $my_xabs"
723
# Do not bother doing anything if just a dry run
724
if test -z "$run"; then
725
darwin_orig_dir=`pwd`
726
cd $my_xdir || exit $?
727
darwin_archive=$my_xabs
729
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
730
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
731
if test -n "$darwin_arches"; then
732
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
734
$show "$darwin_base_archive has multiple architectures $darwin_arches"
735
for darwin_arch in $darwin_arches ; do
736
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
737
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
738
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
739
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
741
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
742
done # $darwin_arches
743
## Okay now we have a bunch of thin objects, gotta fatten them up :)
744
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
747
for darwin_file in $darwin_filelist; do
748
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
749
lipo -create -output "$darwin_file" $darwin_files
750
done # $darwin_filelist
752
cd "$darwin_orig_dir"
754
cd "$darwin_orig_dir"
755
func_extract_an_archive "$my_xdir" "$my_xabs"
760
func_extract_an_archive "$my_xdir" "$my_xabs"
763
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
765
func_extract_archives_result="$my_oldobjs"
767
# End of Shell function definitions
768
#####################################
771
eval std_shrext=\"$shrext_cmds\"
775
# Parse our command line options once, thoroughly.
776
while test "$#" -gt 0
782
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
786
# If the previous option needs an argument, assign it.
787
if test -n "$prev"; then
790
execute_dlfiles="$execute_dlfiles $arg"
794
preserve_args="${preserve_args}=$arg"
796
# Check whether tagname contains only valid characters
799
$echo "$progname: invalid tag name: $tagname" 1>&2
806
# Don't test for the "default" C tag, as we know, it's there, but
807
# not specially marked.
810
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
811
taglist="$taglist $tagname"
812
# Evaluate the configuration.
813
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
815
$echo "$progname: ignoring unknown tag $tagname" 1>&2
830
# Have we seen a non-optional argument yet?
838
$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
840
Copyright (C) 2007 Free Software Foundation, Inc.
841
This is free software; see the source for copying conditions. There is NO
842
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
847
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
848
# Now print the configurations for the tags.
849
for tagname in $taglist; do
850
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
856
$echo "$progname: enabling shell trace mode"
858
preserve_args="$preserve_args $arg"
867
if test "$build_libtool_libs" = yes; then
868
$echo "enable shared libraries"
870
$echo "disable shared libraries"
872
if test "$build_old_libs" = yes; then
873
$echo "enable static libraries"
875
$echo "disable static libraries"
880
--finish) mode="finish" ;;
882
--mode) prevopt="--mode" prev=mode ;;
883
--mode=*) mode="$optarg" ;;
885
--preserve-dup-deps) duplicate_deps="yes" ;;
889
preserve_args="$preserve_args $arg"
895
preserve_args="$preserve_args --tag"
898
set tag "$optarg" ${1+"$@"}
901
preserve_args="$preserve_args --tag"
910
$echo "$modename: unrecognized option \`$arg'" 1>&2
922
if test -n "$prevopt"; then
923
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
928
case $disable_libs in
932
build_libtool_libs=no
936
build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
940
# If this variable is set in any of the actions, the command in it
941
# will be execed at the end. This prevents here-documents from being
942
# left over by shells.
945
if test -z "$show_help"; then
947
# Infer the operation mode.
948
if test -z "$mode"; then
949
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
950
$echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
952
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
964
*db | *dbx | *strace | *truss)
974
# If we have no mode, but dlfiles were specified, then do execute mode.
975
test -n "$execute_dlfiles" && mode=execute
977
# Just use the default operation mode.
978
if test -z "$mode"; then
979
if test -n "$nonopt"; then
980
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
982
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
989
# Only execute mode is allowed to have -dlopen flags.
990
if test -n "$execute_dlfiles" && test "$mode" != execute; then
991
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
996
# Change the help message to a mode-specific one.
998
help="Try \`$modename --help --mode=$mode' for more information."
1000
# These modes are in order of execution frequency so that they run quickly.
1002
# libtool compile mode
1004
modename="$modename: compile"
1005
# Get the compilation command and the source file.
1007
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1018
# do not "continue". Instead, add this to base_compile
1030
# Accept any command-line options.
1033
if test -n "$libobj" ; then
1034
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
1041
-static | -prefer-pic | -prefer-non-pic)
1052
arg_mode=arg # the next one goes into the "base_compile" arg list
1053
continue # The current "srcfile" will either be retained or
1054
;; # replaced later. I would guess that would be a bug.
1057
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1059
save_ifs="$IFS"; IFS=','
1060
for arg in $args; do
1063
# Double-quote args containing other shell metacharacters.
1064
# Many Bourne shells cannot handle close brackets correctly
1065
# in scan sets, so we specify it separately.
1067
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1071
lastarg="$lastarg $arg"
1074
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1076
# Add the arguments to base_compile.
1077
base_compile="$base_compile $lastarg"
1082
# Accept the current argument as the source file.
1083
# The previous "srcfile" becomes the current argument.
1090
esac # case $arg_mode
1092
# Aesthetically quote the previous argument.
1093
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1096
# Double-quote args containing other shell metacharacters.
1097
# Many Bourne shells cannot handle close brackets correctly
1098
# in scan sets, and some SunOS ksh mistreat backslash-escaping
1099
# in scan sets (worked around with variable expansion),
1100
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
1101
# at all, so we specify them separately.
1102
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1103
lastarg="\"$lastarg\""
1107
base_compile="$base_compile $lastarg"
1112
$echo "$modename: you must specify an argument for -Xcompile"
1116
$echo "$modename: you must specify a target with \`-o'" 1>&2
1120
# Get the name of the library object.
1121
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1125
# Recognize several different file suffixes.
1126
# If the user specifies -o file.o, it is replaced with file.lo
1136
*.class) xform=class ;;
1139
*.[fF][09]?) xform=[fF][09]. ;;
1141
*.java) xform=java ;;
1145
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1148
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1150
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1155
func_infer_tag $base_compile
1157
for arg in $later; do
1176
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1178
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1179
qlibobj="\"$qlibobj\"" ;;
1181
test "X$libobj" != "X$qlibobj" \
1182
&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1183
&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1184
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1185
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1186
if test "X$xdir" = "X$obj"; then
1191
lobj=${xdir}$objdir/$objname
1193
if test -z "$base_compile"; then
1194
$echo "$modename: you must specify a compilation command" 1>&2
1199
# Delete any leftover library objects.
1200
if test "$build_old_libs" = yes; then
1201
removelist="$obj $lobj $libobj ${libobj}T"
1203
removelist="$lobj $libobj ${libobj}T"
1206
$run $rm $removelist
1207
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1209
# On Cygwin there's no "real" PIC flag so we must build both object types
1211
cygwin* | mingw* | pw32* | os2*)
1215
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1216
# non-PIC code in shared libraries is not supported
1220
# Calculate the filename of the output object if compiler does
1221
# not support -o with -c
1222
if test "$compiler_c_o" = no; then
1223
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1224
lockfile="$output_obj.lock"
1225
removelist="$removelist $output_obj $lockfile"
1226
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1233
# Lock this critical section if it is needed
1234
# We use this script file to make the link, it avoids creating a new file
1235
if test "$need_locks" = yes; then
1236
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1237
$show "Waiting for $lockfile to be removed"
1240
elif test "$need_locks" = warn; then
1241
if test -f "$lockfile"; then
1243
*** ERROR, $lockfile exists and contains:
1244
`cat $lockfile 2>/dev/null`
1246
This indicates that another process is trying to use the same
1247
temporary object file, and libtool could not work around it because
1248
your compiler does not support \`-c' and \`-o' together. If you
1249
repeat this compilation, it may succeed, by chance, but you had better
1250
avoid parallel builds (make -j) in this platform, or get a better
1253
$run $rm $removelist
1256
$echo "$srcfile" > "$lockfile"
1259
if test -n "$fix_srcfile_path"; then
1260
eval srcfile=\"$fix_srcfile_path\"
1262
qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1264
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1265
qsrcfile="\"$qsrcfile\"" ;;
1268
$run $rm "$libobj" "${libobj}T"
1270
# Create a libtool object file (analogous to a ".la" file),
1271
# but don't create it if we're doing a dry run.
1272
test -z "$run" && cat > ${libobj}T <<EOF
1273
# $libobj - a libtool object file
1274
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1276
# Please DO NOT delete this file!
1277
# It is necessary for linking the library.
1279
# Name of the PIC object.
1282
# Only build a PIC object if we are building libtool libraries.
1283
if test "$build_libtool_libs" = yes; then
1284
# Without this assignment, base_compile gets emptied.
1285
fbsd_hideous_sh_bug=$base_compile
1287
if test "$pic_mode" != no; then
1288
command="$base_compile $qsrcfile $pic_flag"
1290
# Don't build PIC code
1291
command="$base_compile $qsrcfile"
1294
if test ! -d "${xdir}$objdir"; then
1295
$show "$mkdir ${xdir}$objdir"
1296
$run $mkdir ${xdir}$objdir
1298
if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1303
if test -z "$output_obj"; then
1304
# Place PIC objects in $objdir
1305
command="$command -o $lobj"
1308
$run $rm "$lobj" "$output_obj"
1311
if $run eval "$command"; then :
1313
test -n "$output_obj" && $run $rm $removelist
1317
if test "$need_locks" = warn &&
1318
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1320
*** ERROR, $lockfile contains:
1321
`cat $lockfile 2>/dev/null`
1323
but it should contain:
1326
This indicates that another process is trying to use the same
1327
temporary object file, and libtool could not work around it because
1328
your compiler does not support \`-c' and \`-o' together. If you
1329
repeat this compilation, it may succeed, by chance, but you had better
1330
avoid parallel builds (make -j) in this platform, or get a better
1333
$run $rm $removelist
1337
# Just move the object if needed, then go on to compile the next one
1338
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1339
$show "$mv $output_obj $lobj"
1340
if $run $mv $output_obj $lobj; then :
1343
$run $rm $removelist
1348
# Append the name of the PIC object to the libtool object file.
1349
test -z "$run" && cat >> ${libobj}T <<EOF
1350
pic_object='$objdir/$objname'
1354
# Allow error messages only from the first compilation.
1355
if test "$suppress_opt" = yes; then
1356
suppress_output=' >/dev/null 2>&1'
1359
# No PIC object so indicate it doesn't exist in the libtool
1361
test -z "$run" && cat >> ${libobj}T <<EOF
1367
# Only build a position-dependent object if we build old libraries.
1368
if test "$build_old_libs" = yes; then
1369
if test "$pic_mode" != yes; then
1370
# Don't build PIC code
1371
command="$base_compile $qsrcfile"
1373
command="$base_compile $qsrcfile $pic_flag"
1375
if test "$compiler_c_o" = yes; then
1376
command="$command -o $obj"
1379
# Suppress compiler output if we already did a PIC compilation.
1380
command="$command$suppress_output"
1381
$run $rm "$obj" "$output_obj"
1383
if $run eval "$command"; then :
1385
$run $rm $removelist
1389
if test "$need_locks" = warn &&
1390
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1392
*** ERROR, $lockfile contains:
1393
`cat $lockfile 2>/dev/null`
1395
but it should contain:
1398
This indicates that another process is trying to use the same
1399
temporary object file, and libtool could not work around it because
1400
your compiler does not support \`-c' and \`-o' together. If you
1401
repeat this compilation, it may succeed, by chance, but you had better
1402
avoid parallel builds (make -j) in this platform, or get a better
1405
$run $rm $removelist
1409
# Just move the object if needed
1410
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1411
$show "$mv $output_obj $obj"
1412
if $run $mv $output_obj $obj; then :
1415
$run $rm $removelist
1420
# Append the name of the non-PIC object the libtool object file.
1421
# Only append if the libtool object file exists.
1422
test -z "$run" && cat >> ${libobj}T <<EOF
1423
# Name of the non-PIC object.
1424
non_pic_object='$objname'
1428
# Append the name of the non-PIC object the libtool object file.
1429
# Only append if the libtool object file exists.
1430
test -z "$run" && cat >> ${libobj}T <<EOF
1431
# Name of the non-PIC object.
1437
$run $mv "${libobj}T" "${libobj}"
1439
# Unlock the critical section if it was locked
1440
if test "$need_locks" != no; then
1441
$run $rm "$lockfile"
1449
modename="$modename: link"
1451
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1452
# It is impossible to link a dll without this setting, and
1453
# we shouldn't force the makefile maintainer to figure out
1454
# which system we are compiling for in order to pass an extra
1455
# flag for every libtool invocation.
1456
# allow_undefined=no
1458
# FIXME: Unfortunately, there are problems with the above when trying
1459
# to make a dll which has undefined symbols, in which case not
1460
# even a static library is built. For now, we need to specify
1461
# -no-undefined on the libtool link line when we can be certain
1462
# that all symbols are satisfied, otherwise we get a static library.
1469
libtool_args="$nonopt"
1470
base_compile="$nonopt $@"
1471
compile_command="$nonopt"
1472
finalize_command="$nonopt"
1485
lib_search_path=`pwd`
1494
export_symbols_regex=
1502
notinst_path= # paths that contain not-installed libtool libraries
1503
precious_files_regex=
1504
prefer_static_libs=no
1517
func_infer_tag $base_compile
1519
# We need to know -static, to get the right output filenames.
1523
-all-static | -static | -static-libtool-libs)
1526
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1527
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1529
if test -n "$link_static_flag"; then
1530
dlopen_self=$dlopen_self_static
1532
prefer_static_libs=yes
1535
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1536
dlopen_self=$dlopen_self_static
1538
prefer_static_libs=built
1540
-static-libtool-libs)
1541
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1542
dlopen_self=$dlopen_self_static
1544
prefer_static_libs=yes
1547
build_libtool_libs=no
1554
# See if our shared archives depend on static archives.
1555
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1557
# Go through the arguments, transforming them on the way.
1558
while test "$#" -gt 0; do
1562
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1563
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1567
libtool_args="$libtool_args $qarg"
1569
# If the previous option needs an argument, assign it.
1570
if test -n "$prev"; then
1573
compile_command="$compile_command @OUTPUT@"
1574
finalize_command="$finalize_command @OUTPUT@"
1580
if test "$preload" = no; then
1581
# Add the symbol object into the linking commands.
1582
compile_command="$compile_command @SYMFILE@"
1583
finalize_command="$finalize_command @SYMFILE@"
1587
*.la | *.lo) ;; # We handle these cases below.
1589
if test "$dlself" = no; then
1597
if test "$prev" = dlprefiles; then
1599
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1609
if test "$prev" = dlfiles; then
1610
dlfiles="$dlfiles $arg"
1612
dlprefiles="$dlprefiles $arg"
1620
export_symbols="$arg"
1621
if test ! -f "$arg"; then
1622
$echo "$modename: symbol file \`$arg' does not exist"
1629
export_symbols_regex="$arg"
1634
inst_prefix_dir="$arg"
1639
precious_files_regex="$arg"
1649
if test -f "$arg"; then
1652
for fil in `cat $save_arg`
1654
# moreargs="$moreargs $fil"
1656
# A libtool-controlled object.
1658
# Check to see that this really is a libtool object.
1659
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1664
# If there is no directory component, then add one.
1666
*/* | *\\*) . $arg ;;
1670
if test -z "$pic_object" || \
1671
test -z "$non_pic_object" ||
1672
test "$pic_object" = none && \
1673
test "$non_pic_object" = none; then
1674
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1678
# Extract subdirectory from the argument.
1679
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1680
if test "X$xdir" = "X$arg"; then
1686
if test "$pic_object" != none; then
1687
# Prepend the subdirectory the object is found in.
1688
pic_object="$xdir$pic_object"
1690
if test "$prev" = dlfiles; then
1691
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1692
dlfiles="$dlfiles $pic_object"
1696
# If libtool objects are unsupported, then we need to preload.
1701
# CHECK ME: I think I busted this. -Ossama
1702
if test "$prev" = dlprefiles; then
1703
# Preload the old-style object.
1704
dlprefiles="$dlprefiles $pic_object"
1709
libobjs="$libobjs $pic_object"
1714
if test "$non_pic_object" != none; then
1715
# Prepend the subdirectory the object is found in.
1716
non_pic_object="$xdir$non_pic_object"
1718
# A standard non-PIC object
1719
non_pic_objects="$non_pic_objects $non_pic_object"
1720
if test -z "$pic_object" || test "$pic_object" = none ; then
1721
arg="$non_pic_object"
1724
# If the PIC object exists, use it instead.
1725
# $xdir was prepended to $pic_object above.
1726
non_pic_object="$pic_object"
1727
non_pic_objects="$non_pic_objects $non_pic_object"
1730
# Only an error if not doing a dry-run.
1731
if test -z "$run"; then
1732
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1737
# Extract subdirectory from the argument.
1738
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1739
if test "X$xdir" = "X$arg"; then
1745
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1746
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1747
libobjs="$libobjs $pic_object"
1748
non_pic_objects="$non_pic_objects $non_pic_object"
1753
$echo "$modename: link input file \`$save_arg' does not exist"
1761
# We need an absolute path.
1763
[\\/]* | [A-Za-z]:[\\/]*) ;;
1765
$echo "$modename: only absolute run-paths are allowed" 1>&2
1769
if test "$prev" = rpath; then
1772
*) rpath="$rpath $arg" ;;
1777
*) xrpath="$xrpath $arg" ;;
1784
compiler_flags="$compiler_flags $qarg"
1786
compile_command="$compile_command $qarg"
1787
finalize_command="$finalize_command $qarg"
1791
linker_flags="$linker_flags $qarg"
1792
compiler_flags="$compiler_flags $wl$qarg"
1794
compile_command="$compile_command $wl$qarg"
1795
finalize_command="$finalize_command $wl$qarg"
1799
linker_flags="$linker_flags $qarg"
1800
compiler_flags="$compiler_flags $qarg"
1802
compile_command="$compile_command $qarg"
1803
finalize_command="$finalize_command $qarg"
1811
darwin_framework|darwin_framework_skip)
1812
test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1813
compile_command="$compile_command $arg"
1814
finalize_command="$finalize_command $arg"
1819
eval "$prev=\"\$arg\""
1824
fi # test -n "$prev"
1830
if test -n "$link_static_flag"; then
1831
compile_command="$compile_command $link_static_flag"
1832
finalize_command="$finalize_command $link_static_flag"
1838
# FIXME: remove this flag sometime in the future.
1839
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1863
-export-symbols | -export-symbols-regex)
1864
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1865
$echo "$modename: more than one -exported-symbols argument is not allowed"
1868
if test "X$arg" = "X-export-symbols"; then
1876
-framework|-arch|-isysroot)
1878
*" ${arg} ${1} "* | *" ${arg} ${1} "*)
1879
prev=darwin_framework_skip ;;
1880
*) compiler_flags="$compiler_flags $arg"
1881
prev=darwin_framework ;;
1883
compile_command="$compile_command $arg"
1884
finalize_command="$finalize_command $arg"
1893
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1894
# so, if we see these flags be careful not to treat them like -L
1896
case $with_gcc/$host in
1897
no/*-*-irix* | /*-*-irix*)
1898
compile_command="$compile_command $arg"
1899
finalize_command="$finalize_command $arg"
1906
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1907
# We need an absolute path.
1909
[\\/]* | [A-Za-z]:[\\/]*) ;;
1911
absdir=`cd "$dir" && pwd`
1912
if test -z "$absdir"; then
1913
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1915
notinst_path="$notinst_path $dir"
1923
deplibs="$deplibs -L$dir"
1924
lib_search_path="$lib_search_path $dir"
1928
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1929
testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1930
case :$dllsearchpath: in
1932
*) dllsearchpath="$dllsearchpath:$dir";;
1934
case :$dllsearchpath: in
1935
*":$testbindir:"*) ;;
1936
*) dllsearchpath="$dllsearchpath:$testbindir";;
1944
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1946
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1947
# These systems don't actually have a C or math library (as such)
1951
# These systems don't actually have a C library (as such)
1952
test "X$arg" = "X-lc" && continue
1954
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1955
# Do not include libc due to us having libc/libc_r.
1956
test "X$arg" = "X-lc" && continue
1958
*-*-rhapsody* | *-*-darwin1.[012])
1959
# Rhapsody C and math libraries are in the System framework
1960
deplibs="$deplibs -framework System"
1963
*-*-sco3.2v5* | *-*-sco5v6*)
1964
# Causes problems with __ctype
1965
test "X$arg" = "X-lc" && continue
1967
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1968
# Compiler inserts libc in the correct place for threads to work
1969
test "X$arg" = "X-lc" && continue
1972
elif test "X$arg" = "X-lc_r"; then
1974
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1975
# Do not include libc_r directly, use -pthread flag.
1980
deplibs="$deplibs $arg"
1984
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1985
# classes, name mangling, and exception handling.
1987
compile_command="$compile_command $arg"
1988
compiler_flags="$compiler_flags $arg"
1989
finalize_command="$finalize_command $arg"
1994
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
1995
compiler_flags="$compiler_flags $arg"
1996
compile_command="$compile_command $arg"
1997
finalize_command="$finalize_command $arg"
2006
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2007
# -r[0-9][0-9]* specifies the processor on the SGI compiler
2008
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2009
# +DA*, +DD* enable 64-bit mode on the HP compiler
2010
# -q* pass through compiler args for the IBM compiler
2011
# -m* pass through architecture-specific compiler args for GCC
2012
# -m*, -t[45]*, -txscale* pass through architecture-specific
2013
# compiler args for GCC
2014
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
2015
# -F/path gives path to uninstalled frameworks, gcc on darwin
2016
# @file GCC response files
2017
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
2018
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
2020
# Unknown arguments in both finalize_command and compile_command need
2021
# to be aesthetically quoted because they are evaled later.
2022
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2024
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2028
compile_command="$compile_command $arg"
2029
finalize_command="$finalize_command $arg"
2030
compiler_flags="$compiler_flags $arg"
2046
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
2047
# The PATH hackery in wrapper scripts is required on Windows
2048
# and Darwin in order for the loader to find any dlls it needs.
2049
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2050
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2053
*) no_install=yes ;;
2070
-precious-files-regex)
2091
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2092
# We need an absolute path.
2094
[\\/]* | [A-Za-z]:[\\/]*) ;;
2096
$echo "$modename: only absolute run-paths are allowed" 1>&2
2102
*) xrpath="$xrpath $dir" ;;
2107
-static | -static-libtool-libs)
2108
# The effects of -static are defined in a previous loop.
2109
# We used to do the same as -all-static on platforms that
2110
# didn't have a PIC flag, but the assumption that the effects
2111
# would be equivalent was wrong. It would break on at least
2112
# Digital Unix and AIX.
2132
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2134
save_ifs="$IFS"; IFS=','
2135
for flag in $args; do
2138
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2143
compiler_flags="$compiler_flags $flag"
2146
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2150
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2152
save_ifs="$IFS"; IFS=','
2153
for flag in $args; do
2156
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2161
compiler_flags="$compiler_flags $wl$flag"
2162
linker_flags="$linker_flags $flag"
2165
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2183
# Some other compiler flag.
2185
# Unknown arguments in both finalize_command and compile_command need
2186
# to be aesthetically quoted because they are evaled later.
2187
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2189
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2196
# A standard object.
2201
# A libtool-controlled object.
2203
# Check to see that this really is a libtool object.
2204
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2209
# If there is no directory component, then add one.
2211
*/* | *\\*) . $arg ;;
2215
if test -z "$pic_object" || \
2216
test -z "$non_pic_object" ||
2217
test "$pic_object" = none && \
2218
test "$non_pic_object" = none; then
2219
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
2223
# Extract subdirectory from the argument.
2224
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2225
if test "X$xdir" = "X$arg"; then
2231
if test "$pic_object" != none; then
2232
# Prepend the subdirectory the object is found in.
2233
pic_object="$xdir$pic_object"
2235
if test "$prev" = dlfiles; then
2236
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2237
dlfiles="$dlfiles $pic_object"
2241
# If libtool objects are unsupported, then we need to preload.
2246
# CHECK ME: I think I busted this. -Ossama
2247
if test "$prev" = dlprefiles; then
2248
# Preload the old-style object.
2249
dlprefiles="$dlprefiles $pic_object"
2254
libobjs="$libobjs $pic_object"
2259
if test "$non_pic_object" != none; then
2260
# Prepend the subdirectory the object is found in.
2261
non_pic_object="$xdir$non_pic_object"
2263
# A standard non-PIC object
2264
non_pic_objects="$non_pic_objects $non_pic_object"
2265
if test -z "$pic_object" || test "$pic_object" = none ; then
2266
arg="$non_pic_object"
2269
# If the PIC object exists, use it instead.
2270
# $xdir was prepended to $pic_object above.
2271
non_pic_object="$pic_object"
2272
non_pic_objects="$non_pic_objects $non_pic_object"
2275
# Only an error if not doing a dry-run.
2276
if test -z "$run"; then
2277
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2282
# Extract subdirectory from the argument.
2283
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2284
if test "X$xdir" = "X$arg"; then
2290
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2291
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2292
libobjs="$libobjs $pic_object"
2293
non_pic_objects="$non_pic_objects $non_pic_object"
2300
deplibs="$deplibs $arg"
2301
old_deplibs="$old_deplibs $arg"
2306
# A libtool-controlled library.
2308
if test "$prev" = dlfiles; then
2309
# This library was specified with -dlopen.
2310
dlfiles="$dlfiles $arg"
2312
elif test "$prev" = dlprefiles; then
2313
# The library was specified with -dlpreopen.
2314
dlprefiles="$dlprefiles $arg"
2317
deplibs="$deplibs $arg"
2322
# Some other compiler argument.
2324
# Unknown arguments in both finalize_command and compile_command need
2325
# to be aesthetically quoted because they are evaled later.
2326
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2328
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2335
# Now actually substitute the argument into the commands.
2336
if test -n "$arg"; then
2337
compile_command="$compile_command $arg"
2338
finalize_command="$finalize_command $arg"
2340
done # argument parsing loop
2342
if test -n "$prev"; then
2343
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2348
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2349
eval arg=\"$export_dynamic_flag_spec\"
2350
compile_command="$compile_command $arg"
2351
finalize_command="$finalize_command $arg"
2355
# calculate the name of the file, without its directory
2356
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2357
libobjs_save="$libobjs"
2359
if test -n "$shlibpath_var"; then
2360
# get the directories listed in $shlibpath_var
2361
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2365
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2366
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2368
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2369
if test "X$output_objdir" = "X$output"; then
2370
output_objdir="$objdir"
2372
output_objdir="$output_objdir/$objdir"
2374
# Create the object directory.
2375
if test ! -d "$output_objdir"; then
2376
$show "$mkdir $output_objdir"
2377
$run $mkdir $output_objdir
2379
if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2384
# Determine the type of output
2387
$echo "$modename: you must specify an output file" 1>&2
2391
*.$libext) linkmode=oldlib ;;
2392
*.lo | *.$objext) linkmode=obj ;;
2393
*.la) linkmode=lib ;;
2394
*) linkmode=prog ;; # Anything else should be a program.
2398
*cygwin* | *mingw* | *pw32*)
2399
# don't eliminate duplications in $postdeps and $predeps
2400
duplicate_compiler_generated_deps=yes
2403
duplicate_compiler_generated_deps=$duplicate_deps
2409
# Find all interdependent deplibs by searching for libraries
2410
# that are linked more than once (e.g. -la -lb -la)
2411
for deplib in $deplibs; do
2412
if test "X$duplicate_deps" = "Xyes" ; then
2414
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2417
libs="$libs $deplib"
2420
if test "$linkmode" = lib; then
2421
libs="$predeps $libs $compiler_lib_search_path $postdeps"
2423
# Compute libraries that are listed more than once in $predeps
2424
# $postdeps and mark them as special (i.e., whose duplicates are
2425
# not to be eliminated).
2427
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2428
for pre_post_dep in $predeps $postdeps; do
2429
case "$pre_post_deps " in
2430
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2432
pre_post_deps="$pre_post_deps $pre_post_dep"
2441
need_relink=no # whether we're linking any uninstalled libtool libraries
2442
notinst_deplibs= # not-installed libtool libraries
2446
for file in $dlfiles $dlprefiles; do
2450
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2462
passes="conv scan dlopen dlpreopen link"
2467
for pass in $passes; do
2468
if test "$linkmode,$pass" = "lib,link" ||
2469
test "$linkmode,$pass" = "prog,scan"; then
2473
if test "$linkmode" = prog; then
2475
dlopen) libs="$dlfiles" ;;
2476
dlpreopen) libs="$dlprefiles" ;;
2478
libs="$deplibs %DEPLIBS%"
2479
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2483
if test "$pass" = dlopen; then
2484
# Collect dlpreopened libraries
2485
save_deplibs="$deplibs"
2488
for deplib in $libs; do
2492
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2493
if test "$linkmode,$pass" = "prog,link"; then
2494
compile_deplibs="$deplib $compile_deplibs"
2495
finalize_deplibs="$deplib $finalize_deplibs"
2497
compiler_flags="$compiler_flags $deplib"
2502
if test "$linkmode" != lib && test "$linkmode" != prog; then
2503
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2506
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2507
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2508
for search_ext in .la $std_shrext .so .a; do
2509
# Search the libtool library
2510
lib="$searchdir/lib${name}${search_ext}"
2511
if test -f "$lib"; then
2512
if test "$search_ext" = ".la"; then
2521
if test "$found" != yes; then
2522
# deplib doesn't seem to be a libtool library
2523
if test "$linkmode,$pass" = "prog,link"; then
2524
compile_deplibs="$deplib $compile_deplibs"
2525
finalize_deplibs="$deplib $finalize_deplibs"
2527
deplibs="$deplib $deplibs"
2528
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2531
else # deplib is a libtool library
2532
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2533
# We need to do some special things here, and not later.
2534
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2535
case " $predeps $postdeps " in
2537
if (${SED} -e '2q' $lib |
2538
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2542
*/* | *\\*) . $lib ;;
2545
for l in $old_library $library_names; do
2548
if test "X$ll" = "X$old_library" ; then # only static version available
2550
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2551
test "X$ladir" = "X$lib" && ladir="."
2552
lib=$ladir/$old_library
2553
if test "$linkmode,$pass" = "prog,link"; then
2554
compile_deplibs="$deplib $compile_deplibs"
2555
finalize_deplibs="$deplib $finalize_deplibs"
2557
deplibs="$deplib $deplibs"
2558
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2572
deplibs="$deplib $deplibs"
2573
test "$pass" = conv && continue
2574
newdependency_libs="$deplib $newdependency_libs"
2575
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2578
if test "$pass" = conv; then
2579
deplibs="$deplib $deplibs"
2582
if test "$pass" = scan; then
2583
deplibs="$deplib $deplibs"
2585
compile_deplibs="$deplib $compile_deplibs"
2586
finalize_deplibs="$deplib $finalize_deplibs"
2588
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2591
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2597
if test "$pass" = link; then
2598
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2599
# Make sure the xrpath contains only unique directories.
2602
*) xrpath="$xrpath $dir" ;;
2605
deplibs="$deplib $deplibs"
2608
*.la) lib="$deplib" ;;
2610
if test "$pass" = conv; then
2611
deplibs="$deplib $deplibs"
2617
case $deplibs_check_method in
2619
set dummy $deplibs_check_method
2620
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2621
if eval $echo \"$deplib\" 2>/dev/null \
2623
| $EGREP "$match_pattern_regex" > /dev/null; then
2631
if test "$valid_a_lib" != yes; then
2633
$echo "*** Warning: Trying to link with static lib archive $deplib."
2634
$echo "*** I have the capability to make that library automatically link in when"
2635
$echo "*** you link to this library. But I can only do this if you have a"
2636
$echo "*** shared version of the library, which you do not appear to have"
2637
$echo "*** because the file extensions .$libext of this argument makes me believe"
2638
$echo "*** that it is just a static archive that I should not used here."
2641
$echo "*** Warning: Linking the shared library $output against the"
2642
$echo "*** static library $deplib is not portable!"
2643
deplibs="$deplib $deplibs"
2648
if test "$pass" != link; then
2649
deplibs="$deplib $deplibs"
2651
compile_deplibs="$deplib $compile_deplibs"
2652
finalize_deplibs="$deplib $finalize_deplibs"
2659
if test "$pass" = conv; then
2660
deplibs="$deplib $deplibs"
2661
elif test "$linkmode" = prog; then
2662
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2663
# If there is no dlopen support or we're linking statically,
2664
# we need to preload.
2665
newdlprefiles="$newdlprefiles $deplib"
2666
compile_deplibs="$deplib $compile_deplibs"
2667
finalize_deplibs="$deplib $finalize_deplibs"
2669
newdlfiles="$newdlfiles $deplib"
2679
if test "$found" = yes || test -f "$lib"; then :
2681
$echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2685
# Check to see that this really is a libtool archive.
2686
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2688
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2692
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2693
test "X$ladir" = "X$lib" && ladir="."
2701
# If the library was installed with an old release of libtool,
2702
# it will not redefine variables installed, or shouldnotlink
2710
*/* | *\\*) . $lib ;;
2714
if test "$linkmode,$pass" = "lib,link" ||
2715
test "$linkmode,$pass" = "prog,scan" ||
2716
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
2717
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2718
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2721
if test "$pass" = conv; then
2722
# Only check for convenience libraries
2723
deplibs="$lib $deplibs"
2724
if test -z "$libdir"; then
2725
if test -z "$old_library"; then
2726
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2729
# It is a libtool convenience library, so add in its objects.
2730
convenience="$convenience $ladir/$objdir/$old_library"
2731
old_convenience="$old_convenience $ladir/$objdir/$old_library"
2733
for deplib in $dependency_libs; do
2734
deplibs="$deplib $deplibs"
2735
if test "X$duplicate_deps" = "Xyes" ; then
2736
case "$tmp_libs " in
2737
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2740
tmp_libs="$tmp_libs $deplib"
2742
elif test "$linkmode" != prog && test "$linkmode" != lib; then
2743
$echo "$modename: \`$lib' is not a convenience library" 1>&2
2750
# Get the name of the library we link against.
2752
for l in $old_library $library_names; do
2755
if test -z "$linklib"; then
2756
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2760
# This library was specified with -dlopen.
2761
if test "$pass" = dlopen; then
2762
if test -z "$libdir"; then
2763
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2766
if test -z "$dlname" ||
2767
test "$dlopen_support" != yes ||
2768
test "$build_libtool_libs" = no; then
2769
# If there is no dlname, no dlopen support or we're linking
2770
# statically, we need to preload. We also need to preload any
2771
# dependent libraries so libltdl's deplib preloader doesn't
2772
# bomb out in the load deplibs phase.
2773
dlprefiles="$dlprefiles $lib $dependency_libs"
2775
newdlfiles="$newdlfiles $lib"
2780
# We need an absolute path.
2782
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2784
abs_ladir=`cd "$ladir" && pwd`
2785
if test -z "$abs_ladir"; then
2786
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2787
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2792
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2794
# Find the relevant object directory and library name.
2795
if test "X$installed" = Xyes; then
2796
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2797
$echo "$modename: warning: library \`$lib' was moved." 1>&2
2805
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2807
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2810
# Remove this search path later
2811
notinst_path="$notinst_path $abs_ladir"
2813
dir="$ladir/$objdir"
2814
absdir="$abs_ladir/$objdir"
2815
# Remove this search path later
2816
notinst_path="$notinst_path $abs_ladir"
2818
fi # $installed = yes
2819
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2821
# This library was specified with -dlpreopen.
2822
if test "$pass" = dlpreopen; then
2823
if test -z "$libdir"; then
2824
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2827
# Prefer using a static library (so that no silly _DYNAMIC symbols
2828
# are required to link).
2829
if test -n "$old_library"; then
2830
newdlprefiles="$newdlprefiles $dir/$old_library"
2831
# Otherwise, use the dlname, so that lt_dlopen finds it.
2832
elif test -n "$dlname"; then
2833
newdlprefiles="$newdlprefiles $dir/$dlname"
2835
newdlprefiles="$newdlprefiles $dir/$linklib"
2837
fi # $pass = dlpreopen
2839
if test -z "$libdir"; then
2840
# Link the convenience library
2841
if test "$linkmode" = lib; then
2842
deplibs="$dir/$old_library $deplibs"
2843
elif test "$linkmode,$pass" = "prog,link"; then
2844
compile_deplibs="$dir/$old_library $compile_deplibs"
2845
finalize_deplibs="$dir/$old_library $finalize_deplibs"
2847
deplibs="$lib $deplibs" # used for prog,scan pass
2853
if test "$linkmode" = prog && test "$pass" != link; then
2854
newlib_search_path="$newlib_search_path $ladir"
2855
deplibs="$lib $deplibs"
2858
if test "$link_all_deplibs" != no || test -z "$library_names" ||
2859
test "$build_libtool_libs" = no; then
2864
for deplib in $dependency_libs; do
2866
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2868
# Need to link against all dependency_libs?
2869
if test "$linkalldeplibs" = yes; then
2870
deplibs="$deplib $deplibs"
2872
# Need to hardcode shared library paths
2873
# or/and link against static libraries
2874
newdependency_libs="$deplib $newdependency_libs"
2876
if test "X$duplicate_deps" = "Xyes" ; then
2877
case "$tmp_libs " in
2878
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2881
tmp_libs="$tmp_libs $deplib"
2884
fi # $linkmode = prog...
2886
if test "$linkmode,$pass" = "prog,link"; then
2887
if test -n "$library_names" &&
2888
{ { test "$prefer_static_libs" = no ||
2889
test "$prefer_static_libs,$installed" = "built,yes"; } ||
2890
test -z "$old_library"; }; then
2891
# We need to hardcode the library path
2892
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2893
# Make sure the rpath contains only unique directories.
2894
case "$temp_rpath " in
2897
*) temp_rpath="$temp_rpath $absdir" ;;
2901
# Hardcode the library path.
2902
# Skip directories that are in the system default run-time
2904
case " $sys_lib_dlsearch_path " in
2907
case "$compile_rpath " in
2909
*) compile_rpath="$compile_rpath $absdir"
2913
case " $sys_lib_dlsearch_path " in
2916
case "$finalize_rpath " in
2918
*) finalize_rpath="$finalize_rpath $libdir"
2922
fi # $linkmode,$pass = prog,link...
2924
if test "$alldeplibs" = yes &&
2925
{ test "$deplibs_check_method" = pass_all ||
2926
{ test "$build_libtool_libs" = yes &&
2927
test -n "$library_names"; }; }; then
2928
# We only need to search for static libraries
2933
link_static=no # Whether the deplib will be linked statically
2934
use_static_libs=$prefer_static_libs
2935
if test "$use_static_libs" = built && test "$installed" = yes ; then
2938
if test -n "$library_names" &&
2939
{ test "$use_static_libs" = no || test -z "$old_library"; }; then
2940
if test "$installed" = no; then
2941
notinst_deplibs="$notinst_deplibs $lib"
2944
# This is a shared library
2946
# Warn about portability, can't link against -module's on
2947
# some systems (darwin)
2948
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2950
if test "$linkmode" = prog; then
2951
$echo "*** Warning: Linking the executable $output against the loadable module"
2953
$echo "*** Warning: Linking the shared library $output against the loadable module"
2955
$echo "*** $linklib is not portable!"
2957
if test "$linkmode" = lib &&
2958
test "$hardcode_into_libs" = yes; then
2959
# Hardcode the library path.
2960
# Skip directories that are in the system default run-time
2962
case " $sys_lib_dlsearch_path " in
2965
case "$compile_rpath " in
2967
*) compile_rpath="$compile_rpath $absdir"
2971
case " $sys_lib_dlsearch_path " in
2974
case "$finalize_rpath " in
2976
*) finalize_rpath="$finalize_rpath $libdir"
2982
if test -n "$old_archive_from_expsyms_cmds"; then
2983
# figure out the soname
2984
set dummy $library_names
2987
libname=`eval \\$echo \"$libname_spec\"`
2988
# use dlname if we got it. it's perfectly good, no?
2989
if test -n "$dlname"; then
2991
elif test -n "$soname_spec"; then
2995
major=`expr $current - $age`
2999
eval soname=\"$soname_spec\"
3004
# Make a new name for the extract_expsyms_cmds to use
3006
soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3007
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3009
# If the library has no export list, then create one now
3010
if test -f "$output_objdir/$soname-def"; then :
3012
$show "extracting exported symbol list from \`$soname'"
3013
save_ifs="$IFS"; IFS='~'
3014
cmds=$extract_expsyms_cmds
3015
for cmd in $cmds; do
3019
$run eval "$cmd" || exit $?
3025
if test -f "$output_objdir/$newlib"; then :; else
3026
$show "generating import library for \`$soname'"
3027
save_ifs="$IFS"; IFS='~'
3028
cmds=$old_archive_from_expsyms_cmds
3029
for cmd in $cmds; do
3033
$run eval "$cmd" || exit $?
3037
# make sure the library variables are pointing to the new library
3040
fi # test -n "$old_archive_from_expsyms_cmds"
3042
if test "$linkmode" = prog || test "$mode" != relink; then
3047
case $hardcode_action in
3048
immediate | unsupported)
3049
if test "$hardcode_direct" = no; then
3052
*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3053
*-*-sysv4*uw2*) add_dir="-L$dir" ;;
3054
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3055
*-*-unixware7*) add_dir="-L$dir" ;;
3057
# if the lib is a module then we can not link against
3058
# it, someone is ignoring the new warnings I added
3059
if /usr/bin/file -L $add 2> /dev/null |
3060
$EGREP ": [^:]* bundle" >/dev/null ; then
3061
$echo "** Warning, lib $linklib is a module, not a shared library"
3062
if test -z "$old_library" ; then
3064
$echo "** And there doesn't seem to be a static archive available"
3065
$echo "** The link will probably fail, sorry"
3067
add="$dir/$old_library"
3071
elif test "$hardcode_minus_L" = no; then
3073
*-*-sunos*) add_shlibpath="$dir" ;;
3077
elif test "$hardcode_shlibpath_var" = no; then
3078
add_shlibpath="$dir"
3085
if test "$hardcode_direct" = yes; then
3087
elif test "$hardcode_minus_L" = yes; then
3089
# Try looking first in the location we're being installed to.
3090
if test -n "$inst_prefix_dir"; then
3093
add_dir="$add_dir -L$inst_prefix_dir$libdir"
3098
elif test "$hardcode_shlibpath_var" = yes; then
3099
add_shlibpath="$dir"
3108
if test "$lib_linked" != yes; then
3109
$echo "$modename: configuration error: unsupported hardcode properties"
3113
if test -n "$add_shlibpath"; then
3114
case :$compile_shlibpath: in
3115
*":$add_shlibpath:"*) ;;
3116
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3119
if test "$linkmode" = prog; then
3120
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3121
test -n "$add" && compile_deplibs="$add $compile_deplibs"
3123
test -n "$add_dir" && deplibs="$add_dir $deplibs"
3124
test -n "$add" && deplibs="$add $deplibs"
3125
if test "$hardcode_direct" != yes && \
3126
test "$hardcode_minus_L" != yes && \
3127
test "$hardcode_shlibpath_var" = yes; then
3128
case :$finalize_shlibpath: in
3130
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3136
if test "$linkmode" = prog || test "$mode" = relink; then
3140
# Finalize command for both is simple: just hardcode it.
3141
if test "$hardcode_direct" = yes; then
3142
add="$libdir/$linklib"
3143
elif test "$hardcode_minus_L" = yes; then
3146
elif test "$hardcode_shlibpath_var" = yes; then
3147
case :$finalize_shlibpath: in
3149
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3152
elif test "$hardcode_automatic" = yes; then
3153
if test -n "$inst_prefix_dir" &&
3154
test -f "$inst_prefix_dir$libdir/$linklib" ; then
3155
add="$inst_prefix_dir$libdir/$linklib"
3157
add="$libdir/$linklib"
3160
# We cannot seem to hardcode it, guess we'll fake it.
3162
# Try looking first in the location we're being installed to.
3163
if test -n "$inst_prefix_dir"; then
3166
add_dir="$add_dir -L$inst_prefix_dir$libdir"
3173
if test "$linkmode" = prog; then
3174
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3175
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3177
test -n "$add_dir" && deplibs="$add_dir $deplibs"
3178
test -n "$add" && deplibs="$add $deplibs"
3181
elif test "$linkmode" = prog; then
3182
# Here we assume that one of hardcode_direct or hardcode_minus_L
3183
# is not unsupported. This is valid on all known static and
3185
if test "$hardcode_direct" != unsupported; then
3186
test -n "$old_library" && linklib="$old_library"
3187
compile_deplibs="$dir/$linklib $compile_deplibs"
3188
finalize_deplibs="$dir/$linklib $finalize_deplibs"
3190
compile_deplibs="-l$name -L$dir $compile_deplibs"
3191
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3193
elif test "$build_libtool_libs" = yes; then
3194
# Not a shared library
3195
if test "$deplibs_check_method" != pass_all; then
3196
# We're trying link a shared library against a static one
3197
# but the system doesn't support it.
3199
# Just print a warning and add the library to dependency_libs so
3200
# that the program can be linked against the static library.
3202
$echo "*** Warning: This system can not link to static lib archive $lib."
3203
$echo "*** I have the capability to make that library automatically link in when"
3204
$echo "*** you link to this library. But I can only do this if you have a"
3205
$echo "*** shared version of the library, which you do not appear to have."
3206
if test "$module" = yes; then
3207
$echo "*** But as you try to build a module library, libtool will still create "
3208
$echo "*** a static module, that should work as long as the dlopening application"
3209
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3210
if test -z "$global_symbol_pipe"; then
3212
$echo "*** However, this would only work if libtool was able to extract symbol"
3213
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3214
$echo "*** not find such a program. So, this module is probably useless."
3215
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
3217
if test "$build_old_libs" = no; then
3218
build_libtool_libs=module
3221
build_libtool_libs=no
3225
deplibs="$dir/$old_library $deplibs"
3228
fi # link shared/static library?
3230
if test "$linkmode" = lib; then
3231
if test -n "$dependency_libs" &&
3232
{ test "$hardcode_into_libs" != yes ||
3233
test "$build_old_libs" = yes ||
3234
test "$link_static" = yes; }; then
3235
# Extract -R from dependency_libs
3237
for libdir in $dependency_libs; do
3239
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3241
*" $temp_xrpath "*) ;;
3242
*) xrpath="$xrpath $temp_xrpath";;
3244
*) temp_deplibs="$temp_deplibs $libdir";;
3247
dependency_libs="$temp_deplibs"
3250
newlib_search_path="$newlib_search_path $absdir"
3251
# Link against this library
3252
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3253
# ... and its dependency_libs
3255
for deplib in $dependency_libs; do
3256
newdependency_libs="$deplib $newdependency_libs"
3257
if test "X$duplicate_deps" = "Xyes" ; then
3258
case "$tmp_libs " in
3259
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3262
tmp_libs="$tmp_libs $deplib"
3265
if test "$link_all_deplibs" != no; then
3266
# Add the search paths of all dependency libraries
3267
for deplib in $dependency_libs; do
3269
-L*) path="$deplib" ;;
3271
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3272
test "X$dir" = "X$deplib" && dir="."
3273
# We need an absolute path.
3275
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3277
absdir=`cd "$dir" && pwd`
3278
if test -z "$absdir"; then
3279
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3284
if grep "^installed=no" $deplib > /dev/null; then
3285
path="$absdir/$objdir"
3287
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3288
if test -z "$libdir"; then
3289
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3292
if test "$absdir" != "$libdir"; then
3293
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3300
# we do not want to link against static libs,
3301
# but need to link against shared
3302
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3303
if test -n "$deplibrary_names" ; then
3304
for tmp in $deplibrary_names ; do
3307
if test -f "$path/$depdepl" ; then
3308
depdepl="$path/$depdepl"
3310
# do not add paths which are already there
3311
case " $newlib_search_path " in
3313
*) newlib_search_path="$newlib_search_path $path";;
3326
# Again, we only want to link against shared libraries
3327
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3328
for tmp in $newlib_search_path ; do
3329
if test -f "$tmp/lib$tmp_libs.dylib" ; then
3330
eval depdepl="$tmp/lib$tmp_libs.dylib"
3341
case " $deplibs " in
3343
*) deplibs="$path $deplibs" ;;
3345
case " $deplibs " in
3347
*) deplibs="$depdepl $deplibs" ;;
3350
fi # link_all_deplibs != no
3352
done # for deplib in $libs
3353
dependency_libs="$newdependency_libs"
3354
if test "$pass" = dlpreopen; then
3355
# Link the dlpreopened libraries before other libraries
3356
for deplib in $save_deplibs; do
3357
deplibs="$deplib $deplibs"
3360
if test "$pass" != dlopen; then
3361
if test "$pass" != conv; then
3362
# Make sure lib_search_path contains only unique directories.
3364
for dir in $newlib_search_path; do
3365
case "$lib_search_path " in
3367
*) lib_search_path="$lib_search_path $dir" ;;
3373
if test "$linkmode,$pass" != "prog,link"; then
3376
vars="compile_deplibs finalize_deplibs"
3378
for var in $vars dependency_libs; do
3379
# Add libraries to $var in reverse order
3380
eval tmp_libs=\"\$$var\"
3382
for deplib in $tmp_libs; do
3383
# FIXME: Pedantically, this is the right thing to do, so
3384
# that some nasty dependency loop isn't accidentally
3386
#new_libs="$deplib $new_libs"
3387
# Pragmatically, this seems to cause very few problems in
3390
-L*) new_libs="$deplib $new_libs" ;;
3393
# And here is the reason: when a library appears more
3394
# than once as an explicit dependence of a library, or
3395
# is implicitly linked in more than once by the
3396
# compiler, it is considered special, and multiple
3397
# occurrences thereof are not removed. Compare this
3398
# with having the same library being listed as a
3399
# dependency of multiple other libraries: in this case,
3400
# we know (pedantically, we assume) the library does not
3401
# need to be listed more than once, so we keep only the
3402
# last copy. This is not always right, but it is rare
3403
# enough that we require users that really mean to play
3404
# such unportable linking tricks to link the library
3405
# using -Wl,-lname, so that libtool does not consider it
3406
# for duplicate removal.
3407
case " $specialdeplibs " in
3408
*" $deplib "*) new_libs="$deplib $new_libs" ;;
3410
case " $new_libs " in
3412
*) new_libs="$deplib $new_libs" ;;
3420
for deplib in $new_libs; do
3423
case " $tmp_libs " in
3425
*) tmp_libs="$tmp_libs $deplib" ;;
3428
*) tmp_libs="$tmp_libs $deplib" ;;
3431
eval $var=\"$tmp_libs\"
3434
# Last step: remove runtime libs from dependency_libs
3435
# (they stay in deplibs)
3437
for i in $dependency_libs ; do
3438
case " $predeps $postdeps $compiler_lib_search_path " in
3443
if test -n "$i" ; then
3444
tmp_libs="$tmp_libs $i"
3447
dependency_libs=$tmp_libs
3449
if test "$linkmode" = prog; then
3450
dlfiles="$newdlfiles"
3451
dlprefiles="$newdlprefiles"
3456
if test -n "$deplibs"; then
3457
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3460
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3461
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3464
if test -n "$rpath"; then
3465
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3468
if test -n "$xrpath"; then
3469
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3472
if test -n "$vinfo"; then
3473
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3476
if test -n "$release"; then
3477
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3480
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3481
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3484
# Now set the variables for building old libraries.
3485
build_libtool_libs=no
3487
objs="$objs$old_deplibs"
3491
# Make sure we only generate libraries of the form `libNAME.la'.
3494
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3495
eval shared_ext=\"$shrext_cmds\"
3496
eval libname=\"$libname_spec\"
3499
if test "$module" = no; then
3500
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3504
if test "$need_lib_prefix" != no; then
3505
# Add the "lib" prefix for modules if required
3506
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3507
eval shared_ext=\"$shrext_cmds\"
3508
eval libname=\"$libname_spec\"
3510
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3515
if test -n "$objs"; then
3516
if test "$deplibs_check_method" != pass_all; then
3517
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3521
$echo "*** Warning: Linking the shared library $output against the non-libtool"
3522
$echo "*** objects $objs is not portable!"
3523
libobjs="$libobjs $objs"
3527
if test "$dlself" != no; then
3528
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3532
if test "$#" -gt 2; then
3533
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3538
if test -z "$rpath"; then
3539
if test "$build_libtool_libs" = yes; then
3540
# Building a libtool convenience library.
3541
# Some compilers have problems with a `.al' extension so
3542
# convenience libraries should have the same extension an
3543
# archive normally would.
3544
oldlibs="$output_objdir/$libname.$libext $oldlibs"
3545
build_libtool_libs=convenience
3549
if test -n "$vinfo"; then
3550
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3553
if test -n "$release"; then
3554
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3558
# Parse the version information argument.
3559
save_ifs="$IFS"; IFS=':'
3560
set dummy $vinfo 0 0 0
3563
if test -n "$8"; then
3564
$echo "$modename: too many parameters to \`-version-info'" 1>&2
3569
# convert absolute version numbers to libtool ages
3570
# this retains compatibility with .la files and attempts
3571
# to make the code below a bit more comprehensible
3573
case $vinfo_number in
3577
number_revision="$4"
3579
# There are really only two kinds -- those that
3580
# use the current revision as the major version
3581
# and those that subtract age and use age as
3582
# a minor version. But, then there is irix
3583
# which has an extra 1 added just for fun
3585
case $version_type in
3586
darwin|linux|osf|windows|none)
3587
current=`expr $number_major + $number_minor`
3589
revision="$number_revision"
3591
freebsd-aout|freebsd-elf|sunos)
3592
current="$number_major"
3593
revision="$number_minor"
3597
current=`expr $number_major + $number_minor`
3599
revision="$number_minor"
3600
lt_irix_increment=no
3603
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3604
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3616
# Check that each of the things are valid numbers.
3618
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]) ;;
3620
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3621
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3627
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]) ;;
3629
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3630
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3636
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]) ;;
3638
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3639
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3644
if test "$age" -gt "$current"; then
3645
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3646
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3650
# Calculate the version variables.
3654
case $version_type in
3658
# Like Linux, but with the current version available in
3659
# verstring for coding it into the library header
3660
major=.`expr $current - $age`
3661
versuffix="$major.$age.$revision"
3662
# Darwin ld doesn't like 0 for these options...
3663
minor_current=`expr $current + 1`
3664
xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3665
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3670
versuffix=".$current.$revision";
3675
versuffix=".$current";
3679
if test "X$lt_irix_increment" = "Xno"; then
3680
major=`expr $current - $age`
3682
major=`expr $current - $age + 1`
3684
case $version_type in
3685
nonstopux) verstring_prefix=nonstopux ;;
3686
*) verstring_prefix=sgi ;;
3688
verstring="$verstring_prefix$major.$revision"
3690
# Add in all the interfaces that we are compatible with.
3692
while test "$loop" -ne 0; do
3693
iface=`expr $revision - $loop`
3694
loop=`expr $loop - 1`
3695
verstring="$verstring_prefix$major.$iface:$verstring"
3698
# Before this point, $major must not contain `.'.
3700
versuffix="$major.$revision"
3704
major=.`expr $current - $age`
3705
versuffix="$major.$age.$revision"
3709
major=.`expr $current - $age`
3710
versuffix=".$current.$age.$revision"
3711
verstring="$current.$age.$revision"
3713
# Add in all the interfaces that we are compatible with.
3715
while test "$loop" -ne 0; do
3716
iface=`expr $current - $loop`
3717
loop=`expr $loop - 1`
3718
verstring="$verstring:${iface}.0"
3721
# Make executables depend on our current version.
3722
verstring="$verstring:${current}.0"
3727
versuffix=".$current.$revision"
3731
# Use '-' rather than '.', since we only want one
3732
# extension on DOS 8.3 filesystems.
3733
major=`expr $current - $age`
3738
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3739
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3744
# Clear the version info if we defaulted, and they specified a release.
3745
if test -z "$vinfo" && test -n "$release"; then
3747
case $version_type in
3749
# we can't check for "0.0" in archive_cmds due to quoting
3750
# problems, so we reset it completely
3757
if test "$need_version" = no; then
3764
# Remove version info from name if versioning should be avoided
3765
if test "$avoid_version" = yes && test "$need_version" = no; then
3771
# Check to see if the archive will have undefined symbols.
3772
if test "$allow_undefined" = yes; then
3773
if test "$allow_undefined_flag" = unsupported; then
3774
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3775
build_libtool_libs=no
3779
# Don't allow undefined symbols.
3780
allow_undefined_flag="$no_undefined_flag"
3784
if test "$mode" != relink; then
3785
# Remove our outputs, but don't remove object files since they
3786
# may have been created when compiling PIC objects.
3788
tempremovelist=`$echo "$output_objdir/*"`
3789
for p in $tempremovelist; do
3793
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3794
if test "X$precious_files_regex" != "X"; then
3795
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3800
removelist="$removelist $p"
3805
if test -n "$removelist"; then
3806
$show "${rm}r $removelist"
3807
$run ${rm}r $removelist
3811
# Now set the variables for building old libraries.
3812
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3813
oldlibs="$oldlibs $output_objdir/$libname.$libext"
3815
# Transform .lo files to .o files.
3816
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3819
# Eliminate all temporary directories.
3820
#for path in $notinst_path; do
3821
# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3822
# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3823
# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3826
if test -n "$xrpath"; then
3827
# If the user specified any rpath flags, then add them.
3829
for libdir in $xrpath; do
3830
temp_xrpath="$temp_xrpath -R$libdir"
3831
case "$finalize_rpath " in
3833
*) finalize_rpath="$finalize_rpath $libdir" ;;
3836
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3837
dependency_libs="$temp_xrpath $dependency_libs"
3841
# Make sure dlfiles contains only unique files that won't be dlpreopened
3842
old_dlfiles="$dlfiles"
3844
for lib in $old_dlfiles; do
3845
case " $dlprefiles $dlfiles " in
3847
*) dlfiles="$dlfiles $lib" ;;
3851
# Make sure dlprefiles contains only unique files
3852
old_dlprefiles="$dlprefiles"
3854
for lib in $old_dlprefiles; do
3855
case "$dlprefiles " in
3857
*) dlprefiles="$dlprefiles $lib" ;;
3861
if test "$build_libtool_libs" = yes; then
3862
if test -n "$rpath"; then
3864
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3865
# these systems don't actually have a c library (as such)!
3867
*-*-rhapsody* | *-*-darwin1.[012])
3868
# Rhapsody C library is in the System framework
3869
deplibs="$deplibs -framework System"
3872
# Don't link with libc until the a.out ld.so is fixed.
3874
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3875
# Do not include libc due to us having libc/libc_r.
3877
*-*-sco3.2v5* | *-*-sco5v6*)
3878
# Causes problems with __ctype
3880
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3881
# Compiler inserts libc in the correct place for threads to work
3884
# Add libc to deplibs on all other systems if necessary.
3885
if test "$build_libtool_need_lc" = "yes"; then
3886
deplibs="$deplibs -lc"
3892
# Transform deplibs into only deplibs that can be linked in shared.
3894
libname_save=$libname
3895
release_save=$release
3896
versuffix_save=$versuffix
3898
# I'm not sure if I'm treating the release correctly. I think
3899
# release should show up in the -l (ie -lgmp5) so we don't want to
3900
# add it in twice. Is that correct?
3906
case $deplibs_check_method in
3908
# Don't check for shared/static. Everything works.
3909
# This might be a little naive. We might want to check
3910
# whether the library exists or not. But this is on
3911
# osf3 & osf4 and I'm not really sure... Just
3912
# implementing what was already the behavior.
3916
# This code stresses the "libraries are programs" paradigm to its
3917
# limits. Maybe even breaks it. We compile a program, linking it
3918
# against the deplibs as a proxy for the library. Then we can check
3919
# whether they linked in statically or dynamically with ldd.
3921
cat > conftest.c <<EOF
3922
int main() { return 0; }
3925
if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3926
ldd_output=`ldd conftest`
3927
for i in $deplibs; do
3928
name=`expr $i : '-l\(.*\)'`
3929
# If $name is empty we are operating on a -L argument.
3930
if test "$name" != "" && test "$name" != "0"; then
3931
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3932
case " $predeps $postdeps " in
3934
newdeplibs="$newdeplibs $i"
3939
if test -n "$i" ; then
3940
libname=`eval \\$echo \"$libname_spec\"`
3941
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3942
set dummy $deplib_matches
3944
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3945
newdeplibs="$newdeplibs $i"
3949
$echo "*** Warning: dynamic linker does not accept needed library $i."
3950
$echo "*** I have the capability to make that library automatically link in when"
3951
$echo "*** you link to this library. But I can only do this if you have a"
3952
$echo "*** shared version of the library, which I believe you do not have"
3953
$echo "*** because a test_compile did reveal that the linker did not use it for"
3954
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3958
newdeplibs="$newdeplibs $i"
3962
# Error occurred in the first compile. Let's try to salvage
3963
# the situation: Compile a separate program for each library.
3964
for i in $deplibs; do
3965
name=`expr $i : '-l\(.*\)'`
3966
# If $name is empty we are operating on a -L argument.
3967
if test "$name" != "" && test "$name" != "0"; then
3969
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3970
ldd_output=`ldd conftest`
3971
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3972
case " $predeps $postdeps " in
3974
newdeplibs="$newdeplibs $i"
3979
if test -n "$i" ; then
3980
libname=`eval \\$echo \"$libname_spec\"`
3981
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3982
set dummy $deplib_matches
3984
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3985
newdeplibs="$newdeplibs $i"
3989
$echo "*** Warning: dynamic linker does not accept needed library $i."
3990
$echo "*** I have the capability to make that library automatically link in when"
3991
$echo "*** you link to this library. But I can only do this if you have a"
3992
$echo "*** shared version of the library, which you do not appear to have"
3993
$echo "*** because a test_compile did reveal that the linker did not use this one"
3994
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
4000
$echo "*** Warning! Library $i is needed by this library but I was not able to"
4001
$echo "*** make it link in! You will probably need to install it or some"
4002
$echo "*** library that it depends on before this library will be fully"
4003
$echo "*** functional. Installing it before continuing would be even better."
4006
newdeplibs="$newdeplibs $i"
4012
set dummy $deplibs_check_method
4013
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4014
for a_deplib in $deplibs; do
4015
name=`expr $a_deplib : '-l\(.*\)'`
4016
# If $name is empty we are operating on a -L argument.
4017
if test "$name" != "" && test "$name" != "0"; then
4018
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4019
case " $predeps $postdeps " in
4021
newdeplibs="$newdeplibs $a_deplib"
4026
if test -n "$a_deplib" ; then
4027
libname=`eval \\$echo \"$libname_spec\"`
4028
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4029
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4030
for potent_lib in $potential_libs; do
4031
# Follow soft links.
4032
if ls -lLd "$potent_lib" 2>/dev/null \
4033
| grep " -> " >/dev/null; then
4036
# The statement above tries to avoid entering an
4037
# endless loop below, in case of cyclic links.
4038
# We might still enter an endless loop, since a link
4039
# loop can be closed while we follow links,
4041
potlib="$potent_lib"
4042
while test -h "$potlib" 2>/dev/null; do
4043
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4045
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4046
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4049
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4051
| $EGREP "$file_magic_regex" > /dev/null; then
4052
newdeplibs="$newdeplibs $a_deplib"
4059
if test -n "$a_deplib" ; then
4062
$echo "*** Warning: linker path does not have real file for library $a_deplib."
4063
$echo "*** I have the capability to make that library automatically link in when"
4064
$echo "*** you link to this library. But I can only do this if you have a"
4065
$echo "*** shared version of the library, which you do not appear to have"
4066
$echo "*** because I did check the linker path looking for a file starting"
4067
if test -z "$potlib" ; then
4068
$echo "*** with $libname but no candidates were found. (...for file magic test)"
4070
$echo "*** with $libname and none of the candidates passed a file format test"
4071
$echo "*** using a file magic. Last file checked: $potlib"
4075
# Add a -L argument.
4076
newdeplibs="$newdeplibs $a_deplib"
4078
done # Gone through all deplibs.
4081
set dummy $deplibs_check_method
4082
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4083
for a_deplib in $deplibs; do
4084
name=`expr $a_deplib : '-l\(.*\)'`
4085
# If $name is empty we are operating on a -L argument.
4086
if test -n "$name" && test "$name" != "0"; then
4087
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4088
case " $predeps $postdeps " in
4090
newdeplibs="$newdeplibs $a_deplib"
4095
if test -n "$a_deplib" ; then
4096
libname=`eval \\$echo \"$libname_spec\"`
4097
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4098
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4099
for potent_lib in $potential_libs; do
4100
potlib="$potent_lib" # see symlink-check above in file_magic test
4101
if eval $echo \"$potent_lib\" 2>/dev/null \
4103
| $EGREP "$match_pattern_regex" > /dev/null; then
4104
newdeplibs="$newdeplibs $a_deplib"
4111
if test -n "$a_deplib" ; then
4114
$echo "*** Warning: linker path does not have real file for library $a_deplib."
4115
$echo "*** I have the capability to make that library automatically link in when"
4116
$echo "*** you link to this library. But I can only do this if you have a"
4117
$echo "*** shared version of the library, which you do not appear to have"
4118
$echo "*** because I did check the linker path looking for a file starting"
4119
if test -z "$potlib" ; then
4120
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4122
$echo "*** with $libname and none of the candidates passed a file format test"
4123
$echo "*** using a regex pattern. Last file checked: $potlib"
4127
# Add a -L argument.
4128
newdeplibs="$newdeplibs $a_deplib"
4130
done # Gone through all deplibs.
4134
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4135
-e 's/ -[LR][^ ]*//g'`
4136
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4137
for i in $predeps $postdeps ; do
4138
# can't use Xsed below, because $i might contain '/'
4139
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4142
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4143
| grep . >/dev/null; then
4145
if test "X$deplibs_check_method" = "Xnone"; then
4146
$echo "*** Warning: inter-library dependencies are not supported in this platform."
4148
$echo "*** Warning: inter-library dependencies are not known to be supported."
4150
$echo "*** All declared inter-library dependencies are being dropped."
4155
versuffix=$versuffix_save
4157
release=$release_save
4158
libname=$libname_save
4162
*-*-rhapsody* | *-*-darwin1.[012])
4163
# On Rhapsody replace the C library is the System framework
4164
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4168
if test "$droppeddeps" = yes; then
4169
if test "$module" = yes; then
4171
$echo "*** Warning: libtool could not satisfy all declared inter-library"
4172
$echo "*** dependencies of module $libname. Therefore, libtool will create"
4173
$echo "*** a static module, that should work as long as the dlopening"
4174
$echo "*** application is linked with the -dlopen flag."
4175
if test -z "$global_symbol_pipe"; then
4177
$echo "*** However, this would only work if libtool was able to extract symbol"
4178
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4179
$echo "*** not find such a program. So, this module is probably useless."
4180
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
4182
if test "$build_old_libs" = no; then
4183
oldlibs="$output_objdir/$libname.$libext"
4184
build_libtool_libs=module
4187
build_libtool_libs=no
4190
$echo "*** The inter-library dependencies that have been dropped here will be"
4191
$echo "*** automatically added whenever a program is linked with this library"
4192
$echo "*** or is declared to -dlopen it."
4194
if test "$allow_undefined" = no; then
4196
$echo "*** Since this library must not contain undefined symbols,"
4197
$echo "*** because either the platform does not support them or"
4198
$echo "*** it was explicitly requested with -no-undefined,"
4199
$echo "*** libtool will only create a static version of it."
4200
if test "$build_old_libs" = no; then
4201
oldlibs="$output_objdir/$libname.$libext"
4202
build_libtool_libs=module
4205
build_libtool_libs=no
4210
# Done checking deplibs!
4215
# move library search paths that coincide with paths to not yet
4216
# installed libraries to the beginning of the library search list
4218
for path in $notinst_path; do
4219
case " $new_libs " in
4220
*" -L$path/$objdir "*) ;;
4222
case " $deplibs " in
4223
*" -L$path/$objdir "*)
4224
new_libs="$new_libs -L$path/$objdir" ;;
4229
for deplib in $deplibs; do
4232
case " $new_libs " in
4234
*) new_libs="$new_libs $deplib" ;;
4237
*) new_libs="$new_libs $deplib" ;;
4243
# All the library-specific variables (install_libdir is set above).
4248
# Test again, we may have decided not to build it any more
4249
if test "$build_libtool_libs" = yes; then
4250
if test "$hardcode_into_libs" = yes; then
4251
# Hardcode the library paths
4254
rpath="$finalize_rpath"
4255
test "$mode" != relink && rpath="$compile_rpath$rpath"
4256
for libdir in $rpath; do
4257
if test -n "$hardcode_libdir_flag_spec"; then
4258
if test -n "$hardcode_libdir_separator"; then
4259
if test -z "$hardcode_libdirs"; then
4260
hardcode_libdirs="$libdir"
4262
# Just accumulate the unique libdirs.
4263
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4264
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4267
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4272
eval flag=\"$hardcode_libdir_flag_spec\"
4273
dep_rpath="$dep_rpath $flag"
4275
elif test -n "$runpath_var"; then
4276
case "$perm_rpath " in
4278
*) perm_rpath="$perm_rpath $libdir" ;;
4282
# Substitute the hardcoded libdirs into the rpath.
4283
if test -n "$hardcode_libdir_separator" &&
4284
test -n "$hardcode_libdirs"; then
4285
libdir="$hardcode_libdirs"
4286
if test -n "$hardcode_libdir_flag_spec_ld"; then
4287
case $archive_cmds in
4288
*\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
4289
*) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
4292
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4295
if test -n "$runpath_var" && test -n "$perm_rpath"; then
4296
# We should set the runpath_var.
4298
for dir in $perm_rpath; do
4301
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4303
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4306
shlibpath="$finalize_shlibpath"
4307
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4308
if test -n "$shlibpath"; then
4309
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4312
# Get the real and link names of the library.
4313
eval shared_ext=\"$shrext_cmds\"
4314
eval library_names=\"$library_names_spec\"
4315
set dummy $library_names
4319
if test -n "$soname_spec"; then
4320
eval soname=\"$soname_spec\"
4324
if test -z "$dlname"; then
4328
lib="$output_objdir/$realname"
4332
linknames="$linknames $link"
4335
# Use standard objects if they are pic
4336
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4338
# Prepare the list of exported symbols
4339
if test -z "$export_symbols"; then
4340
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4341
$show "generating symbol list for \`$libname.la'"
4342
export_symbols="$output_objdir/$libname.exp"
4343
$run $rm $export_symbols
4344
cmds=$export_symbols_cmds
4345
save_ifs="$IFS"; IFS='~'
4346
for cmd in $cmds; do
4349
if len=`expr "X$cmd" : ".*"` &&
4350
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4352
$run eval "$cmd" || exit $?
4353
skipped_export=false
4355
# The command line is too long to execute in one step.
4356
$show "using reloadable object file for export list..."
4358
# Break out early, otherwise skipped_export may be
4359
# set to false by a later but shorter cmd.
4364
if test -n "$export_symbols_regex"; then
4365
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4366
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4367
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
4368
$run eval '$mv "${export_symbols}T" "$export_symbols"'
4373
if test -n "$export_symbols" && test -n "$include_expsyms"; then
4374
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4378
for test_deplib in $deplibs; do
4379
case " $convenience " in
4380
*" $test_deplib "*) ;;
4382
tmp_deplibs="$tmp_deplibs $test_deplib"
4386
deplibs="$tmp_deplibs"
4388
if test -n "$convenience"; then
4389
if test -n "$whole_archive_flag_spec"; then
4390
save_libobjs=$libobjs
4391
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4393
gentop="$output_objdir/${outputname}x"
4394
generated="$generated $gentop"
4396
func_extract_archives $gentop $convenience
4397
libobjs="$libobjs $func_extract_archives_result"
4401
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4402
eval flag=\"$thread_safe_flag_spec\"
4403
linker_flags="$linker_flags $flag"
4406
# Make a backup of the uninstalled library when relinking
4407
if test "$mode" = relink; then
4408
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4411
# Do each of the archive commands.
4412
if test "$module" = yes && test -n "$module_cmds" ; then
4413
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4414
eval test_cmds=\"$module_expsym_cmds\"
4415
cmds=$module_expsym_cmds
4417
eval test_cmds=\"$module_cmds\"
4421
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4422
eval test_cmds=\"$archive_expsym_cmds\"
4423
cmds=$archive_expsym_cmds
4425
eval test_cmds=\"$archive_cmds\"
4430
if test "X$skipped_export" != "X:" &&
4431
len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4432
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4435
# The command line is too long to link in one step, link piecewise.
4436
$echo "creating reloadable object files..."
4438
# Save the value of $output and $libobjs because we want to
4439
# use them later. If we have whole_archive_flag_spec, we
4440
# want to use save_libobjs as it was before
4441
# whole_archive_flag_spec was expanded, because we can't
4442
# assume the linker understands whole_archive_flag_spec.
4443
# This may have to be revisited, in case too many
4444
# convenience libraries get linked in and end up exceeding
4446
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4447
save_libobjs=$libobjs
4450
output_la=`$echo "X$output" | $Xsed -e "$basename"`
4452
# Clear the reloadable object creation command queue and
4453
# initialize k to one.
4460
output=$output_objdir/$output_la-${k}.$objext
4461
# Loop over the list of objects to be linked.
4462
for obj in $save_libobjs
4464
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4465
if test "X$objlist" = X ||
4466
{ len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4467
test "$len" -le "$max_cmd_len"; }; then
4468
objlist="$objlist $obj"
4470
# The command $test_cmds is almost too long, add a
4471
# command to the queue.
4472
if test "$k" -eq 1 ; then
4473
# The first file doesn't have a previous command to add.
4474
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4476
# All subsequent reloadable object files will link in
4477
# the last one created.
4478
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4480
last_robj=$output_objdir/$output_la-${k}.$objext
4482
output=$output_objdir/$output_la-${k}.$objext
4487
# Handle the remaining objects by creating one last
4488
# reloadable object file. All subsequent reloadable object
4489
# files will link in the last one created.
4490
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4491
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4493
if ${skipped_export-false}; then
4494
$show "generating symbol list for \`$libname.la'"
4495
export_symbols="$output_objdir/$libname.exp"
4496
$run $rm $export_symbols
4498
# Append the command to create the export file.
4499
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4502
# Set up a command to remove the reloadable object files
4503
# after they are used.
4505
while test "$i" -lt "$k"
4508
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4511
$echo "creating a temporary reloadable object file: $output"
4513
# Loop through the commands generated above and execute them.
4514
save_ifs="$IFS"; IFS='~'
4515
for cmd in $concat_cmds; do
4518
$run eval "$cmd" || exit $?
4523
# Restore the value of output.
4526
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4527
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4529
# Expand the library linking commands again to reset the
4530
# value of $libobjs for piecewise linking.
4532
# Do each of the archive commands.
4533
if test "$module" = yes && test -n "$module_cmds" ; then
4534
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4535
cmds=$module_expsym_cmds
4540
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4541
cmds=$archive_expsym_cmds
4547
# Append the command to remove the reloadable object files
4548
# to the just-reset $cmds.
4549
eval cmds=\"\$cmds~\$rm $delfiles\"
4551
save_ifs="$IFS"; IFS='~'
4552
for cmd in $cmds; do
4556
$run eval "$cmd" || {
4559
# Restore the uninstalled library and exit
4560
if test "$mode" = relink; then
4561
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4569
# Restore the uninstalled library and exit
4570
if test "$mode" = relink; then
4571
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4573
if test -n "$convenience"; then
4574
if test -z "$whole_archive_flag_spec"; then
4575
$show "${rm}r $gentop"
4576
$run ${rm}r "$gentop"
4583
# Create links to the real library.
4584
for linkname in $linknames; do
4585
if test "$realname" != "$linkname"; then
4586
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4587
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4591
# If -module or -export-dynamic was specified, set the dlname.
4592
if test "$module" = yes || test "$export_dynamic" = yes; then
4593
# On all known operating systems, these are identical.
4600
if test -n "$deplibs"; then
4601
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4604
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4605
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4608
if test -n "$rpath"; then
4609
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4612
if test -n "$xrpath"; then
4613
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4616
if test -n "$vinfo"; then
4617
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4620
if test -n "$release"; then
4621
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4626
if test -n "$objs$old_deplibs"; then
4627
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4631
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4639
# Delete the old objects.
4640
$run $rm $obj $libobj
4642
# Objects from convenience libraries. This assumes
4643
# single-version convenience libraries. Whenever we create
4644
# different ones for PIC/non-PIC, this we'll have to duplicate
4648
# reload_cmds runs $LD directly, so let us get rid of
4649
# -Wl from whole_archive_flag_spec and hope we can get by with
4650
# turning comma into space..
4653
if test -n "$convenience"; then
4654
if test -n "$whole_archive_flag_spec"; then
4655
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4656
reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4658
gentop="$output_objdir/${obj}x"
4659
generated="$generated $gentop"
4661
func_extract_archives $gentop $convenience
4662
reload_conv_objs="$reload_objs $func_extract_archives_result"
4666
# Create the old-style object.
4667
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
4671
save_ifs="$IFS"; IFS='~'
4672
for cmd in $cmds; do
4676
$run eval "$cmd" || exit $?
4680
# Exit if we aren't doing a library object file.
4681
if test -z "$libobj"; then
4682
if test -n "$gentop"; then
4683
$show "${rm}r $gentop"
4690
if test "$build_libtool_libs" != yes; then
4691
if test -n "$gentop"; then
4692
$show "${rm}r $gentop"
4696
# Create an invalid libtool object if no PIC, so that we don't
4697
# accidentally link it into a program.
4698
# $show "echo timestamp > $libobj"
4699
# $run eval "echo timestamp > $libobj" || exit $?
4703
if test -n "$pic_flag" || test "$pic_mode" != default; then
4704
# Only do commands if we really have different PIC objects.
4705
reload_objs="$libobjs $reload_conv_objs"
4708
save_ifs="$IFS"; IFS='~'
4709
for cmd in $cmds; do
4713
$run eval "$cmd" || exit $?
4718
if test -n "$gentop"; then
4719
$show "${rm}r $gentop"
4728
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4730
if test -n "$vinfo"; then
4731
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4734
if test -n "$release"; then
4735
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4738
if test "$preload" = yes; then
4739
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4740
test "$dlopen_self_static" = unknown; then
4741
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4746
*-*-rhapsody* | *-*-darwin1.[012])
4747
# On Rhapsody replace the C library is the System framework
4748
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4749
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4755
# Don't allow lazy linking, it breaks C++ global constructors
4756
if test "$tagname" = CXX ; then
4757
compile_command="$compile_command ${wl}-bind_at_load"
4758
finalize_command="$finalize_command ${wl}-bind_at_load"
4764
# move library search paths that coincide with paths to not yet
4765
# installed libraries to the beginning of the library search list
4767
for path in $notinst_path; do
4768
case " $new_libs " in
4769
*" -L$path/$objdir "*) ;;
4771
case " $compile_deplibs " in
4772
*" -L$path/$objdir "*)
4773
new_libs="$new_libs -L$path/$objdir" ;;
4778
for deplib in $compile_deplibs; do
4781
case " $new_libs " in
4783
*) new_libs="$new_libs $deplib" ;;
4786
*) new_libs="$new_libs $deplib" ;;
4789
compile_deplibs="$new_libs"
4792
compile_command="$compile_command $compile_deplibs"
4793
finalize_command="$finalize_command $finalize_deplibs"
4795
if test -n "$rpath$xrpath"; then
4796
# If the user specified any rpath flags, then add them.
4797
for libdir in $rpath $xrpath; do
4798
# This is the magic to use -rpath.
4799
case "$finalize_rpath " in
4801
*) finalize_rpath="$finalize_rpath $libdir" ;;
4806
# Now hardcode the library paths
4809
for libdir in $compile_rpath $finalize_rpath; do
4810
if test -n "$hardcode_libdir_flag_spec"; then
4811
if test -n "$hardcode_libdir_separator"; then
4812
if test -z "$hardcode_libdirs"; then
4813
hardcode_libdirs="$libdir"
4815
# Just accumulate the unique libdirs.
4816
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4817
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4820
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4825
eval flag=\"$hardcode_libdir_flag_spec\"
4826
rpath="$rpath $flag"
4828
elif test -n "$runpath_var"; then
4829
case "$perm_rpath " in
4831
*) perm_rpath="$perm_rpath $libdir" ;;
4835
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4836
testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4837
case :$dllsearchpath: in
4839
*) dllsearchpath="$dllsearchpath:$libdir";;
4841
case :$dllsearchpath: in
4842
*":$testbindir:"*) ;;
4843
*) dllsearchpath="$dllsearchpath:$testbindir";;
4848
# Substitute the hardcoded libdirs into the rpath.
4849
if test -n "$hardcode_libdir_separator" &&
4850
test -n "$hardcode_libdirs"; then
4851
libdir="$hardcode_libdirs"
4852
eval rpath=\" $hardcode_libdir_flag_spec\"
4854
compile_rpath="$rpath"
4858
for libdir in $finalize_rpath; do
4859
if test -n "$hardcode_libdir_flag_spec"; then
4860
if test -n "$hardcode_libdir_separator"; then
4861
if test -z "$hardcode_libdirs"; then
4862
hardcode_libdirs="$libdir"
4864
# Just accumulate the unique libdirs.
4865
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4866
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4869
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4874
eval flag=\"$hardcode_libdir_flag_spec\"
4875
rpath="$rpath $flag"
4877
elif test -n "$runpath_var"; then
4878
case "$finalize_perm_rpath " in
4880
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4884
# Substitute the hardcoded libdirs into the rpath.
4885
if test -n "$hardcode_libdir_separator" &&
4886
test -n "$hardcode_libdirs"; then
4887
libdir="$hardcode_libdirs"
4888
eval rpath=\" $hardcode_libdir_flag_spec\"
4890
finalize_rpath="$rpath"
4892
if test -n "$libobjs" && test "$build_old_libs" = yes; then
4893
# Transform all the library objects into standard objects.
4894
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4895
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4899
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4900
if test -n "$NM" && test -n "$global_symbol_pipe"; then
4901
dlsyms="${outputname}S.c"
4903
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4907
if test -n "$dlsyms"; then
4911
# Discover the nlist of each of the dlfiles.
4912
nlist="$output_objdir/${outputname}.nm"
4914
$show "$rm $nlist ${nlist}S ${nlist}T"
4915
$run $rm "$nlist" "${nlist}S" "${nlist}T"
4917
# Parse the name list into a source file.
4918
$show "creating $output_objdir/$dlsyms"
4920
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4921
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4922
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4928
/* Prevent the only kind of declaration conflicts we can make. */
4929
#define lt_preloaded_symbols some_other_symbol
4931
/* External symbol declarations for the compiler. */\
4934
if test "$dlself" = yes; then
4935
$show "generating symbol list for \`$output'"
4937
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4939
# Add our own program objects to the symbol list.
4940
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4941
for arg in $progfiles; do
4942
$show "extracting global C symbols from \`$arg'"
4943
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4946
if test -n "$exclude_expsyms"; then
4947
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4948
$run eval '$mv "$nlist"T "$nlist"'
4951
if test -n "$export_symbols_regex"; then
4952
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4953
$run eval '$mv "$nlist"T "$nlist"'
4956
# Prepare the list of exported symbols
4957
if test -z "$export_symbols"; then
4958
export_symbols="$output_objdir/$outputname.exp"
4959
$run $rm $export_symbols
4960
$run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4962
*cygwin* | *mingw* )
4963
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4964
$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4968
$run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4969
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4970
$run eval 'mv "$nlist"T "$nlist"'
4972
*cygwin* | *mingw* )
4973
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4974
$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4980
for arg in $dlprefiles; do
4981
$show "extracting global C symbols from \`$arg'"
4982
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4983
$run eval '$echo ": $name " >> "$nlist"'
4984
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4987
if test -z "$run"; then
4988
# Make sure we have at least an empty file.
4989
test -f "$nlist" || : > "$nlist"
4991
if test -n "$exclude_expsyms"; then
4992
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4993
$mv "$nlist"T "$nlist"
4996
# Try sorting and uniquifying the output.
4997
if grep -v "^: " < "$nlist" |
4998
if sort -k 3 </dev/null >/dev/null 2>&1; then
5003
uniq > "$nlist"S; then
5006
grep -v "^: " < "$nlist" > "$nlist"S
5009
if test -f "$nlist"S; then
5010
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5012
$echo '/* NONE */' >> "$output_objdir/$dlsyms"
5015
$echo >> "$output_objdir/$dlsyms" "\
5017
#undef lt_preloaded_symbols
5019
#if defined (__STDC__) && __STDC__
5020
# define lt_ptr void *
5022
# define lt_ptr char *
5026
/* The mapping between symbol names and symbols. */
5030
*cygwin* | *mingw* )
5031
$echo >> "$output_objdir/$dlsyms" "\
5032
/* DATA imports from DLLs on WIN32 can't be const, because
5033
runtime relocations are performed -- see ld's documentation
5039
$echo >> "$output_objdir/$dlsyms" "\
5046
$echo >> "$output_objdir/$dlsyms" "\
5050
lt_preloaded_symbols[] =
5054
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5056
$echo >> "$output_objdir/$dlsyms" "\
5060
/* This works around a problem in FreeBSD linker */
5061
#ifdef FREEBSD_WORKAROUND
5062
static const void *lt_preloaded_setup() {
5063
return lt_preloaded_symbols;
5073
pic_flag_for_symtable=
5075
# compiling the symbol table file with pic_flag works around
5076
# a FreeBSD bug that causes programs to crash when -lm is
5077
# linked before any other PIC object. But we must not use
5078
# pic_flag when linking with -static. The problem exists in
5079
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5080
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5081
case "$compile_command " in
5083
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5086
case "$compile_command " in
5088
*) pic_flag_for_symtable=" $pic_flag";;
5092
# Now compile the dynamic symbol file.
5093
$show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5094
$run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5096
# Clean up the generated files.
5097
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5098
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5100
# Transform the symbol file into the correct name.
5102
*cygwin* | *mingw* )
5103
if test -f "$output_objdir/${outputname}.def" ; then
5104
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5105
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5107
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5108
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5112
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5113
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5118
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5123
# We keep going just in case the user didn't refer to
5124
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5125
# really was required.
5127
# Nullify the symbol file.
5128
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5129
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5132
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5133
# Replace the output file specification.
5134
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
5135
link_command="$compile_command$compile_rpath"
5137
# We have no uninstalled library dependencies, so finalize right now.
5138
$show "$link_command"
5139
$run eval "$link_command"
5142
# Delete the generated files.
5143
if test -n "$dlsyms"; then
5144
$show "$rm $output_objdir/${outputname}S.${objext}"
5145
$run $rm "$output_objdir/${outputname}S.${objext}"
5151
if test -n "$shlibpath_var"; then
5152
# We should set the shlibpath_var
5154
for dir in $temp_rpath; do
5156
[\\/]* | [A-Za-z]:[\\/]*)
5161
# Relative path: add a thisdir entry.
5162
rpath="$rpath\$thisdir/$dir:"
5169
if test -n "$compile_shlibpath$finalize_shlibpath"; then
5170
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5172
if test -n "$finalize_shlibpath"; then
5173
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5178
if test -n "$runpath_var"; then
5179
if test -n "$perm_rpath"; then
5180
# We should set the runpath_var.
5182
for dir in $perm_rpath; do
5185
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5187
if test -n "$finalize_perm_rpath"; then
5188
# We should set the runpath_var.
5190
for dir in $finalize_perm_rpath; do
5193
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5197
if test "$no_install" = yes; then
5198
# We don't need to create a wrapper script.
5199
link_command="$compile_var$compile_command$compile_rpath"
5200
# Replace the output file specification.
5201
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5202
# Delete the old output file.
5204
# Link the executable and exit
5205
$show "$link_command"
5206
$run eval "$link_command" || exit $?
5210
if test "$hardcode_action" = relink; then
5211
# Fast installation is not supported
5212
link_command="$compile_var$compile_command$compile_rpath"
5213
relink_command="$finalize_var$finalize_command$finalize_rpath"
5215
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5216
$echo "$modename: \`$output' will be relinked during installation" 1>&2
5218
if test "$fast_install" != no; then
5219
link_command="$finalize_var$compile_command$finalize_rpath"
5220
if test "$fast_install" = yes; then
5221
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
5223
# fast_install is set to needless
5227
link_command="$compile_var$compile_command$compile_rpath"
5228
relink_command="$finalize_var$finalize_command$finalize_rpath"
5232
# Replace the output file specification.
5233
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5235
# Delete the old output files.
5236
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5238
$show "$link_command"
5239
$run eval "$link_command" || exit $?
5241
# Now create the wrapper script.
5242
$show "creating $output"
5244
# Quote the relink command for shipping.
5245
if test -n "$relink_command"; then
5246
# Preserve any variables that may affect compiler behavior
5247
for var in $variables_saved_for_relink; do
5248
if eval test -z \"\${$var+set}\"; then
5249
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5250
elif eval var_value=\$$var; test -z "$var_value"; then
5251
relink_command="$var=; export $var; $relink_command"
5253
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5254
relink_command="$var=\"$var_value\"; export $var; $relink_command"
5257
relink_command="(cd `pwd`; $relink_command)"
5258
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5261
# Quote $echo for shipping.
5262
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5264
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5265
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5267
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5269
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5272
# Only actually do things if our run command is non-null.
5273
if test -z "$run"; then
5274
# win32 will think the script is a binary if it has
5275
# a .exe suffix, so we strip it off here.
5277
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5279
# test for cygwin because mv fails w/o .exe extensions
5283
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5287
*cygwin* | *mingw* )
5288
output_name=`basename $output`
5289
output_path=`dirname $output`
5290
cwrappersource="$output_path/$objdir/lt-$output_name.c"
5291
cwrapper="$output_path/$output_name.exe"
5292
$rm $cwrappersource $cwrapper
5293
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5295
cat > $cwrappersource <<EOF
5297
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5298
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5300
The $output program cannot be directly executed until all the libtool
5301
libraries that it depends on are installed.
5303
This wrapper executable should never be moved out of the build directory.
5304
If it is, it will not operate correctly.
5306
Currently, it simply execs the wrapper *script* "/bin/sh $output",
5307
but could eventually absorb all of the scripts functionality and
5308
exec $objdir/$outputname directly.
5311
cat >> $cwrappersource<<"EOF"
5320
#include <sys/stat.h>
5322
#if defined(PATH_MAX)
5323
# define LT_PATHMAX PATH_MAX
5324
#elif defined(MAXPATHLEN)
5325
# define LT_PATHMAX MAXPATHLEN
5327
# define LT_PATHMAX 1024
5330
#ifndef DIR_SEPARATOR
5331
# define DIR_SEPARATOR '/'
5332
# define PATH_SEPARATOR ':'
5335
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5337
# define HAVE_DOS_BASED_FILE_SYSTEM
5338
# ifndef DIR_SEPARATOR_2
5339
# define DIR_SEPARATOR_2 '\\'
5341
# ifndef PATH_SEPARATOR_2
5342
# define PATH_SEPARATOR_2 ';'
5346
#ifndef DIR_SEPARATOR_2
5347
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5348
#else /* DIR_SEPARATOR_2 */
5349
# define IS_DIR_SEPARATOR(ch) \
5350
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5351
#endif /* DIR_SEPARATOR_2 */
5353
#ifndef PATH_SEPARATOR_2
5354
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5355
#else /* PATH_SEPARATOR_2 */
5356
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5357
#endif /* PATH_SEPARATOR_2 */
5359
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5360
#define XFREE(stale) do { \
5361
if (stale) { free ((void *) stale); stale = 0; } \
5364
/* -DDEBUG is fairly common in CFLAGS. */
5366
#if defined DEBUGWRAPPER
5367
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5369
# define DEBUG(format, ...)
5372
const char *program_name = NULL;
5374
void * xmalloc (size_t num);
5375
char * xstrdup (const char *string);
5376
const char * base_name (const char *name);
5377
char * find_executable(const char *wrapper);
5378
int check_executable(const char *path);
5379
char * strendzap(char *str, const char *pat);
5380
void lt_fatal (const char *message, ...);
5383
main (int argc, char *argv[])
5388
program_name = (char *) xstrdup (base_name (argv[0]));
5389
DEBUG("(main) argv[0] : %s\n",argv[0]);
5390
DEBUG("(main) program_name : %s\n",program_name);
5391
newargz = XMALLOC(char *, argc+2);
5394
cat >> $cwrappersource <<EOF
5395
newargz[0] = (char *) xstrdup("$SHELL");
5398
cat >> $cwrappersource <<"EOF"
5399
newargz[1] = find_executable(argv[0]);
5400
if (newargz[1] == NULL)
5401
lt_fatal("Couldn't find %s", argv[0]);
5402
DEBUG("(main) found exe at : %s\n",newargz[1]);
5403
/* we know the script has the same name, without the .exe */
5404
/* so make sure newargz[1] doesn't end in .exe */
5405
strendzap(newargz[1],".exe");
5406
for (i = 1; i < argc; i++)
5407
newargz[i+1] = xstrdup(argv[i]);
5408
newargz[argc+1] = NULL;
5410
for (i=0; i<argc+1; i++)
5412
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5420
cat >> $cwrappersource <<EOF
5421
execv("$SHELL",(char const **)newargz);
5425
cat >> $cwrappersource <<EOF
5426
execv("$SHELL",newargz);
5431
cat >> $cwrappersource <<"EOF"
5436
xmalloc (size_t num)
5438
void * p = (void *) malloc (num);
5440
lt_fatal ("Memory exhausted");
5446
xstrdup (const char *string)
5448
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5453
base_name (const char *name)
5457
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5458
/* Skip over the disk name in MSDOS pathnames. */
5459
if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5463
for (base = name; *name; name++)
5464
if (IS_DIR_SEPARATOR (*name))
5470
check_executable(const char * path)
5474
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5475
if ((!path) || (!*path))
5478
if ((stat (path, &st) >= 0) &&
5480
/* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5481
#if defined (S_IXOTH)
5482
((st.st_mode & S_IXOTH) == S_IXOTH) ||
5484
#if defined (S_IXGRP)
5485
((st.st_mode & S_IXGRP) == S_IXGRP) ||
5487
((st.st_mode & S_IXUSR) == S_IXUSR))
5494
/* Searches for the full path of the wrapper. Returns
5495
newly allocated full path name if found, NULL otherwise */
5497
find_executable (const char* wrapper)
5502
/* static buffer for getcwd */
5503
char tmp[LT_PATHMAX + 1];
5507
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5509
if ((wrapper == NULL) || (*wrapper == '\0'))
5512
/* Absolute path? */
5513
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5514
if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5516
concat_name = xstrdup (wrapper);
5517
if (check_executable(concat_name))
5524
if (IS_DIR_SEPARATOR (wrapper[0]))
5526
concat_name = xstrdup (wrapper);
5527
if (check_executable(concat_name))
5531
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5535
for (p = wrapper; *p; p++)
5543
/* no slashes; search PATH */
5544
const char* path = getenv ("PATH");
5547
for (p = path; *p; p = p_next)
5551
for (q = p; *q; q++)
5552
if (IS_PATH_SEPARATOR(*q))
5555
p_next = (*q == '\0' ? q : q + 1);
5558
/* empty path: current directory */
5559
if (getcwd (tmp, LT_PATHMAX) == NULL)
5560
lt_fatal ("getcwd failed");
5561
tmp_len = strlen(tmp);
5562
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5563
memcpy (concat_name, tmp, tmp_len);
5564
concat_name[tmp_len] = '/';
5565
strcpy (concat_name + tmp_len + 1, wrapper);
5569
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5570
memcpy (concat_name, p, p_len);
5571
concat_name[p_len] = '/';
5572
strcpy (concat_name + p_len + 1, wrapper);
5574
if (check_executable(concat_name))
5579
/* not found in PATH; assume curdir */
5581
/* Relative path | not found in path: prepend cwd */
5582
if (getcwd (tmp, LT_PATHMAX) == NULL)
5583
lt_fatal ("getcwd failed");
5584
tmp_len = strlen(tmp);
5585
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5586
memcpy (concat_name, tmp, tmp_len);
5587
concat_name[tmp_len] = '/';
5588
strcpy (concat_name + tmp_len + 1, wrapper);
5590
if (check_executable(concat_name))
5597
strendzap(char *str, const char *pat)
5601
assert(str != NULL);
5602
assert(pat != NULL);
5605
patlen = strlen(pat);
5609
str += len - patlen;
5610
if (strcmp(str, pat) == 0)
5617
lt_error_core (int exit_status, const char * mode,
5618
const char * message, va_list ap)
5620
fprintf (stderr, "%s: %s: ", program_name, mode);
5621
vfprintf (stderr, message, ap);
5622
fprintf (stderr, ".\n");
5624
if (exit_status >= 0)
5629
lt_fatal (const char *message, ...)
5632
va_start (ap, message);
5633
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5637
# we should really use a build-platform specific compiler
5638
# here, but OTOH, the wrappers (shell script and this C one)
5639
# are only useful if you want to execute the "real" binary.
5640
# Since the "real" binary is built for $host, then this
5641
# wrapper might as well be built for $host, too.
5642
$run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5646
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5651
# $output - temporary wrapper script for $objdir/$outputname
5652
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5654
# The $output program cannot be directly executed until all the libtool
5655
# libraries that it depends on are installed.
5657
# This wrapper script should never be moved out of the build directory.
5658
# If it is, it will not operate correctly.
5660
# Sed substitution that helps us do robust quoting. It backslashifies
5661
# metacharacters that are still active within double-quoted strings.
5662
Xsed='${SED} -e 1s/^X//'
5663
sed_quote_subst='$sed_quote_subst'
5665
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5666
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5669
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5670
# is contrary to our usage. Disable this feature.
5671
alias -g '\${1+\"\$@\"}'='\"\$@\"'
5672
setopt NO_GLOB_SUBST
5674
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5676
BIN_SH=xpg4; export BIN_SH # for Tru64
5677
DUALCASE=1; export DUALCASE # for MKS sh
5679
# The HP-UX ksh and POSIX shell print the target directory to stdout
5681
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5683
relink_command=\"$relink_command\"
5685
# This environment variable determines our operation mode.
5686
if test \"\$libtool_install_magic\" = \"$magic\"; then
5687
# install mode needs the following variable:
5688
notinst_deplibs='$notinst_deplibs'
5690
# When we are sourced in execute mode, \$file and \$echo are already set.
5691
if test \"\$libtool_execute_magic\" != \"$magic\"; then
5694
# Make sure echo works.
5695
if test \"X\$1\" = X--no-reexec; then
5696
# Discard the --no-reexec flag, and continue.
5698
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5699
# Yippee, \$echo works!
5702
# Restart under the correct shell, and then maybe \$echo will work.
5703
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5709
# Find the directory that this script lives in.
5710
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5711
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5713
# Follow symbolic links until we get to the real thisdir.
5714
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5715
while test -n \"\$file\"; do
5716
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5718
# If there was a directory component, then change thisdir.
5719
if test \"x\$destdir\" != \"x\$file\"; then
5720
case \"\$destdir\" in
5721
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5722
*) thisdir=\"\$thisdir/\$destdir\" ;;
5726
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5727
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5730
# Try to get the absolute directory name.
5731
absdir=\`cd \"\$thisdir\" && pwd\`
5732
test -n \"\$absdir\" && thisdir=\"\$absdir\"
5735
if test "$fast_install" = yes; then
5737
program=lt-'$outputname'$exeext
5738
progdir=\"\$thisdir/$objdir\"
5740
if test ! -f \"\$progdir/\$program\" || \\
5741
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5742
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5744
file=\"\$\$-\$program\"
5746
if test ! -d \"\$progdir\"; then
5747
$mkdir \"\$progdir\"
5749
$rm \"\$progdir/\$file\"
5754
# relink executable if necessary
5755
if test -n \"\$relink_command\"; then
5756
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5758
$echo \"\$relink_command_output\" >&2
5759
$rm \"\$progdir/\$file\"
5764
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5765
{ $rm \"\$progdir/\$program\";
5766
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5767
$rm \"\$progdir/\$file\"
5771
program='$outputname'
5772
progdir=\"\$thisdir/$objdir\"
5778
if test -f \"\$progdir/\$program\"; then"
5780
# Export our shlibpath_var if we have one.
5781
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5783
# Add our own library path to $shlibpath_var
5784
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5786
# Some systems cannot cope with colon-terminated $shlibpath_var
5787
# The second colon is a workaround for a bug in BeOS R4 sed
5788
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5790
export $shlibpath_var
5794
# fixup the dll searchpath if we need to.
5795
if test -n "$dllsearchpath"; then
5797
# Add the dll search path components to the executable PATH
5798
PATH=$dllsearchpath:\$PATH
5803
if test \"\$libtool_execute_magic\" != \"$magic\"; then
5804
# Run the actual program with our arguments.
5807
# Backslashes separate directories on plain windows
5808
*-*-mingw | *-*-os2*)
5810
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5816
exec \"\$progdir/\$program\" \${1+\"\$@\"}
5821
\$echo \"\$0: cannot exec \$program \$*\"
5825
# The program doesn't exist.
5826
\$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5827
\$echo \"This script is just a wrapper for \$program.\" 1>&2
5828
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
5839
# See if we need to build an old-fashioned archive.
5840
for oldlib in $oldlibs; do
5842
if test "$build_libtool_libs" = convenience; then
5843
oldobjs="$libobjs_save"
5844
addlibs="$convenience"
5845
build_libtool_libs=no
5847
if test "$build_libtool_libs" = module; then
5848
oldobjs="$libobjs_save"
5849
build_libtool_libs=no
5851
oldobjs="$old_deplibs $non_pic_objects"
5853
addlibs="$old_convenience"
5856
if test -n "$addlibs"; then
5857
gentop="$output_objdir/${outputname}x"
5858
generated="$generated $gentop"
5860
func_extract_archives $gentop $addlibs
5861
oldobjs="$oldobjs $func_extract_archives_result"
5864
# Do each command in the archive commands.
5865
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5866
cmds=$old_archive_from_new_cmds
5868
# POSIX demands no paths to be encoded in archives. We have
5869
# to avoid creating archives with duplicate basenames if we
5870
# might have to extract them afterwards, e.g., when creating a
5871
# static archive out of a convenience library, or when linking
5872
# the entirety of a libtool archive into another (currently
5873
# not supported by libtool).
5874
if (for obj in $oldobjs
5876
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5877
done | sort | sort -uc >/dev/null 2>&1); then
5880
$echo "copying selected object files to avoid basename conflicts..."
5882
if test -z "$gentop"; then
5883
gentop="$output_objdir/${outputname}x"
5884
generated="$generated $gentop"
5886
$show "${rm}r $gentop"
5887
$run ${rm}r "$gentop"
5888
$show "$mkdir $gentop"
5889
$run $mkdir "$gentop"
5891
if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5896
save_oldobjs=$oldobjs
5899
for obj in $save_oldobjs
5901
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5902
case " $oldobjs " in
5903
" ") oldobjs=$obj ;;
5906
# Make sure we don't pick an alternate name that also
5908
newobj=lt$counter-$objbase
5909
counter=`expr $counter + 1`
5910
case " $oldobjs " in
5911
*[\ /]"$newobj "*) ;;
5912
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5915
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5916
$run ln "$obj" "$gentop/$newobj" ||
5917
$run cp "$obj" "$gentop/$newobj"
5918
oldobjs="$oldobjs $gentop/$newobj"
5920
*) oldobjs="$oldobjs $obj" ;;
5925
eval cmds=\"$old_archive_cmds\"
5927
if len=`expr "X$cmds" : ".*"` &&
5928
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5929
cmds=$old_archive_cmds
5931
# the command line is too long to link in one step, link in parts
5932
$echo "using piecewise archive linking..."
5937
save_oldobjs=$oldobjs
5939
# Is there a better way of finding the last object in the list?
5940
for obj in $save_oldobjs
5944
for obj in $save_oldobjs
5946
oldobjs="$objlist $obj"
5947
objlist="$objlist $obj"
5948
eval test_cmds=\"$old_archive_cmds\"
5949
if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5950
test "$len" -le "$max_cmd_len"; then
5953
# the above command should be used before it gets too long
5955
if test "$obj" = "$last_oldobj" ; then
5958
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5959
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5965
if test "X$oldobjs" = "X" ; then
5966
eval cmds=\"\$concat_cmds\"
5968
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5972
save_ifs="$IFS"; IFS='~'
5973
for cmd in $cmds; do
5977
$run eval "$cmd" || exit $?
5982
if test -n "$generated"; then
5983
$show "${rm}r$generated"
5984
$run ${rm}r$generated
5987
# Now create the libtool archive.
5991
test "$build_old_libs" = yes && old_library="$libname.$libext"
5992
$show "creating $output"
5994
# Preserve any variables that may affect compiler behavior
5995
for var in $variables_saved_for_relink; do
5996
if eval test -z \"\${$var+set}\"; then
5997
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5998
elif eval var_value=\$$var; test -z "$var_value"; then
5999
relink_command="$var=; export $var; $relink_command"
6001
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
6002
relink_command="$var=\"$var_value\"; export $var; $relink_command"
6005
# Quote the link command for shipping.
6006
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6007
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
6008
if test "$hardcode_automatic" = yes ; then
6013
# Only create the output if not a dry run.
6014
if test -z "$run"; then
6015
for installed in no yes; do
6016
if test "$installed" = yes; then
6017
if test -z "$install_libdir"; then
6020
output="$output_objdir/$outputname"i
6021
# Replace all uninstalled libtool libraries with the installed ones
6023
for deplib in $dependency_libs; do
6026
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
6027
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6028
if test -z "$libdir"; then
6029
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6032
newdependency_libs="$newdependency_libs $libdir/$name"
6034
*) newdependency_libs="$newdependency_libs $deplib" ;;
6037
dependency_libs="$newdependency_libs"
6039
for lib in $dlfiles; do
6040
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6041
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6042
if test -z "$libdir"; then
6043
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6046
newdlfiles="$newdlfiles $libdir/$name"
6048
dlfiles="$newdlfiles"
6050
for lib in $dlprefiles; do
6051
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6052
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6053
if test -z "$libdir"; then
6054
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6057
newdlprefiles="$newdlprefiles $libdir/$name"
6059
dlprefiles="$newdlprefiles"
6062
for lib in $dlfiles; do
6064
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6065
*) abs=`pwd`"/$lib" ;;
6067
newdlfiles="$newdlfiles $abs"
6069
dlfiles="$newdlfiles"
6071
for lib in $dlprefiles; do
6073
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6074
*) abs=`pwd`"/$lib" ;;
6076
newdlprefiles="$newdlprefiles $abs"
6078
dlprefiles="$newdlprefiles"
6081
# place dlname in correct position for cygwin
6083
case $host,$output,$installed,$module,$dlname in
6084
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6087
# $outputname - a libtool library file
6088
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6090
# Please DO NOT delete this file!
6091
# It is necessary for linking the library.
6093
# The name that we can dlopen(3).
6096
# Names of this library.
6097
library_names='$library_names'
6099
# The name of the static archive.
6100
old_library='$old_library'
6102
# Libraries that this one depends upon.
6103
dependency_libs='$dependency_libs'
6105
# Version information for $libname.
6110
# Is this an already installed library?
6111
installed=$installed
6113
# Should we warn about portability when linking against -modules?
6114
shouldnotlink=$module
6116
# Files to dlopen/dlpreopen
6118
dlpreopen='$dlprefiles'
6120
# Directory that this library needs to be installed in:
6121
libdir='$install_libdir'"
6122
if test "$installed" = no && test "$need_relink" = yes; then
6124
relink_command=\"$relink_command\""
6129
# Do a symbolic link so that the libtool archive can be found in
6130
# LD_LIBRARY_PATH before the program is installed.
6131
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6132
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6138
# libtool install mode
6140
modename="$modename: install"
6142
# There may be an optional sh(1) argument at the beginning of
6143
# install_prog (especially on Windows NT).
6144
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6145
# Allow the use of GNU shtool's install command.
6146
$echo "X$nonopt" | grep shtool > /dev/null; then
6147
# Aesthetically quote it.
6148
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6150
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6154
install_prog="$arg "
6162
# The real first argument should be the name of the installation program.
6163
# Aesthetically quote it.
6164
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6166
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6170
install_prog="$install_prog$arg"
6172
# We need to accept at least all the BSD install flags.
6182
if test -n "$dest"; then
6183
files="$files $dest"
6191
case " $install_prog " in
6196
-g | -m | -o) prev=$arg ;;
6204
# If the previous option needed an argument, then skip it.
6205
if test -n "$prev"; then
6214
# Aesthetically quote the argument.
6215
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6217
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6221
install_prog="$install_prog $arg"
6224
if test -z "$install_prog"; then
6225
$echo "$modename: you must specify an install program" 1>&2
6230
if test -n "$prev"; then
6231
$echo "$modename: the \`$prev' option requires an argument" 1>&2
6236
if test -z "$files"; then
6237
if test -z "$dest"; then
6238
$echo "$modename: no file or destination specified" 1>&2
6240
$echo "$modename: you must specify a destination" 1>&2
6246
# Strip any trailing slash from the destination.
6247
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6249
# Check to see that the destination is a directory.
6250
test -d "$dest" && isdir=yes
6251
if test "$isdir" = yes; then
6255
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6256
test "X$destdir" = "X$dest" && destdir=.
6257
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6259
# Not a directory, so check to see that there is only one file specified.
6261
if test "$#" -gt 2; then
6262
$echo "$modename: \`$dest' is not a directory" 1>&2
6268
[\\/]* | [A-Za-z]:[\\/]*) ;;
6270
for file in $files; do
6274
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6283
# This variable tells wrapper scripts just to set variables rather
6284
# than running their programs.
6285
libtool_install_magic="$magic"
6290
for file in $files; do
6292
# Do each installation.
6295
# Do the static libraries later.
6296
staticlibs="$staticlibs $file"
6300
# Check to see that this really is a libtool archive.
6301
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6303
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6311
# If there is no directory component, then add one.
6313
*/* | *\\*) . $file ;;
6317
# Add the libdir to current_libdirs if it is the destination.
6318
if test "X$destdir" = "X$libdir"; then
6319
case "$current_libdirs " in
6321
*) current_libdirs="$current_libdirs $libdir" ;;
6324
# Note the libdir as a future libdir.
6325
case "$future_libdirs " in
6327
*) future_libdirs="$future_libdirs $libdir" ;;
6331
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6332
test "X$dir" = "X$file/" && dir=
6335
if test -n "$relink_command"; then
6336
# Determine the prefix the user has applied to our future dir.
6337
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6339
# Don't allow the user to place us outside of our expected
6340
# location b/c this prevents finding dependent libraries that
6341
# are installed to the same prefix.
6342
# At present, this check doesn't affect windows .dll's that
6343
# are installed into $libdir/../bin (currently, that works fine)
6344
# but it's something to keep an eye on.
6345
if test "$inst_prefix_dir" = "$destdir"; then
6346
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6350
if test -n "$inst_prefix_dir"; then
6351
# Stick the inst_prefix_dir data into the link command.
6352
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6354
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6357
$echo "$modename: warning: relinking \`$file'" 1>&2
6358
$show "$relink_command"
6359
if $run eval "$relink_command"; then :
6361
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6366
# See the names of the shared library.
6367
set dummy $library_names
6368
if test -n "$2"; then
6374
test -n "$relink_command" && srcname="$realname"T
6376
# Install the shared library and build the symlinks.
6377
$show "$install_prog $dir/$srcname $destdir/$realname"
6378
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6379
if test -n "$stripme" && test -n "$striplib"; then
6380
$show "$striplib $destdir/$realname"
6381
$run eval "$striplib $destdir/$realname" || exit $?
6384
if test "$#" -gt 0; then
6385
# Delete the old symlinks, and create new ones.
6386
# Try `ln -sf' first, because the `ln' binary might depend on
6387
# the symlink we replace! Solaris /bin/ln does not understand -f,
6388
# so we also need to try rm && ln -s.
6391
if test "$linkname" != "$realname"; then
6392
$show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6393
$run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6398
# Do each command in the postinstall commands.
6399
lib="$destdir/$realname"
6400
cmds=$postinstall_cmds
6401
save_ifs="$IFS"; IFS='~'
6402
for cmd in $cmds; do
6406
$run eval "$cmd" || {
6409
# Restore the uninstalled library and exit
6410
if test "$mode" = relink; then
6411
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6420
# Install the pseudo-library for information purposes.
6421
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6422
instname="$dir/$name"i
6423
$show "$install_prog $instname $destdir/$name"
6424
$run eval "$install_prog $instname $destdir/$name" || exit $?
6426
# Maybe install the static library, too.
6427
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6431
# Install (i.e. copy) a libtool object.
6433
# Figure out destination file name, if it wasn't already specified.
6434
if test -n "$destname"; then
6435
destfile="$destdir/$destname"
6437
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6438
destfile="$destdir/$destfile"
6441
# Deduce the name of the destination old-style object file.
6444
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6447
staticdest="$destfile"
6451
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6457
# Install the libtool object if requested.
6458
if test -n "$destfile"; then
6459
$show "$install_prog $file $destfile"
6460
$run eval "$install_prog $file $destfile" || exit $?
6463
# Install the old object if enabled.
6464
if test "$build_old_libs" = yes; then
6465
# Deduce the name of the old-style object file.
6466
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6468
$show "$install_prog $staticobj $staticdest"
6469
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
6475
# Figure out destination file name, if it wasn't already specified.
6476
if test -n "$destname"; then
6477
destfile="$destdir/$destname"
6479
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6480
destfile="$destdir/$destfile"
6483
# If the file is missing, and there is a .exe on the end, strip it
6484
# because it is most likely a libtool script we actually want to
6489
if test ! -f "$file"; then
6490
file=`$echo $file|${SED} 's,.exe$,,'`
6496
# Do a test to see if this is really a libtool program.
6499
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6505
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6509
# Note that it is not necessary on cygwin/mingw to append a dot to
6510
# foo even if both foo and FILE.exe exist: automatic-append-.exe
6511
# behavior happens only for exec(3), not for open(2)! Also, sourcing
6512
# `FILE.' does not work on cygwin managed mounts.
6514
# If there is no directory component, then add one.
6516
*/* | *\\*) . ${wrapper} ;;
6517
*) . ./${wrapper} ;;
6520
# Check the variables that should have been set.
6521
if test -z "$notinst_deplibs"; then
6522
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6527
for lib in $notinst_deplibs; do
6528
# Check to see that each library is installed.
6530
if test -f "$lib"; then
6531
# If there is no directory component, then add one.
6533
*/* | *\\*) . $lib ;;
6537
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6538
if test -n "$libdir" && test ! -f "$libfile"; then
6539
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6545
# Note that it is not necessary on cygwin/mingw to append a dot to
6546
# foo even if both foo and FILE.exe exist: automatic-append-.exe
6547
# behavior happens only for exec(3), not for open(2)! Also, sourcing
6548
# `FILE.' does not work on cygwin managed mounts.
6550
# If there is no directory component, then add one.
6552
*/* | *\\*) . ${wrapper} ;;
6553
*) . ./${wrapper} ;;
6557
if test "$fast_install" = no && test -n "$relink_command"; then
6558
if test "$finalize" = yes && test -z "$run"; then
6559
tmpdir=`func_mktempdir`
6560
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6561
outputname="$tmpdir/$file"
6562
# Replace the output file specification.
6563
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6565
$show "$relink_command"
6566
if $run eval "$relink_command"; then :
6568
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6574
$echo "$modename: warning: cannot relink \`$file'" 1>&2
6577
# Install the binary that we compiled earlier.
6578
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6582
# remove .exe since cygwin /usr/bin/install will append another
6584
case $install_prog,$host in
6585
*/usr/bin/install*,*cygwin*)
6586
case $file:$destfile in
6591
destfile=$destfile.exe
6594
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6599
$show "$install_prog$stripme $file $destfile"
6600
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6601
test -n "$outputname" && ${rm}r "$tmpdir"
6606
for file in $staticlibs; do
6607
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6609
# Set up the ranlib parameters.
6610
oldlib="$destdir/$name"
6612
$show "$install_prog $file $oldlib"
6613
$run eval "$install_prog \$file \$oldlib" || exit $?
6615
if test -n "$stripme" && test -n "$old_striplib"; then
6616
$show "$old_striplib $oldlib"
6617
$run eval "$old_striplib $oldlib" || exit $?
6620
# Do each command in the postinstall commands.
6621
cmds=$old_postinstall_cmds
6622
save_ifs="$IFS"; IFS='~'
6623
for cmd in $cmds; do
6627
$run eval "$cmd" || exit $?
6632
if test -n "$future_libdirs"; then
6633
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6636
if test -n "$current_libdirs"; then
6637
# Maybe just do a dry run.
6638
test -n "$run" && current_libdirs=" -n$current_libdirs"
6639
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6645
# libtool finish mode
6647
modename="$modename: finish"
6651
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6654
libdirs="$libdirs $dir"
6657
for libdir in $libdirs; do
6658
if test -n "$finish_cmds"; then
6659
# Do each command in the finish commands.
6661
save_ifs="$IFS"; IFS='~'
6662
for cmd in $cmds; do
6666
$run eval "$cmd" || admincmds="$admincmds
6671
if test -n "$finish_eval"; then
6672
# Do the single finish_eval.
6673
eval cmds=\"$finish_eval\"
6674
$run eval "$cmds" || admincmds="$admincmds
6680
# Exit here if they wanted silent mode.
6681
test "$show" = : && exit $EXIT_SUCCESS
6683
$echo "X----------------------------------------------------------------------" | $Xsed
6684
$echo "Libraries have been installed in:"
6685
for libdir in $libdirs; do
6689
$echo "If you ever happen to want to link against installed libraries"
6690
$echo "in a given directory, LIBDIR, you must either use libtool, and"
6691
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6692
$echo "flag during linking and do at least one of the following:"
6693
if test -n "$shlibpath_var"; then
6694
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6695
$echo " during execution"
6697
if test -n "$runpath_var"; then
6698
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
6699
$echo " during linking"
6701
if test -n "$hardcode_libdir_flag_spec"; then
6703
eval flag=\"$hardcode_libdir_flag_spec\"
6705
$echo " - use the \`$flag' linker flag"
6707
if test -n "$admincmds"; then
6708
$echo " - have your system administrator run these commands:$admincmds"
6710
if test -f /etc/ld.so.conf; then
6711
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6714
$echo "See any operating system documentation about shared libraries for"
6715
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
6716
$echo "X----------------------------------------------------------------------" | $Xsed
6720
# libtool execute mode
6722
modename="$modename: execute"
6724
# The first argument is the command name.
6726
if test -z "$cmd"; then
6727
$echo "$modename: you must specify a COMMAND" 1>&2
6732
# Handle -dlopen flags immediately.
6733
for file in $execute_dlfiles; do
6734
if test ! -f "$file"; then
6735
$echo "$modename: \`$file' is not a file" 1>&2
6743
# Check to see that this really is a libtool archive.
6744
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6746
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6751
# Read the libtool library.
6755
# If there is no directory component, then add one.
6757
*/* | *\\*) . $file ;;
6761
# Skip this library if it cannot be dlopened.
6762
if test -z "$dlname"; then
6763
# Warn if it was a shared library.
6764
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6768
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6769
test "X$dir" = "X$file" && dir=.
6771
if test -f "$dir/$objdir/$dlname"; then
6774
if test ! -f "$dir/$dlname"; then
6775
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6782
# Just add the directory containing the .lo file.
6783
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6784
test "X$dir" = "X$file" && dir=.
6788
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6793
# Get the absolute pathname.
6794
absdir=`cd "$dir" && pwd`
6795
test -n "$absdir" && dir="$absdir"
6797
# Now add the directory to shlibpath_var.
6798
if eval "test -z \"\$$shlibpath_var\""; then
6799
eval "$shlibpath_var=\"\$dir\""
6801
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6805
# This variable tells wrapper scripts just to set shlibpath_var
6806
# rather than running their programs.
6807
libtool_execute_magic="$magic"
6809
# Check if any of the arguments is a wrapper script.
6816
# Do a test to see if this is really a libtool program.
6817
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6818
# If there is no directory component, then add one.
6820
*/* | *\\*) . $file ;;
6824
# Transform arg to wrapped name.
6825
file="$progdir/$program"
6829
# Quote arguments (to preserve shell metacharacters).
6830
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6831
args="$args \"$file\""
6834
if test -z "$run"; then
6835
if test -n "$shlibpath_var"; then
6836
# Export the shlibpath_var.
6837
eval "export $shlibpath_var"
6840
# Restore saved environment variables
6841
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6843
eval "if test \"\${save_$lt_var+set}\" = set; then
6844
$lt_var=\$save_$lt_var; export $lt_var
6848
# Now prepare to actually exec the command.
6849
exec_cmd="\$cmd$args"
6851
# Display what would be done.
6852
if test -n "$shlibpath_var"; then
6853
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6854
$echo "export $shlibpath_var"
6861
# libtool clean and uninstall mode
6863
modename="$modename: $mode"
6869
# This variable tells wrapper scripts just to set variables rather
6870
# than running their programs.
6871
libtool_install_magic="$magic"
6876
-f) rm="$rm $arg"; rmforce=yes ;;
6877
-*) rm="$rm $arg" ;;
6878
*) files="$files $arg" ;;
6882
if test -z "$rm"; then
6883
$echo "$modename: you must specify an RM program" 1>&2
6890
origobjdir="$objdir"
6891
for file in $files; do
6892
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6893
if test "X$dir" = "X$file"; then
6895
objdir="$origobjdir"
6897
objdir="$dir/$origobjdir"
6899
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6900
test "$mode" = uninstall && objdir="$dir"
6902
# Remember objdir for removal later, being careful to avoid duplicates
6903
if test "$mode" = clean; then
6906
*) rmdirs="$rmdirs $objdir" ;;
6910
# Don't error if the file doesn't exist and rm -f was used.
6911
if (test -L "$file") >/dev/null 2>&1 \
6912
|| (test -h "$file") >/dev/null 2>&1 \
6913
|| test -f "$file"; then
6915
elif test -d "$file"; then
6918
elif test "$rmforce" = yes; then
6926
# Possibly a libtool archive, so verify it.
6927
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6930
# Delete the libtool libraries and symlinks.
6931
for n in $library_names; do
6932
rmfiles="$rmfiles $objdir/$n"
6934
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6938
case " $library_names " in
6939
# " " in the beginning catches empty $dlname
6941
*) rmfiles="$rmfiles $objdir/$dlname" ;;
6943
test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6946
if test -n "$library_names"; then
6947
# Do each command in the postuninstall commands.
6948
cmds=$postuninstall_cmds
6949
save_ifs="$IFS"; IFS='~'
6950
for cmd in $cmds; do
6955
if test "$?" -ne 0 && test "$rmforce" != yes; then
6962
if test -n "$old_library"; then
6963
# Do each command in the old_postuninstall commands.
6964
cmds=$old_postuninstall_cmds
6965
save_ifs="$IFS"; IFS='~'
6966
for cmd in $cmds; do
6971
if test "$?" -ne 0 && test "$rmforce" != yes; then
6977
# FIXME: should reinstall the best remaining shared library.
6984
# Possibly a libtool object, so verify it.
6985
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6990
# Add PIC object to the list of files to remove.
6991
if test -n "$pic_object" \
6992
&& test "$pic_object" != none; then
6993
rmfiles="$rmfiles $dir/$pic_object"
6996
# Add non-PIC object to the list of files to remove.
6997
if test -n "$non_pic_object" \
6998
&& test "$non_pic_object" != none; then
6999
rmfiles="$rmfiles $dir/$non_pic_object"
7005
if test "$mode" = clean ; then
7009
file=`$echo $file|${SED} 's,.exe$,,'`
7010
noexename=`$echo $name|${SED} 's,.exe$,,'`
7011
# $file with .exe has already been added to rmfiles,
7012
# add $file without .exe
7013
rmfiles="$rmfiles $file"
7016
# Do a test to see if this is a libtool program.
7017
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7021
# note $name still contains .exe if it was in $file originally
7022
# as does the version of $file that was added into $rmfiles
7023
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7024
if test "$fast_install" = yes && test -n "$relink_command"; then
7025
rmfiles="$rmfiles $objdir/lt-$name"
7027
if test "X$noexename" != "X$name" ; then
7028
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7034
$show "$rm $rmfiles"
7035
$run $rm $rmfiles || exit_status=1
7037
objdir="$origobjdir"
7039
# Try to remove the ${objdir}s in the directories where we deleted files
7040
for dir in $rmdirs; do
7041
if test -d "$dir"; then
7043
$run rmdir $dir >/dev/null 2>&1
7051
$echo "$modename: you must specify a MODE" 1>&2
7052
$echo "$generic_help" 1>&2
7057
if test -z "$exec_cmd"; then
7058
$echo "$modename: invalid operation mode \`$mode'" 1>&2
7059
$echo "$generic_help" 1>&2
7062
fi # test -z "$show_help"
7064
if test -n "$exec_cmd"; then
7069
# We need to display help for each of the modes.
7072
"Usage: $modename [OPTION]... [MODE-ARG]...
7074
Provide generalized library-building support services.
7076
--config show all configuration variables
7077
--debug enable verbose shell tracing
7078
-n, --dry-run display commands without modifying any files
7079
--features display basic configuration information and exit
7080
--finish same as \`--mode=finish'
7081
--help display this help message and exit
7082
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7083
--quiet same as \`--silent'
7084
--silent don't print informational messages
7085
--tag=TAG use configuration variables from tag TAG
7086
--version print version information
7088
MODE must be one of the following:
7090
clean remove files from the build directory
7091
compile compile a source file into a libtool object
7092
execute automatically set library path, then run a program
7093
finish complete the installation of libtool libraries
7094
install install libraries or executables
7095
link create a library or an executable
7096
uninstall remove libraries from an installed directory
7098
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7099
a more detailed description of MODE.
7101
Report bugs to <bug-libtool@gnu.org>."
7107
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7109
Remove files from the build directory.
7111
RM is the name of the program to use to delete files associated with each FILE
7112
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7115
If FILE is a libtool library, object or program, all the files associated
7116
with it are deleted. Otherwise, only FILE itself is deleted using RM."
7121
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7123
Compile a source file into a libtool library object.
7125
This mode accepts the following additional options:
7127
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
7128
-prefer-pic try to building PIC objects only
7129
-prefer-non-pic try to building non-PIC objects only
7130
-static always build a \`.o' file suitable for static linking
7132
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7133
from the given SOURCEFILE.
7135
The output file name is determined by removing the directory component from
7136
SOURCEFILE, then substituting the C source code suffix \`.c' with the
7137
library object suffix, \`.lo'."
7142
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7144
Automatically set library path, then run a program.
7146
This mode accepts the following additional options:
7148
-dlopen FILE add the directory containing FILE to the library path
7150
This mode sets the library path environment variable according to \`-dlopen'
7153
If any of the ARGS are libtool executable wrappers, then they are translated
7154
into their corresponding uninstalled binary, and any of their required library
7155
directories are added to the library path.
7157
Then, COMMAND is executed, with ARGS as arguments."
7162
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7164
Complete the installation of libtool libraries.
7166
Each LIBDIR is a directory that contains libtool libraries.
7168
The commands that this mode executes may require superuser privileges. Use
7169
the \`--dry-run' option if you just want to see what would be executed."
7174
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7176
Install executables or libraries.
7178
INSTALL-COMMAND is the installation command. The first component should be
7179
either the \`install' or \`cp' program.
7181
The rest of the components are interpreted as arguments to that command (only
7182
BSD-compatible install options are recognized)."
7187
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7189
Link object files or libraries together to form another library, or to
7190
create an executable program.
7192
LINK-COMMAND is a command using the C compiler that you would use to create
7193
a program from several object files.
7195
The following components of LINK-COMMAND are treated specially:
7197
-all-static do not do any dynamic linking at all
7198
-avoid-version do not add a version suffix if possible
7199
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7200
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7201
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7202
-export-symbols SYMFILE
7203
try to export only the symbols listed in SYMFILE
7204
-export-symbols-regex REGEX
7205
try to export only the symbols matching REGEX
7206
-LLIBDIR search LIBDIR for required installed libraries
7207
-lNAME OUTPUT-FILE requires the installed library libNAME
7208
-module build a library that can dlopened
7209
-no-fast-install disable the fast-install mode
7210
-no-install link a not-installable executable
7211
-no-undefined declare that a library does not refer to external symbols
7212
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7213
-objectlist FILE Use a list of object files found in FILE to specify objects
7214
-precious-files-regex REGEX
7215
don't remove output files matching REGEX
7216
-release RELEASE specify package release information
7217
-rpath LIBDIR the created library will eventually be installed in LIBDIR
7218
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7219
-static do not do any dynamic linking of uninstalled libtool libraries
7220
-static-libtool-libs
7221
do not do any dynamic linking of libtool libraries
7222
-version-info CURRENT[:REVISION[:AGE]]
7223
specify library version info [each variable defaults to 0]
7225
All other options (arguments beginning with \`-') are ignored.
7227
Every other argument is treated as a filename. Files ending in \`.la' are
7228
treated as uninstalled libtool libraries, other files are standard or library
7231
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7232
only library objects (\`.lo' files) may be specified, and \`-rpath' is
7233
required, except when creating a convenience library.
7235
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7236
using \`ar' and \`ranlib', or on Windows using \`lib'.
7238
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7239
is created, otherwise an executable program is created."
7244
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7246
Remove libraries from an installation directory.
7248
RM is the name of the program to use to delete files associated with each FILE
7249
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7252
If FILE is a libtool library, all the files associated with it are deleted.
7253
Otherwise, only FILE itself is deleted using RM."
7257
$echo "$modename: invalid operation mode \`$mode'" 1>&2
7264
$echo "Try \`$modename --help' for more information about other modes."
7268
# The TAGs below are defined such that we never get into a situation
7269
# in which we disable both kinds of libraries. Given conflicting
7270
# choices, we go for a static library, that is the most portable,
7271
# since we can't tell whether shared libraries were disabled because
7272
# the user asked for that or because the platform doesn't support
7273
# them. This is particularly important on AIX, because we don't
7274
# support having both static and shared libraries enabled at the same
7275
# time on that platform, so we default to a shared-only configuration.
7276
# If a disable-shared tag is given, we'll fallback to a static-only
7277
# configuration. But we'll never go from static-only to shared-only.
7279
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7281
# ### END LIBTOOL TAG CONFIG: disable-shared
7283
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
7285
# ### END LIBTOOL TAG CONFIG: disable-static
7291
# ### BEGIN LIBTOOL TAG CONFIG: CXX
7293
# Libtool was configured on host ubu-necropotame:
7295
# Shell to use when invoking shell scripts.
7298
# Whether or not to build shared libraries.
7299
build_libtool_libs=yes
7301
# Whether or not to build static libraries.
7304
# Whether or not to add -lc for building shared libraries.
7305
build_libtool_need_lc=no
7307
# Whether or not to disallow shared libs when runtime libs are static
7308
allow_libtool_libs_with_static_runtimes=no
7310
# Whether or not to optimize for fast installation.
7315
host=i686-pc-linux-gnu
7320
build=i686-pc-linux-gnu
7323
# An echo program that does not interpret backslashes.
7333
# LTCC compiler flags.
7336
# A language-specific compiler.
7339
# Is the compiler the GNU C compiler?
7343
EGREP="/bin/grep -E"
7345
# The linker used to build libraries.
7348
# Whether we need hard or soft links.
7351
# A BSD-compatible nm program.
7354
# A symbol stripping program
7357
# Used to examine libraries when file_magic_cmd begins "file"
7360
# Used on cygwin: DLL creation program.
7363
# Used on cygwin: object dumper.
7366
# Used on cygwin: assembler.
7369
# The name of the directory that contains temporary libtool files.
7372
# How to create reloadable object files.
7374
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7376
# How to pass a linker flag through the compiler.
7379
# Object file suffix (normally "o").
7382
# Old archive suffix (normally "a").
7385
# Shared library suffix (normally ".so").
7388
# Executable file suffix (normally "").
7391
# Additional compiler flags for building library objects.
7392
pic_flag=" -fPIC -DPIC"
7395
# What is the maximum length of a command?
7398
# Does compiler simultaneously support -c and -o options?
7401
# Must we lock files when doing compilation?
7404
# Do we need the lib prefix for modules?
7407
# Do we need a version for libraries?
7410
# Whether dlopen is supported.
7411
dlopen_support=unknown
7413
# Whether dlopen of programs is supported.
7416
# Whether dlopen of statically linked programs is supported.
7417
dlopen_self_static=unknown
7419
# Compiler flag to prevent dynamic linking.
7420
link_static_flag="-static"
7422
# Compiler flag to turn off builtin functions.
7423
no_builtin_flag=" -fno-builtin"
7425
# Compiler flag to allow reflexive dlopens.
7426
export_dynamic_flag_spec="\${wl}--export-dynamic"
7428
# Compiler flag to generate shared objects directly from archives.
7429
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7431
# Compiler flag to generate thread-safe objects.
7432
thread_safe_flag_spec=""
7434
# Library versioning type.
7437
# Format of library name prefix.
7438
libname_spec="lib\$name"
7440
# List of archive names. First name is the real one, the rest are links.
7441
# The last name is the one that the linker finds with -lNAME.
7442
library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
7444
# The coded name of the library, if different from the real name.
7445
soname_spec="\${libname}\${release}\${shared_ext}\$major"
7447
# Commands used to build and install an old-style archive.
7449
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
7450
old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7451
old_postuninstall_cmds=""
7453
# Create an old-style archive from a shared archive.
7454
old_archive_from_new_cmds=""
7456
# Create a temporary old-style archive to link instead of a shared archive.
7457
old_archive_from_expsyms_cmds=""
7459
# Commands used to build and install a shared archive.
7460
archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7461
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"
7463
postuninstall_cmds=""
7465
# Commands used to build a loadable module (assumed same as above if empty)
7467
module_expsym_cmds=""
7469
# Commands to strip libraries.
7470
old_striplib="strip --strip-debug"
7471
striplib="strip --strip-unneeded"
7473
# Dependencies to place before the objects being linked to create a
7475
predep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.1.3/crtbeginS.o"
7477
# Dependencies to place after the objects being linked to create a
7479
postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crtn.o"
7481
# Dependencies to place before the objects being linked to create a
7485
# Dependencies to place after the objects being linked to create a
7487
postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7489
# The library search path used internally by the compiler when linking
7491
compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.1.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib"
7493
# Method to check whether dependent libraries are shared objects.
7494
deplibs_check_method="pass_all"
7496
# Command to use when deplibs_check_method == file_magic.
7497
file_magic_cmd="\$MAGIC_CMD"
7499
# Flag that allows shared libraries with undefined symbols to be built.
7500
allow_undefined_flag=""
7502
# Flag that forces no undefined symbols.
7503
no_undefined_flag=""
7505
# Commands used to finish a libtool library installation in a directory.
7506
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7508
# Same as above, but a single script fragment to be evaled but not shown.
7511
# Take the output of nm and produce a listing of raw symbols and C names.
7512
global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7514
# Transform the output of nm in a proper C declaration
7515
global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7517
# Transform the output of nm in a C name address pair
7518
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7520
# This is the shared library runtime path variable.
7521
runpath_var=LD_RUN_PATH
7523
# This is the shared library path variable.
7524
shlibpath_var=LD_LIBRARY_PATH
7526
# Is shlibpath searched before the hard-coded library search path?
7527
shlibpath_overrides_runpath=no
7529
# How to hardcode a shared library path into an executable.
7530
hardcode_action=immediate
7532
# Whether we should hardcode library paths into libraries.
7533
hardcode_into_libs=yes
7535
# Flag to hardcode $libdir into a binary during linking.
7536
# This must work even if $libdir does not exist.
7537
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
7539
# If ld is used when linking, flag to hardcode $libdir into
7540
# a binary during linking. This must work even if $libdir does
7542
hardcode_libdir_flag_spec_ld=""
7544
# Whether we need a single -rpath flag with a separated argument.
7545
hardcode_libdir_separator=""
7547
# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7551
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7555
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7556
# the resulting binary.
7557
hardcode_shlibpath_var=unsupported
7559
# Set to yes if building a shared library automatically hardcodes DIR into the library
7560
# and all subsequent libraries and executables linked against it.
7561
hardcode_automatic=no
7563
# Variables whose values should be saved in libtool wrapper scripts and
7564
# restored at relink time.
7565
variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7567
# Whether libtool must link a program against all its dependency libraries.
7570
# Compile-time system search path for libraries
7571
sys_lib_search_path_spec="/usr/lib/gcc/i486-linux-gnu/4.1.3 /usr/lib /lib"
7573
# Run-time system search path for libraries
7574
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib "
7576
# Fix the shell variable $srcfile for the compiler.
7579
# Set to yes if exported symbols are required.
7580
always_export_symbols=no
7582
# The commands to list exported symbols.
7583
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7585
# The commands to extract the exported symbol list from a shared archive.
7586
extract_expsyms_cmds=""
7588
# Symbols that should not be listed in the preloaded symbols.
7591
# Symbols that must always be exported.
7594
# ### END LIBTOOL TAG CONFIG: CXX