114
133
lo2o="s/\\.lo\$/.${objext}/"
115
134
o2lo="s/\\.${objext}\$/.lo/"
135
quote_scanset='[[~#^*{};<>?'"'"' ]'
137
#####################################
138
# Shell function definitions:
139
# This seems to be the best place for them
141
# func_win32_libid arg
142
# return the library type of file 'arg'
144
# Need a lot of goo to handle *both* DLLs and import libs
145
# Has to be a shell function in order to 'eat' the argument
146
# that is supplied when $file_magic_command is called.
149
win32_libid_type="unknown"
150
win32_fileres=`file -L $1 2>/dev/null`
151
case $win32_fileres in
152
*ar\ archive\ import\ library*) # definitely import
153
win32_libid_type="x86 archive import"
155
*ar\ archive*) # could be an import, or static
156
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
157
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
158
win32_nmres=`eval $NM -f posix -A $1 | \
159
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
160
if test "X$win32_nmres" = "Ximport" ; then
161
win32_libid_type="x86 archive import"
163
win32_libid_type="x86 archive static"
168
win32_libid_type="x86 DLL"
170
*executable*) # but shell scripts are "executable" too...
171
case $win32_fileres in
172
*MS\ Windows\ PE\ Intel*)
173
win32_libid_type="x86 DLL"
178
$echo $win32_libid_type
183
# Infer tagged configuration to use if any are available and
184
# if one wasn't chosen via the "--tag" command line option.
185
# Only attempt this if the compiler in the base compile
186
# command doesn't match the default compiler.
187
# arg is usually of the form 'gcc ...'
190
if test -n "$available_tags" && test -z "$tagname"; then
194
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
198
CC_quoted="$CC_quoted $arg"
201
# Blanks in the command may have been stripped by the calling shell,
202
# but not from the CC environment variable when configure was run.
203
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
204
# Blanks at the start of $base_compile will cause this to fail
205
# if we don't check for them as well.
207
for z in $available_tags; do
208
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
209
# Evaluate the configuration.
210
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
213
# Double-quote args containing other shell metacharacters.
215
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
219
CC_quoted="$CC_quoted $arg"
222
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
223
# The compiler in the base compile command matches
224
# the one in the tagged configuration.
225
# Assume this is the tagged configuration we want.
232
# If $tagname still isn't set, then no tagged configuration
233
# was found and let the user know that the "--tag" command
234
# line option must be used.
235
if test -z "$tagname"; then
236
$echo "$modename: unable to infer tagged configuration"
237
$echo "$modename: specify a tag with \`--tag'" 1>&2
240
# $echo "$modename: using $tagname tagged configuration"
248
# func_extract_an_archive dir oldlib
249
func_extract_an_archive ()
251
f_ex_an_ar_dir="$1"; shift
252
f_ex_an_ar_oldlib="$1"
253
f_ex_an_ar_lib=`$echo "X$f_ex_an_ar_oldlib" | $Xsed -e 's%^.*/%%'`
255
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
256
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
257
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
260
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
261
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
262
$show "cp $f_ex_an_ar_oldlib $f_ex_an_ar_dir/$f_ex_an_ar_lib"
263
$run eval "cp \$f_ex_an_ar_oldlib \$f_ex_an_ar_dir/\$f_ex_an_ar_lib"
264
$AR t "$f_ex_an_ar_oldlib" | sort | uniq -c \
265
| $EGREP -v '^[ ]*1[ ]' | while read count name
268
while test "$i" -le "$count"
270
# Put our $i before any first dot (extension)
271
# Never overwrite any file
273
while test "X$name_to" = "X$name" || test -f "$f_ex_an_ar_dir/$name_to"
275
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
277
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_lib '$name' && $mv '$name' '$name_to')"
278
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_lib '$name' && $mv '$name' '$name_to' && $AR -d \$f_ex_an_ar_lib '$name')" || exit $?
282
$show "$rm $f_ex_an_ar_dir/$f_ex_an_ar_lib"
283
$run eval "$rm \$f_ex_an_ar_dir/\$f_ex_an_ar_lib"
287
# func_extract_archives gentop oldlib ...
288
func_extract_archives ()
290
my_gentop="$1"; shift
298
$show "${rm}r $my_gentop"
299
$run ${rm}r "$my_gentop"
300
$show "$mkdir $my_gentop"
301
$run $mkdir "$my_gentop"
303
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
307
for my_xlib in $my_oldlibs; do
308
# Extract the objects.
310
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
311
*) my_xabs=`pwd`"/$my_xlib" ;;
313
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
314
my_xdir="$my_gentop/$my_xlib"
316
$show "${rm}r $my_xdir"
317
$run ${rm}r "$my_xdir"
318
$show "$mkdir $my_xdir"
319
$run $mkdir "$my_xdir"
321
if test "$status" -ne 0 && test ! -d "$my_xdir"; then
326
$show "Extracting $my_xabs"
327
# Do not bother doing anything if just a dry run
328
if test -z "$run"; then
329
darwin_orig_dir=`pwd`
330
cd $my_xdir || exit $?
331
darwin_archive=$my_xabs
333
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
334
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
335
if test -n "$darwin_arches"; then
336
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
338
$show "$darwin_base_archive has multiple architectures $darwin_arches"
339
for darwin_arch in $darwin_arches ; do
340
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
341
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
342
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
343
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
345
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
346
done # $darwin_arches
347
## Okay now we have a bunch of thin objects, gotta fatten them up :)
348
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
351
for darwin_file in $darwin_filelist; do
352
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
353
lipo -create -output "$darwin_file" $darwin_files
354
done # $darwin_filelist
356
cd "$darwin_orig_dir"
358
cd "$darwin_orig_dir"
359
func_extract_an_archive "$my_xdir" "$my_xabs"
364
func_extract_an_archive "$my_xdir" "$my_xabs"
367
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
369
func_extract_archives_result="$my_oldobjs"
371
# End of Shell function definitions
372
#####################################
375
eval std_shrext=\"$shrext_cmds\"
117
377
# Parse our command line options once, thoroughly.
378
while test "$#" -gt 0
281
589
modename="$modename: compile"
282
590
# Get the compilation command and the source file.
592
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
295
# Aesthetically quote the previous argument.
297
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
300
# Double-quote args containing other shell metacharacters.
301
# Many Bourne shells cannot handle close brackets correctly
302
# in scan sets, so we specify it separately.
303
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
308
# Add the previous argument to base_compile.
309
if test -z "$base_compile"; then
310
base_compile="$lastarg"
312
base_compile="$base_compile $lastarg"
318
# Accept any command-line options.
321
if test "$user_target" != "no"; then
322
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
349
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
351
save_ifs="$IFS"; IFS=','
355
# Double-quote args containing other shell metacharacters.
356
# Many Bourne shells cannot handle close brackets correctly
357
# in scan sets, so we specify it separately.
359
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
363
lastarg="$lastarg $arg"
366
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
368
# Add the arguments to base_compile.
369
if test -z "$base_compile"; then
370
base_compile="$lastarg"
372
base_compile="$base_compile $lastarg"
380
# The next one is the -o target name
385
# We got the output file
603
# do not "continue". Instead, add this to base_compile
392
# Accept the current argument as the source file.
615
# Accept any command-line options.
618
if test -n "$libobj" ; then
619
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
626
-static | -prefer-pic | -prefer-non-pic)
637
arg_mode=arg # the next one goes into the "base_compile" arg list
638
continue # The current "srcfile" will either be retained or
639
;; # replaced later. I would guess that would be a bug.
642
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
644
save_ifs="$IFS"; IFS=','
648
# Double-quote args containing other shell metacharacters.
649
# Many Bourne shells cannot handle close brackets correctly
650
# in scan sets, so we specify it separately.
652
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
656
lastarg="$lastarg $arg"
659
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
661
# Add the arguments to base_compile.
662
base_compile="$base_compile $lastarg"
667
# Accept the current argument as the source file.
668
# The previous "srcfile" becomes the current argument.
675
esac # case $arg_mode
396
677
# Aesthetically quote the previous argument.
398
# Backslashify any backslashes, double quotes, and dollar signs.
399
# These are the only characters that are still specially
400
# interpreted inside of double-quoted scrings.
401
678
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
403
681
# Double-quote args containing other shell metacharacters.
404
682
# Many Bourne shells cannot handle close brackets correctly
405
# in scan sets, so we specify it separately.
407
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
683
# in scan sets, and some SunOS ksh mistreat backslash-escaping
684
# in scan sets (worked around with variable expansion),
685
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
686
# at all, so we specify them separately.
687
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
408
688
lastarg="\"$lastarg\""
412
# Add the previous argument to base_compile.
413
if test -z "$base_compile"; then
414
base_compile="$lastarg"
416
base_compile="$base_compile $lastarg"
692
base_compile="$base_compile $lastarg"
697
$echo "$modename: you must specify an argument for -Xcompile"
701
$echo "$modename: you must specify a target with \`-o'" 1>&2
424
705
# Get the name of the library object.
425
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
428
$echo "$modename: you must specify a target with \`-o'" 1>&2
706
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
433
710
# Recognize several different file suffixes.
434
711
# If the user specifies -o file.o, it is replaced with file.lo
437
714
*.ada) xform=ada ;;
438
715
*.adb) xform=adb ;;
518
829
$run $rm $removelist
521
echo $srcfile > "$lockfile"
832
$echo $srcfile > "$lockfile"
524
835
if test -n "$fix_srcfile_path"; then
525
836
eval srcfile=\"$fix_srcfile_path\"
839
$run $rm "$libobj" "${libobj}T"
841
# Create a libtool object file (analogous to a ".la" file),
842
# but don't create it if we're doing a dry run.
843
test -z "$run" && cat > ${libobj}T <<EOF
844
# $libobj - a libtool object file
845
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
847
# Please DO NOT delete this file!
848
# It is necessary for linking the library.
850
# Name of the PIC object.
528
853
# Only build a PIC object if we are building libtool libraries.
529
854
if test "$build_libtool_libs" = yes; then
530
855
# Without this assignment, base_compile gets emptied.
531
856
fbsd_hideous_sh_bug=$base_compile
533
858
if test "$pic_mode" != no; then
534
# All platforms use -DPIC, to notify preprocessed assembler code.
535
command="$base_compile $srcfile $pic_flag -DPIC"
859
command="$base_compile $srcfile $pic_flag"
537
861
# Don't build PIC code
538
862
command="$base_compile $srcfile"
540
if test "$build_old_libs" = yes; then
542
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
543
if test "X$dir" = "X$libobj"; then
548
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
550
if test -d "$dir"; then
557
if test $status -ne 0 && test ! -d $dir; then
562
if test "$compiler_o_lo" = yes; then
564
command="$command -o $output_obj"
565
elif test "$compiler_c_o" = yes; then
567
command="$command -o $output_obj"
570
$run $rm "$output_obj"
865
if test ! -d "${xdir}$objdir"; then
866
$show "$mkdir ${xdir}$objdir"
867
$run $mkdir ${xdir}$objdir
869
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
874
if test -z "$output_obj"; then
875
# Place PIC objects in $objdir
876
command="$command -o $lobj"
879
$run $rm "$lobj" "$output_obj"
572
882
if $run eval "$command"; then :
574
884
test -n "$output_obj" && $run $rm $removelist
578
888
if test "$need_locks" = warn &&
579
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
889
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
581
891
*** ERROR, $lockfile contains:
582
892
`cat $lockfile 2>/dev/null`
594
904
$run $rm $removelist
598
908
# Just move the object if needed, then go on to compile the next one
599
if test x"$output_obj" != x"$libobj"; then
600
$show "$mv $output_obj $libobj"
601
if $run $mv $output_obj $libobj; then :
609
# If we have no pic_flag, then copy the object into place and finish.
610
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
611
test "$build_old_libs" = yes; then
612
# Rename the .lo from within objdir to obj
613
if test -f $obj; then
618
$show "$mv $libobj $obj"
619
if $run $mv $libobj $obj; then :
626
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
627
if test "X$xdir" = "X$obj"; then
632
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
633
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
634
# Now arrange that obj and lo_libobj become the same file
635
$show "(cd $xdir && $LN_S $baseobj $libobj)"
636
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
637
# Unlock the critical section if it was locked
638
if test "$need_locks" != no; then
909
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
910
$show "$mv $output_obj $lobj"
911
if $run $mv $output_obj $lobj; then :
919
# Append the name of the PIC object to the libtool object file.
920
test -z "$run" && cat >> ${libobj}T <<EOF
921
pic_object='$objdir/$objname'
649
925
# Allow error messages only from the first compilation.
650
suppress_output=' >/dev/null 2>&1'
926
if test "$suppress_opt" = yes; then
927
suppress_output=' >/dev/null 2>&1'
930
# No PIC object so indicate it doesn't exist in the libtool
932
test -z "$run" && cat >> ${libobj}T <<EOF
653
938
# Only build a position-dependent object if we build old libraries.
1194
inst_prefix_dir="$arg"
1199
precious_files_regex="$arg"
1209
if test -f "$arg"; then
1212
for fil in `cat $save_arg`
1214
# moreargs="$moreargs $fil"
1216
# A libtool-controlled object.
1218
# Check to see that this really is a libtool object.
1219
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1224
# If there is no directory component, then add one.
1226
*/* | *\\*) . $arg ;;
1230
if test -z "$pic_object" || \
1231
test -z "$non_pic_object" ||
1232
test "$pic_object" = none && \
1233
test "$non_pic_object" = none; then
1234
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1238
# Extract subdirectory from the argument.
1239
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1240
if test "X$xdir" = "X$arg"; then
1246
if test "$pic_object" != none; then
1247
# Prepend the subdirectory the object is found in.
1248
pic_object="$xdir$pic_object"
1250
if test "$prev" = dlfiles; then
1251
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1252
dlfiles="$dlfiles $pic_object"
1256
# If libtool objects are unsupported, then we need to preload.
1261
# CHECK ME: I think I busted this. -Ossama
1262
if test "$prev" = dlprefiles; then
1263
# Preload the old-style object.
1264
dlprefiles="$dlprefiles $pic_object"
1269
libobjs="$libobjs $pic_object"
1274
if test "$non_pic_object" != none; then
1275
# Prepend the subdirectory the object is found in.
1276
non_pic_object="$xdir$non_pic_object"
1278
# A standard non-PIC object
1279
non_pic_objects="$non_pic_objects $non_pic_object"
1280
if test -z "$pic_object" || test "$pic_object" = none ; then
1281
arg="$non_pic_object"
1285
# Only an error if not doing a dry-run.
1286
if test -z "$run"; then
1287
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1292
# Extract subdirectory from the argument.
1293
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1294
if test "X$xdir" = "X$arg"; then
1300
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1301
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1302
libobjs="$libobjs $pic_object"
1303
non_pic_objects="$non_pic_objects $non_pic_object"
1308
$echo "$modename: link input file \`$save_arg' does not exist"
907
1316
# We need an absolute path.
909
1318
[\\/]* | [A-Za-z]:[\\/]*) ;;
911
1320
$echo "$modename: only absolute run-paths are allowed" 1>&2
915
1324
if test "$prev" = rpath; then
1054
1492
# These systems don't actually have a C library (as such)
1055
1493
test "X$arg" = "X-lc" && continue
1057
*-*-openbsd* | *-*-freebsd*)
1495
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1058
1496
# Do not include libc due to us having libc/libc_r.
1059
1497
test "X$arg" = "X-lc" && continue
1062
elif test "X$arg" = "X-lc_r"; then
1064
*-*-openbsd* | *-*-freebsd*)
1065
# Do not include libc_r directly, use -pthread flag.
1499
*-*-rhapsody* | *-*-darwin1.[012])
1500
# Rhapsody C and math libraries are in the System framework
1501
deplibs="$deplibs -framework System"
1504
elif test "X$arg" = "X-lc_r"; then
1506
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1507
# Do not include libc_r directly, use -pthread flag.
1070
1512
deplibs="$deplibs $arg"
1516
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1517
# classes, name mangling, and exception handling.
1519
compile_command="$compile_command $arg"
1520
compiler_flags="$compiler_flags $arg"
1521
finalize_command="$finalize_command $arg"
1526
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1527
compiler_flags="$compiler_flags $arg"
1528
compile_command="$compile_command $arg"
1529
finalize_command="$finalize_command $arg"
1538
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1539
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1540
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1541
# +DA*, +DD* enable 64-bit mode on the HP compiler
1542
# -q* pass through compiler args for the IBM compiler
1543
# -m* pass through architecture-specific compiler args for GCC
1544
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1546
# Unknown arguments in both finalize_command and compile_command need
1547
# to be aesthetically quoted because they are evaled later.
1548
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1550
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1554
compile_command="$compile_command $arg"
1555
finalize_command="$finalize_command $arg"
1556
if test "$with_gcc" = "yes" ; then
1557
compiler_flags="$compiler_flags $arg"
1079
1567
-no-fast-install)
1080
1568
fast_install=no
1203
1711
# Some other compiler flag.
1205
1713
# Unknown arguments in both finalize_command and compile_command need
1206
1714
# to be aesthetically quoted because they are evaled later.
1207
1715
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1209
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1717
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1216
# A library or standard object.
1217
if test "$prev" = dlfiles; then
1218
# This file was specified with -dlopen.
1219
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1220
dlfiles="$dlfiles $arg"
1224
# If libtool objects are unsupported, then we need to preload.
1229
if test "$prev" = dlprefiles; then
1230
# Preload the old-style object.
1231
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1724
# A standard object.
1729
# A libtool-controlled object.
1731
# Check to see that this really is a libtool object.
1732
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1737
# If there is no directory component, then add one.
1235
*.lo) libobjs="$libobjs $arg" ;;
1236
*) objs="$objs $arg" ;;
1739
*/* | *\\*) . $arg ;;
1743
if test -z "$pic_object" || \
1744
test -z "$non_pic_object" ||
1745
test "$pic_object" = none && \
1746
test "$non_pic_object" = none; then
1747
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1751
# Extract subdirectory from the argument.
1752
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1753
if test "X$xdir" = "X$arg"; then
1759
if test "$pic_object" != none; then
1760
# Prepend the subdirectory the object is found in.
1761
pic_object="$xdir$pic_object"
1763
if test "$prev" = dlfiles; then
1764
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1765
dlfiles="$dlfiles $pic_object"
1769
# If libtool objects are unsupported, then we need to preload.
1774
# CHECK ME: I think I busted this. -Ossama
1775
if test "$prev" = dlprefiles; then
1776
# Preload the old-style object.
1777
dlprefiles="$dlprefiles $pic_object"
1782
libobjs="$libobjs $pic_object"
1787
if test "$non_pic_object" != none; then
1788
# Prepend the subdirectory the object is found in.
1789
non_pic_object="$xdir$non_pic_object"
1791
# A standard non-PIC object
1792
non_pic_objects="$non_pic_objects $non_pic_object"
1793
if test -z "$pic_object" || test "$pic_object" = none ; then
1794
arg="$non_pic_object"
1798
# Only an error if not doing a dry-run.
1799
if test -z "$run"; then
1800
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1805
# Extract subdirectory from the argument.
1806
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1807
if test "X$xdir" = "X$arg"; then
1813
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1814
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1815
libobjs="$libobjs $pic_object"
1816
non_pic_objects="$non_pic_objects $non_pic_object"
1381
1991
for pass in $passes; do
1382
if test $linkmode = prog; then
1383
# Determine which files to process
1992
if test "$linkmode,$pass" = "lib,link" ||
1993
test "$linkmode,$pass" = "prog,scan"; then
1997
if test "$linkmode" = prog; then
1387
save_deplibs="$deplibs" # Collect dlpreopened libraries
1999
dlopen) libs="$dlfiles" ;;
1390
2000
dlpreopen) libs="$dlprefiles" ;;
1391
2001
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2004
if test "$pass" = dlopen; then
2005
# Collect dlpreopened libraries
2006
save_deplibs="$deplibs"
1394
2009
for deplib in $libs; do
1397
2012
case $deplib in
2013
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2014
if test "$linkmode,$pass" = "prog,link"; then
2015
compile_deplibs="$deplib $compile_deplibs"
2016
finalize_deplibs="$deplib $finalize_deplibs"
2018
compiler_flags="$compiler_flags $deplib"
1399
if test $linkmode = oldlib && test $linkmode = obj; then
1400
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1403
if test $pass = conv; then
1404
deplibs="$deplib $deplibs"
2023
if test "$linkmode" != lib && test "$linkmode" != prog; then
2024
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1407
2027
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1408
2028
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1409
# Search the libtool library
1410
lib="$searchdir/lib${name}.la"
1411
if test -f "$lib"; then
2029
for search_ext in .la $std_shrext .so .a; do
2030
# Search the libtool library
2031
lib="$searchdir/lib${name}${search_ext}"
2032
if test -f "$lib"; then
2033
if test "$search_ext" = ".la"; then
1416
2042
if test "$found" != yes; then
1417
2043
# deplib doesn't seem to be a libtool library
1420
2046
finalize_deplibs="$deplib $finalize_deplibs"
1422
2048
deplibs="$deplib $deplibs"
1423
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
2049
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2052
else # deplib is a libtool library
2053
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2054
# We need to do some special things here, and not later.
2055
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2056
case " $predeps $postdeps " in
2058
if (${SED} -e '2q' $lib |
2059
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2063
*/* | *\\*) . $lib ;;
2066
for l in $old_library $library_names; do
2069
if test "X$ll" = "X$old_library" ; then # only static version available
2071
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2072
test "X$ladir" = "X$lib" && ladir="."
2073
lib=$ladir/$old_library
2074
if test "$linkmode,$pass" = "prog,link"; then
2075
compile_deplibs="$deplib $compile_deplibs"
2076
finalize_deplibs="$deplib $finalize_deplibs"
2078
deplibs="$deplib $deplibs"
2079
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1429
2091
case $linkmode in
1431
2093
deplibs="$deplib $deplibs"
1432
test $pass = conv && continue
2094
test "$pass" = conv && continue
1433
2095
newdependency_libs="$deplib $newdependency_libs"
1434
2096
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1437
if test $pass = conv; then
2099
if test "$pass" = conv; then
1438
2100
deplibs="$deplib $deplibs"
1441
if test $pass = scan; then
2103
if test "$pass" = scan; then
1442
2104
deplibs="$deplib $deplibs"
1443
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1445
2106
compile_deplibs="$deplib $compile_deplibs"
1446
2107
finalize_deplibs="$deplib $finalize_deplibs"
2109
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1450
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
2112
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1452
2114
esac # linkmode
1456
if test $pass = link; then
2118
if test "$pass" = link; then
1457
2119
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1458
2120
# Make sure the xrpath contains only unique directories.
1459
2121
case "$xrpath " in
1467
2129
*.la) lib="$deplib" ;;
1469
if test $pass = conv; then
2131
if test "$pass" = conv; then
1470
2132
deplibs="$deplib $deplibs"
1473
2135
case $linkmode in
1475
if test "$deplibs_check_method" != pass_all; then
1477
echo "*** Warning: Trying to link with static lib archive $deplib."
1478
echo "*** I have the capability to make that library automatically link in when"
1479
echo "*** you link to this library. But I can only do this if you have a"
1480
echo "*** shared version of the library, which you do not appear to have"
1481
echo "*** because the file extensions .$libext of this argument makes me believe"
1482
echo "*** that it is just a static archive that I should not used here."
2138
case $deplibs_check_method in
2140
set dummy $deplibs_check_method
2141
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2142
if eval $echo \"$deplib\" 2>/dev/null \
2144
| $EGREP "$match_pattern_regex" > /dev/null; then
2152
if test "$valid_a_lib" != yes; then
2154
$echo "*** Warning: Trying to link with static lib archive $deplib."
2155
$echo "*** I have the capability to make that library automatically link in when"
2156
$echo "*** you link to this library. But I can only do this if you have a"
2157
$echo "*** shared version of the library, which you do not appear to have"
2158
$echo "*** because the file extensions .$libext of this argument makes me believe"
2159
$echo "*** that it is just a static archive that I should not used here."
1485
echo "*** Warning: Linking the shared library $output against the"
1486
echo "*** static library $deplib is not portable!"
2162
$echo "*** Warning: Linking the shared library $output against the"
2163
$echo "*** static library $deplib is not portable!"
1487
2164
deplibs="$deplib $deplibs"
1492
if test $pass != link; then
2169
if test "$pass" != link; then
1493
2170
deplibs="$deplib $deplibs"
1495
2172
compile_deplibs="$deplib $compile_deplibs"
1708
2405
fi # $linkmode = prog...
2407
if test "$linkmode,$pass" = "prog,link"; then
2408
if test -n "$library_names" &&
2409
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2410
# We need to hardcode the library path
2411
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2412
# Make sure the rpath contains only unique directories.
2413
case "$temp_rpath " in
2416
*) temp_rpath="$temp_rpath $dir" ;;
2420
# Hardcode the library path.
2421
# Skip directories that are in the system default run-time
2423
case " $sys_lib_dlsearch_path " in
2426
case "$compile_rpath " in
2428
*) compile_rpath="$compile_rpath $absdir"
2432
case " $sys_lib_dlsearch_path " in
2435
case "$finalize_rpath " in
2437
*) finalize_rpath="$finalize_rpath $libdir"
2441
fi # $linkmode,$pass = prog,link...
2443
if test "$alldeplibs" = yes &&
2444
{ test "$deplibs_check_method" = pass_all ||
2445
{ test "$build_libtool_libs" = yes &&
2446
test -n "$library_names"; }; }; then
2447
# We only need to search for static libraries
1710
2452
link_static=no # Whether the deplib will be linked statically
1711
2453
if test -n "$library_names" &&
1712
2454
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1713
# Link against this shared library
1715
if test "$linkmode,$pass" = "prog,link" ||
1716
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1717
# Hardcode the library path.
1718
# Skip directories that are in the system default run-time
1720
case " $sys_lib_dlsearch_path " in
1723
case "$compile_rpath " in
1725
*) compile_rpath="$compile_rpath $absdir"
1729
case " $sys_lib_dlsearch_path " in
1732
case "$finalize_rpath " in
1734
*) finalize_rpath="$finalize_rpath $libdir"
1738
if test $linkmode = prog; then
1739
# We need to hardcode the library path
1740
if test -n "$shlibpath_var"; then
1741
# Make sure the rpath contains only unique directories.
1742
case "$temp_rpath " in
1745
*) temp_rpath="$temp_rpath $dir" ;;
1749
fi # $linkmode,$pass = prog,link...
1751
if test "$alldeplibs" = yes &&
1752
{ test "$deplibs_check_method" = pass_all ||
1753
{ test "$build_libtool_libs" = yes &&
1754
test -n "$library_names"; }; }; then
1755
# We only need to search for static libraries
1759
2455
if test "$installed" = no; then
1760
2456
notinst_deplibs="$notinst_deplibs $lib"
1761
2457
need_relink=yes
2459
# This is a shared library
2461
# Warn about portability, can't link against -module's on
2462
# some systems (darwin)
2463
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2465
if test "$linkmode" = prog; then
2466
$echo "*** Warning: Linking the executable $output against the loadable module"
2468
$echo "*** Warning: Linking the shared library $output against the loadable module"
2470
$echo "*** $linklib is not portable!"
2472
if test "$linkmode" = lib &&
2473
test "$hardcode_into_libs" = yes; then
2474
# Hardcode the library path.
2475
# Skip directories that are in the system default run-time
2477
case " $sys_lib_dlsearch_path " in
2480
case "$compile_rpath " in
2482
*) compile_rpath="$compile_rpath $absdir"
2486
case " $sys_lib_dlsearch_path " in
2489
case "$finalize_rpath " in
2491
*) finalize_rpath="$finalize_rpath $libdir"
1764
2497
if test -n "$old_archive_from_expsyms_cmds"; then
1765
2498
# figure out the soname
1945
2710
# Just print a warning and add the library to dependency_libs so
1946
2711
# that the program can be linked against the static library.
1948
echo "*** Warning: This system can not link to static lib archive $lib."
1949
echo "*** I have the capability to make that library automatically link in when"
1950
echo "*** you link to this library. But I can only do this if you have a"
1951
echo "*** shared version of the library, which you do not appear to have."
2713
$echo "*** Warning: This system can not link to static lib archive $lib."
2714
$echo "*** I have the capability to make that library automatically link in when"
2715
$echo "*** you link to this library. But I can only do this if you have a"
2716
$echo "*** shared version of the library, which you do not appear to have."
1952
2717
if test "$module" = yes; then
1953
echo "*** But as you try to build a module library, libtool will still create "
1954
echo "*** a static module, that should work as long as the dlopening application"
1955
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2718
$echo "*** But as you try to build a module library, libtool will still create "
2719
$echo "*** a static module, that should work as long as the dlopening application"
2720
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1956
2721
if test -z "$global_symbol_pipe"; then
1958
echo "*** However, this would only work if libtool was able to extract symbol"
1959
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1960
echo "*** not find such a program. So, this module is probably useless."
1961
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2723
$echo "*** However, this would only work if libtool was able to extract symbol"
2724
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2725
$echo "*** not find such a program. So, this module is probably useless."
2726
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
1963
2728
if test "$build_old_libs" = no; then
1964
2729
build_libtool_libs=module
2031
2797
if grep "^installed=no" $deplib > /dev/null; then
2032
path="-L$absdir/$objdir"
2798
path="$absdir/$objdir"
2034
2800
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2035
2801
if test -z "$libdir"; then
2036
2802
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2039
2805
if test "$absdir" != "$libdir"; then
2040
2806
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2813
# we do not want to link against static libs,
2814
# but need to link against shared
2815
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2816
if test -n "$deplibrary_names" ; then
2817
for tmp in $deplibrary_names ; do
2820
if test -f "$path/$depdepl" ; then
2821
depdepl="$path/$depdepl"
2823
# do not add paths which are already there
2824
case " $newlib_search_path " in
2826
*) newlib_search_path="$newlib_search_path $path";;
2839
# Again, we only want to link against shared libraries
2840
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2841
for tmp in $newlib_search_path ; do
2842
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2843
eval depdepl="$tmp/lib$tmp_libs.dylib"
2047
2854
case " $deplibs " in
2856
*) deplibs="$depdepl $deplibs" ;;
2858
case " $deplibs " in
2048
2859
*" $path "*) ;;
2049
2860
*) deplibs="$deplibs $path" ;;
2082
2893
eval tmp_libs=\"\$$var\"
2084
2895
for deplib in $tmp_libs; do
2896
# FIXME: Pedantically, this is the right thing to do, so
2897
# that some nasty dependency loop isn't accidentally
2899
#new_libs="$deplib $new_libs"
2900
# Pragmatically, this seems to cause very few problems in
2085
2902
case $deplib in
2086
2903
-L*) new_libs="$deplib $new_libs" ;;
2906
# And here is the reason: when a library appears more
2907
# than once as an explicit dependence of a library, or
2908
# is implicitly linked in more than once by the
2909
# compiler, it is considered special, and multiple
2910
# occurrences thereof are not removed. Compare this
2911
# with having the same library being listed as a
2912
# dependency of multiple other libraries: in this case,
2913
# we know (pedantically, we assume) the library does not
2914
# need to be listed more than once, so we keep only the
2915
# last copy. This is not always right, but it is rare
2916
# enough that we require users that really mean to play
2917
# such unportable linking tricks to link the library
2918
# using -Wl,-lname, so that libtool does not consider it
2919
# for duplicate removal.
2088
2920
case " $specialdeplibs " in
2089
2921
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2227
3076
if test -n "$8"; then
2228
3077
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2229
3078
$echo "$help" 1>&2
3082
# convert absolute version numbers to libtool ages
3083
# this retains compatibility with .la files and attempts
3084
# to make the code below a bit more comprehensible
3086
case $vinfo_number in
3090
number_revision="$4"
3092
# There are really only two kinds -- those that
3093
# use the current revision as the major version
3094
# and those that subtract age and use age as
3095
# a minor version. But, then there is irix
3096
# which has an extra 1 added just for fun
3098
case $version_type in
3099
darwin|linux|osf|windows)
3100
current=`expr $number_major + $number_minor`
3102
revision="$number_revision"
3104
freebsd-aout|freebsd-elf|sunos)
3105
current="$number_major"
3106
revision="$number_minor"
3110
current=`expr $number_major + $number_minor - 1`
3112
revision="$number_minor"
2237
3123
# Check that each of the things are valid numbers.
2238
3124
case $current in
2239
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3125
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2241
3127
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2242
3128
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2247
3133
case $revision in
2248
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3134
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2250
3136
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2251
3137
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2257
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3143
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2259
3145
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2260
3146
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2265
if test $age -gt $current; then
3151
if test "$age" -gt "$current"; then
2266
3152
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2267
3153
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2271
3157
# Calculate the version variables.
2513
3420
int main() { return 0; }
2516
$CC -o conftest conftest.c $deplibs
2517
if test $? -eq 0 ; then
3423
$LTCC -o conftest conftest.c $deplibs
3424
if test "$?" -eq 0 ; then
2518
3425
ldd_output=`ldd conftest`
2519
3426
for i in $deplibs; do
2520
3427
name="`expr $i : '-l\(.*\)'`"
2521
3428
# If $name is empty we are operating on a -L argument.
2522
if test -n "$name" && test "$name" != "0"; then
2523
libname=`eval \\$echo \"$libname_spec\"`
2524
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2525
set dummy $deplib_matches
2527
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2528
newdeplibs="$newdeplibs $i"
2532
echo "*** Warning: dynamic linker does not accept needed library $i."
2533
echo "*** I have the capability to make that library automatically link in when"
2534
echo "*** you link to this library. But I can only do this if you have a"
2535
echo "*** shared version of the library, which I believe you do not have"
2536
echo "*** because a test_compile did reveal that the linker did not use it for"
2537
echo "*** its dynamic dependency list that programs get resolved with at runtime."
2540
newdeplibs="$newdeplibs $i"
2544
# Error occured in the first compile. Let's try to salvage
2545
# the situation: Compile a separate program for each library.
2546
for i in $deplibs; do
2547
name="`expr $i : '-l\(.*\)'`"
2548
# If $name is empty we are operating on a -L argument.
2549
if test -n "$name" && test "$name" != "0"; then
2551
$CC -o conftest conftest.c $i
2553
if test $? -eq 0 ; then
2554
ldd_output=`ldd conftest`
3429
if test "$name" != "" && test "$name" -ne "0"; then
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
2555
3439
libname=`eval \\$echo \"$libname_spec\"`
2556
3440
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2557
3441
set dummy $deplib_matches
2560
3444
newdeplibs="$newdeplibs $i"
2562
3446
droppeddeps=yes
2564
echo "*** Warning: dynamic linker does not accept needed library $i."
2565
echo "*** I have the capability to make that library automatically link in when"
2566
echo "*** you link to this library. But I can only do this if you have a"
2567
echo "*** shared version of the library, which you do not appear to have"
2568
echo "*** because a test_compile did reveal that the linker did not use this one"
2569
echo "*** as a dynamic dependency that programs can get resolved with at runtime."
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 I believe you do not have"
3452
$echo "*** because a test_compile did reveal that the linker did not use it for"
3453
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3457
newdeplibs="$newdeplibs $i"
3461
# Error occurred in the first compile. Let's try to salvage
3462
# the situation: Compile a separate program for each library.
3463
for i in $deplibs; do
3464
name="`expr $i : '-l\(.*\)'`"
3465
# If $name is empty we are operating on a -L argument.
3466
if test "$name" != "" && test "$name" != "0"; then
3468
$LTCC -o conftest conftest.c $i
3470
if test "$?" -eq 0 ; then
3471
ldd_output=`ldd conftest`
3472
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3473
case " $predeps $postdeps " in
3475
newdeplibs="$newdeplibs $i"
3480
if test -n "$i" ; then
3481
libname=`eval \\$echo \"$libname_spec\"`
3482
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3483
set dummy $deplib_matches
3485
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3486
newdeplibs="$newdeplibs $i"
3490
$echo "*** Warning: dynamic linker does not accept needed library $i."
3491
$echo "*** I have the capability to make that library automatically link in when"
3492
$echo "*** you link to this library. But I can only do this if you have a"
3493
$echo "*** shared version of the library, which you do not appear to have"
3494
$echo "*** because a test_compile did reveal that the linker did not use this one"
3495
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2572
3499
droppeddeps=yes
2574
echo "*** Warning! Library $i is needed by this library but I was not able to"
2575
echo "*** make it link in! You will probably need to install it or some"
2576
echo "*** library that it depends on before this library will be fully"
2577
echo "*** functional. Installing it before continuing would be even better."
3501
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3502
$echo "*** make it link in! You will probably need to install it or some"
3503
$echo "*** library that it depends on before this library will be fully"
3504
$echo "*** functional. Installing it before continuing would be even better."
2580
3507
newdeplibs="$newdeplibs $i"
2614
3550
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2616
| egrep "$file_magic_regex" > /dev/null; then
3552
| $EGREP "$file_magic_regex" > /dev/null; then
2617
3553
newdeplibs="$newdeplibs $a_deplib"
2623
3560
if test -n "$a_deplib" ; then
2624
3561
droppeddeps=yes
2626
echo "*** Warning: linker path does not have real file for library $a_deplib."
2627
echo "*** I have the capability to make that library automatically link in when"
2628
echo "*** you link to this library. But I can only do this if you have a"
2629
echo "*** shared version of the library, which you do not appear to have"
2630
echo "*** because I did check the linker path looking for a file starting"
3563
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3564
$echo "*** I have the capability to make that library automatically link in when"
3565
$echo "*** you link to this library. But I can only do this if you have a"
3566
$echo "*** shared version of the library, which you do not appear to have"
3567
$echo "*** because I did check the linker path looking for a file starting"
2631
3568
if test -z "$potlib" ; then
2632
echo "*** with $libname but no candidates were found. (...for file magic test)"
3569
$echo "*** with $libname but no candidates were found. (...for file magic test)"
2634
echo "*** with $libname and none of the candidates passed a file format test"
2635
echo "*** using a file magic. Last file checked: $potlib"
3571
$echo "*** with $libname and none of the candidates passed a file format test"
3572
$echo "*** using a file magic. Last file checked: $potlib"
2648
3585
name="`expr $a_deplib : '-l\(.*\)'`"
2649
3586
# If $name is empty we are operating on a -L argument.
2650
3587
if test -n "$name" && test "$name" != "0"; then
2651
libname=`eval \\$echo \"$libname_spec\"`
2652
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2653
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2654
for potent_lib in $potential_libs; do
2655
potlib="$potent_lib" # see symlink-check below in file_magic test
2656
if eval echo \"$potent_lib\" 2>/dev/null \
2658
| egrep "$match_pattern_regex" > /dev/null; then
2659
newdeplibs="$newdeplibs $a_deplib"
3588
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3589
case " $predeps $postdeps " in
3591
newdeplibs="$newdeplibs $a_deplib"
3596
if test -n "$a_deplib" ; then
3597
libname=`eval \\$echo \"$libname_spec\"`
3598
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3599
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3600
for potent_lib in $potential_libs; do
3601
potlib="$potent_lib" # see symlink-check above in file_magic test
3602
if eval $echo \"$potent_lib\" 2>/dev/null \
3604
| $EGREP "$match_pattern_regex" > /dev/null; then
3605
newdeplibs="$newdeplibs $a_deplib"
2665
3612
if test -n "$a_deplib" ; then
2666
3613
droppeddeps=yes
2668
echo "*** Warning: linker path does not have real file for library $a_deplib."
2669
echo "*** I have the capability to make that library automatically link in when"
2670
echo "*** you link to this library. But I can only do this if you have a"
2671
echo "*** shared version of the library, which you do not appear to have"
2672
echo "*** because I did check the linker path looking for a file starting"
3615
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3616
$echo "*** I have the capability to make that library automatically link in when"
3617
$echo "*** you link to this library. But I can only do this if you have a"
3618
$echo "*** shared version of the library, which you do not appear to have"
3619
$echo "*** because I did check the linker path looking for a file starting"
2673
3620
if test -z "$potlib" ; then
2674
echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3621
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2676
echo "*** with $libname and none of the candidates passed a file format test"
2677
echo "*** using a regex pattern. Last file checked: $potlib"
3623
$echo "*** with $libname and none of the candidates passed a file format test"
3624
$echo "*** using a regex pattern. Last file checked: $potlib"
2715
3669
if test "$droppeddeps" = yes; then
2716
3670
if test "$module" = yes; then
2718
echo "*** Warning: libtool could not satisfy all declared inter-library"
2719
echo "*** dependencies of module $libname. Therefore, libtool will create"
2720
echo "*** a static module, that should work as long as the dlopening"
2721
echo "*** application is linked with the -dlopen flag."
3672
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3673
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3674
$echo "*** a static module, that should work as long as the dlopening"
3675
$echo "*** application is linked with the -dlopen flag."
2722
3676
if test -z "$global_symbol_pipe"; then
2724
echo "*** However, this would only work if libtool was able to extract symbol"
2725
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2726
echo "*** not find such a program. So, this module is probably useless."
2727
echo "*** \`nm' from GNU binutils and a full rebuild may help."
3678
$echo "*** However, this would only work if libtool was able to extract symbol"
3679
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3680
$echo "*** not find such a program. So, this module is probably useless."
3681
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2729
3683
if test "$build_old_libs" = no; then
2730
3684
oldlibs="$output_objdir/$libname.$libext"
2734
3688
build_libtool_libs=no
2737
echo "*** The inter-library dependencies that have been dropped here will be"
2738
echo "*** automatically added whenever a program is linked with this library"
2739
echo "*** or is declared to -dlopen it."
3691
$echo "*** The inter-library dependencies that have been dropped here will be"
3692
$echo "*** automatically added whenever a program is linked with this library"
3693
$echo "*** or is declared to -dlopen it."
2741
if test $allow_undefined = no; then
2743
echo "*** Since this library must not contain undefined symbols,"
2744
echo "*** because either the platform does not support them or"
2745
echo "*** it was explicitly requested with -no-undefined,"
2746
echo "*** libtool will only create a static version of it."
3695
if test "$allow_undefined" = no; then
3697
$echo "*** Since this library must not contain undefined symbols,"
3698
$echo "*** because either the platform does not support them or"
3699
$echo "*** it was explicitly requested with -no-undefined,"
3700
$echo "*** libtool will only create a static version of it."
2747
3701
if test "$build_old_libs" = no; then
2748
3702
oldlibs="$output_objdir/$libname.$libext"
2749
3703
build_libtool_libs=module
2939
3876
# Do each of the archive commands.
3877
if test "$module" = yes && test -n "$module_cmds" ; then
3878
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3879
eval test_cmds=\"$module_expsym_cmds\"
3880
cmds=$module_expsym_cmds
3882
eval test_cmds=\"$module_cmds\"
2940
3886
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2941
eval cmds=\"$archive_expsym_cmds\"
2943
save_deplibs="$deplibs"
2944
for conv in $convenience; do
2946
for test_deplib in $deplibs; do
2947
if test "$test_deplib" != "$conv"; then
2948
tmp_deplibs="$tmp_deplibs $test_deplib"
3887
eval test_cmds=\"$archive_expsym_cmds\"
3888
cmds=$archive_expsym_cmds
3890
eval test_cmds=\"$archive_cmds\"
3895
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3896
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3899
# The command line is too long to link in one step, link piecewise.
3900
$echo "creating reloadable object files..."
3902
# Save the value of $output and $libobjs because we want to
3903
# use them later. If we have whole_archive_flag_spec, we
3904
# want to use save_libobjs as it was before
3905
# whole_archive_flag_spec was expanded, because we can't
3906
# assume the linker understands whole_archive_flag_spec.
3907
# This may have to be revisited, in case too many
3908
# convenience libraries get linked in and end up exceeding
3910
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3911
save_libobjs=$libobjs
3914
output_la=`$echo "X$output" | $Xsed -e "$basename"`
3916
# Clear the reloadable object creation command queue and
3917
# initialize k to one.
3924
output=$output_objdir/$output_la-${k}.$objext
3925
# Loop over the list of objects to be linked.
3926
for obj in $save_libobjs
3928
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3929
if test "X$objlist" = X ||
3930
{ len=`expr "X$test_cmds" : ".*"` &&
3931
test "$len" -le "$max_cmd_len"; }; then
3932
objlist="$objlist $obj"
3934
# The command $test_cmds is almost too long, add a
3935
# command to the queue.
3936
if test "$k" -eq 1 ; then
3937
# The first file doesn't have a previous command to add.
3938
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3940
# All subsequent reloadable object files will link in
3941
# the last one created.
3942
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
2951
deplibs="$tmp_deplibs"
2953
eval cmds=\"$archive_cmds\"
2954
deplibs="$save_deplibs"
3944
last_robj=$output_objdir/$output_la-${k}.$objext
3946
output=$output_objdir/$output_la-${k}.$objext
3951
# Handle the remaining objects by creating one last
3952
# reloadable object file. All subsequent reloadable object
3953
# files will link in the last one created.
3954
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3955
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3957
if ${skipped_export-false}; then
3958
$show "generating symbol list for \`$libname.la'"
3959
export_symbols="$output_objdir/$libname.exp"
3960
$run $rm $export_symbols
3962
# Append the command to create the export file.
3963
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3966
# Set up a command to remove the reloadable object files
3967
# after they are used.
3969
while test "$i" -lt "$k"
3972
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3975
$echo "creating a temporary reloadable object file: $output"
3977
# Loop through the commands generated above and execute them.
3978
save_ifs="$IFS"; IFS='~'
3979
for cmd in $concat_cmds; do
3982
$run eval "$cmd" || exit $?
3987
# Restore the value of output.
3990
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3991
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3993
# Expand the library linking commands again to reset the
3994
# value of $libobjs for piecewise linking.
3996
# Do each of the archive commands.
3997
if test "$module" = yes && test -n "$module_cmds" ; then
3998
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3999
cmds=$module_expsym_cmds
4004
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4005
cmds=$archive_expsym_cmds
4011
# Append the command to remove the reloadable object files
4012
# to the just-reset $cmds.
4013
eval cmds=\"\$cmds~\$rm $delfiles\"
2956
4015
save_ifs="$IFS"; IFS='~'
2957
4016
for cmd in $cmds; do
2958
4017
IFS="$save_ifs"
2960
4020
$run eval "$cmd" || exit $?
3334
4357
if test -n "$exclude_expsyms"; then
3335
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4358
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3336
4359
$run eval '$mv "$nlist"T "$nlist"'
3339
4362
if test -n "$export_symbols_regex"; then
3340
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4363
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3341
4364
$run eval '$mv "$nlist"T "$nlist"'
3344
4367
# Prepare the list of exported symbols
3345
4368
if test -z "$export_symbols"; then
3346
export_symbols="$output_objdir/$output.exp"
4369
export_symbols="$output_objdir/$outputname.exp"
3347
4370
$run $rm $export_symbols
3348
4371
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3350
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3351
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4373
$run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4374
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3352
4375
$run eval 'mv "$nlist"T "$nlist"'
3356
4379
for arg in $dlprefiles; do
3357
4380
$show "extracting global C symbols from \`$arg'"
3358
name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
3359
$run eval 'echo ": $name " >> "$nlist"'
4381
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4382
$run eval '$echo ": $name " >> "$nlist"'
3360
4383
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3618
4660
# win32 will think the script is a binary if it has
3619
4661
# a .exe suffix, so we strip it off here.
3620
4662
case $output in
3621
*.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
4663
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3623
4665
# test for cygwin because mv fails w/o .exe extensions
3625
*cygwin*) exeext=.exe ;;
4669
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4673
*cygwin* | *mingw* )
4674
cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4675
cwrapper=`$echo ${output}.exe`
4676
$rm $cwrappersource $cwrapper
4677
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4679
cat > $cwrappersource <<EOF
4681
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4682
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4684
The $output program cannot be directly executed until all the libtool
4685
libraries that it depends on are installed.
4687
This wrapper executable should never be moved out of the build directory.
4688
If it is, it will not operate correctly.
4690
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4691
but could eventually absorb all of the scripts functionality and
4692
exec $objdir/$outputname directly.
4695
cat >> $cwrappersource<<"EOF"
4703
#if defined(PATH_MAX)
4704
# define LT_PATHMAX PATH_MAX
4705
#elif defined(MAXPATHLEN)
4706
# define LT_PATHMAX MAXPATHLEN
4708
# define LT_PATHMAX 1024
4711
#ifndef DIR_SEPARATOR
4712
#define DIR_SEPARATOR '/'
4715
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4717
#define HAVE_DOS_BASED_FILE_SYSTEM
4718
#ifndef DIR_SEPARATOR_2
4719
#define DIR_SEPARATOR_2 '\\'
4723
#ifndef DIR_SEPARATOR_2
4724
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4725
#else /* DIR_SEPARATOR_2 */
4726
# define IS_DIR_SEPARATOR(ch) \
4727
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4728
#endif /* DIR_SEPARATOR_2 */
4730
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4731
#define XFREE(stale) do { \
4732
if (stale) { free ((void *) stale); stale = 0; } \
4735
const char *program_name = NULL;
4737
void * xmalloc (size_t num);
4738
char * xstrdup (const char *string);
4739
char * basename (const char *name);
4740
char * fnqualify(const char *path);
4741
char * strendzap(char *str, const char *pat);
4742
void lt_fatal (const char *message, ...);
4745
main (int argc, char *argv[])
4750
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4751
newargz = XMALLOC(char *, argc+2);
4754
cat >> $cwrappersource <<EOF
4755
newargz[0] = "$SHELL";
4758
cat >> $cwrappersource <<"EOF"
4759
newargz[1] = fnqualify(argv[0]);
4760
/* we know the script has the same name, without the .exe */
4761
/* so make sure newargz[1] doesn't end in .exe */
4762
strendzap(newargz[1],".exe");
4763
for (i = 1; i < argc; i++)
4764
newargz[i+1] = xstrdup(argv[i]);
4765
newargz[argc+1] = NULL;
4768
cat >> $cwrappersource <<EOF
4769
execv("$SHELL",newargz);
4772
cat >> $cwrappersource <<"EOF"
4776
xmalloc (size_t num)
4778
void * p = (void *) malloc (num);
4780
lt_fatal ("Memory exhausted");
4786
xstrdup (const char *string)
4788
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4793
basename (const char *name)
4797
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4798
/* Skip over the disk name in MSDOS pathnames. */
4799
if (isalpha (name[0]) && name[1] == ':')
4803
for (base = name; *name; name++)
4804
if (IS_DIR_SEPARATOR (*name))
4806
return (char *) base;
4810
fnqualify(const char *path)
4814
char tmp[LT_PATHMAX + 1];
4816
assert(path != NULL);
4818
/* Is it qualified already? */
4819
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4820
if (isalpha (path[0]) && path[1] == ':')
4821
return xstrdup (path);
4823
if (IS_DIR_SEPARATOR (path[0]))
4824
return xstrdup (path);
4826
/* prepend the current directory */
4827
/* doesn't handle '~' */
4828
if (getcwd (tmp, LT_PATHMAX) == NULL)
4829
lt_fatal ("getcwd failed");
4830
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4831
p = XMALLOC(char, size);
4832
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4837
strendzap(char *str, const char *pat)
4841
assert(str != NULL);
4842
assert(pat != NULL);
4845
patlen = strlen(pat);
4849
str += len - patlen;
4850
if (strcmp(str, pat) == 0)
4857
lt_error_core (int exit_status, const char * mode,
4858
const char * message, va_list ap)
4860
fprintf (stderr, "%s: %s: ", program_name, mode);
4861
vfprintf (stderr, message, ap);
4862
fprintf (stderr, ".\n");
4864
if (exit_status >= 0)
4869
lt_fatal (const char *message, ...)
4872
va_start (ap, message);
4873
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4877
# we should really use a build-platform specific compiler
4878
# here, but OTOH, the wrappers (shell script and this C one)
4879
# are only useful if you want to execute the "real" binary.
4880
# Since the "real" binary is built for $host, then this
4881
# wrapper might as well be built for $host, too.
4882
$run $LTCC -s -o $cwrapper $cwrappersource
3629
trap "$rm $output; exit 1" 1 2 15
4886
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
3631
4888
$echo > $output "\
3829
5074
oldobjs="$libobjs_save"
3830
5075
build_libtool_libs=no
3832
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
5077
oldobjs="$old_deplibs $non_pic_objects"
3834
5079
addlibs="$old_convenience"
3837
5082
if test -n "$addlibs"; then
3838
5083
gentop="$output_objdir/${outputname}x"
3839
$show "${rm}r $gentop"
3840
$run ${rm}r "$gentop"
3841
$show "mkdir $gentop"
3842
$run mkdir "$gentop"
3844
if test $status -ne 0 && test ! -d "$gentop"; then
3847
5084
generated="$generated $gentop"
3849
# Add in members from convenience archives.
3850
for xlib in $addlibs; do
3851
# Extract the objects.
3853
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3854
*) xabs=`pwd`"/$xlib" ;;
3856
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3857
xdir="$gentop/$xlib"
3859
$show "${rm}r $xdir"
3864
if test $status -ne 0 && test ! -d "$xdir"; then
3867
$show "(cd $xdir && $AR x $xabs)"
3868
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3870
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5086
func_extract_archives $gentop $addlibs
5087
oldobjs="$oldobjs $func_extract_archives_result"
3874
5090
# Do each command in the archive commands.
3875
5091
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3876
eval cmds=\"$old_archive_from_new_cmds\"
5092
cmds=$old_archive_from_new_cmds
3878
# Ensure that we have .o objects in place in case we decided
3879
# not to build a shared library, and have fallen back to building
3880
# static libs even though --disable-static was passed!
3881
for oldobj in $oldobjs; do
3882
if test ! -f $oldobj; then
3883
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3884
if test "X$xdir" = "X$oldobj"; then
3889
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3890
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3891
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
3892
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3896
5094
eval cmds=\"$old_archive_cmds\"
5096
if len=`expr "X$cmds" : ".*"` &&
5097
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5098
cmds=$old_archive_cmds
5100
# the command line is too long to link in one step, link in parts
5101
$echo "using piecewise archive linking..."
5106
save_oldobjs=$oldobjs
5107
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
5108
# encoded into archives. This makes 'ar r' malfunction in
5109
# this piecewise linking case whenever conflicting object
5110
# names appear in distinct ar calls; check, warn and compensate.
5111
if (for obj in $save_oldobjs
5113
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5114
done | sort | sort -uc >/dev/null 2>&1); then
5117
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5118
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5121
# Is there a better way of finding the last object in the list?
5122
for obj in $save_oldobjs
5126
for obj in $save_oldobjs
5128
oldobjs="$objlist $obj"
5129
objlist="$objlist $obj"
5130
eval test_cmds=\"$old_archive_cmds\"
5131
if len=`expr "X$test_cmds" : ".*"` &&
5132
test "$len" -le "$max_cmd_len"; then
5135
# the above command should be used before it gets too long
5137
if test "$obj" = "$last_oldobj" ; then
5140
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5141
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5147
if test "X$oldobjs" = "X" ; then
5148
eval cmds=\"\$concat_cmds\"
5150
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
3898
5154
save_ifs="$IFS"; IFS='~'
3899
5155
for cmd in $cmds; do
3900
5157
IFS="$save_ifs"
3902
5159
$run eval "$cmd" || exit $?
3973
5234
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3974
5235
if test -z "$libdir"; then
3975
5236
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3978
5239
newdlprefiles="$newdlprefiles $libdir/$name"
3980
5241
dlprefiles="$newdlprefiles"
5244
for lib in $dlfiles; do
5246
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5247
*) abs=`pwd`"/$lib" ;;
5249
newdlfiles="$newdlfiles $abs"
5251
dlfiles="$newdlfiles"
5253
for lib in $dlprefiles; do
5255
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5256
*) abs=`pwd`"/$lib" ;;
5258
newdlprefiles="$newdlprefiles $abs"
5260
dlprefiles="$newdlprefiles"
3983
5263
# place dlname in correct position for cygwin
3984
5264
tdlname=$dlname
3985
5265
case $host,$output,$installed,$module,$dlname in
3986
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5266
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3988
5268
$echo > $output "\
3989
5269
# $outputname - a libtool library file
4342
5647
destfile="$destdir/$destfile"
5650
# If the file is missing, and there is a .exe on the end, strip it
5651
# because it is most likely a libtool script we actually want to
5656
if test ! -f "$file"; then
5657
file=`$echo $file|${SED} 's,.exe$,,'`
4345
5663
# Do a test to see if this is really a libtool program.
4347
5665
*cygwin*|*mingw*)
4348
wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
5666
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
4354
if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5672
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4355
5673
notinst_deplibs=
4356
5674
relink_command=
5676
# To insure that "foo" is sourced, and not "foo.exe",
5677
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5678
# which disallows the automatic-append-.exe behavior.
5680
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5681
*) wrapperdot=${wrapper} ;;
4358
5683
# If there is no directory component, then add one.
4360
*/* | *\\*) . $wrapper ;;
5685
*/* | *\\*) . ${wrapperdot} ;;
5686
*) . ./${wrapperdot} ;;
4364
5689
# Check the variables that should have been set.
4365
5690
if test -z "$notinst_deplibs"; then
4366
5691
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4524
5862
# Exit here if they wanted silent mode.
4525
test "$show" = ":" && exit 0
5863
test "$show" = : && exit $EXIT_SUCCESS
4527
echo "----------------------------------------------------------------------"
4528
echo "Libraries have been installed in:"
5865
$echo "----------------------------------------------------------------------"
5866
$echo "Libraries have been installed in:"
4529
5867
for libdir in $libdirs; do
4533
echo "If you ever happen to want to link against installed libraries"
4534
echo "in a given directory, LIBDIR, you must either use libtool, and"
4535
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4536
echo "flag during linking and do at least one of the following:"
5871
$echo "If you ever happen to want to link against installed libraries"
5872
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5873
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5874
$echo "flag during linking and do at least one of the following:"
4537
5875
if test -n "$shlibpath_var"; then
4538
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4539
echo " during execution"
5876
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5877
$echo " during execution"
4541
5879
if test -n "$runpath_var"; then
4542
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4543
echo " during linking"
5880
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5881
$echo " during linking"
4545
5883
if test -n "$hardcode_libdir_flag_spec"; then
4547
5885
eval flag=\"$hardcode_libdir_flag_spec\"
4549
echo " - use the \`$flag' linker flag"
5887
$echo " - use the \`$flag' linker flag"
4551
5889
if test -n "$admincmds"; then
4552
echo " - have your system administrator run these commands:$admincmds"
5890
$echo " - have your system administrator run these commands:$admincmds"
4554
5892
if test -f /etc/ld.so.conf; then
4555
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5893
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4558
echo "See any operating system documentation about shared libraries for"
4559
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4560
echo "----------------------------------------------------------------------"
5896
$echo "See any operating system documentation about shared libraries for"
5897
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5898
$echo "----------------------------------------------------------------------"
4564
5902
# libtool execute mode
4814
if test "$build_old_libs" = yes; then
4815
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4816
rmfiles="$rmfiles $dir/$oldobj"
6155
# Possibly a libtool object, so verify it.
6156
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6161
# Add PIC object to the list of files to remove.
6162
if test -n "$pic_object" \
6163
&& test "$pic_object" != none; then
6164
rmfiles="$rmfiles $dir/$pic_object"
6167
# Add non-PIC object to the list of files to remove.
6168
if test -n "$non_pic_object" \
6169
&& test "$non_pic_object" != none; then
6170
rmfiles="$rmfiles $dir/$non_pic_object"
4821
# Do a test to see if this is a libtool program.
4822
if test $mode = clean &&
4823
(${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6176
if test "$mode" = clean ; then
6180
file=`$echo $file|${SED} 's,.exe$,,'`
6181
noexename=`$echo $name|${SED} 's,.exe$,,'`
6182
# $file with .exe has already been added to rmfiles,
6183
# add $file without .exe
6184
rmfiles="$rmfiles $file"
6187
# Do a test to see if this is a libtool program.
6188
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4827
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4828
if test "$fast_install" = yes && test -n "$relink_command"; then
4829
rmfiles="$rmfiles $objdir/lt-$name"
6192
# note $name still contains .exe if it was in $file originally
6193
# as does the version of $file that was added into $rmfiles
6194
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6195
if test "$fast_install" = yes && test -n "$relink_command"; then
6196
rmfiles="$rmfiles $objdir/lt-$name"
6198
if test "X$noexename" != "X$name" ; then
6199
rmfiles="$rmfiles $objdir/lt-${noexename}.c"