18
18
# You should have received a copy of the GNU General Public License
19
19
# along with this program; if not, write to the Free Software
20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
22
# As a special exception to the GNU General Public License, if you
23
23
# distribute this file as part of a program that contains a
24
24
# configuration script generated by Autoconf, you may include it under
25
25
# the same distribution terms that you use for the rest of that program.
29
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30
# is ksh but when the shell is invoked as "sh" and the current value of
31
# the _XPG environment variable is not equal to 1 (one), the special
32
# positional parameter $0, within a function call, is the name of the
36
# The name of this program:
37
progname=`echo "$progpath" | $SED $basename`
47
TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)"
49
# See if we are running on zsh, and set the options which allow our
50
# commands through without removal of \ escapes.
51
if test -n "${ZSH_VERSION+set}" ; then
27
55
# Check that we have a working $echo.
28
56
if test "X$1" = X--no-reexec; then
29
57
# Discard the --no-reexec flag, and continue.
105
134
lo2o="s/\\.lo\$/.${objext}/"
106
135
o2lo="s/\\.${objext}\$/.lo/"
136
quote_scanset='[[~#^*{};<>?'"'"' ]'
138
#####################################
139
# Shell function definitions:
140
# This seems to be the best place for them
142
# func_win32_libid arg
143
# return the library type of file 'arg'
145
# Need a lot of goo to handle *both* DLLs and import libs
146
# Has to be a shell function in order to 'eat' the argument
147
# that is supplied when $file_magic_command is called.
150
win32_libid_type="unknown"
151
win32_fileres=`file -L $1 2>/dev/null`
152
case $win32_fileres in
153
*ar\ archive\ import\ library*) # definitely import
154
win32_libid_type="x86 archive import"
156
*ar\ archive*) # could be an import, or static
157
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
158
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
159
win32_nmres=`eval $NM -f posix -A $1 | \
160
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
161
if test "X$win32_nmres" = "Ximport" ; then
162
win32_libid_type="x86 archive import"
164
win32_libid_type="x86 archive static"
169
win32_libid_type="x86 DLL"
171
*executable*) # but shell scripts are "executable" too...
172
case $win32_fileres in
173
*MS\ Windows\ PE\ Intel*)
174
win32_libid_type="x86 DLL"
179
$echo $win32_libid_type
184
# Infer tagged configuration to use if any are available and
185
# if one wasn't chosen via the "--tag" command line option.
186
# Only attempt this if the compiler in the base compile
187
# command doesn't match the default compiler.
188
# arg is usually of the form 'gcc ...'
191
if test -n "$available_tags" && test -z "$tagname"; then
195
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
199
CC_quoted="$CC_quoted $arg"
202
# Blanks in the command may have been stripped by the calling shell,
203
# but not from the CC environment variable when configure was run.
204
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
205
# Blanks at the start of $base_compile will cause this to fail
206
# if we don't check for them as well.
208
for z in $available_tags; do
209
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
210
# Evaluate the configuration.
211
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
214
# Double-quote args containing other shell metacharacters.
216
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
220
CC_quoted="$CC_quoted $arg"
223
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
224
# The compiler in the base compile command matches
225
# the one in the tagged configuration.
226
# Assume this is the tagged configuration we want.
233
# If $tagname still isn't set, then no tagged configuration
234
# was found and let the user know that the "--tag" command
235
# line option must be used.
236
if test -z "$tagname"; then
237
$echo "$modename: unable to infer tagged configuration"
238
$echo "$modename: specify a tag with \`--tag'" 1>&2
241
# $echo "$modename: using $tagname tagged configuration"
249
# func_extract_an_archive dir oldlib
250
func_extract_an_archive ()
252
f_ex_an_ar_dir="$1"; shift
253
f_ex_an_ar_oldlib="$1"
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: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
265
# func_extract_archives gentop oldlib ...
266
func_extract_archives ()
268
my_gentop="$1"; shift
276
$show "${rm}r $my_gentop"
277
$run ${rm}r "$my_gentop"
278
$show "$mkdir $my_gentop"
279
$run $mkdir "$my_gentop"
281
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
285
for my_xlib in $my_oldlibs; do
286
# Extract the objects.
288
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
289
*) my_xabs=`pwd`"/$my_xlib" ;;
291
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
292
my_xdir="$my_gentop/$my_xlib"
294
$show "${rm}r $my_xdir"
295
$run ${rm}r "$my_xdir"
296
$show "$mkdir $my_xdir"
297
$run $mkdir "$my_xdir"
299
if test "$status" -ne 0 && test ! -d "$my_xdir"; then
304
$show "Extracting $my_xabs"
305
# Do not bother doing anything if just a dry run
306
if test -z "$run"; then
307
darwin_orig_dir=`pwd`
308
cd $my_xdir || exit $?
309
darwin_archive=$my_xabs
311
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
312
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
313
if test -n "$darwin_arches"; then
314
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
316
$show "$darwin_base_archive has multiple architectures $darwin_arches"
317
for darwin_arch in $darwin_arches ; do
318
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
319
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
320
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
321
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
323
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
324
done # $darwin_arches
325
## Okay now we have a bunch of thin objects, gotta fatten them up :)
326
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
329
for darwin_file in $darwin_filelist; do
330
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
331
lipo -create -output "$darwin_file" $darwin_files
332
done # $darwin_filelist
334
cd "$darwin_orig_dir"
336
cd "$darwin_orig_dir"
337
func_extract_an_archive "$my_xdir" "$my_xabs"
342
func_extract_an_archive "$my_xdir" "$my_xabs"
345
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
347
func_extract_archives_result="$my_oldobjs"
349
# End of Shell function definitions
350
#####################################
353
eval std_shrext=\"$shrext_cmds\"
108
355
# Parse our command line options once, thoroughly.
356
while test "$#" -gt 0
272
567
modename="$modename: compile"
273
568
# Get the compilation command and the source file.
570
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
286
# Aesthetically quote the previous argument.
288
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
291
# Double-quote args containing other shell metacharacters.
292
# Many Bourne shells cannot handle close brackets correctly
293
# in scan sets, so we specify it separately.
294
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
299
# Add the previous argument to base_compile.
300
if test -z "$base_compile"; then
301
base_compile="$lastarg"
303
base_compile="$base_compile $lastarg"
309
# Accept any command-line options.
312
if test "$user_target" != "no"; then
313
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
340
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
342
save_ifs="$IFS"; IFS=','
346
# Double-quote args containing other shell metacharacters.
347
# Many Bourne shells cannot handle close brackets correctly
348
# in scan sets, so we specify it separately.
350
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
354
lastarg="$lastarg $arg"
357
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
359
# Add the arguments to base_compile.
360
if test -z "$base_compile"; then
361
base_compile="$lastarg"
363
base_compile="$base_compile $lastarg"
371
# The next one is the -o target name
376
# We got the output file
581
# do not "continue". Instead, add this to base_compile
383
# Accept the current argument as the source file.
593
# Accept any command-line options.
596
if test -n "$libobj" ; then
597
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
604
-static | -prefer-pic | -prefer-non-pic)
615
arg_mode=arg # the next one goes into the "base_compile" arg list
616
continue # The current "srcfile" will either be retained or
617
;; # replaced later. I would guess that would be a bug.
620
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
622
save_ifs="$IFS"; IFS=','
626
# Double-quote args containing other shell metacharacters.
627
# Many Bourne shells cannot handle close brackets correctly
628
# in scan sets, so we specify it separately.
630
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
634
lastarg="$lastarg $arg"
637
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
639
# Add the arguments to base_compile.
640
base_compile="$base_compile $lastarg"
645
# Accept the current argument as the source file.
646
# The previous "srcfile" becomes the current argument.
653
esac # case $arg_mode
387
655
# Aesthetically quote the previous argument.
389
# Backslashify any backslashes, double quotes, and dollar signs.
390
# These are the only characters that are still specially
391
# interpreted inside of double-quoted scrings.
392
656
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
394
659
# Double-quote args containing other shell metacharacters.
395
660
# Many Bourne shells cannot handle close brackets correctly
396
# in scan sets, so we specify it separately.
398
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
661
# in scan sets, and some SunOS ksh mistreat backslash-escaping
662
# in scan sets (worked around with variable expansion),
663
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
664
# at all, so we specify them separately.
665
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
399
666
lastarg="\"$lastarg\""
403
# Add the previous argument to base_compile.
404
if test -z "$base_compile"; then
405
base_compile="$lastarg"
407
base_compile="$base_compile $lastarg"
670
base_compile="$base_compile $lastarg"
675
$echo "$modename: you must specify an argument for -Xcompile"
679
$echo "$modename: you must specify a target with \`-o'" 1>&2
415
683
# Get the name of the library object.
416
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
419
$echo "$modename: you must specify a target with \`-o'" 1>&2
684
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
424
688
# Recognize several different file suffixes.
425
689
# If the user specifies -o file.o, it is replaced with file.lo
428
692
*.ada) xform=ada ;;
429
693
*.adb) xform=adb ;;
443
710
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
445
712
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
717
func_infer_tag $base_compile
719
for arg in $later; do
738
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
740
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
741
qlibobj="\"$qlibobj\"" ;;
743
if test "X$libobj" != "X$qlibobj"; then
744
$echo "$modename: libobj name \`$libobj' may not contain shell special characters."
747
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
748
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
749
if test "X$xdir" = "X$obj"; then
754
lobj=${xdir}$objdir/$objname
450
756
if test -z "$base_compile"; then
451
757
$echo "$modename: you must specify a compilation command" 1>&2
452
758
$echo "$help" 1>&2
456
762
# Delete any leftover library objects.
457
763
if test "$build_old_libs" = yes; then
458
removelist="$obj $libobj"
764
removelist="$obj $lobj $libobj ${libobj}T"
766
removelist="$lobj $libobj ${libobj}T"
463
769
$run $rm $removelist
464
trap "$run $rm $removelist; exit 1" 1 2 15
770
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
466
772
# On Cygwin there's no "real" PIC flag so we must build both object types
522
848
fbsd_hideous_sh_bug=$base_compile
524
850
if test "$pic_mode" != no; then
525
# All platforms use -DPIC, to notify preprocessed assembler code.
526
command="$base_compile $srcfile $pic_flag -DPIC"
851
command="$base_compile $qsrcfile $pic_flag"
528
853
# Don't build PIC code
529
command="$base_compile $srcfile"
531
if test "$build_old_libs" = yes; then
533
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
534
if test "X$dir" = "X$libobj"; then
539
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
541
if test -d "$dir"; then
548
if test $status -ne 0 && test ! -d $dir; then
553
if test "$compiler_o_lo" = yes; then
555
command="$command -o $output_obj"
556
elif test "$compiler_c_o" = yes; then
558
command="$command -o $output_obj"
561
$run $rm "$output_obj"
854
command="$base_compile $qsrcfile"
857
if test ! -d "${xdir}$objdir"; then
858
$show "$mkdir ${xdir}$objdir"
859
$run $mkdir ${xdir}$objdir
861
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
866
if test -z "$output_obj"; then
867
# Place PIC objects in $objdir
868
command="$command -o $lobj"
871
$run $rm "$lobj" "$output_obj"
563
874
if $run eval "$command"; then :
565
876
test -n "$output_obj" && $run $rm $removelist
569
880
if test "$need_locks" = warn &&
570
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
881
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
572
883
*** ERROR, $lockfile contains:
573
884
`cat $lockfile 2>/dev/null`
585
896
$run $rm $removelist
589
900
# Just move the object if needed, then go on to compile the next one
590
if test x"$output_obj" != x"$libobj"; then
591
$show "$mv $output_obj $libobj"
592
if $run $mv $output_obj $libobj; then :
600
# If we have no pic_flag, then copy the object into place and finish.
601
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
602
test "$build_old_libs" = yes; then
603
# Rename the .lo from within objdir to obj
604
if test -f $obj; then
609
$show "$mv $libobj $obj"
610
if $run $mv $libobj $obj; then :
617
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
618
if test "X$xdir" = "X$obj"; then
623
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
624
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
625
# Now arrange that obj and lo_libobj become the same file
626
$show "(cd $xdir && $LN_S $baseobj $libobj)"
627
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
628
# Unlock the critical section if it was locked
629
if test "$need_locks" != no; then
901
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
902
$show "$mv $output_obj $lobj"
903
if $run $mv $output_obj $lobj; then :
911
# Append the name of the PIC object to the libtool object file.
912
test -z "$run" && cat >> ${libobj}T <<EOF
913
pic_object='$objdir/$objname'
640
917
# Allow error messages only from the first compilation.
641
suppress_output=' >/dev/null 2>&1'
918
if test "$suppress_opt" = yes; then
919
suppress_output=' >/dev/null 2>&1'
922
# No PIC object so indicate it doesn't exist in the libtool
924
test -z "$run" && cat >> ${libobj}T <<EOF
644
930
# Only build a position-dependent object if we build old libraries.
645
931
if test "$build_old_libs" = yes; then
646
932
if test "$pic_mode" != yes; then
647
933
# Don't build PIC code
648
command="$base_compile $srcfile"
934
command="$base_compile $qsrcfile"
650
# All platforms use -DPIC, to notify preprocessed assembler code.
651
command="$base_compile $srcfile $pic_flag -DPIC"
936
command="$base_compile $qsrcfile $pic_flag"
653
938
if test "$compiler_c_o" = yes; then
654
939
command="$command -o $obj"
658
942
# Suppress compiler output if we already did a PIC compilation.
659
943
command="$command$suppress_output"
660
$run $rm "$output_obj"
944
$run $rm "$obj" "$output_obj"
662
946
if $run eval "$command"; then :
664
948
$run $rm $removelist
668
952
if test "$need_locks" = warn &&
669
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
953
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
671
955
*** ERROR, $lockfile contains:
672
956
`cat $lockfile 2>/dev/null`
699
# Create an invalid libtool object if no PIC, so that we do not
700
# accidentally link it into a program.
701
if test "$build_libtool_libs" != yes; then
702
$show "echo timestamp > $libobj"
703
$run eval "echo timestamp > \$libobj" || exit $?
705
# Move the .lo from within objdir
706
$show "$mv $libobj $lo_libobj"
707
if $run $mv $libobj $lo_libobj; then :
983
# Append the name of the non-PIC object the libtool object file.
984
# Only append if the libtool object file exists.
985
test -z "$run" && cat >> ${libobj}T <<EOF
986
# Name of the non-PIC object.
987
non_pic_object='$objname'
991
# Append the name of the non-PIC object the libtool object file.
992
# Only append if the libtool object file exists.
993
test -z "$run" && cat >> ${libobj}T <<EOF
994
# Name of the non-PIC object.
1000
$run $mv "${libobj}T" "${libobj}"
716
1002
# Unlock the critical section if it was locked
717
1003
if test "$need_locks" != no; then
718
1004
$run $rm "$lockfile"
724
1010
# libtool link mode
894
1186
inst_prefix_dir="$arg"
1191
precious_files_regex="$arg"
1201
if test -f "$arg"; then
1204
for fil in `cat $save_arg`
1206
# moreargs="$moreargs $fil"
1208
# A libtool-controlled object.
1210
# Check to see that this really is a libtool object.
1211
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1216
# If there is no directory component, then add one.
1218
*/* | *\\*) . $arg ;;
1222
if test -z "$pic_object" || \
1223
test -z "$non_pic_object" ||
1224
test "$pic_object" = none && \
1225
test "$non_pic_object" = none; then
1226
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1230
# Extract subdirectory from the argument.
1231
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1232
if test "X$xdir" = "X$arg"; then
1238
if test "$pic_object" != none; then
1239
# Prepend the subdirectory the object is found in.
1240
pic_object="$xdir$pic_object"
1242
if test "$prev" = dlfiles; then
1243
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1244
dlfiles="$dlfiles $pic_object"
1248
# If libtool objects are unsupported, then we need to preload.
1253
# CHECK ME: I think I busted this. -Ossama
1254
if test "$prev" = dlprefiles; then
1255
# Preload the old-style object.
1256
dlprefiles="$dlprefiles $pic_object"
1261
libobjs="$libobjs $pic_object"
1266
if test "$non_pic_object" != none; then
1267
# Prepend the subdirectory the object is found in.
1268
non_pic_object="$xdir$non_pic_object"
1270
# A standard non-PIC object
1271
non_pic_objects="$non_pic_objects $non_pic_object"
1272
if test -z "$pic_object" || test "$pic_object" = none ; then
1273
arg="$non_pic_object"
1277
# Only an error if not doing a dry-run.
1278
if test -z "$run"; then
1279
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1284
# Extract subdirectory from the argument.
1285
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1286
if test "X$xdir" = "X$arg"; then
1292
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1293
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1294
libobjs="$libobjs $pic_object"
1295
non_pic_objects="$non_pic_objects $non_pic_object"
1300
$echo "$modename: link input file \`$save_arg' does not exist"
904
1308
# We need an absolute path.
906
1310
[\\/]* | [A-Za-z]:[\\/]*) ;;
908
1312
$echo "$modename: only absolute run-paths are allowed" 1>&2
912
1316
if test "$prev" = rpath; then
1056
1488
# These systems don't actually have a C library (as such)
1057
1489
test "X$arg" = "X-lc" && continue
1491
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1060
1492
# Do not include libc due to us having libc/libc_r.
1061
1493
test "X$arg" = "X-lc" && continue
1064
elif test "X$arg" = "X-lc_r"; then
1067
# Do not include libc_r directly, use -pthread flag.
1495
*-*-rhapsody* | *-*-darwin1.[012])
1496
# Rhapsody C and math libraries are in the System framework
1497
deplibs="$deplibs -framework System"
1500
elif test "X$arg" = "X-lc_r"; then
1502
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1503
# Do not include libc_r directly, use -pthread flag.
1072
1508
deplibs="$deplibs $arg"
1512
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1513
# classes, name mangling, and exception handling.
1515
compile_command="$compile_command $arg"
1516
compiler_flags="$compiler_flags $arg"
1517
finalize_command="$finalize_command $arg"
1522
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1523
compiler_flags="$compiler_flags $arg"
1524
compile_command="$compile_command $arg"
1525
finalize_command="$finalize_command $arg"
1534
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1535
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1536
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1537
# +DA*, +DD* enable 64-bit mode on the HP compiler
1538
# -q* pass through compiler args for the IBM compiler
1539
# -m* pass through architecture-specific compiler args for GCC
1540
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1542
# Unknown arguments in both finalize_command and compile_command need
1543
# to be aesthetically quoted because they are evaled later.
1544
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1546
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1550
compile_command="$compile_command $arg"
1551
finalize_command="$finalize_command $arg"
1552
if test "$with_gcc" = "yes" ; then
1553
compiler_flags="$compiler_flags $arg"
1081
1563
-no-fast-install)
1082
1564
fast_install=no
1205
1707
# Some other compiler flag.
1207
1709
# Unknown arguments in both finalize_command and compile_command need
1208
1710
# to be aesthetically quoted because they are evaled later.
1209
1711
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1211
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1713
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1218
# A library or standard object.
1219
if test "$prev" = dlfiles; then
1220
# This file was specified with -dlopen.
1221
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1222
dlfiles="$dlfiles $arg"
1226
# If libtool objects are unsupported, then we need to preload.
1231
if test "$prev" = dlprefiles; then
1232
# Preload the old-style object.
1233
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1720
# A standard object.
1725
# A libtool-controlled object.
1727
# Check to see that this really is a libtool object.
1728
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1733
# If there is no directory component, then add one.
1237
*.lo) libobjs="$libobjs $arg" ;;
1238
*) objs="$objs $arg" ;;
1735
*/* | *\\*) . $arg ;;
1739
if test -z "$pic_object" || \
1740
test -z "$non_pic_object" ||
1741
test "$pic_object" = none && \
1742
test "$non_pic_object" = none; then
1743
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1747
# Extract subdirectory from the argument.
1748
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1749
if test "X$xdir" = "X$arg"; then
1755
if test "$pic_object" != none; then
1756
# Prepend the subdirectory the object is found in.
1757
pic_object="$xdir$pic_object"
1759
if test "$prev" = dlfiles; then
1760
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1761
dlfiles="$dlfiles $pic_object"
1765
# If libtool objects are unsupported, then we need to preload.
1770
# CHECK ME: I think I busted this. -Ossama
1771
if test "$prev" = dlprefiles; then
1772
# Preload the old-style object.
1773
dlprefiles="$dlprefiles $pic_object"
1778
libobjs="$libobjs $pic_object"
1783
if test "$non_pic_object" != none; then
1784
# Prepend the subdirectory the object is found in.
1785
non_pic_object="$xdir$non_pic_object"
1787
# A standard non-PIC object
1788
non_pic_objects="$non_pic_objects $non_pic_object"
1789
if test -z "$pic_object" || test "$pic_object" = none ; then
1790
arg="$non_pic_object"
1794
# Only an error if not doing a dry-run.
1795
if test -z "$run"; then
1796
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1801
# Extract subdirectory from the argument.
1802
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1803
if test "X$xdir" = "X$arg"; then
1809
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1810
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1811
libobjs="$libobjs $pic_object"
1812
non_pic_objects="$non_pic_objects $non_pic_object"
1402
1987
for pass in $passes; do
1988
if test "$linkmode,$pass" = "lib,link" ||
1989
test "$linkmode,$pass" = "prog,scan"; then
1403
1993
if test "$linkmode" = prog; then
1404
# Determine which files to process
1408
save_deplibs="$deplibs" # Collect dlpreopened libraries
1995
dlopen) libs="$dlfiles" ;;
1411
1996
dlpreopen) libs="$dlprefiles" ;;
1412
1997
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2000
if test "$pass" = dlopen; then
2001
# Collect dlpreopened libraries
2002
save_deplibs="$deplibs"
1415
2005
for deplib in $libs; do
1418
2008
case $deplib in
2009
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2010
if test "$linkmode,$pass" = "prog,link"; then
2011
compile_deplibs="$deplib $compile_deplibs"
2012
finalize_deplibs="$deplib $finalize_deplibs"
2014
compiler_flags="$compiler_flags $deplib"
1420
if test "$linkmode" = oldlib && test "$linkmode" = obj; then
1421
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1424
if test "$pass" = conv; then
1425
deplibs="$deplib $deplibs"
2019
if test "$linkmode" != lib && test "$linkmode" != prog; then
2020
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1428
2023
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1429
2024
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1430
# Search the libtool library
1431
lib="$searchdir/lib${name}.la"
1432
if test -f "$lib"; then
2025
for search_ext in .la $std_shrext .so .a; do
2026
# Search the libtool library
2027
lib="$searchdir/lib${name}${search_ext}"
2028
if test -f "$lib"; then
2029
if test "$search_ext" = ".la"; then
1437
2038
if test "$found" != yes; then
1438
2039
# deplib doesn't seem to be a libtool library
1444
2045
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2048
else # deplib is a libtool library
2049
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2050
# We need to do some special things here, and not later.
2051
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2052
case " $predeps $postdeps " in
2054
if (${SED} -e '2q' $lib |
2055
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2059
*/* | *\\*) . $lib ;;
2062
for l in $old_library $library_names; do
2065
if test "X$ll" = "X$old_library" ; then # only static version available
2067
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2068
test "X$ladir" = "X$lib" && ladir="."
2069
lib=$ladir/$old_library
2070
if test "$linkmode,$pass" = "prog,link"; then
2071
compile_deplibs="$deplib $compile_deplibs"
2072
finalize_deplibs="$deplib $finalize_deplibs"
2074
deplibs="$deplib $deplibs"
2075
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1494
2131
case $linkmode in
1496
if test "$deplibs_check_method" != pass_all; then
1498
echo "*** Warning: This library needs some functionality provided by $deplib."
1499
echo "*** I have the capability to make that library automatically link in when"
1500
echo "*** you link to this library. But I can only do this if you have a"
1501
echo "*** shared version of the library, which you do not appear to have."
2134
case $deplibs_check_method in
2136
set dummy $deplibs_check_method
2137
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2138
if eval $echo \"$deplib\" 2>/dev/null \
2140
| $EGREP "$match_pattern_regex" > /dev/null; then
2148
if test "$valid_a_lib" != yes; then
2150
$echo "*** Warning: Trying to link with static lib archive $deplib."
2151
$echo "*** I have the capability to make that library automatically link in when"
2152
$echo "*** you link to this library. But I can only do this if you have a"
2153
$echo "*** shared version of the library, which you do not appear to have"
2154
$echo "*** because the file extensions .$libext of this argument makes me believe"
2155
$echo "*** that it is just a static archive that I should not used here."
1504
echo "*** Warning: Linking the shared library $output against the"
1505
echo "*** static library $deplib is not portable!"
2158
$echo "*** Warning: Linking the shared library $output against the"
2159
$echo "*** static library $deplib is not portable!"
1506
2160
deplibs="$deplib $deplibs"
1727
2401
fi # $linkmode = prog...
2403
if test "$linkmode,$pass" = "prog,link"; then
2404
if test -n "$library_names" &&
2405
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2406
# We need to hardcode the library path
2407
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2408
# Make sure the rpath contains only unique directories.
2409
case "$temp_rpath " in
2412
*) temp_rpath="$temp_rpath $dir" ;;
2416
# Hardcode the library path.
2417
# Skip directories that are in the system default run-time
2419
case " $sys_lib_dlsearch_path " in
2422
case "$compile_rpath " in
2424
*) compile_rpath="$compile_rpath $absdir"
2428
case " $sys_lib_dlsearch_path " in
2431
case "$finalize_rpath " in
2433
*) finalize_rpath="$finalize_rpath $libdir"
2437
fi # $linkmode,$pass = prog,link...
2439
if test "$alldeplibs" = yes &&
2440
{ test "$deplibs_check_method" = pass_all ||
2441
{ test "$build_libtool_libs" = yes &&
2442
test -n "$library_names"; }; }; then
2443
# We only need to search for static libraries
1729
2448
link_static=no # Whether the deplib will be linked statically
1730
2449
if test -n "$library_names" &&
1731
2450
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1732
# Link against this shared library
1734
if test "$linkmode,$pass" = "prog,link" ||
1735
{ test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then
1736
# Hardcode the library path.
1737
# Skip directories that are in the system default run-time
1739
case " $sys_lib_dlsearch_path " in
1742
case "$compile_rpath " in
1744
*) compile_rpath="$compile_rpath $absdir"
1748
case " $sys_lib_dlsearch_path " in
1751
case "$finalize_rpath " in
1753
*) finalize_rpath="$finalize_rpath $libdir"
1757
if test "$linkmode" = prog; then
1758
# We need to hardcode the library path
1759
if test -n "$shlibpath_var"; then
1760
# Make sure the rpath contains only unique directories.
1761
case "$temp_rpath " in
1764
*) temp_rpath="$temp_rpath $dir" ;;
1768
fi # $linkmode,$pass = prog,link...
1770
if test "$alldeplibs" = yes &&
1771
{ test "$deplibs_check_method" = pass_all ||
1772
{ test "$build_libtool_libs" = yes &&
1773
test -n "$library_names"; }; }; then
1774
# We only need to search for static libraries
1778
2451
if test "$installed" = no; then
1779
2452
notinst_deplibs="$notinst_deplibs $lib"
1780
2453
need_relink=yes
2455
# This is a shared library
2457
# Warn about portability, can't link against -module's on
2458
# some systems (darwin)
2459
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2461
if test "$linkmode" = prog; then
2462
$echo "*** Warning: Linking the executable $output against the loadable module"
2464
$echo "*** Warning: Linking the shared library $output against the loadable module"
2466
$echo "*** $linklib is not portable!"
2468
if test "$linkmode" = lib &&
2469
test "$hardcode_into_libs" = yes; then
2470
# Hardcode the library path.
2471
# Skip directories that are in the system default run-time
2473
case " $sys_lib_dlsearch_path " in
2476
case "$compile_rpath " in
2478
*) compile_rpath="$compile_rpath $absdir"
2482
case " $sys_lib_dlsearch_path " in
2485
case "$finalize_rpath " in
2487
*) finalize_rpath="$finalize_rpath $libdir"
1783
2493
if test -n "$old_archive_from_expsyms_cmds"; then
1784
2494
# figure out the soname
1982
2706
# Just print a warning and add the library to dependency_libs so
1983
2707
# that the program can be linked against the static library.
1985
echo "*** Warning: This library needs some functionality provided by $lib."
1986
echo "*** I have the capability to make that library automatically link in when"
1987
echo "*** you link to this library. But I can only do this if you have a"
1988
echo "*** shared version of the library, which you do not appear to have."
2709
$echo "*** Warning: This system can not link to static lib archive $lib."
2710
$echo "*** I have the capability to make that library automatically link in when"
2711
$echo "*** you link to this library. But I can only do this if you have a"
2712
$echo "*** shared version of the library, which you do not appear to have."
1989
2713
if test "$module" = yes; then
1990
echo "*** Therefore, libtool will create a static module, that should work "
1991
echo "*** as long as the dlopening application is linked with the -dlopen flag."
2714
$echo "*** But as you try to build a module library, libtool will still create "
2715
$echo "*** a static module, that should work as long as the dlopening application"
2716
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1992
2717
if test -z "$global_symbol_pipe"; then
1994
echo "*** However, this would only work if libtool was able to extract symbol"
1995
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1996
echo "*** not find such a program. So, this module is probably useless."
1997
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2719
$echo "*** However, this would only work if libtool was able to extract symbol"
2720
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2721
$echo "*** not find such a program. So, this module is probably useless."
2722
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
1999
2724
if test "$build_old_libs" = no; then
2000
2725
build_libtool_libs=module
2067
2793
if grep "^installed=no" $deplib > /dev/null; then
2068
path="-L$absdir/$objdir"
2794
path="$absdir/$objdir"
2070
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2796
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2071
2797
if test -z "$libdir"; then
2072
2798
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2075
2801
if test "$absdir" != "$libdir"; then
2076
2802
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2809
# we do not want to link against static libs,
2810
# but need to link against shared
2811
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2812
if test -n "$deplibrary_names" ; then
2813
for tmp in $deplibrary_names ; do
2816
if test -f "$path/$depdepl" ; then
2817
depdepl="$path/$depdepl"
2819
# do not add paths which are already there
2820
case " $newlib_search_path " in
2822
*) newlib_search_path="$newlib_search_path $path";;
2835
# Again, we only want to link against shared libraries
2836
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2837
for tmp in $newlib_search_path ; do
2838
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2839
eval depdepl="$tmp/lib$tmp_libs.dylib"
2083
2850
case " $deplibs " in
2084
2851
*" $path "*) ;;
2085
*) deplibs="$deplibs $path" ;;
2852
*) deplibs="$path $deplibs" ;;
2854
case " $deplibs " in
2856
*) deplibs="$depdepl $deplibs" ;;
2088
2859
fi # link_all_deplibs != no
2089
2860
fi # linkmode = lib
2090
2861
done # for deplib in $libs
2862
dependency_libs="$newdependency_libs"
2091
2863
if test "$pass" = dlpreopen; then
2092
2864
# Link the dlpreopened libraries before other libraries
2093
2865
for deplib in $save_deplibs; do
2118
2889
eval tmp_libs=\"\$$var\"
2120
2891
for deplib in $tmp_libs; do
2892
# FIXME: Pedantically, this is the right thing to do, so
2893
# that some nasty dependency loop isn't accidentally
2895
#new_libs="$deplib $new_libs"
2896
# Pragmatically, this seems to cause very few problems in
2121
2898
case $deplib in
2122
2899
-L*) new_libs="$deplib $new_libs" ;;
2902
# And here is the reason: when a library appears more
2903
# than once as an explicit dependence of a library, or
2904
# is implicitly linked in more than once by the
2905
# compiler, it is considered special, and multiple
2906
# occurrences thereof are not removed. Compare this
2907
# with having the same library being listed as a
2908
# dependency of multiple other libraries: in this case,
2909
# we know (pedantically, we assume) the library does not
2910
# need to be listed more than once, so we keep only the
2911
# last copy. This is not always right, but it is rare
2912
# enough that we require users that really mean to play
2913
# such unportable linking tricks to link the library
2914
# using -Wl,-lname, so that libtool does not consider it
2915
# for duplicate removal.
2124
2916
case " $specialdeplibs " in
2125
2917
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2263
3072
if test -n "$8"; then
2264
3073
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2265
3074
$echo "$help" 1>&2
3078
# convert absolute version numbers to libtool ages
3079
# this retains compatibility with .la files and attempts
3080
# to make the code below a bit more comprehensible
3082
case $vinfo_number in
3086
number_revision="$4"
3088
# There are really only two kinds -- those that
3089
# use the current revision as the major version
3090
# and those that subtract age and use age as
3091
# a minor version. But, then there is irix
3092
# which has an extra 1 added just for fun
3094
case $version_type in
3095
darwin|linux|osf|windows)
3096
current=`expr $number_major + $number_minor`
3098
revision="$number_revision"
3100
freebsd-aout|freebsd-elf|sunos)
3101
current="$number_major"
3102
revision="$number_minor"
3106
current=`expr $number_major + $number_minor - 1`
3108
revision="$number_minor"
2273
3119
# Check that each of the things are valid numbers.
2274
3120
case $current in
3121
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]) ;;
2277
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3123
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2278
3124
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2283
3129
case $revision in
3130
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]) ;;
2286
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3132
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2287
3133
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3139
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]) ;;
2295
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3141
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2296
3142
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2301
3147
if test "$age" -gt "$current"; then
2302
3148
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2303
3149
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2307
3153
# Calculate the version variables.
2544
3416
int main() { return 0; }
2547
$CC -o conftest conftest.c $deplibs
3419
$LTCC -o conftest conftest.c $deplibs
2548
3420
if test "$?" -eq 0 ; then
2549
3421
ldd_output=`ldd conftest`
2550
3422
for i in $deplibs; do
2551
3423
name="`expr $i : '-l\(.*\)'`"
2552
3424
# If $name is empty we are operating on a -L argument.
2553
if test -n "$name" && test "$name" != "0"; then
2554
libname=`eval \\$echo \"$libname_spec\"`
2555
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2556
set dummy $deplib_matches
2558
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2559
newdeplibs="$newdeplibs $i"
2563
echo "*** Warning: This library needs some functionality provided by $i."
2564
echo "*** I have the capability to make that library automatically link in when"
2565
echo "*** you link to this library. But I can only do this if you have a"
2566
echo "*** shared version of the library, which you do not appear to have."
2569
newdeplibs="$newdeplibs $i"
2573
# Error occured in the first compile. Let's try to salvage the situation:
2574
# Compile a seperate program for each library.
2575
for i in $deplibs; do
2576
name="`expr $i : '-l\(.*\)'`"
2577
# If $name is empty we are operating on a -L argument.
2578
if test -n "$name" && test "$name" != "0"; then
2580
$CC -o conftest conftest.c $i
2582
if test "$?" -eq 0 ; then
2583
ldd_output=`ldd conftest`
3425
if test "$name" != "" && test "$name" -ne "0"; then
3426
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3427
case " $predeps $postdeps " in
3429
newdeplibs="$newdeplibs $i"
3434
if test -n "$i" ; then
2584
3435
libname=`eval \\$echo \"$libname_spec\"`
2585
3436
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2586
3437
set dummy $deplib_matches
2589
3440
newdeplibs="$newdeplibs $i"
2591
3442
droppeddeps=yes
2593
echo "*** Warning: This library needs some functionality provided by $i."
2594
echo "*** I have the capability to make that library automatically link in when"
2595
echo "*** you link to this library. But I can only do this if you have a"
2596
echo "*** shared version of the library, which you do not appear to have."
3444
$echo "*** Warning: dynamic linker does not accept needed library $i."
3445
$echo "*** I have the capability to make that library automatically link in when"
3446
$echo "*** you link to this library. But I can only do this if you have a"
3447
$echo "*** shared version of the library, which I believe you do not have"
3448
$echo "*** because a test_compile did reveal that the linker did not use it for"
3449
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3453
newdeplibs="$newdeplibs $i"
3457
# Error occurred in the first compile. Let's try to salvage
3458
# the situation: Compile a separate program for each library.
3459
for i in $deplibs; do
3460
name="`expr $i : '-l\(.*\)'`"
3461
# If $name is empty we are operating on a -L argument.
3462
if test "$name" != "" && test "$name" != "0"; then
3464
$LTCC -o conftest conftest.c $i
3466
if test "$?" -eq 0 ; then
3467
ldd_output=`ldd conftest`
3468
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3469
case " $predeps $postdeps " in
3471
newdeplibs="$newdeplibs $i"
3476
if test -n "$i" ; then
3477
libname=`eval \\$echo \"$libname_spec\"`
3478
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3479
set dummy $deplib_matches
3481
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3482
newdeplibs="$newdeplibs $i"
3486
$echo "*** Warning: dynamic linker does not accept needed library $i."
3487
$echo "*** I have the capability to make that library automatically link in when"
3488
$echo "*** you link to this library. But I can only do this if you have a"
3489
$echo "*** shared version of the library, which you do not appear to have"
3490
$echo "*** because a test_compile did reveal that the linker did not use this one"
3491
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2599
3495
droppeddeps=yes
2601
echo "*** Warning! Library $i is needed by this library but I was not able to"
2602
echo "*** make it link in! You will probably need to install it or some"
2603
echo "*** library that it depends on before this library will be fully"
2604
echo "*** functional. Installing it before continuing would be even better."
3497
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3498
$echo "*** make it link in! You will probably need to install it or some"
3499
$echo "*** library that it depends on before this library will be fully"
3500
$echo "*** functional. Installing it before continuing would be even better."
2607
3503
newdeplibs="$newdeplibs $i"
2615
3511
for a_deplib in $deplibs; do
2616
3512
name="`expr $a_deplib : '-l\(.*\)'`"
2617
3513
# If $name is empty we are operating on a -L argument.
2618
if test -n "$name" && test "$name" != "0"; then
2619
libname=`eval \\$echo \"$libname_spec\"`
2620
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2621
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2622
for potent_lib in $potential_libs; do
3514
if test "$name" != "" && test "$name" != "0"; then
3515
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3516
case " $predeps $postdeps " in
3518
newdeplibs="$newdeplibs $a_deplib"
3523
if test -n "$a_deplib" ; then
3524
libname=`eval \\$echo \"$libname_spec\"`
3525
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3526
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3527
for potent_lib in $potential_libs; do
2623
3528
# Follow soft links.
2624
3529
if ls -lLd "$potent_lib" 2>/dev/null \
2625
3530
| grep " -> " >/dev/null; then
2633
3538
potlib="$potent_lib"
2634
3539
while test -h "$potlib" 2>/dev/null; do
2635
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
3540
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2636
3541
case $potliblink in
2637
3542
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2638
3543
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2641
3546
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2643
| egrep "$file_magic_regex" > /dev/null; then
3548
| $EGREP "$file_magic_regex" > /dev/null; then
2644
3549
newdeplibs="$newdeplibs $a_deplib"
2650
3556
if test -n "$a_deplib" ; then
2651
3557
droppeddeps=yes
2653
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2654
echo "*** I have the capability to make that library automatically link in when"
2655
echo "*** you link to this library. But I can only do this if you have a"
2656
echo "*** shared version of the library, which you do not appear to have."
3559
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3560
$echo "*** I have the capability to make that library automatically link in when"
3561
$echo "*** you link to this library. But I can only do this if you have a"
3562
$echo "*** shared version of the library, which you do not appear to have"
3563
$echo "*** because I did check the linker path looking for a file starting"
3564
if test -z "$potlib" ; then
3565
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3567
$echo "*** with $libname and none of the candidates passed a file format test"
3568
$echo "*** using a file magic. Last file checked: $potlib"
2659
3572
# Add a -L argument.
2668
3581
name="`expr $a_deplib : '-l\(.*\)'`"
2669
3582
# If $name is empty we are operating on a -L argument.
2670
3583
if test -n "$name" && test "$name" != "0"; then
2671
libname=`eval \\$echo \"$libname_spec\"`
2672
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2673
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2674
for potent_lib in $potential_libs; do
2675
if eval echo \"$potent_lib\" 2>/dev/null \
2677
| egrep "$match_pattern_regex" > /dev/null; then
2678
newdeplibs="$newdeplibs $a_deplib"
3584
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3585
case " $predeps $postdeps " in
3587
newdeplibs="$newdeplibs $a_deplib"
3592
if test -n "$a_deplib" ; then
3593
libname=`eval \\$echo \"$libname_spec\"`
3594
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3595
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3596
for potent_lib in $potential_libs; do
3597
potlib="$potent_lib" # see symlink-check above in file_magic test
3598
if eval $echo \"$potent_lib\" 2>/dev/null \
3600
| $EGREP "$match_pattern_regex" > /dev/null; then
3601
newdeplibs="$newdeplibs $a_deplib"
2684
3608
if test -n "$a_deplib" ; then
2685
3609
droppeddeps=yes
2687
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2688
echo "*** I have the capability to make that library automatically link in when"
2689
echo "*** you link to this library. But I can only do this if you have a"
2690
echo "*** shared version of the library, which you do not appear to have."
3611
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3612
$echo "*** I have the capability to make that library automatically link in when"
3613
$echo "*** you link to this library. But I can only do this if you have a"
3614
$echo "*** shared version of the library, which you do not appear to have"
3615
$echo "*** because I did check the linker path looking for a file starting"
3616
if test -z "$potlib" ; then
3617
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3619
$echo "*** with $libname and none of the candidates passed a file format test"
3620
$echo "*** using a regex pattern. Last file checked: $potlib"
2693
3624
# Add a -L argument.
2698
3629
none | unknown | *)
2700
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2701
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2702
grep . >/dev/null; then
3631
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3632
-e 's/ -[LR][^ ]*//g'`
3633
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3634
for i in $predeps $postdeps ; do
3635
# can't use Xsed below, because $i might contain '/'
3636
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3639
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3640
| grep . >/dev/null; then
2704
3642
if test "X$deplibs_check_method" = "Xnone"; then
2705
echo "*** Warning: inter-library dependencies are not supported in this platform."
3643
$echo "*** Warning: inter-library dependencies are not supported in this platform."
2707
echo "*** Warning: inter-library dependencies are not known to be supported."
3645
$echo "*** Warning: inter-library dependencies are not known to be supported."
2709
echo "*** All declared inter-library dependencies are being dropped."
3647
$echo "*** All declared inter-library dependencies are being dropped."
2710
3648
droppeddeps=yes
2727
3665
if test "$droppeddeps" = yes; then
2728
3666
if test "$module" = yes; then
2730
echo "*** Warning: libtool could not satisfy all declared inter-library"
2731
echo "*** dependencies of module $libname. Therefore, libtool will create"
2732
echo "*** a static module, that should work as long as the dlopening"
2733
echo "*** application is linked with the -dlopen flag."
3668
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3669
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3670
$echo "*** a static module, that should work as long as the dlopening"
3671
$echo "*** application is linked with the -dlopen flag."
2734
3672
if test -z "$global_symbol_pipe"; then
2736
echo "*** However, this would only work if libtool was able to extract symbol"
2737
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2738
echo "*** not find such a program. So, this module is probably useless."
2739
echo "*** \`nm' from GNU binutils and a full rebuild may help."
3674
$echo "*** However, this would only work if libtool was able to extract symbol"
3675
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3676
$echo "*** not find such a program. So, this module is probably useless."
3677
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2741
3679
if test "$build_old_libs" = no; then
2742
3680
oldlibs="$output_objdir/$libname.$libext"
2746
3684
build_libtool_libs=no
2749
echo "*** The inter-library dependencies that have been dropped here will be"
2750
echo "*** automatically added whenever a program is linked with this library"
2751
echo "*** or is declared to -dlopen it."
3687
$echo "*** The inter-library dependencies that have been dropped here will be"
3688
$echo "*** automatically added whenever a program is linked with this library"
3689
$echo "*** or is declared to -dlopen it."
2753
3691
if test "$allow_undefined" = no; then
2755
echo "*** Since this library must not contain undefined symbols,"
2756
echo "*** because either the platform does not support them or"
2757
echo "*** it was explicitly requested with -no-undefined,"
2758
echo "*** libtool will only create a static version of it."
3693
$echo "*** Since this library must not contain undefined symbols,"
3694
$echo "*** because either the platform does not support them or"
3695
$echo "*** it was explicitly requested with -no-undefined,"
3696
$echo "*** libtool will only create a static version of it."
2759
3697
if test "$build_old_libs" = no; then
2760
3698
oldlibs="$output_objdir/$libname.$libext"
2761
3699
build_libtool_libs=module
2898
3835
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3839
for test_deplib in $deplibs; do
3840
case " $convenience " in
3841
*" $test_deplib "*) ;;
3843
tmp_deplibs="$tmp_deplibs $test_deplib"
3847
deplibs="$tmp_deplibs"
2901
3849
if test -n "$convenience"; then
2902
3850
if test -n "$whole_archive_flag_spec"; then
3851
save_libobjs=$libobjs
2903
3852
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2905
3854
gentop="$output_objdir/${outputname}x"
2906
$show "${rm}r $gentop"
2907
$run ${rm}r "$gentop"
2908
$show "mkdir $gentop"
2909
$run mkdir "$gentop"
2911
if test "$status" -ne 0 && test ! -d "$gentop"; then
2914
3855
generated="$generated $gentop"
2916
for xlib in $convenience; do
2917
# Extract the objects.
2919
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2920
*) xabs=`pwd`"/$xlib" ;;
2922
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2923
xdir="$gentop/$xlib"
2925
$show "${rm}r $xdir"
2930
if test "$status" -ne 0 && test ! -d "$xdir"; then
2933
$show "(cd $xdir && $AR x $xabs)"
2934
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2936
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3857
func_extract_archives $gentop $convenience
3858
libobjs="$libobjs $func_extract_archives_result"
2941
3862
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2942
3863
eval flag=\"$thread_safe_flag_spec\"
2943
3864
linker_flags="$linker_flags $flag"
2951
3872
# Do each of the archive commands.
3873
if test "$module" = yes && test -n "$module_cmds" ; then
3874
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3875
eval test_cmds=\"$module_expsym_cmds\"
3876
cmds=$module_expsym_cmds
3878
eval test_cmds=\"$module_cmds\"
2952
3882
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2953
eval cmds=\"$archive_expsym_cmds\"
2955
eval cmds=\"$archive_cmds\"
3883
eval test_cmds=\"$archive_expsym_cmds\"
3884
cmds=$archive_expsym_cmds
3886
eval test_cmds=\"$archive_cmds\"
3891
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3892
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3895
# The command line is too long to link in one step, link piecewise.
3896
$echo "creating reloadable object files..."
3898
# Save the value of $output and $libobjs because we want to
3899
# use them later. If we have whole_archive_flag_spec, we
3900
# want to use save_libobjs as it was before
3901
# whole_archive_flag_spec was expanded, because we can't
3902
# assume the linker understands whole_archive_flag_spec.
3903
# This may have to be revisited, in case too many
3904
# convenience libraries get linked in and end up exceeding
3906
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3907
save_libobjs=$libobjs
3910
output_la=`$echo "X$output" | $Xsed -e "$basename"`
3912
# Clear the reloadable object creation command queue and
3913
# initialize k to one.
3920
output=$output_objdir/$output_la-${k}.$objext
3921
# Loop over the list of objects to be linked.
3922
for obj in $save_libobjs
3924
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3925
if test "X$objlist" = X ||
3926
{ len=`expr "X$test_cmds" : ".*"` &&
3927
test "$len" -le "$max_cmd_len"; }; then
3928
objlist="$objlist $obj"
3930
# The command $test_cmds is almost too long, add a
3931
# command to the queue.
3932
if test "$k" -eq 1 ; then
3933
# The first file doesn't have a previous command to add.
3934
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3936
# All subsequent reloadable object files will link in
3937
# the last one created.
3938
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3940
last_robj=$output_objdir/$output_la-${k}.$objext
3942
output=$output_objdir/$output_la-${k}.$objext
3947
# Handle the remaining objects by creating one last
3948
# reloadable object file. All subsequent reloadable object
3949
# files will link in the last one created.
3950
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3951
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3953
if ${skipped_export-false}; then
3954
$show "generating symbol list for \`$libname.la'"
3955
export_symbols="$output_objdir/$libname.exp"
3956
$run $rm $export_symbols
3958
# Append the command to create the export file.
3959
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3962
# Set up a command to remove the reloadable object files
3963
# after they are used.
3965
while test "$i" -lt "$k"
3968
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3971
$echo "creating a temporary reloadable object file: $output"
3973
# Loop through the commands generated above and execute them.
3974
save_ifs="$IFS"; IFS='~'
3975
for cmd in $concat_cmds; do
3978
$run eval "$cmd" || exit $?
3983
# Restore the value of output.
3986
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3987
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3989
# Expand the library linking commands again to reset the
3990
# value of $libobjs for piecewise linking.
3992
# Do each of the archive commands.
3993
if test "$module" = yes && test -n "$module_cmds" ; then
3994
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3995
cmds=$module_expsym_cmds
4000
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4001
cmds=$archive_expsym_cmds
4007
# Append the command to remove the reloadable object files
4008
# to the just-reset $cmds.
4009
eval cmds=\"\$cmds~\$rm $delfiles\"
2957
4011
save_ifs="$IFS"; IFS='~'
2958
4012
for cmd in $cmds; do
2959
4013
IFS="$save_ifs"
2961
4016
$run eval "$cmd" || exit $?
3328
4353
if test -n "$exclude_expsyms"; then
3329
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4354
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3330
4355
$run eval '$mv "$nlist"T "$nlist"'
3333
4358
if test -n "$export_symbols_regex"; then
3334
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4359
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3335
4360
$run eval '$mv "$nlist"T "$nlist"'
3338
4363
# Prepare the list of exported symbols
3339
4364
if test -z "$export_symbols"; then
3340
export_symbols="$output_objdir/$output.exp"
4365
export_symbols="$output_objdir/$outputname.exp"
3341
4366
$run $rm $export_symbols
3342
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4367
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3344
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3345
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4369
$run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4370
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3346
4371
$run eval 'mv "$nlist"T "$nlist"'
3350
4375
for arg in $dlprefiles; do
3351
4376
$show "extracting global C symbols from \`$arg'"
3352
name=`echo "$arg" | sed -e 's%^.*/%%'`
3353
$run eval 'echo ": $name " >> "$nlist"'
4377
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4378
$run eval '$echo ": $name " >> "$nlist"'
3354
4379
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3606
4656
# win32 will think the script is a binary if it has
3607
4657
# a .exe suffix, so we strip it off here.
3608
4658
case $output in
3609
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
4659
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3611
4661
# test for cygwin because mv fails w/o .exe extensions
3613
*cygwin*) exeext=.exe ;;
4665
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4669
*cygwin* | *mingw* )
4670
cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4671
cwrapper=`$echo ${output}.exe`
4672
$rm $cwrappersource $cwrapper
4673
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4675
cat > $cwrappersource <<EOF
4677
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4678
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4680
The $output program cannot be directly executed until all the libtool
4681
libraries that it depends on are installed.
4683
This wrapper executable should never be moved out of the build directory.
4684
If it is, it will not operate correctly.
4686
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4687
but could eventually absorb all of the scripts functionality and
4688
exec $objdir/$outputname directly.
4691
cat >> $cwrappersource<<"EOF"
4699
#if defined(PATH_MAX)
4700
# define LT_PATHMAX PATH_MAX
4701
#elif defined(MAXPATHLEN)
4702
# define LT_PATHMAX MAXPATHLEN
4704
# define LT_PATHMAX 1024
4707
#ifndef DIR_SEPARATOR
4708
#define DIR_SEPARATOR '/'
4711
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4713
#define HAVE_DOS_BASED_FILE_SYSTEM
4714
#ifndef DIR_SEPARATOR_2
4715
#define DIR_SEPARATOR_2 '\\'
4719
#ifndef DIR_SEPARATOR_2
4720
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4721
#else /* DIR_SEPARATOR_2 */
4722
# define IS_DIR_SEPARATOR(ch) \
4723
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4724
#endif /* DIR_SEPARATOR_2 */
4726
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4727
#define XFREE(stale) do { \
4728
if (stale) { free ((void *) stale); stale = 0; } \
4731
const char *program_name = NULL;
4733
void * xmalloc (size_t num);
4734
char * xstrdup (const char *string);
4735
char * basename (const char *name);
4736
char * fnqualify(const char *path);
4737
char * strendzap(char *str, const char *pat);
4738
void lt_fatal (const char *message, ...);
4741
main (int argc, char *argv[])
4746
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4747
newargz = XMALLOC(char *, argc+2);
4750
cat >> $cwrappersource <<EOF
4751
newargz[0] = "$SHELL";
4754
cat >> $cwrappersource <<"EOF"
4755
newargz[1] = fnqualify(argv[0]);
4756
/* we know the script has the same name, without the .exe */
4757
/* so make sure newargz[1] doesn't end in .exe */
4758
strendzap(newargz[1],".exe");
4759
for (i = 1; i < argc; i++)
4760
newargz[i+1] = xstrdup(argv[i]);
4761
newargz[argc+1] = NULL;
4764
cat >> $cwrappersource <<EOF
4765
execv("$SHELL",newargz);
4768
cat >> $cwrappersource <<"EOF"
4772
xmalloc (size_t num)
4774
void * p = (void *) malloc (num);
4776
lt_fatal ("Memory exhausted");
4782
xstrdup (const char *string)
4784
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4789
basename (const char *name)
4793
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4794
/* Skip over the disk name in MSDOS pathnames. */
4795
if (isalpha (name[0]) && name[1] == ':')
4799
for (base = name; *name; name++)
4800
if (IS_DIR_SEPARATOR (*name))
4802
return (char *) base;
4806
fnqualify(const char *path)
4810
char tmp[LT_PATHMAX + 1];
4812
assert(path != NULL);
4814
/* Is it qualified already? */
4815
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4816
if (isalpha (path[0]) && path[1] == ':')
4817
return xstrdup (path);
4819
if (IS_DIR_SEPARATOR (path[0]))
4820
return xstrdup (path);
4822
/* prepend the current directory */
4823
/* doesn't handle '~' */
4824
if (getcwd (tmp, LT_PATHMAX) == NULL)
4825
lt_fatal ("getcwd failed");
4826
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4827
p = XMALLOC(char, size);
4828
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4833
strendzap(char *str, const char *pat)
4837
assert(str != NULL);
4838
assert(pat != NULL);
4841
patlen = strlen(pat);
4845
str += len - patlen;
4846
if (strcmp(str, pat) == 0)
4853
lt_error_core (int exit_status, const char * mode,
4854
const char * message, va_list ap)
4856
fprintf (stderr, "%s: %s: ", program_name, mode);
4857
vfprintf (stderr, message, ap);
4858
fprintf (stderr, ".\n");
4860
if (exit_status >= 0)
4865
lt_fatal (const char *message, ...)
4868
va_start (ap, message);
4869
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4873
# we should really use a build-platform specific compiler
4874
# here, but OTOH, the wrappers (shell script and this C one)
4875
# are only useful if you want to execute the "real" binary.
4876
# Since the "real" binary is built for $host, then this
4877
# wrapper might as well be built for $host, too.
4878
$run $LTCC -s -o $cwrapper $cwrappersource
3617
trap "$rm $output; exit 1" 1 2 15
4882
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
3619
4884
$echo > $output "\
3817
5070
oldobjs="$libobjs_save"
3818
5071
build_libtool_libs=no
3820
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
5073
oldobjs="$old_deplibs $non_pic_objects"
3822
5075
addlibs="$old_convenience"
3825
5078
if test -n "$addlibs"; then
3826
5079
gentop="$output_objdir/${outputname}x"
3827
$show "${rm}r $gentop"
3828
$run ${rm}r "$gentop"
3829
$show "mkdir $gentop"
3830
$run mkdir "$gentop"
3832
if test "$status" -ne 0 && test ! -d "$gentop"; then
3835
5080
generated="$generated $gentop"
3837
# Add in members from convenience archives.
3838
for xlib in $addlibs; do
3839
# Extract the objects.
3841
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3842
*) xabs=`pwd`"/$xlib" ;;
3844
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3845
xdir="$gentop/$xlib"
3847
$show "${rm}r $xdir"
3852
if test "$status" -ne 0 && test ! -d "$xdir"; then
3855
$show "(cd $xdir && $AR x $xabs)"
3856
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3858
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5082
func_extract_archives $gentop $addlibs
5083
oldobjs="$oldobjs $func_extract_archives_result"
3862
5086
# Do each command in the archive commands.
3863
5087
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3864
eval cmds=\"$old_archive_from_new_cmds\"
5088
cmds=$old_archive_from_new_cmds
3866
# Ensure that we have .o objects in place in case we decided
3867
# not to build a shared library, and have fallen back to building
3868
# static libs even though --disable-static was passed!
3869
for oldobj in $oldobjs; do
3870
if test ! -f $oldobj; then
3871
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3872
if test "X$xdir" = "X$oldobj"; then
5090
# POSIX demands no paths to be encoded in archives. We have
5091
# to avoid creating archives with duplicate basenames if we
5092
# might have to extract them afterwards, e.g., when creating a
5093
# static archive out of a convenience library, or when linking
5094
# the entirety of a libtool archive into another (currently
5095
# not supported by libtool).
5096
if (for obj in $oldobjs
5098
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5099
done | sort | sort -uc >/dev/null 2>&1); then
5102
$echo "copying selected object files to avoid basename conflicts..."
5104
if test -z "$gentop"; then
5105
gentop="$output_objdir/${outputname}x"
5106
generated="$generated $gentop"
5108
$show "${rm}r $gentop"
5109
$run ${rm}r "$gentop"
5110
$show "$mkdir $gentop"
5111
$run $mkdir "$gentop"
5113
if test "$status" -ne 0 && test ! -d "$gentop"; then
3877
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3878
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3879
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
3880
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
5118
save_oldobjs=$oldobjs
5121
for obj in $save_oldobjs
5123
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5124
case " $oldobjs " in
5125
" ") oldobjs=$obj ;;
5128
# Make sure we don't pick an alternate name that also
5130
newobj=lt$counter-$objbase
5131
counter=`expr $counter + 1`
5132
case " $oldobjs " in
5133
*[\ /]"$newobj "*) ;;
5134
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5137
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5138
$run ln "$obj" "$gentop/$newobj" ||
5139
$run cp "$obj" "$gentop/$newobj"
5140
oldobjs="$oldobjs $gentop/$newobj"
5142
*) oldobjs="$oldobjs $obj" ;;
3884
5147
eval cmds=\"$old_archive_cmds\"
5149
if len=`expr "X$cmds" : ".*"` &&
5150
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5151
cmds=$old_archive_cmds
5153
# the command line is too long to link in one step, link in parts
5154
$echo "using piecewise archive linking..."
5159
save_oldobjs=$oldobjs
5161
# Is there a better way of finding the last object in the list?
5162
for obj in $save_oldobjs
5166
for obj in $save_oldobjs
5168
oldobjs="$objlist $obj"
5169
objlist="$objlist $obj"
5170
eval test_cmds=\"$old_archive_cmds\"
5171
if len=`expr "X$test_cmds" : ".*"` &&
5172
test "$len" -le "$max_cmd_len"; then
5175
# the above command should be used before it gets too long
5177
if test "$obj" = "$last_oldobj" ; then
5180
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5181
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5187
if test "X$oldobjs" = "X" ; then
5188
eval cmds=\"\$concat_cmds\"
5190
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
3886
5194
save_ifs="$IFS"; IFS='~'
3887
5195
for cmd in $cmds; do
3888
5197
IFS="$save_ifs"
3890
5199
$run eval "$cmd" || exit $?
3959
5272
for lib in $dlprefiles; do
3960
5273
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3961
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5274
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3962
5275
if test -z "$libdir"; then
3963
5276
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3966
5279
newdlprefiles="$newdlprefiles $libdir/$name"
3968
5281
dlprefiles="$newdlprefiles"
5284
for lib in $dlfiles; do
5286
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5287
*) abs=`pwd`"/$lib" ;;
5289
newdlfiles="$newdlfiles $abs"
5291
dlfiles="$newdlfiles"
5293
for lib in $dlprefiles; do
5295
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5296
*) abs=`pwd`"/$lib" ;;
5298
newdlprefiles="$newdlprefiles $abs"
5300
dlprefiles="$newdlprefiles"
3971
5303
# place dlname in correct position for cygwin
3972
5304
tdlname=$dlname
3973
5305
case $host,$output,$installed,$module,$dlname in
3974
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5306
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3976
5308
$echo > $output "\
3977
5309
# $outputname - a libtool library file
4219
5554
if test -n "$relink_command"; then
4220
5555
# Determine the prefix the user has applied to our future dir.
4221
inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
5556
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
4223
5558
# Don't allow the user to place us outside of our expected
4224
5559
# location b/c this prevents finding dependent libraries that
4225
5560
# are installed to the same prefix.
5561
# At present, this check doesn't affect windows .dll's that
5562
# are installed into $libdir/../bin (currently, that works fine)
5563
# but it's something to keep an eye on.
4226
5564
if test "$inst_prefix_dir" = "$destdir"; then
4227
5565
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4231
5569
if test -n "$inst_prefix_dir"; then
4232
5570
# Stick the inst_prefix_dir data into the link command.
4233
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5571
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4235
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
5573
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4238
5576
$echo "$modename: warning: relinking \`$file'" 1>&2
4348
5687
destfile="$destdir/$destfile"
5690
# If the file is missing, and there is a .exe on the end, strip it
5691
# because it is most likely a libtool script we actually want to
5696
if test ! -f "$file"; then
5697
file=`$echo $file|${SED} 's,.exe$,,'`
4351
5703
# Do a test to see if this is really a libtool program.
4352
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5706
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5712
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4353
5713
notinst_deplibs=
4354
5714
relink_command=
5716
# To insure that "foo" is sourced, and not "foo.exe",
5717
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5718
# which disallows the automatic-append-.exe behavior.
5720
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5721
*) wrapperdot=${wrapper} ;;
4356
5723
# If there is no directory component, then add one.
4358
*/* | *\\*) . $file ;;
5725
*/* | *\\*) . ${wrapperdot} ;;
5726
*) . ./${wrapperdot} ;;
4362
5729
# Check the variables that should have been set.
4363
5730
if test -z "$notinst_deplibs"; then
4364
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
5731
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4526
5902
# Exit here if they wanted silent mode.
4527
test "$show" = : && exit 0
5903
test "$show" = : && exit $EXIT_SUCCESS
4529
echo "----------------------------------------------------------------------"
4530
echo "Libraries have been installed in:"
5905
$echo "----------------------------------------------------------------------"
5906
$echo "Libraries have been installed in:"
4531
5907
for libdir in $libdirs; do
4535
echo "If you ever happen to want to link against installed libraries"
4536
echo "in a given directory, LIBDIR, you must either use libtool, and"
4537
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4538
echo "flag during linking and do at least one of the following:"
5911
$echo "If you ever happen to want to link against installed libraries"
5912
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5913
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5914
$echo "flag during linking and do at least one of the following:"
4539
5915
if test -n "$shlibpath_var"; then
4540
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4541
echo " during execution"
5916
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5917
$echo " during execution"
4543
5919
if test -n "$runpath_var"; then
4544
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4545
echo " during linking"
5920
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5921
$echo " during linking"
4547
5923
if test -n "$hardcode_libdir_flag_spec"; then
4549
5925
eval flag=\"$hardcode_libdir_flag_spec\"
4551
echo " - use the \`$flag' linker flag"
5927
$echo " - use the \`$flag' linker flag"
4553
5929
if test -n "$admincmds"; then
4554
echo " - have your system administrator run these commands:$admincmds"
5930
$echo " - have your system administrator run these commands:$admincmds"
4556
5932
if test -f /etc/ld.so.conf; then
4557
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5933
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4560
echo "See any operating system documentation about shared libraries for"
4561
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4562
echo "----------------------------------------------------------------------"
5936
$echo "See any operating system documentation about shared libraries for"
5937
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5938
$echo "----------------------------------------------------------------------"
4566
5942
# libtool execute mode
4816
if test "$build_old_libs" = yes; then
4817
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4818
rmfiles="$rmfiles $dir/$oldobj"
6195
# Possibly a libtool object, so verify it.
6196
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6201
# Add PIC object to the list of files to remove.
6202
if test -n "$pic_object" \
6203
&& test "$pic_object" != none; then
6204
rmfiles="$rmfiles $dir/$pic_object"
6207
# Add non-PIC object to the list of files to remove.
6208
if test -n "$non_pic_object" \
6209
&& test "$non_pic_object" != none; then
6210
rmfiles="$rmfiles $dir/$non_pic_object"
4823
# Do a test to see if this is a libtool program.
4824
if test "$mode" = clean &&
4825
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6216
if test "$mode" = clean ; then
6220
file=`$echo $file|${SED} 's,.exe$,,'`
6221
noexename=`$echo $name|${SED} 's,.exe$,,'`
6222
# $file with .exe has already been added to rmfiles,
6223
# add $file without .exe
6224
rmfiles="$rmfiles $file"
6227
# Do a test to see if this is a libtool program.
6228
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4829
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4830
if test "$fast_install" = yes && test -n "$relink_command"; then
4831
rmfiles="$rmfiles $objdir/lt-$name"
6232
# note $name still contains .exe if it was in $file originally
6233
# as does the version of $file that was added into $rmfiles
6234
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6235
if test "$fast_install" = yes && test -n "$relink_command"; then
6236
rmfiles="$rmfiles $objdir/lt-$name"
6238
if test "X$noexename" != "X$name" ; then
6239
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
5050
6466
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5051
6467
$echo "$help" 1>&2
5057
6473
$echo "Try \`$modename --help' for more information about other modes."
6477
# The TAGs below are defined such that we never get into a situation
6478
# in which we disable both kinds of libraries. Given conflicting
6479
# choices, we go for a static library, that is the most portable,
6480
# since we can't tell whether shared libraries were disabled because
6481
# the user asked for that or because the platform doesn't support
6482
# them. This is particularly important on AIX, because we don't
6483
# support having both static and shared libraries enabled at the same
6484
# time on that platform, so we default to a shared-only configuration.
6485
# If a disable-shared tag is given, we'll fallback to a static-only
6486
# configuration. But we'll never go from static-only to shared-only.
6488
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6489
build_libtool_libs=no
6491
# ### END LIBTOOL TAG CONFIG: disable-shared
6493
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6494
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6495
# ### END LIBTOOL TAG CONFIG: disable-static
5061
6497
# Local Variables:
5062
6498
# mode:shell-script