102
133
lo2o="s/\\.lo\$/.${objext}/"
103
134
o2lo="s/\\.${objext}\$/.lo/"
136
#####################################
137
# Shell function definitions:
138
# This seems to be the best place for them
140
# func_win32_libid arg
141
# return the library type of file 'arg'
143
# Need a lot of goo to handle *both* DLLs and import libs
144
# Has to be a shell function in order to 'eat' the argument
145
# that is supplied when $file_magic_command is called.
146
func_win32_libid () {
147
win32_libid_type="unknown"
148
win32_fileres=`file -L $1 2>/dev/null`
149
case $win32_fileres in
150
*ar\ archive\ import\ library*) # definitely import
151
win32_libid_type="x86 archive import"
153
*ar\ archive*) # could be an import, or static
154
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
155
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
156
win32_nmres=`eval $NM -f posix -A $1 | \
157
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
158
if test "X$win32_nmres" = "Ximport" ; then
159
win32_libid_type="x86 archive import"
161
win32_libid_type="x86 archive static"
166
win32_libid_type="x86 DLL"
168
*executable*) # but shell scripts are "executable" too...
169
case $win32_fileres in
170
*MS\ Windows\ PE\ Intel*)
171
win32_libid_type="x86 DLL"
176
$echo $win32_libid_type
181
# Infer tagged configuration to use if any are available and
182
# if one wasn't chosen via the "--tag" command line option.
183
# Only attempt this if the compiler in the base compile
184
# command doesn't match the default compiler.
185
# arg is usually of the form 'gcc ...'
187
if test -n "$available_tags" && test -z "$tagname"; then
191
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
195
CC_quoted="$CC_quoted $arg"
198
# Blanks in the command may have been stripped by the calling shell,
199
# but not from the CC environment variable when configure was run.
200
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
201
# Blanks at the start of $base_compile will cause this to fail
202
# if we don't check for them as well.
204
for z in $available_tags; do
205
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
206
# Evaluate the configuration.
207
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
210
# Double-quote args containing other shell metacharacters.
212
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
216
CC_quoted="$CC_quoted $arg"
219
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
220
# The compiler in the base compile command matches
221
# the one in the tagged configuration.
222
# Assume this is the tagged configuration we want.
229
# If $tagname still isn't set, then no tagged configuration
230
# was found and let the user know that the "--tag" command
231
# line option must be used.
232
if test -z "$tagname"; then
233
$echo "$modename: unable to infer tagged configuration"
234
$echo "$modename: specify a tag with \`--tag'" 1>&2
237
# $echo "$modename: using $tagname tagged configuration"
245
# func_extract_archives gentop oldlib ...
246
func_extract_archives () {
247
my_gentop="$1"; shift
255
$show "${rm}r $my_gentop"
256
$run ${rm}r "$my_gentop"
257
$show "$mkdir $my_gentop"
258
$run $mkdir "$my_gentop"
260
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
264
for my_xlib in $my_oldlibs; do
265
# Extract the objects.
267
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
268
*) my_xabs=`pwd`"/$my_xlib" ;;
270
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
271
my_xdir="$my_gentop/$my_xlib"
273
$show "${rm}r $my_xdir"
274
$run ${rm}r "$my_xdir"
275
$show "$mkdir $my_xdir"
276
$run $mkdir "$my_xdir"
278
if test "$status" -ne 0 && test ! -d "$my_xdir"; then
283
$show "Extracting $my_xabs"
284
# Do not bother doing anything if just a dry run
285
if test -z "$run"; then
286
darwin_orig_dir=`pwd`
287
cd $my_xdir || exit $?
288
darwin_archive=$my_xabs
290
darwin_base_archive=`basename $darwin_archive`
291
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
292
if test -n "$darwin_arches"; then
293
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
295
$show "$darwin_base_archive has multiple architectures $darwin_arches"
296
for darwin_arch in $darwin_arches ; do
297
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
298
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
299
# Remove the table of contents from the thin files.
300
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
301
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
302
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
303
$AR -xo "${darwin_base_archive}"
304
rm "${darwin_base_archive}"
306
done # $darwin_arches
307
## Okay now we have a bunch of thin objects, gotta fatten them up :)
308
darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
311
for darwin_file in $darwin_filelist; do
312
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
313
lipo -create -output "$darwin_file" $darwin_files
314
done # $darwin_filelist
316
cd "$darwin_orig_dir"
319
(cd $my_xdir && $AR x $my_xabs) || exit $?
324
# We will extract separately just the conflicting names and we will
325
# no longer touch any unique names. It is faster to leave these
326
# extract automatically by $AR in one run.
327
$show "(cd $my_xdir && $AR x $my_xabs)"
328
$run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
329
if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
332
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
333
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
334
$AR t "$my_xabs" | sort | uniq -cd | while read -r count name
337
while test "$i" -le "$count"
339
# Put our $i before any first dot (extension)
340
# Never overwrite any file
342
while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
344
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
346
$show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
347
$run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
354
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
357
func_extract_archives_result="$my_oldobjs"
359
# End of Shell function definitions
360
#####################################
363
eval std_shrext=\"$shrext_cmds\"
105
365
# Parse our command line options once, thoroughly.
366
while test "$#" -gt 0
262
577
modename="$modename: compile"
263
578
# Get the compilation command and the source file.
580
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
276
# Aesthetically quote the previous argument.
278
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
281
# Double-quote args containing other shell metacharacters.
282
# Many Bourne shells cannot handle close brackets correctly
283
# in scan sets, so we specify it separately.
284
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
289
# Add the previous argument to base_compile.
290
if test -z "$base_compile"; then
291
base_compile="$lastarg"
293
base_compile="$base_compile $lastarg"
299
# Accept any command-line options.
302
if test "$user_target" != "no"; then
303
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
330
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
332
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
336
# Double-quote args containing other shell metacharacters.
337
# Many Bourne shells cannot handle close brackets correctly
338
# in scan sets, so we specify it separately.
340
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
344
lastarg="$lastarg $arg"
347
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
349
# Add the arguments to base_compile.
350
if test -z "$base_compile"; then
351
base_compile="$lastarg"
353
base_compile="$base_compile $lastarg"
361
# The next one is the -o target name
366
# We got the output file
591
# do not "continue". Instead, add this to base_compile
373
# Accept the current argument as the source file.
603
# Accept any command-line options.
606
if test -n "$libobj" ; then
607
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
614
-static | -prefer-pic | -prefer-non-pic)
625
arg_mode=arg # the next one goes into the "base_compile" arg list
626
continue # The current "srcfile" will either be retained or
627
;; # replaced later. I would guess that would be a bug.
630
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
632
save_ifs="$IFS"; IFS=','
636
# Double-quote args containing other shell metacharacters.
637
# Many Bourne shells cannot handle close brackets correctly
638
# in scan sets, so we specify it separately.
640
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
644
lastarg="$lastarg $arg"
647
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
649
# Add the arguments to base_compile.
650
base_compile="$base_compile $lastarg"
655
# Accept the current argument as the source file.
656
# The previous "srcfile" becomes the current argument.
663
esac # case $arg_mode
377
665
# Aesthetically quote the previous argument.
379
# Backslashify any backslashes, double quotes, and dollar signs.
380
# These are the only characters that are still specially
381
# interpreted inside of double-quoted scrings.
382
666
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
384
669
# Double-quote args containing other shell metacharacters.
385
670
# Many Bourne shells cannot handle close brackets correctly
386
671
# in scan sets, so we specify it separately.
388
672
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
389
673
lastarg="\"$lastarg\""
393
# Add the previous argument to base_compile.
394
if test -z "$base_compile"; then
395
base_compile="$lastarg"
397
base_compile="$base_compile $lastarg"
677
base_compile="$base_compile $lastarg"
682
$echo "$modename: you must specify an argument for -Xcompile"
686
$echo "$modename: you must specify a target with \`-o'" 1>&2
405
690
# Get the name of the library object.
406
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
409
$echo "$modename: you must specify a target with \`-o'" 1>&2
691
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
414
695
# Recognize several different file suffixes.
415
696
# If the user specifies -o file.o, it is replaced with file.lo
418
699
*.ada) xform=ada ;;
419
700
*.adb) xform=adb ;;
499
814
$run $rm $removelist
502
echo $srcfile > "$lockfile"
817
$echo $srcfile > "$lockfile"
505
820
if test -n "$fix_srcfile_path"; then
506
821
eval srcfile=\"$fix_srcfile_path\"
824
$run $rm "$libobj" "${libobj}T"
826
# Create a libtool object file (analogous to a ".la" file),
827
# but don't create it if we're doing a dry run.
828
test -z "$run" && cat > ${libobj}T <<EOF
829
# $libobj - a libtool object file
830
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
832
# Please DO NOT delete this file!
833
# It is necessary for linking the library.
835
# Name of the PIC object.
509
838
# Only build a PIC object if we are building libtool libraries.
510
839
if test "$build_libtool_libs" = yes; then
511
840
# Without this assignment, base_compile gets emptied.
512
841
fbsd_hideous_sh_bug=$base_compile
514
843
if test "$pic_mode" != no; then
515
# All platforms use -DPIC, to notify preprocessed assembler code.
516
command="$base_compile $srcfile $pic_flag -DPIC"
844
command="$base_compile $srcfile $pic_flag"
518
846
# Don't build PIC code
519
847
command="$base_compile $srcfile"
521
if test "$build_old_libs" = yes; then
523
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
524
if test "X$dir" = "X$libobj"; then
529
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
531
if test -d "$dir"; then
538
if test $status -ne 0 && test ! -d $dir; then
543
if test "$compiler_o_lo" = yes; then
545
command="$command -o $output_obj"
546
elif test "$compiler_c_o" = yes; then
548
command="$command -o $output_obj"
551
$run $rm "$output_obj"
850
if test ! -d "${xdir}$objdir"; then
851
$show "$mkdir ${xdir}$objdir"
852
$run $mkdir ${xdir}$objdir
854
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
859
if test -z "$output_obj"; then
860
# Place PIC objects in $objdir
861
command="$command -o $lobj"
864
$run $rm "$lobj" "$output_obj"
553
867
if $run eval "$command"; then :
555
869
test -n "$output_obj" && $run $rm $removelist
559
873
if test "$need_locks" = warn &&
560
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
874
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
562
876
*** ERROR, $lockfile contains:
563
877
`cat $lockfile 2>/dev/null`
575
889
$run $rm $removelist
579
893
# Just move the object if needed, then go on to compile the next one
580
if test x"$output_obj" != x"$libobj"; then
581
$show "$mv $output_obj $libobj"
582
if $run $mv $output_obj $libobj; then :
590
# If we have no pic_flag, then copy the object into place and finish.
591
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
592
test "$build_old_libs" = yes; then
593
# Rename the .lo from within objdir to obj
594
if test -f $obj; then
599
$show "$mv $libobj $obj"
600
if $run $mv $libobj $obj; then :
607
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
608
if test "X$xdir" = "X$obj"; then
613
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
614
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
615
# Now arrange that obj and lo_libobj become the same file
616
$show "(cd $xdir && $LN_S $baseobj $libobj)"
617
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
894
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
895
$show "$mv $output_obj $lobj"
896
if $run $mv $output_obj $lobj; then :
904
# Append the name of the PIC object to the libtool object file.
905
test -z "$run" && cat >> ${libobj}T <<EOF
906
pic_object='$objdir/$objname'
626
910
# Allow error messages only from the first compilation.
627
suppress_output=' >/dev/null 2>&1'
911
if test "$suppress_opt" = yes; then
912
suppress_output=' >/dev/null 2>&1'
915
# No PIC object so indicate it doesn't exist in the libtool
917
test -z "$run" && cat >> ${libobj}T <<EOF
630
923
# Only build a position-dependent object if we build old libraries.
880
1179
inst_prefix_dir="$arg"
1184
precious_files_regex="$arg"
1194
if test -f "$arg"; then
1197
for fil in `cat $save_arg`
1199
# moreargs="$moreargs $fil"
1201
# A libtool-controlled object.
1203
# Check to see that this really is a libtool object.
1204
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1209
# If there is no directory component, then add one.
1211
*/* | *\\*) . $arg ;;
1215
if test -z "$pic_object" || \
1216
test -z "$non_pic_object" ||
1217
test "$pic_object" = none && \
1218
test "$non_pic_object" = none; then
1219
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1223
# Extract subdirectory from the argument.
1224
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1225
if test "X$xdir" = "X$arg"; then
1231
if test "$pic_object" != none; then
1232
# Prepend the subdirectory the object is found in.
1233
pic_object="$xdir$pic_object"
1235
if test "$prev" = dlfiles; then
1236
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1237
dlfiles="$dlfiles $pic_object"
1241
# If libtool objects are unsupported, then we need to preload.
1246
# CHECK ME: I think I busted this. -Ossama
1247
if test "$prev" = dlprefiles; then
1248
# Preload the old-style object.
1249
dlprefiles="$dlprefiles $pic_object"
1254
libobjs="$libobjs $pic_object"
1259
if test "$non_pic_object" != none; then
1260
# Prepend the subdirectory the object is found in.
1261
non_pic_object="$xdir$non_pic_object"
1263
# A standard non-PIC object
1264
non_pic_objects="$non_pic_objects $non_pic_object"
1265
if test -z "$pic_object" || test "$pic_object" = none ; then
1266
arg="$non_pic_object"
1270
# Only an error if not doing a dry-run.
1271
if test -z "$run"; then
1272
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1277
# Extract subdirectory from the argument.
1278
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1279
if test "X$xdir" = "X$arg"; then
1285
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1286
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1287
libobjs="$libobjs $pic_object"
1288
non_pic_objects="$non_pic_objects $non_pic_object"
1293
$echo "$modename: link input file \`$save_arg' does not exist"
890
1301
# We need an absolute path.
892
1303
[\\/]* | [A-Za-z]:[\\/]*) ;;
894
1305
$echo "$modename: only absolute run-paths are allowed" 1>&2
898
1309
if test "$prev" = rpath; then
1042
1466
# These systems don't actually have a C library (as such)
1043
1467
test "X$arg" = "X-lc" && continue
1469
*-*-openbsd* | *-*-freebsd*)
1470
# Do not include libc due to us having libc/libc_r.
1471
test "X$arg" = "X-lc" && continue
1473
*-*-rhapsody* | *-*-darwin1.[012])
1474
# Rhapsody C and math libraries are in the System framework
1475
deplibs="$deplibs -framework System"
1478
elif test "X$arg" = "X-lc_r"; then
1480
*-*-openbsd* | *-*-freebsd*)
1481
# Do not include libc_r directly, use -pthread flag.
1047
1486
deplibs="$deplibs $arg"
1490
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1491
deplibs="$deplibs $arg"
1500
# gcc -m* arguments should be passed to the linker via $compiler_flags
1501
# in order to pass architecture information to the linker
1502
# (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1503
# but this is not reliable with gcc because gcc may use -mfoo to
1504
# select a different linker, different libraries, etc, while
1505
# -Wl,-mfoo simply passes -mfoo to the linker.
1507
# Unknown arguments in both finalize_command and compile_command need
1508
# to be aesthetically quoted because they are evaled later.
1509
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1511
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1515
compile_command="$compile_command $arg"
1516
finalize_command="$finalize_command $arg"
1517
if test "$with_gcc" = "yes" ; then
1518
compiler_flags="$compiler_flags $arg"
1056
1528
-no-fast-install)
1057
1529
fast_install=no
1193
# A library or standard object.
1194
if test "$prev" = dlfiles; then
1195
# This file was specified with -dlopen.
1196
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1197
dlfiles="$dlfiles $arg"
1201
# If libtool objects are unsupported, then we need to preload.
1206
if test "$prev" = dlprefiles; then
1207
# Preload the old-style object.
1208
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1685
# A standard object.
1690
# A libtool-controlled object.
1692
# Check to see that this really is a libtool object.
1693
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1698
# If there is no directory component, then add one.
1212
*.lo) libobjs="$libobjs $arg" ;;
1213
*) objs="$objs $arg" ;;
1700
*/* | *\\*) . $arg ;;
1704
if test -z "$pic_object" || \
1705
test -z "$non_pic_object" ||
1706
test "$pic_object" = none && \
1707
test "$non_pic_object" = none; then
1708
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1712
# Extract subdirectory from the argument.
1713
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1714
if test "X$xdir" = "X$arg"; then
1720
if test "$pic_object" != none; then
1721
# Prepend the subdirectory the object is found in.
1722
pic_object="$xdir$pic_object"
1724
if test "$prev" = dlfiles; then
1725
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1726
dlfiles="$dlfiles $pic_object"
1730
# If libtool objects are unsupported, then we need to preload.
1735
# CHECK ME: I think I busted this. -Ossama
1736
if test "$prev" = dlprefiles; then
1737
# Preload the old-style object.
1738
dlprefiles="$dlprefiles $pic_object"
1743
libobjs="$libobjs $pic_object"
1748
if test "$non_pic_object" != none; then
1749
# Prepend the subdirectory the object is found in.
1750
non_pic_object="$xdir$non_pic_object"
1752
# A standard non-PIC object
1753
non_pic_objects="$non_pic_objects $non_pic_object"
1754
if test -z "$pic_object" || test "$pic_object" = none ; then
1755
arg="$non_pic_object"
1759
# Only an error if not doing a dry-run.
1760
if test -z "$run"; then
1761
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1766
# Extract subdirectory from the argument.
1767
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1768
if test "X$xdir" = "X$arg"; then
1774
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1775
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1776
libobjs="$libobjs $pic_object"
1777
non_pic_objects="$non_pic_objects $non_pic_object"
1313
1878
*) linkmode=prog ;; # Anything else should be a program.
1882
*cygwin* | *mingw* | *pw32*)
1883
# don't eliminate duplications in $postdeps and $predeps
1884
duplicate_compiler_generated_deps=yes
1887
duplicate_compiler_generated_deps=$duplicate_deps
1316
1890
specialdeplibs=
1318
1893
# Find all interdependent deplibs by searching for libraries
1319
1894
# that are linked more than once (e.g. -la -lb -la)
1320
1895
for deplib in $deplibs; do
1322
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1896
if test "X$duplicate_deps" = "Xyes" ; then
1898
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1324
1901
libs="$libs $deplib"
1904
if test "$linkmode" = lib; then
1905
libs="$predeps $libs $compiler_lib_search_path $postdeps"
1907
# Compute libraries that are listed more than once in $predeps
1908
# $postdeps and mark them as special (i.e., whose duplicates are
1909
# not to be eliminated).
1911
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1912
for pre_post_dep in $predeps $postdeps; do
1913
case "$pre_post_deps " in
1914
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1916
pre_post_deps="$pre_post_deps $pre_post_dep"
1327
1923
newdependency_libs=
1328
1924
newlib_search_path=
1356
1952
for pass in $passes; do
1357
if test $linkmode = prog; then
1358
# Determine which files to process
1953
if test "$linkmode,$pass" = "lib,link" ||
1954
test "$linkmode,$pass" = "prog,scan"; then
1958
if test "$linkmode" = prog; then
1362
save_deplibs="$deplibs" # Collect dlpreopened libraries
1960
dlopen) libs="$dlfiles" ;;
1365
1961
dlpreopen) libs="$dlprefiles" ;;
1366
1962
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1965
if test "$pass" = dlopen; then
1966
# Collect dlpreopened libraries
1967
save_deplibs="$deplibs"
1369
1970
for deplib in $libs; do
1372
1973
case $deplib in
1974
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1975
if test "$linkmode,$pass" = "prog,link"; then
1976
compile_deplibs="$deplib $compile_deplibs"
1977
finalize_deplibs="$deplib $finalize_deplibs"
1979
deplibs="$deplib $deplibs"
1374
if test $linkmode = oldlib && test $linkmode = obj; then
1375
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1378
if test $pass = conv; then
1379
deplibs="$deplib $deplibs"
1984
if test "$linkmode" != lib && test "$linkmode" != prog; then
1985
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1382
1988
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1383
1989
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1384
# Search the libtool library
1385
lib="$searchdir/lib${name}.la"
1386
if test -f "$lib"; then
1990
for search_ext in .la $std_shrext .so .a; do
1991
# Search the libtool library
1992
lib="$searchdir/lib${name}${search_ext}"
1993
if test -f "$lib"; then
1994
if test "$search_ext" = ".la"; then
1391
2003
if test "$found" != yes; then
1392
2004
# deplib doesn't seem to be a libtool library
1395
2007
finalize_deplibs="$deplib $finalize_deplibs"
1397
2009
deplibs="$deplib $deplibs"
1398
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
2010
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2013
else # deplib is a libtool library
2014
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2015
# We need to do some special things here, and not later.
2016
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2017
case " $predeps $postdeps " in
2019
if (${SED} -e '2q' $lib |
2020
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2024
*/* | *\\*) . $lib ;;
2027
for l in $old_library $library_names; do
2030
if test "X$ll" = "X$old_library" ; then # only static version available
2032
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2033
test "X$ladir" = "X$lib" && ladir="."
2034
lib=$ladir/$old_library
2035
if test "$linkmode,$pass" = "prog,link"; then
2036
compile_deplibs="$deplib $compile_deplibs"
2037
finalize_deplibs="$deplib $finalize_deplibs"
2039
deplibs="$deplib $deplibs"
2040
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1404
2052
case $linkmode in
1406
2054
deplibs="$deplib $deplibs"
1407
test $pass = conv && continue
2055
test "$pass" = conv && continue
1408
2056
newdependency_libs="$deplib $newdependency_libs"
1409
2057
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1412
if test $pass = conv; then
2060
if test "$pass" = conv; then
1413
2061
deplibs="$deplib $deplibs"
1416
if test $pass = scan; then
2064
if test "$pass" = scan; then
1417
2065
deplibs="$deplib $deplibs"
1418
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1420
2067
compile_deplibs="$deplib $compile_deplibs"
1421
2068
finalize_deplibs="$deplib $finalize_deplibs"
2070
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1425
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
2073
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1427
2075
esac # linkmode
1431
if test $pass = link; then
2079
if test "$pass" = link; then
1432
2080
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1433
2081
# Make sure the xrpath contains only unique directories.
1434
2082
case "$xrpath " in
1442
2090
*.la) lib="$deplib" ;;
1444
if test $pass = conv; then
2092
if test "$pass" = conv; then
1445
2093
deplibs="$deplib $deplibs"
1448
2096
case $linkmode in
1450
if test "$deplibs_check_method" != pass_all; then
1452
echo "*** Warning: This library needs some functionality provided by $deplib."
1453
echo "*** I have the capability to make that library automatically link in when"
1454
echo "*** you link to this library. But I can only do this if you have a"
1455
echo "*** shared version of the library, which you do not appear to have."
2099
case $deplibs_check_method in
2101
set dummy $deplibs_check_method
2102
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2103
if eval $echo \"$deplib\" 2>/dev/null \
2105
| $EGREP "$match_pattern_regex" > /dev/null; then
2113
if test "$valid_a_lib" != yes; then
2115
$echo "*** Warning: Trying to link with static lib archive $deplib."
2116
$echo "*** I have the capability to make that library automatically link in when"
2117
$echo "*** you link to this library. But I can only do this if you have a"
2118
$echo "*** shared version of the library, which you do not appear to have"
2119
$echo "*** because the file extensions .$libext of this argument makes me believe"
2120
$echo "*** that it is just a static archive that I should not used here."
1458
echo "*** Warning: Linking the shared library $output against the"
1459
echo "*** static library $deplib is not portable!"
2123
$echo "*** Warning: Linking the shared library $output against the"
2124
$echo "*** static library $deplib is not portable!"
1460
2125
deplibs="$deplib $deplibs"
1465
if test $pass != link; then
2130
if test "$pass" != link; then
1466
2131
deplibs="$deplib $deplibs"
1468
2133
compile_deplibs="$deplib $compile_deplibs"
1661
2345
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1663
2347
# Need to link against all dependency_libs?
1664
if test $linkalldeplibs = yes; then
2348
if test "$linkalldeplibs" = yes; then
1665
2349
deplibs="$deplib $deplibs"
1667
2351
# Need to hardcode shared library paths
1668
2352
# or/and link against static libraries
1669
2353
newdependency_libs="$deplib $newdependency_libs"
1671
case "$tmp_libs " in
1672
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2355
if test "X$duplicate_deps" = "Xyes" ; then
2356
case "$tmp_libs " in
2357
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1674
2360
tmp_libs="$tmp_libs $deplib"
1675
2361
done # for deplib
1677
2363
fi # $linkmode = prog...
2365
if test "$linkmode,$pass" = "prog,link"; then
2366
if test -n "$library_names" &&
2367
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2368
# We need to hardcode the library path
2369
if test -n "$shlibpath_var"; then
2370
# Make sure the rpath contains only unique directories.
2371
case "$temp_rpath " in
2374
*) temp_rpath="$temp_rpath $dir" ;;
2378
# Hardcode the library path.
2379
# Skip directories that are in the system default run-time
2381
case " $sys_lib_dlsearch_path " in
2384
case "$compile_rpath " in
2386
*) compile_rpath="$compile_rpath $absdir"
2390
case " $sys_lib_dlsearch_path " in
2393
case "$finalize_rpath " in
2395
*) finalize_rpath="$finalize_rpath $libdir"
2399
fi # $linkmode,$pass = prog,link...
2401
if test "$alldeplibs" = yes &&
2402
{ test "$deplibs_check_method" = pass_all ||
2403
{ test "$build_libtool_libs" = yes &&
2404
test -n "$library_names"; }; }; then
2405
# We only need to search for static libraries
1679
2410
link_static=no # Whether the deplib will be linked statically
1680
2411
if test -n "$library_names" &&
1681
2412
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1682
# Link against this shared library
1684
if test "$linkmode,$pass" = "prog,link" ||
1685
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1686
# Hardcode the library path.
1687
# Skip directories that are in the system default run-time
1689
case " $sys_lib_dlsearch_path " in
1692
case "$compile_rpath " in
1694
*) compile_rpath="$compile_rpath $absdir"
1698
case " $sys_lib_dlsearch_path " in
1701
case "$finalize_rpath " in
1703
*) finalize_rpath="$finalize_rpath $libdir"
1707
if test $linkmode = prog; then
1708
# We need to hardcode the library path
1709
if test -n "$shlibpath_var"; then
1710
# Make sure the rpath contains only unique directories.
1711
case "$temp_rpath " in
1714
*) temp_rpath="$temp_rpath $dir" ;;
1718
fi # $linkmode,$pass = prog,link...
1720
if test "$alldeplibs" = yes &&
1721
{ test "$deplibs_check_method" = pass_all ||
1722
{ test "$build_libtool_libs" = yes &&
1723
test -n "$library_names"; }; }; then
1724
# We only need to search for static libraries
1728
2413
if test "$installed" = no; then
1729
2414
notinst_deplibs="$notinst_deplibs $lib"
1730
2415
need_relink=yes
2417
# This is a shared library
2419
# Warn about portability, can't link against -module's on
2420
# some systems (darwin)
2421
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2423
if test "$linkmode" = prog; then
2424
$echo "*** Warning: Linking the executable $output against the loadable module"
2426
$echo "*** Warning: Linking the shared library $output against the loadable module"
2428
$echo "*** $linklib is not portable!"
2430
if test "$linkmode" = lib &&
2431
test "$hardcode_into_libs" = yes; then
2432
# Hardcode the library path.
2433
# Skip directories that are in the system default run-time
2435
case " $sys_lib_dlsearch_path " in
2438
case "$compile_rpath " in
2440
*) compile_rpath="$compile_rpath $absdir"
2444
case " $sys_lib_dlsearch_path " in
2447
case "$finalize_rpath " in
2449
*) finalize_rpath="$finalize_rpath $libdir"
1733
2455
if test -n "$old_archive_from_expsyms_cmds"; then
1734
2456
# figure out the soname
1933
2668
# Just print a warning and add the library to dependency_libs so
1934
2669
# that the program can be linked against the static library.
1936
echo "*** Warning: This library needs some functionality provided by $lib."
1937
echo "*** I have the capability to make that library automatically link in when"
1938
echo "*** you link to this library. But I can only do this if you have a"
1939
echo "*** shared version of the library, which you do not appear to have."
2671
$echo "*** Warning: This system can not link to static lib archive $lib."
2672
$echo "*** I have the capability to make that library automatically link in when"
2673
$echo "*** you link to this library. But I can only do this if you have a"
2674
$echo "*** shared version of the library, which you do not appear to have."
1940
2675
if test "$module" = yes; then
1941
echo "*** Therefore, libtool will create a static module, that should work "
1942
echo "*** as long as the dlopening application is linked with the -dlopen flag."
2676
$echo "*** But as you try to build a module library, libtool will still create "
2677
$echo "*** a static module, that should work as long as the dlopening application"
2678
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1943
2679
if test -z "$global_symbol_pipe"; then
1945
echo "*** However, this would only work if libtool was able to extract symbol"
1946
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1947
echo "*** not find such a program. So, this module is probably useless."
1948
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2681
$echo "*** However, this would only work if libtool was able to extract symbol"
2682
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2683
$echo "*** not find such a program. So, this module is probably useless."
2684
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
1950
2686
if test "$build_old_libs" = no; then
1951
build_libtool_libs=module
2687
build_libtool_libs=module
1954
build_libtool_libs=no
2690
build_libtool_libs=no
2016
2755
if grep "^installed=no" $deplib > /dev/null; then
2017
path="-L$absdir/$objdir"
2756
path="$absdir/$objdir"
2019
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2758
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2020
2759
if test -z "$libdir"; then
2021
2760
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2024
2763
if test "$absdir" != "$libdir"; then
2025
2764
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2771
# we do not want to link against static libs,
2772
# but need to link against shared
2773
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2774
if test -n "$deplibrary_names" ; then
2775
for tmp in $deplibrary_names ; do
2778
if test -f "$path/$depdepl" ; then
2779
depdepl="$path/$depdepl"
2781
# do not add paths which are already there
2782
case " $newlib_search_path " in
2784
*) newlib_search_path="$newlib_search_path $path";;
2797
# Again, we only want to link against shared libraries
2798
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2799
for tmp in $newlib_search_path ; do
2800
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2801
eval depdepl="$tmp/lib$tmp_libs.dylib"
2032
2812
case " $deplibs " in
2814
*) deplibs="$depdepl $deplibs" ;;
2816
case " $deplibs " in
2033
2817
*" $path "*) ;;
2034
2818
*) deplibs="$deplibs $path" ;;
2067
2851
eval tmp_libs=\"\$$var\"
2069
2853
for deplib in $tmp_libs; do
2854
# FIXME: Pedantically, this is the right thing to do, so
2855
# that some nasty dependency loop isn't accidentally
2857
#new_libs="$deplib $new_libs"
2858
# Pragmatically, this seems to cause very few problems in
2070
2860
case $deplib in
2071
2861
-L*) new_libs="$deplib $new_libs" ;;
2864
# And here is the reason: when a library appears more
2865
# than once as an explicit dependence of a library, or
2866
# is implicitly linked in more than once by the
2867
# compiler, it is considered special, and multiple
2868
# occurrences thereof are not removed. Compare this
2869
# with having the same library being listed as a
2870
# dependency of multiple other libraries: in this case,
2871
# we know (pedantically, we assume) the library does not
2872
# need to be listed more than once, so we keep only the
2873
# last copy. This is not always right, but it is rare
2874
# enough that we require users that really mean to play
2875
# such unportable linking tricks to link the library
2876
# using -Wl,-lname, so that libtool does not consider it
2877
# for duplicate removal.
2073
2878
case " $specialdeplibs " in
2074
2879
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2207
3029
# Parse the version information argument.
2208
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
3030
save_ifs="$IFS"; IFS=':'
2209
3031
set dummy $vinfo 0 0 0
2210
3032
IFS="$save_ifs"
2212
3034
if test -n "$8"; then
2213
3035
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2214
3036
$echo "$help" 1>&2
3040
# convert absolute version numbers to libtool ages
3041
# this retains compatibility with .la files and attempts
3042
# to make the code below a bit more comprehensible
3044
case $vinfo_number in
3048
number_revision="$4"
3050
# There are really only two kinds -- those that
3051
# use the current revision as the major version
3052
# and those that subtract age and use age as
3053
# a minor version. But, then there is irix
3054
# which has an extra 1 added just for fun
3056
case $version_type in
3057
darwin|linux|osf|windows)
3058
current=`expr $number_major + $number_minor`
3060
revision="$number_revision"
3062
freebsd-aout|freebsd-elf|sunos)
3063
current="$number_major"
3064
revision="$number_minor"
3068
current=`expr $number_major + $number_minor - 1`
3070
revision="$number_minor"
2222
3081
# Check that each of the things are valid numbers.
2223
3082
case $current in
3083
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2226
3085
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2227
3086
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2232
3091
case $revision in
3092
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2235
3094
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2236
3095
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3101
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2244
3103
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2245
3104
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2250
if test $age -gt $current; then
3109
if test "$age" -gt "$current"; then
2251
3110
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2252
3111
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2256
3115
# Calculate the version variables.
2480
3378
int main() { return 0; }
2483
$CC -o conftest conftest.c $deplibs
2484
if test $? -eq 0 ; then
3381
$LTCC -o conftest conftest.c $deplibs
3382
if test "$?" -eq 0 ; then
2485
3383
ldd_output=`ldd conftest`
2486
3384
for i in $deplibs; do
2487
3385
name="`expr $i : '-l\(.*\)'`"
2488
3386
# If $name is empty we are operating on a -L argument.
2489
if test -n "$name" && test "$name" != "0"; then
2490
libname=`eval \\$echo \"$libname_spec\"`
2491
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2492
set dummy $deplib_matches
2494
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2495
newdeplibs="$newdeplibs $i"
2499
echo "*** Warning: This library needs some functionality provided by $i."
2500
echo "*** I have the capability to make that library automatically link in when"
2501
echo "*** you link to this library. But I can only do this if you have a"
2502
echo "*** shared version of the library, which you do not appear to have."
2505
newdeplibs="$newdeplibs $i"
2509
# Error occured in the first compile. Let's try to salvage the situation:
2510
# Compile a seperate program for each library.
2511
for i in $deplibs; do
2512
name="`expr $i : '-l\(.*\)'`"
2513
# If $name is empty we are operating on a -L argument.
2514
if test -n "$name" && test "$name" != "0"; then
2516
$CC -o conftest conftest.c $i
2518
if test $? -eq 0 ; then
2519
ldd_output=`ldd conftest`
3387
if test "$name" != "" && test "$name" -ne "0"; then
3388
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3389
case " $predeps $postdeps " in
3391
newdeplibs="$newdeplibs $i"
3396
if test -n "$i" ; then
2520
3397
libname=`eval \\$echo \"$libname_spec\"`
2521
3398
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2522
3399
set dummy $deplib_matches
2525
3402
newdeplibs="$newdeplibs $i"
2527
3404
droppeddeps=yes
2529
echo "*** Warning: This library needs some functionality provided by $i."
2530
echo "*** I have the capability to make that library automatically link in when"
2531
echo "*** you link to this library. But I can only do this if you have a"
2532
echo "*** shared version of the library, which you do not appear to have."
3406
$echo "*** Warning: dynamic linker does not accept needed library $i."
3407
$echo "*** I have the capability to make that library automatically link in when"
3408
$echo "*** you link to this library. But I can only do this if you have a"
3409
$echo "*** shared version of the library, which I believe you do not have"
3410
$echo "*** because a test_compile did reveal that the linker did not use it for"
3411
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3415
newdeplibs="$newdeplibs $i"
3419
# Error occurred in the first compile. Let's try to salvage
3420
# the situation: Compile a separate program for each library.
3421
for i in $deplibs; do
3422
name="`expr $i : '-l\(.*\)'`"
3423
# If $name is empty we are operating on a -L argument.
3424
if test "$name" != "" && test "$name" != "0"; then
3426
$LTCC -o conftest conftest.c $i
3428
if test "$?" -eq 0 ; then
3429
ldd_output=`ldd conftest`
3430
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3431
case " $predeps $postdeps " in
3433
newdeplibs="$newdeplibs $i"
3438
if test -n "$i" ; then
3439
libname=`eval \\$echo \"$libname_spec\"`
3440
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3441
set dummy $deplib_matches
3443
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3444
newdeplibs="$newdeplibs $i"
3448
$echo "*** Warning: dynamic linker does not accept needed library $i."
3449
$echo "*** I have the capability to make that library automatically link in when"
3450
$echo "*** you link to this library. But I can only do this if you have a"
3451
$echo "*** shared version of the library, which you do not appear to have"
3452
$echo "*** because a test_compile did reveal that the linker did not use this one"
3453
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2535
3457
droppeddeps=yes
2537
echo "*** Warning! Library $i is needed by this library but I was not able to"
2538
echo "*** make it link in! You will probably need to install it or some"
2539
echo "*** library that it depends on before this library will be fully"
2540
echo "*** functional. Installing it before continuing would be even better."
3459
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3460
$echo "*** make it link in! You will probably need to install it or some"
3461
$echo "*** library that it depends on before this library will be fully"
3462
$echo "*** functional. Installing it before continuing would be even better."
2543
3465
newdeplibs="$newdeplibs $i"
2569
3500
potlib="$potent_lib"
2570
3501
while test -h "$potlib" 2>/dev/null; do
2571
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
3502
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2572
3503
case $potliblink in
2573
3504
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2574
3505
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2577
3508
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2579
| egrep "$file_magic_regex" > /dev/null; then
3510
| $EGREP "$file_magic_regex" > /dev/null; then
2580
3511
newdeplibs="$newdeplibs $a_deplib"
2586
3518
if test -n "$a_deplib" ; then
2587
3519
droppeddeps=yes
2589
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2590
echo "*** I have the capability to make that library automatically link in when"
2591
echo "*** you link to this library. But I can only do this if you have a"
2592
echo "*** shared version of the library, which you do not appear to have."
3521
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3522
$echo "*** I have the capability to make that library automatically link in when"
3523
$echo "*** you link to this library. But I can only do this if you have a"
3524
$echo "*** shared version of the library, which you do not appear to have"
3525
$echo "*** because I did check the linker path looking for a file starting"
3526
if test -z "$potlib" ; then
3527
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3529
$echo "*** with $libname and none of the candidates passed a file format test"
3530
$echo "*** using a file magic. Last file checked: $potlib"
2595
3534
# Add a -L argument.
2604
3543
name="`expr $a_deplib : '-l\(.*\)'`"
2605
3544
# If $name is empty we are operating on a -L argument.
2606
3545
if test -n "$name" && test "$name" != "0"; then
2607
libname=`eval \\$echo \"$libname_spec\"`
2608
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2609
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2610
for potent_lib in $potential_libs; do
2611
if eval echo \"$potent_lib\" 2>/dev/null \
2613
| egrep "$match_pattern_regex" > /dev/null; then
2614
newdeplibs="$newdeplibs $a_deplib"
3546
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3547
case " $predeps $postdeps " in
3549
newdeplibs="$newdeplibs $a_deplib"
3554
if test -n "$a_deplib" ; then
3555
libname=`eval \\$echo \"$libname_spec\"`
3556
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3557
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3558
for potent_lib in $potential_libs; do
3559
potlib="$potent_lib" # see symlink-check above in file_magic test
3560
if eval $echo \"$potent_lib\" 2>/dev/null \
3562
| $EGREP "$match_pattern_regex" > /dev/null; then
3563
newdeplibs="$newdeplibs $a_deplib"
2620
3570
if test -n "$a_deplib" ; then
2621
3571
droppeddeps=yes
2623
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2624
echo "*** I have the capability to make that library automatically link in when"
2625
echo "*** you link to this library. But I can only do this if you have a"
2626
echo "*** shared version of the library, which you do not appear to have."
3573
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3574
$echo "*** I have the capability to make that library automatically link in when"
3575
$echo "*** you link to this library. But I can only do this if you have a"
3576
$echo "*** shared version of the library, which you do not appear to have"
3577
$echo "*** because I did check the linker path looking for a file starting"
3578
if test -z "$potlib" ; then
3579
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3581
$echo "*** with $libname and none of the candidates passed a file format test"
3582
$echo "*** using a regex pattern. Last file checked: $potlib"
2629
3586
# Add a -L argument.
2663
3627
if test "$droppeddeps" = yes; then
2664
3628
if test "$module" = yes; then
2666
echo "*** Warning: libtool could not satisfy all declared inter-library"
2667
echo "*** dependencies of module $libname. Therefore, libtool will create"
2668
echo "*** a static module, that should work as long as the dlopening"
2669
echo "*** application is linked with the -dlopen flag."
3630
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3631
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3632
$echo "*** a static module, that should work as long as the dlopening"
3633
$echo "*** application is linked with the -dlopen flag."
2670
3634
if test -z "$global_symbol_pipe"; then
2672
echo "*** However, this would only work if libtool was able to extract symbol"
2673
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2674
echo "*** not find such a program. So, this module is probably useless."
2675
echo "*** \`nm' from GNU binutils and a full rebuild may help."
3636
$echo "*** However, this would only work if libtool was able to extract symbol"
3637
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3638
$echo "*** not find such a program. So, this module is probably useless."
3639
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2677
3641
if test "$build_old_libs" = no; then
2678
3642
oldlibs="$output_objdir/$libname.$libext"
2682
3646
build_libtool_libs=no
2685
echo "*** The inter-library dependencies that have been dropped here will be"
2686
echo "*** automatically added whenever a program is linked with this library"
2687
echo "*** or is declared to -dlopen it."
3649
$echo "*** The inter-library dependencies that have been dropped here will be"
3650
$echo "*** automatically added whenever a program is linked with this library"
3651
$echo "*** or is declared to -dlopen it."
2689
if test $allow_undefined = no; then
2691
echo "*** Since this library must not contain undefined symbols,"
2692
echo "*** because either the platform does not support them or"
2693
echo "*** it was explicitly requested with -no-undefined,"
2694
echo "*** libtool will only create a static version of it."
3653
if test "$allow_undefined" = no; then
3655
$echo "*** Since this library must not contain undefined symbols,"
3656
$echo "*** because either the platform does not support them or"
3657
$echo "*** it was explicitly requested with -no-undefined,"
3658
$echo "*** libtool will only create a static version of it."
2695
3659
if test "$build_old_libs" = no; then
2696
3660
oldlibs="$output_objdir/$libname.$libext"
2697
3661
build_libtool_libs=module
2834
3797
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3801
for test_deplib in $deplibs; do
3802
case " $convenience " in
3803
*" $test_deplib "*) ;;
3805
tmp_deplibs="$tmp_deplibs $test_deplib"
3809
deplibs="$tmp_deplibs"
2837
3811
if test -n "$convenience"; then
2838
3812
if test -n "$whole_archive_flag_spec"; then
3813
save_libobjs=$libobjs
2839
3814
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2841
3816
gentop="$output_objdir/${outputname}x"
2842
$show "${rm}r $gentop"
2843
$run ${rm}r "$gentop"
2844
$show "mkdir $gentop"
2845
$run mkdir "$gentop"
2847
if test $status -ne 0 && test ! -d "$gentop"; then
2850
3817
generated="$generated $gentop"
2852
for xlib in $convenience; do
2853
# Extract the objects.
2855
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2856
*) xabs=`pwd`"/$xlib" ;;
2858
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2859
xdir="$gentop/$xlib"
2861
$show "${rm}r $xdir"
2866
if test $status -ne 0 && test ! -d "$xdir"; then
2869
$show "(cd $xdir && $AR x $xabs)"
2870
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2872
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3819
func_extract_archives $gentop $convenience
3820
libobjs="$libobjs $func_extract_archives_result"
2877
3824
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2878
3825
eval flag=\"$thread_safe_flag_spec\"
2879
3826
linker_flags="$linker_flags $flag"
2887
3834
# Do each of the archive commands.
3835
if test "$module" = yes && test -n "$module_cmds" ; then
3836
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3837
eval test_cmds=\"$module_expsym_cmds\"
3838
cmds=$module_expsym_cmds
3840
eval test_cmds=\"$module_cmds\"
2888
3844
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2889
eval cmds=\"$archive_expsym_cmds\"
2891
eval cmds=\"$archive_cmds\"
2893
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3845
eval test_cmds=\"$archive_expsym_cmds\"
3846
cmds=$archive_expsym_cmds
3848
eval test_cmds=\"$archive_cmds\"
3853
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3854
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3857
# The command line is too long to link in one step, link piecewise.
3858
$echo "creating reloadable object files..."
3860
# Save the value of $output and $libobjs because we want to
3861
# use them later. If we have whole_archive_flag_spec, we
3862
# want to use save_libobjs as it was before
3863
# whole_archive_flag_spec was expanded, because we can't
3864
# assume the linker understands whole_archive_flag_spec.
3865
# This may have to be revisited, in case too many
3866
# convenience libraries get linked in and end up exceeding
3868
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3869
save_libobjs=$libobjs
3873
# Clear the reloadable object creation command queue and
3874
# initialize k to one.
3881
output=$output_objdir/$save_output-${k}.$objext
3882
# Loop over the list of objects to be linked.
3883
for obj in $save_libobjs
3885
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3886
if test "X$objlist" = X ||
3887
{ len=`expr "X$test_cmds" : ".*"` &&
3888
test "$len" -le "$max_cmd_len"; }; then
3889
objlist="$objlist $obj"
3891
# The command $test_cmds is almost too long, add a
3892
# command to the queue.
3893
if test "$k" -eq 1 ; then
3894
# The first file doesn't have a previous command to add.
3895
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3897
# All subsequent reloadable object files will link in
3898
# the last one created.
3899
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3901
last_robj=$output_objdir/$save_output-${k}.$objext
3903
output=$output_objdir/$save_output-${k}.$objext
3908
# Handle the remaining objects by creating one last
3909
# reloadable object file. All subsequent reloadable object
3910
# files will link in the last one created.
3911
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3912
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3914
if ${skipped_export-false}; then
3915
$show "generating symbol list for \`$libname.la'"
3916
export_symbols="$output_objdir/$libname.exp"
3917
$run $rm $export_symbols
3919
# Append the command to create the export file.
3920
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3923
# Set up a command to remove the reloadale object files
3924
# after they are used.
3926
while test "$i" -lt "$k"
3929
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3932
$echo "creating a temporary reloadable object file: $output"
3934
# Loop through the commands generated above and execute them.
3935
save_ifs="$IFS"; IFS='~'
3936
for cmd in $concat_cmds; do
3939
$run eval "$cmd" || exit $?
3944
# Restore the value of output.
3947
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3948
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3950
# Expand the library linking commands again to reset the
3951
# value of $libobjs for piecewise linking.
3953
# Do each of the archive commands.
3954
if test "$module" = yes && test -n "$module_cmds" ; then
3955
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3956
cmds=$module_expsym_cmds
3961
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3962
cmds=$archive_expsym_cmds
3968
# Append the command to remove the reloadable object files
3969
# to the just-reset $cmds.
3970
eval cmds=\"\$cmds~\$rm $delfiles\"
3972
save_ifs="$IFS"; IFS='~'
2894
3973
for cmd in $cmds; do
2895
3974
IFS="$save_ifs"
2897
3977
$run eval "$cmd" || exit $?
3544
4598
# win32 will think the script is a binary if it has
3545
4599
# a .exe suffix, so we strip it off here.
3546
4600
case $output in
3547
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
4601
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3549
4603
# test for cygwin because mv fails w/o .exe extensions
3551
*cygwin*) exeext=.exe ;;
4607
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4611
*cygwin* | *mingw* )
4612
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4613
cwrapper=`$echo ${output}.exe`
4614
$rm $cwrappersource $cwrapper
4615
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4617
cat > $cwrappersource <<EOF
4619
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4620
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4622
The $output program cannot be directly executed until all the libtool
4623
libraries that it depends on are installed.
4625
This wrapper executable should never be moved out of the build directory.
4626
If it is, it will not operate correctly.
4628
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4629
but could eventually absorb all of the scripts functionality and
4630
exec $objdir/$outputname directly.
4633
cat >> $cwrappersource<<"EOF"
4641
#if defined(PATH_MAX)
4642
# define LT_PATHMAX PATH_MAX
4643
#elif defined(MAXPATHLEN)
4644
# define LT_PATHMAX MAXPATHLEN
4646
# define LT_PATHMAX 1024
4649
#ifndef DIR_SEPARATOR
4650
#define DIR_SEPARATOR '/'
4653
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4655
#define HAVE_DOS_BASED_FILE_SYSTEM
4656
#ifndef DIR_SEPARATOR_2
4657
#define DIR_SEPARATOR_2 '\\'
4661
#ifndef DIR_SEPARATOR_2
4662
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4663
#else /* DIR_SEPARATOR_2 */
4664
# define IS_DIR_SEPARATOR(ch) \
4665
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4666
#endif /* DIR_SEPARATOR_2 */
4668
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4669
#define XFREE(stale) do { \
4670
if (stale) { free ((void *) stale); stale = 0; } \
4673
const char *program_name = NULL;
4675
void * xmalloc (size_t num);
4676
char * xstrdup (const char *string);
4677
char * basename (const char *name);
4678
char * fnqualify(const char *path);
4679
char * strendzap(char *str, const char *pat);
4680
void lt_fatal (const char *message, ...);
4683
main (int argc, char *argv[])
4688
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4689
newargz = XMALLOC(char *, argc+2);
4692
cat >> $cwrappersource <<EOF
4693
newargz[0] = "$SHELL";
4696
cat >> $cwrappersource <<"EOF"
4697
newargz[1] = fnqualify(argv[0]);
4698
/* we know the script has the same name, without the .exe */
4699
/* so make sure newargz[1] doesn't end in .exe */
4700
strendzap(newargz[1],".exe");
4701
for (i = 1; i < argc; i++)
4702
newargz[i+1] = xstrdup(argv[i]);
4703
newargz[argc+1] = NULL;
4706
cat >> $cwrappersource <<EOF
4707
execv("$SHELL",newargz);
4710
cat >> $cwrappersource <<"EOF"
4714
xmalloc (size_t num)
4716
void * p = (void *) malloc (num);
4718
lt_fatal ("Memory exhausted");
4724
xstrdup (const char *string)
4726
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4731
basename (const char *name)
4735
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4736
/* Skip over the disk name in MSDOS pathnames. */
4737
if (isalpha (name[0]) && name[1] == ':')
4741
for (base = name; *name; name++)
4742
if (IS_DIR_SEPARATOR (*name))
4744
return (char *) base;
4748
fnqualify(const char *path)
4752
char tmp[LT_PATHMAX + 1];
4754
assert(path != NULL);
4756
/* Is it qualified already? */
4757
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4758
if (isalpha (path[0]) && path[1] == ':')
4759
return xstrdup (path);
4761
if (IS_DIR_SEPARATOR (path[0]))
4762
return xstrdup (path);
4764
/* prepend the current directory */
4765
/* doesn't handle '~' */
4766
if (getcwd (tmp, LT_PATHMAX) == NULL)
4767
lt_fatal ("getcwd failed");
4768
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4769
p = XMALLOC(char, size);
4770
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4775
strendzap(char *str, const char *pat)
4779
assert(str != NULL);
4780
assert(pat != NULL);
4783
patlen = strlen(pat);
4787
str += len - patlen;
4788
if (strcmp(str, pat) == 0)
4795
lt_error_core (int exit_status, const char * mode,
4796
const char * message, va_list ap)
4798
fprintf (stderr, "%s: %s: ", program_name, mode);
4799
vfprintf (stderr, message, ap);
4800
fprintf (stderr, ".\n");
4802
if (exit_status >= 0)
4807
lt_fatal (const char *message, ...)
4810
va_start (ap, message);
4811
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4815
# we should really use a build-platform specific compiler
4816
# here, but OTOH, the wrappers (shell script and this C one)
4817
# are only useful if you want to execute the "real" binary.
4818
# Since the "real" binary is built for $host, then this
4819
# wrapper might as well be built for $host, too.
4820
$run $LTCC -s -o $cwrapper $cwrappersource
3555
trap "$rm $output; exit 1" 1 2 15
4824
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
3557
4826
$echo > $output "\
3754
5012
oldobjs="$libobjs_save"
3755
5013
build_libtool_libs=no
3757
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
5015
oldobjs="$old_deplibs $non_pic_objects"
3759
5017
addlibs="$old_convenience"
3762
5020
if test -n "$addlibs"; then
3763
5021
gentop="$output_objdir/${outputname}x"
3764
$show "${rm}r $gentop"
3765
$run ${rm}r "$gentop"
3766
$show "mkdir $gentop"
3767
$run mkdir "$gentop"
3769
if test $status -ne 0 && test ! -d "$gentop"; then
3772
5022
generated="$generated $gentop"
3774
# Add in members from convenience archives.
3775
for xlib in $addlibs; do
3776
# Extract the objects.
3778
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3779
*) xabs=`pwd`"/$xlib" ;;
3781
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3782
xdir="$gentop/$xlib"
3784
$show "${rm}r $xdir"
3789
if test $status -ne 0 && test ! -d "$xdir"; then
3792
$show "(cd $xdir && $AR x $xabs)"
3793
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3795
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5024
func_extract_archives $gentop $addlibs
5025
oldobjs="$oldobjs $func_extract_archives_result"
3799
5028
# Do each command in the archive commands.
3800
5029
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3801
eval cmds=\"$old_archive_from_new_cmds\"
5030
cmds=$old_archive_from_new_cmds
3803
# Ensure that we have .o objects in place in case we decided
3804
# not to build a shared library, and have fallen back to building
3805
# static libs even though --disable-static was passed!
3806
for oldobj in $oldobjs; do
3807
if test ! -f $oldobj; then
3808
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3809
if test "X$xdir" = "X$oldobj"; then
3814
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3815
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3816
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
3817
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3821
5032
eval cmds=\"$old_archive_cmds\"
5034
if len=`expr "X$cmds" : ".*"` &&
5035
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5036
cmds=$old_archive_cmds
5038
# the command line is too long to link in one step, link in parts
5039
$echo "using piecewise archive linking..."
5044
save_oldobjs=$oldobjs
5045
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
5046
# encoded into archives. This makes 'ar r' malfunction in
5047
# this piecewise linking case whenever conflicting object
5048
# names appear in distinct ar calls; check, warn and compensate.
5049
if (for obj in $save_oldobjs
5051
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5052
done | sort | sort -uc >/dev/null 2>&1); then
5055
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5056
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5059
# Is there a better way of finding the last object in the list?
5060
for obj in $save_oldobjs
5064
for obj in $save_oldobjs
5066
oldobjs="$objlist $obj"
5067
objlist="$objlist $obj"
5068
eval test_cmds=\"$old_archive_cmds\"
5069
if len=`expr "X$test_cmds" : ".*"` &&
5070
test "$len" -le "$max_cmd_len"; then
5073
# the above command should be used before it gets too long
5075
if test "$obj" = "$last_oldobj" ; then
5078
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5079
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5085
if test "X$oldobjs" = "X" ; then
5086
eval cmds=\"\$concat_cmds\"
5088
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
3823
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
5092
save_ifs="$IFS"; IFS='~'
3824
5093
for cmd in $cmds; do
3825
5095
IFS="$save_ifs"
3827
5097
$run eval "$cmd" || exit $?
3896
5170
for lib in $dlprefiles; do
3897
5171
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3898
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5172
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3899
5173
if test -z "$libdir"; then
3900
5174
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3903
5177
newdlprefiles="$newdlprefiles $libdir/$name"
3905
5179
dlprefiles="$newdlprefiles"
5182
for lib in $dlfiles; do
5184
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5185
*) abs=`pwd`"/$lib" ;;
5187
newdlfiles="$newdlfiles $abs"
5189
dlfiles="$newdlfiles"
5191
for lib in $dlprefiles; do
5193
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5194
*) abs=`pwd`"/$lib" ;;
5196
newdlprefiles="$newdlprefiles $abs"
5198
dlprefiles="$newdlprefiles"
3908
5201
# place dlname in correct position for cygwin
3909
5202
tdlname=$dlname
3910
5203
case $host,$output,$installed,$module,$dlname in
3911
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5204
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3913
5206
$echo > $output "\
3914
5207
# $outputname - a libtool library file
4156
5452
if test -n "$relink_command"; then
4157
5453
# Determine the prefix the user has applied to our future dir.
4158
inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
5454
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
4160
5456
# Don't allow the user to place us outside of our expected
4161
5457
# location b/c this prevents finding dependent libraries that
4162
5458
# are installed to the same prefix.
5459
# At present, this check doesn't affect windows .dll's that
5460
# are installed into $libdir/../bin (currently, that works fine)
5461
# but it's something to keep an eye on.
4163
5462
if test "$inst_prefix_dir" = "$destdir"; then
4164
5463
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4168
5467
if test -n "$inst_prefix_dir"; then
4169
5468
# Stick the inst_prefix_dir data into the link command.
4170
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5469
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4172
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
5471
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4175
5474
$echo "$modename: warning: relinking \`$file'" 1>&2
4285
5585
destfile="$destdir/$destfile"
5588
# If the file is missing, and there is a .exe on the end, strip it
5589
# because it is most likely a libtool script we actually want to
5594
if test ! -f "$file"; then
5595
file=`$echo $file|${SED} 's,.exe$,,'`
4288
5601
# Do a test to see if this is really a libtool program.
4289
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5604
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5610
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4290
5611
notinst_deplibs=
4291
5612
relink_command=
5614
# To insure that "foo" is sourced, and not "foo.exe",
5615
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5616
# which disallows the automatic-append-.exe behavior.
5618
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5619
*) wrapperdot=${wrapper} ;;
4293
5621
# If there is no directory component, then add one.
4295
*/* | *\\*) . $file ;;
5623
*/* | *\\*) . ${wrapperdot} ;;
5624
*) . ./${wrapperdot} ;;
4299
5627
# Check the variables that should have been set.
4300
5628
if test -z "$notinst_deplibs"; then
4301
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
5629
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4464
5800
# Exit here if they wanted silent mode.
4465
test "$show" = ":" && exit 0
5801
test "$show" = : && exit $EXIT_SUCCESS
4467
echo "----------------------------------------------------------------------"
4468
echo "Libraries have been installed in:"
5803
$echo "----------------------------------------------------------------------"
5804
$echo "Libraries have been installed in:"
4469
5805
for libdir in $libdirs; do
4473
echo "If you ever happen to want to link against installed libraries"
4474
echo "in a given directory, LIBDIR, you must either use libtool, and"
4475
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4476
echo "flag during linking and do at least one of the following:"
5809
$echo "If you ever happen to want to link against installed libraries"
5810
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5811
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5812
$echo "flag during linking and do at least one of the following:"
4477
5813
if test -n "$shlibpath_var"; then
4478
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4479
echo " during execution"
5814
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5815
$echo " during execution"
4481
5817
if test -n "$runpath_var"; then
4482
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4483
echo " during linking"
5818
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5819
$echo " during linking"
4485
5821
if test -n "$hardcode_libdir_flag_spec"; then
4487
5823
eval flag=\"$hardcode_libdir_flag_spec\"
4489
echo " - use the \`$flag' linker flag"
5825
$echo " - use the \`$flag' linker flag"
4491
5827
if test -n "$admincmds"; then
4492
echo " - have your system administrator run these commands:$admincmds"
5828
$echo " - have your system administrator run these commands:$admincmds"
4494
5830
if test -f /etc/ld.so.conf; then
4495
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5831
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4498
echo "See any operating system documentation about shared libraries for"
4499
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4500
echo "----------------------------------------------------------------------"
5834
$echo "See any operating system documentation about shared libraries for"
5835
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5836
$echo "----------------------------------------------------------------------"
4504
5840
# libtool execute mode
4757
if test "$build_old_libs" = yes; then
4758
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4759
rmfiles="$rmfiles $dir/$oldobj"
6093
# Possibly a libtool object, so verify it.
6094
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6099
# Add PIC object to the list of files to remove.
6100
if test -n "$pic_object" \
6101
&& test "$pic_object" != none; then
6102
rmfiles="$rmfiles $dir/$pic_object"
6105
# Add non-PIC object to the list of files to remove.
6106
if test -n "$non_pic_object" \
6107
&& test "$non_pic_object" != none; then
6108
rmfiles="$rmfiles $dir/$non_pic_object"
4764
# Do a test to see if this is a libtool program.
4765
if test $mode = clean &&
4766
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6114
if test "$mode" = clean ; then
6118
file=`$echo $file|${SED} 's,.exe$,,'`
6119
noexename=`$echo $name|${SED} 's,.exe$,,'`
6120
# $file with .exe has already been added to rmfiles,
6121
# add $file without .exe
6122
rmfiles="$rmfiles $file"
6125
# Do a test to see if this is a libtool program.
6126
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4770
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4771
if test "$fast_install" = yes && test -n "$relink_command"; then
4772
rmfiles="$rmfiles $objdir/lt-$name"
6130
# note $name still contains .exe if it was in $file originally
6131
# as does the version of $file that was added into $rmfiles
6132
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6133
if test "$fast_install" = yes && test -n "$relink_command"; then
6134
rmfiles="$rmfiles $objdir/lt-$name"
6136
if test "X$noexename" != "X$name" ; then
6137
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
4984
6364
$echo "$modename: invalid operation mode \`$mode'" 1>&2
4985
6365
$echo "$help" 1>&2
4991
6371
$echo "Try \`$modename --help' for more information about other modes."
6375
# The TAGs below are defined such that we never get into a situation
6376
# in which we disable both kinds of libraries. Given conflicting
6377
# choices, we go for a static library, that is the most portable,
6378
# since we can't tell whether shared libraries were disabled because
6379
# the user asked for that or because the platform doesn't support
6380
# them. This is particularly important on AIX, because we don't
6381
# support having both static and shared libraries enabled at the same
6382
# time on that platform, so we default to a shared-only configuration.
6383
# If a disable-shared tag is given, we'll fallback to a static-only
6384
# configuration. But we'll never go from static-only to shared-only.
6386
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6387
build_libtool_libs=no
6389
# ### END LIBTOOL TAG CONFIG: disable-shared
6391
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6392
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6393
# ### END LIBTOOL TAG CONFIG: disable-static
4995
6395
# Local Variables:
4996
6396
# mode:shell-script