3
# libtool - Provide generalized library-building support services.
4
# Generated automatically by (GNU )
5
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7
# Copyright (C) 1996-2000 Free Software Foundation, Inc.
8
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
10
# This program is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU General Public License as published by
12
# the Free Software Foundation; either version 2 of the License, or
13
# (at your option) any later version.
15
# This program is distributed in the hope that it will be useful, but
16
# WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
# General Public License for more details.
20
# You should have received a copy of the GNU General Public License
21
# along with this program; if not, write to the Free Software
22
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
# As a special exception to the GNU General Public License, if you
25
# distribute this file as part of a program that contains a
26
# configuration script generated by Autoconf, you may include it under
27
# the same distribution terms that you use for the rest of that program.
29
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
32
# The HP-UX ksh and POSIX shell print the target directory to stdout
34
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
36
# ### BEGIN LIBTOOL CONFIG
38
# Libtool was configured on host linux-6tvq:
40
# Shell to use when invoking shell scripts.
43
# Whether or not to build shared libraries.
44
build_libtool_libs=yes
46
# Whether or not to build static libraries.
49
# Whether or not to add -lc for building shared libraries.
50
build_libtool_need_lc=no
52
# Whether or not to optimize for fast installation.
57
host=x86_64-unknown-linux-gnu
59
# An echo program that does not interpret backslashes.
66
# The default C compiler.
69
# Is the compiler the GNU C compiler?
72
# The linker used to build libraries.
73
LD="/usr/x86_64-suse-linux/bin/ld"
75
# Whether we need hard or soft links.
78
# A BSD-compatible nm program.
81
# A symbol stripping program
84
# Used to examine libraries when file_magic_cmd begins "file"
87
# Used on cygwin: DLL creation program.
90
# Used on cygwin: object dumper.
93
# Used on cygwin: assembler.
96
# The name of the directory that contains temporary libtool files.
99
# How to create reloadable object files.
101
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
103
# How to pass a linker flag through the compiler.
106
# Object file suffix (normally "o").
109
# Old archive suffix (normally "a").
112
# Executable file suffix (normally "").
115
# Additional compiler flags for building library objects.
119
# Does compiler simultaneously support -c and -o options?
122
# Can we write directly to a .lo ?
125
# Must we lock files when doing compilation ?
128
# Do we need the lib prefix for modules?
131
# Do we need a version for libraries?
134
# Whether dlopen is supported.
135
dlopen_support=unknown
137
# Whether dlopen of programs is supported.
140
# Whether dlopen of statically linked programs is supported.
141
dlopen_self_static=unknown
143
# Compiler flag to prevent dynamic linking.
144
link_static_flag="-static"
146
# Compiler flag to turn off builtin functions.
147
no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
149
# Compiler flag to allow reflexive dlopens.
150
export_dynamic_flag_spec="\${wl}--export-dynamic"
152
# Compiler flag to generate shared objects directly from archives.
153
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
155
# Compiler flag to generate thread-safe objects.
156
thread_safe_flag_spec=""
158
# Library versioning type.
161
# Format of library name prefix.
162
libname_spec="lib\$name"
164
# List of archive names. First name is the real one, the rest are links.
165
# The last name is the one that the linker finds with -lNAME.
166
library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
168
# The coded name of the library, if different from the real name.
169
soname_spec="\${libname}\${release}.so\$major"
171
# Commands used to build and install an old-style archive.
173
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
174
old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
175
old_postuninstall_cmds=""
177
# Create an old-style archive from a shared archive.
178
old_archive_from_new_cmds=""
180
# Create a temporary old-style archive to link instead of a shared archive.
181
old_archive_from_expsyms_cmds=""
183
# Commands used to build and install a shared archive.
184
archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
185
archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
187
postuninstall_cmds=""
189
# Commands to strip libraries.
190
old_striplib="strip --strip-debug"
191
striplib="strip --strip-unneeded"
193
# Method to check whether dependent libraries are shared objects.
194
deplibs_check_method="pass_all"
196
# Command to use when deplibs_check_method == file_magic.
197
file_magic_cmd="\$MAGIC_CMD"
199
# Flag that allows shared libraries with undefined symbols to be built.
200
allow_undefined_flag=""
202
# Flag that forces no undefined symbols.
205
# Commands used to finish a libtool library installation in a directory.
206
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
208
# Same as above, but a single script fragment to be evaled but not shown.
211
# Take the output of nm and produce a listing of raw symbols and C names.
212
global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
214
# Transform the output of nm in a proper C declaration
215
global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
217
# Transform the output of nm in a C name address pair
218
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
220
# This is the shared library runtime path variable.
221
runpath_var=LD_RUN_PATH
223
# This is the shared library path variable.
224
shlibpath_var=LD_LIBRARY_PATH
226
# Is shlibpath searched before the hard-coded library search path?
227
shlibpath_overrides_runpath=no
229
# How to hardcode a shared library path into an executable.
230
hardcode_action=immediate
232
# Whether we should hardcode library paths into libraries.
233
hardcode_into_libs=yes
235
# Flag to hardcode $libdir into a binary during linking.
236
# This must work even if $libdir does not exist.
237
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
239
# Whether we need a single -rpath flag with a separated argument.
240
hardcode_libdir_separator=""
242
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
246
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
250
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
251
# the resulting binary.
252
hardcode_shlibpath_var=unsupported
254
# Variables whose values should be saved in libtool wrapper scripts and
255
# restored at relink time.
256
variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
258
# Whether libtool must link a program against all its dependency libraries.
259
link_all_deplibs=unknown
261
# Compile-time system search path for libraries
262
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
264
# Run-time system search path for libraries
265
sys_lib_dlsearch_path_spec="/lib /usr/lib"
267
# Fix the shell variable $srcfile for the compiler.
270
# Set to yes if exported symbols are required.
271
always_export_symbols=no
273
# The commands to list exported symbols.
274
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
276
# The commands to extract the exported symbol list from a shared archive.
277
extract_expsyms_cmds=""
279
# Symbols that should not be listed in the preloaded symbols.
280
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
282
# Symbols that must always be exported.
285
# ### END LIBTOOL CONFIG
287
# ltmain.sh - Provide generalized library-building support services.
288
# NOTE: Changing this file will not affect anything until you rerun configure.
290
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
291
# Free Software Foundation, Inc.
292
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
294
# This program is free software; you can redistribute it and/or modify
295
# it under the terms of the GNU General Public License as published by
296
# the Free Software Foundation; either version 2 of the License, or
297
# (at your option) any later version.
299
# This program is distributed in the hope that it will be useful, but
300
# WITHOUT ANY WARRANTY; without even the implied warranty of
301
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
302
# General Public License for more details.
304
# You should have received a copy of the GNU General Public License
305
# along with this program; if not, write to the Free Software
306
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
308
# As a special exception to the GNU General Public License, if you
309
# distribute this file as part of a program that contains a
310
# configuration script generated by Autoconf, you may include it under
311
# the same distribution terms that you use for the rest of that program.
313
# Check that we have a working $echo.
314
if test "X$1" = X--no-reexec; then
315
# Discard the --no-reexec flag, and continue.
317
elif test "X$1" = X--fallback-echo; then
318
# Avoid inline document here, it may be left over
320
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
321
# Yippee, $echo works!
324
# Restart under the correct shell, and then maybe $echo will work.
325
exec $SHELL "$0" --no-reexec ${1+"$@"}
328
if test "X$1" = X--fallback-echo; then
329
# used as fallback echo
337
# The name of this program.
338
progname=`$echo "$0" | sed 's%^.*/%%'`
345
TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)"
348
help="Try \`$progname --help' for more information."
349
magic="%%%MAGIC variable%%%"
354
# Sed substitution that helps us do robust quoting. It backslashifies
355
# metacharacters that are still active within double-quoted strings.
356
Xsed='sed -e 1s/^X//'
357
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
359
NL2SP='tr \015\012 \040\040'
362
# Only set LANG and LC_ALL to C if already set.
363
# These must not be set unconditionally because not all systems understand
364
# e.g. LANG=C (notably SCO).
365
# We save the old values to restore during execute mode.
366
if test "${LC_ALL+set}" = set; then
367
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
369
if test "${LANG+set}" = set; then
370
save_LANG="$LANG"; LANG=C; export LANG
373
# Make sure IFS has a sensible default
376
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
377
echo "$modename: not configured to build any kind of library" 1>&2
378
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
391
lo2o="s/\\.lo\$/.${objext}/"
392
o2lo="s/\\.${objext}\$/.lo/"
394
# Parse our command line options once, thoroughly.
401
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
405
# If the previous option needs an argument, assign it.
406
if test -n "$prev"; then
409
execute_dlfiles="$execute_dlfiles $arg"
421
# Have we seen a non-optional argument yet?
428
echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
433
sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
438
echo "$progname: enabling shell trace mode"
448
if test "$build_libtool_libs" = yes; then
449
echo "enable shared libraries"
451
echo "disable shared libraries"
453
if test "$build_old_libs" = yes; then
454
echo "enable static libraries"
456
echo "disable static libraries"
461
--finish) mode="finish" ;;
463
--mode) prevopt="--mode" prev=mode ;;
464
--mode=*) mode="$optarg" ;;
476
$echo "$modename: unrecognized option \`$arg'" 1>&2
488
if test -n "$prevopt"; then
489
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
494
# If this variable is set in any of the actions, the command in it
495
# will be execed at the end. This prevents here-documents from being
496
# left over by shells.
499
if test -z "$show_help"; then
501
# Infer the operation mode.
502
if test -z "$mode"; then
504
*cc | *++ | gcc* | *-gcc*)
516
*db | *dbx | *strace | *truss)
526
# If we have no mode, but dlfiles were specified, then do execute mode.
527
test -n "$execute_dlfiles" && mode=execute
529
# Just use the default operation mode.
530
if test -z "$mode"; then
531
if test -n "$nonopt"; then
532
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
534
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
541
# Only execute mode is allowed to have -dlopen flags.
542
if test -n "$execute_dlfiles" && test "$mode" != execute; then
543
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
548
# Change the help message to a mode-specific one.
550
help="Try \`$modename --help --mode=$mode' for more information."
552
# These modes are in order of execution frequency so that they run quickly.
554
# libtool compile mode
556
modename="$modename: compile"
557
# Get the compilation command and the source file.
570
# Aesthetically quote the previous argument.
572
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
575
# Double-quote args containing other shell metacharacters.
576
# Many Bourne shells cannot handle close brackets correctly
577
# in scan sets, so we specify it separately.
578
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
583
# Add the previous argument to base_compile.
584
if test -z "$base_compile"; then
585
base_compile="$lastarg"
587
base_compile="$base_compile $lastarg"
593
# Accept any command-line options.
596
if test "$user_target" != "no"; then
597
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
624
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
626
save_ifs="$IFS"; IFS=','
630
# Double-quote args containing other shell metacharacters.
631
# Many Bourne shells cannot handle close brackets correctly
632
# in scan sets, so we specify it separately.
634
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
638
lastarg="$lastarg $arg"
641
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
643
# Add the arguments to base_compile.
644
if test -z "$base_compile"; then
645
base_compile="$lastarg"
647
base_compile="$base_compile $lastarg"
655
# The next one is the -o target name
660
# We got the output file
667
# Accept the current argument as the source file.
671
# Aesthetically quote the previous argument.
673
# Backslashify any backslashes, double quotes, and dollar signs.
674
# These are the only characters that are still specially
675
# interpreted inside of double-quoted scrings.
676
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
678
# Double-quote args containing other shell metacharacters.
679
# Many Bourne shells cannot handle close brackets correctly
680
# in scan sets, so we specify it separately.
682
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
683
lastarg="\"$lastarg\""
687
# Add the previous argument to base_compile.
688
if test -z "$base_compile"; then
689
base_compile="$lastarg"
691
base_compile="$base_compile $lastarg"
699
# Get the name of the library object.
700
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
703
$echo "$modename: you must specify a target with \`-o'" 1>&2
708
# Recognize several different file suffixes.
709
# If the user specifies -o file.o, it is replaced with file.lo
724
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
727
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
729
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
734
if test -z "$base_compile"; then
735
$echo "$modename: you must specify a compilation command" 1>&2
740
# Delete any leftover library objects.
741
if test "$build_old_libs" = yes; then
742
removelist="$obj $libobj"
748
trap "$run $rm $removelist; exit 1" 1 2 15
750
# On Cygwin there's no "real" PIC flag so we must build both object types
752
cygwin* | mingw* | pw32* | os2*)
756
if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
757
# non-PIC code in shared libraries is not supported
761
# Calculate the filename of the output object if compiler does
762
# not support -o with -c
763
if test "$compiler_c_o" = no; then
764
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
765
lockfile="$output_obj.lock"
766
removelist="$removelist $output_obj $lockfile"
767
trap "$run $rm $removelist; exit 1" 1 2 15
773
# Lock this critical section if it is needed
774
# We use this script file to make the link, it avoids creating a new file
775
if test "$need_locks" = yes; then
776
until $run ln "$0" "$lockfile" 2>/dev/null; do
777
$show "Waiting for $lockfile to be removed"
780
elif test "$need_locks" = warn; then
781
if test -f "$lockfile"; then
783
*** ERROR, $lockfile exists and contains:
784
`cat $lockfile 2>/dev/null`
786
This indicates that another process is trying to use the same
787
temporary object file, and libtool could not work around it because
788
your compiler does not support \`-c' and \`-o' together. If you
789
repeat this compilation, it may succeed, by chance, but you had better
790
avoid parallel builds (make -j) in this platform, or get a better
796
echo $srcfile > "$lockfile"
799
if test -n "$fix_srcfile_path"; then
800
eval srcfile=\"$fix_srcfile_path\"
803
# Only build a PIC object if we are building libtool libraries.
804
if test "$build_libtool_libs" = yes; then
805
# Without this assignment, base_compile gets emptied.
806
fbsd_hideous_sh_bug=$base_compile
808
if test "$pic_mode" != no; then
809
# All platforms use -DPIC, to notify preprocessed assembler code.
810
command="$base_compile $srcfile $pic_flag -DPIC"
812
# Don't build PIC code
813
command="$base_compile $srcfile"
815
if test "$build_old_libs" = yes; then
817
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
818
if test "X$dir" = "X$libobj"; then
823
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
825
if test -d "$dir"; then
832
if test $status -ne 0 && test ! -d $dir; then
837
if test "$compiler_o_lo" = yes; then
839
command="$command -o $output_obj"
840
elif test "$compiler_c_o" = yes; then
842
command="$command -o $output_obj"
845
$run $rm "$output_obj"
847
if $run eval "$command"; then :
849
test -n "$output_obj" && $run $rm $removelist
853
if test "$need_locks" = warn &&
854
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
856
*** ERROR, $lockfile contains:
857
`cat $lockfile 2>/dev/null`
859
but it should contain:
862
This indicates that another process is trying to use the same
863
temporary object file, and libtool could not work around it because
864
your compiler does not support \`-c' and \`-o' together. If you
865
repeat this compilation, it may succeed, by chance, but you had better
866
avoid parallel builds (make -j) in this platform, or get a better
873
# Just move the object if needed, then go on to compile the next one
874
if test x"$output_obj" != x"$libobj"; then
875
$show "$mv $output_obj $libobj"
876
if $run $mv $output_obj $libobj; then :
884
# If we have no pic_flag, then copy the object into place and finish.
885
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
886
test "$build_old_libs" = yes; then
887
# Rename the .lo from within objdir to obj
888
if test -f $obj; then
893
$show "$mv $libobj $obj"
894
if $run $mv $libobj $obj; then :
901
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
902
if test "X$xdir" = "X$obj"; then
907
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
908
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
909
# Now arrange that obj and lo_libobj become the same file
910
$show "(cd $xdir && $LN_S $baseobj $libobj)"
911
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
912
# Unlock the critical section if it was locked
913
if test "$need_locks" != no; then
924
# Allow error messages only from the first compilation.
925
suppress_output=' >/dev/null 2>&1'
928
# Only build a position-dependent object if we build old libraries.
929
if test "$build_old_libs" = yes; then
930
if test "$pic_mode" != yes; then
931
# Don't build PIC code
932
command="$base_compile $srcfile"
934
# All platforms use -DPIC, to notify preprocessed assembler code.
935
command="$base_compile $srcfile $pic_flag -DPIC"
937
if test "$compiler_c_o" = yes; then
938
command="$command -o $obj"
942
# Suppress compiler output if we already did a PIC compilation.
943
command="$command$suppress_output"
944
$run $rm "$output_obj"
946
if $run eval "$command"; then :
952
if test "$need_locks" = warn &&
953
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
955
*** ERROR, $lockfile contains:
956
`cat $lockfile 2>/dev/null`
958
but it should contain:
961
This indicates that another process is trying to use the same
962
temporary object file, and libtool could not work around it because
963
your compiler does not support \`-c' and \`-o' together. If you
964
repeat this compilation, it may succeed, by chance, but you had better
965
avoid parallel builds (make -j) in this platform, or get a better
972
# Just move the object if needed
973
if test x"$output_obj" != x"$obj"; then
974
$show "$mv $output_obj $obj"
975
if $run $mv $output_obj $obj; then :
983
# Create an invalid libtool object if no PIC, so that we do not
984
# accidentally link it into a program.
985
if test "$build_libtool_libs" != yes; then
986
$show "echo timestamp > $libobj"
987
$run eval "echo timestamp > \$libobj" || exit $?
989
# Move the .lo from within objdir
990
$show "$mv $libobj $lo_libobj"
991
if $run $mv $libobj $lo_libobj; then :
1000
# Unlock the critical section if it was locked
1001
if test "$need_locks" != no; then
1002
$run $rm "$lockfile"
1010
modename="$modename: link"
1012
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1013
# It is impossible to link a dll without this setting, and
1014
# we shouldn't force the makefile maintainer to figure out
1015
# which system we are compiling for in order to pass an extra
1016
# flag for every libtool invokation.
1017
# allow_undefined=no
1019
# FIXME: Unfortunately, there are problems with the above when trying
1020
# to make a dll which has undefined symbols, in which case not
1021
# even a static library is built. For now, we need to specify
1022
# -no-undefined on the libtool link line when we can be certain
1023
# that all symbols are satisfied, otherwise we get a static library.
1030
libtool_args="$nonopt"
1031
compile_command="$nonopt"
1032
finalize_command="$nonopt"
1045
lib_search_path=`pwd`
1053
export_symbols_regex=
1060
prefer_static_libs=no
1072
# We need to know -static, to get the right output filenames.
1076
-all-static | -static)
1077
if test "X$arg" = "X-all-static"; then
1078
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1079
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1081
if test -n "$link_static_flag"; then
1082
dlopen_self=$dlopen_self_static
1085
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1086
dlopen_self=$dlopen_self_static
1089
build_libtool_libs=no
1091
prefer_static_libs=yes
1097
# See if our shared archives depend on static archives.
1098
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1100
# Go through the arguments, transforming them on the way.
1101
while test $# -gt 0; do
1105
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1106
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1110
libtool_args="$libtool_args $qarg"
1112
# If the previous option needs an argument, assign it.
1113
if test -n "$prev"; then
1116
compile_command="$compile_command @OUTPUT@"
1117
finalize_command="$finalize_command @OUTPUT@"
1123
if test "$preload" = no; then
1124
# Add the symbol object into the linking commands.
1125
compile_command="$compile_command @SYMFILE@"
1126
finalize_command="$finalize_command @SYMFILE@"
1130
*.la | *.lo) ;; # We handle these cases below.
1132
if test "$dlself" = no; then
1140
if test "$prev" = dlprefiles; then
1142
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1152
if test "$prev" = dlfiles; then
1153
dlfiles="$dlfiles $arg"
1155
dlprefiles="$dlprefiles $arg"
1163
export_symbols="$arg"
1164
if test ! -f "$arg"; then
1165
$echo "$modename: symbol file \`$arg' does not exist"
1172
export_symbols_regex="$arg"
1182
# We need an absolute path.
1184
[\\/]* | [A-Za-z]:[\\/]*) ;;
1186
$echo "$modename: only absolute run-paths are allowed" 1>&2
1190
if test "$prev" = rpath; then
1193
*) rpath="$rpath $arg" ;;
1198
*) xrpath="$xrpath $arg" ;;
1205
compiler_flags="$compiler_flags $qarg"
1207
compile_command="$compile_command $qarg"
1208
finalize_command="$finalize_command $qarg"
1212
linker_flags="$linker_flags $qarg"
1213
compiler_flags="$compiler_flags $wl$qarg"
1215
compile_command="$compile_command $wl$qarg"
1216
finalize_command="$finalize_command $wl$qarg"
1220
eval "$prev=\"\$arg\""
1231
if test -n "$link_static_flag"; then
1232
compile_command="$compile_command $link_static_flag"
1233
finalize_command="$finalize_command $link_static_flag"
1239
# FIXME: remove this flag sometime in the future.
1240
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1264
-export-symbols | -export-symbols-regex)
1265
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1266
$echo "$modename: more than one -exported-symbols argument is not allowed"
1269
if test "X$arg" = "X-export-symbols"; then
1277
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1278
# so, if we see these flags be careful not to treat them like -L
1280
case $with_gcc/$host in
1282
compile_command="$compile_command $arg"
1283
finalize_command="$finalize_command $arg"
1290
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1291
# We need an absolute path.
1293
[\\/]* | [A-Za-z]:[\\/]*) ;;
1295
absdir=`cd "$dir" && pwd`
1296
if test -z "$absdir"; then
1297
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1306
deplibs="$deplibs -L$dir"
1307
lib_search_path="$lib_search_path $dir"
1311
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1312
case :$dllsearchpath: in
1314
*) dllsearchpath="$dllsearchpath:$dir";;
1322
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1324
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1325
# These systems don't actually have a C or math library (as such)
1328
*-*-mingw* | *-*-os2*)
1329
# These systems don't actually have a C library (as such)
1330
test "X$arg" = "X-lc" && continue
1333
# Do not include libc due to us having libc/libc_r.
1334
test "X$arg" = "X-lc" && continue
1337
elif test "X$arg" = "X-lc_r"; then
1340
# Do not include libc_r directly, use -pthread flag.
1345
deplibs="$deplibs $arg"
1354
#### Local change for Sleepycat's Berkeley DB [#6117]:
1368
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1369
# The PATH hackery in wrapper scripts is required on Windows
1370
# in order for the loader to find any dlls it needs.
1371
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1372
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1375
*) no_install=yes ;;
1403
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1404
# We need an absolute path.
1406
[\\/]* | [A-Za-z]:[\\/]*) ;;
1408
$echo "$modename: only absolute run-paths are allowed" 1>&2
1414
*) xrpath="$xrpath $dir" ;;
1420
# The effects of -static are defined in a previous loop.
1421
# We used to do the same as -all-static on platforms that
1422
# didn't have a PIC flag, but the assumption that the effects
1423
# would be equivalent was wrong. It would break on at least
1424
# Digital Unix and AIX.
1439
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1441
save_ifs="$IFS"; IFS=','
1442
for flag in $args; do
1445
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1450
compiler_flags="$compiler_flags $flag"
1453
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1457
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1459
save_ifs="$IFS"; IFS=','
1460
for flag in $args; do
1463
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1468
compiler_flags="$compiler_flags $wl$flag"
1469
linker_flags="$linker_flags $flag"
1472
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1485
# Some other compiler flag.
1487
# Unknown arguments in both finalize_command and compile_command need
1488
# to be aesthetically quoted because they are evaled later.
1489
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1491
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1498
# A library or standard object.
1499
if test "$prev" = dlfiles; then
1500
# This file was specified with -dlopen.
1501
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1502
dlfiles="$dlfiles $arg"
1506
# If libtool objects are unsupported, then we need to preload.
1511
if test "$prev" = dlprefiles; then
1512
# Preload the old-style object.
1513
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1517
*.lo) libobjs="$libobjs $arg" ;;
1518
*) objs="$objs $arg" ;;
1525
deplibs="$deplibs $arg"
1526
old_deplibs="$old_deplibs $arg"
1531
# A libtool-controlled library.
1533
if test "$prev" = dlfiles; then
1534
# This library was specified with -dlopen.
1535
dlfiles="$dlfiles $arg"
1537
elif test "$prev" = dlprefiles; then
1538
# The library was specified with -dlpreopen.
1539
dlprefiles="$dlprefiles $arg"
1542
deplibs="$deplibs $arg"
1547
# Some other compiler argument.
1549
# Unknown arguments in both finalize_command and compile_command need
1550
# to be aesthetically quoted because they are evaled later.
1551
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1553
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1560
# Now actually substitute the argument into the commands.
1561
if test -n "$arg"; then
1562
compile_command="$compile_command $arg"
1563
finalize_command="$finalize_command $arg"
1565
done # argument parsing loop
1567
if test -n "$prev"; then
1568
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1573
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1574
eval arg=\"$export_dynamic_flag_spec\"
1575
compile_command="$compile_command $arg"
1576
finalize_command="$finalize_command $arg"
1579
# calculate the name of the file, without its directory
1580
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1581
libobjs_save="$libobjs"
1583
if test -n "$shlibpath_var"; then
1584
# get the directories listed in $shlibpath_var
1585
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1589
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1590
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1592
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1593
if test "X$output_objdir" = "X$output"; then
1594
output_objdir="$objdir"
1596
output_objdir="$output_objdir/$objdir"
1598
# Create the object directory.
1599
if test ! -d $output_objdir; then
1600
$show "$mkdir $output_objdir"
1601
$run $mkdir $output_objdir
1603
if test $status -ne 0 && test ! -d $output_objdir; then
1608
# Determine the type of output
1611
$echo "$modename: you must specify an output file" 1>&2
1615
*.$libext) linkmode=oldlib ;;
1616
*.lo | *.$objext) linkmode=obj ;;
1617
*.la) linkmode=lib ;;
1618
*) linkmode=prog ;; # Anything else should be a program.
1623
# Find all interdependent deplibs by searching for libraries
1624
# that are linked more than once (e.g. -la -lb -la)
1625
for deplib in $deplibs; do
1627
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1629
libs="$libs $deplib"
1634
need_relink=no # whether we're linking any uninstalled libtool libraries
1635
notinst_deplibs= # not-installed libtool libraries
1636
notinst_path= # paths that contain not-installed libtool libraries
1640
for file in $dlfiles $dlprefiles; do
1644
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1656
passes="conv scan dlopen dlpreopen link"
1661
for pass in $passes; do
1662
if test $linkmode = prog; then
1663
# Determine which files to process
1667
save_deplibs="$deplibs" # Collect dlpreopened libraries
1670
dlpreopen) libs="$dlprefiles" ;;
1671
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1674
for deplib in $libs; do
1679
if test $linkmode = oldlib && test $linkmode = obj; then
1680
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1683
if test $pass = conv; then
1684
deplibs="$deplib $deplibs"
1687
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1688
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1689
# Search the libtool library
1690
lib="$searchdir/lib${name}.la"
1691
if test -f "$lib"; then
1696
if test "$found" != yes; then
1697
# deplib doesn't seem to be a libtool library
1698
if test "$linkmode,$pass" = "prog,link"; then
1699
compile_deplibs="$deplib $compile_deplibs"
1700
finalize_deplibs="$deplib $finalize_deplibs"
1702
deplibs="$deplib $deplibs"
1703
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1711
deplibs="$deplib $deplibs"
1712
test $pass = conv && continue
1713
newdependency_libs="$deplib $newdependency_libs"
1714
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1717
if test $pass = conv; then
1718
deplibs="$deplib $deplibs"
1721
if test $pass = scan; then
1722
deplibs="$deplib $deplibs"
1723
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1725
compile_deplibs="$deplib $compile_deplibs"
1726
finalize_deplibs="$deplib $finalize_deplibs"
1730
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1736
if test $pass = link; then
1737
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1738
# Make sure the xrpath contains only unique directories.
1741
*) xrpath="$xrpath $dir" ;;
1744
deplibs="$deplib $deplibs"
1747
*.la) lib="$deplib" ;;
1749
if test $pass = conv; then
1750
deplibs="$deplib $deplibs"
1755
if test "$deplibs_check_method" != pass_all; then
1757
echo "*** Warning: This library needs some functionality provided by $deplib."
1758
echo "*** I have the capability to make that library automatically link in when"
1759
echo "*** you link to this library. But I can only do this if you have a"
1760
echo "*** shared version of the library, which you do not appear to have."
1763
echo "*** Warning: Linking the shared library $output against the"
1764
echo "*** static library $deplib is not portable!"
1765
deplibs="$deplib $deplibs"
1770
if test $pass != link; then
1771
deplibs="$deplib $deplibs"
1773
compile_deplibs="$deplib $compile_deplibs"
1774
finalize_deplibs="$deplib $finalize_deplibs"
1781
if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1782
# If there is no dlopen support or we're linking statically,
1783
# we need to preload.
1784
newdlprefiles="$newdlprefiles $deplib"
1785
compile_deplibs="$deplib $compile_deplibs"
1786
finalize_deplibs="$deplib $finalize_deplibs"
1788
newdlfiles="$newdlfiles $deplib"
1797
if test $found = yes || test -f "$lib"; then :
1799
$echo "$modename: cannot find the library \`$lib'" 1>&2
1803
# Check to see that this really is a libtool archive.
1804
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1806
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1810
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1811
test "X$ladir" = "X$lib" && ladir="."
1819
# If the library was installed with an old release of libtool,
1820
# it will not redefine variable installed.
1825
*/* | *\\*) . $lib ;;
1829
if test "$linkmode,$pass" = "lib,link" ||
1830
test "$linkmode,$pass" = "prog,scan" ||
1831
{ test $linkmode = oldlib && test $linkmode = obj; }; then
1832
# Add dl[pre]opened files of deplib
1833
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1834
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1837
if test $pass = conv; then
1838
# Only check for convenience libraries
1839
deplibs="$lib $deplibs"
1840
if test -z "$libdir"; then
1841
if test -z "$old_library"; then
1842
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1845
# It is a libtool convenience library, so add in its objects.
1846
convenience="$convenience $ladir/$objdir/$old_library"
1847
old_convenience="$old_convenience $ladir/$objdir/$old_library"
1849
for deplib in $dependency_libs; do
1850
deplibs="$deplib $deplibs"
1851
case "$tmp_libs " in
1852
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1854
tmp_libs="$tmp_libs $deplib"
1856
elif test $linkmode != prog && test $linkmode != lib; then
1857
$echo "$modename: \`$lib' is not a convenience library" 1>&2
1863
# Get the name of the library we link against.
1865
for l in $old_library $library_names; do
1868
if test -z "$linklib"; then
1869
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1873
# This library was specified with -dlopen.
1874
if test $pass = dlopen; then
1875
if test -z "$libdir"; then
1876
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1879
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1880
# If there is no dlname, no dlopen support or we're linking
1881
# statically, we need to preload.
1882
dlprefiles="$dlprefiles $lib"
1884
newdlfiles="$newdlfiles $lib"
1889
# We need an absolute path.
1891
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1893
abs_ladir=`cd "$ladir" && pwd`
1894
if test -z "$abs_ladir"; then
1895
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1896
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1901
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1903
# Find the relevant object directory and library name.
1904
if test "X$installed" = Xyes; then
1905
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1906
$echo "$modename: warning: library \`$lib' was moved." 1>&2
1915
dir="$ladir/$objdir"
1916
absdir="$abs_ladir/$objdir"
1917
# Remove this search path later
1918
notinst_path="$notinst_path $abs_ladir"
1919
fi # $installed = yes
1920
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1922
# This library was specified with -dlpreopen.
1923
if test $pass = dlpreopen; then
1924
if test -z "$libdir"; then
1925
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1928
# Prefer using a static library (so that no silly _DYNAMIC symbols
1929
# are required to link).
1930
if test -n "$old_library"; then
1931
newdlprefiles="$newdlprefiles $dir/$old_library"
1932
# Otherwise, use the dlname, so that lt_dlopen finds it.
1933
elif test -n "$dlname"; then
1934
newdlprefiles="$newdlprefiles $dir/$dlname"
1936
newdlprefiles="$newdlprefiles $dir/$linklib"
1938
fi # $pass = dlpreopen
1940
if test -z "$libdir"; then
1941
# Link the convenience library
1942
if test $linkmode = lib; then
1943
deplibs="$dir/$old_library $deplibs"
1944
elif test "$linkmode,$pass" = "prog,link"; then
1945
compile_deplibs="$dir/$old_library $compile_deplibs"
1946
finalize_deplibs="$dir/$old_library $finalize_deplibs"
1948
deplibs="$lib $deplibs"
1953
if test $linkmode = prog && test $pass != link; then
1954
newlib_search_path="$newlib_search_path $ladir"
1955
deplibs="$lib $deplibs"
1958
if test "$link_all_deplibs" != no || test -z "$library_names" ||
1959
test "$build_libtool_libs" = no; then
1964
for deplib in $dependency_libs; do
1966
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1968
# Need to link against all dependency_libs?
1969
if test $linkalldeplibs = yes; then
1970
deplibs="$deplib $deplibs"
1972
# Need to hardcode shared library paths
1973
# or/and link against static libraries
1974
newdependency_libs="$deplib $newdependency_libs"
1976
case "$tmp_libs " in
1977
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1979
tmp_libs="$tmp_libs $deplib"
1982
fi # $linkmode = prog...
1984
link_static=no # Whether the deplib will be linked statically
1985
if test -n "$library_names" &&
1986
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1987
# Link against this shared library
1989
if test "$linkmode,$pass" = "prog,link" ||
1990
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1991
# Hardcode the library path.
1992
# Skip directories that are in the system default run-time
1994
case " $sys_lib_dlsearch_path " in
1997
case "$compile_rpath " in
1999
*) compile_rpath="$compile_rpath $absdir"
2003
case " $sys_lib_dlsearch_path " in
2006
case "$finalize_rpath " in
2008
*) finalize_rpath="$finalize_rpath $libdir"
2012
if test $linkmode = prog; then
2013
# We need to hardcode the library path
2014
if test -n "$shlibpath_var"; then
2015
# Make sure the rpath contains only unique directories.
2016
case "$temp_rpath " in
2019
*) temp_rpath="$temp_rpath $dir" ;;
2023
fi # $linkmode,$pass = prog,link...
2025
if test "$alldeplibs" = yes &&
2026
{ test "$deplibs_check_method" = pass_all ||
2027
{ test "$build_libtool_libs" = yes &&
2028
test -n "$library_names"; }; }; then
2029
# We only need to search for static libraries
2033
if test "$installed" = no; then
2034
notinst_deplibs="$notinst_deplibs $lib"
2038
if test -n "$old_archive_from_expsyms_cmds"; then
2039
# figure out the soname
2040
set dummy $library_names
2043
libname=`eval \\$echo \"$libname_spec\"`
2044
# use dlname if we got it. it's perfectly good, no?
2045
if test -n "$dlname"; then
2047
elif test -n "$soname_spec"; then
2051
major=`expr $current - $age`
2055
eval soname=\"$soname_spec\"
2060
# Make a new name for the extract_expsyms_cmds to use
2062
soname=`echo $soroot | sed -e 's/^.*\///'`
2063
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2065
# If the library has no export list, then create one now
2066
if test -f "$output_objdir/$soname-def"; then :
2068
$show "extracting exported symbol list from \`$soname'"
2069
save_ifs="$IFS"; IFS='~'
2070
eval cmds=\"$extract_expsyms_cmds\"
2071
for cmd in $cmds; do
2074
$run eval "$cmd" || exit $?
2080
if test -f "$output_objdir/$newlib"; then :; else
2081
$show "generating import library for \`$soname'"
2082
save_ifs="$IFS"; IFS='~'
2083
eval cmds=\"$old_archive_from_expsyms_cmds\"
2084
for cmd in $cmds; do
2087
$run eval "$cmd" || exit $?
2091
# make sure the library variables are pointing to the new library
2094
fi # test -n $old_archive_from_expsyms_cmds
2096
if test $linkmode = prog || test "$mode" != relink; then
2101
case $hardcode_action in
2102
immediate | unsupported)
2103
if test "$hardcode_direct" = no; then
2105
elif test "$hardcode_minus_L" = no; then
2107
*-*-sunos*) add_shlibpath="$dir" ;;
2111
elif test "$hardcode_shlibpath_var" = no; then
2112
add_shlibpath="$dir"
2119
if test "$hardcode_direct" = yes; then
2121
elif test "$hardcode_minus_L" = yes; then
2124
elif test "$hardcode_shlibpath_var" = yes; then
2125
add_shlibpath="$dir"
2134
if test "$lib_linked" != yes; then
2135
$echo "$modename: configuration error: unsupported hardcode properties"
2139
if test -n "$add_shlibpath"; then
2140
case :$compile_shlibpath: in
2141
*":$add_shlibpath:"*) ;;
2142
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2145
if test $linkmode = prog; then
2146
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2147
test -n "$add" && compile_deplibs="$add $compile_deplibs"
2149
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2150
test -n "$add" && deplibs="$add $deplibs"
2151
if test "$hardcode_direct" != yes && \
2152
test "$hardcode_minus_L" != yes && \
2153
test "$hardcode_shlibpath_var" = yes; then
2154
case :$finalize_shlibpath: in
2156
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2162
if test $linkmode = prog || test "$mode" = relink; then
2166
# Finalize command for both is simple: just hardcode it.
2167
if test "$hardcode_direct" = yes; then
2168
add="$libdir/$linklib"
2169
elif test "$hardcode_minus_L" = yes; then
2172
elif test "$hardcode_shlibpath_var" = yes; then
2173
case :$finalize_shlibpath: in
2175
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2179
# We cannot seem to hardcode it, guess we'll fake it.
2184
if test $linkmode = prog; then
2185
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2186
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2188
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2189
test -n "$add" && deplibs="$add $deplibs"
2192
elif test $linkmode = prog; then
2193
if test "$alldeplibs" = yes &&
2194
{ test "$deplibs_check_method" = pass_all ||
2195
{ test "$build_libtool_libs" = yes &&
2196
test -n "$library_names"; }; }; then
2197
# We only need to search for static libraries
2201
# Try to link the static library
2202
# Here we assume that one of hardcode_direct or hardcode_minus_L
2203
# is not unsupported. This is valid on all known static and
2205
if test "$hardcode_direct" != unsupported; then
2206
test -n "$old_library" && linklib="$old_library"
2207
compile_deplibs="$dir/$linklib $compile_deplibs"
2208
finalize_deplibs="$dir/$linklib $finalize_deplibs"
2210
compile_deplibs="-l$name -L$dir $compile_deplibs"
2211
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2213
elif test "$build_libtool_libs" = yes; then
2214
# Not a shared library
2215
if test "$deplibs_check_method" != pass_all; then
2216
# We're trying link a shared library against a static one
2217
# but the system doesn't support it.
2219
# Just print a warning and add the library to dependency_libs so
2220
# that the program can be linked against the static library.
2222
echo "*** Warning: This library needs some functionality provided by $lib."
2223
echo "*** I have the capability to make that library automatically link in when"
2224
echo "*** you link to this library. But I can only do this if you have a"
2225
echo "*** shared version of the library, which you do not appear to have."
2226
if test "$module" = yes; then
2227
echo "*** Therefore, libtool will create a static module, that should work "
2228
echo "*** as long as the dlopening application is linked with the -dlopen flag."
2229
if test -z "$global_symbol_pipe"; then
2231
echo "*** However, this would only work if libtool was able to extract symbol"
2232
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2233
echo "*** not find such a program. So, this module is probably useless."
2234
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2236
if test "$build_old_libs" = no; then
2237
build_libtool_libs=module
2240
build_libtool_libs=no
2244
convenience="$convenience $dir/$old_library"
2245
old_convenience="$old_convenience $dir/$old_library"
2246
deplibs="$dir/$old_library $deplibs"
2249
fi # link shared/static library?
2251
if test $linkmode = lib; then
2252
if test -n "$dependency_libs" &&
2253
{ test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2254
test $link_static = yes; }; then
2255
# Extract -R from dependency_libs
2257
for libdir in $dependency_libs; do
2259
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2261
*" $temp_xrpath "*) ;;
2262
*) xrpath="$xrpath $temp_xrpath";;
2264
*) temp_deplibs="$temp_deplibs $libdir";;
2267
dependency_libs="$temp_deplibs"
2270
newlib_search_path="$newlib_search_path $absdir"
2271
# Link against this library
2272
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2273
# ... and its dependency_libs
2275
for deplib in $dependency_libs; do
2276
newdependency_libs="$deplib $newdependency_libs"
2277
case "$tmp_libs " in
2278
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2280
tmp_libs="$tmp_libs $deplib"
2283
if test $link_all_deplibs != no; then
2284
# Add the search paths of all dependency libraries
2285
for deplib in $dependency_libs; do
2287
-L*) path="$deplib" ;;
2289
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2290
test "X$dir" = "X$deplib" && dir="."
2291
# We need an absolute path.
2293
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2295
absdir=`cd "$dir" && pwd`
2296
if test -z "$absdir"; then
2297
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2302
if grep "^installed=no" $deplib > /dev/null; then
2303
path="-L$absdir/$objdir"
2305
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2306
if test -z "$libdir"; then
2307
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2310
if test "$absdir" != "$libdir"; then
2311
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2318
case " $deplibs " in
2320
*) deplibs="$deplibs $path" ;;
2323
fi # link_all_deplibs != no
2325
done # for deplib in $libs
2326
if test $pass = dlpreopen; then
2327
# Link the dlpreopened libraries before other libraries
2328
for deplib in $save_deplibs; do
2329
deplibs="$deplib $deplibs"
2332
if test $pass != dlopen; then
2333
test $pass != scan && dependency_libs="$newdependency_libs"
2334
if test $pass != conv; then
2335
# Make sure lib_search_path contains only unique directories.
2337
for dir in $newlib_search_path; do
2338
case "$lib_search_path " in
2340
*) lib_search_path="$lib_search_path $dir" ;;
2346
if test "$linkmode,$pass" != "prog,link"; then
2349
vars="compile_deplibs finalize_deplibs"
2351
for var in $vars dependency_libs; do
2352
# Add libraries to $var in reverse order
2353
eval tmp_libs=\"\$$var\"
2355
for deplib in $tmp_libs; do
2357
-L*) new_libs="$deplib $new_libs" ;;
2359
case " $specialdeplibs " in
2360
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2362
case " $new_libs " in
2364
*) new_libs="$deplib $new_libs" ;;
2372
for deplib in $new_libs; do
2375
case " $tmp_libs " in
2377
*) tmp_libs="$tmp_libs $deplib" ;;
2380
*) tmp_libs="$tmp_libs $deplib" ;;
2383
eval $var=\"$tmp_libs\"
2386
if test "$pass" = "conv" &&
2387
{ test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2388
libs="$deplibs" # reset libs
2392
if test $linkmode = prog; then
2393
dlfiles="$newdlfiles"
2394
dlprefiles="$newdlprefiles"
2399
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2400
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2403
if test -n "$rpath"; then
2404
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2407
if test -n "$xrpath"; then
2408
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2411
if test -n "$vinfo"; then
2412
$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2415
if test -n "$release"; then
2416
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2419
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2420
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2423
# Now set the variables for building old libraries.
2424
build_libtool_libs=no
2426
objs="$objs$old_deplibs"
2430
# Make sure we only generate libraries of the form `libNAME.la'.
2433
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2434
eval libname=\"$libname_spec\"
2437
if test "$module" = no; then
2438
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2442
if test "$need_lib_prefix" != no; then
2443
# Add the "lib" prefix for modules if required
2444
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2445
eval libname=\"$libname_spec\"
2447
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2452
if test -n "$objs"; then
2453
if test "$deplibs_check_method" != pass_all; then
2454
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2458
echo "*** Warning: Linking the shared library $output against the non-libtool"
2459
echo "*** objects $objs is not portable!"
2460
libobjs="$libobjs $objs"
2464
if test "$dlself" != no; then
2465
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2469
if test $# -gt 2; then
2470
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2475
if test -z "$rpath"; then
2476
if test "$build_libtool_libs" = yes; then
2477
# Building a libtool convenience library.
2479
oldlibs="$output_objdir/$libname.$libext $oldlibs"
2480
build_libtool_libs=convenience
2484
if test -n "$vinfo"; then
2485
$echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2488
if test -n "$release"; then
2489
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2493
# Parse the version information argument.
2494
save_ifs="$IFS"; IFS=':'
2495
set dummy $vinfo 0 0 0
2498
if test -n "$8"; then
2499
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2508
# Check that each of the things are valid numbers.
2510
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2512
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2513
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2519
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2521
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2522
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2528
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2530
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2531
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2536
if test $age -gt $current; then
2537
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2538
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2542
# Calculate the version variables.
2546
case $version_type in
2550
# Like Linux, but with the current version available in
2551
# verstring for coding it into the library header
2552
major=.`expr $current - $age`
2553
versuffix="$major.$age.$revision"
2554
# Darwin ld doesn't like 0 for these options...
2555
minor_current=`expr $current + 1`
2556
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2561
versuffix=".$current.$revision";
2566
versuffix=".$current";
2570
major=`expr $current - $age + 1`
2571
verstring="sgi$major.$revision"
2573
# Add in all the interfaces that we are compatible with.
2575
while test $loop != 0; do
2576
iface=`expr $revision - $loop`
2577
loop=`expr $loop - 1`
2578
verstring="sgi$major.$iface:$verstring"
2581
# Before this point, $major must not contain `.'.
2583
versuffix="$major.$revision"
2587
major=.`expr $current - $age`
2588
versuffix="$major.$age.$revision"
2592
major=`expr $current - $age`
2593
versuffix=".$current.$age.$revision"
2594
verstring="$current.$age.$revision"
2596
# Add in all the interfaces that we are compatible with.
2598
while test $loop != 0; do
2599
iface=`expr $current - $loop`
2600
loop=`expr $loop - 1`
2601
verstring="$verstring:${iface}.0"
2604
# Make executables depend on our current version.
2605
verstring="$verstring:${current}.0"
2610
versuffix=".$current.$revision"
2614
# Use '-' rather than '.', since we only want one
2615
# extension on DOS 8.3 filesystems.
2616
major=`expr $current - $age`
2621
$echo "$modename: unknown library version type \`$version_type'" 1>&2
2622
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2627
# Clear the version info if we defaulted, and they specified a release.
2628
if test -z "$vinfo" && test -n "$release"; then
2631
case $version_type in
2633
# we can't check for "0.0" in archive_cmds due to quoting
2634
# problems, so we reset it completely
2641
if test "$need_version" = no; then
2648
# Remove version info from name if versioning should be avoided
2649
if test "$avoid_version" = yes && test "$need_version" = no; then
2655
# Check to see if the archive will have undefined symbols.
2656
if test "$allow_undefined" = yes; then
2657
if test "$allow_undefined_flag" = unsupported; then
2658
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2659
build_libtool_libs=no
2663
# Don't allow undefined symbols.
2664
allow_undefined_flag="$no_undefined_flag"
2668
if test "$mode" != relink; then
2669
# Remove our outputs.
2670
$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2671
$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2674
# Now set the variables for building old libraries.
2675
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2676
oldlibs="$oldlibs $output_objdir/$libname.$libext"
2678
# Transform .lo files to .o files.
2679
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2682
# Eliminate all temporary directories.
2683
for path in $notinst_path; do
2684
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2685
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2686
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2689
if test -n "$xrpath"; then
2690
# If the user specified any rpath flags, then add them.
2692
for libdir in $xrpath; do
2693
temp_xrpath="$temp_xrpath -R$libdir"
2694
case "$finalize_rpath " in
2696
*) finalize_rpath="$finalize_rpath $libdir" ;;
2699
if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2700
dependency_libs="$temp_xrpath $dependency_libs"
2704
# Make sure dlfiles contains only unique files that won't be dlpreopened
2705
old_dlfiles="$dlfiles"
2707
for lib in $old_dlfiles; do
2708
case " $dlprefiles $dlfiles " in
2710
*) dlfiles="$dlfiles $lib" ;;
2714
# Make sure dlprefiles contains only unique files
2715
old_dlprefiles="$dlprefiles"
2717
for lib in $old_dlprefiles; do
2718
case "$dlprefiles " in
2720
*) dlprefiles="$dlprefiles $lib" ;;
2724
if test "$build_libtool_libs" = yes; then
2725
if test -n "$rpath"; then
2727
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2728
# these systems don't actually have a c library (as such)!
2730
*-*-rhapsody* | *-*-darwin1.[012])
2731
# Rhapsody C library is in the System framework
2732
deplibs="$deplibs -framework System"
2735
# Don't link with libc until the a.out ld.so is fixed.
2738
# Do not include libc due to us having libc/libc_r.
2740
#### Local change for Sleepycat's Berkeley DB [#2380]:
2741
# FreeBSD, like OpenBSD, uses libc/libc_r and should not
2742
# link against libc/c_r explicitly; the -pthread linker flag
2743
# implicitly controls use of -lc and -lc_r.
2745
# Do not include libc due to us having libc/libc_r.
2748
# Add libc to deplibs on all other systems if necessary.
2749
if test $build_libtool_need_lc = "yes"; then
2750
deplibs="$deplibs -lc"
2756
# Transform deplibs into only deplibs that can be linked in shared.
2758
libname_save=$libname
2759
release_save=$release
2760
versuffix_save=$versuffix
2762
# I'm not sure if I'm treating the release correctly. I think
2763
# release should show up in the -l (ie -lgmp5) so we don't want to
2764
# add it in twice. Is that correct?
2770
case $deplibs_check_method in
2772
# Don't check for shared/static. Everything works.
2773
# This might be a little naive. We might want to check
2774
# whether the library exists or not. But this is on
2775
# osf3 & osf4 and I'm not really sure... Just
2776
# implementing what was already the behaviour.
2780
# This code stresses the "libraries are programs" paradigm to its
2781
# limits. Maybe even breaks it. We compile a program, linking it
2782
# against the deplibs as a proxy for the library. Then we can check
2783
# whether they linked in statically or dynamically with ldd.
2785
cat > conftest.c <<EOF
2786
int main() { return 0; }
2789
$CC -o conftest conftest.c $deplibs
2790
if test $? -eq 0 ; then
2791
ldd_output=`ldd conftest`
2792
for i in $deplibs; do
2793
name="`expr $i : '-l\(.*\)'`"
2794
# If $name is empty we are operating on a -L argument.
2795
if test -n "$name" && test "$name" != "0"; then
2796
libname=`eval \\$echo \"$libname_spec\"`
2797
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2798
set dummy $deplib_matches
2800
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2801
newdeplibs="$newdeplibs $i"
2805
echo "*** Warning: This library needs some functionality provided by $i."
2806
echo "*** I have the capability to make that library automatically link in when"
2807
echo "*** you link to this library. But I can only do this if you have a"
2808
echo "*** shared version of the library, which you do not appear to have."
2811
newdeplibs="$newdeplibs $i"
2815
# Error occured in the first compile. Let's try to salvage the situation:
2816
# Compile a seperate program for each library.
2817
for i in $deplibs; do
2818
name="`expr $i : '-l\(.*\)'`"
2819
# If $name is empty we are operating on a -L argument.
2820
if test -n "$name" && test "$name" != "0"; then
2822
$CC -o conftest conftest.c $i
2824
if test $? -eq 0 ; then
2825
ldd_output=`ldd conftest`
2826
libname=`eval \\$echo \"$libname_spec\"`
2827
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2828
set dummy $deplib_matches
2830
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2831
newdeplibs="$newdeplibs $i"
2835
echo "*** Warning: This library needs some functionality provided by $i."
2836
echo "*** I have the capability to make that library automatically link in when"
2837
echo "*** you link to this library. But I can only do this if you have a"
2838
echo "*** shared version of the library, which you do not appear to have."
2843
echo "*** Warning! Library $i is needed by this library but I was not able to"
2844
echo "*** make it link in! You will probably need to install it or some"
2845
echo "*** library that it depends on before this library will be fully"
2846
echo "*** functional. Installing it before continuing would be even better."
2849
newdeplibs="$newdeplibs $i"
2855
set dummy $deplibs_check_method
2856
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2857
for a_deplib in $deplibs; do
2858
name="`expr $a_deplib : '-l\(.*\)'`"
2859
# If $name is empty we are operating on a -L argument.
2860
if test -n "$name" && test "$name" != "0"; then
2861
libname=`eval \\$echo \"$libname_spec\"`
2862
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2863
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2864
for potent_lib in $potential_libs; do
2865
# Follow soft links.
2866
if ls -lLd "$potent_lib" 2>/dev/null \
2867
| grep " -> " >/dev/null; then
2870
# The statement above tries to avoid entering an
2871
# endless loop below, in case of cyclic links.
2872
# We might still enter an endless loop, since a link
2873
# loop can be closed while we follow links,
2875
potlib="$potent_lib"
2876
while test -h "$potlib" 2>/dev/null; do
2877
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2879
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2880
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2883
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2885
| egrep "$file_magic_regex" > /dev/null; then
2886
newdeplibs="$newdeplibs $a_deplib"
2892
if test -n "$a_deplib" ; then
2895
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2896
echo "*** I have the capability to make that library automatically link in when"
2897
echo "*** you link to this library. But I can only do this if you have a"
2898
echo "*** shared version of the library, which you do not appear to have."
2901
# Add a -L argument.
2902
newdeplibs="$newdeplibs $a_deplib"
2904
done # Gone through all deplibs.
2907
set dummy $deplibs_check_method
2908
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2909
for a_deplib in $deplibs; do
2910
name="`expr $a_deplib : '-l\(.*\)'`"
2911
# If $name is empty we are operating on a -L argument.
2912
if test -n "$name" && test "$name" != "0"; then
2913
libname=`eval \\$echo \"$libname_spec\"`
2914
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2915
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2916
for potent_lib in $potential_libs; do
2917
if eval echo \"$potent_lib\" 2>/dev/null \
2919
| egrep "$match_pattern_regex" > /dev/null; then
2920
newdeplibs="$newdeplibs $a_deplib"
2926
if test -n "$a_deplib" ; then
2929
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2930
echo "*** I have the capability to make that library automatically link in when"
2931
echo "*** you link to this library. But I can only do this if you have a"
2932
echo "*** shared version of the library, which you do not appear to have."
2935
# Add a -L argument.
2936
newdeplibs="$newdeplibs $a_deplib"
2938
done # Gone through all deplibs.
2942
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2943
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2944
grep . >/dev/null; then
2946
if test "X$deplibs_check_method" = "Xnone"; then
2947
echo "*** Warning: inter-library dependencies are not supported in this platform."
2949
echo "*** Warning: inter-library dependencies are not known to be supported."
2951
echo "*** All declared inter-library dependencies are being dropped."
2956
versuffix=$versuffix_save
2958
release=$release_save
2959
libname=$libname_save
2963
*-*-rhapsody* | *-*-darwin1.[012])
2964
# On Rhapsody replace the C library is the System framework
2965
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2969
if test "$droppeddeps" = yes; then
2970
if test "$module" = yes; then
2972
echo "*** Warning: libtool could not satisfy all declared inter-library"
2973
echo "*** dependencies of module $libname. Therefore, libtool will create"
2974
echo "*** a static module, that should work as long as the dlopening"
2975
echo "*** application is linked with the -dlopen flag."
2976
if test -z "$global_symbol_pipe"; then
2978
echo "*** However, this would only work if libtool was able to extract symbol"
2979
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2980
echo "*** not find such a program. So, this module is probably useless."
2981
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2983
if test "$build_old_libs" = no; then
2984
oldlibs="$output_objdir/$libname.$libext"
2985
build_libtool_libs=module
2988
build_libtool_libs=no
2991
echo "*** The inter-library dependencies that have been dropped here will be"
2992
echo "*** automatically added whenever a program is linked with this library"
2993
echo "*** or is declared to -dlopen it."
2995
if test $allow_undefined = no; then
2997
echo "*** Since this library must not contain undefined symbols,"
2998
echo "*** because either the platform does not support them or"
2999
echo "*** it was explicitly requested with -no-undefined,"
3000
echo "*** libtool will only create a static version of it."
3001
if test "$build_old_libs" = no; then
3002
oldlibs="$output_objdir/$libname.$libext"
3003
build_libtool_libs=module
3006
build_libtool_libs=no
3011
# Done checking deplibs!
3015
# All the library-specific variables (install_libdir is set above).
3020
# Test again, we may have decided not to build it any more
3021
if test "$build_libtool_libs" = yes; then
3022
if test $hardcode_into_libs = yes; then
3023
# Hardcode the library paths
3026
rpath="$finalize_rpath"
3027
test "$mode" != relink && rpath="$compile_rpath$rpath"
3028
for libdir in $rpath; do
3029
if test -n "$hardcode_libdir_flag_spec"; then
3030
if test -n "$hardcode_libdir_separator"; then
3031
if test -z "$hardcode_libdirs"; then
3032
hardcode_libdirs="$libdir"
3034
# Just accumulate the unique libdirs.
3035
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3036
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3039
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3044
eval flag=\"$hardcode_libdir_flag_spec\"
3045
dep_rpath="$dep_rpath $flag"
3047
elif test -n "$runpath_var"; then
3048
case "$perm_rpath " in
3050
*) perm_rpath="$perm_rpath $libdir" ;;
3054
# Substitute the hardcoded libdirs into the rpath.
3055
if test -n "$hardcode_libdir_separator" &&
3056
test -n "$hardcode_libdirs"; then
3057
libdir="$hardcode_libdirs"
3058
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3060
if test -n "$runpath_var" && test -n "$perm_rpath"; then
3061
# We should set the runpath_var.
3063
for dir in $perm_rpath; do
3066
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3068
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3071
shlibpath="$finalize_shlibpath"
3072
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3073
if test -n "$shlibpath"; then
3074
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3077
# Get the real and link names of the library.
3078
eval library_names=\"$library_names_spec\"
3079
set dummy $library_names
3083
if test -n "$soname_spec"; then
3084
eval soname=\"$soname_spec\"
3088
test -z "$dlname" && dlname=$soname
3090
lib="$output_objdir/$realname"
3093
linknames="$linknames $link"
3096
# Ensure that we have .o objects for linkers which dislike .lo
3097
# (e.g. aix) in case we are running --disable-static
3098
for obj in $libobjs; do
3099
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3100
if test "X$xdir" = "X$obj"; then
3105
baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3106
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3107
if test ! -f $xdir/$oldobj; then
3108
$show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3109
$run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3113
# Use standard objects if they are pic
3114
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3116
# Prepare the list of exported symbols
3117
if test -z "$export_symbols"; then
3118
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3119
$show "generating symbol list for \`$libname.la'"
3120
export_symbols="$output_objdir/$libname.exp"
3121
$run $rm $export_symbols
3122
eval cmds=\"$export_symbols_cmds\"
3123
save_ifs="$IFS"; IFS='~'
3124
for cmd in $cmds; do
3127
$run eval "$cmd" || exit $?
3130
if test -n "$export_symbols_regex"; then
3131
$show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3132
$run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3133
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
3134
$run eval '$mv "${export_symbols}T" "$export_symbols"'
3139
if test -n "$export_symbols" && test -n "$include_expsyms"; then
3140
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3143
if test -n "$convenience"; then
3144
if test -n "$whole_archive_flag_spec"; then
3145
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3147
gentop="$output_objdir/${outputname}x"
3148
$show "${rm}r $gentop"
3149
$run ${rm}r "$gentop"
3150
$show "mkdir $gentop"
3151
$run mkdir "$gentop"
3153
if test $status -ne 0 && test ! -d "$gentop"; then
3156
generated="$generated $gentop"
3158
for xlib in $convenience; do
3159
# Extract the objects.
3161
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3162
*) xabs=`pwd`"/$xlib" ;;
3164
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3165
xdir="$gentop/$xlib"
3167
$show "${rm}r $xdir"
3172
if test $status -ne 0 && test ! -d "$xdir"; then
3175
$show "(cd $xdir && $AR x $xabs)"
3176
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3178
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3183
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3184
eval flag=\"$thread_safe_flag_spec\"
3185
linker_flags="$linker_flags $flag"
3188
# Make a backup of the uninstalled library when relinking
3189
if test "$mode" = relink; then
3190
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3193
# Do each of the archive commands.
3194
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3195
eval cmds=\"$archive_expsym_cmds\"
3197
eval cmds=\"$archive_cmds\"
3199
save_ifs="$IFS"; IFS='~'
3200
for cmd in $cmds; do
3203
$run eval "$cmd" || exit $?
3207
# Restore the uninstalled library and exit
3208
if test "$mode" = relink; then
3209
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3213
# Create links to the real library.
3214
for linkname in $linknames; do
3215
if test "$realname" != "$linkname"; then
3216
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3217
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3221
# If -module or -export-dynamic was specified, set the dlname.
3222
if test "$module" = yes || test "$export_dynamic" = yes; then
3223
# On all known operating systems, these are identical.
3230
if test -n "$deplibs"; then
3231
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3234
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3235
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3238
if test -n "$rpath"; then
3239
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3242
if test -n "$xrpath"; then
3243
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3246
if test -n "$vinfo"; then
3247
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3250
if test -n "$release"; then
3251
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3256
if test -n "$objs$old_deplibs"; then
3257
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3261
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3269
# Delete the old objects.
3270
$run $rm $obj $libobj
3272
# Objects from convenience libraries. This assumes
3273
# single-version convenience libraries. Whenever we create
3274
# different ones for PIC/non-PIC, this we'll have to duplicate
3278
# reload_cmds runs $LD directly, so let us get rid of
3279
# -Wl from whole_archive_flag_spec
3282
if test -n "$convenience"; then
3283
if test -n "$whole_archive_flag_spec"; then
3284
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3286
gentop="$output_objdir/${obj}x"
3287
$show "${rm}r $gentop"
3288
$run ${rm}r "$gentop"
3289
$show "mkdir $gentop"
3290
$run mkdir "$gentop"
3292
if test $status -ne 0 && test ! -d "$gentop"; then
3295
generated="$generated $gentop"
3297
for xlib in $convenience; do
3298
# Extract the objects.
3300
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3301
*) xabs=`pwd`"/$xlib" ;;
3303
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3304
xdir="$gentop/$xlib"
3306
$show "${rm}r $xdir"
3311
if test $status -ne 0 && test ! -d "$xdir"; then
3314
$show "(cd $xdir && $AR x $xabs)"
3315
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3317
reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3322
# Create the old-style object.
3323
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
3326
eval cmds=\"$reload_cmds\"
3327
save_ifs="$IFS"; IFS='~'
3328
for cmd in $cmds; do
3331
$run eval "$cmd" || exit $?
3335
# Exit if we aren't doing a library object file.
3336
if test -z "$libobj"; then
3337
if test -n "$gentop"; then
3338
$show "${rm}r $gentop"
3345
if test "$build_libtool_libs" != yes; then
3346
if test -n "$gentop"; then
3347
$show "${rm}r $gentop"
3351
# Create an invalid libtool object if no PIC, so that we don't
3352
# accidentally link it into a program.
3353
$show "echo timestamp > $libobj"
3354
$run eval "echo timestamp > $libobj" || exit $?
3358
if test -n "$pic_flag" || test "$pic_mode" != default; then
3359
# Only do commands if we really have different PIC objects.
3360
reload_objs="$libobjs $reload_conv_objs"
3362
eval cmds=\"$reload_cmds\"
3363
save_ifs="$IFS"; IFS='~'
3364
for cmd in $cmds; do
3367
$run eval "$cmd" || exit $?
3371
# Just create a symlink.
3374
xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3375
if test "X$xdir" = "X$libobj"; then
3380
baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3381
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3382
$show "(cd $xdir && $LN_S $oldobj $baseobj)"
3383
$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3386
if test -n "$gentop"; then
3387
$show "${rm}r $gentop"
3396
*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3398
if test -n "$vinfo"; then
3399
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3402
if test -n "$release"; then
3403
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3406
if test "$preload" = yes; then
3407
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3408
test "$dlopen_self_static" = unknown; then
3409
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3414
*-*-rhapsody* | *-*-darwin1.[012])
3415
# On Rhapsody replace the C library is the System framework
3416
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3417
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3421
compile_command="$compile_command $compile_deplibs"
3422
finalize_command="$finalize_command $finalize_deplibs"
3424
if test -n "$rpath$xrpath"; then
3425
# If the user specified any rpath flags, then add them.
3426
for libdir in $rpath $xrpath; do
3427
# This is the magic to use -rpath.
3428
case "$finalize_rpath " in
3430
*) finalize_rpath="$finalize_rpath $libdir" ;;
3435
# Now hardcode the library paths
3438
for libdir in $compile_rpath $finalize_rpath; do
3439
if test -n "$hardcode_libdir_flag_spec"; then
3440
if test -n "$hardcode_libdir_separator"; then
3441
if test -z "$hardcode_libdirs"; then
3442
hardcode_libdirs="$libdir"
3444
# Just accumulate the unique libdirs.
3445
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3446
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3449
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3454
eval flag=\"$hardcode_libdir_flag_spec\"
3455
rpath="$rpath $flag"
3457
elif test -n "$runpath_var"; then
3458
case "$perm_rpath " in
3460
*) perm_rpath="$perm_rpath $libdir" ;;
3464
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3465
case :$dllsearchpath: in
3467
*) dllsearchpath="$dllsearchpath:$libdir";;
3472
# Substitute the hardcoded libdirs into the rpath.
3473
if test -n "$hardcode_libdir_separator" &&
3474
test -n "$hardcode_libdirs"; then
3475
libdir="$hardcode_libdirs"
3476
eval rpath=\" $hardcode_libdir_flag_spec\"
3478
compile_rpath="$rpath"
3482
for libdir in $finalize_rpath; do
3483
if test -n "$hardcode_libdir_flag_spec"; then
3484
if test -n "$hardcode_libdir_separator"; then
3485
if test -z "$hardcode_libdirs"; then
3486
hardcode_libdirs="$libdir"
3488
# Just accumulate the unique libdirs.
3489
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3490
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3493
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3498
eval flag=\"$hardcode_libdir_flag_spec\"
3499
rpath="$rpath $flag"
3501
elif test -n "$runpath_var"; then
3502
case "$finalize_perm_rpath " in
3504
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3508
# Substitute the hardcoded libdirs into the rpath.
3509
if test -n "$hardcode_libdir_separator" &&
3510
test -n "$hardcode_libdirs"; then
3511
libdir="$hardcode_libdirs"
3512
eval rpath=\" $hardcode_libdir_flag_spec\"
3514
finalize_rpath="$rpath"
3516
if test -n "$libobjs" && test "$build_old_libs" = yes; then
3517
# Transform all the library objects into standard objects.
3518
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3519
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3523
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3524
if test -n "$NM" && test -n "$global_symbol_pipe"; then
3525
dlsyms="${outputname}S.c"
3527
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3531
if test -n "$dlsyms"; then
3535
# Discover the nlist of each of the dlfiles.
3536
nlist="$output_objdir/${outputname}.nm"
3538
$show "$rm $nlist ${nlist}S ${nlist}T"
3539
$run $rm "$nlist" "${nlist}S" "${nlist}T"
3541
# Parse the name list into a source file.
3542
$show "creating $output_objdir/$dlsyms"
3544
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3545
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3546
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3552
/* Prevent the only kind of declaration conflicts we can make. */
3553
#define lt_preloaded_symbols some_other_symbol
3555
/* External symbol declarations for the compiler. */\
3558
if test "$dlself" = yes; then
3559
$show "generating symbol list for \`$output'"
3561
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3563
# Add our own program objects to the symbol list.
3564
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3565
for arg in $progfiles; do
3566
$show "extracting global C symbols from \`$arg'"
3567
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3570
if test -n "$exclude_expsyms"; then
3571
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3572
$run eval '$mv "$nlist"T "$nlist"'
3575
if test -n "$export_symbols_regex"; then
3576
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3577
$run eval '$mv "$nlist"T "$nlist"'
3580
# Prepare the list of exported symbols
3581
if test -z "$export_symbols"; then
3582
export_symbols="$output_objdir/$output.exp"
3583
$run $rm $export_symbols
3584
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3586
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3587
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3588
$run eval 'mv "$nlist"T "$nlist"'
3592
for arg in $dlprefiles; do
3593
$show "extracting global C symbols from \`$arg'"
3594
name=`echo "$arg" | sed -e 's%^.*/%%'`
3595
$run eval 'echo ": $name " >> "$nlist"'
3596
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3599
if test -z "$run"; then
3600
# Make sure we have at least an empty file.
3601
test -f "$nlist" || : > "$nlist"
3603
if test -n "$exclude_expsyms"; then
3604
egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3605
$mv "$nlist"T "$nlist"
3608
# Try sorting and uniquifying the output.
3609
if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3612
grep -v "^: " < "$nlist" > "$nlist"S
3615
if test -f "$nlist"S; then
3616
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3618
echo '/* NONE */' >> "$output_objdir/$dlsyms"
3621
$echo >> "$output_objdir/$dlsyms" "\
3623
#undef lt_preloaded_symbols
3625
#if defined (__STDC__) && __STDC__
3626
# define lt_ptr void *
3628
# define lt_ptr char *
3632
/* The mapping between symbol names and symbols. */
3637
lt_preloaded_symbols[] =
3641
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3643
$echo >> "$output_objdir/$dlsyms" "\
3647
/* This works around a problem in FreeBSD linker */
3648
#ifdef FREEBSD_WORKAROUND
3649
static const void *lt_preloaded_setup() {
3650
return lt_preloaded_symbols;
3660
pic_flag_for_symtable=
3662
# compiling the symbol table file with pic_flag works around
3663
# a FreeBSD bug that causes programs to crash when -lm is
3664
# linked before any other PIC object. But we must not use
3665
# pic_flag when linking with -static. The problem exists in
3666
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3667
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3668
case "$compile_command " in
3670
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3673
case "$compile_command " in
3675
*) pic_flag_for_symtable=" $pic_flag -DPIC";;
3679
# Now compile the dynamic symbol file.
3680
$show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3681
$run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3683
# Clean up the generated files.
3684
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3685
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3687
# Transform the symbol file into the correct name.
3688
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3689
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3692
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3697
# We keep going just in case the user didn't refer to
3698
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3699
# really was required.
3701
# Nullify the symbol file.
3702
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3703
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3706
if test $need_relink = no || test "$build_libtool_libs" != yes; then
3707
# Replace the output file specification.
3708
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3709
link_command="$compile_command$compile_rpath"
3711
# We have no uninstalled library dependencies, so finalize right now.
3712
$show "$link_command"
3713
$run eval "$link_command"
3716
# Delete the generated files.
3717
if test -n "$dlsyms"; then
3718
$show "$rm $output_objdir/${outputname}S.${objext}"
3719
$run $rm "$output_objdir/${outputname}S.${objext}"
3725
if test -n "$shlibpath_var"; then
3726
# We should set the shlibpath_var
3728
for dir in $temp_rpath; do
3730
[\\/]* | [A-Za-z]:[\\/]*)
3735
# Relative path: add a thisdir entry.
3736
rpath="$rpath\$thisdir/$dir:"
3743
if test -n "$compile_shlibpath$finalize_shlibpath"; then
3744
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3746
if test -n "$finalize_shlibpath"; then
3747
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3752
if test -n "$runpath_var"; then
3753
if test -n "$perm_rpath"; then
3754
# We should set the runpath_var.
3756
for dir in $perm_rpath; do
3759
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3761
if test -n "$finalize_perm_rpath"; then
3762
# We should set the runpath_var.
3764
for dir in $finalize_perm_rpath; do
3767
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3771
if test "$no_install" = yes; then
3772
# We don't need to create a wrapper script.
3773
link_command="$compile_var$compile_command$compile_rpath"
3774
# Replace the output file specification.
3775
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3776
# Delete the old output file.
3778
# Link the executable and exit
3779
$show "$link_command"
3780
$run eval "$link_command" || exit $?
3784
if test "$hardcode_action" = relink; then
3785
# Fast installation is not supported
3786
link_command="$compile_var$compile_command$compile_rpath"
3787
relink_command="$finalize_var$finalize_command$finalize_rpath"
3789
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3790
$echo "$modename: \`$output' will be relinked during installation" 1>&2
3792
if test "$fast_install" != no; then
3793
link_command="$finalize_var$compile_command$finalize_rpath"
3794
if test "$fast_install" = yes; then
3795
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3797
# fast_install is set to needless
3801
link_command="$compile_var$compile_command$compile_rpath"
3802
relink_command="$finalize_var$finalize_command$finalize_rpath"
3806
# Replace the output file specification.
3807
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3809
# Delete the old output files.
3810
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3812
$show "$link_command"
3813
$run eval "$link_command" || exit $?
3815
# Now create the wrapper script.
3816
$show "creating $output"
3818
# Quote the relink command for shipping.
3819
if test -n "$relink_command"; then
3820
# Preserve any variables that may affect compiler behavior
3821
for var in $variables_saved_for_relink; do
3822
if eval test -z \"\${$var+set}\"; then
3823
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3824
elif eval var_value=\$$var; test -z "$var_value"; then
3825
relink_command="$var=; export $var; $relink_command"
3827
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3828
relink_command="$var=\"$var_value\"; export $var; $relink_command"
3831
relink_command="cd `pwd`; $relink_command"
3832
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3835
# Quote $echo for shipping.
3836
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3838
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3839
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3841
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3843
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3846
# Only actually do things if our run command is non-null.
3847
if test -z "$run"; then
3848
# win32 will think the script is a binary if it has
3849
# a .exe suffix, so we strip it off here.
3851
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3853
# test for cygwin because mv fails w/o .exe extensions
3855
*cygwin*) exeext=.exe ;;
3859
trap "$rm $output; exit 1" 1 2 15
3864
# $output - temporary wrapper script for $objdir/$outputname
3865
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3867
# The $output program cannot be directly executed until all the libtool
3868
# libraries that it depends on are installed.
3870
# This wrapper script should never be moved out of the build directory.
3871
# If it is, it will not operate correctly.
3873
# Sed substitution that helps us do robust quoting. It backslashifies
3874
# metacharacters that are still active within double-quoted strings.
3875
Xsed='sed -e 1s/^X//'
3876
sed_quote_subst='$sed_quote_subst'
3878
# The HP-UX ksh and POSIX shell print the target directory to stdout
3880
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3882
relink_command=\"$relink_command\"
3884
# This environment variable determines our operation mode.
3885
if test \"\$libtool_install_magic\" = \"$magic\"; then
3886
# install mode needs the following variable:
3887
notinst_deplibs='$notinst_deplibs'
3889
# When we are sourced in execute mode, \$file and \$echo are already set.
3890
if test \"\$libtool_execute_magic\" != \"$magic\"; then
3893
# Make sure echo works.
3894
if test \"X\$1\" = X--no-reexec; then
3895
# Discard the --no-reexec flag, and continue.
3897
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3898
# Yippee, \$echo works!
3901
# Restart under the correct shell, and then maybe \$echo will work.
3902
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3908
# Find the directory that this script lives in.
3909
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3910
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3912
# Follow symbolic links until we get to the real thisdir.
3913
file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3914
while test -n \"\$file\"; do
3915
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3917
# If there was a directory component, then change thisdir.
3918
if test \"x\$destdir\" != \"x\$file\"; then
3919
case \"\$destdir\" in
3920
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3921
*) thisdir=\"\$thisdir/\$destdir\" ;;
3925
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3926
file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3929
# Try to get the absolute directory name.
3930
absdir=\`cd \"\$thisdir\" && pwd\`
3931
test -n \"\$absdir\" && thisdir=\"\$absdir\"
3934
if test "$fast_install" = yes; then
3936
program=lt-'$outputname'$exeext
3937
progdir=\"\$thisdir/$objdir\"
3939
if test ! -f \"\$progdir/\$program\" || \\
3940
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3941
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3943
file=\"\$\$-\$program\"
3945
if test ! -d \"\$progdir\"; then
3946
$mkdir \"\$progdir\"
3948
$rm \"\$progdir/\$file\"
3953
# relink executable if necessary
3954
if test -n \"\$relink_command\"; then
3955
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3957
$echo \"\$relink_command_output\" >&2
3958
$rm \"\$progdir/\$file\"
3963
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3964
{ $rm \"\$progdir/\$program\";
3965
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3966
$rm \"\$progdir/\$file\"
3970
program='$outputname'
3971
progdir=\"\$thisdir/$objdir\"
3977
if test -f \"\$progdir/\$program\"; then"
3979
# Export our shlibpath_var if we have one.
3980
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3982
# Add our own library path to $shlibpath_var
3983
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3985
# Some systems cannot cope with colon-terminated $shlibpath_var
3986
# The second colon is a workaround for a bug in BeOS R4 sed
3987
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3989
export $shlibpath_var
3993
# fixup the dll searchpath if we need to.
3994
if test -n "$dllsearchpath"; then
3996
# Add the dll search path components to the executable PATH
3997
PATH=$dllsearchpath:\$PATH
4002
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4003
# Run the actual program with our arguments.
4006
# win32 systems need to use the prog path for dll
4008
*-*-cygwin* | *-*-pw32*)
4010
exec \$progdir/\$program \${1+\"\$@\"}
4014
# Backslashes separate directories on plain windows
4015
*-*-mingw | *-*-os2*)
4017
exec \$progdir\\\\\$program \${1+\"\$@\"}
4023
# Export the path to the program.
4024
PATH=\"\$progdir:\$PATH\"
4027
exec \$program \${1+\"\$@\"}
4032
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4036
# The program doesn't exist.
4037
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4038
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4039
echo \"See the $PACKAGE documentation for more information.\" 1>&2
4050
# See if we need to build an old-fashioned archive.
4051
for oldlib in $oldlibs; do
4053
if test "$build_libtool_libs" = convenience; then
4054
oldobjs="$libobjs_save"
4055
addlibs="$convenience"
4056
build_libtool_libs=no
4058
if test "$build_libtool_libs" = module; then
4059
oldobjs="$libobjs_save"
4060
build_libtool_libs=no
4062
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4064
addlibs="$old_convenience"
4067
if test -n "$addlibs"; then
4068
gentop="$output_objdir/${outputname}x"
4069
$show "${rm}r $gentop"
4070
$run ${rm}r "$gentop"
4071
$show "mkdir $gentop"
4072
$run mkdir "$gentop"
4074
if test $status -ne 0 && test ! -d "$gentop"; then
4077
generated="$generated $gentop"
4079
# Add in members from convenience archives.
4080
for xlib in $addlibs; do
4081
# Extract the objects.
4083
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4084
*) xabs=`pwd`"/$xlib" ;;
4086
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4087
xdir="$gentop/$xlib"
4089
$show "${rm}r $xdir"
4094
if test $status -ne 0 && test ! -d "$xdir"; then
4097
$show "(cd $xdir && $AR x $xabs)"
4098
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4100
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4104
# Do each command in the archive commands.
4105
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4106
eval cmds=\"$old_archive_from_new_cmds\"
4108
# Ensure that we have .o objects in place in case we decided
4109
# not to build a shared library, and have fallen back to building
4110
# static libs even though --disable-static was passed!
4111
for oldobj in $oldobjs; do
4112
if test ! -f $oldobj; then
4113
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4114
if test "X$xdir" = "X$oldobj"; then
4119
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4120
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4121
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
4122
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4126
eval cmds=\"$old_archive_cmds\"
4128
save_ifs="$IFS"; IFS='~'
4129
for cmd in $cmds; do
4132
$run eval "$cmd" || exit $?
4137
if test -n "$generated"; then
4138
$show "${rm}r$generated"
4139
$run ${rm}r$generated
4142
# Now create the libtool archive.
4146
test "$build_old_libs" = yes && old_library="$libname.$libext"
4147
$show "creating $output"
4149
# Preserve any variables that may affect compiler behavior
4150
for var in $variables_saved_for_relink; do
4151
if eval test -z \"\${$var+set}\"; then
4152
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4153
elif eval var_value=\$$var; test -z "$var_value"; then
4154
relink_command="$var=; export $var; $relink_command"
4156
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4157
relink_command="$var=\"$var_value\"; export $var; $relink_command"
4160
# Quote the link command for shipping.
4161
relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
4162
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4164
# Only create the output if not a dry run.
4165
if test -z "$run"; then
4166
for installed in no yes; do
4167
if test "$installed" = yes; then
4168
if test -z "$install_libdir"; then
4171
output="$output_objdir/$outputname"i
4172
# Replace all uninstalled libtool libraries with the installed ones
4174
for deplib in $dependency_libs; do
4177
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4178
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4179
if test -z "$libdir"; then
4180
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4183
newdependency_libs="$newdependency_libs $libdir/$name"
4185
*) newdependency_libs="$newdependency_libs $deplib" ;;
4188
dependency_libs="$newdependency_libs"
4190
for lib in $dlfiles; do
4191
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4192
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4193
if test -z "$libdir"; then
4194
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4197
newdlfiles="$newdlfiles $libdir/$name"
4199
dlfiles="$newdlfiles"
4201
for lib in $dlprefiles; do
4202
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4203
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4204
if test -z "$libdir"; then
4205
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4208
newdlprefiles="$newdlprefiles $libdir/$name"
4210
dlprefiles="$newdlprefiles"
4213
# place dlname in correct position for cygwin
4215
case $host,$output,$installed,$module,$dlname in
4216
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4219
# $outputname - a libtool library file
4220
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4222
# Please DO NOT delete this file!
4223
# It is necessary for linking the library.
4225
# The name that we can dlopen(3).
4228
# Names of this library.
4229
library_names='$library_names'
4231
# The name of the static archive.
4232
old_library='$old_library'
4234
# Libraries that this one depends upon.
4235
dependency_libs='$dependency_libs'
4237
# Version information for $libname.
4242
# Is this an already installed library?
4243
installed=$installed
4245
# Files to dlopen/dlpreopen
4247
dlpreopen='$dlprefiles'
4249
# Directory that this library needs to be installed in:
4250
libdir='$install_libdir'"
4251
if test "$installed" = no && test $need_relink = yes; then
4253
relink_command=\"$relink_command\""
4258
# Do a symbolic link so that the libtool archive can be found in
4259
# LD_LIBRARY_PATH before the program is installed.
4260
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4261
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4267
# libtool install mode
4269
modename="$modename: install"
4271
# There may be an optional sh(1) argument at the beginning of
4272
# install_prog (especially on Windows NT).
4273
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4274
# Allow the use of GNU shtool's install command.
4275
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4276
# Aesthetically quote it.
4277
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4279
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4283
install_prog="$arg "
4291
# The real first argument should be the name of the installation program.
4292
# Aesthetically quote it.
4293
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4295
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4299
install_prog="$install_prog$arg"
4301
# We need to accept at least all the BSD install flags.
4311
if test -n "$dest"; then
4312
files="$files $dest"
4330
# If the previous option needed an argument, then skip it.
4331
if test -n "$prev"; then
4340
# Aesthetically quote the argument.
4341
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4343
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4347
install_prog="$install_prog $arg"
4350
if test -z "$install_prog"; then
4351
$echo "$modename: you must specify an install program" 1>&2
4356
if test -n "$prev"; then
4357
$echo "$modename: the \`$prev' option requires an argument" 1>&2
4362
if test -z "$files"; then
4363
if test -z "$dest"; then
4364
$echo "$modename: no file or destination specified" 1>&2
4366
$echo "$modename: you must specify a destination" 1>&2
4372
# Strip any trailing slash from the destination.
4373
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4375
# Check to see that the destination is a directory.
4376
test -d "$dest" && isdir=yes
4377
if test "$isdir" = yes; then
4381
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4382
test "X$destdir" = "X$dest" && destdir=.
4383
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4385
# Not a directory, so check to see that there is only one file specified.
4387
if test $# -gt 2; then
4388
$echo "$modename: \`$dest' is not a directory" 1>&2
4394
[\\/]* | [A-Za-z]:[\\/]*) ;;
4396
for file in $files; do
4400
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4409
# This variable tells wrapper scripts just to set variables rather
4410
# than running their programs.
4411
libtool_install_magic="$magic"
4416
for file in $files; do
4418
# Do each installation.
4421
# Do the static libraries later.
4422
staticlibs="$staticlibs $file"
4426
# Check to see that this really is a libtool archive.
4427
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4429
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4437
# If there is no directory component, then add one.
4439
*/* | *\\*) . $file ;;
4443
# Add the libdir to current_libdirs if it is the destination.
4444
if test "X$destdir" = "X$libdir"; then
4445
case "$current_libdirs " in
4447
*) current_libdirs="$current_libdirs $libdir" ;;
4450
# Note the libdir as a future libdir.
4451
case "$future_libdirs " in
4453
*) future_libdirs="$future_libdirs $libdir" ;;
4457
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4458
test "X$dir" = "X$file/" && dir=
4461
if test -n "$relink_command"; then
4462
$echo "$modename: warning: relinking \`$file'" 1>&2
4463
$show "$relink_command"
4464
if $run eval "$relink_command"; then :
4466
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4471
# See the names of the shared library.
4472
set dummy $library_names
4473
if test -n "$2"; then
4479
test -n "$relink_command" && srcname="$realname"T
4481
# Install the shared library and build the symlinks.
4482
$show "$install_prog $dir/$srcname $destdir/$realname"
4483
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4484
if test -n "$stripme" && test -n "$striplib"; then
4485
$show "$striplib $destdir/$realname"
4486
$run eval "$striplib $destdir/$realname" || exit $?
4489
if test $# -gt 0; then
4490
# Delete the old symlinks, and create new ones.
4493
if test "$linkname" != "$realname"; then
4494
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4495
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4500
# Do each command in the postinstall commands.
4501
lib="$destdir/$realname"
4502
eval cmds=\"$postinstall_cmds\"
4503
save_ifs="$IFS"; IFS='~'
4504
for cmd in $cmds; do
4507
$run eval "$cmd" || exit $?
4512
# Install the pseudo-library for information purposes.
4513
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4514
instname="$dir/$name"i
4515
$show "$install_prog $instname $destdir/$name"
4516
$run eval "$install_prog $instname $destdir/$name" || exit $?
4518
# Maybe install the static library, too.
4519
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4523
# Install (i.e. copy) a libtool object.
4525
# Figure out destination file name, if it wasn't already specified.
4526
if test -n "$destname"; then
4527
destfile="$destdir/$destname"
4529
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4530
destfile="$destdir/$destfile"
4533
# Deduce the name of the destination old-style object file.
4536
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4539
staticdest="$destfile"
4543
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4549
# Install the libtool object if requested.
4550
if test -n "$destfile"; then
4551
$show "$install_prog $file $destfile"
4552
$run eval "$install_prog $file $destfile" || exit $?
4555
# Install the old object if enabled.
4556
if test "$build_old_libs" = yes; then
4557
# Deduce the name of the old-style object file.
4558
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4560
$show "$install_prog $staticobj $staticdest"
4561
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
4567
# Figure out destination file name, if it wasn't already specified.
4568
if test -n "$destname"; then
4569
destfile="$destdir/$destname"
4571
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4572
destfile="$destdir/$destfile"
4575
# Do a test to see if this is really a libtool program.
4576
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4580
# If there is no directory component, then add one.
4582
*/* | *\\*) . $file ;;
4586
# Check the variables that should have been set.
4587
if test -z "$notinst_deplibs"; then
4588
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4593
for lib in $notinst_deplibs; do
4594
# Check to see that each library is installed.
4596
if test -f "$lib"; then
4597
# If there is no directory component, then add one.
4599
*/* | *\\*) . $lib ;;
4603
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4604
if test -n "$libdir" && test ! -f "$libfile"; then
4605
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4611
# If there is no directory component, then add one.
4613
*/* | *\\*) . $file ;;
4618
if test "$fast_install" = no && test -n "$relink_command"; then
4619
if test "$finalize" = yes && test -z "$run"; then
4621
test -n "$TMPDIR" && tmpdir="$TMPDIR"
4622
tmpdir="$tmpdir/libtool-$$"
4623
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4625
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4628
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4629
outputname="$tmpdir/$file"
4630
# Replace the output file specification.
4631
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4633
$show "$relink_command"
4634
if $run eval "$relink_command"; then :
4636
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4642
$echo "$modename: warning: cannot relink \`$file'" 1>&2
4645
# Install the binary that we compiled earlier.
4646
file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4650
# remove .exe since cygwin /usr/bin/install will append another
4652
case $install_prog,$host in
4653
/usr/bin/install*,*cygwin*)
4654
case $file:$destfile in
4659
destfile=$destfile.exe
4662
destfile=`echo $destfile | sed -e 's,.exe$,,'`
4667
$show "$install_prog$stripme $file $destfile"
4668
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4669
test -n "$outputname" && ${rm}r "$tmpdir"
4674
for file in $staticlibs; do
4675
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4677
# Set up the ranlib parameters.
4678
oldlib="$destdir/$name"
4680
$show "$install_prog $file $oldlib"
4681
$run eval "$install_prog \$file \$oldlib" || exit $?
4683
if test -n "$stripme" && test -n "$striplib"; then
4684
$show "$old_striplib $oldlib"
4685
$run eval "$old_striplib $oldlib" || exit $?
4688
# Do each command in the postinstall commands.
4689
eval cmds=\"$old_postinstall_cmds\"
4690
save_ifs="$IFS"; IFS='~'
4691
for cmd in $cmds; do
4694
$run eval "$cmd" || exit $?
4699
if test -n "$future_libdirs"; then
4700
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4703
if test -n "$current_libdirs"; then
4704
# Maybe just do a dry run.
4705
test -n "$run" && current_libdirs=" -n$current_libdirs"
4706
exec_cmd='$SHELL $0 --finish$current_libdirs'
4712
# libtool finish mode
4714
modename="$modename: finish"
4718
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4721
libdirs="$libdirs $dir"
4724
for libdir in $libdirs; do
4725
if test -n "$finish_cmds"; then
4726
# Do each command in the finish commands.
4727
eval cmds=\"$finish_cmds\"
4728
save_ifs="$IFS"; IFS='~'
4729
for cmd in $cmds; do
4732
$run eval "$cmd" || admincmds="$admincmds
4737
if test -n "$finish_eval"; then
4738
# Do the single finish_eval.
4739
eval cmds=\"$finish_eval\"
4740
$run eval "$cmds" || admincmds="$admincmds
4746
# Exit here if they wanted silent mode.
4747
test "$show" = ":" && exit 0
4749
echo "----------------------------------------------------------------------"
4750
echo "Libraries have been installed in:"
4751
for libdir in $libdirs; do
4755
echo "If you ever happen to want to link against installed libraries"
4756
echo "in a given directory, LIBDIR, you must either use libtool, and"
4757
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4758
echo "flag during linking and do at least one of the following:"
4759
if test -n "$shlibpath_var"; then
4760
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4761
echo " during execution"
4763
if test -n "$runpath_var"; then
4764
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4765
echo " during linking"
4767
if test -n "$hardcode_libdir_flag_spec"; then
4769
eval flag=\"$hardcode_libdir_flag_spec\"
4771
echo " - use the \`$flag' linker flag"
4773
if test -n "$admincmds"; then
4774
echo " - have your system administrator run these commands:$admincmds"
4776
if test -f /etc/ld.so.conf; then
4777
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4780
echo "See any operating system documentation about shared libraries for"
4781
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4782
echo "----------------------------------------------------------------------"
4786
# libtool execute mode
4788
modename="$modename: execute"
4790
# The first argument is the command name.
4792
if test -z "$cmd"; then
4793
$echo "$modename: you must specify a COMMAND" 1>&2
4798
# Handle -dlopen flags immediately.
4799
for file in $execute_dlfiles; do
4800
if test ! -f "$file"; then
4801
$echo "$modename: \`$file' is not a file" 1>&2
4809
# Check to see that this really is a libtool archive.
4810
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4812
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4817
# Read the libtool library.
4821
# If there is no directory component, then add one.
4823
*/* | *\\*) . $file ;;
4827
# Skip this library if it cannot be dlopened.
4828
if test -z "$dlname"; then
4829
# Warn if it was a shared library.
4830
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4834
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4835
test "X$dir" = "X$file" && dir=.
4837
if test -f "$dir/$objdir/$dlname"; then
4840
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4846
# Just add the directory containing the .lo file.
4847
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4848
test "X$dir" = "X$file" && dir=.
4852
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4857
# Get the absolute pathname.
4858
absdir=`cd "$dir" && pwd`
4859
test -n "$absdir" && dir="$absdir"
4861
# Now add the directory to shlibpath_var.
4862
if eval "test -z \"\$$shlibpath_var\""; then
4863
eval "$shlibpath_var=\"\$dir\""
4865
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4869
# This variable tells wrapper scripts just to set shlibpath_var
4870
# rather than running their programs.
4871
libtool_execute_magic="$magic"
4873
# Check if any of the arguments is a wrapper script.
4880
# Do a test to see if this is really a libtool program.
4881
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4882
# If there is no directory component, then add one.
4884
*/* | *\\*) . $file ;;
4888
# Transform arg to wrapped name.
4889
file="$progdir/$program"
4893
# Quote arguments (to preserve shell metacharacters).
4894
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4895
args="$args \"$file\""
4898
if test -z "$run"; then
4899
if test -n "$shlibpath_var"; then
4900
# Export the shlibpath_var.
4901
eval "export $shlibpath_var"
4904
# Restore saved enviroment variables
4905
if test "${save_LC_ALL+set}" = set; then
4906
LC_ALL="$save_LC_ALL"; export LC_ALL
4908
if test "${save_LANG+set}" = set; then
4909
LANG="$save_LANG"; export LANG
4912
# Now prepare to actually exec the command.
4913
exec_cmd='"$cmd"$args'
4915
# Display what would be done.
4916
if test -n "$shlibpath_var"; then
4917
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4918
$echo "export $shlibpath_var"
4925
# libtool clean and uninstall mode
4927
modename="$modename: $mode"
4933
# This variable tells wrapper scripts just to set variables rather
4934
# than running their programs.
4935
libtool_install_magic="$magic"
4940
-f) rm="$rm $arg"; rmforce=yes ;;
4941
-*) rm="$rm $arg" ;;
4942
*) files="$files $arg" ;;
4946
if test -z "$rm"; then
4947
$echo "$modename: you must specify an RM program" 1>&2
4954
for file in $files; do
4955
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4956
if test "X$dir" = "X$file"; then
4960
objdir="$dir/$objdir"
4962
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4963
test $mode = uninstall && objdir="$dir"
4965
# Remember objdir for removal later, being careful to avoid duplicates
4966
if test $mode = clean; then
4969
*) rmdirs="$rmdirs $objdir" ;;
4973
# Don't error if the file doesn't exist and rm -f was used.
4974
if (test -L "$file") >/dev/null 2>&1 \
4975
|| (test -h "$file") >/dev/null 2>&1 \
4976
|| test -f "$file"; then
4978
elif test -d "$file"; then
4981
elif test "$rmforce" = yes; then
4989
# Possibly a libtool archive, so verify it.
4990
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4993
# Delete the libtool libraries and symlinks.
4994
for n in $library_names; do
4995
rmfiles="$rmfiles $objdir/$n"
4997
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4998
test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5000
if test $mode = uninstall; then
5001
if test -n "$library_names"; then
5002
# Do each command in the postuninstall commands.
5003
eval cmds=\"$postuninstall_cmds\"
5004
save_ifs="$IFS"; IFS='~'
5005
for cmd in $cmds; do
5009
if test $? != 0 && test "$rmforce" != yes; then
5016
if test -n "$old_library"; then
5017
# Do each command in the old_postuninstall commands.
5018
eval cmds=\"$old_postuninstall_cmds\"
5019
save_ifs="$IFS"; IFS='~'
5020
for cmd in $cmds; do
5024
if test $? != 0 && test "$rmforce" != yes; then
5030
# FIXME: should reinstall the best remaining shared library.
5036
if test "$build_old_libs" = yes; then
5037
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5038
rmfiles="$rmfiles $dir/$oldobj"
5043
# Do a test to see if this is a libtool program.
5044
if test $mode = clean &&
5045
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5049
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5050
if test "$fast_install" = yes && test -n "$relink_command"; then
5051
rmfiles="$rmfiles $objdir/lt-$name"
5056
$show "$rm $rmfiles"
5057
$run $rm $rmfiles || exit_status=1
5060
# Try to remove the ${objdir}s in the directories where we deleted files
5061
for dir in $rmdirs; do
5062
if test -d "$dir"; then
5064
$run rmdir $dir >/dev/null 2>&1
5072
$echo "$modename: you must specify a MODE" 1>&2
5073
$echo "$generic_help" 1>&2
5078
if test -z "$exec_cmd"; then
5079
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5080
$echo "$generic_help" 1>&2
5083
fi # test -z "$show_help"
5085
if test -n "$exec_cmd"; then
5090
# We need to display help for each of the modes.
5093
"Usage: $modename [OPTION]... [MODE-ARG]...
5095
Provide generalized library-building support services.
5097
--config show all configuration variables
5098
--debug enable verbose shell tracing
5099
-n, --dry-run display commands without modifying any files
5100
--features display basic configuration information and exit
5101
--finish same as \`--mode=finish'
5102
--help display this help message and exit
5103
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5104
--quiet same as \`--silent'
5105
--silent don't print informational messages
5106
--version print version information
5108
MODE must be one of the following:
5110
clean remove files from the build directory
5111
compile compile a source file into a libtool object
5112
execute automatically set library path, then run a program
5113
finish complete the installation of libtool libraries
5114
install install libraries or executables
5115
link create a library or an executable
5116
uninstall remove libraries from an installed directory
5118
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5119
a more detailed description of MODE."
5125
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5127
Remove files from the build directory.
5129
RM is the name of the program to use to delete files associated with each FILE
5130
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5133
If FILE is a libtool library, object or program, all the files associated
5134
with it are deleted. Otherwise, only FILE itself is deleted using RM."
5139
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5141
Compile a source file into a libtool library object.
5143
This mode accepts the following additional options:
5145
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
5146
-prefer-pic try to building PIC objects only
5147
-prefer-non-pic try to building non-PIC objects only
5148
-static always build a \`.o' file suitable for static linking
5150
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5151
from the given SOURCEFILE.
5153
The output file name is determined by removing the directory component from
5154
SOURCEFILE, then substituting the C source code suffix \`.c' with the
5155
library object suffix, \`.lo'."
5160
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5162
Automatically set library path, then run a program.
5164
This mode accepts the following additional options:
5166
-dlopen FILE add the directory containing FILE to the library path
5168
This mode sets the library path environment variable according to \`-dlopen'
5171
If any of the ARGS are libtool executable wrappers, then they are translated
5172
into their corresponding uninstalled binary, and any of their required library
5173
directories are added to the library path.
5175
Then, COMMAND is executed, with ARGS as arguments."
5180
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5182
Complete the installation of libtool libraries.
5184
Each LIBDIR is a directory that contains libtool libraries.
5186
The commands that this mode executes may require superuser privileges. Use
5187
the \`--dry-run' option if you just want to see what would be executed."
5192
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5194
Install executables or libraries.
5196
INSTALL-COMMAND is the installation command. The first component should be
5197
either the \`install' or \`cp' program.
5199
The rest of the components are interpreted as arguments to that command (only
5200
BSD-compatible install options are recognized)."
5205
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5207
Link object files or libraries together to form another library, or to
5208
create an executable program.
5210
LINK-COMMAND is a command using the C compiler that you would use to create
5211
a program from several object files.
5213
The following components of LINK-COMMAND are treated specially:
5215
-all-static do not do any dynamic linking at all
5216
-avoid-version do not add a version suffix if possible
5217
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5218
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5219
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5220
-export-symbols SYMFILE
5221
try to export only the symbols listed in SYMFILE
5222
-export-symbols-regex REGEX
5223
try to export only the symbols matching REGEX
5224
-LLIBDIR search LIBDIR for required installed libraries
5225
-lNAME OUTPUT-FILE requires the installed library libNAME
5226
-jnimodule build a library that can dlopened via Java JNI
5227
-module build a library that can dlopened
5228
-no-fast-install disable the fast-install mode
5229
-no-install link a not-installable executable
5230
-no-undefined declare that a library does not refer to external symbols
5231
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5232
-release RELEASE specify package release information
5233
-rpath LIBDIR the created library will eventually be installed in LIBDIR
5234
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5235
-static do not do any dynamic linking of libtool libraries
5236
-version-info CURRENT[:REVISION[:AGE]]
5237
specify library version info [each variable defaults to 0]
5239
All other options (arguments beginning with \`-') are ignored.
5241
Every other argument is treated as a filename. Files ending in \`.la' are
5242
treated as uninstalled libtool libraries, other files are standard or library
5245
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5246
only library objects (\`.lo' files) may be specified, and \`-rpath' is
5247
required, except when creating a convenience library.
5249
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5250
using \`ar' and \`ranlib', or on Windows using \`lib'.
5252
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5253
is created, otherwise an executable program is created."
5258
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5260
Remove libraries from an installation directory.
5262
RM is the name of the program to use to delete files associated with each FILE
5263
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5266
If FILE is a libtool library, all the files associated with it are deleted.
5267
Otherwise, only FILE itself is deleted using RM."
5271
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5278
$echo "Try \`$modename --help' for more information about other modes."