3
# libtool - Provide generalized library-building support services.
4
# Generated automatically by (GNU stunnel 4.05)
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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
# A sed that does not truncate output.
32
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
33
Xsed="/bin/sed -e s/^X//"
35
# The HP-UX ksh and POSIX shell print the target directory to stdout
37
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
39
# ### BEGIN LIBTOOL CONFIG
41
# Libtool was configured on host morpheus:
43
# Shell to use when invoking shell scripts.
46
# Whether or not to build shared libraries.
47
build_libtool_libs=yes
49
# Whether or not to build static libraries.
52
# Whether or not to add -lc for building shared libraries.
53
build_libtool_need_lc=no
55
# Whether or not to optimize for fast installation.
60
host=i386-pc-linux-gnu
62
# An echo program that does not interpret backslashes.
69
# The default C compiler.
72
# Is the compiler the GNU C compiler?
75
# The linker used to build libraries.
78
# Whether we need hard or soft links.
81
# A BSD-compatible nm program.
84
# A symbol stripping program
87
# Used to examine libraries when file_magic_cmd begins "file"
90
# Used on cygwin: DLL creation program.
93
# Used on cygwin: object dumper.
96
# Used on cygwin: assembler.
99
# The name of the directory that contains temporary libtool files.
102
# How to create reloadable object files.
104
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
106
# How to pass a linker flag through the compiler.
109
# Object file suffix (normally "o").
112
# Old archive suffix (normally "a").
115
# Executable file suffix (normally "").
118
# Additional compiler flags for building library objects.
122
# Does compiler simultaneously support -c and -o options?
125
# Can we write directly to a .lo ?
128
# Must we lock files when doing compilation ?
131
# Do we need the lib prefix for modules?
134
# Do we need a version for libraries?
137
# Whether dlopen is supported.
138
dlopen_support=unknown
140
# Whether dlopen of programs is supported.
143
# Whether dlopen of statically linked programs is supported.
144
dlopen_self_static=unknown
146
# Compiler flag to prevent dynamic linking.
147
link_static_flag="-static"
149
# Compiler flag to turn off builtin functions.
150
no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
152
# Compiler flag to allow reflexive dlopens.
153
export_dynamic_flag_spec="\${wl}--export-dynamic"
155
# Compiler flag to generate shared objects directly from archives.
156
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
158
# Compiler flag to generate thread-safe objects.
159
thread_safe_flag_spec=""
161
# Library versioning type.
164
# Format of library name prefix.
165
libname_spec="lib\$name"
167
# List of archive names. First name is the real one, the rest are links.
168
# The last name is the one that the linker finds with -lNAME.
169
library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
171
# The coded name of the library, if different from the real name.
172
soname_spec="\${libname}\${release}.so\$major"
174
# Commands used to build and install an old-style archive.
176
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
177
old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
178
old_postuninstall_cmds=""
180
# Create an old-style archive from a shared archive.
181
old_archive_from_new_cmds=""
183
# Create a temporary old-style archive to link instead of a shared archive.
184
old_archive_from_expsyms_cmds=""
186
# Commands used to build and install a shared archive.
187
archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
188
archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
190
postuninstall_cmds=""
192
# Commands to strip libraries.
193
old_striplib="strip --strip-debug"
194
striplib="strip --strip-unneeded"
196
# Method to check whether dependent libraries are shared objects.
197
deplibs_check_method="pass_all"
199
# Command to use when deplibs_check_method == file_magic.
200
file_magic_cmd="\$MAGIC_CMD"
202
# Flag that allows shared libraries with undefined symbols to be built.
203
allow_undefined_flag=""
205
# Flag that forces no undefined symbols.
208
# Commands used to finish a libtool library installation in a directory.
209
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
211
# Same as above, but a single script fragment to be evaled but not shown.
214
# Take the output of nm and produce a listing of raw symbols and C names.
215
global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
217
# Transform the output of nm in a proper C declaration
218
global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
220
# Transform the output of nm in a C name address pair
221
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
223
# This is the shared library runtime path variable.
224
runpath_var=LD_RUN_PATH
226
# This is the shared library path variable.
227
shlibpath_var=LD_LIBRARY_PATH
229
# Is shlibpath searched before the hard-coded library search path?
230
shlibpath_overrides_runpath=no
232
# How to hardcode a shared library path into an executable.
233
hardcode_action=immediate
235
# Whether we should hardcode library paths into libraries.
236
hardcode_into_libs=yes
238
# Flag to hardcode $libdir into a binary during linking.
239
# This must work even if $libdir does not exist.
240
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
242
# Whether we need a single -rpath flag with a separated argument.
243
hardcode_libdir_separator=""
245
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
249
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
253
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
254
# the resulting binary.
255
hardcode_shlibpath_var=unsupported
257
# Variables whose values should be saved in libtool wrapper scripts and
258
# restored at relink time.
259
variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
261
# Whether libtool must link a program against all its dependency libraries.
262
link_all_deplibs=unknown
264
# Compile-time system search path for libraries
265
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
267
# Run-time system search path for libraries
268
sys_lib_dlsearch_path_spec="/lib /usr/lib"
270
# Fix the shell variable $srcfile for the compiler.
273
# Set to yes if exported symbols are required.
274
always_export_symbols=no
276
# The commands to list exported symbols.
277
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
279
# The commands to extract the exported symbol list from a shared archive.
280
extract_expsyms_cmds=""
282
# Symbols that should not be listed in the preloaded symbols.
283
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
285
# Symbols that must always be exported.
288
# ### END LIBTOOL CONFIG
290
# ltmain.sh - Provide generalized library-building support services.
291
# NOTE: Changing this file will not affect anything until you rerun configure.
293
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
294
# Free Software Foundation, Inc.
295
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
297
# This program is free software; you can redistribute it and/or modify
298
# it under the terms of the GNU General Public License as published by
299
# the Free Software Foundation; either version 2 of the License, or
300
# (at your option) any later version.
302
# This program is distributed in the hope that it will be useful, but
303
# WITHOUT ANY WARRANTY; without even the implied warranty of
304
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
305
# General Public License for more details.
307
# You should have received a copy of the GNU General Public License
308
# along with this program; if not, write to the Free Software
309
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
311
# As a special exception to the GNU General Public License, if you
312
# distribute this file as part of a program that contains a
313
# configuration script generated by Autoconf, you may include it under
314
# the same distribution terms that you use for the rest of that program.
316
# Check that we have a working $echo.
317
if test "X$1" = X--no-reexec; then
318
# Discard the --no-reexec flag, and continue.
320
elif test "X$1" = X--fallback-echo; then
321
# Avoid inline document here, it may be left over
323
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
324
# Yippee, $echo works!
327
# Restart under the correct shell, and then maybe $echo will work.
328
exec $SHELL "$0" --no-reexec ${1+"$@"}
331
if test "X$1" = X--fallback-echo; then
332
# used as fallback echo
340
# The name of this program.
341
progname=`$echo "$0" | sed 's%^.*/%%'`
348
TIMESTAMP=" (1.922.2.79 2001/11/28 21:50:31)"
351
help="Try \`$progname --help' for more information."
352
magic="%%%MAGIC variable%%%"
357
# Sed substitution that helps us do robust quoting. It backslashifies
358
# metacharacters that are still active within double-quoted strings.
359
Xsed='sed -e 1s/^X//'
360
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
362
NL2SP='tr \015\012 \040\040'
365
# Only set LANG and LC_ALL to C if already set.
366
# These must not be set unconditionally because not all systems understand
367
# e.g. LANG=C (notably SCO).
368
# We save the old values to restore during execute mode.
369
if test "${LC_ALL+set}" = set; then
370
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
372
if test "${LANG+set}" = set; then
373
save_LANG="$LANG"; LANG=C; export LANG
376
# Make sure IFS has a sensible default
379
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
380
echo "$modename: not configured to build any kind of library" 1>&2
381
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
394
lo2o="s/\\.lo\$/.${objext}/"
395
o2lo="s/\\.${objext}\$/.lo/"
397
# Parse our command line options once, thoroughly.
404
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
408
# If the previous option needs an argument, assign it.
409
if test -n "$prev"; then
412
execute_dlfiles="$execute_dlfiles $arg"
424
# Have we seen a non-optional argument yet?
431
echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
436
sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
441
echo "$progname: enabling shell trace mode"
451
if test "$build_libtool_libs" = yes; then
452
echo "enable shared libraries"
454
echo "disable shared libraries"
456
if test "$build_old_libs" = yes; then
457
echo "enable static libraries"
459
echo "disable static libraries"
464
--finish) mode="finish" ;;
466
--mode) prevopt="--mode" prev=mode ;;
467
--mode=*) mode="$optarg" ;;
469
--preserve-dup-deps) duplicate_deps="yes" ;;
481
$echo "$modename: unrecognized option \`$arg'" 1>&2
493
if test -n "$prevopt"; then
494
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
499
# If this variable is set in any of the actions, the command in it
500
# will be execed at the end. This prevents here-documents from being
501
# left over by shells.
504
if test -z "$show_help"; then
506
# Infer the operation mode.
507
if test -z "$mode"; then
509
*cc | *++ | gcc* | *-gcc*)
521
*db | *dbx | *strace | *truss)
531
# If we have no mode, but dlfiles were specified, then do execute mode.
532
test -n "$execute_dlfiles" && mode=execute
534
# Just use the default operation mode.
535
if test -z "$mode"; then
536
if test -n "$nonopt"; then
537
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
539
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
546
# Only execute mode is allowed to have -dlopen flags.
547
if test -n "$execute_dlfiles" && test "$mode" != execute; then
548
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
553
# Change the help message to a mode-specific one.
555
help="Try \`$modename --help --mode=$mode' for more information."
557
# These modes are in order of execution frequency so that they run quickly.
559
# libtool compile mode
561
modename="$modename: compile"
562
# Get the compilation command and the source file.
575
# Aesthetically quote the previous argument.
577
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
580
# Double-quote args containing other shell metacharacters.
581
# Many Bourne shells cannot handle close brackets correctly
582
# in scan sets, so we specify it separately.
583
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
588
# Add the previous argument to base_compile.
589
if test -z "$base_compile"; then
590
base_compile="$lastarg"
592
base_compile="$base_compile $lastarg"
598
# Accept any command-line options.
601
if test "$user_target" != "no"; then
602
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
629
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
631
save_ifs="$IFS"; IFS=','
635
# Double-quote args containing other shell metacharacters.
636
# Many Bourne shells cannot handle close brackets correctly
637
# in scan sets, so we specify it separately.
639
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
643
lastarg="$lastarg $arg"
646
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
648
# Add the arguments to base_compile.
649
if test -z "$base_compile"; then
650
base_compile="$lastarg"
652
base_compile="$base_compile $lastarg"
660
# The next one is the -o target name
665
# We got the output file
672
# Accept the current argument as the source file.
676
# Aesthetically quote the previous argument.
678
# Backslashify any backslashes, double quotes, and dollar signs.
679
# These are the only characters that are still specially
680
# interpreted inside of double-quoted scrings.
681
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
683
# Double-quote args containing other shell metacharacters.
684
# Many Bourne shells cannot handle close brackets correctly
685
# in scan sets, so we specify it separately.
687
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
688
lastarg="\"$lastarg\""
692
# Add the previous argument to base_compile.
693
if test -z "$base_compile"; then
694
base_compile="$lastarg"
696
base_compile="$base_compile $lastarg"
704
# Get the name of the library object.
705
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
708
$echo "$modename: you must specify a target with \`-o'" 1>&2
713
# Recognize several different file suffixes.
714
# If the user specifies -o file.o, it is replaced with file.lo
729
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
732
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
734
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
739
if test -z "$base_compile"; then
740
$echo "$modename: you must specify a compilation command" 1>&2
745
# Delete any leftover library objects.
746
if test "$build_old_libs" = yes; then
747
removelist="$obj $libobj"
753
trap "$run $rm $removelist; exit 1" 1 2 15
755
# On Cygwin there's no "real" PIC flag so we must build both object types
757
cygwin* | mingw* | pw32* | os2*)
761
if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
762
# non-PIC code in shared libraries is not supported
766
# Calculate the filename of the output object if compiler does
767
# not support -o with -c
768
if test "$compiler_c_o" = no; then
769
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
770
lockfile="$output_obj.lock"
771
removelist="$removelist $output_obj $lockfile"
772
trap "$run $rm $removelist; exit 1" 1 2 15
778
# Lock this critical section if it is needed
779
# We use this script file to make the link, it avoids creating a new file
780
if test "$need_locks" = yes; then
781
until $run ln "$0" "$lockfile" 2>/dev/null; do
782
$show "Waiting for $lockfile to be removed"
785
elif test "$need_locks" = warn; then
786
if test -f "$lockfile"; then
788
*** ERROR, $lockfile exists and contains:
789
`cat $lockfile 2>/dev/null`
791
This indicates that another process is trying to use the same
792
temporary object file, and libtool could not work around it because
793
your compiler does not support \`-c' and \`-o' together. If you
794
repeat this compilation, it may succeed, by chance, but you had better
795
avoid parallel builds (make -j) in this platform, or get a better
801
echo $srcfile > "$lockfile"
804
if test -n "$fix_srcfile_path"; then
805
eval srcfile=\"$fix_srcfile_path\"
808
# Only build a PIC object if we are building libtool libraries.
809
if test "$build_libtool_libs" = yes; then
810
# Without this assignment, base_compile gets emptied.
811
fbsd_hideous_sh_bug=$base_compile
813
if test "$pic_mode" != no; then
814
# All platforms use -DPIC, to notify preprocessed assembler code.
815
command="$base_compile $srcfile $pic_flag -DPIC"
817
# Don't build PIC code
818
command="$base_compile $srcfile"
820
if test "$build_old_libs" = yes; then
822
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
823
if test "X$dir" = "X$libobj"; then
828
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
830
if test -d "$dir"; then
837
if test $status -ne 0 && test ! -d $dir; then
842
if test "$compiler_o_lo" = yes; then
844
command="$command -o $output_obj"
845
elif test "$compiler_c_o" = yes; then
847
command="$command -o $output_obj"
850
$run $rm "$output_obj"
852
if $run eval "$command"; then :
854
test -n "$output_obj" && $run $rm $removelist
858
if test "$need_locks" = warn &&
859
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
861
*** ERROR, $lockfile contains:
862
`cat $lockfile 2>/dev/null`
864
but it should contain:
867
This indicates that another process is trying to use the same
868
temporary object file, and libtool could not work around it because
869
your compiler does not support \`-c' and \`-o' together. If you
870
repeat this compilation, it may succeed, by chance, but you had better
871
avoid parallel builds (make -j) in this platform, or get a better
878
# Just move the object if needed, then go on to compile the next one
879
if test x"$output_obj" != x"$libobj"; then
880
$show "$mv $output_obj $libobj"
881
if $run $mv $output_obj $libobj; then :
889
# If we have no pic_flag, then copy the object into place and finish.
890
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
891
test "$build_old_libs" = yes; then
892
# Rename the .lo from within objdir to obj
893
if test -f $obj; then
898
$show "$mv $libobj $obj"
899
if $run $mv $libobj $obj; then :
906
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
907
if test "X$xdir" = "X$obj"; then
912
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
913
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
914
# Now arrange that obj and lo_libobj become the same file
915
$show "(cd $xdir && $LN_S $baseobj $libobj)"
916
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
917
# Unlock the critical section if it was locked
918
if test "$need_locks" != no; then
929
# Allow error messages only from the first compilation.
930
suppress_output=' >/dev/null 2>&1'
933
# Only build a position-dependent object if we build old libraries.
934
if test "$build_old_libs" = yes; then
935
if test "$pic_mode" != yes; then
936
# Don't build PIC code
937
command="$base_compile $srcfile"
939
# All platforms use -DPIC, to notify preprocessed assembler code.
940
command="$base_compile $srcfile $pic_flag -DPIC"
942
if test "$compiler_c_o" = yes; then
943
command="$command -o $obj"
947
# Suppress compiler output if we already did a PIC compilation.
948
command="$command$suppress_output"
949
$run $rm "$output_obj"
951
if $run eval "$command"; then :
957
if test "$need_locks" = warn &&
958
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
960
*** ERROR, $lockfile contains:
961
`cat $lockfile 2>/dev/null`
963
but it should contain:
966
This indicates that another process is trying to use the same
967
temporary object file, and libtool could not work around it because
968
your compiler does not support \`-c' and \`-o' together. If you
969
repeat this compilation, it may succeed, by chance, but you had better
970
avoid parallel builds (make -j) in this platform, or get a better
977
# Just move the object if needed
978
if test x"$output_obj" != x"$obj"; then
979
$show "$mv $output_obj $obj"
980
if $run $mv $output_obj $obj; then :
988
# Create an invalid libtool object if no PIC, so that we do not
989
# accidentally link it into a program.
990
if test "$build_libtool_libs" != yes; then
991
$show "echo timestamp > $libobj"
992
$run eval "echo timestamp > \$libobj" || exit $?
994
# Move the .lo from within objdir
995
$show "$mv $libobj $lo_libobj"
996
if $run $mv $libobj $lo_libobj; then :
1005
# Unlock the critical section if it was locked
1006
if test "$need_locks" != no; then
1007
$run $rm "$lockfile"
1015
modename="$modename: link"
1017
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1018
# It is impossible to link a dll without this setting, and
1019
# we shouldn't force the makefile maintainer to figure out
1020
# which system we are compiling for in order to pass an extra
1021
# flag for every libtool invokation.
1022
# allow_undefined=no
1024
# FIXME: Unfortunately, there are problems with the above when trying
1025
# to make a dll which has undefined symbols, in which case not
1026
# even a static library is built. For now, we need to specify
1027
# -no-undefined on the libtool link line when we can be certain
1028
# that all symbols are satisfied, otherwise we get a static library.
1035
libtool_args="$nonopt"
1036
compile_command="$nonopt"
1037
finalize_command="$nonopt"
1050
lib_search_path=`pwd`
1058
export_symbols_regex=
1065
prefer_static_libs=no
1077
# We need to know -static, to get the right output filenames.
1081
-all-static | -static)
1082
if test "X$arg" = "X-all-static"; then
1083
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1084
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1086
if test -n "$link_static_flag"; then
1087
dlopen_self=$dlopen_self_static
1090
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1091
dlopen_self=$dlopen_self_static
1094
build_libtool_libs=no
1096
prefer_static_libs=yes
1102
# See if our shared archives depend on static archives.
1103
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1105
# Go through the arguments, transforming them on the way.
1106
while test $# -gt 0; do
1110
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1111
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1115
libtool_args="$libtool_args $qarg"
1117
# If the previous option needs an argument, assign it.
1118
if test -n "$prev"; then
1121
compile_command="$compile_command @OUTPUT@"
1122
finalize_command="$finalize_command @OUTPUT@"
1128
if test "$preload" = no; then
1129
# Add the symbol object into the linking commands.
1130
compile_command="$compile_command @SYMFILE@"
1131
finalize_command="$finalize_command @SYMFILE@"
1135
*.la | *.lo) ;; # We handle these cases below.
1137
if test "$dlself" = no; then
1145
if test "$prev" = dlprefiles; then
1147
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1157
if test "$prev" = dlfiles; then
1158
dlfiles="$dlfiles $arg"
1160
dlprefiles="$dlprefiles $arg"
1168
export_symbols="$arg"
1169
if test ! -f "$arg"; then
1170
$echo "$modename: symbol file \`$arg' does not exist"
1177
export_symbols_regex="$arg"
1187
# We need an absolute path.
1189
[\\/]* | [A-Za-z]:[\\/]*) ;;
1191
$echo "$modename: only absolute run-paths are allowed" 1>&2
1195
if test "$prev" = rpath; then
1198
*) rpath="$rpath $arg" ;;
1203
*) xrpath="$xrpath $arg" ;;
1210
compiler_flags="$compiler_flags $qarg"
1212
compile_command="$compile_command $qarg"
1213
finalize_command="$finalize_command $qarg"
1217
linker_flags="$linker_flags $qarg"
1218
compiler_flags="$compiler_flags $wl$qarg"
1220
compile_command="$compile_command $wl$qarg"
1221
finalize_command="$finalize_command $wl$qarg"
1225
eval "$prev=\"\$arg\""
1236
if test -n "$link_static_flag"; then
1237
compile_command="$compile_command $link_static_flag"
1238
finalize_command="$finalize_command $link_static_flag"
1244
# FIXME: remove this flag sometime in the future.
1245
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1269
-export-symbols | -export-symbols-regex)
1270
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1271
$echo "$modename: more than one -exported-symbols argument is not allowed"
1274
if test "X$arg" = "X-export-symbols"; then
1282
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1283
# so, if we see these flags be careful not to treat them like -L
1285
case $with_gcc/$host in
1286
no/*-*-irix* | no/*-*-nonstopux*)
1287
compile_command="$compile_command $arg"
1288
finalize_command="$finalize_command $arg"
1295
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1296
# We need an absolute path.
1298
[\\/]* | [A-Za-z]:[\\/]*) ;;
1300
absdir=`cd "$dir" && pwd`
1301
if test -z "$absdir"; then
1302
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1311
deplibs="$deplibs -L$dir"
1312
lib_search_path="$lib_search_path $dir"
1316
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1317
case :$dllsearchpath: in
1319
*) dllsearchpath="$dllsearchpath:$dir";;
1327
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1329
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1330
# These systems don't actually have a C or math library (as such)
1333
*-*-mingw* | *-*-os2*)
1334
# These systems don't actually have a C library (as such)
1335
test "X$arg" = "X-lc" && continue
1337
*-*-openbsd* | *-*-freebsd*)
1338
# Do not include libc due to us having libc/libc_r.
1339
test "X$arg" = "X-lc" && continue
1342
elif test "X$arg" = "X-lc_r"; then
1344
*-*-openbsd* | *-*-freebsd*)
1345
# Do not include libc_r directly, use -pthread flag.
1350
deplibs="$deplibs $arg"
1366
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1367
# The PATH hackery in wrapper scripts is required on Windows
1368
# in order for the loader to find any dlls it needs.
1369
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1370
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1373
*) no_install=yes ;;
1401
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1402
# We need an absolute path.
1404
[\\/]* | [A-Za-z]:[\\/]*) ;;
1406
$echo "$modename: only absolute run-paths are allowed" 1>&2
1412
*) xrpath="$xrpath $dir" ;;
1418
# The effects of -static are defined in a previous loop.
1419
# We used to do the same as -all-static on platforms that
1420
# didn't have a PIC flag, but the assumption that the effects
1421
# would be equivalent was wrong. It would break on at least
1422
# Digital Unix and AIX.
1437
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1439
save_ifs="$IFS"; IFS=','
1440
for flag in $args; do
1443
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1448
compiler_flags="$compiler_flags $flag"
1451
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1455
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1457
save_ifs="$IFS"; IFS=','
1458
for flag in $args; do
1461
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1466
compiler_flags="$compiler_flags $wl$flag"
1467
linker_flags="$linker_flags $flag"
1470
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1483
# Some other compiler flag.
1485
# Unknown arguments in both finalize_command and compile_command need
1486
# to be aesthetically quoted because they are evaled later.
1487
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1489
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1496
# A library or standard object.
1497
if test "$prev" = dlfiles; then
1498
# This file was specified with -dlopen.
1499
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1500
dlfiles="$dlfiles $arg"
1504
# If libtool objects are unsupported, then we need to preload.
1509
if test "$prev" = dlprefiles; then
1510
# Preload the old-style object.
1511
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1515
*.lo) libobjs="$libobjs $arg" ;;
1516
*) objs="$objs $arg" ;;
1523
deplibs="$deplibs $arg"
1524
old_deplibs="$old_deplibs $arg"
1529
# A libtool-controlled library.
1531
if test "$prev" = dlfiles; then
1532
# This library was specified with -dlopen.
1533
dlfiles="$dlfiles $arg"
1535
elif test "$prev" = dlprefiles; then
1536
# The library was specified with -dlpreopen.
1537
dlprefiles="$dlprefiles $arg"
1540
deplibs="$deplibs $arg"
1545
# Some other compiler argument.
1547
# Unknown arguments in both finalize_command and compile_command need
1548
# to be aesthetically quoted because they are evaled later.
1549
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1551
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1558
# Now actually substitute the argument into the commands.
1559
if test -n "$arg"; then
1560
compile_command="$compile_command $arg"
1561
finalize_command="$finalize_command $arg"
1563
done # argument parsing loop
1565
if test -n "$prev"; then
1566
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1571
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1572
eval arg=\"$export_dynamic_flag_spec\"
1573
compile_command="$compile_command $arg"
1574
finalize_command="$finalize_command $arg"
1577
# calculate the name of the file, without its directory
1578
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1579
libobjs_save="$libobjs"
1581
if test -n "$shlibpath_var"; then
1582
# get the directories listed in $shlibpath_var
1583
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1587
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1588
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1590
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1591
if test "X$output_objdir" = "X$output"; then
1592
output_objdir="$objdir"
1594
output_objdir="$output_objdir/$objdir"
1596
# Create the object directory.
1597
if test ! -d $output_objdir; then
1598
$show "$mkdir $output_objdir"
1599
$run $mkdir $output_objdir
1601
if test $status -ne 0 && test ! -d $output_objdir; then
1606
# Determine the type of output
1609
$echo "$modename: you must specify an output file" 1>&2
1613
*.$libext) linkmode=oldlib ;;
1614
*.lo | *.$objext) linkmode=obj ;;
1615
*.la) linkmode=lib ;;
1616
*) linkmode=prog ;; # Anything else should be a program.
1621
# Find all interdependent deplibs by searching for libraries
1622
# that are linked more than once (e.g. -la -lb -la)
1623
for deplib in $deplibs; do
1624
if test "X$duplicate_deps" = "Xyes" ; then
1626
*" $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: Trying to link with static lib archive $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"
1761
echo "*** because the file extensions .$libext of this argument makes me believe"
1762
echo "*** that it is just a static archive that I should not used here."
1765
echo "*** Warning: Linking the shared library $output against the"
1766
echo "*** static library $deplib is not portable!"
1767
deplibs="$deplib $deplibs"
1772
if test $pass != link; then
1773
deplibs="$deplib $deplibs"
1775
compile_deplibs="$deplib $compile_deplibs"
1776
finalize_deplibs="$deplib $finalize_deplibs"
1783
if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1784
# If there is no dlopen support or we're linking statically,
1785
# we need to preload.
1786
newdlprefiles="$newdlprefiles $deplib"
1787
compile_deplibs="$deplib $compile_deplibs"
1788
finalize_deplibs="$deplib $finalize_deplibs"
1790
newdlfiles="$newdlfiles $deplib"
1799
if test $found = yes || test -f "$lib"; then :
1801
$echo "$modename: cannot find the library \`$lib'" 1>&2
1805
# Check to see that this really is a libtool archive.
1806
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1808
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1812
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1813
test "X$ladir" = "X$lib" && ladir="."
1821
# If the library was installed with an old release of libtool,
1822
# it will not redefine variable installed.
1827
*/* | *\\*) . $lib ;;
1831
if test "$linkmode,$pass" = "lib,link" ||
1832
test "$linkmode,$pass" = "prog,scan" ||
1833
{ test $linkmode = oldlib && test $linkmode = obj; }; then
1834
# Add dl[pre]opened files of deplib
1835
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1836
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1839
if test $pass = conv; then
1840
# Only check for convenience libraries
1841
deplibs="$lib $deplibs"
1842
if test -z "$libdir"; then
1843
if test -z "$old_library"; then
1844
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1847
# It is a libtool convenience library, so add in its objects.
1848
convenience="$convenience $ladir/$objdir/$old_library"
1849
old_convenience="$old_convenience $ladir/$objdir/$old_library"
1851
for deplib in $dependency_libs; do
1852
deplibs="$deplib $deplibs"
1853
if test "X$duplicate_deps" = "Xyes" ; then
1854
case "$tmp_libs " in
1855
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1858
tmp_libs="$tmp_libs $deplib"
1860
elif test $linkmode != prog && test $linkmode != lib; then
1861
$echo "$modename: \`$lib' is not a convenience library" 1>&2
1867
# Get the name of the library we link against.
1869
for l in $old_library $library_names; do
1872
if test -z "$linklib"; then
1873
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1877
# This library was specified with -dlopen.
1878
if test $pass = dlopen; then
1879
if test -z "$libdir"; then
1880
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1883
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1884
# If there is no dlname, no dlopen support or we're linking
1885
# statically, we need to preload.
1886
dlprefiles="$dlprefiles $lib"
1888
newdlfiles="$newdlfiles $lib"
1893
# We need an absolute path.
1895
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1897
abs_ladir=`cd "$ladir" && pwd`
1898
if test -z "$abs_ladir"; then
1899
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1900
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1905
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1907
# Find the relevant object directory and library name.
1908
if test "X$installed" = Xyes; then
1909
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1910
$echo "$modename: warning: library \`$lib' was moved." 1>&2
1919
dir="$ladir/$objdir"
1920
absdir="$abs_ladir/$objdir"
1921
# Remove this search path later
1922
notinst_path="$notinst_path $abs_ladir"
1923
fi # $installed = yes
1924
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1926
# This library was specified with -dlpreopen.
1927
if test $pass = dlpreopen; then
1928
if test -z "$libdir"; then
1929
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1932
# Prefer using a static library (so that no silly _DYNAMIC symbols
1933
# are required to link).
1934
if test -n "$old_library"; then
1935
newdlprefiles="$newdlprefiles $dir/$old_library"
1936
# Otherwise, use the dlname, so that lt_dlopen finds it.
1937
elif test -n "$dlname"; then
1938
newdlprefiles="$newdlprefiles $dir/$dlname"
1940
newdlprefiles="$newdlprefiles $dir/$linklib"
1942
fi # $pass = dlpreopen
1944
if test -z "$libdir"; then
1945
# Link the convenience library
1946
if test $linkmode = lib; then
1947
deplibs="$dir/$old_library $deplibs"
1948
elif test "$linkmode,$pass" = "prog,link"; then
1949
compile_deplibs="$dir/$old_library $compile_deplibs"
1950
finalize_deplibs="$dir/$old_library $finalize_deplibs"
1952
deplibs="$lib $deplibs"
1957
if test $linkmode = prog && test $pass != link; then
1958
newlib_search_path="$newlib_search_path $ladir"
1959
deplibs="$lib $deplibs"
1962
if test "$link_all_deplibs" != no || test -z "$library_names" ||
1963
test "$build_libtool_libs" = no; then
1968
for deplib in $dependency_libs; do
1970
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1972
# Need to link against all dependency_libs?
1973
if test $linkalldeplibs = yes; then
1974
deplibs="$deplib $deplibs"
1976
# Need to hardcode shared library paths
1977
# or/and link against static libraries
1978
newdependency_libs="$deplib $newdependency_libs"
1980
if test "X$duplicate_deps" = "Xyes" ; then
1981
case "$tmp_libs " in
1982
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1985
tmp_libs="$tmp_libs $deplib"
1988
fi # $linkmode = prog...
1990
link_static=no # Whether the deplib will be linked statically
1991
if test -n "$library_names" &&
1992
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1993
# Link against this shared library
1995
if test "$linkmode,$pass" = "prog,link" ||
1996
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1997
# Hardcode the library path.
1998
# Skip directories that are in the system default run-time
2000
case " $sys_lib_dlsearch_path " in
2003
case "$compile_rpath " in
2005
*) compile_rpath="$compile_rpath $absdir"
2009
case " $sys_lib_dlsearch_path " in
2012
case "$finalize_rpath " in
2014
*) finalize_rpath="$finalize_rpath $libdir"
2018
if test $linkmode = prog; then
2019
# We need to hardcode the library path
2020
if test -n "$shlibpath_var"; then
2021
# Make sure the rpath contains only unique directories.
2022
case "$temp_rpath " in
2025
*) temp_rpath="$temp_rpath $dir" ;;
2029
fi # $linkmode,$pass = prog,link...
2031
if test "$alldeplibs" = yes &&
2032
{ test "$deplibs_check_method" = pass_all ||
2033
{ test "$build_libtool_libs" = yes &&
2034
test -n "$library_names"; }; }; then
2035
# We only need to search for static libraries
2039
if test "$installed" = no; then
2040
notinst_deplibs="$notinst_deplibs $lib"
2044
if test -n "$old_archive_from_expsyms_cmds"; then
2045
# figure out the soname
2046
set dummy $library_names
2049
libname=`eval \\$echo \"$libname_spec\"`
2050
# use dlname if we got it. it's perfectly good, no?
2051
if test -n "$dlname"; then
2053
elif test -n "$soname_spec"; then
2057
major=`expr $current - $age`
2061
eval soname=\"$soname_spec\"
2066
# Make a new name for the extract_expsyms_cmds to use
2068
soname=`echo $soroot | sed -e 's/^.*\///'`
2069
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2071
# If the library has no export list, then create one now
2072
if test -f "$output_objdir/$soname-def"; then :
2074
$show "extracting exported symbol list from \`$soname'"
2075
save_ifs="$IFS"; IFS='~'
2076
eval cmds=\"$extract_expsyms_cmds\"
2077
for cmd in $cmds; do
2080
$run eval "$cmd" || exit $?
2086
if test -f "$output_objdir/$newlib"; then :; else
2087
$show "generating import library for \`$soname'"
2088
save_ifs="$IFS"; IFS='~'
2089
eval cmds=\"$old_archive_from_expsyms_cmds\"
2090
for cmd in $cmds; do
2093
$run eval "$cmd" || exit $?
2097
# make sure the library variables are pointing to the new library
2100
fi # test -n $old_archive_from_expsyms_cmds
2102
if test $linkmode = prog || test "$mode" != relink; then
2107
case $hardcode_action in
2108
immediate | unsupported)
2109
if test "$hardcode_direct" = no; then
2111
elif test "$hardcode_minus_L" = no; then
2113
*-*-sunos*) add_shlibpath="$dir" ;;
2117
elif test "$hardcode_shlibpath_var" = no; then
2118
add_shlibpath="$dir"
2125
if test "$hardcode_direct" = yes; then
2127
elif test "$hardcode_minus_L" = yes; then
2130
elif test "$hardcode_shlibpath_var" = yes; then
2131
add_shlibpath="$dir"
2140
if test "$lib_linked" != yes; then
2141
$echo "$modename: configuration error: unsupported hardcode properties"
2145
if test -n "$add_shlibpath"; then
2146
case :$compile_shlibpath: in
2147
*":$add_shlibpath:"*) ;;
2148
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2151
if test $linkmode = prog; then
2152
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2153
test -n "$add" && compile_deplibs="$add $compile_deplibs"
2155
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2156
test -n "$add" && deplibs="$add $deplibs"
2157
if test "$hardcode_direct" != yes && \
2158
test "$hardcode_minus_L" != yes && \
2159
test "$hardcode_shlibpath_var" = yes; then
2160
case :$finalize_shlibpath: in
2162
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2168
if test $linkmode = prog || test "$mode" = relink; then
2172
# Finalize command for both is simple: just hardcode it.
2173
if test "$hardcode_direct" = yes; then
2174
add="$libdir/$linklib"
2175
elif test "$hardcode_minus_L" = yes; then
2178
elif test "$hardcode_shlibpath_var" = yes; then
2179
case :$finalize_shlibpath: in
2181
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2185
# We cannot seem to hardcode it, guess we'll fake it.
2190
if test $linkmode = prog; then
2191
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2192
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2194
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2195
test -n "$add" && deplibs="$add $deplibs"
2198
elif test $linkmode = prog; then
2199
if test "$alldeplibs" = yes &&
2200
{ test "$deplibs_check_method" = pass_all ||
2201
{ test "$build_libtool_libs" = yes &&
2202
test -n "$library_names"; }; }; then
2203
# We only need to search for static libraries
2207
# Try to link the static library
2208
# Here we assume that one of hardcode_direct or hardcode_minus_L
2209
# is not unsupported. This is valid on all known static and
2211
if test "$hardcode_direct" != unsupported; then
2212
test -n "$old_library" && linklib="$old_library"
2213
compile_deplibs="$dir/$linklib $compile_deplibs"
2214
finalize_deplibs="$dir/$linklib $finalize_deplibs"
2216
compile_deplibs="-l$name -L$dir $compile_deplibs"
2217
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2219
elif test "$build_libtool_libs" = yes; then
2220
# Not a shared library
2221
if test "$deplibs_check_method" != pass_all; then
2222
# We're trying link a shared library against a static one
2223
# but the system doesn't support it.
2225
# Just print a warning and add the library to dependency_libs so
2226
# that the program can be linked against the static library.
2228
echo "*** Warning: This system can not link to static lib archive $lib."
2229
echo "*** I have the capability to make that library automatically link in when"
2230
echo "*** you link to this library. But I can only do this if you have a"
2231
echo "*** shared version of the library, which you do not appear to have."
2232
if test "$module" = yes; then
2233
echo "*** But as you try to build a module library, libtool will still create "
2234
echo "*** a static module, that should work as long as the dlopening application"
2235
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2236
if test -z "$global_symbol_pipe"; then
2238
echo "*** However, this would only work if libtool was able to extract symbol"
2239
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2240
echo "*** not find such a program. So, this module is probably useless."
2241
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2243
if test "$build_old_libs" = no; then
2244
build_libtool_libs=module
2247
build_libtool_libs=no
2251
convenience="$convenience $dir/$old_library"
2252
old_convenience="$old_convenience $dir/$old_library"
2253
deplibs="$dir/$old_library $deplibs"
2256
fi # link shared/static library?
2258
if test $linkmode = lib; then
2259
if test -n "$dependency_libs" &&
2260
{ test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2261
test $link_static = yes; }; then
2262
# Extract -R from dependency_libs
2264
for libdir in $dependency_libs; do
2266
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2268
*" $temp_xrpath "*) ;;
2269
*) xrpath="$xrpath $temp_xrpath";;
2271
*) temp_deplibs="$temp_deplibs $libdir";;
2274
dependency_libs="$temp_deplibs"
2277
newlib_search_path="$newlib_search_path $absdir"
2278
# Link against this library
2279
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2280
# ... and its dependency_libs
2282
for deplib in $dependency_libs; do
2283
newdependency_libs="$deplib $newdependency_libs"
2284
if test "X$duplicate_deps" = "Xyes" ; then
2285
case "$tmp_libs " in
2286
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2289
tmp_libs="$tmp_libs $deplib"
2292
if test $link_all_deplibs != no; then
2293
# Add the search paths of all dependency libraries
2294
for deplib in $dependency_libs; do
2296
-L*) path="$deplib" ;;
2298
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2299
test "X$dir" = "X$deplib" && dir="."
2300
# We need an absolute path.
2302
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2304
absdir=`cd "$dir" && pwd`
2305
if test -z "$absdir"; then
2306
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2311
if grep "^installed=no" $deplib > /dev/null; then
2312
path="-L$absdir/$objdir"
2314
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2315
if test -z "$libdir"; then
2316
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2319
if test "$absdir" != "$libdir"; then
2320
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2327
case " $deplibs " in
2329
*) deplibs="$deplibs $path" ;;
2332
fi # link_all_deplibs != no
2334
done # for deplib in $libs
2335
if test $pass = dlpreopen; then
2336
# Link the dlpreopened libraries before other libraries
2337
for deplib in $save_deplibs; do
2338
deplibs="$deplib $deplibs"
2341
if test $pass != dlopen; then
2342
test $pass != scan && dependency_libs="$newdependency_libs"
2343
if test $pass != conv; then
2344
# Make sure lib_search_path contains only unique directories.
2346
for dir in $newlib_search_path; do
2347
case "$lib_search_path " in
2349
*) lib_search_path="$lib_search_path $dir" ;;
2355
if test "$linkmode,$pass" != "prog,link"; then
2358
vars="compile_deplibs finalize_deplibs"
2360
for var in $vars dependency_libs; do
2361
# Add libraries to $var in reverse order
2362
eval tmp_libs=\"\$$var\"
2364
for deplib in $tmp_libs; do
2366
-L*) new_libs="$deplib $new_libs" ;;
2368
case " $specialdeplibs " in
2369
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2371
case " $new_libs " in
2373
*) new_libs="$deplib $new_libs" ;;
2381
for deplib in $new_libs; do
2384
case " $tmp_libs " in
2386
*) tmp_libs="$tmp_libs $deplib" ;;
2389
*) tmp_libs="$tmp_libs $deplib" ;;
2392
eval $var=\"$tmp_libs\"
2395
if test "$pass" = "conv" &&
2396
{ test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2397
libs="$deplibs" # reset libs
2401
if test $linkmode = prog; then
2402
dlfiles="$newdlfiles"
2403
dlprefiles="$newdlprefiles"
2408
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2409
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2412
if test -n "$rpath"; then
2413
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2416
if test -n "$xrpath"; then
2417
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2420
if test -n "$vinfo"; then
2421
$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2424
if test -n "$release"; then
2425
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2428
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2429
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2432
# Now set the variables for building old libraries.
2433
build_libtool_libs=no
2435
objs="$objs$old_deplibs"
2439
# Make sure we only generate libraries of the form `libNAME.la'.
2442
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2443
eval libname=\"$libname_spec\"
2446
if test "$module" = no; then
2447
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2451
if test "$need_lib_prefix" != no; then
2452
# Add the "lib" prefix for modules if required
2453
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2454
eval libname=\"$libname_spec\"
2456
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2461
if test -n "$objs"; then
2462
if test "$deplibs_check_method" != pass_all; then
2463
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2467
echo "*** Warning: Linking the shared library $output against the non-libtool"
2468
echo "*** objects $objs is not portable!"
2469
libobjs="$libobjs $objs"
2473
if test "$dlself" != no; then
2474
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2478
if test $# -gt 2; then
2479
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2484
if test -z "$rpath"; then
2485
if test "$build_libtool_libs" = yes; then
2486
# Building a libtool convenience library.
2488
oldlibs="$output_objdir/$libname.$libext $oldlibs"
2489
build_libtool_libs=convenience
2493
if test -n "$vinfo"; then
2494
$echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2497
if test -n "$release"; then
2498
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2502
# Parse the version information argument.
2503
save_ifs="$IFS"; IFS=':'
2504
set dummy $vinfo 0 0 0
2507
if test -n "$8"; then
2508
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2517
# Check that each of the things are valid numbers.
2519
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2521
$echo "$modename: CURRENT \`$current' 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: REVISION \`$revision' is not a nonnegative integer" 1>&2
2531
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2537
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2539
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2540
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2545
if test $age -gt $current; then
2546
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2547
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2551
# Calculate the version variables.
2555
case $version_type in
2559
# Like Linux, but with the current version available in
2560
# verstring for coding it into the library header
2561
major=.`expr $current - $age`
2562
versuffix="$major.$age.$revision"
2563
# Darwin ld doesn't like 0 for these options...
2564
minor_current=`expr $current + 1`
2565
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2570
versuffix=".$current.$revision";
2575
versuffix=".$current";
2579
case $version_type in
2580
nonstopux) verstring_prefix=nonstopux ;;
2581
*) verstring_prefix=sgi ;;
2583
verstring="$verstring_prefix$major.$revision"
2585
major=`expr $current - $age + 1`
2587
# Add in all the interfaces that we are compatible with.
2589
while test $loop != 0; do
2590
iface=`expr $revision - $loop`
2591
loop=`expr $loop - 1`
2592
verstring="$verstring_prefix$major.$iface:$verstring"
2595
# Before this point, $major must not contain `.'.
2597
versuffix="$major.$revision"
2601
major=.`expr $current - $age`
2602
versuffix="$major.$age.$revision"
2606
major=`expr $current - $age`
2607
versuffix=".$current.$age.$revision"
2608
verstring="$current.$age.$revision"
2610
# Add in all the interfaces that we are compatible with.
2612
while test $loop != 0; do
2613
iface=`expr $current - $loop`
2614
loop=`expr $loop - 1`
2615
verstring="$verstring:${iface}.0"
2618
# Make executables depend on our current version.
2619
verstring="$verstring:${current}.0"
2624
versuffix=".$current.$revision"
2628
# Use '-' rather than '.', since we only want one
2629
# extension on DOS 8.3 filesystems.
2630
major=`expr $current - $age`
2635
$echo "$modename: unknown library version type \`$version_type'" 1>&2
2636
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2641
# Clear the version info if we defaulted, and they specified a release.
2642
if test -z "$vinfo" && test -n "$release"; then
2645
case $version_type in
2647
# we can't check for "0.0" in archive_cmds due to quoting
2648
# problems, so we reset it completely
2655
if test "$need_version" = no; then
2662
# Remove version info from name if versioning should be avoided
2663
if test "$avoid_version" = yes && test "$need_version" = no; then
2669
# Check to see if the archive will have undefined symbols.
2670
if test "$allow_undefined" = yes; then
2671
if test "$allow_undefined_flag" = unsupported; then
2672
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2673
build_libtool_libs=no
2677
# Don't allow undefined symbols.
2678
allow_undefined_flag="$no_undefined_flag"
2682
if test "$mode" != relink; then
2683
# Remove our outputs.
2684
$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2685
$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2688
# Now set the variables for building old libraries.
2689
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2690
oldlibs="$oldlibs $output_objdir/$libname.$libext"
2692
# Transform .lo files to .o files.
2693
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2696
# Eliminate all temporary directories.
2697
for path in $notinst_path; do
2698
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2699
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2700
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2703
if test -n "$xrpath"; then
2704
# If the user specified any rpath flags, then add them.
2706
for libdir in $xrpath; do
2707
temp_xrpath="$temp_xrpath -R$libdir"
2708
case "$finalize_rpath " in
2710
*) finalize_rpath="$finalize_rpath $libdir" ;;
2713
if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2714
dependency_libs="$temp_xrpath $dependency_libs"
2718
# Make sure dlfiles contains only unique files that won't be dlpreopened
2719
old_dlfiles="$dlfiles"
2721
for lib in $old_dlfiles; do
2722
case " $dlprefiles $dlfiles " in
2724
*) dlfiles="$dlfiles $lib" ;;
2728
# Make sure dlprefiles contains only unique files
2729
old_dlprefiles="$dlprefiles"
2731
for lib in $old_dlprefiles; do
2732
case "$dlprefiles " in
2734
*) dlprefiles="$dlprefiles $lib" ;;
2738
if test "$build_libtool_libs" = yes; then
2739
if test -n "$rpath"; then
2741
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2742
# these systems don't actually have a c library (as such)!
2744
*-*-rhapsody* | *-*-darwin1.[012])
2745
# Rhapsody C library is in the System framework
2746
deplibs="$deplibs -framework System"
2749
# Don't link with libc until the a.out ld.so is fixed.
2751
*-*-openbsd* | *-*-freebsd*)
2752
# Do not include libc due to us having libc/libc_r.
2755
# Add libc to deplibs on all other systems if necessary.
2756
if test $build_libtool_need_lc = "yes"; then
2757
deplibs="$deplibs -lc"
2763
# Transform deplibs into only deplibs that can be linked in shared.
2765
libname_save=$libname
2766
release_save=$release
2767
versuffix_save=$versuffix
2769
# I'm not sure if I'm treating the release correctly. I think
2770
# release should show up in the -l (ie -lgmp5) so we don't want to
2771
# add it in twice. Is that correct?
2777
case $deplibs_check_method in
2779
# Don't check for shared/static. Everything works.
2780
# This might be a little naive. We might want to check
2781
# whether the library exists or not. But this is on
2782
# osf3 & osf4 and I'm not really sure... Just
2783
# implementing what was already the behaviour.
2787
# This code stresses the "libraries are programs" paradigm to its
2788
# limits. Maybe even breaks it. We compile a program, linking it
2789
# against the deplibs as a proxy for the library. Then we can check
2790
# whether they linked in statically or dynamically with ldd.
2792
cat > conftest.c <<EOF
2793
int main() { return 0; }
2796
$CC -o conftest conftest.c $deplibs
2797
if test $? -eq 0 ; then
2798
ldd_output=`ldd conftest`
2799
for i in $deplibs; do
2800
name="`expr $i : '-l\(.*\)'`"
2801
# If $name is empty we are operating on a -L argument.
2802
if test -n "$name" && test "$name" != "0"; then
2803
libname=`eval \\$echo \"$libname_spec\"`
2804
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2805
set dummy $deplib_matches
2807
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2808
newdeplibs="$newdeplibs $i"
2812
echo "*** Warning: dynamic linker does not accept needed library $i."
2813
echo "*** I have the capability to make that library automatically link in when"
2814
echo "*** you link to this library. But I can only do this if you have a"
2815
echo "*** shared version of the library, which I believe you do not have"
2816
echo "*** because a test_compile did reveal that the linker did not use it for"
2817
echo "*** its dynamic dependency list that programs get resolved with at runtime."
2820
newdeplibs="$newdeplibs $i"
2824
# Error occured in the first compile. Let's try to salvage
2825
# the situation: Compile a separate program for each library.
2826
for i in $deplibs; do
2827
name="`expr $i : '-l\(.*\)'`"
2828
# If $name is empty we are operating on a -L argument.
2829
if test -n "$name" && test "$name" != "0"; then
2831
$CC -o conftest conftest.c $i
2833
if test $? -eq 0 ; then
2834
ldd_output=`ldd conftest`
2835
libname=`eval \\$echo \"$libname_spec\"`
2836
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2837
set dummy $deplib_matches
2839
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2840
newdeplibs="$newdeplibs $i"
2844
echo "*** Warning: dynamic linker does not accept needed library $i."
2845
echo "*** I have the capability to make that library automatically link in when"
2846
echo "*** you link to this library. But I can only do this if you have a"
2847
echo "*** shared version of the library, which you do not appear to have"
2848
echo "*** because a test_compile did reveal that the linker did not use this one"
2849
echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2854
echo "*** Warning! Library $i is needed by this library but I was not able to"
2855
echo "*** make it link in! You will probably need to install it or some"
2856
echo "*** library that it depends on before this library will be fully"
2857
echo "*** functional. Installing it before continuing would be even better."
2860
newdeplibs="$newdeplibs $i"
2866
set dummy $deplibs_check_method
2867
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2868
for a_deplib in $deplibs; do
2869
name="`expr $a_deplib : '-l\(.*\)'`"
2870
# If $name is empty we are operating on a -L argument.
2871
if test -n "$name" && test "$name" != "0"; then
2872
libname=`eval \\$echo \"$libname_spec\"`
2873
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2874
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2875
for potent_lib in $potential_libs; do
2876
# Follow soft links.
2877
if ls -lLd "$potent_lib" 2>/dev/null \
2878
| grep " -> " >/dev/null; then
2881
# The statement above tries to avoid entering an
2882
# endless loop below, in case of cyclic links.
2883
# We might still enter an endless loop, since a link
2884
# loop can be closed while we follow links,
2886
potlib="$potent_lib"
2887
while test -h "$potlib" 2>/dev/null; do
2888
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2890
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2891
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2894
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2896
| egrep "$file_magic_regex" > /dev/null; then
2897
newdeplibs="$newdeplibs $a_deplib"
2903
if test -n "$a_deplib" ; then
2906
echo "*** Warning: linker path does not have real file for library $a_deplib."
2907
echo "*** I have the capability to make that library automatically link in when"
2908
echo "*** you link to this library. But I can only do this if you have a"
2909
echo "*** shared version of the library, which you do not appear to have"
2910
echo "*** because I did check the linker path looking for a file starting"
2911
if test -z "$potlib" ; then
2912
echo "*** with $libname but no candidates were found. (...for file magic test)"
2914
echo "*** with $libname and none of the candidates passed a file format test"
2915
echo "*** using a file magic. Last file checked: $potlib"
2919
# Add a -L argument.
2920
newdeplibs="$newdeplibs $a_deplib"
2922
done # Gone through all deplibs.
2925
set dummy $deplibs_check_method
2926
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2927
for a_deplib in $deplibs; do
2928
name="`expr $a_deplib : '-l\(.*\)'`"
2929
# If $name is empty we are operating on a -L argument.
2930
if test -n "$name" && test "$name" != "0"; then
2931
libname=`eval \\$echo \"$libname_spec\"`
2932
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2933
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2934
for potent_lib in $potential_libs; do
2935
potlib="$potent_lib" # see symlink-check below in file_magic test
2936
if eval echo \"$potent_lib\" 2>/dev/null \
2938
| egrep "$match_pattern_regex" > /dev/null; then
2939
newdeplibs="$newdeplibs $a_deplib"
2945
if test -n "$a_deplib" ; then
2948
echo "*** Warning: linker path does not have real file for library $a_deplib."
2949
echo "*** I have the capability to make that library automatically link in when"
2950
echo "*** you link to this library. But I can only do this if you have a"
2951
echo "*** shared version of the library, which you do not appear to have"
2952
echo "*** because I did check the linker path looking for a file starting"
2953
if test -z "$potlib" ; then
2954
echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2956
echo "*** with $libname and none of the candidates passed a file format test"
2957
echo "*** using a regex pattern. Last file checked: $potlib"
2961
# Add a -L argument.
2962
newdeplibs="$newdeplibs $a_deplib"
2964
done # Gone through all deplibs.
2968
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2969
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2970
grep . >/dev/null; then
2972
if test "X$deplibs_check_method" = "Xnone"; then
2973
echo "*** Warning: inter-library dependencies are not supported in this platform."
2975
echo "*** Warning: inter-library dependencies are not known to be supported."
2977
echo "*** All declared inter-library dependencies are being dropped."
2982
versuffix=$versuffix_save
2984
release=$release_save
2985
libname=$libname_save
2989
*-*-rhapsody* | *-*-darwin1.[012])
2990
# On Rhapsody replace the C library is the System framework
2991
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2995
if test "$droppeddeps" = yes; then
2996
if test "$module" = yes; then
2998
echo "*** Warning: libtool could not satisfy all declared inter-library"
2999
echo "*** dependencies of module $libname. Therefore, libtool will create"
3000
echo "*** a static module, that should work as long as the dlopening"
3001
echo "*** application is linked with the -dlopen flag."
3002
if test -z "$global_symbol_pipe"; then
3004
echo "*** However, this would only work if libtool was able to extract symbol"
3005
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3006
echo "*** not find such a program. So, this module is probably useless."
3007
echo "*** \`nm' from GNU binutils and a full rebuild may help."
3009
if test "$build_old_libs" = no; then
3010
oldlibs="$output_objdir/$libname.$libext"
3011
build_libtool_libs=module
3014
build_libtool_libs=no
3017
echo "*** The inter-library dependencies that have been dropped here will be"
3018
echo "*** automatically added whenever a program is linked with this library"
3019
echo "*** or is declared to -dlopen it."
3021
if test $allow_undefined = no; then
3023
echo "*** Since this library must not contain undefined symbols,"
3024
echo "*** because either the platform does not support them or"
3025
echo "*** it was explicitly requested with -no-undefined,"
3026
echo "*** libtool will only create a static version of it."
3027
if test "$build_old_libs" = no; then
3028
oldlibs="$output_objdir/$libname.$libext"
3029
build_libtool_libs=module
3032
build_libtool_libs=no
3037
# Done checking deplibs!
3041
# All the library-specific variables (install_libdir is set above).
3046
# Test again, we may have decided not to build it any more
3047
if test "$build_libtool_libs" = yes; then
3048
if test $hardcode_into_libs = yes; then
3049
# Hardcode the library paths
3052
rpath="$finalize_rpath"
3053
test "$mode" != relink && rpath="$compile_rpath$rpath"
3054
for libdir in $rpath; do
3055
if test -n "$hardcode_libdir_flag_spec"; then
3056
if test -n "$hardcode_libdir_separator"; then
3057
if test -z "$hardcode_libdirs"; then
3058
hardcode_libdirs="$libdir"
3060
# Just accumulate the unique libdirs.
3061
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3062
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3065
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3070
eval flag=\"$hardcode_libdir_flag_spec\"
3071
dep_rpath="$dep_rpath $flag"
3073
elif test -n "$runpath_var"; then
3074
case "$perm_rpath " in
3076
*) perm_rpath="$perm_rpath $libdir" ;;
3080
# Substitute the hardcoded libdirs into the rpath.
3081
if test -n "$hardcode_libdir_separator" &&
3082
test -n "$hardcode_libdirs"; then
3083
libdir="$hardcode_libdirs"
3084
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3086
if test -n "$runpath_var" && test -n "$perm_rpath"; then
3087
# We should set the runpath_var.
3089
for dir in $perm_rpath; do
3092
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3094
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3097
shlibpath="$finalize_shlibpath"
3098
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3099
if test -n "$shlibpath"; then
3100
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3103
# Get the real and link names of the library.
3104
eval library_names=\"$library_names_spec\"
3105
set dummy $library_names
3109
if test -n "$soname_spec"; then
3110
eval soname=\"$soname_spec\"
3114
test -z "$dlname" && dlname=$soname
3116
lib="$output_objdir/$realname"
3119
linknames="$linknames $link"
3122
# Ensure that we have .o objects for linkers which dislike .lo
3123
# (e.g. aix) in case we are running --disable-static
3124
for obj in $libobjs; do
3125
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3126
if test "X$xdir" = "X$obj"; then
3131
baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3132
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3133
if test ! -f $xdir/$oldobj; then
3134
$show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3135
$run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3139
# Use standard objects if they are pic
3140
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3142
# Prepare the list of exported symbols
3143
if test -z "$export_symbols"; then
3144
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3145
$show "generating symbol list for \`$libname.la'"
3146
export_symbols="$output_objdir/$libname.exp"
3147
$run $rm $export_symbols
3148
eval cmds=\"$export_symbols_cmds\"
3149
save_ifs="$IFS"; IFS='~'
3150
for cmd in $cmds; do
3153
$run eval "$cmd" || exit $?
3156
if test -n "$export_symbols_regex"; then
3157
$show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3158
$run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3159
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
3160
$run eval '$mv "${export_symbols}T" "$export_symbols"'
3165
if test -n "$export_symbols" && test -n "$include_expsyms"; then
3166
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3169
if test -n "$convenience"; then
3170
if test -n "$whole_archive_flag_spec"; then
3171
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3173
gentop="$output_objdir/${outputname}x"
3174
$show "${rm}r $gentop"
3175
$run ${rm}r "$gentop"
3176
$show "mkdir $gentop"
3177
$run mkdir "$gentop"
3179
if test $status -ne 0 && test ! -d "$gentop"; then
3182
generated="$generated $gentop"
3184
for xlib in $convenience; do
3185
# Extract the objects.
3187
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3188
*) xabs=`pwd`"/$xlib" ;;
3190
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3191
xdir="$gentop/$xlib"
3193
$show "${rm}r $xdir"
3198
if test $status -ne 0 && test ! -d "$xdir"; then
3201
$show "(cd $xdir && $AR x $xabs)"
3202
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3204
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3209
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3210
eval flag=\"$thread_safe_flag_spec\"
3211
linker_flags="$linker_flags $flag"
3214
# Make a backup of the uninstalled library when relinking
3215
if test "$mode" = relink; then
3216
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3219
# Do each of the archive commands.
3220
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3221
eval cmds=\"$archive_expsym_cmds\"
3223
eval cmds=\"$archive_cmds\"
3225
save_ifs="$IFS"; IFS='~'
3226
for cmd in $cmds; do
3229
$run eval "$cmd" || exit $?
3233
# Restore the uninstalled library and exit
3234
if test "$mode" = relink; then
3235
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3239
# Create links to the real library.
3240
for linkname in $linknames; do
3241
if test "$realname" != "$linkname"; then
3242
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3243
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3247
# If -module or -export-dynamic was specified, set the dlname.
3248
if test "$module" = yes || test "$export_dynamic" = yes; then
3249
# On all known operating systems, these are identical.
3256
if test -n "$deplibs"; then
3257
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3260
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3261
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3264
if test -n "$rpath"; then
3265
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3268
if test -n "$xrpath"; then
3269
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3272
if test -n "$vinfo"; then
3273
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3276
if test -n "$release"; then
3277
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3282
if test -n "$objs$old_deplibs"; then
3283
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3287
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3295
# Delete the old objects.
3296
$run $rm $obj $libobj
3298
# Objects from convenience libraries. This assumes
3299
# single-version convenience libraries. Whenever we create
3300
# different ones for PIC/non-PIC, this we'll have to duplicate
3304
# reload_cmds runs $LD directly, so let us get rid of
3305
# -Wl from whole_archive_flag_spec
3308
if test -n "$convenience"; then
3309
if test -n "$whole_archive_flag_spec"; then
3310
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3312
gentop="$output_objdir/${obj}x"
3313
$show "${rm}r $gentop"
3314
$run ${rm}r "$gentop"
3315
$show "mkdir $gentop"
3316
$run mkdir "$gentop"
3318
if test $status -ne 0 && test ! -d "$gentop"; then
3321
generated="$generated $gentop"
3323
for xlib in $convenience; do
3324
# Extract the objects.
3326
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3327
*) xabs=`pwd`"/$xlib" ;;
3329
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3330
xdir="$gentop/$xlib"
3332
$show "${rm}r $xdir"
3337
if test $status -ne 0 && test ! -d "$xdir"; then
3340
$show "(cd $xdir && $AR x $xabs)"
3341
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3343
reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3348
# Create the old-style object.
3349
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
3352
eval cmds=\"$reload_cmds\"
3353
save_ifs="$IFS"; IFS='~'
3354
for cmd in $cmds; do
3357
$run eval "$cmd" || exit $?
3361
# Exit if we aren't doing a library object file.
3362
if test -z "$libobj"; then
3363
if test -n "$gentop"; then
3364
$show "${rm}r $gentop"
3371
if test "$build_libtool_libs" != yes; then
3372
if test -n "$gentop"; then
3373
$show "${rm}r $gentop"
3377
# Create an invalid libtool object if no PIC, so that we don't
3378
# accidentally link it into a program.
3379
$show "echo timestamp > $libobj"
3380
$run eval "echo timestamp > $libobj" || exit $?
3384
if test -n "$pic_flag" || test "$pic_mode" != default; then
3385
# Only do commands if we really have different PIC objects.
3386
reload_objs="$libobjs $reload_conv_objs"
3388
eval cmds=\"$reload_cmds\"
3389
save_ifs="$IFS"; IFS='~'
3390
for cmd in $cmds; do
3393
$run eval "$cmd" || exit $?
3397
# Just create a symlink.
3400
xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3401
if test "X$xdir" = "X$libobj"; then
3406
baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3407
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3408
$show "(cd $xdir && $LN_S $oldobj $baseobj)"
3409
$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3412
if test -n "$gentop"; then
3413
$show "${rm}r $gentop"
3422
*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3424
if test -n "$vinfo"; then
3425
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3428
if test -n "$release"; then
3429
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3432
if test "$preload" = yes; then
3433
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3434
test "$dlopen_self_static" = unknown; then
3435
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3440
*-*-rhapsody* | *-*-darwin1.[012])
3441
# On Rhapsody replace the C library is the System framework
3442
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3443
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3447
compile_command="$compile_command $compile_deplibs"
3448
finalize_command="$finalize_command $finalize_deplibs"
3450
if test -n "$rpath$xrpath"; then
3451
# If the user specified any rpath flags, then add them.
3452
for libdir in $rpath $xrpath; do
3453
# This is the magic to use -rpath.
3454
case "$finalize_rpath " in
3456
*) finalize_rpath="$finalize_rpath $libdir" ;;
3461
# Now hardcode the library paths
3464
for libdir in $compile_rpath $finalize_rpath; do
3465
if test -n "$hardcode_libdir_flag_spec"; then
3466
if test -n "$hardcode_libdir_separator"; then
3467
if test -z "$hardcode_libdirs"; then
3468
hardcode_libdirs="$libdir"
3470
# Just accumulate the unique libdirs.
3471
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3472
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3475
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3480
eval flag=\"$hardcode_libdir_flag_spec\"
3481
rpath="$rpath $flag"
3483
elif test -n "$runpath_var"; then
3484
case "$perm_rpath " in
3486
*) perm_rpath="$perm_rpath $libdir" ;;
3490
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3491
case :$dllsearchpath: in
3493
*) dllsearchpath="$dllsearchpath:$libdir";;
3498
# Substitute the hardcoded libdirs into the rpath.
3499
if test -n "$hardcode_libdir_separator" &&
3500
test -n "$hardcode_libdirs"; then
3501
libdir="$hardcode_libdirs"
3502
eval rpath=\" $hardcode_libdir_flag_spec\"
3504
compile_rpath="$rpath"
3508
for libdir in $finalize_rpath; do
3509
if test -n "$hardcode_libdir_flag_spec"; then
3510
if test -n "$hardcode_libdir_separator"; then
3511
if test -z "$hardcode_libdirs"; then
3512
hardcode_libdirs="$libdir"
3514
# Just accumulate the unique libdirs.
3515
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3516
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3519
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3524
eval flag=\"$hardcode_libdir_flag_spec\"
3525
rpath="$rpath $flag"
3527
elif test -n "$runpath_var"; then
3528
case "$finalize_perm_rpath " in
3530
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3534
# Substitute the hardcoded libdirs into the rpath.
3535
if test -n "$hardcode_libdir_separator" &&
3536
test -n "$hardcode_libdirs"; then
3537
libdir="$hardcode_libdirs"
3538
eval rpath=\" $hardcode_libdir_flag_spec\"
3540
finalize_rpath="$rpath"
3542
if test -n "$libobjs" && test "$build_old_libs" = yes; then
3543
# Transform all the library objects into standard objects.
3544
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3545
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3549
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3550
if test -n "$NM" && test -n "$global_symbol_pipe"; then
3551
dlsyms="${outputname}S.c"
3553
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3557
if test -n "$dlsyms"; then
3561
# Discover the nlist of each of the dlfiles.
3562
nlist="$output_objdir/${outputname}.nm"
3564
$show "$rm $nlist ${nlist}S ${nlist}T"
3565
$run $rm "$nlist" "${nlist}S" "${nlist}T"
3567
# Parse the name list into a source file.
3568
$show "creating $output_objdir/$dlsyms"
3570
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3571
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3572
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3578
/* Prevent the only kind of declaration conflicts we can make. */
3579
#define lt_preloaded_symbols some_other_symbol
3581
/* External symbol declarations for the compiler. */\
3584
if test "$dlself" = yes; then
3585
$show "generating symbol list for \`$output'"
3587
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3589
# Add our own program objects to the symbol list.
3590
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3591
for arg in $progfiles; do
3592
$show "extracting global C symbols from \`$arg'"
3593
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3596
if test -n "$exclude_expsyms"; then
3597
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3598
$run eval '$mv "$nlist"T "$nlist"'
3601
if test -n "$export_symbols_regex"; then
3602
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3603
$run eval '$mv "$nlist"T "$nlist"'
3606
# Prepare the list of exported symbols
3607
if test -z "$export_symbols"; then
3608
export_symbols="$output_objdir/$output.exp"
3609
$run $rm $export_symbols
3610
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3612
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3613
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3614
$run eval 'mv "$nlist"T "$nlist"'
3618
for arg in $dlprefiles; do
3619
$show "extracting global C symbols from \`$arg'"
3620
name=`echo "$arg" | sed -e 's%^.*/%%'`
3621
$run eval 'echo ": $name " >> "$nlist"'
3622
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3625
if test -z "$run"; then
3626
# Make sure we have at least an empty file.
3627
test -f "$nlist" || : > "$nlist"
3629
if test -n "$exclude_expsyms"; then
3630
egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3631
$mv "$nlist"T "$nlist"
3634
# Try sorting and uniquifying the output.
3635
if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3638
grep -v "^: " < "$nlist" > "$nlist"S
3641
if test -f "$nlist"S; then
3642
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3644
echo '/* NONE */' >> "$output_objdir/$dlsyms"
3647
$echo >> "$output_objdir/$dlsyms" "\
3649
#undef lt_preloaded_symbols
3651
#if defined (__STDC__) && __STDC__
3652
# define lt_ptr void *
3654
# define lt_ptr char *
3658
/* The mapping between symbol names and symbols. */
3663
lt_preloaded_symbols[] =
3667
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3669
$echo >> "$output_objdir/$dlsyms" "\
3673
/* This works around a problem in FreeBSD linker */
3674
#ifdef FREEBSD_WORKAROUND
3675
static const void *lt_preloaded_setup() {
3676
return lt_preloaded_symbols;
3686
pic_flag_for_symtable=
3688
# compiling the symbol table file with pic_flag works around
3689
# a FreeBSD bug that causes programs to crash when -lm is
3690
# linked before any other PIC object. But we must not use
3691
# pic_flag when linking with -static. The problem exists in
3692
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3693
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3694
case "$compile_command " in
3696
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3699
case "$compile_command " in
3701
*) pic_flag_for_symtable=" $pic_flag -DPIC";;
3705
# Now compile the dynamic symbol file.
3706
$show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3707
$run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3709
# Clean up the generated files.
3710
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3711
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3713
# Transform the symbol file into the correct name.
3714
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3715
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3718
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3723
# We keep going just in case the user didn't refer to
3724
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3725
# really was required.
3727
# Nullify the symbol file.
3728
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3729
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3732
if test $need_relink = no || test "$build_libtool_libs" != yes; then
3733
# Replace the output file specification.
3734
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3735
link_command="$compile_command$compile_rpath"
3737
# We have no uninstalled library dependencies, so finalize right now.
3738
$show "$link_command"
3739
$run eval "$link_command"
3742
# Delete the generated files.
3743
if test -n "$dlsyms"; then
3744
$show "$rm $output_objdir/${outputname}S.${objext}"
3745
$run $rm "$output_objdir/${outputname}S.${objext}"
3751
if test -n "$shlibpath_var"; then
3752
# We should set the shlibpath_var
3754
for dir in $temp_rpath; do
3756
[\\/]* | [A-Za-z]:[\\/]*)
3761
# Relative path: add a thisdir entry.
3762
rpath="$rpath\$thisdir/$dir:"
3769
if test -n "$compile_shlibpath$finalize_shlibpath"; then
3770
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3772
if test -n "$finalize_shlibpath"; then
3773
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3778
if test -n "$runpath_var"; then
3779
if test -n "$perm_rpath"; then
3780
# We should set the runpath_var.
3782
for dir in $perm_rpath; do
3785
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3787
if test -n "$finalize_perm_rpath"; then
3788
# We should set the runpath_var.
3790
for dir in $finalize_perm_rpath; do
3793
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3797
if test "$no_install" = yes; then
3798
# We don't need to create a wrapper script.
3799
link_command="$compile_var$compile_command$compile_rpath"
3800
# Replace the output file specification.
3801
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3802
# Delete the old output file.
3804
# Link the executable and exit
3805
$show "$link_command"
3806
$run eval "$link_command" || exit $?
3810
if test "$hardcode_action" = relink; then
3811
# Fast installation is not supported
3812
link_command="$compile_var$compile_command$compile_rpath"
3813
relink_command="$finalize_var$finalize_command$finalize_rpath"
3815
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3816
$echo "$modename: \`$output' will be relinked during installation" 1>&2
3818
if test "$fast_install" != no; then
3819
link_command="$finalize_var$compile_command$finalize_rpath"
3820
if test "$fast_install" = yes; then
3821
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3823
# fast_install is set to needless
3827
link_command="$compile_var$compile_command$compile_rpath"
3828
relink_command="$finalize_var$finalize_command$finalize_rpath"
3832
# Replace the output file specification.
3833
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3835
# Delete the old output files.
3836
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3838
$show "$link_command"
3839
$run eval "$link_command" || exit $?
3841
# Now create the wrapper script.
3842
$show "creating $output"
3844
# Quote the relink command for shipping.
3845
if test -n "$relink_command"; then
3846
# Preserve any variables that may affect compiler behavior
3847
for var in $variables_saved_for_relink; do
3848
if eval test -z \"\${$var+set}\"; then
3849
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3850
elif eval var_value=\$$var; test -z "$var_value"; then
3851
relink_command="$var=; export $var; $relink_command"
3853
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3854
relink_command="$var=\"$var_value\"; export $var; $relink_command"
3857
relink_command="(cd `pwd`; $relink_command)"
3858
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3861
# Quote $echo for shipping.
3862
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3864
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3865
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3867
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3869
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3872
# Only actually do things if our run command is non-null.
3873
if test -z "$run"; then
3874
# win32 will think the script is a binary if it has
3875
# a .exe suffix, so we strip it off here.
3877
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3879
# test for cygwin because mv fails w/o .exe extensions
3881
*cygwin*) exeext=.exe ;;
3885
trap "$rm $output; exit 1" 1 2 15
3890
# $output - temporary wrapper script for $objdir/$outputname
3891
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3893
# The $output program cannot be directly executed until all the libtool
3894
# libraries that it depends on are installed.
3896
# This wrapper script should never be moved out of the build directory.
3897
# If it is, it will not operate correctly.
3899
# Sed substitution that helps us do robust quoting. It backslashifies
3900
# metacharacters that are still active within double-quoted strings.
3901
Xsed='sed -e 1s/^X//'
3902
sed_quote_subst='$sed_quote_subst'
3904
# The HP-UX ksh and POSIX shell print the target directory to stdout
3906
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3908
relink_command=\"$relink_command\"
3910
# This environment variable determines our operation mode.
3911
if test \"\$libtool_install_magic\" = \"$magic\"; then
3912
# install mode needs the following variable:
3913
notinst_deplibs='$notinst_deplibs'
3915
# When we are sourced in execute mode, \$file and \$echo are already set.
3916
if test \"\$libtool_execute_magic\" != \"$magic\"; then
3919
# Make sure echo works.
3920
if test \"X\$1\" = X--no-reexec; then
3921
# Discard the --no-reexec flag, and continue.
3923
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3924
# Yippee, \$echo works!
3927
# Restart under the correct shell, and then maybe \$echo will work.
3928
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3934
# Find the directory that this script lives in.
3935
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3936
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3938
# Follow symbolic links until we get to the real thisdir.
3939
file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3940
while test -n \"\$file\"; do
3941
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3943
# If there was a directory component, then change thisdir.
3944
if test \"x\$destdir\" != \"x\$file\"; then
3945
case \"\$destdir\" in
3946
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3947
*) thisdir=\"\$thisdir/\$destdir\" ;;
3951
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3952
file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3955
# Try to get the absolute directory name.
3956
absdir=\`cd \"\$thisdir\" && pwd\`
3957
test -n \"\$absdir\" && thisdir=\"\$absdir\"
3960
if test "$fast_install" = yes; then
3962
program=lt-'$outputname'$exeext
3963
progdir=\"\$thisdir/$objdir\"
3965
if test ! -f \"\$progdir/\$program\" || \\
3966
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3967
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3969
file=\"\$\$-\$program\"
3971
if test ! -d \"\$progdir\"; then
3972
$mkdir \"\$progdir\"
3974
$rm \"\$progdir/\$file\"
3979
# relink executable if necessary
3980
if test -n \"\$relink_command\"; then
3981
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3983
$echo \"\$relink_command_output\" >&2
3984
$rm \"\$progdir/\$file\"
3989
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3990
{ $rm \"\$progdir/\$program\";
3991
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3992
$rm \"\$progdir/\$file\"
3996
program='$outputname'
3997
progdir=\"\$thisdir/$objdir\"
4003
if test -f \"\$progdir/\$program\"; then"
4005
# Export our shlibpath_var if we have one.
4006
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4008
# Add our own library path to $shlibpath_var
4009
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4011
# Some systems cannot cope with colon-terminated $shlibpath_var
4012
# The second colon is a workaround for a bug in BeOS R4 sed
4013
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4015
export $shlibpath_var
4019
# fixup the dll searchpath if we need to.
4020
if test -n "$dllsearchpath"; then
4022
# Add the dll search path components to the executable PATH
4023
PATH=$dllsearchpath:\$PATH
4028
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4029
# Run the actual program with our arguments.
4032
# win32 systems need to use the prog path for dll
4034
*-*-cygwin* | *-*-pw32*)
4036
exec \$progdir/\$program \${1+\"\$@\"}
4040
# Backslashes separate directories on plain windows
4041
*-*-mingw | *-*-os2*)
4043
exec \$progdir\\\\\$program \${1+\"\$@\"}
4049
# Export the path to the program.
4050
PATH=\"\$progdir:\$PATH\"
4053
exec \$program \${1+\"\$@\"}
4058
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4062
# The program doesn't exist.
4063
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4064
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4065
echo \"See the $PACKAGE documentation for more information.\" 1>&2
4076
# See if we need to build an old-fashioned archive.
4077
for oldlib in $oldlibs; do
4079
if test "$build_libtool_libs" = convenience; then
4080
oldobjs="$libobjs_save"
4081
addlibs="$convenience"
4082
build_libtool_libs=no
4084
if test "$build_libtool_libs" = module; then
4085
oldobjs="$libobjs_save"
4086
build_libtool_libs=no
4088
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4090
addlibs="$old_convenience"
4093
if test -n "$addlibs"; then
4094
gentop="$output_objdir/${outputname}x"
4095
$show "${rm}r $gentop"
4096
$run ${rm}r "$gentop"
4097
$show "mkdir $gentop"
4098
$run mkdir "$gentop"
4100
if test $status -ne 0 && test ! -d "$gentop"; then
4103
generated="$generated $gentop"
4105
# Add in members from convenience archives.
4106
for xlib in $addlibs; do
4107
# Extract the objects.
4109
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4110
*) xabs=`pwd`"/$xlib" ;;
4112
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4113
xdir="$gentop/$xlib"
4115
$show "${rm}r $xdir"
4120
if test $status -ne 0 && test ! -d "$xdir"; then
4123
$show "(cd $xdir && $AR x $xabs)"
4124
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4126
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4130
# Do each command in the archive commands.
4131
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4132
eval cmds=\"$old_archive_from_new_cmds\"
4134
# Ensure that we have .o objects in place in case we decided
4135
# not to build a shared library, and have fallen back to building
4136
# static libs even though --disable-static was passed!
4137
for oldobj in $oldobjs; do
4138
if test ! -f $oldobj; then
4139
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4140
if test "X$xdir" = "X$oldobj"; then
4145
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4146
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4147
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
4148
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4152
eval cmds=\"$old_archive_cmds\"
4154
save_ifs="$IFS"; IFS='~'
4155
for cmd in $cmds; do
4158
$run eval "$cmd" || exit $?
4163
if test -n "$generated"; then
4164
$show "${rm}r$generated"
4165
$run ${rm}r$generated
4168
# Now create the libtool archive.
4172
test "$build_old_libs" = yes && old_library="$libname.$libext"
4173
$show "creating $output"
4175
# Preserve any variables that may affect compiler behavior
4176
for var in $variables_saved_for_relink; do
4177
if eval test -z \"\${$var+set}\"; then
4178
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4179
elif eval var_value=\$$var; test -z "$var_value"; then
4180
relink_command="$var=; export $var; $relink_command"
4182
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4183
relink_command="$var=\"$var_value\"; export $var; $relink_command"
4186
# Quote the link command for shipping.
4187
relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
4188
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4190
# Only create the output if not a dry run.
4191
if test -z "$run"; then
4192
for installed in no yes; do
4193
if test "$installed" = yes; then
4194
if test -z "$install_libdir"; then
4197
output="$output_objdir/$outputname"i
4198
# Replace all uninstalled libtool libraries with the installed ones
4200
for deplib in $dependency_libs; do
4203
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4204
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4205
if test -z "$libdir"; then
4206
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4209
newdependency_libs="$newdependency_libs $libdir/$name"
4211
*) newdependency_libs="$newdependency_libs $deplib" ;;
4214
dependency_libs="$newdependency_libs"
4216
for lib in $dlfiles; do
4217
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4218
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4219
if test -z "$libdir"; then
4220
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4223
newdlfiles="$newdlfiles $libdir/$name"
4225
dlfiles="$newdlfiles"
4227
for lib in $dlprefiles; do
4228
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4229
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4230
if test -z "$libdir"; then
4231
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4234
newdlprefiles="$newdlprefiles $libdir/$name"
4236
dlprefiles="$newdlprefiles"
4239
# place dlname in correct position for cygwin
4241
case $host,$output,$installed,$module,$dlname in
4242
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4245
# $outputname - a libtool library file
4246
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4248
# Please DO NOT delete this file!
4249
# It is necessary for linking the library.
4251
# The name that we can dlopen(3).
4254
# Names of this library.
4255
library_names='$library_names'
4257
# The name of the static archive.
4258
old_library='$old_library'
4260
# Libraries that this one depends upon.
4261
dependency_libs='$dependency_libs'
4263
# Version information for $libname.
4268
# Is this an already installed library?
4269
installed=$installed
4271
# Files to dlopen/dlpreopen
4273
dlpreopen='$dlprefiles'
4275
# Directory that this library needs to be installed in:
4276
libdir='$install_libdir'"
4277
if test "$installed" = no && test $need_relink = yes; then
4279
relink_command=\"$relink_command\""
4284
# Do a symbolic link so that the libtool archive can be found in
4285
# LD_LIBRARY_PATH before the program is installed.
4286
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4287
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4293
# libtool install mode
4295
modename="$modename: install"
4297
# There may be an optional sh(1) argument at the beginning of
4298
# install_prog (especially on Windows NT).
4299
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4300
# Allow the use of GNU shtool's install command.
4301
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4302
# Aesthetically quote it.
4303
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4305
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4309
install_prog="$arg "
4317
# The real first argument should be the name of the installation program.
4318
# Aesthetically quote it.
4319
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4321
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4325
install_prog="$install_prog$arg"
4327
# We need to accept at least all the BSD install flags.
4337
if test -n "$dest"; then
4338
files="$files $dest"
4356
# If the previous option needed an argument, then skip it.
4357
if test -n "$prev"; then
4366
# Aesthetically quote the argument.
4367
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4369
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4373
install_prog="$install_prog $arg"
4376
if test -z "$install_prog"; then
4377
$echo "$modename: you must specify an install program" 1>&2
4382
if test -n "$prev"; then
4383
$echo "$modename: the \`$prev' option requires an argument" 1>&2
4388
if test -z "$files"; then
4389
if test -z "$dest"; then
4390
$echo "$modename: no file or destination specified" 1>&2
4392
$echo "$modename: you must specify a destination" 1>&2
4398
# Strip any trailing slash from the destination.
4399
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4401
# Check to see that the destination is a directory.
4402
test -d "$dest" && isdir=yes
4403
if test "$isdir" = yes; then
4407
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4408
test "X$destdir" = "X$dest" && destdir=.
4409
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4411
# Not a directory, so check to see that there is only one file specified.
4413
if test $# -gt 2; then
4414
$echo "$modename: \`$dest' is not a directory" 1>&2
4420
[\\/]* | [A-Za-z]:[\\/]*) ;;
4422
for file in $files; do
4426
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4435
# This variable tells wrapper scripts just to set variables rather
4436
# than running their programs.
4437
libtool_install_magic="$magic"
4442
for file in $files; do
4444
# Do each installation.
4447
# Do the static libraries later.
4448
staticlibs="$staticlibs $file"
4452
# Check to see that this really is a libtool archive.
4453
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4455
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4463
# If there is no directory component, then add one.
4465
*/* | *\\*) . $file ;;
4469
# Add the libdir to current_libdirs if it is the destination.
4470
if test "X$destdir" = "X$libdir"; then
4471
case "$current_libdirs " in
4473
*) current_libdirs="$current_libdirs $libdir" ;;
4476
# Note the libdir as a future libdir.
4477
case "$future_libdirs " in
4479
*) future_libdirs="$future_libdirs $libdir" ;;
4483
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4484
test "X$dir" = "X$file/" && dir=
4487
if test -n "$relink_command"; then
4488
$echo "$modename: warning: relinking \`$file'" 1>&2
4489
$show "$relink_command"
4490
if $run eval "$relink_command"; then :
4492
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4497
# See the names of the shared library.
4498
set dummy $library_names
4499
if test -n "$2"; then
4505
test -n "$relink_command" && srcname="$realname"T
4507
# Install the shared library and build the symlinks.
4508
$show "$install_prog $dir/$srcname $destdir/$realname"
4509
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4510
if test -n "$stripme" && test -n "$striplib"; then
4511
$show "$striplib $destdir/$realname"
4512
$run eval "$striplib $destdir/$realname" || exit $?
4515
if test $# -gt 0; then
4516
# Delete the old symlinks, and create new ones.
4519
if test "$linkname" != "$realname"; then
4520
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4521
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4526
# Do each command in the postinstall commands.
4527
lib="$destdir/$realname"
4528
eval cmds=\"$postinstall_cmds\"
4529
save_ifs="$IFS"; IFS='~'
4530
for cmd in $cmds; do
4533
$run eval "$cmd" || exit $?
4538
# Install the pseudo-library for information purposes.
4539
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4540
instname="$dir/$name"i
4541
$show "$install_prog $instname $destdir/$name"
4542
$run eval "$install_prog $instname $destdir/$name" || exit $?
4544
# Maybe install the static library, too.
4545
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4549
# Install (i.e. copy) a libtool object.
4551
# Figure out destination file name, if it wasn't already specified.
4552
if test -n "$destname"; then
4553
destfile="$destdir/$destname"
4555
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4556
destfile="$destdir/$destfile"
4559
# Deduce the name of the destination old-style object file.
4562
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4565
staticdest="$destfile"
4569
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4575
# Install the libtool object if requested.
4576
if test -n "$destfile"; then
4577
$show "$install_prog $file $destfile"
4578
$run eval "$install_prog $file $destfile" || exit $?
4581
# Install the old object if enabled.
4582
if test "$build_old_libs" = yes; then
4583
# Deduce the name of the old-style object file.
4584
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4586
$show "$install_prog $staticobj $staticdest"
4587
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
4593
# Figure out destination file name, if it wasn't already specified.
4594
if test -n "$destname"; then
4595
destfile="$destdir/$destname"
4597
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4598
destfile="$destdir/$destfile"
4601
# Do a test to see if this is really a libtool program.
4604
wrapper=`echo $file | sed -e 's,.exe$,,'`
4610
if (sed -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4614
# If there is no directory component, then add one.
4616
*/* | *\\*) . $wrapper ;;
4620
# Check the variables that should have been set.
4621
if test -z "$notinst_deplibs"; then
4622
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4627
for lib in $notinst_deplibs; do
4628
# Check to see that each library is installed.
4630
if test -f "$lib"; then
4631
# If there is no directory component, then add one.
4633
*/* | *\\*) . $lib ;;
4637
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4638
if test -n "$libdir" && test ! -f "$libfile"; then
4639
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4645
# If there is no directory component, then add one.
4647
*/* | *\\*) . $wrapper ;;
4652
if test "$fast_install" = no && test -n "$relink_command"; then
4653
if test "$finalize" = yes && test -z "$run"; then
4655
test -n "$TMPDIR" && tmpdir="$TMPDIR"
4656
tmpdir="$tmpdir/libtool-$$"
4657
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4659
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4662
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4663
outputname="$tmpdir/$file"
4664
# Replace the output file specification.
4665
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4667
$show "$relink_command"
4668
if $run eval "$relink_command"; then :
4670
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4676
$echo "$modename: warning: cannot relink \`$file'" 1>&2
4679
# Install the binary that we compiled earlier.
4680
file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4684
# remove .exe since cygwin /usr/bin/install will append another
4686
case $install_prog,$host in
4687
/usr/bin/install*,*cygwin*)
4688
case $file:$destfile in
4693
destfile=$destfile.exe
4696
destfile=`echo $destfile | sed -e 's,.exe$,,'`
4701
$show "$install_prog$stripme $file $destfile"
4702
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4703
test -n "$outputname" && ${rm}r "$tmpdir"
4708
for file in $staticlibs; do
4709
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4711
# Set up the ranlib parameters.
4712
oldlib="$destdir/$name"
4714
$show "$install_prog $file $oldlib"
4715
$run eval "$install_prog \$file \$oldlib" || exit $?
4717
if test -n "$stripme" && test -n "$striplib"; then
4718
$show "$old_striplib $oldlib"
4719
$run eval "$old_striplib $oldlib" || exit $?
4722
# Do each command in the postinstall commands.
4723
eval cmds=\"$old_postinstall_cmds\"
4724
save_ifs="$IFS"; IFS='~'
4725
for cmd in $cmds; do
4728
$run eval "$cmd" || exit $?
4733
if test -n "$future_libdirs"; then
4734
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4737
if test -n "$current_libdirs"; then
4738
# Maybe just do a dry run.
4739
test -n "$run" && current_libdirs=" -n$current_libdirs"
4740
exec_cmd='$SHELL $0 --finish$current_libdirs'
4746
# libtool finish mode
4748
modename="$modename: finish"
4752
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4755
libdirs="$libdirs $dir"
4758
for libdir in $libdirs; do
4759
if test -n "$finish_cmds"; then
4760
# Do each command in the finish commands.
4761
eval cmds=\"$finish_cmds\"
4762
save_ifs="$IFS"; IFS='~'
4763
for cmd in $cmds; do
4766
$run eval "$cmd" || admincmds="$admincmds
4771
if test -n "$finish_eval"; then
4772
# Do the single finish_eval.
4773
eval cmds=\"$finish_eval\"
4774
$run eval "$cmds" || admincmds="$admincmds
4780
# Exit here if they wanted silent mode.
4781
test "$show" = ":" && exit 0
4783
echo "----------------------------------------------------------------------"
4784
echo "Libraries have been installed in:"
4785
for libdir in $libdirs; do
4789
echo "If you ever happen to want to link against installed libraries"
4790
echo "in a given directory, LIBDIR, you must either use libtool, and"
4791
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4792
echo "flag during linking and do at least one of the following:"
4793
if test -n "$shlibpath_var"; then
4794
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4795
echo " during execution"
4797
if test -n "$runpath_var"; then
4798
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4799
echo " during linking"
4801
if test -n "$hardcode_libdir_flag_spec"; then
4803
eval flag=\"$hardcode_libdir_flag_spec\"
4805
echo " - use the \`$flag' linker flag"
4807
if test -n "$admincmds"; then
4808
echo " - have your system administrator run these commands:$admincmds"
4810
if test -f /etc/ld.so.conf; then
4811
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4814
echo "See any operating system documentation about shared libraries for"
4815
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4816
echo "----------------------------------------------------------------------"
4820
# libtool execute mode
4822
modename="$modename: execute"
4824
# The first argument is the command name.
4826
if test -z "$cmd"; then
4827
$echo "$modename: you must specify a COMMAND" 1>&2
4832
# Handle -dlopen flags immediately.
4833
for file in $execute_dlfiles; do
4834
if test ! -f "$file"; then
4835
$echo "$modename: \`$file' is not a file" 1>&2
4843
# Check to see that this really is a libtool archive.
4844
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4846
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4851
# Read the libtool library.
4855
# If there is no directory component, then add one.
4857
*/* | *\\*) . $file ;;
4861
# Skip this library if it cannot be dlopened.
4862
if test -z "$dlname"; then
4863
# Warn if it was a shared library.
4864
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4868
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4869
test "X$dir" = "X$file" && dir=.
4871
if test -f "$dir/$objdir/$dlname"; then
4874
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4880
# Just add the directory containing the .lo file.
4881
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4882
test "X$dir" = "X$file" && dir=.
4886
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4891
# Get the absolute pathname.
4892
absdir=`cd "$dir" && pwd`
4893
test -n "$absdir" && dir="$absdir"
4895
# Now add the directory to shlibpath_var.
4896
if eval "test -z \"\$$shlibpath_var\""; then
4897
eval "$shlibpath_var=\"\$dir\""
4899
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4903
# This variable tells wrapper scripts just to set shlibpath_var
4904
# rather than running their programs.
4905
libtool_execute_magic="$magic"
4907
# Check if any of the arguments is a wrapper script.
4914
# Do a test to see if this is really a libtool program.
4915
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4916
# If there is no directory component, then add one.
4918
*/* | *\\*) . $file ;;
4922
# Transform arg to wrapped name.
4923
file="$progdir/$program"
4927
# Quote arguments (to preserve shell metacharacters).
4928
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4929
args="$args \"$file\""
4932
if test -z "$run"; then
4933
if test -n "$shlibpath_var"; then
4934
# Export the shlibpath_var.
4935
eval "export $shlibpath_var"
4938
# Restore saved enviroment variables
4939
if test "${save_LC_ALL+set}" = set; then
4940
LC_ALL="$save_LC_ALL"; export LC_ALL
4942
if test "${save_LANG+set}" = set; then
4943
LANG="$save_LANG"; export LANG
4946
# Now prepare to actually exec the command.
4947
exec_cmd="\$cmd$args"
4949
# Display what would be done.
4950
if test -n "$shlibpath_var"; then
4951
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4952
$echo "export $shlibpath_var"
4959
# libtool clean and uninstall mode
4961
modename="$modename: $mode"
4967
# This variable tells wrapper scripts just to set variables rather
4968
# than running their programs.
4969
libtool_install_magic="$magic"
4974
-f) rm="$rm $arg"; rmforce=yes ;;
4975
-*) rm="$rm $arg" ;;
4976
*) files="$files $arg" ;;
4980
if test -z "$rm"; then
4981
$echo "$modename: you must specify an RM program" 1>&2
4988
for file in $files; do
4989
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4990
if test "X$dir" = "X$file"; then
4994
objdir="$dir/$objdir"
4996
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4997
test $mode = uninstall && objdir="$dir"
4999
# Remember objdir for removal later, being careful to avoid duplicates
5000
if test $mode = clean; then
5003
*) rmdirs="$rmdirs $objdir" ;;
5007
# Don't error if the file doesn't exist and rm -f was used.
5008
if (test -L "$file") >/dev/null 2>&1 \
5009
|| (test -h "$file") >/dev/null 2>&1 \
5010
|| test -f "$file"; then
5012
elif test -d "$file"; then
5015
elif test "$rmforce" = yes; then
5023
# Possibly a libtool archive, so verify it.
5024
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5027
# Delete the libtool libraries and symlinks.
5028
for n in $library_names; do
5029
rmfiles="$rmfiles $objdir/$n"
5031
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5032
test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5034
if test $mode = uninstall; then
5035
if test -n "$library_names"; then
5036
# Do each command in the postuninstall commands.
5037
eval cmds=\"$postuninstall_cmds\"
5038
save_ifs="$IFS"; IFS='~'
5039
for cmd in $cmds; do
5043
if test $? != 0 && test "$rmforce" != yes; then
5050
if test -n "$old_library"; then
5051
# Do each command in the old_postuninstall commands.
5052
eval cmds=\"$old_postuninstall_cmds\"
5053
save_ifs="$IFS"; IFS='~'
5054
for cmd in $cmds; do
5058
if test $? != 0 && test "$rmforce" != yes; then
5064
# FIXME: should reinstall the best remaining shared library.
5070
if test "$build_old_libs" = yes; then
5071
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5072
rmfiles="$rmfiles $dir/$oldobj"
5077
# Do a test to see if this is a libtool program.
5078
if test $mode = clean &&
5079
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5083
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5084
if test "$fast_install" = yes && test -n "$relink_command"; then
5085
rmfiles="$rmfiles $objdir/lt-$name"
5090
$show "$rm $rmfiles"
5091
$run $rm $rmfiles || exit_status=1
5094
# Try to remove the ${objdir}s in the directories where we deleted files
5095
for dir in $rmdirs; do
5096
if test -d "$dir"; then
5098
$run rmdir $dir >/dev/null 2>&1
5106
$echo "$modename: you must specify a MODE" 1>&2
5107
$echo "$generic_help" 1>&2
5112
if test -z "$exec_cmd"; then
5113
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5114
$echo "$generic_help" 1>&2
5117
fi # test -z "$show_help"
5119
if test -n "$exec_cmd"; then
5124
# We need to display help for each of the modes.
5127
"Usage: $modename [OPTION]... [MODE-ARG]...
5129
Provide generalized library-building support services.
5131
--config show all configuration variables
5132
--debug enable verbose shell tracing
5133
-n, --dry-run display commands without modifying any files
5134
--features display basic configuration information and exit
5135
--finish same as \`--mode=finish'
5136
--help display this help message and exit
5137
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5138
--quiet same as \`--silent'
5139
--silent don't print informational messages
5140
--version print version information
5142
MODE must be one of the following:
5144
clean remove files from the build directory
5145
compile compile a source file into a libtool object
5146
execute automatically set library path, then run a program
5147
finish complete the installation of libtool libraries
5148
install install libraries or executables
5149
link create a library or an executable
5150
uninstall remove libraries from an installed directory
5152
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5153
a more detailed description of MODE."
5159
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5161
Remove files from the build directory.
5163
RM is the name of the program to use to delete files associated with each FILE
5164
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5167
If FILE is a libtool library, object or program, all the files associated
5168
with it are deleted. Otherwise, only FILE itself is deleted using RM."
5173
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5175
Compile a source file into a libtool library object.
5177
This mode accepts the following additional options:
5179
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
5180
-prefer-pic try to building PIC objects only
5181
-prefer-non-pic try to building non-PIC objects only
5182
-static always build a \`.o' file suitable for static linking
5184
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5185
from the given SOURCEFILE.
5187
The output file name is determined by removing the directory component from
5188
SOURCEFILE, then substituting the C source code suffix \`.c' with the
5189
library object suffix, \`.lo'."
5194
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5196
Automatically set library path, then run a program.
5198
This mode accepts the following additional options:
5200
-dlopen FILE add the directory containing FILE to the library path
5202
This mode sets the library path environment variable according to \`-dlopen'
5205
If any of the ARGS are libtool executable wrappers, then they are translated
5206
into their corresponding uninstalled binary, and any of their required library
5207
directories are added to the library path.
5209
Then, COMMAND is executed, with ARGS as arguments."
5214
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5216
Complete the installation of libtool libraries.
5218
Each LIBDIR is a directory that contains libtool libraries.
5220
The commands that this mode executes may require superuser privileges. Use
5221
the \`--dry-run' option if you just want to see what would be executed."
5226
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5228
Install executables or libraries.
5230
INSTALL-COMMAND is the installation command. The first component should be
5231
either the \`install' or \`cp' program.
5233
The rest of the components are interpreted as arguments to that command (only
5234
BSD-compatible install options are recognized)."
5239
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5241
Link object files or libraries together to form another library, or to
5242
create an executable program.
5244
LINK-COMMAND is a command using the C compiler that you would use to create
5245
a program from several object files.
5247
The following components of LINK-COMMAND are treated specially:
5249
-all-static do not do any dynamic linking at all
5250
-avoid-version do not add a version suffix if possible
5251
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5252
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5253
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5254
-export-symbols SYMFILE
5255
try to export only the symbols listed in SYMFILE
5256
-export-symbols-regex REGEX
5257
try to export only the symbols matching REGEX
5258
-LLIBDIR search LIBDIR for required installed libraries
5259
-lNAME OUTPUT-FILE requires the installed library libNAME
5260
-module build a library that can dlopened
5261
-no-fast-install disable the fast-install mode
5262
-no-install link a not-installable executable
5263
-no-undefined declare that a library does not refer to external symbols
5264
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5265
-release RELEASE specify package release information
5266
-rpath LIBDIR the created library will eventually be installed in LIBDIR
5267
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5268
-static do not do any dynamic linking of libtool libraries
5269
-version-info CURRENT[:REVISION[:AGE]]
5270
specify library version info [each variable defaults to 0]
5272
All other options (arguments beginning with \`-') are ignored.
5274
Every other argument is treated as a filename. Files ending in \`.la' are
5275
treated as uninstalled libtool libraries, other files are standard or library
5278
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5279
only library objects (\`.lo' files) may be specified, and \`-rpath' is
5280
required, except when creating a convenience library.
5282
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5283
using \`ar' and \`ranlib', or on Windows using \`lib'.
5285
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5286
is created, otherwise an executable program is created."
5291
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5293
Remove libraries from an installation directory.
5295
RM is the name of the program to use to delete files associated with each FILE
5296
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5299
If FILE is a libtool library, all the files associated with it are deleted.
5300
Otherwise, only FILE itself is deleted using RM."
5304
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5311
$echo "Try \`$modename --help' for more information about other modes."