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`
46
VERSION="1.5.20 Debian 1.5.20-2"
47
TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
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
135
lo2o="s/\\.lo\$/.${objext}/"
106
136
o2lo="s/\\.${objext}\$/.lo/"
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
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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.
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.
398
665
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
741
qlibobj="\"$qlibobj\"" ;;
743
test "X$libobj" != "X$qlibobj" \
744
&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
745
&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
746
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
747
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
748
if test "X$xdir" = "X$obj"; then
753
lobj=${xdir}$objdir/$objname
450
755
if test -z "$base_compile"; then
451
756
$echo "$modename: you must specify a compilation command" 1>&2
452
757
$echo "$help" 1>&2
456
761
# Delete any leftover library objects.
457
762
if test "$build_old_libs" = yes; then
458
removelist="$obj $libobj"
763
removelist="$obj $lobj $libobj ${libobj}T"
765
removelist="$lobj $libobj ${libobj}T"
463
768
$run $rm $removelist
464
trap "$run $rm $removelist; exit 1" 1 2 15
769
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
466
771
# On Cygwin there's no "real" PIC flag so we must build both object types
522
847
fbsd_hideous_sh_bug=$base_compile
524
849
if test "$pic_mode" != no; then
525
# All platforms use -DPIC, to notify preprocessed assembler code.
526
command="$base_compile $srcfile $pic_flag -DPIC"
850
command="$base_compile $qsrcfile $pic_flag"
528
852
# 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"
853
command="$base_compile $qsrcfile"
856
if test ! -d "${xdir}$objdir"; then
857
$show "$mkdir ${xdir}$objdir"
858
$run $mkdir ${xdir}$objdir
860
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
865
if test -z "$output_obj"; then
866
# Place PIC objects in $objdir
867
command="$command -o $lobj"
870
$run $rm "$lobj" "$output_obj"
563
873
if $run eval "$command"; then :
565
875
test -n "$output_obj" && $run $rm $removelist
569
879
if test "$need_locks" = warn &&
570
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
880
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
572
882
*** ERROR, $lockfile contains:
573
883
`cat $lockfile 2>/dev/null`
585
895
$run $rm $removelist
589
899
# 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
900
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
901
$show "$mv $output_obj $lobj"
902
if $run $mv $output_obj $lobj; then :
910
# Append the name of the PIC object to the libtool object file.
911
test -z "$run" && cat >> ${libobj}T <<EOF
912
pic_object='$objdir/$objname'
640
916
# Allow error messages only from the first compilation.
641
suppress_output=' >/dev/null 2>&1'
917
if test "$suppress_opt" = yes; then
918
suppress_output=' >/dev/null 2>&1'
921
# No PIC object so indicate it doesn't exist in the libtool
923
test -z "$run" && cat >> ${libobj}T <<EOF
644
929
# Only build a position-dependent object if we build old libraries.
645
930
if test "$build_old_libs" = yes; then
646
931
if test "$pic_mode" != yes; then
647
932
# Don't build PIC code
648
command="$base_compile $srcfile"
933
command="$base_compile $qsrcfile"
650
# All platforms use -DPIC, to notify preprocessed assembler code.
651
command="$base_compile $srcfile $pic_flag -DPIC"
935
command="$base_compile $qsrcfile $pic_flag"
653
937
if test "$compiler_c_o" = yes; then
654
938
command="$command -o $obj"
658
941
# Suppress compiler output if we already did a PIC compilation.
659
942
command="$command$suppress_output"
660
$run $rm "$output_obj"
943
$run $rm "$obj" "$output_obj"
662
945
if $run eval "$command"; then :
664
947
$run $rm $removelist
668
951
if test "$need_locks" = warn &&
669
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
952
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
671
954
*** ERROR, $lockfile contains:
672
955
`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 :
982
# Append the name of the non-PIC object the libtool object file.
983
# Only append if the libtool object file exists.
984
test -z "$run" && cat >> ${libobj}T <<EOF
985
# Name of the non-PIC object.
986
non_pic_object='$objname'
990
# Append the name of the non-PIC object the libtool object file.
991
# Only append if the libtool object file exists.
992
test -z "$run" && cat >> ${libobj}T <<EOF
993
# Name of the non-PIC object.
999
$run $mv "${libobj}T" "${libobj}"
716
1001
# Unlock the critical section if it was locked
717
1002
if test "$need_locks" != no; then
718
1003
$run $rm "$lockfile"
724
1009
# libtool link mode
894
1185
inst_prefix_dir="$arg"
1190
precious_files_regex="$arg"
1200
if test -f "$arg"; then
1203
for fil in `cat $save_arg`
1205
# moreargs="$moreargs $fil"
1207
# A libtool-controlled object.
1209
# Check to see that this really is a libtool object.
1210
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1215
# If there is no directory component, then add one.
1217
*/* | *\\*) . $arg ;;
1221
if test -z "$pic_object" || \
1222
test -z "$non_pic_object" ||
1223
test "$pic_object" = none && \
1224
test "$non_pic_object" = none; then
1225
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1229
# Extract subdirectory from the argument.
1230
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1231
if test "X$xdir" = "X$arg"; then
1237
if test "$pic_object" != none; then
1238
# Prepend the subdirectory the object is found in.
1239
pic_object="$xdir$pic_object"
1241
if test "$prev" = dlfiles; then
1242
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1243
dlfiles="$dlfiles $pic_object"
1247
# If libtool objects are unsupported, then we need to preload.
1252
# CHECK ME: I think I busted this. -Ossama
1253
if test "$prev" = dlprefiles; then
1254
# Preload the old-style object.
1255
dlprefiles="$dlprefiles $pic_object"
1260
libobjs="$libobjs $pic_object"
1265
if test "$non_pic_object" != none; then
1266
# Prepend the subdirectory the object is found in.
1267
non_pic_object="$xdir$non_pic_object"
1269
# A standard non-PIC object
1270
non_pic_objects="$non_pic_objects $non_pic_object"
1271
if test -z "$pic_object" || test "$pic_object" = none ; then
1272
arg="$non_pic_object"
1276
# Only an error if not doing a dry-run.
1277
if test -z "$run"; then
1278
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1283
# Extract subdirectory from the argument.
1284
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1285
if test "X$xdir" = "X$arg"; then
1291
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1292
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1293
libobjs="$libobjs $pic_object"
1294
non_pic_objects="$non_pic_objects $non_pic_object"
1299
$echo "$modename: link input file \`$save_arg' does not exist"
904
1307
# We need an absolute path.
906
1309
[\\/]* | [A-Za-z]:[\\/]*) ;;
908
1311
$echo "$modename: only absolute run-paths are allowed" 1>&2
912
1315
if test "$prev" = rpath; then
1056
1487
# These systems don't actually have a C library (as such)
1057
1488
test "X$arg" = "X-lc" && continue
1490
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1060
1491
# Do not include libc due to us having libc/libc_r.
1061
1492
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.
1494
*-*-rhapsody* | *-*-darwin1.[012])
1495
# Rhapsody C and math libraries are in the System framework
1496
deplibs="$deplibs -framework System"
1499
elif test "X$arg" = "X-lc_r"; then
1501
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1502
# Do not include libc_r directly, use -pthread flag.
1072
1507
deplibs="$deplibs $arg"
1511
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1512
# classes, name mangling, and exception handling.
1514
compile_command="$compile_command $arg"
1515
compiler_flags="$compiler_flags $arg"
1516
finalize_command="$finalize_command $arg"
1521
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1522
compiler_flags="$compiler_flags $arg"
1523
compile_command="$compile_command $arg"
1524
finalize_command="$finalize_command $arg"
1533
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1534
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1535
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1536
# +DA*, +DD* enable 64-bit mode on the HP compiler
1537
# -q* pass through compiler args for the IBM compiler
1538
# -m* pass through architecture-specific compiler args for GCC
1539
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1541
# Unknown arguments in both finalize_command and compile_command need
1542
# to be aesthetically quoted because they are evaled later.
1543
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1545
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1549
compile_command="$compile_command $arg"
1550
finalize_command="$finalize_command $arg"
1551
if test "$with_gcc" = "yes" ; then
1552
compiler_flags="$compiler_flags $arg"
1081
1562
-no-fast-install)
1082
1563
fast_install=no
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"`
1719
# A standard object.
1724
# A libtool-controlled object.
1726
# Check to see that this really is a libtool object.
1727
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1732
# If there is no directory component, then add one.
1237
*.lo) libobjs="$libobjs $arg" ;;
1238
*) objs="$objs $arg" ;;
1734
*/* | *\\*) . $arg ;;
1738
if test -z "$pic_object" || \
1739
test -z "$non_pic_object" ||
1740
test "$pic_object" = none && \
1741
test "$non_pic_object" = none; then
1742
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1746
# Extract subdirectory from the argument.
1747
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1748
if test "X$xdir" = "X$arg"; then
1754
if test "$pic_object" != none; then
1755
# Prepend the subdirectory the object is found in.
1756
pic_object="$xdir$pic_object"
1758
if test "$prev" = dlfiles; then
1759
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1760
dlfiles="$dlfiles $pic_object"
1764
# If libtool objects are unsupported, then we need to preload.
1769
# CHECK ME: I think I busted this. -Ossama
1770
if test "$prev" = dlprefiles; then
1771
# Preload the old-style object.
1772
dlprefiles="$dlprefiles $pic_object"
1777
libobjs="$libobjs $pic_object"
1782
if test "$non_pic_object" != none; then
1783
# Prepend the subdirectory the object is found in.
1784
non_pic_object="$xdir$non_pic_object"
1786
# A standard non-PIC object
1787
non_pic_objects="$non_pic_objects $non_pic_object"
1788
if test -z "$pic_object" || test "$pic_object" = none ; then
1789
arg="$non_pic_object"
1793
# Only an error if not doing a dry-run.
1794
if test -z "$run"; then
1795
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1800
# Extract subdirectory from the argument.
1801
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1802
if test "X$xdir" = "X$arg"; then
1808
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1809
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1810
libobjs="$libobjs $pic_object"
1811
non_pic_objects="$non_pic_objects $non_pic_object"
1402
1986
for pass in $passes; do
1987
if test "$linkmode,$pass" = "lib,link" ||
1988
test "$linkmode,$pass" = "prog,scan"; then
1403
1992
if test "$linkmode" = prog; then
1404
# Determine which files to process
1408
save_deplibs="$deplibs" # Collect dlpreopened libraries
1994
dlopen) libs="$dlfiles" ;;
1411
1995
dlpreopen) libs="$dlprefiles" ;;
1412
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1997
libs="$deplibs %DEPLIBS%"
1998
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2002
if test "$pass" = dlopen; then
2003
# Collect dlpreopened libraries
2004
save_deplibs="$deplibs"
1415
2007
for deplib in $libs; do
1418
2010
case $deplib in
2011
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2012
if test "$linkmode,$pass" = "prog,link"; then
2013
compile_deplibs="$deplib $compile_deplibs"
2014
finalize_deplibs="$deplib $finalize_deplibs"
2016
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"
2021
if test "$linkmode" != lib && test "$linkmode" != prog; then
2022
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1428
2025
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1429
2026
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
2027
for search_ext in .la $std_shrext .so .a; do
2028
# Search the libtool library
2029
lib="$searchdir/lib${name}${search_ext}"
2030
if test -f "$lib"; then
2031
if test "$search_ext" = ".la"; then
1437
2040
if test "$found" != yes; then
1438
2041
# deplib doesn't seem to be a libtool library
1444
2047
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2050
else # deplib is a libtool library
2051
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2052
# We need to do some special things here, and not later.
2053
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2054
case " $predeps $postdeps " in
2056
if (${SED} -e '2q' $lib |
2057
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2061
*/* | *\\*) . $lib ;;
2064
for l in $old_library $library_names; do
2067
if test "X$ll" = "X$old_library" ; then # only static version available
2069
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2070
test "X$ladir" = "X$lib" && ladir="."
2071
lib=$ladir/$old_library
2072
if test "$linkmode,$pass" = "prog,link"; then
2073
compile_deplibs="$deplib $compile_deplibs"
2074
finalize_deplibs="$deplib $finalize_deplibs"
2076
deplibs="$deplib $deplibs"
2077
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1494
2133
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."
2136
case $deplibs_check_method in
2138
set dummy $deplibs_check_method
2139
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2140
if eval $echo \"$deplib\" 2>/dev/null \
2142
| $EGREP "$match_pattern_regex" > /dev/null; then
2150
if test "$valid_a_lib" != yes; then
2152
$echo "*** Warning: Trying to link with static lib archive $deplib."
2153
$echo "*** I have the capability to make that library automatically link in when"
2154
$echo "*** you link to this library. But I can only do this if you have a"
2155
$echo "*** shared version of the library, which you do not appear to have"
2156
$echo "*** because the file extensions .$libext of this argument makes me believe"
2157
$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!"
2160
$echo "*** Warning: Linking the shared library $output against the"
2161
$echo "*** static library $deplib is not portable!"
1506
2162
deplibs="$deplib $deplibs"
1727
2403
fi # $linkmode = prog...
2405
if test "$linkmode,$pass" = "prog,link"; then
2406
if test -n "$library_names" &&
2407
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2408
# We need to hardcode the library path
2409
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2410
# Make sure the rpath contains only unique directories.
2411
case "$temp_rpath " in
2414
*) temp_rpath="$temp_rpath $absdir" ;;
2418
# Hardcode the library path.
2419
# Skip directories that are in the system default run-time
2421
case " $sys_lib_dlsearch_path " in
2424
case "$compile_rpath " in
2426
*) compile_rpath="$compile_rpath $absdir"
2430
case " $sys_lib_dlsearch_path " in
2433
case "$finalize_rpath " in
2435
*) finalize_rpath="$finalize_rpath $libdir"
2439
fi # $linkmode,$pass = prog,link...
2441
if test "$alldeplibs" = yes &&
2442
{ test "$deplibs_check_method" = pass_all ||
2443
{ test "$build_libtool_libs" = yes &&
2444
test -n "$library_names"; }; }; then
2445
# We only need to search for static libraries
1729
2450
link_static=no # Whether the deplib will be linked statically
1730
2451
if test -n "$library_names" &&
1731
2452
{ 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
2453
if test "$installed" = no; then
1779
2454
notinst_deplibs="$notinst_deplibs $lib"
1780
2455
need_relink=yes
2457
# This is a shared library
2459
# Warn about portability, can't link against -module's on
2460
# some systems (darwin)
2461
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2463
if test "$linkmode" = prog; then
2464
$echo "*** Warning: Linking the executable $output against the loadable module"
2466
$echo "*** Warning: Linking the shared library $output against the loadable module"
2468
$echo "*** $linklib is not portable!"
2470
if test "$linkmode" = lib &&
2471
test "$hardcode_into_libs" = yes; then
2472
# Hardcode the library path.
2473
# Skip directories that are in the system default run-time
2475
case " $sys_lib_dlsearch_path " in
2478
case "$compile_rpath " in
2480
*) compile_rpath="$compile_rpath $absdir"
2484
case " $sys_lib_dlsearch_path " in
2487
case "$finalize_rpath " in
2489
*) finalize_rpath="$finalize_rpath $libdir"
1783
2495
if test -n "$old_archive_from_expsyms_cmds"; then
1784
2496
# figure out the soname
1982
2708
# Just print a warning and add the library to dependency_libs so
1983
2709
# 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."
2711
$echo "*** Warning: This system can not link to static lib archive $lib."
2712
$echo "*** I have the capability to make that library automatically link in when"
2713
$echo "*** you link to this library. But I can only do this if you have a"
2714
$echo "*** shared version of the library, which you do not appear to have."
1989
2715
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."
2716
$echo "*** But as you try to build a module library, libtool will still create "
2717
$echo "*** a static module, that should work as long as the dlopening application"
2718
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1992
2719
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."
2721
$echo "*** However, this would only work if libtool was able to extract symbol"
2722
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2723
$echo "*** not find such a program. So, this module is probably useless."
2724
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
1999
2726
if test "$build_old_libs" = no; then
2000
2727
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"
3111
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3112
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2273
3124
# Check that each of the things are valid numbers.
2274
3125
case $current in
3126
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
3128
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2278
3129
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2283
3134
case $revision in
3135
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
3137
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2287
3138
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3144
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
3146
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2296
3147
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2301
3152
if test "$age" -gt "$current"; then
2302
3153
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2303
3154
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2307
3158
# Calculate the version variables.
2544
3421
int main() { return 0; }
2547
$CC -o conftest conftest.c $deplibs
3424
$LTCC -o conftest conftest.c $deplibs
2548
3425
if test "$?" -eq 0 ; then
2549
3426
ldd_output=`ldd conftest`
2550
3427
for i in $deplibs; do
2551
name="`expr $i : '-l\(.*\)'`"
3428
name=`expr $i : '-l\(.*\)'`
2552
3429
# 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`
3430
if test "$name" != "" && test "$name" -ne "0"; then
3431
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3432
case " $predeps $postdeps " in
3434
newdeplibs="$newdeplibs $i"
3439
if test -n "$i" ; then
2584
3440
libname=`eval \\$echo \"$libname_spec\"`
2585
3441
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2586
3442
set dummy $deplib_matches
2589
3445
newdeplibs="$newdeplibs $i"
2591
3447
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."
3449
$echo "*** Warning: dynamic linker does not accept needed library $i."
3450
$echo "*** I have the capability to make that library automatically link in when"
3451
$echo "*** you link to this library. But I can only do this if you have a"
3452
$echo "*** shared version of the library, which I believe you do not have"
3453
$echo "*** because a test_compile did reveal that the linker did not use it for"
3454
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3458
newdeplibs="$newdeplibs $i"
3462
# Error occurred in the first compile. Let's try to salvage
3463
# the situation: Compile a separate program for each library.
3464
for i in $deplibs; do
3465
name=`expr $i : '-l\(.*\)'`
3466
# If $name is empty we are operating on a -L argument.
3467
if test "$name" != "" && test "$name" != "0"; then
3469
$LTCC -o conftest conftest.c $i
3471
if test "$?" -eq 0 ; then
3472
ldd_output=`ldd conftest`
3473
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3474
case " $predeps $postdeps " in
3476
newdeplibs="$newdeplibs $i"
3481
if test -n "$i" ; then
3482
libname=`eval \\$echo \"$libname_spec\"`
3483
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3484
set dummy $deplib_matches
3486
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3487
newdeplibs="$newdeplibs $i"
3491
$echo "*** Warning: dynamic linker does not accept needed library $i."
3492
$echo "*** I have the capability to make that library automatically link in when"
3493
$echo "*** you link to this library. But I can only do this if you have a"
3494
$echo "*** shared version of the library, which you do not appear to have"
3495
$echo "*** because a test_compile did reveal that the linker did not use this one"
3496
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2599
3500
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."
3502
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3503
$echo "*** make it link in! You will probably need to install it or some"
3504
$echo "*** library that it depends on before this library will be fully"
3505
$echo "*** functional. Installing it before continuing would be even better."
2607
3508
newdeplibs="$newdeplibs $i"
2613
3514
set dummy $deplibs_check_method
2614
3515
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2615
3516
for a_deplib in $deplibs; do
2616
name="`expr $a_deplib : '-l\(.*\)'`"
3517
name=`expr $a_deplib : '-l\(.*\)'`
2617
3518
# 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
3519
if test "$name" != "" && test "$name" != "0"; then
3520
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3521
case " $predeps $postdeps " in
3523
newdeplibs="$newdeplibs $a_deplib"
3528
if test -n "$a_deplib" ; then
3529
libname=`eval \\$echo \"$libname_spec\"`
3530
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3531
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3532
for potent_lib in $potential_libs; do
2623
3533
# Follow soft links.
2624
3534
if ls -lLd "$potent_lib" 2>/dev/null \
2625
3535
| grep " -> " >/dev/null; then
2633
3543
potlib="$potent_lib"
2634
3544
while test -h "$potlib" 2>/dev/null; do
2635
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
3545
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2636
3546
case $potliblink in
2637
3547
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2638
3548
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2641
3551
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2643
| egrep "$file_magic_regex" > /dev/null; then
3553
| $EGREP "$file_magic_regex" > /dev/null; then
2644
3554
newdeplibs="$newdeplibs $a_deplib"
2650
3561
if test -n "$a_deplib" ; then
2651
3562
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."
3564
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3565
$echo "*** I have the capability to make that library automatically link in when"
3566
$echo "*** you link to this library. But I can only do this if you have a"
3567
$echo "*** shared version of the library, which you do not appear to have"
3568
$echo "*** because I did check the linker path looking for a file starting"
3569
if test -z "$potlib" ; then
3570
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3572
$echo "*** with $libname and none of the candidates passed a file format test"
3573
$echo "*** using a file magic. Last file checked: $potlib"
2659
3577
# Add a -L argument.
2665
3583
set dummy $deplibs_check_method
2666
3584
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2667
3585
for a_deplib in $deplibs; do
2668
name="`expr $a_deplib : '-l\(.*\)'`"
3586
name=`expr $a_deplib : '-l\(.*\)'`
2669
3587
# If $name is empty we are operating on a -L argument.
2670
3588
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"
3589
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3590
case " $predeps $postdeps " in
3592
newdeplibs="$newdeplibs $a_deplib"
3597
if test -n "$a_deplib" ; then
3598
libname=`eval \\$echo \"$libname_spec\"`
3599
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3600
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3601
for potent_lib in $potential_libs; do
3602
potlib="$potent_lib" # see symlink-check above in file_magic test
3603
if eval $echo \"$potent_lib\" 2>/dev/null \
3605
| $EGREP "$match_pattern_regex" > /dev/null; then
3606
newdeplibs="$newdeplibs $a_deplib"
2684
3613
if test -n "$a_deplib" ; then
2685
3614
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."
3616
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3617
$echo "*** I have the capability to make that library automatically link in when"
3618
$echo "*** you link to this library. But I can only do this if you have a"
3619
$echo "*** shared version of the library, which you do not appear to have"
3620
$echo "*** because I did check the linker path looking for a file starting"
3621
if test -z "$potlib" ; then
3622
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3624
$echo "*** with $libname and none of the candidates passed a file format test"
3625
$echo "*** using a regex pattern. Last file checked: $potlib"
2693
3629
# Add a -L argument.
2698
3634
none | unknown | *)
2700
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2701
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2702
grep . >/dev/null; then
3636
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3637
-e 's/ -[LR][^ ]*//g'`
3638
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3639
for i in $predeps $postdeps ; do
3640
# can't use Xsed below, because $i might contain '/'
3641
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3644
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3645
| grep . >/dev/null; then
2704
3647
if test "X$deplibs_check_method" = "Xnone"; then
2705
echo "*** Warning: inter-library dependencies are not supported in this platform."
3648
$echo "*** Warning: inter-library dependencies are not supported in this platform."
2707
echo "*** Warning: inter-library dependencies are not known to be supported."
3650
$echo "*** Warning: inter-library dependencies are not known to be supported."
2709
echo "*** All declared inter-library dependencies are being dropped."
3652
$echo "*** All declared inter-library dependencies are being dropped."
2710
3653
droppeddeps=yes
2727
3670
if test "$droppeddeps" = yes; then
2728
3671
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."
3673
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3674
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3675
$echo "*** a static module, that should work as long as the dlopening"
3676
$echo "*** application is linked with the -dlopen flag."
2734
3677
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."
3679
$echo "*** However, this would only work if libtool was able to extract symbol"
3680
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3681
$echo "*** not find such a program. So, this module is probably useless."
3682
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2741
3684
if test "$build_old_libs" = no; then
2742
3685
oldlibs="$output_objdir/$libname.$libext"
2746
3689
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."
3692
$echo "*** The inter-library dependencies that have been dropped here will be"
3693
$echo "*** automatically added whenever a program is linked with this library"
3694
$echo "*** or is declared to -dlopen it."
2753
3696
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."
3698
$echo "*** Since this library must not contain undefined symbols,"
3699
$echo "*** because either the platform does not support them or"
3700
$echo "*** it was explicitly requested with -no-undefined,"
3701
$echo "*** libtool will only create a static version of it."
2759
3702
if test "$build_old_libs" = no; then
2760
3703
oldlibs="$output_objdir/$libname.$libext"
2761
3704
build_libtool_libs=module
2877
3810
$show "generating symbol list for \`$libname.la'"
2878
3811
export_symbols="$output_objdir/$libname.exp"
2879
3812
$run $rm $export_symbols
2880
eval cmds=\"$export_symbols_cmds\"
3813
cmds=$export_symbols_cmds
2881
3814
save_ifs="$IFS"; IFS='~'
2882
3815
for cmd in $cmds; do
2883
3816
IFS="$save_ifs"
2885
$run eval "$cmd" || exit $?
3818
if len=`expr "X$cmd" : ".*"` &&
3819
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3821
$run eval "$cmd" || exit $?
3822
skipped_export=false
3824
# The command line is too long to execute in one step.
3825
$show "using reloadable object file for export list..."
3827
# Break out early, otherwise skipped_export may be
3828
# set to false by a later but shorter cmd.
2887
3832
IFS="$save_ifs"
2888
3833
if test -n "$export_symbols_regex"; then
2889
$show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2890
$run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3834
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3835
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2891
3836
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
2892
3837
$run eval '$mv "${export_symbols}T" "$export_symbols"'
2898
3843
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3847
for test_deplib in $deplibs; do
3848
case " $convenience " in
3849
*" $test_deplib "*) ;;
3851
tmp_deplibs="$tmp_deplibs $test_deplib"
3855
deplibs="$tmp_deplibs"
2901
3857
if test -n "$convenience"; then
2902
3858
if test -n "$whole_archive_flag_spec"; then
3859
save_libobjs=$libobjs
2903
3860
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2905
3862
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
3863
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`
3865
func_extract_archives $gentop $convenience
3866
libobjs="$libobjs $func_extract_archives_result"
2941
3870
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2942
3871
eval flag=\"$thread_safe_flag_spec\"
2943
3872
linker_flags="$linker_flags $flag"
2951
3880
# Do each of the archive commands.
3881
if test "$module" = yes && test -n "$module_cmds" ; then
3882
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3883
eval test_cmds=\"$module_expsym_cmds\"
3884
cmds=$module_expsym_cmds
3886
eval test_cmds=\"$module_cmds\"
2952
3890
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2953
eval cmds=\"$archive_expsym_cmds\"
2955
eval cmds=\"$archive_cmds\"
3891
eval test_cmds=\"$archive_expsym_cmds\"
3892
cmds=$archive_expsym_cmds
3894
eval test_cmds=\"$archive_cmds\"
3899
if test "X$skipped_export" != "X:" &&
3900
len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3901
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3904
# The command line is too long to link in one step, link piecewise.
3905
$echo "creating reloadable object files..."
3907
# Save the value of $output and $libobjs because we want to
3908
# use them later. If we have whole_archive_flag_spec, we
3909
# want to use save_libobjs as it was before
3910
# whole_archive_flag_spec was expanded, because we can't
3911
# assume the linker understands whole_archive_flag_spec.
3912
# This may have to be revisited, in case too many
3913
# convenience libraries get linked in and end up exceeding
3915
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3916
save_libobjs=$libobjs
3919
output_la=`$echo "X$output" | $Xsed -e "$basename"`
3921
# Clear the reloadable object creation command queue and
3922
# initialize k to one.
3929
output=$output_objdir/$output_la-${k}.$objext
3930
# Loop over the list of objects to be linked.
3931
for obj in $save_libobjs
3933
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3934
if test "X$objlist" = X ||
3935
{ len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3936
test "$len" -le "$max_cmd_len"; }; then
3937
objlist="$objlist $obj"
3939
# The command $test_cmds is almost too long, add a
3940
# command to the queue.
3941
if test "$k" -eq 1 ; then
3942
# The first file doesn't have a previous command to add.
3943
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3945
# All subsequent reloadable object files will link in
3946
# the last one created.
3947
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3949
last_robj=$output_objdir/$output_la-${k}.$objext
3951
output=$output_objdir/$output_la-${k}.$objext
3956
# Handle the remaining objects by creating one last
3957
# reloadable object file. All subsequent reloadable object
3958
# files will link in the last one created.
3959
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3960
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3962
if ${skipped_export-false}; then
3963
$show "generating symbol list for \`$libname.la'"
3964
export_symbols="$output_objdir/$libname.exp"
3965
$run $rm $export_symbols
3967
# Append the command to create the export file.
3968
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3971
# Set up a command to remove the reloadable object files
3972
# after they are used.
3974
while test "$i" -lt "$k"
3977
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3980
$echo "creating a temporary reloadable object file: $output"
3982
# Loop through the commands generated above and execute them.
3983
save_ifs="$IFS"; IFS='~'
3984
for cmd in $concat_cmds; do
3987
$run eval "$cmd" || exit $?
3992
# Restore the value of output.
3995
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3996
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3998
# Expand the library linking commands again to reset the
3999
# value of $libobjs for piecewise linking.
4001
# Do each of the archive commands.
4002
if test "$module" = yes && test -n "$module_cmds" ; then
4003
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4004
cmds=$module_expsym_cmds
4009
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4010
cmds=$archive_expsym_cmds
4016
# Append the command to remove the reloadable object files
4017
# to the just-reset $cmds.
4018
eval cmds=\"\$cmds~\$rm $delfiles\"
2957
4020
save_ifs="$IFS"; IFS='~'
2958
4021
for cmd in $cmds; do
2959
4022
IFS="$save_ifs"
2961
$run eval "$cmd" || exit $?
4025
$run eval "$cmd" || {
4028
# Restore the uninstalled library and exit
4029
if test "$mode" = relink; then
4030
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
2963
4036
IFS="$save_ifs"
2965
4038
# Restore the uninstalled library and exit
2966
4039
if test "$mode" = relink; then
2967
4040
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4042
if test -n "$convenience"; then
4043
if test -z "$whole_archive_flag_spec"; then
4044
$show "${rm}r $gentop"
4045
$run ${rm}r "$gentop"
2971
4052
# Create links to the real library.
3328
4379
if test -n "$exclude_expsyms"; then
3329
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4380
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3330
4381
$run eval '$mv "$nlist"T "$nlist"'
3333
4384
if test -n "$export_symbols_regex"; then
3334
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4385
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3335
4386
$run eval '$mv "$nlist"T "$nlist"'
3338
4389
# Prepare the list of exported symbols
3339
4390
if test -z "$export_symbols"; then
3340
export_symbols="$output_objdir/$output.exp"
4391
export_symbols="$output_objdir/$outputname.exp"
3341
4392
$run $rm $export_symbols
3342
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4393
$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'
4395
$run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4396
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3346
4397
$run eval 'mv "$nlist"T "$nlist"'
3350
4401
for arg in $dlprefiles; do
3351
4402
$show "extracting global C symbols from \`$arg'"
3352
name=`echo "$arg" | sed -e 's%^.*/%%'`
3353
$run eval 'echo ": $name " >> "$nlist"'
4403
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4404
$run eval '$echo ": $name " >> "$nlist"'
3354
4405
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3606
4682
# win32 will think the script is a binary if it has
3607
4683
# a .exe suffix, so we strip it off here.
3608
4684
case $output in
3609
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
4685
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3611
4687
# test for cygwin because mv fails w/o .exe extensions
3613
*cygwin*) exeext=.exe ;;
4691
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4695
*cygwin* | *mingw* )
4696
cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4697
cwrapper=`$echo ${output}.exe`
4698
$rm $cwrappersource $cwrapper
4699
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4701
cat > $cwrappersource <<EOF
4703
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4704
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4706
The $output program cannot be directly executed until all the libtool
4707
libraries that it depends on are installed.
4709
This wrapper executable should never be moved out of the build directory.
4710
If it is, it will not operate correctly.
4712
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4713
but could eventually absorb all of the scripts functionality and
4714
exec $objdir/$outputname directly.
4717
cat >> $cwrappersource<<"EOF"
4725
#if defined(PATH_MAX)
4726
# define LT_PATHMAX PATH_MAX
4727
#elif defined(MAXPATHLEN)
4728
# define LT_PATHMAX MAXPATHLEN
4730
# define LT_PATHMAX 1024
4733
#ifndef DIR_SEPARATOR
4734
#define DIR_SEPARATOR '/'
4737
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4739
#define HAVE_DOS_BASED_FILE_SYSTEM
4740
#ifndef DIR_SEPARATOR_2
4741
#define DIR_SEPARATOR_2 '\\'
4745
#ifndef DIR_SEPARATOR_2
4746
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4747
#else /* DIR_SEPARATOR_2 */
4748
# define IS_DIR_SEPARATOR(ch) \
4749
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4750
#endif /* DIR_SEPARATOR_2 */
4752
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4753
#define XFREE(stale) do { \
4754
if (stale) { free ((void *) stale); stale = 0; } \
4757
const char *program_name = NULL;
4759
void * xmalloc (size_t num);
4760
char * xstrdup (const char *string);
4761
char * basename (const char *name);
4762
char * fnqualify(const char *path);
4763
char * strendzap(char *str, const char *pat);
4764
void lt_fatal (const char *message, ...);
4767
main (int argc, char *argv[])
4772
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4773
newargz = XMALLOC(char *, argc+2);
4776
cat >> $cwrappersource <<EOF
4777
newargz[0] = "$SHELL";
4780
cat >> $cwrappersource <<"EOF"
4781
newargz[1] = fnqualify(argv[0]);
4782
/* we know the script has the same name, without the .exe */
4783
/* so make sure newargz[1] doesn't end in .exe */
4784
strendzap(newargz[1],".exe");
4785
for (i = 1; i < argc; i++)
4786
newargz[i+1] = xstrdup(argv[i]);
4787
newargz[argc+1] = NULL;
4790
cat >> $cwrappersource <<EOF
4791
execv("$SHELL",newargz);
4794
cat >> $cwrappersource <<"EOF"
4799
xmalloc (size_t num)
4801
void * p = (void *) malloc (num);
4803
lt_fatal ("Memory exhausted");
4809
xstrdup (const char *string)
4811
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4816
basename (const char *name)
4820
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4821
/* Skip over the disk name in MSDOS pathnames. */
4822
if (isalpha (name[0]) && name[1] == ':')
4826
for (base = name; *name; name++)
4827
if (IS_DIR_SEPARATOR (*name))
4829
return (char *) base;
4833
fnqualify(const char *path)
4837
char tmp[LT_PATHMAX + 1];
4839
assert(path != NULL);
4841
/* Is it qualified already? */
4842
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4843
if (isalpha (path[0]) && path[1] == ':')
4844
return xstrdup (path);
4846
if (IS_DIR_SEPARATOR (path[0]))
4847
return xstrdup (path);
4849
/* prepend the current directory */
4850
/* doesn't handle '~' */
4851
if (getcwd (tmp, LT_PATHMAX) == NULL)
4852
lt_fatal ("getcwd failed");
4853
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4854
p = XMALLOC(char, size);
4855
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4860
strendzap(char *str, const char *pat)
4864
assert(str != NULL);
4865
assert(pat != NULL);
4868
patlen = strlen(pat);
4872
str += len - patlen;
4873
if (strcmp(str, pat) == 0)
4880
lt_error_core (int exit_status, const char * mode,
4881
const char * message, va_list ap)
4883
fprintf (stderr, "%s: %s: ", program_name, mode);
4884
vfprintf (stderr, message, ap);
4885
fprintf (stderr, ".\n");
4887
if (exit_status >= 0)
4892
lt_fatal (const char *message, ...)
4895
va_start (ap, message);
4896
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4900
# we should really use a build-platform specific compiler
4901
# here, but OTOH, the wrappers (shell script and this C one)
4902
# are only useful if you want to execute the "real" binary.
4903
# Since the "real" binary is built for $host, then this
4904
# wrapper might as well be built for $host, too.
4905
$run $LTCC -s -o $cwrapper $cwrappersource
3617
trap "$rm $output; exit 1" 1 2 15
4909
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
3619
4911
$echo > $output "\
3817
5097
oldobjs="$libobjs_save"
3818
5098
build_libtool_libs=no
3820
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
5100
oldobjs="$old_deplibs $non_pic_objects"
3822
5102
addlibs="$old_convenience"
3825
5105
if test -n "$addlibs"; then
3826
5106
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
5107
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`
5109
func_extract_archives $gentop $addlibs
5110
oldobjs="$oldobjs $func_extract_archives_result"
3862
5113
# Do each command in the archive commands.
3863
5114
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3864
eval cmds=\"$old_archive_from_new_cmds\"
5115
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
5117
# POSIX demands no paths to be encoded in archives. We have
5118
# to avoid creating archives with duplicate basenames if we
5119
# might have to extract them afterwards, e.g., when creating a
5120
# static archive out of a convenience library, or when linking
5121
# the entirety of a libtool archive into another (currently
5122
# not supported by libtool).
5123
if (for obj in $oldobjs
5125
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5126
done | sort | sort -uc >/dev/null 2>&1); then
5129
$echo "copying selected object files to avoid basename conflicts..."
5131
if test -z "$gentop"; then
5132
gentop="$output_objdir/${outputname}x"
5133
generated="$generated $gentop"
5135
$show "${rm}r $gentop"
5136
$run ${rm}r "$gentop"
5137
$show "$mkdir $gentop"
5138
$run $mkdir "$gentop"
5140
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 $?
5145
save_oldobjs=$oldobjs
5148
for obj in $save_oldobjs
5150
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5151
case " $oldobjs " in
5152
" ") oldobjs=$obj ;;
5155
# Make sure we don't pick an alternate name that also
5157
newobj=lt$counter-$objbase
5158
counter=`expr $counter + 1`
5159
case " $oldobjs " in
5160
*[\ /]"$newobj "*) ;;
5161
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5164
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5165
$run ln "$obj" "$gentop/$newobj" ||
5166
$run cp "$obj" "$gentop/$newobj"
5167
oldobjs="$oldobjs $gentop/$newobj"
5169
*) oldobjs="$oldobjs $obj" ;;
3884
5174
eval cmds=\"$old_archive_cmds\"
5176
if len=`expr "X$cmds" : ".*"` &&
5177
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5178
cmds=$old_archive_cmds
5180
# the command line is too long to link in one step, link in parts
5181
$echo "using piecewise archive linking..."
5186
save_oldobjs=$oldobjs
5188
# Is there a better way of finding the last object in the list?
5189
for obj in $save_oldobjs
5193
for obj in $save_oldobjs
5195
oldobjs="$objlist $obj"
5196
objlist="$objlist $obj"
5197
eval test_cmds=\"$old_archive_cmds\"
5198
if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5199
test "$len" -le "$max_cmd_len"; then
5202
# the above command should be used before it gets too long
5204
if test "$obj" = "$last_oldobj" ; then
5207
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5208
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5214
if test "X$oldobjs" = "X" ; then
5215
eval cmds=\"\$concat_cmds\"
5217
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
3886
5221
save_ifs="$IFS"; IFS='~'
3887
5222
for cmd in $cmds; do
3888
5224
IFS="$save_ifs"
3890
5226
$run eval "$cmd" || exit $?
3959
5299
for lib in $dlprefiles; do
3960
5300
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3961
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5301
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3962
5302
if test -z "$libdir"; then
3963
5303
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3966
5306
newdlprefiles="$newdlprefiles $libdir/$name"
3968
5308
dlprefiles="$newdlprefiles"
5311
for lib in $dlfiles; do
5313
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5314
*) abs=`pwd`"/$lib" ;;
5316
newdlfiles="$newdlfiles $abs"
5318
dlfiles="$newdlfiles"
5320
for lib in $dlprefiles; do
5322
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5323
*) abs=`pwd`"/$lib" ;;
5325
newdlprefiles="$newdlprefiles $abs"
5327
dlprefiles="$newdlprefiles"
3971
5330
# place dlname in correct position for cygwin
3972
5331
tdlname=$dlname
3973
5332
case $host,$output,$installed,$module,$dlname in
3974
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5333
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3976
5335
$echo > $output "\
3977
5336
# $outputname - a libtool library file
4219
5584
if test -n "$relink_command"; then
4220
5585
# Determine the prefix the user has applied to our future dir.
4221
inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
5586
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
4223
5588
# Don't allow the user to place us outside of our expected
4224
5589
# location b/c this prevents finding dependent libraries that
4225
5590
# are installed to the same prefix.
5591
# At present, this check doesn't affect windows .dll's that
5592
# are installed into $libdir/../bin (currently, that works fine)
5593
# but it's something to keep an eye on.
4226
5594
if test "$inst_prefix_dir" = "$destdir"; then
4227
5595
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4231
5599
if test -n "$inst_prefix_dir"; then
4232
5600
# 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%"`
5601
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@%%"`
5603
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4238
5606
$echo "$modename: warning: relinking \`$file'" 1>&2
4348
5729
destfile="$destdir/$destfile"
5732
# If the file is missing, and there is a .exe on the end, strip it
5733
# because it is most likely a libtool script we actually want to
5738
if test ! -f "$file"; then
5739
file=`$echo $file|${SED} 's,.exe$,,'`
4351
5745
# 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
5748
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5754
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4353
5755
notinst_deplibs=
4354
5756
relink_command=
5758
# Note that it is not necessary on cygwin/mingw to append a dot to
5759
# foo even if both foo and FILE.exe exist: automatic-append-.exe
5760
# behavior happens only for exec(3), not for open(2)! Also, sourcing
5761
# `FILE.' does not work on cygwin managed mounts.
4356
5763
# If there is no directory component, then add one.
4358
*/* | *\\*) . $file ;;
5765
*/* | *\\*) . ${wrapper} ;;
5766
*) . ./${wrapper} ;;
4362
5769
# Check the variables that should have been set.
4363
5770
if test -z "$notinst_deplibs"; then
4364
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
5771
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4526
5940
# Exit here if they wanted silent mode.
4527
test "$show" = : && exit 0
5941
test "$show" = : && exit $EXIT_SUCCESS
4529
echo "----------------------------------------------------------------------"
4530
echo "Libraries have been installed in:"
5943
$echo "----------------------------------------------------------------------"
5944
$echo "Libraries have been installed in:"
4531
5945
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:"
5949
$echo "If you ever happen to want to link against installed libraries"
5950
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5951
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5952
$echo "flag during linking and do at least one of the following:"
4539
5953
if test -n "$shlibpath_var"; then
4540
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4541
echo " during execution"
5954
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5955
$echo " during execution"
4543
5957
if test -n "$runpath_var"; then
4544
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4545
echo " during linking"
5958
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5959
$echo " during linking"
4547
5961
if test -n "$hardcode_libdir_flag_spec"; then
4549
5963
eval flag=\"$hardcode_libdir_flag_spec\"
4551
echo " - use the \`$flag' linker flag"
5965
$echo " - use the \`$flag' linker flag"
4553
5967
if test -n "$admincmds"; then
4554
echo " - have your system administrator run these commands:$admincmds"
5968
$echo " - have your system administrator run these commands:$admincmds"
4556
5970
if test -f /etc/ld.so.conf; then
4557
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5971
$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 "----------------------------------------------------------------------"
5974
$echo "See any operating system documentation about shared libraries for"
5975
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5976
$echo "----------------------------------------------------------------------"
4566
5980
# libtool execute mode
4816
if test "$build_old_libs" = yes; then
4817
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4818
rmfiles="$rmfiles $dir/$oldobj"
6233
# Possibly a libtool object, so verify it.
6234
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6239
# Add PIC object to the list of files to remove.
6240
if test -n "$pic_object" \
6241
&& test "$pic_object" != none; then
6242
rmfiles="$rmfiles $dir/$pic_object"
6245
# Add non-PIC object to the list of files to remove.
6246
if test -n "$non_pic_object" \
6247
&& test "$non_pic_object" != none; then
6248
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
6254
if test "$mode" = clean ; then
6258
file=`$echo $file|${SED} 's,.exe$,,'`
6259
noexename=`$echo $name|${SED} 's,.exe$,,'`
6260
# $file with .exe has already been added to rmfiles,
6261
# add $file without .exe
6262
rmfiles="$rmfiles $file"
6265
# Do a test to see if this is a libtool program.
6266
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"
6270
# note $name still contains .exe if it was in $file originally
6271
# as does the version of $file that was added into $rmfiles
6272
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6273
if test "$fast_install" = yes && test -n "$relink_command"; then
6274
rmfiles="$rmfiles $objdir/lt-$name"
6276
if test "X$noexename" != "X$name" ; then
6277
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
5050
6504
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5051
6505
$echo "$help" 1>&2
5057
6511
$echo "Try \`$modename --help' for more information about other modes."
6515
# The TAGs below are defined such that we never get into a situation
6516
# in which we disable both kinds of libraries. Given conflicting
6517
# choices, we go for a static library, that is the most portable,
6518
# since we can't tell whether shared libraries were disabled because
6519
# the user asked for that or because the platform doesn't support
6520
# them. This is particularly important on AIX, because we don't
6521
# support having both static and shared libraries enabled at the same
6522
# time on that platform, so we default to a shared-only configuration.
6523
# If a disable-shared tag is given, we'll fallback to a static-only
6524
# configuration. But we'll never go from static-only to shared-only.
6526
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6527
build_libtool_libs=no
6529
# ### END LIBTOOL TAG CONFIG: disable-shared
6531
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6532
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6533
# ### END LIBTOOL TAG CONFIG: disable-static
5061
6535
# Local Variables:
5062
6536
# mode:shell-script