114
128
lo2o="s/\\.lo\$/.${objext}/"
115
129
o2lo="s/\\.${objext}\$/.lo/"
131
#####################################
132
# Shell function definitions:
133
# This seems to be the best place for them
135
# func_win32_libid arg
136
# return the library type of file 'arg'
138
# Need a lot of goo to handle *both* DLLs and import libs
139
# Has to be a shell function in order to 'eat' the argument
140
# that is supplied when $file_magic_command is called.
141
func_win32_libid () {
142
win32_libid_type="unknown"
143
win32_fileres=`file -L $1 2>/dev/null`
144
case $win32_fileres in
145
*ar\ archive\ import\ library*) # definitely import
146
win32_libid_type="x86 archive import"
148
*ar\ archive*) # could be an import, or static
149
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
150
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
151
win32_nmres=`eval $NM -f posix -A $1 | \
152
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
153
if test "X$win32_nmres" = "Ximport" ; then
154
win32_libid_type="x86 archive import"
156
win32_libid_type="x86 archive static"
161
win32_libid_type="x86 DLL"
163
*executable*) # but shell scripts are "executable" too...
164
case $win32_fileres in
165
*MS\ Windows\ PE\ Intel*)
166
win32_libid_type="x86 DLL"
171
$echo $win32_libid_type
176
# Infer tagged configuration to use if any are available and
177
# if one wasn't chosen via the "--tag" command line option.
178
# Only attempt this if the compiler in the base compile
179
# command doesn't match the default compiler.
180
# arg is usually of the form 'gcc ...'
182
if test -n "$available_tags" && test -z "$tagname"; then
186
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
190
CC_quoted="$CC_quoted $arg"
193
# Blanks in the command may have been stripped by the calling shell,
194
# but not from the CC environment variable when configure was run.
195
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
196
# Blanks at the start of $base_compile will cause this to fail
197
# if we don't check for them as well.
199
for z in $available_tags; do
200
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
201
# Evaluate the configuration.
202
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
205
# Double-quote args containing other shell metacharacters.
207
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
211
CC_quoted="$CC_quoted $arg"
214
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
215
# The compiler in the base compile command matches
216
# the one in the tagged configuration.
217
# Assume this is the tagged configuration we want.
224
# If $tagname still isn't set, then no tagged configuration
225
# was found and let the user know that the "--tag" command
226
# line option must be used.
227
if test -z "$tagname"; then
228
$echo "$modename: unable to infer tagged configuration"
229
$echo "$modename: specify a tag with \`--tag'" 1>&2
232
# $echo "$modename: using $tagname tagged configuration"
238
# End of Shell function definitions
239
#####################################
242
eval std_shrext=\"$shrext_cmds\"
117
244
# Parse our command line options once, thoroughly.
245
while test "$#" -gt 0
281
456
modename="$modename: compile"
282
457
# Get the compilation command and the source file.
459
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
295
# Aesthetically quote the previous argument.
297
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
300
# Double-quote args containing other shell metacharacters.
301
# Many Bourne shells cannot handle close brackets correctly
302
# in scan sets, so we specify it separately.
303
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
308
# Add the previous argument to base_compile.
309
if test -z "$base_compile"; then
310
base_compile="$lastarg"
312
base_compile="$base_compile $lastarg"
318
# Accept any command-line options.
321
if test "$user_target" != "no"; then
322
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
349
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
351
save_ifs="$IFS"; IFS=','
355
# Double-quote args containing other shell metacharacters.
356
# Many Bourne shells cannot handle close brackets correctly
357
# in scan sets, so we specify it separately.
359
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
363
lastarg="$lastarg $arg"
366
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
368
# Add the arguments to base_compile.
369
if test -z "$base_compile"; then
370
base_compile="$lastarg"
372
base_compile="$base_compile $lastarg"
380
# The next one is the -o target name
385
# We got the output file
470
# do not "continue". Instead, add this to base_compile
392
# Accept the current argument as the source file.
482
# Accept any command-line options.
485
if test -n "$libobj" ; then
486
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
493
-static | -prefer-pic | -prefer-non-pic)
504
arg_mode=arg # the next one goes into the "base_compile" arg list
505
continue # The current "srcfile" will either be retained or
506
;; # replaced later. I would guess that would be a bug.
509
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
511
save_ifs="$IFS"; IFS=','
515
# Double-quote args containing other shell metacharacters.
516
# Many Bourne shells cannot handle close brackets correctly
517
# in scan sets, so we specify it separately.
519
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
523
lastarg="$lastarg $arg"
526
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
528
# Add the arguments to base_compile.
529
base_compile="$base_compile $lastarg"
534
# Accept the current argument as the source file.
535
# The previous "srcfile" becomes the current argument.
542
esac # case $arg_mode
396
544
# Aesthetically quote the previous argument.
398
# Backslashify any backslashes, double quotes, and dollar signs.
399
# These are the only characters that are still specially
400
# interpreted inside of double-quoted scrings.
401
545
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
403
548
# Double-quote args containing other shell metacharacters.
404
549
# Many Bourne shells cannot handle close brackets correctly
405
550
# in scan sets, so we specify it separately.
407
551
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
408
552
lastarg="\"$lastarg\""
412
# Add the previous argument to base_compile.
413
if test -z "$base_compile"; then
414
base_compile="$lastarg"
416
base_compile="$base_compile $lastarg"
556
base_compile="$base_compile $lastarg"
561
$echo "$modename: you must specify an argument for -Xcompile"
565
$echo "$modename: you must specify a target with \`-o'" 1>&2
424
569
# Get the name of the library object.
425
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
428
$echo "$modename: you must specify a target with \`-o'" 1>&2
570
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
433
574
# Recognize several different file suffixes.
434
575
# If the user specifies -o file.o, it is replaced with file.lo
437
578
*.ada) xform=ada ;;
438
579
*.adb) xform=adb ;;
518
693
$run $rm $removelist
521
echo $srcfile > "$lockfile"
696
$echo $srcfile > "$lockfile"
524
699
if test -n "$fix_srcfile_path"; then
525
700
eval srcfile=\"$fix_srcfile_path\"
703
$run $rm "$libobj" "${libobj}T"
705
# Create a libtool object file (analogous to a ".la" file),
706
# but don't create it if we're doing a dry run.
707
test -z "$run" && cat > ${libobj}T <<EOF
708
# $libobj - a libtool object file
709
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
711
# Please DO NOT delete this file!
712
# It is necessary for linking the library.
714
# Name of the PIC object.
528
717
# Only build a PIC object if we are building libtool libraries.
529
718
if test "$build_libtool_libs" = yes; then
530
719
# Without this assignment, base_compile gets emptied.
531
720
fbsd_hideous_sh_bug=$base_compile
533
722
if test "$pic_mode" != no; then
534
# All platforms use -DPIC, to notify preprocessed assembler code.
535
command="$base_compile $srcfile $pic_flag -DPIC"
723
command="$base_compile $srcfile $pic_flag"
537
725
# Don't build PIC code
538
726
command="$base_compile $srcfile"
540
if test "$build_old_libs" = yes; then
542
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
543
if test "X$dir" = "X$libobj"; then
548
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
550
if test -d "$dir"; then
557
if test $status -ne 0 && test ! -d $dir; then
562
if test "$compiler_o_lo" = yes; then
564
command="$command -o $output_obj"
565
elif test "$compiler_c_o" = yes; then
567
command="$command -o $output_obj"
570
$run $rm "$output_obj"
729
if test ! -d "${xdir}$objdir"; then
730
$show "$mkdir ${xdir}$objdir"
731
$run $mkdir ${xdir}$objdir
733
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
738
if test -z "$output_obj"; then
739
# Place PIC objects in $objdir
740
command="$command -o $lobj"
743
$run $rm "$lobj" "$output_obj"
572
746
if $run eval "$command"; then :
574
748
test -n "$output_obj" && $run $rm $removelist
578
752
if test "$need_locks" = warn &&
579
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
753
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
581
755
*** ERROR, $lockfile contains:
582
756
`cat $lockfile 2>/dev/null`
594
768
$run $rm $removelist
598
772
# Just move the object if needed, then go on to compile the next one
599
if test x"$output_obj" != x"$libobj"; then
600
$show "$mv $output_obj $libobj"
601
if $run $mv $output_obj $libobj; then :
609
# If we have no pic_flag, then copy the object into place and finish.
610
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
611
test "$build_old_libs" = yes; then
612
# Rename the .lo from within objdir to obj
613
if test -f $obj; then
618
$show "$mv $libobj $obj"
619
if $run $mv $libobj $obj; then :
626
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
627
if test "X$xdir" = "X$obj"; then
632
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
633
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
634
# Now arrange that obj and lo_libobj become the same file
635
$show "(cd $xdir && $LN_S $baseobj $libobj)"
636
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
637
# Unlock the critical section if it was locked
638
if test "$need_locks" != no; then
773
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
774
$show "$mv $output_obj $lobj"
775
if $run $mv $output_obj $lobj; then :
783
# Append the name of the PIC object to the libtool object file.
784
test -z "$run" && cat >> ${libobj}T <<EOF
785
pic_object='$objdir/$objname'
649
789
# Allow error messages only from the first compilation.
650
suppress_output=' >/dev/null 2>&1'
790
if test "$suppress_opt" = yes; then
791
suppress_output=' >/dev/null 2>&1'
794
# No PIC object so indicate it doesn't exist in the libtool
796
test -z "$run" && cat >> ${libobj}T <<EOF
653
802
# Only build a position-dependent object if we build old libraries.
708
# Create an invalid libtool object if no PIC, so that we do not
709
# accidentally link it into a program.
710
if test "$build_libtool_libs" != yes; then
711
$show "echo timestamp > $libobj"
712
$run eval "echo timestamp > \$libobj" || exit $?
714
# Move the .lo from within objdir
715
$show "$mv $libobj $lo_libobj"
716
if $run $mv $libobj $lo_libobj; then :
855
# Append the name of the non-PIC object the libtool object file.
856
# Only append if the libtool object file exists.
857
test -z "$run" && cat >> ${libobj}T <<EOF
858
# Name of the non-PIC object.
859
non_pic_object='$objname'
863
# Append the name of the non-PIC object the libtool object file.
864
# Only append if the libtool object file exists.
865
test -z "$run" && cat >> ${libobj}T <<EOF
866
# Name of the non-PIC object.
872
$run $mv "${libobj}T" "${libobj}"
725
874
# Unlock the critical section if it was locked
726
875
if test "$need_locks" != no; then
727
876
$run $rm "$lockfile"
733
882
# libtool link mode
1063
precious_files_regex="$arg"
1073
if test -f "$arg"; then
1076
for fil in `cat $save_arg`
1078
# moreargs="$moreargs $fil"
1080
# A libtool-controlled object.
1082
# Check to see that this really is a libtool object.
1083
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1088
# If there is no directory component, then add one.
1090
*/* | *\\*) . $arg ;;
1094
if test -z "$pic_object" || \
1095
test -z "$non_pic_object" ||
1096
test "$pic_object" = none && \
1097
test "$non_pic_object" = none; then
1098
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1102
# Extract subdirectory from the argument.
1103
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1104
if test "X$xdir" = "X$arg"; then
1110
if test "$pic_object" != none; then
1111
# Prepend the subdirectory the object is found in.
1112
pic_object="$xdir$pic_object"
1114
if test "$prev" = dlfiles; then
1115
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1116
dlfiles="$dlfiles $pic_object"
1120
# If libtool objects are unsupported, then we need to preload.
1125
# CHECK ME: I think I busted this. -Ossama
1126
if test "$prev" = dlprefiles; then
1127
# Preload the old-style object.
1128
dlprefiles="$dlprefiles $pic_object"
1133
libobjs="$libobjs $pic_object"
1138
if test "$non_pic_object" != none; then
1139
# Prepend the subdirectory the object is found in.
1140
non_pic_object="$xdir$non_pic_object"
1142
# A standard non-PIC object
1143
non_pic_objects="$non_pic_objects $non_pic_object"
1144
if test -z "$pic_object" || test "$pic_object" = none ; then
1145
arg="$non_pic_object"
1149
# Only an error if not doing a dry-run.
1150
if test -z "$run"; then
1151
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1156
# Extract subdirectory from the argument.
1157
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1158
if test "X$xdir" = "X$arg"; then
1164
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1165
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1166
libobjs="$libobjs $pic_object"
1167
non_pic_objects="$non_pic_objects $non_pic_object"
1172
$echo "$modename: link input file \`$save_arg' does not exist"
913
1180
# We need an absolute path.
915
1182
[\\/]* | [A-Za-z]:[\\/]*) ;;
917
1184
$echo "$modename: only absolute run-paths are allowed" 1>&2
921
1188
if test "$prev" = rpath; then
1069
1349
# Do not include libc due to us having libc/libc_r.
1070
1350
test "X$arg" = "X-lc" && continue
1352
*-*-rhapsody* | *-*-darwin1.[012])
1353
# Rhapsody C and math libraries are in the System framework
1354
deplibs="$deplibs -framework System"
1073
elif test "X$arg" = "X-lc_r"; then
1357
elif test "X$arg" = "X-lc_r"; then
1075
1359
*-*-openbsd* | *-*-freebsd*)
1076
# Do not include libc_r directly, use -pthread flag.
1360
# Do not include libc_r directly, use -pthread flag.
1081
1365
deplibs="$deplibs $arg"
1369
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1370
deplibs="$deplibs $arg"
1379
# gcc -m* arguments should be passed to the linker via $compiler_flags
1380
# in order to pass architecture information to the linker
1381
# (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1382
# but this is not reliable with gcc because gcc may use -mfoo to
1383
# select a different linker, different libraries, etc, while
1384
# -Wl,-mfoo simply passes -mfoo to the linker.
1386
# Unknown arguments in both finalize_command and compile_command need
1387
# to be aesthetically quoted because they are evaled later.
1388
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1390
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1394
compile_command="$compile_command $arg"
1395
finalize_command="$finalize_command $arg"
1396
if test "$with_gcc" = "yes" ; then
1397
compiler_flags="$compiler_flags $arg"
1090
1407
-no-fast-install)
1091
1408
fast_install=no
1227
# A library or standard object.
1228
if test "$prev" = dlfiles; then
1229
# This file was specified with -dlopen.
1230
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1231
dlfiles="$dlfiles $arg"
1235
# If libtool objects are unsupported, then we need to preload.
1240
if test "$prev" = dlprefiles; then
1241
# Preload the old-style object.
1242
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1564
# A standard object.
1569
# A libtool-controlled object.
1571
# Check to see that this really is a libtool object.
1572
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1577
# If there is no directory component, then add one.
1246
*.lo) libobjs="$libobjs $arg" ;;
1247
*) objs="$objs $arg" ;;
1579
*/* | *\\*) . $arg ;;
1583
if test -z "$pic_object" || \
1584
test -z "$non_pic_object" ||
1585
test "$pic_object" = none && \
1586
test "$non_pic_object" = none; then
1587
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1591
# Extract subdirectory from the argument.
1592
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1593
if test "X$xdir" = "X$arg"; then
1599
if test "$pic_object" != none; then
1600
# Prepend the subdirectory the object is found in.
1601
pic_object="$xdir$pic_object"
1603
if test "$prev" = dlfiles; then
1604
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1605
dlfiles="$dlfiles $pic_object"
1609
# If libtool objects are unsupported, then we need to preload.
1614
# CHECK ME: I think I busted this. -Ossama
1615
if test "$prev" = dlprefiles; then
1616
# Preload the old-style object.
1617
dlprefiles="$dlprefiles $pic_object"
1622
libobjs="$libobjs $pic_object"
1627
if test "$non_pic_object" != none; then
1628
# Prepend the subdirectory the object is found in.
1629
non_pic_object="$xdir$non_pic_object"
1631
# A standard non-PIC object
1632
non_pic_objects="$non_pic_objects $non_pic_object"
1633
if test -z "$pic_object" || test "$pic_object" = none ; then
1634
arg="$non_pic_object"
1638
# Only an error if not doing a dry-run.
1639
if test -z "$run"; then
1640
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1645
# Extract subdirectory from the argument.
1646
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1647
if test "X$xdir" = "X$arg"; then
1653
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1654
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1655
libobjs="$libobjs $pic_object"
1656
non_pic_objects="$non_pic_objects $non_pic_object"
1392
1831
for pass in $passes; do
1393
if test $linkmode = prog; then
1394
# Determine which files to process
1832
if test "$linkmode,$pass" = "lib,link" ||
1833
test "$linkmode,$pass" = "prog,scan"; then
1837
if test "$linkmode" = prog; then
1398
save_deplibs="$deplibs" # Collect dlpreopened libraries
1839
dlopen) libs="$dlfiles" ;;
1401
1840
dlpreopen) libs="$dlprefiles" ;;
1402
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1842
libs="$deplibs %DEPLIBS%"
1843
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
1847
if test "$pass" = dlopen; then
1848
# Collect dlpreopened libraries
1849
save_deplibs="$deplibs"
1405
1852
for deplib in $libs; do
1408
1855
case $deplib in
1856
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1857
if test "$linkmode,$pass" = "prog,link"; then
1858
compile_deplibs="$deplib $compile_deplibs"
1859
finalize_deplibs="$deplib $finalize_deplibs"
1861
deplibs="$deplib $deplibs"
1410
if test $linkmode = oldlib && test $linkmode = obj; then
1411
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1414
if test $pass = conv; then
1415
deplibs="$deplib $deplibs"
1866
if test "$linkmode" != lib && test "$linkmode" != prog; then
1867
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1418
1870
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1419
1871
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1420
# Search the libtool library
1421
lib="$searchdir/lib${name}.la"
1422
if test -f "$lib"; then
1872
for search_ext in .la $std_shrext .so .a; do
1873
# Search the libtool library
1874
lib="$searchdir/lib${name}${search_ext}"
1875
if test -f "$lib"; then
1876
if test "$search_ext" = ".la"; then
1427
1885
if test "$found" != yes; then
1428
1886
# deplib doesn't seem to be a libtool library
1431
1889
finalize_deplibs="$deplib $finalize_deplibs"
1433
1891
deplibs="$deplib $deplibs"
1434
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1892
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1895
else # deplib is a libtool library
1896
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1897
# We need to do some special things here, and not later.
1898
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1899
case " $predeps $postdeps " in
1901
if (${SED} -e '2q' $lib |
1902
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1906
*/* | *\\*) . $lib ;;
1909
for l in $old_library $library_names; do
1912
if test "X$ll" = "X$old_library" ; then # only static version available
1914
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1915
test "X$ladir" = "X$lib" && ladir="."
1916
lib=$ladir/$old_library
1917
if test "$linkmode,$pass" = "prog,link"; then
1918
compile_deplibs="$deplib $compile_deplibs"
1919
finalize_deplibs="$deplib $finalize_deplibs"
1921
deplibs="$deplib $deplibs"
1922
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1440
1934
case $linkmode in
1442
1936
deplibs="$deplib $deplibs"
1443
test $pass = conv && continue
1937
test "$pass" = conv && continue
1444
1938
newdependency_libs="$deplib $newdependency_libs"
1445
1939
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1448
if test $pass = conv; then
1942
if test "$pass" = conv; then
1449
1943
deplibs="$deplib $deplibs"
1452
if test $pass = scan; then
1946
if test "$pass" = scan; then
1453
1947
deplibs="$deplib $deplibs"
1454
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1456
1949
compile_deplibs="$deplib $compile_deplibs"
1457
1950
finalize_deplibs="$deplib $finalize_deplibs"
1952
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1461
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1955
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1463
1957
esac # linkmode
1467
if test $pass = link; then
1961
if test "$pass" = link; then
1468
1962
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1469
1963
# Make sure the xrpath contains only unique directories.
1470
1964
case "$xrpath " in
1478
1972
*.la) lib="$deplib" ;;
1480
if test $pass = conv; then
1974
if test "$pass" = conv; then
1481
1975
deplibs="$deplib $deplibs"
1484
1978
case $linkmode in
1486
1980
if test "$deplibs_check_method" != pass_all; then
1488
echo "*** Warning: Trying to link with static lib archive $deplib."
1489
echo "*** I have the capability to make that library automatically link in when"
1490
echo "*** you link to this library. But I can only do this if you have a"
1491
echo "*** shared version of the library, which you do not appear to have"
1492
echo "*** because the file extensions .$libext of this argument makes me believe"
1493
echo "*** that it is just a static archive that I should not used here."
1982
$echo "*** Warning: Trying to link with static lib archive $deplib."
1983
$echo "*** I have the capability to make that library automatically link in when"
1984
$echo "*** you link to this library. But I can only do this if you have a"
1985
$echo "*** shared version of the library, which you do not appear to have"
1986
$echo "*** because the file extensions .$libext of this argument makes me believe"
1987
$echo "*** that it is just a static archive that I should not used here."
1496
echo "*** Warning: Linking the shared library $output against the"
1497
echo "*** static library $deplib is not portable!"
1990
$echo "*** Warning: Linking the shared library $output against the"
1991
$echo "*** static library $deplib is not portable!"
1498
1992
deplibs="$deplib $deplibs"
1503
if test $pass != link; then
1997
if test "$pass" != link; then
1504
1998
deplibs="$deplib $deplibs"
1506
2000
compile_deplibs="$deplib $compile_deplibs"
1603
2102
if test -z "$linklib"; then
1604
2103
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1608
2107
# This library was specified with -dlopen.
1609
if test $pass = dlopen; then
2108
if test "$pass" = dlopen; then
1610
2109
if test -z "$libdir"; then
1611
2110
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1614
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2113
if test -z "$dlname" ||
2114
test "$dlopen_support" != yes ||
2115
test "$build_libtool_libs" = no; then
1615
2116
# If there is no dlname, no dlopen support or we're linking
1616
# statically, we need to preload.
1617
dlprefiles="$dlprefiles $lib"
2117
# statically, we need to preload. We also need to preload any
2118
# dependent libraries so libltdl's deplib preloader doesn't
2119
# bomb out in the load deplibs phase.
2120
dlprefiles="$dlprefiles $lib $dependency_libs"
1619
2122
newdlfiles="$newdlfiles $lib"
1719
2223
fi # $linkmode = prog...
2225
if test "$linkmode,$pass" = "prog,link"; then
2226
if test -n "$library_names" &&
2227
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2228
# We need to hardcode the library path
2229
if test -n "$shlibpath_var"; then
2230
# Make sure the rpath contains only unique directories.
2231
case "$temp_rpath " in
2234
*) temp_rpath="$temp_rpath $dir" ;;
2238
# Hardcode the library path.
2239
# Skip directories that are in the system default run-time
2241
case " $sys_lib_dlsearch_path " in
2244
case "$compile_rpath " in
2246
*) compile_rpath="$compile_rpath $absdir"
2250
case " $sys_lib_dlsearch_path " in
2253
case "$finalize_rpath " in
2255
*) finalize_rpath="$finalize_rpath $libdir"
2259
fi # $linkmode,$pass = prog,link...
2261
if test "$alldeplibs" = yes &&
2262
{ test "$deplibs_check_method" = pass_all ||
2263
{ test "$build_libtool_libs" = yes &&
2264
test -n "$library_names"; }; }; then
2265
# We only need to search for static libraries
1721
2270
link_static=no # Whether the deplib will be linked statically
1722
2271
if test -n "$library_names" &&
1723
2272
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1724
# Link against this shared library
1726
if test "$linkmode,$pass" = "prog,link" ||
1727
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1728
# Hardcode the library path.
1729
# Skip directories that are in the system default run-time
1731
case " $sys_lib_dlsearch_path " in
1734
case "$compile_rpath " in
1736
*) compile_rpath="$compile_rpath $absdir"
1740
case " $sys_lib_dlsearch_path " in
1743
case "$finalize_rpath " in
1745
*) finalize_rpath="$finalize_rpath $libdir"
1749
if test $linkmode = prog; then
1750
# We need to hardcode the library path
1751
if test -n "$shlibpath_var"; then
1752
# Make sure the rpath contains only unique directories.
1753
case "$temp_rpath " in
1756
*) temp_rpath="$temp_rpath $dir" ;;
1760
fi # $linkmode,$pass = prog,link...
1762
if test "$alldeplibs" = yes &&
1763
{ test "$deplibs_check_method" = pass_all ||
1764
{ test "$build_libtool_libs" = yes &&
1765
test -n "$library_names"; }; }; then
1766
# We only need to search for static libraries
1770
2273
if test "$installed" = no; then
1771
2274
notinst_deplibs="$notinst_deplibs $lib"
1772
2275
need_relink=yes
2277
# This is a shared library
2279
# Warn about portability, can't link against -module's on
2280
# some systems (darwin)
2281
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2283
if test "$linkmode" = prog; then
2284
$echo "*** Warning: Linking the executable $output against the loadable module"
2286
$echo "*** Warning: Linking the shared library $output against the loadable module"
2288
$echo "*** $linklib is not portable!"
2290
if test "$linkmode" = lib &&
2291
test "$hardcode_into_libs" = yes; then
2292
# Hardcode the library path.
2293
# Skip directories that are in the system default run-time
2295
case " $sys_lib_dlsearch_path " in
2298
case "$compile_rpath " in
2300
*) compile_rpath="$compile_rpath $absdir"
2304
case " $sys_lib_dlsearch_path " in
2307
case "$finalize_rpath " in
2309
*) finalize_rpath="$finalize_rpath $libdir"
1775
2315
if test -n "$old_archive_from_expsyms_cmds"; then
1776
2316
# figure out the soname
1972
2528
# Just print a warning and add the library to dependency_libs so
1973
2529
# that the program can be linked against the static library.
1975
echo "*** Warning: This system can not link to static lib archive $lib."
1976
echo "*** I have the capability to make that library automatically link in when"
1977
echo "*** you link to this library. But I can only do this if you have a"
1978
echo "*** shared version of the library, which you do not appear to have."
2531
$echo "*** Warning: This system can not link to static lib archive $lib."
2532
$echo "*** I have the capability to make that library automatically link in when"
2533
$echo "*** you link to this library. But I can only do this if you have a"
2534
$echo "*** shared version of the library, which you do not appear to have."
1979
2535
if test "$module" = yes; then
1980
echo "*** But as you try to build a module library, libtool will still create "
1981
echo "*** a static module, that should work as long as the dlopening application"
1982
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2536
$echo "*** But as you try to build a module library, libtool will still create "
2537
$echo "*** a static module, that should work as long as the dlopening application"
2538
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1983
2539
if test -z "$global_symbol_pipe"; then
1985
echo "*** However, this would only work if libtool was able to extract symbol"
1986
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1987
echo "*** not find such a program. So, this module is probably useless."
1988
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2541
$echo "*** However, this would only work if libtool was able to extract symbol"
2542
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2543
$echo "*** not find such a program. So, this module is probably useless."
2544
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
1990
2546
if test "$build_old_libs" = no; then
1991
2547
build_libtool_libs=module
2058
2615
if grep "^installed=no" $deplib > /dev/null; then
2059
path="-L$absdir/$objdir"
2616
path="$absdir/$objdir"
2061
2618
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2062
2619
if test -z "$libdir"; then
2063
2620
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2066
2623
if test "$absdir" != "$libdir"; then
2067
2624
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2631
# we do not want to link against static libs,
2632
# but need to link against shared
2633
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2634
if test -n "$deplibrary_names" ; then
2635
for tmp in $deplibrary_names ; do
2638
if test -f "$path/$depdepl" ; then
2639
depdepl="$path/$depdepl"
2641
# do not add paths which are already there
2642
case " $newlib_search_path " in
2644
*) newlib_search_path="$newlib_search_path $path";;
2657
# Again, we only want to link against shared libraries
2658
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2659
for tmp in $newlib_search_path ; do
2660
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2661
eval depdepl="$tmp/lib$tmp_libs.dylib"
2074
2672
case " $deplibs " in
2674
*) deplibs="$depdepl $deplibs" ;;
2676
case " $deplibs " in
2075
2677
*" $path "*) ;;
2076
2678
*) deplibs="$deplibs $path" ;;
2109
2711
eval tmp_libs=\"\$$var\"
2111
2713
for deplib in $tmp_libs; do
2714
# FIXME: Pedantically, this is the right thing to do, so
2715
# that some nasty dependency loop isn't accidentally
2717
#new_libs="$deplib $new_libs"
2718
# Pragmatically, this seems to cause very few problems in
2112
2720
case $deplib in
2113
2721
-L*) new_libs="$deplib $new_libs" ;;
2724
# And here is the reason: when a library appears more
2725
# than once as an explicit dependence of a library, or
2726
# is implicitly linked in more than once by the
2727
# compiler, it is considered special, and multiple
2728
# occurrences thereof are not removed. Compare this
2729
# with having the same library being listed as a
2730
# dependency of multiple other libraries: in this case,
2731
# we know (pedantically, we assume) the library does not
2732
# need to be listed more than once, so we keep only the
2733
# last copy. This is not always right, but it is rare
2734
# enough that we require users that really mean to play
2735
# such unportable linking tricks to link the library
2736
# using -Wl,-lname, so that libtool does not consider it
2737
# for duplicate removal.
2115
2738
case " $specialdeplibs " in
2116
2739
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2254
2894
if test -n "$8"; then
2255
2895
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2256
2896
$echo "$help" 1>&2
2900
# convert absolute version numbers to libtool ages
2901
# this retains compatibility with .la files and attempts
2902
# to make the code below a bit more comprehensible
2904
case $vinfo_number in
2908
number_revision="$4"
2910
# There are really only two kinds -- those that
2911
# use the current revision as the major version
2912
# and those that subtract age and use age as
2913
# a minor version. But, then there is irix
2914
# which has an extra 1 added just for fun
2916
case $version_type in
2917
darwin|linux|osf|windows)
2918
current=`expr $number_major + $number_minor`
2920
revision="$number_revision"
2922
freebsd-aout|freebsd-elf|sunos)
2923
current="$number_major"
2924
revision="$number_minor"
2928
current=`expr $number_major + $number_minor - 1`
2930
revision="$number_minor"
2933
$echo "$modename: unknown library version type \`$version_type'" 1>&2
2934
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2264
2946
# Check that each of the things are valid numbers.
2265
2947
case $current in
2266
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2948
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]) ;;
2268
2950
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2269
2951
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2274
2956
case $revision in
2275
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2957
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
2959
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2278
2960
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2284
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2966
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
2968
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2287
2969
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2292
if test $age -gt $current; then
2974
if test "$age" -gt "$current"; then
2293
2975
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2294
2976
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2298
2980
# Calculate the version variables.
2540
3243
int main() { return 0; }
2543
$CC -o conftest conftest.c $deplibs
2544
if test $? -eq 0 ; then
3246
$LTCC -o conftest conftest.c $deplibs
3247
if test "$?" -eq 0 ; then
2545
3248
ldd_output=`ldd conftest`
2546
3249
for i in $deplibs; do
2547
3250
name="`expr $i : '-l\(.*\)'`"
2548
3251
# If $name is empty we are operating on a -L argument.
2549
if test -n "$name" && test "$name" != "0"; then
2550
libname=`eval \\$echo \"$libname_spec\"`
2551
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2552
set dummy $deplib_matches
2554
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2555
newdeplibs="$newdeplibs $i"
2559
echo "*** Warning: dynamic linker does not accept needed library $i."
2560
echo "*** I have the capability to make that library automatically link in when"
2561
echo "*** you link to this library. But I can only do this if you have a"
2562
echo "*** shared version of the library, which I believe you do not have"
2563
echo "*** because a test_compile did reveal that the linker did not use it for"
2564
echo "*** its dynamic dependency list that programs get resolved with at runtime."
2567
newdeplibs="$newdeplibs $i"
2571
# Error occured in the first compile. Let's try to salvage
2572
# the situation: Compile a separate program for each library.
2573
for i in $deplibs; do
2574
name="`expr $i : '-l\(.*\)'`"
2575
# If $name is empty we are operating on a -L argument.
2576
if test -n "$name" && test "$name" != "0"; then
2578
$CC -o conftest conftest.c $i
2580
if test $? -eq 0 ; then
2581
ldd_output=`ldd conftest`
3252
if test "$name" != "" && test "$name" -ne "0"; then
3253
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3254
case " $predeps $postdeps " in
3256
newdeplibs="$newdeplibs $i"
3261
if test -n "$i" ; then
2582
3262
libname=`eval \\$echo \"$libname_spec\"`
2583
3263
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2584
3264
set dummy $deplib_matches
2587
3267
newdeplibs="$newdeplibs $i"
2589
3269
droppeddeps=yes
2591
echo "*** Warning: dynamic linker does not accept needed library $i."
2592
echo "*** I have the capability to make that library automatically link in when"
2593
echo "*** you link to this library. But I can only do this if you have a"
2594
echo "*** shared version of the library, which you do not appear to have"
2595
echo "*** because a test_compile did reveal that the linker did not use this one"
2596
echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3271
$echo "*** Warning: dynamic linker does not accept needed library $i."
3272
$echo "*** I have the capability to make that library automatically link in when"
3273
$echo "*** you link to this library. But I can only do this if you have a"
3274
$echo "*** shared version of the library, which I believe you do not have"
3275
$echo "*** because a test_compile did reveal that the linker did not use it for"
3276
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3280
newdeplibs="$newdeplibs $i"
3284
# Error occurred in the first compile. Let's try to salvage
3285
# the situation: Compile a separate program for each library.
3286
for i in $deplibs; do
3287
name="`expr $i : '-l\(.*\)'`"
3288
# If $name is empty we are operating on a -L argument.
3289
if test "$name" != "" && test "$name" != "0"; then
3291
$LTCC -o conftest conftest.c $i
3293
if test "$?" -eq 0 ; then
3294
ldd_output=`ldd conftest`
3295
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3296
case " $predeps $postdeps " in
3298
newdeplibs="$newdeplibs $i"
3303
if test -n "$i" ; then
3304
libname=`eval \\$echo \"$libname_spec\"`
3305
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3306
set dummy $deplib_matches
3308
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3309
newdeplibs="$newdeplibs $i"
3313
$echo "*** Warning: dynamic linker does not accept needed library $i."
3314
$echo "*** I have the capability to make that library automatically link in when"
3315
$echo "*** you link to this library. But I can only do this if you have a"
3316
$echo "*** shared version of the library, which you do not appear to have"
3317
$echo "*** because a test_compile did reveal that the linker did not use this one"
3318
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2599
3322
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."
3324
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3325
$echo "*** make it link in! You will probably need to install it or some"
3326
$echo "*** library that it depends on before this library will be fully"
3327
$echo "*** functional. Installing it before continuing would be even better."
2607
3330
newdeplibs="$newdeplibs $i"
2615
3338
for a_deplib in $deplibs; do
2616
3339
name="`expr $a_deplib : '-l\(.*\)'`"
2617
3340
# 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
3341
if test "$name" != "" && test "$name" != "0"; then
3342
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3343
case " $predeps $postdeps " in
3345
newdeplibs="$newdeplibs $a_deplib"
3350
if test -n "$a_deplib" ; then
3351
libname=`eval \\$echo \"$libname_spec\"`
3352
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3353
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3354
for potent_lib in $potential_libs; do
2623
3355
# Follow soft links.
2624
3356
if ls -lLd "$potent_lib" 2>/dev/null \
2625
3357
| grep " -> " >/dev/null; then
2641
3373
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2643
| egrep "$file_magic_regex" > /dev/null; then
3375
| $EGREP "$file_magic_regex" > /dev/null; then
2644
3376
newdeplibs="$newdeplibs $a_deplib"
2650
3383
if test -n "$a_deplib" ; then
2651
3384
droppeddeps=yes
2653
echo "*** Warning: linker path does not have real file for library $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"
2657
echo "*** because I did check the linker path looking for a file starting"
3386
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3387
$echo "*** I have the capability to make that library automatically link in when"
3388
$echo "*** you link to this library. But I can only do this if you have a"
3389
$echo "*** shared version of the library, which you do not appear to have"
3390
$echo "*** because I did check the linker path looking for a file starting"
2658
3391
if test -z "$potlib" ; then
2659
echo "*** with $libname but no candidates were found. (...for file magic test)"
3392
$echo "*** with $libname but no candidates were found. (...for file magic test)"
2661
echo "*** with $libname and none of the candidates passed a file format test"
2662
echo "*** using a file magic. Last file checked: $potlib"
3394
$echo "*** with $libname and none of the candidates passed a file format test"
3395
$echo "*** using a file magic. Last file checked: $potlib"
2675
3408
name="`expr $a_deplib : '-l\(.*\)'`"
2676
3409
# If $name is empty we are operating on a -L argument.
2677
3410
if test -n "$name" && test "$name" != "0"; then
2678
libname=`eval \\$echo \"$libname_spec\"`
2679
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2680
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2681
for potent_lib in $potential_libs; do
2682
potlib="$potent_lib" # see symlink-check below in file_magic test
2683
if eval echo \"$potent_lib\" 2>/dev/null \
2685
| egrep "$match_pattern_regex" > /dev/null; then
2686
newdeplibs="$newdeplibs $a_deplib"
3411
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3412
case " $predeps $postdeps " in
3414
newdeplibs="$newdeplibs $a_deplib"
3419
if test -n "$a_deplib" ; then
3420
libname=`eval \\$echo \"$libname_spec\"`
3421
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3422
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3423
for potent_lib in $potential_libs; do
3424
potlib="$potent_lib" # see symlink-check above in file_magic test
3425
if eval $echo \"$potent_lib\" 2>/dev/null \
3427
| $EGREP "$match_pattern_regex" > /dev/null; then
3428
newdeplibs="$newdeplibs $a_deplib"
2692
3435
if test -n "$a_deplib" ; then
2693
3436
droppeddeps=yes
2695
echo "*** Warning: linker path does not have real file for library $a_deplib."
2696
echo "*** I have the capability to make that library automatically link in when"
2697
echo "*** you link to this library. But I can only do this if you have a"
2698
echo "*** shared version of the library, which you do not appear to have"
2699
echo "*** because I did check the linker path looking for a file starting"
3438
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3439
$echo "*** I have the capability to make that library automatically link in when"
3440
$echo "*** you link to this library. But I can only do this if you have a"
3441
$echo "*** shared version of the library, which you do not appear to have"
3442
$echo "*** because I did check the linker path looking for a file starting"
2700
3443
if test -z "$potlib" ; then
2701
echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3444
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2703
echo "*** with $libname and none of the candidates passed a file format test"
2704
echo "*** using a regex pattern. Last file checked: $potlib"
3446
$echo "*** with $libname and none of the candidates passed a file format test"
3447
$echo "*** using a regex pattern. Last file checked: $potlib"
2713
3456
none | unknown | *)
2715
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2716
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2717
grep . >/dev/null; then
3458
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3459
-e 's/ -[LR][^ ]*//g'`
3460
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3461
for i in $predeps $postdeps ; do
3462
# can't use Xsed below, because $i might contain '/'
3463
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3466
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3467
| grep . >/dev/null; then
2719
3469
if test "X$deplibs_check_method" = "Xnone"; then
2720
echo "*** Warning: inter-library dependencies are not supported in this platform."
3470
$echo "*** Warning: inter-library dependencies are not supported in this platform."
2722
echo "*** Warning: inter-library dependencies are not known to be supported."
3472
$echo "*** Warning: inter-library dependencies are not known to be supported."
2724
echo "*** All declared inter-library dependencies are being dropped."
3474
$echo "*** All declared inter-library dependencies are being dropped."
2725
3475
droppeddeps=yes
2742
3492
if test "$droppeddeps" = yes; then
2743
3493
if test "$module" = yes; then
2745
echo "*** Warning: libtool could not satisfy all declared inter-library"
2746
echo "*** dependencies of module $libname. Therefore, libtool will create"
2747
echo "*** a static module, that should work as long as the dlopening"
2748
echo "*** application is linked with the -dlopen flag."
3495
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3496
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3497
$echo "*** a static module, that should work as long as the dlopening"
3498
$echo "*** application is linked with the -dlopen flag."
2749
3499
if test -z "$global_symbol_pipe"; then
2751
echo "*** However, this would only work if libtool was able to extract symbol"
2752
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2753
echo "*** not find such a program. So, this module is probably useless."
2754
echo "*** \`nm' from GNU binutils and a full rebuild may help."
3501
$echo "*** However, this would only work if libtool was able to extract symbol"
3502
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3503
$echo "*** not find such a program. So, this module is probably useless."
3504
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2756
3506
if test "$build_old_libs" = no; then
2757
3507
oldlibs="$output_objdir/$libname.$libext"
2761
3511
build_libtool_libs=no
2764
echo "*** The inter-library dependencies that have been dropped here will be"
2765
echo "*** automatically added whenever a program is linked with this library"
2766
echo "*** or is declared to -dlopen it."
3514
$echo "*** The inter-library dependencies that have been dropped here will be"
3515
$echo "*** automatically added whenever a program is linked with this library"
3516
$echo "*** or is declared to -dlopen it."
2768
if test $allow_undefined = no; then
2770
echo "*** Since this library must not contain undefined symbols,"
2771
echo "*** because either the platform does not support them or"
2772
echo "*** it was explicitly requested with -no-undefined,"
2773
echo "*** libtool will only create a static version of it."
3518
if test "$allow_undefined" = no; then
3520
$echo "*** Since this library must not contain undefined symbols,"
3521
$echo "*** because either the platform does not support them or"
3522
$echo "*** it was explicitly requested with -no-undefined,"
3523
$echo "*** libtool will only create a static version of it."
2774
3524
if test "$build_old_libs" = no; then
2775
3525
oldlibs="$output_objdir/$libname.$libext"
2776
3526
build_libtool_libs=module
2940
3701
$show "${rm}r $xdir"
2941
3702
$run ${rm}r "$xdir"
3703
$show "$mkdir $xdir"
2945
if test $status -ne 0 && test ! -d "$xdir"; then
3706
if test "$status" -ne 0 && test ! -d "$xdir"; then
3709
# We will extract separately just the conflicting names and we will no
3710
# longer touch any unique names. It is faster to leave these extract
3711
# automatically by $AR in one run.
2948
3712
$show "(cd $xdir && $AR x $xabs)"
2949
3713
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3714
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3717
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3718
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3719
$AR t "$xabs" | sort | uniq -cd | while read -r count name
3722
while test "$i" -le "$count"
3724
# Put our $i before any first dot (extension)
3725
# Never overwrite any file
3727
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3729
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3731
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3732
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
2951
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3738
libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2966
3753
# Do each of the archive commands.
3754
if test "$module" = yes && test -n "$module_cmds" ; then
3755
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3756
eval test_cmds=\"$module_expsym_cmds\"
3757
cmds=$module_expsym_cmds
3759
eval test_cmds=\"$module_cmds\"
2967
3763
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2968
eval cmds=\"$archive_expsym_cmds\"
2970
save_deplibs="$deplibs"
2971
for conv in $convenience; do
2973
for test_deplib in $deplibs; do
2974
if test "$test_deplib" != "$conv"; then
2975
tmp_deplibs="$tmp_deplibs $test_deplib"
3764
eval test_cmds=\"$archive_expsym_cmds\"
3765
cmds=$archive_expsym_cmds
3767
eval test_cmds=\"$archive_cmds\"
3772
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3773
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3776
# The command line is too long to link in one step, link piecewise.
3777
$echo "creating reloadable object files..."
3779
# Save the value of $output and $libobjs because we want to
3780
# use them later. If we have whole_archive_flag_spec, we
3781
# want to use save_libobjs as it was before
3782
# whole_archive_flag_spec was expanded, because we can't
3783
# assume the linker understands whole_archive_flag_spec.
3784
# This may have to be revisited, in case too many
3785
# convenience libraries get linked in and end up exceeding
3787
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3788
save_libobjs=$libobjs
3792
# Clear the reloadable object creation command queue and
3793
# initialize k to one.
3800
output=$output_objdir/$save_output-${k}.$objext
3801
# Loop over the list of objects to be linked.
3802
for obj in $save_libobjs
3804
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3805
if test "X$objlist" = X ||
3806
{ len=`expr "X$test_cmds" : ".*"` &&
3807
test "$len" -le "$max_cmd_len"; }; then
3808
objlist="$objlist $obj"
3810
# The command $test_cmds is almost too long, add a
3811
# command to the queue.
3812
if test "$k" -eq 1 ; then
3813
# The first file doesn't have a previous command to add.
3814
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3816
# All subsequent reloadable object files will link in
3817
# the last one created.
3818
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
2978
deplibs="$tmp_deplibs"
2980
eval cmds=\"$archive_cmds\"
2981
deplibs="$save_deplibs"
3820
last_robj=$output_objdir/$save_output-${k}.$objext
3822
output=$output_objdir/$save_output-${k}.$objext
3827
# Handle the remaining objects by creating one last
3828
# reloadable object file. All subsequent reloadable object
3829
# files will link in the last one created.
3830
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3831
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3833
if ${skipped_export-false}; then
3834
$show "generating symbol list for \`$libname.la'"
3835
export_symbols="$output_objdir/$libname.exp"
3836
$run $rm $export_symbols
3838
# Append the command to create the export file.
3839
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3842
# Set up a command to remove the reloadale object files
3843
# after they are used.
3845
while test "$i" -lt "$k"
3848
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3851
$echo "creating a temporary reloadable object file: $output"
3853
# Loop through the commands generated above and execute them.
3854
save_ifs="$IFS"; IFS='~'
3855
for cmd in $concat_cmds; do
3858
$run eval "$cmd" || exit $?
3863
# Restore the value of output.
3866
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3867
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3869
# Expand the library linking commands again to reset the
3870
# value of $libobjs for piecewise linking.
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
cmds=$module_expsym_cmds
3880
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3881
cmds=$archive_expsym_cmds
3887
# Append the command to remove the reloadable object files
3888
# to the just-reset $cmds.
3889
eval cmds=\"\$cmds~\$rm $delfiles\"
2983
3891
save_ifs="$IFS"; IFS='~'
2984
3892
for cmd in $cmds; do
2985
3893
IFS="$save_ifs"
2987
3896
$run eval "$cmd" || exit $?
3090
3999
$show "${rm}r $xdir"
3091
4000
$run ${rm}r "$xdir"
4001
$show "$mkdir $xdir"
3095
if test $status -ne 0 && test ! -d "$xdir"; then
4004
if test "$status" -ne 0 && test ! -d "$xdir"; then
4007
# We will extract separately just the conflicting names and we will no
4008
# longer touch any unique names. It is faster to leave these extract
4009
# automatically by $AR in one run.
3098
4010
$show "(cd $xdir && $AR x $xabs)"
3099
4011
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4012
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4015
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4016
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4017
$AR t "$xabs" | sort | uniq -cd | while read -r count name
4020
while test "$i" -le "$count"
4022
# Put our $i before any first dot (extension)
4023
# Never overwrite any file
4025
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4027
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4029
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4030
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3101
reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
4036
reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3645
4571
# win32 will think the script is a binary if it has
3646
4572
# a .exe suffix, so we strip it off here.
3647
4573
case $output in
3648
*.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
4574
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3650
4576
# test for cygwin because mv fails w/o .exe extensions
3652
*cygwin*) exeext=.exe ;;
4580
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4584
*cygwin* | *mingw* )
4585
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4586
cwrapper=`$echo ${output}.exe`
4587
$rm $cwrappersource $cwrapper
4588
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4590
cat > $cwrappersource <<EOF
4592
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4593
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4595
The $output program cannot be directly executed until all the libtool
4596
libraries that it depends on are installed.
4598
This wrapper executable should never be moved out of the build directory.
4599
If it is, it will not operate correctly.
4601
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4602
but could eventually absorb all of the scripts functionality and
4603
exec $objdir/$outputname directly.
4606
cat >> $cwrappersource<<"EOF"
4614
#if defined(PATH_MAX)
4615
# define LT_PATHMAX PATH_MAX
4616
#elif defined(MAXPATHLEN)
4617
# define LT_PATHMAX MAXPATHLEN
4619
# define LT_PATHMAX 1024
4622
#ifndef DIR_SEPARATOR
4623
#define DIR_SEPARATOR '/'
4626
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4628
#define HAVE_DOS_BASED_FILE_SYSTEM
4629
#ifndef DIR_SEPARATOR_2
4630
#define DIR_SEPARATOR_2 '\\'
4634
#ifndef DIR_SEPARATOR_2
4635
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4636
#else /* DIR_SEPARATOR_2 */
4637
# define IS_DIR_SEPARATOR(ch) \
4638
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4639
#endif /* DIR_SEPARATOR_2 */
4641
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4642
#define XFREE(stale) do { \
4643
if (stale) { free ((void *) stale); stale = 0; } \
4646
const char *program_name = NULL;
4648
void * xmalloc (size_t num);
4649
char * xstrdup (const char *string);
4650
char * basename (const char *name);
4651
char * fnqualify(const char *path);
4652
char * strendzap(char *str, const char *pat);
4653
void lt_fatal (const char *message, ...);
4656
main (int argc, char *argv[])
4661
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4662
newargz = XMALLOC(char *, argc+2);
4665
cat >> $cwrappersource <<EOF
4666
newargz[0] = "$SHELL";
4669
cat >> $cwrappersource <<"EOF"
4670
newargz[1] = fnqualify(argv[0]);
4671
/* we know the script has the same name, without the .exe */
4672
/* so make sure newargz[1] doesn't end in .exe */
4673
strendzap(newargz[1],".exe");
4674
for (i = 1; i < argc; i++)
4675
newargz[i+1] = xstrdup(argv[i]);
4676
newargz[argc+1] = NULL;
4679
cat >> $cwrappersource <<EOF
4680
execv("$SHELL",newargz);
4683
cat >> $cwrappersource <<"EOF"
4687
xmalloc (size_t num)
4689
void * p = (void *) malloc (num);
4691
lt_fatal ("Memory exhausted");
4697
xstrdup (const char *string)
4699
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4704
basename (const char *name)
4708
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4709
/* Skip over the disk name in MSDOS pathnames. */
4710
if (isalpha (name[0]) && name[1] == ':')
4714
for (base = name; *name; name++)
4715
if (IS_DIR_SEPARATOR (*name))
4717
return (char *) base;
4721
fnqualify(const char *path)
4725
char tmp[LT_PATHMAX + 1];
4727
assert(path != NULL);
4729
/* Is it qualified already? */
4730
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4731
if (isalpha (path[0]) && path[1] == ':')
4732
return xstrdup (path);
4734
if (IS_DIR_SEPARATOR (path[0]))
4735
return xstrdup (path);
4737
/* prepend the current directory */
4738
/* doesn't handle '~' */
4739
if (getcwd (tmp, LT_PATHMAX) == NULL)
4740
lt_fatal ("getcwd failed");
4741
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4742
p = XMALLOC(char, size);
4743
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4748
strendzap(char *str, const char *pat)
4752
assert(str != NULL);
4753
assert(pat != NULL);
4756
patlen = strlen(pat);
4760
str += len - patlen;
4761
if (strcmp(str, pat) == 0)
4768
lt_error_core (int exit_status, const char * mode,
4769
const char * message, va_list ap)
4771
fprintf (stderr, "%s: %s: ", program_name, mode);
4772
vfprintf (stderr, message, ap);
4773
fprintf (stderr, ".\n");
4775
if (exit_status >= 0)
4780
lt_fatal (const char *message, ...)
4783
va_start (ap, message);
4784
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4788
# we should really use a build-platform specific compiler
4789
# here, but OTOH, the wrappers (shell script and this C one)
4790
# are only useful if you want to execute the "real" binary.
4791
# Since the "real" binary is built for $host, then this
4792
# wrapper might as well be built for $host, too.
4793
$run $LTCC -s -o $cwrapper $cwrappersource
3656
trap "$rm $output; exit 1" 1 2 15
4797
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
3658
4799
$echo > $output "\
3886
5015
$show "${rm}r $xdir"
3887
5016
$run ${rm}r "$xdir"
5017
$show "$mkdir $xdir"
3891
if test $status -ne 0 && test ! -d "$xdir"; then
5020
if test "$status" -ne 0 && test ! -d "$xdir"; then
5023
# We will extract separately just the conflicting names and we will no
5024
# longer touch any unique names. It is faster to leave these extract
5025
# automatically by $AR in one run.
3894
5026
$show "(cd $xdir && $AR x $xabs)"
3895
5027
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5028
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5031
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5032
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5033
$AR t "$xabs" | sort | uniq -cd | while read -r count name
5036
while test "$i" -le "$count"
5038
# Put our $i before any first dot (extension)
5039
# Never overwrite any file
5041
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5043
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5045
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5046
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3897
5052
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3901
5056
# Do each command in the archive commands.
3902
5057
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3903
eval cmds=\"$old_archive_from_new_cmds\"
5058
cmds=$old_archive_from_new_cmds
3905
# Ensure that we have .o objects in place in case we decided
3906
# not to build a shared library, and have fallen back to building
3907
# static libs even though --disable-static was passed!
3908
for oldobj in $oldobjs; do
3909
if test ! -f $oldobj; then
3910
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3911
if test "X$xdir" = "X$oldobj"; then
3916
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3917
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3918
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
3919
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3923
5060
eval cmds=\"$old_archive_cmds\"
5062
if len=`expr "X$cmds" : ".*"` &&
5063
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5064
cmds=$old_archive_cmds
5066
# the command line is too long to link in one step, link in parts
5067
$echo "using piecewise archive linking..."
5072
save_oldobjs=$oldobjs
5073
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
5074
# encoded into archives. This makes 'ar r' malfunction in
5075
# this piecewise linking case whenever conflicting object
5076
# names appear in distinct ar calls; check, warn and compensate.
5077
if (for obj in $save_oldobjs
5079
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5080
done | sort | sort -uc >/dev/null 2>&1); then
5083
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5084
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5087
# Is there a better way of finding the last object in the list?
5088
for obj in $save_oldobjs
5092
for obj in $save_oldobjs
5094
oldobjs="$objlist $obj"
5095
objlist="$objlist $obj"
5096
eval test_cmds=\"$old_archive_cmds\"
5097
if len=`expr "X$test_cmds" : ".*"` &&
5098
test "$len" -le "$max_cmd_len"; then
5101
# the above command should be used before it gets too long
5103
if test "$obj" = "$last_oldobj" ; then
5106
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5107
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5113
if test "X$oldobjs" = "X" ; then
5114
eval cmds=\"\$concat_cmds\"
5116
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
3925
5120
save_ifs="$IFS"; IFS='~'
3926
5121
for cmd in $cmds; do
3927
5123
IFS="$save_ifs"
3929
5125
$run eval "$cmd" || exit $?
4000
5200
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4001
5201
if test -z "$libdir"; then
4002
5202
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4005
5205
newdlprefiles="$newdlprefiles $libdir/$name"
4007
5207
dlprefiles="$newdlprefiles"
5210
for lib in $dlfiles; do
5212
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5213
*) abs=`pwd`"/$lib" ;;
5215
newdlfiles="$newdlfiles $abs"
5217
dlfiles="$newdlfiles"
5219
for lib in $dlprefiles; do
5221
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5222
*) abs=`pwd`"/$lib" ;;
5224
newdlprefiles="$newdlprefiles $abs"
5226
dlprefiles="$newdlprefiles"
4010
5229
# place dlname in correct position for cygwin
4011
5230
tdlname=$dlname
4012
5231
case $host,$output,$installed,$module,$dlname in
4013
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5232
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4015
5234
$echo > $output "\
4016
5235
# $outputname - a libtool library file
4256
5478
dir="$dir$objdir"
4258
5480
if test -n "$relink_command"; then
4259
# Determine the prefix the user has applied to our future dir.
4260
inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
4262
# Don't allow the user to place us outside of our expected
4263
# location b/c this prevents finding dependent libraries that
4264
# are installed to the same prefix.
4265
if test "$inst_prefix_dir" = "$destdir"; then
4266
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4270
if test -n "$inst_prefix_dir"; then
4271
# Stick the inst_prefix_dir data into the link command.
4272
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4274
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
5481
# Determine the prefix the user has applied to our future dir.
5482
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5484
# Don't allow the user to place us outside of our expected
5485
# location b/c this prevents finding dependent libraries that
5486
# are installed to the same prefix.
5487
# At present, this check doesn't affect windows .dll's that
5488
# are installed into $libdir/../bin (currently, that works fine)
5489
# but it's something to keep an eye on.
5490
if test "$inst_prefix_dir" = "$destdir"; then
5491
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5495
if test -n "$inst_prefix_dir"; then
5496
# Stick the inst_prefix_dir data into the link command.
5497
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5499
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4277
5502
$echo "$modename: warning: relinking \`$file'" 1>&2
4278
5503
$show "$relink_command"
4279
5504
if $run eval "$relink_command"; then :
4281
5506
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4387
5613
destfile="$destdir/$destfile"
5616
# If the file is missing, and there is a .exe on the end, strip it
5617
# because it is most likely a libtool script we actually want to
5622
if test ! -f "$file"; then
5623
file=`$echo $file|${SED} 's,.exe$,,'`
4390
5629
# Do a test to see if this is really a libtool program.
4392
5631
*cygwin*|*mingw*)
4393
wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
5632
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
4399
if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5638
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4400
5639
notinst_deplibs=
4401
5640
relink_command=
5642
# To insure that "foo" is sourced, and not "foo.exe",
5643
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5644
# which disallows the automatic-append-.exe behavior.
5646
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5647
*) wrapperdot=${wrapper} ;;
4403
5649
# If there is no directory component, then add one.
4405
*/* | *\\*) . $wrapper ;;
5651
*/* | *\\*) . ${wrapperdot} ;;
5652
*) . ./${wrapperdot} ;;
4409
5655
# Check the variables that should have been set.
4410
5656
if test -z "$notinst_deplibs"; then
4411
5657
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4569
5828
# Exit here if they wanted silent mode.
4570
test "$show" = ":" && exit 0
5829
test "$show" = : && exit $EXIT_SUCCESS
4572
echo "----------------------------------------------------------------------"
4573
echo "Libraries have been installed in:"
5831
$echo "----------------------------------------------------------------------"
5832
$echo "Libraries have been installed in:"
4574
5833
for libdir in $libdirs; do
4578
echo "If you ever happen to want to link against installed libraries"
4579
echo "in a given directory, LIBDIR, you must either use libtool, and"
4580
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4581
echo "flag during linking and do at least one of the following:"
5837
$echo "If you ever happen to want to link against installed libraries"
5838
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5839
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5840
$echo "flag during linking and do at least one of the following:"
4582
5841
if test -n "$shlibpath_var"; then
4583
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4584
echo " during execution"
5842
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5843
$echo " during execution"
4586
5845
if test -n "$runpath_var"; then
4587
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4588
echo " during linking"
5846
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5847
$echo " during linking"
4590
5849
if test -n "$hardcode_libdir_flag_spec"; then
4592
5851
eval flag=\"$hardcode_libdir_flag_spec\"
4594
echo " - use the \`$flag' linker flag"
5853
$echo " - use the \`$flag' linker flag"
4596
5855
if test -n "$admincmds"; then
4597
echo " - have your system administrator run these commands:$admincmds"
5856
$echo " - have your system administrator run these commands:$admincmds"
4599
5858
if test -f /etc/ld.so.conf; then
4600
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5859
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4603
echo "See any operating system documentation about shared libraries for"
4604
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4605
echo "----------------------------------------------------------------------"
5862
$echo "See any operating system documentation about shared libraries for"
5863
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5864
$echo "----------------------------------------------------------------------"
4609
5868
# libtool execute mode
4859
if test "$build_old_libs" = yes; then
4860
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4861
rmfiles="$rmfiles $dir/$oldobj"
6121
# Possibly a libtool object, so verify it.
6122
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6127
# Add PIC object to the list of files to remove.
6128
if test -n "$pic_object" \
6129
&& test "$pic_object" != none; then
6130
rmfiles="$rmfiles $dir/$pic_object"
6133
# Add non-PIC object to the list of files to remove.
6134
if test -n "$non_pic_object" \
6135
&& test "$non_pic_object" != none; then
6136
rmfiles="$rmfiles $dir/$non_pic_object"
4866
# Do a test to see if this is a libtool program.
4867
if test $mode = clean &&
4868
(${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6142
if test "$mode" = clean ; then
6146
file=`$echo $file|${SED} 's,.exe$,,'`
6147
noexename=`$echo $name|${SED} 's,.exe$,,'`
6148
# $file with .exe has already been added to rmfiles,
6149
# add $file without .exe
6150
rmfiles="$rmfiles $file"
6153
# Do a test to see if this is a libtool program.
6154
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4872
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4873
if test "$fast_install" = yes && test -n "$relink_command"; then
4874
rmfiles="$rmfiles $objdir/lt-$name"
6158
# note $name still contains .exe if it was in $file originally
6159
# as does the version of $file that was added into $rmfiles
6160
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6161
if test "$fast_install" = yes && test -n "$relink_command"; then
6162
rmfiles="$rmfiles $objdir/lt-$name"
6164
if test "X$noexename" != "X$name" ; then
6165
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
5093
6392
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5094
6393
$echo "$help" 1>&2
5100
6399
$echo "Try \`$modename --help' for more information about other modes."
6403
# The TAGs below are defined such that we never get into a situation
6404
# in which we disable both kinds of libraries. Given conflicting
6405
# choices, we go for a static library, that is the most portable,
6406
# since we can't tell whether shared libraries were disabled because
6407
# the user asked for that or because the platform doesn't support
6408
# them. This is particularly important on AIX, because we don't
6409
# support having both static and shared libraries enabled at the same
6410
# time on that platform, so we default to a shared-only configuration.
6411
# If a disable-shared tag is given, we'll fallback to a static-only
6412
# configuration. But we'll never go from static-only to shared-only.
6414
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6415
build_libtool_libs=no
6417
# ### END LIBTOOL TAG CONFIG: disable-shared
6419
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6420
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6421
# ### END LIBTOOL TAG CONFIG: disable-static
5104
6423
# Local Variables:
5105
6424
# mode:shell-script