105
128
lo2o="s/\\.lo\$/.${objext}/"
106
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\"
108
244
# Parse our command line options once, thoroughly.
245
while test "$#" -gt 0
272
456
modename="$modename: compile"
273
457
# Get the compilation command and the source file.
459
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
470
# do not "continue". Instead, add this to base_compile
383
# 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
387
544
# 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
545
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
394
548
# Double-quote args containing other shell metacharacters.
395
549
# Many Bourne shells cannot handle close brackets correctly
396
550
# in scan sets, so we specify it separately.
398
551
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
399
552
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"
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
415
569
# 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
570
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
424
574
# Recognize several different file suffixes.
425
575
# If the user specifies -o file.o, it is replaced with file.lo
428
578
*.ada) xform=ada ;;
429
579
*.adb) xform=adb ;;
509
693
$run $rm $removelist
512
echo $srcfile > "$lockfile"
696
$echo $srcfile > "$lockfile"
515
699
if test -n "$fix_srcfile_path"; then
516
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.
519
717
# Only build a PIC object if we are building libtool libraries.
520
718
if test "$build_libtool_libs" = yes; then
521
719
# Without this assignment, base_compile gets emptied.
522
720
fbsd_hideous_sh_bug=$base_compile
524
722
if test "$pic_mode" != no; then
525
# All platforms use -DPIC, to notify preprocessed assembler code.
526
command="$base_compile $srcfile $pic_flag -DPIC"
723
command="$base_compile $srcfile $pic_flag"
528
725
# Don't build PIC code
529
726
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"
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"
563
746
if $run eval "$command"; then :
565
748
test -n "$output_obj" && $run $rm $removelist
569
752
if test "$need_locks" = warn &&
570
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
753
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
572
755
*** ERROR, $lockfile contains:
573
756
`cat $lockfile 2>/dev/null`
585
768
$run $rm $removelist
589
772
# 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
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'
640
789
# Allow error messages only from the first compilation.
641
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
644
802
# Only build a position-dependent object if we build old libraries.
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 :
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}"
716
874
# Unlock the critical section if it was locked
717
875
if test "$need_locks" != no; then
718
876
$run $rm "$lockfile"
724
882
# libtool link mode
1058
inst_prefix_dir="$arg"
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"
898
1180
# We need an absolute path.
900
1182
[\\/]* | [A-Za-z]:[\\/]*) ;;
902
1184
$echo "$modename: only absolute run-paths are allowed" 1>&2
906
1188
if test "$prev" = rpath; then
1049
1349
# Do not include libc due to us having libc/libc_r.
1050
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"
1053
elif test "X$arg" = "X-lc_r"; then
1357
elif test "X$arg" = "X-lc_r"; then
1055
1359
*-*-openbsd* | *-*-freebsd*)
1056
# Do not include libc_r directly, use -pthread flag.
1360
# Do not include libc_r directly, use -pthread flag.
1061
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"
1070
1407
-no-fast-install)
1071
1408
fast_install=no
1207
# A library or standard object.
1208
if test "$prev" = dlfiles; then
1209
# This file was specified with -dlopen.
1210
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1211
dlfiles="$dlfiles $arg"
1215
# If libtool objects are unsupported, then we need to preload.
1220
if test "$prev" = dlprefiles; then
1221
# Preload the old-style object.
1222
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.
1226
*.lo) libobjs="$libobjs $arg" ;;
1227
*) 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"
1372
1831
for pass in $passes; do
1373
if test $linkmode = prog; then
1374
# 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
1378
save_deplibs="$deplibs" # Collect dlpreopened libraries
1839
dlopen) libs="$dlfiles" ;;
1381
1840
dlpreopen) libs="$dlprefiles" ;;
1382
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"
1385
1852
for deplib in $libs; do
1388
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"
1390
if test $linkmode = oldlib && test $linkmode = obj; then
1391
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1866
if test "$linkmode" != lib && test "$linkmode" != prog; then
1867
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1394
if test $pass = conv; then
1870
if test "$pass" = conv; then
1395
1871
deplibs="$deplib $deplibs"
1398
1874
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1399
1875
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1400
# Search the libtool library
1401
lib="$searchdir/lib${name}.la"
1402
if test -f "$lib"; then
1876
for search_ext in .la $std_shrext .so .a; do
1877
# Search the libtool library
1878
lib="$searchdir/lib${name}${search_ext}"
1879
if test -f "$lib"; then
1880
if test "$search_ext" = ".la"; then
1407
1889
if test "$found" != yes; then
1408
1890
# deplib doesn't seem to be a libtool library
1411
1893
finalize_deplibs="$deplib $finalize_deplibs"
1413
1895
deplibs="$deplib $deplibs"
1414
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1896
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1899
else # deplib is a libtool library
1900
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1901
# We need to do some special things here, and not later.
1902
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1903
case " $predeps $postdeps " in
1905
if (${SED} -e '2q' $lib |
1906
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1910
*/* | *\\*) . $lib ;;
1913
for l in $old_library $library_names; do
1916
if test "X$ll" = "X$old_library" ; then # only static version available
1918
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1919
test "X$ladir" = "X$lib" && ladir="."
1920
lib=$ladir/$old_library
1921
if test "$linkmode,$pass" = "prog,link"; then
1922
compile_deplibs="$deplib $compile_deplibs"
1923
finalize_deplibs="$deplib $finalize_deplibs"
1925
deplibs="$deplib $deplibs"
1926
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1420
1938
case $linkmode in
1422
1940
deplibs="$deplib $deplibs"
1423
test $pass = conv && continue
1941
test "$pass" = conv && continue
1424
1942
newdependency_libs="$deplib $newdependency_libs"
1425
1943
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1428
if test $pass = conv; then
1946
if test "$pass" = conv; then
1429
1947
deplibs="$deplib $deplibs"
1432
if test $pass = scan; then
1950
if test "$pass" = scan; then
1433
1951
deplibs="$deplib $deplibs"
1434
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1436
1953
compile_deplibs="$deplib $compile_deplibs"
1437
1954
finalize_deplibs="$deplib $finalize_deplibs"
1956
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1441
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1959
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1443
1961
esac # linkmode
1447
if test $pass = link; then
1965
if test "$pass" = link; then
1448
1966
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1449
1967
# Make sure the xrpath contains only unique directories.
1450
1968
case "$xrpath " in
1458
1976
*.la) lib="$deplib" ;;
1460
if test $pass = conv; then
1978
if test "$pass" = conv; then
1461
1979
deplibs="$deplib $deplibs"
1464
1982
case $linkmode in
1466
1984
if test "$deplibs_check_method" != pass_all; then
1468
echo "*** Warning: Trying to link with static lib archive $deplib."
1469
echo "*** I have the capability to make that library automatically link in when"
1470
echo "*** you link to this library. But I can only do this if you have a"
1471
echo "*** shared version of the library, which you do not appear to have"
1472
echo "*** because the file extensions .$libext of this argument makes me believe"
1473
echo "*** that it is just a static archive that I should not used here."
1986
$echo "*** Warning: Trying to link with static lib archive $deplib."
1987
$echo "*** I have the capability to make that library automatically link in when"
1988
$echo "*** you link to this library. But I can only do this if you have a"
1989
$echo "*** shared version of the library, which you do not appear to have"
1990
$echo "*** because the file extensions .$libext of this argument makes me believe"
1991
$echo "*** that it is just a static archive that I should not used here."
1476
echo "*** Warning: Linking the shared library $output against the"
1477
echo "*** static library $deplib is not portable!"
1994
$echo "*** Warning: Linking the shared library $output against the"
1995
$echo "*** static library $deplib is not portable!"
1478
1996
deplibs="$deplib $deplibs"
1483
if test $pass != link; then
2001
if test "$pass" != link; then
1484
2002
deplibs="$deplib $deplibs"
1486
2004
compile_deplibs="$deplib $compile_deplibs"
1583
2106
if test -z "$linklib"; then
1584
2107
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1588
2111
# This library was specified with -dlopen.
1589
if test $pass = dlopen; then
2112
if test "$pass" = dlopen; then
1590
2113
if test -z "$libdir"; then
1591
2114
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1594
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2117
if test -z "$dlname" ||
2118
test "$dlopen_support" != yes ||
2119
test "$build_libtool_libs" = no; then
1595
2120
# If there is no dlname, no dlopen support or we're linking
1596
# statically, we need to preload.
1597
dlprefiles="$dlprefiles $lib"
2121
# statically, we need to preload. We also need to preload any
2122
# dependent libraries so libltdl's deplib preloader doesn't
2123
# bomb out in the load deplibs phase.
2124
dlprefiles="$dlprefiles $lib $dependency_libs"
1599
2126
newdlfiles="$newdlfiles $lib"
1699
2227
fi # $linkmode = prog...
2229
if test "$linkmode,$pass" = "prog,link"; then
2230
if test -n "$library_names" &&
2231
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2232
# We need to hardcode the library path
2233
if test -n "$shlibpath_var"; then
2234
# Make sure the rpath contains only unique directories.
2235
case "$temp_rpath " in
2238
*) temp_rpath="$temp_rpath $dir" ;;
2242
# Hardcode the library path.
2243
# Skip directories that are in the system default run-time
2245
case " $sys_lib_dlsearch_path " in
2248
case "$compile_rpath " in
2250
*) compile_rpath="$compile_rpath $absdir"
2254
case " $sys_lib_dlsearch_path " in
2257
case "$finalize_rpath " in
2259
*) finalize_rpath="$finalize_rpath $libdir"
2263
fi # $linkmode,$pass = prog,link...
2265
if test "$alldeplibs" = yes &&
2266
{ test "$deplibs_check_method" = pass_all ||
2267
{ test "$build_libtool_libs" = yes &&
2268
test -n "$library_names"; }; }; then
2269
# We only need to search for static libraries
1701
2274
link_static=no # Whether the deplib will be linked statically
1702
2275
if test -n "$library_names" &&
1703
2276
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1704
# Link against this shared library
1706
if test "$linkmode,$pass" = "prog,link" ||
1707
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1708
# Hardcode the library path.
1709
# Skip directories that are in the system default run-time
1711
case " $sys_lib_dlsearch_path " in
1714
case "$compile_rpath " in
1716
*) compile_rpath="$compile_rpath $absdir"
1720
case " $sys_lib_dlsearch_path " in
1723
case "$finalize_rpath " in
1725
*) finalize_rpath="$finalize_rpath $libdir"
1729
if test $linkmode = prog; then
1730
# We need to hardcode the library path
1731
if test -n "$shlibpath_var"; then
1732
# Make sure the rpath contains only unique directories.
1733
case "$temp_rpath " in
1736
*) temp_rpath="$temp_rpath $dir" ;;
1740
fi # $linkmode,$pass = prog,link...
1742
if test "$alldeplibs" = yes &&
1743
{ test "$deplibs_check_method" = pass_all ||
1744
{ test "$build_libtool_libs" = yes &&
1745
test -n "$library_names"; }; }; then
1746
# We only need to search for static libraries
1750
2277
if test "$installed" = no; then
1751
2278
notinst_deplibs="$notinst_deplibs $lib"
1752
2279
need_relink=yes
2281
# This is a shared library
2283
# Warn about portability, can't link against -module's on
2284
# some systems (darwin)
2285
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2287
if test "$linkmode" = prog; then
2288
$echo "*** Warning: Linking the executable $output against the loadable module"
2290
$echo "*** Warning: Linking the shared library $output against the loadable module"
2292
$echo "*** $linklib is not portable!"
2294
if test "$linkmode" = lib &&
2295
test "$hardcode_into_libs" = yes; then
2296
# Hardcode the library path.
2297
# Skip directories that are in the system default run-time
2299
case " $sys_lib_dlsearch_path " in
2302
case "$compile_rpath " in
2304
*) compile_rpath="$compile_rpath $absdir"
2308
case " $sys_lib_dlsearch_path " in
2311
case "$finalize_rpath " in
2313
*) finalize_rpath="$finalize_rpath $libdir"
1755
2319
if test -n "$old_archive_from_expsyms_cmds"; then
1756
2320
# figure out the soname
1936
2532
# Just print a warning and add the library to dependency_libs so
1937
2533
# that the program can be linked against the static library.
1939
echo "*** Warning: This system can not link to static lib archive $lib."
1940
echo "*** I have the capability to make that library automatically link in when"
1941
echo "*** you link to this library. But I can only do this if you have a"
1942
echo "*** shared version of the library, which you do not appear to have."
2535
$echo "*** Warning: This system can not link to static lib archive $lib."
2536
$echo "*** I have the capability to make that library automatically link in when"
2537
$echo "*** you link to this library. But I can only do this if you have a"
2538
$echo "*** shared version of the library, which you do not appear to have."
1943
2539
if test "$module" = yes; then
1944
echo "*** But as you try to build a module library, libtool will still create "
1945
echo "*** a static module, that should work as long as the dlopening application"
1946
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2540
$echo "*** But as you try to build a module library, libtool will still create "
2541
$echo "*** a static module, that should work as long as the dlopening application"
2542
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1947
2543
if test -z "$global_symbol_pipe"; then
1949
echo "*** However, this would only work if libtool was able to extract symbol"
1950
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1951
echo "*** not find such a program. So, this module is probably useless."
1952
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2545
$echo "*** However, this would only work if libtool was able to extract symbol"
2546
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2547
$echo "*** not find such a program. So, this module is probably useless."
2548
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
1954
2550
if test "$build_old_libs" = no; then
1955
2551
build_libtool_libs=module
2022
2619
if grep "^installed=no" $deplib > /dev/null; then
2023
path="-L$absdir/$objdir"
2620
path="$absdir/$objdir"
2025
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2622
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2026
2623
if test -z "$libdir"; then
2027
2624
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2030
2627
if test "$absdir" != "$libdir"; then
2031
2628
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2635
# we do not want to link against static libs,
2636
# but need to link against shared
2637
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2638
if test -n "$deplibrary_names" ; then
2639
for tmp in $deplibrary_names ; do
2642
if test -f "$path/$depdepl" ; then
2643
depdepl="$path/$depdepl"
2645
# do not add paths which are already there
2646
case " $newlib_search_path " in
2648
*) newlib_search_path="$newlib_search_path $path";;
2661
# Again, we only want to link against shared libraries
2662
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2663
for tmp in $newlib_search_path ; do
2664
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2665
eval depdepl="$tmp/lib$tmp_libs.dylib"
2038
2676
case " $deplibs " in
2678
*) deplibs="$depdepl $deplibs" ;;
2680
case " $deplibs " in
2039
2681
*" $path "*) ;;
2040
2682
*) deplibs="$deplibs $path" ;;
2073
2715
eval tmp_libs=\"\$$var\"
2075
2717
for deplib in $tmp_libs; do
2718
# FIXME: Pedantically, this is the right thing to do, so
2719
# that some nasty dependency loop isn't accidentally
2721
#new_libs="$deplib $new_libs"
2722
# Pragmatically, this seems to cause very few problems in
2076
2724
case $deplib in
2077
2725
-L*) new_libs="$deplib $new_libs" ;;
2728
# And here is the reason: when a library appears more
2729
# than once as an explicit dependence of a library, or
2730
# is implicitly linked in more than once by the
2731
# compiler, it is considered special, and multiple
2732
# occurrences thereof are not removed. Compare this
2733
# with having the same library being listed as a
2734
# dependency of multiple other libraries: in this case,
2735
# we know (pedantically, we assume) the library does not
2736
# need to be listed more than once, so we keep only the
2737
# last copy. This is not always right, but it is rare
2738
# enough that we require users that really mean to play
2739
# such unportable linking tricks to link the library
2740
# using -Wl,-lname, so that libtool does not consider it
2741
# for duplicate removal.
2079
2742
case " $specialdeplibs " in
2080
2743
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2504
3247
int main() { return 0; }
2507
$CC -o conftest conftest.c $deplibs
2508
if test $? -eq 0 ; then
3250
$LTCC -o conftest conftest.c $deplibs
3251
if test "$?" -eq 0 ; then
2509
3252
ldd_output=`ldd conftest`
2510
3253
for i in $deplibs; do
2511
3254
name="`expr $i : '-l\(.*\)'`"
2512
3255
# If $name is empty we are operating on a -L argument.
2513
if test -n "$name" && test "$name" != "0"; then
2514
libname=`eval \\$echo \"$libname_spec\"`
2515
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2516
set dummy $deplib_matches
2518
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2519
newdeplibs="$newdeplibs $i"
2523
echo "*** Warning: dynamic linker does not accept needed library $i."
2524
echo "*** I have the capability to make that library automatically link in when"
2525
echo "*** you link to this library. But I can only do this if you have a"
2526
echo "*** shared version of the library, which I believe you do not have"
2527
echo "*** because a test_compile did reveal that the linker did not use it for"
2528
echo "*** its dynamic dependency list that programs get resolved with at runtime."
2531
newdeplibs="$newdeplibs $i"
2535
# Error occured in the first compile. Let's try to salvage
2536
# the situation: Compile a separate program for each library.
2537
for i in $deplibs; do
2538
name="`expr $i : '-l\(.*\)'`"
2539
# If $name is empty we are operating on a -L argument.
2540
if test -n "$name" && test "$name" != "0"; then
2542
$CC -o conftest conftest.c $i
2544
if test $? -eq 0 ; then
2545
ldd_output=`ldd conftest`
3256
if test "$name" != "" && test "$name" -ne "0"; then
3257
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3258
case " $predeps $postdeps " in
3260
newdeplibs="$newdeplibs $i"
3265
if test -n "$i" ; then
2546
3266
libname=`eval \\$echo \"$libname_spec\"`
2547
3267
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2548
3268
set dummy $deplib_matches
2551
3271
newdeplibs="$newdeplibs $i"
2553
3273
droppeddeps=yes
2555
echo "*** Warning: dynamic linker does not accept needed library $i."
2556
echo "*** I have the capability to make that library automatically link in when"
2557
echo "*** you link to this library. But I can only do this if you have a"
2558
echo "*** shared version of the library, which you do not appear to have"
2559
echo "*** because a test_compile did reveal that the linker did not use this one"
2560
echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3275
$echo "*** Warning: dynamic linker does not accept needed library $i."
3276
$echo "*** I have the capability to make that library automatically link in when"
3277
$echo "*** you link to this library. But I can only do this if you have a"
3278
$echo "*** shared version of the library, which I believe you do not have"
3279
$echo "*** because a test_compile did reveal that the linker did not use it for"
3280
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3284
newdeplibs="$newdeplibs $i"
3288
# Error occurred in the first compile. Let's try to salvage
3289
# the situation: Compile a separate program for each library.
3290
for i in $deplibs; do
3291
name="`expr $i : '-l\(.*\)'`"
3292
# If $name is empty we are operating on a -L argument.
3293
if test "$name" != "" && test "$name" != "0"; then
3295
$LTCC -o conftest conftest.c $i
3297
if test "$?" -eq 0 ; then
3298
ldd_output=`ldd conftest`
3299
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3300
case " $predeps $postdeps " in
3302
newdeplibs="$newdeplibs $i"
3307
if test -n "$i" ; then
3308
libname=`eval \\$echo \"$libname_spec\"`
3309
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3310
set dummy $deplib_matches
3312
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3313
newdeplibs="$newdeplibs $i"
3317
$echo "*** Warning: dynamic linker does not accept needed library $i."
3318
$echo "*** I have the capability to make that library automatically link in when"
3319
$echo "*** you link to this library. But I can only do this if you have a"
3320
$echo "*** shared version of the library, which you do not appear to have"
3321
$echo "*** because a test_compile did reveal that the linker did not use this one"
3322
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2563
3326
droppeddeps=yes
2565
echo "*** Warning! Library $i is needed by this library but I was not able to"
2566
echo "*** make it link in! You will probably need to install it or some"
2567
echo "*** library that it depends on before this library will be fully"
2568
echo "*** functional. Installing it before continuing would be even better."
3328
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3329
$echo "*** make it link in! You will probably need to install it or some"
3330
$echo "*** library that it depends on before this library will be fully"
3331
$echo "*** functional. Installing it before continuing would be even better."
2571
3334
newdeplibs="$newdeplibs $i"
2579
3342
for a_deplib in $deplibs; do
2580
3343
name="`expr $a_deplib : '-l\(.*\)'`"
2581
3344
# If $name is empty we are operating on a -L argument.
2582
if test -n "$name" && test "$name" != "0"; then
2583
libname=`eval \\$echo \"$libname_spec\"`
2584
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2585
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2586
for potent_lib in $potential_libs; do
3345
if test "$name" != "" && test "$name" != "0"; then
3346
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3347
case " $predeps $postdeps " in
3349
newdeplibs="$newdeplibs $a_deplib"
3354
if test -n "$a_deplib" ; then
3355
libname=`eval \\$echo \"$libname_spec\"`
3356
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3357
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3358
for potent_lib in $potential_libs; do
2587
3359
# Follow soft links.
2588
3360
if ls -lLd "$potent_lib" 2>/dev/null \
2589
3361
| grep " -> " >/dev/null; then
2597
3369
potlib="$potent_lib"
2598
3370
while test -h "$potlib" 2>/dev/null; do
2599
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
3371
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2600
3372
case $potliblink in
2601
3373
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2602
3374
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2605
3377
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2607
| egrep "$file_magic_regex" > /dev/null; then
3379
| $EGREP "$file_magic_regex" > /dev/null; then
2608
3380
newdeplibs="$newdeplibs $a_deplib"
2614
3387
if test -n "$a_deplib" ; then
2615
3388
droppeddeps=yes
2617
echo "*** Warning: linker path does not have real file for library $a_deplib."
2618
echo "*** I have the capability to make that library automatically link in when"
2619
echo "*** you link to this library. But I can only do this if you have a"
2620
echo "*** shared version of the library, which you do not appear to have"
2621
echo "*** because I did check the linker path looking for a file starting"
3390
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3391
$echo "*** I have the capability to make that library automatically link in when"
3392
$echo "*** you link to this library. But I can only do this if you have a"
3393
$echo "*** shared version of the library, which you do not appear to have"
3394
$echo "*** because I did check the linker path looking for a file starting"
2622
3395
if test -z "$potlib" ; then
2623
echo "*** with $libname but no candidates were found. (...for file magic test)"
3396
$echo "*** with $libname but no candidates were found. (...for file magic test)"
2625
echo "*** with $libname and none of the candidates passed a file format test"
2626
echo "*** using a file magic. Last file checked: $potlib"
3398
$echo "*** with $libname and none of the candidates passed a file format test"
3399
$echo "*** using a file magic. Last file checked: $potlib"
2639
3412
name="`expr $a_deplib : '-l\(.*\)'`"
2640
3413
# If $name is empty we are operating on a -L argument.
2641
3414
if test -n "$name" && test "$name" != "0"; then
2642
libname=`eval \\$echo \"$libname_spec\"`
2643
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2644
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2645
for potent_lib in $potential_libs; do
2646
potlib="$potent_lib" # see symlink-check below in file_magic test
2647
if eval echo \"$potent_lib\" 2>/dev/null \
2649
| egrep "$match_pattern_regex" > /dev/null; then
2650
newdeplibs="$newdeplibs $a_deplib"
3415
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3416
case " $predeps $postdeps " in
3418
newdeplibs="$newdeplibs $a_deplib"
3423
if test -n "$a_deplib" ; then
3424
libname=`eval \\$echo \"$libname_spec\"`
3425
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3426
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3427
for potent_lib in $potential_libs; do
3428
potlib="$potent_lib" # see symlink-check above in file_magic test
3429
if eval $echo \"$potent_lib\" 2>/dev/null \
3431
| $EGREP "$match_pattern_regex" > /dev/null; then
3432
newdeplibs="$newdeplibs $a_deplib"
2656
3439
if test -n "$a_deplib" ; then
2657
3440
droppeddeps=yes
2659
echo "*** Warning: linker path does not have real file for library $a_deplib."
2660
echo "*** I have the capability to make that library automatically link in when"
2661
echo "*** you link to this library. But I can only do this if you have a"
2662
echo "*** shared version of the library, which you do not appear to have"
2663
echo "*** because I did check the linker path looking for a file starting"
3442
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3443
$echo "*** I have the capability to make that library automatically link in when"
3444
$echo "*** you link to this library. But I can only do this if you have a"
3445
$echo "*** shared version of the library, which you do not appear to have"
3446
$echo "*** because I did check the linker path looking for a file starting"
2664
3447
if test -z "$potlib" ; then
2665
echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3448
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2667
echo "*** with $libname and none of the candidates passed a file format test"
2668
echo "*** using a regex pattern. Last file checked: $potlib"
3450
$echo "*** with $libname and none of the candidates passed a file format test"
3451
$echo "*** using a regex pattern. Last file checked: $potlib"
2677
3460
none | unknown | *)
2679
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2680
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2681
grep . >/dev/null; then
3462
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3463
-e 's/ -[LR][^ ]*//g'`
3464
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3465
for i in $predeps $postdeps ; do
3466
# can't use Xsed below, because $i might contain '/'
3467
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3470
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3471
| grep . >/dev/null; then
2683
3473
if test "X$deplibs_check_method" = "Xnone"; then
2684
echo "*** Warning: inter-library dependencies are not supported in this platform."
3474
$echo "*** Warning: inter-library dependencies are not supported in this platform."
2686
echo "*** Warning: inter-library dependencies are not known to be supported."
3476
$echo "*** Warning: inter-library dependencies are not known to be supported."
2688
echo "*** All declared inter-library dependencies are being dropped."
3478
$echo "*** All declared inter-library dependencies are being dropped."
2689
3479
droppeddeps=yes
2706
3496
if test "$droppeddeps" = yes; then
2707
3497
if test "$module" = yes; then
2709
echo "*** Warning: libtool could not satisfy all declared inter-library"
2710
echo "*** dependencies of module $libname. Therefore, libtool will create"
2711
echo "*** a static module, that should work as long as the dlopening"
2712
echo "*** application is linked with the -dlopen flag."
3499
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3500
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3501
$echo "*** a static module, that should work as long as the dlopening"
3502
$echo "*** application is linked with the -dlopen flag."
2713
3503
if test -z "$global_symbol_pipe"; then
2715
echo "*** However, this would only work if libtool was able to extract symbol"
2716
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2717
echo "*** not find such a program. So, this module is probably useless."
2718
echo "*** \`nm' from GNU binutils and a full rebuild may help."
3505
$echo "*** However, this would only work if libtool was able to extract symbol"
3506
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3507
$echo "*** not find such a program. So, this module is probably useless."
3508
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2720
3510
if test "$build_old_libs" = no; then
2721
3511
oldlibs="$output_objdir/$libname.$libext"
2725
3515
build_libtool_libs=no
2728
echo "*** The inter-library dependencies that have been dropped here will be"
2729
echo "*** automatically added whenever a program is linked with this library"
2730
echo "*** or is declared to -dlopen it."
3518
$echo "*** The inter-library dependencies that have been dropped here will be"
3519
$echo "*** automatically added whenever a program is linked with this library"
3520
$echo "*** or is declared to -dlopen it."
2732
if test $allow_undefined = no; then
2734
echo "*** Since this library must not contain undefined symbols,"
2735
echo "*** because either the platform does not support them or"
2736
echo "*** it was explicitly requested with -no-undefined,"
2737
echo "*** libtool will only create a static version of it."
3522
if test "$allow_undefined" = no; then
3524
$echo "*** Since this library must not contain undefined symbols,"
3525
$echo "*** because either the platform does not support them or"
3526
$echo "*** it was explicitly requested with -no-undefined,"
3527
$echo "*** libtool will only create a static version of it."
2738
3528
if test "$build_old_libs" = no; then
2739
3529
oldlibs="$output_objdir/$libname.$libext"
2740
3530
build_libtool_libs=module
2904
3705
$show "${rm}r $xdir"
2905
3706
$run ${rm}r "$xdir"
3707
$show "$mkdir $xdir"
2909
if test $status -ne 0 && test ! -d "$xdir"; then
3710
if test "$status" -ne 0 && test ! -d "$xdir"; then
3713
# We will extract separately just the conflicting names and we will no
3714
# longer touch any unique names. It is faster to leave these extract
3715
# automatically by $AR in one run.
2912
3716
$show "(cd $xdir && $AR x $xabs)"
2913
3717
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3718
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3721
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3722
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3723
$AR t "$xabs" | sort | uniq -cd | while read -r count name
3726
while test "$i" -le "$count"
3728
# Put our $i before any first dot (extension)
3729
# Never overwrite any file
3731
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3733
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3735
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3736
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
2915
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3742
libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2930
3757
# Do each of the archive commands.
3758
if test "$module" = yes && test -n "$module_cmds" ; then
3759
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3760
eval test_cmds=\"$module_expsym_cmds\"
3761
cmds=$module_expsym_cmds
3763
eval test_cmds=\"$module_cmds\"
2931
3767
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2932
eval cmds=\"$archive_expsym_cmds\"
2934
eval cmds=\"$archive_cmds\"
3768
eval test_cmds=\"$archive_expsym_cmds\"
3769
cmds=$archive_expsym_cmds
3771
eval test_cmds=\"$archive_cmds\"
3776
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3777
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3780
# The command line is too long to link in one step, link piecewise.
3781
$echo "creating reloadable object files..."
3783
# Save the value of $output and $libobjs because we want to
3784
# use them later. If we have whole_archive_flag_spec, we
3785
# want to use save_libobjs as it was before
3786
# whole_archive_flag_spec was expanded, because we can't
3787
# assume the linker understands whole_archive_flag_spec.
3788
# This may have to be revisited, in case too many
3789
# convenience libraries get linked in and end up exceeding
3791
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3792
save_libobjs=$libobjs
3796
# Clear the reloadable object creation command queue and
3797
# initialize k to one.
3804
output=$output_objdir/$save_output-${k}.$objext
3805
# Loop over the list of objects to be linked.
3806
for obj in $save_libobjs
3808
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3809
if test "X$objlist" = X ||
3810
{ len=`expr "X$test_cmds" : ".*"` &&
3811
test "$len" -le "$max_cmd_len"; }; then
3812
objlist="$objlist $obj"
3814
# The command $test_cmds is almost too long, add a
3815
# command to the queue.
3816
if test "$k" -eq 1 ; then
3817
# The first file doesn't have a previous command to add.
3818
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3820
# All subsequent reloadable object files will link in
3821
# the last one created.
3822
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3824
last_robj=$output_objdir/$save_output-${k}.$objext
3826
output=$output_objdir/$save_output-${k}.$objext
3831
# Handle the remaining objects by creating one last
3832
# reloadable object file. All subsequent reloadable object
3833
# files will link in the last one created.
3834
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3835
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3837
if ${skipped_export-false}; then
3838
$show "generating symbol list for \`$libname.la'"
3839
export_symbols="$output_objdir/$libname.exp"
3840
$run $rm $export_symbols
3842
# Append the command to create the export file.
3843
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3846
# Set up a command to remove the reloadale object files
3847
# after they are used.
3849
while test "$i" -lt "$k"
3852
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3855
$echo "creating a temporary reloadable object file: $output"
3857
# Loop through the commands generated above and execute them.
3858
save_ifs="$IFS"; IFS='~'
3859
for cmd in $concat_cmds; do
3862
$run eval "$cmd" || exit $?
3867
# Restore the value of output.
3870
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3871
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3873
# Expand the library linking commands again to reset the
3874
# value of $libobjs for piecewise linking.
3876
# Do each of the archive commands.
3877
if test "$module" = yes && test -n "$module_cmds" ; then
3878
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3879
cmds=$module_expsym_cmds
3884
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3885
cmds=$archive_expsym_cmds
3891
# Append the command to remove the reloadable object files
3892
# to the just-reset $cmds.
3893
eval cmds=\"\$cmds~\$rm $delfiles\"
2936
3895
save_ifs="$IFS"; IFS='~'
2937
3896
for cmd in $cmds; do
2938
3897
IFS="$save_ifs"
2940
3900
$run eval "$cmd" || exit $?
3043
4003
$show "${rm}r $xdir"
3044
4004
$run ${rm}r "$xdir"
4005
$show "$mkdir $xdir"
3048
if test $status -ne 0 && test ! -d "$xdir"; then
4008
if test "$status" -ne 0 && test ! -d "$xdir"; then
4011
# We will extract separately just the conflicting names and we will no
4012
# longer touch any unique names. It is faster to leave these extract
4013
# automatically by $AR in one run.
3051
4014
$show "(cd $xdir && $AR x $xabs)"
3052
4015
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4016
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4019
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4020
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4021
$AR t "$xabs" | sort | uniq -cd | while read -r count name
4024
while test "$i" -le "$count"
4026
# Put our $i before any first dot (extension)
4027
# Never overwrite any file
4029
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4031
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4033
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4034
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3054
reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
4040
reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3585
4575
# win32 will think the script is a binary if it has
3586
4576
# a .exe suffix, so we strip it off here.
3587
4577
case $output in
3588
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
4578
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3590
4580
# test for cygwin because mv fails w/o .exe extensions
3592
*cygwin*) exeext=.exe ;;
4584
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4588
*cygwin* | *mingw* )
4589
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4590
cwrapper=`$echo ${output}.exe`
4591
$rm $cwrappersource $cwrapper
4592
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4594
cat > $cwrappersource <<EOF
4596
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4597
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4599
The $output program cannot be directly executed until all the libtool
4600
libraries that it depends on are installed.
4602
This wrapper executable should never be moved out of the build directory.
4603
If it is, it will not operate correctly.
4605
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4606
but could eventually absorb all of the scripts functionality and
4607
exec $objdir/$outputname directly.
4610
cat >> $cwrappersource<<"EOF"
4618
#if defined(PATH_MAX)
4619
# define LT_PATHMAX PATH_MAX
4620
#elif defined(MAXPATHLEN)
4621
# define LT_PATHMAX MAXPATHLEN
4623
# define LT_PATHMAX 1024
4626
#ifndef DIR_SEPARATOR
4627
#define DIR_SEPARATOR '/'
4630
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4632
#define HAVE_DOS_BASED_FILE_SYSTEM
4633
#ifndef DIR_SEPARATOR_2
4634
#define DIR_SEPARATOR_2 '\\'
4638
#ifndef DIR_SEPARATOR_2
4639
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4640
#else /* DIR_SEPARATOR_2 */
4641
# define IS_DIR_SEPARATOR(ch) \
4642
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4643
#endif /* DIR_SEPARATOR_2 */
4645
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4646
#define XFREE(stale) do { \
4647
if (stale) { free ((void *) stale); stale = 0; } \
4650
const char *program_name = NULL;
4652
void * xmalloc (size_t num);
4653
char * xstrdup (const char *string);
4654
char * basename (const char *name);
4655
char * fnqualify(const char *path);
4656
char * strendzap(char *str, const char *pat);
4657
void lt_fatal (const char *message, ...);
4660
main (int argc, char *argv[])
4665
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4666
newargz = XMALLOC(char *, argc+2);
4669
cat >> $cwrappersource <<EOF
4670
newargz[0] = "$SHELL";
4673
cat >> $cwrappersource <<"EOF"
4674
newargz[1] = fnqualify(argv[0]);
4675
/* we know the script has the same name, without the .exe */
4676
/* so make sure newargz[1] doesn't end in .exe */
4677
strendzap(newargz[1],".exe");
4678
for (i = 1; i < argc; i++)
4679
newargz[i+1] = xstrdup(argv[i]);
4680
newargz[argc+1] = NULL;
4683
cat >> $cwrappersource <<EOF
4684
execv("$SHELL",newargz);
4687
cat >> $cwrappersource <<"EOF"
4691
xmalloc (size_t num)
4693
void * p = (void *) malloc (num);
4695
lt_fatal ("Memory exhausted");
4701
xstrdup (const char *string)
4703
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4708
basename (const char *name)
4712
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4713
/* Skip over the disk name in MSDOS pathnames. */
4714
if (isalpha (name[0]) && name[1] == ':')
4718
for (base = name; *name; name++)
4719
if (IS_DIR_SEPARATOR (*name))
4721
return (char *) base;
4725
fnqualify(const char *path)
4729
char tmp[LT_PATHMAX + 1];
4731
assert(path != NULL);
4733
/* Is it qualified already? */
4734
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4735
if (isalpha (path[0]) && path[1] == ':')
4736
return xstrdup (path);
4738
if (IS_DIR_SEPARATOR (path[0]))
4739
return xstrdup (path);
4741
/* prepend the current directory */
4742
/* doesn't handle '~' */
4743
if (getcwd (tmp, LT_PATHMAX) == NULL)
4744
lt_fatal ("getcwd failed");
4745
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4746
p = XMALLOC(char, size);
4747
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4752
strendzap(char *str, const char *pat)
4756
assert(str != NULL);
4757
assert(pat != NULL);
4760
patlen = strlen(pat);
4764
str += len - patlen;
4765
if (strcmp(str, pat) == 0)
4772
lt_error_core (int exit_status, const char * mode,
4773
const char * message, va_list ap)
4775
fprintf (stderr, "%s: %s: ", program_name, mode);
4776
vfprintf (stderr, message, ap);
4777
fprintf (stderr, ".\n");
4779
if (exit_status >= 0)
4784
lt_fatal (const char *message, ...)
4787
va_start (ap, message);
4788
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4792
# we should really use a build-platform specific compiler
4793
# here, but OTOH, the wrappers (shell script and this C one)
4794
# are only useful if you want to execute the "real" binary.
4795
# Since the "real" binary is built for $host, then this
4796
# wrapper might as well be built for $host, too.
4797
$run $LTCC -s -o $cwrapper $cwrappersource
3596
trap "$rm $output; exit 1" 1 2 15
4801
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
3598
4803
$echo > $output "\
3826
5019
$show "${rm}r $xdir"
3827
5020
$run ${rm}r "$xdir"
5021
$show "$mkdir $xdir"
3831
if test $status -ne 0 && test ! -d "$xdir"; then
5024
if test "$status" -ne 0 && test ! -d "$xdir"; then
5027
# We will extract separately just the conflicting names and we will no
5028
# longer touch any unique names. It is faster to leave these extract
5029
# automatically by $AR in one run.
3834
5030
$show "(cd $xdir && $AR x $xabs)"
3835
5031
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5032
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5035
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5036
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5037
$AR t "$xabs" | sort | uniq -cd | while read -r count name
5040
while test "$i" -le "$count"
5042
# Put our $i before any first dot (extension)
5043
# Never overwrite any file
5045
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5047
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5049
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5050
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3837
5056
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3841
5060
# Do each command in the archive commands.
3842
5061
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3843
eval cmds=\"$old_archive_from_new_cmds\"
5062
cmds=$old_archive_from_new_cmds
3845
# Ensure that we have .o objects in place in case we decided
3846
# not to build a shared library, and have fallen back to building
3847
# static libs even though --disable-static was passed!
3848
for oldobj in $oldobjs; do
3849
if test ! -f $oldobj; then
3850
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3851
if test "X$xdir" = "X$oldobj"; then
3856
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3857
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3858
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
3859
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3863
5064
eval cmds=\"$old_archive_cmds\"
5066
if len=`expr "X$cmds" : ".*"` &&
5067
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5068
cmds=$old_archive_cmds
5070
# the command line is too long to link in one step, link in parts
5071
$echo "using piecewise archive linking..."
5076
save_oldobjs=$oldobjs
5077
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
5078
# encoded into archives. This makes 'ar r' malfunction in
5079
# this piecewise linking case whenever conflicting object
5080
# names appear in distinct ar calls; check, warn and compensate.
5081
if (for obj in $save_oldobjs
5083
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5084
done | sort | sort -uc >/dev/null 2>&1); then
5087
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5088
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5091
# Is there a better way of finding the last object in the list?
5092
for obj in $save_oldobjs
5096
for obj in $save_oldobjs
5098
oldobjs="$objlist $obj"
5099
objlist="$objlist $obj"
5100
eval test_cmds=\"$old_archive_cmds\"
5101
if len=`expr "X$test_cmds" : ".*"` &&
5102
test "$len" -le "$max_cmd_len"; then
5105
# the above command should be used before it gets too long
5107
if test "$obj" = "$last_oldobj" ; then
5110
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5111
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5117
if test "X$oldobjs" = "X" ; then
5118
eval cmds=\"\$concat_cmds\"
5120
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
3865
5124
save_ifs="$IFS"; IFS='~'
3866
5125
for cmd in $cmds; do
3867
5127
IFS="$save_ifs"
3869
5129
$run eval "$cmd" || exit $?
3938
5202
for lib in $dlprefiles; do
3939
5203
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3940
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5204
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3941
5205
if test -z "$libdir"; then
3942
5206
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3945
5209
newdlprefiles="$newdlprefiles $libdir/$name"
3947
5211
dlprefiles="$newdlprefiles"
5214
for lib in $dlfiles; do
5216
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5217
*) abs=`pwd`"/$lib" ;;
5219
newdlfiles="$newdlfiles $abs"
5221
dlfiles="$newdlfiles"
5223
for lib in $dlprefiles; do
5225
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5226
*) abs=`pwd`"/$lib" ;;
5228
newdlprefiles="$newdlprefiles $abs"
5230
dlprefiles="$newdlprefiles"
3950
5233
# place dlname in correct position for cygwin
3951
5234
tdlname=$dlname
3952
5235
case $host,$output,$installed,$module,$dlname in
3953
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5236
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3955
5238
$echo > $output "\
3956
5239
# $outputname - a libtool library file
4196
5482
dir="$dir$objdir"
4198
5484
if test -n "$relink_command"; then
5485
# Determine the prefix the user has applied to our future dir.
5486
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5488
# Don't allow the user to place us outside of our expected
5489
# location b/c this prevents finding dependent libraries that
5490
# are installed to the same prefix.
5491
# At present, this check doesn't affect windows .dll's that
5492
# are installed into $libdir/../bin (currently, that works fine)
5493
# but it's something to keep an eye on.
5494
if test "$inst_prefix_dir" = "$destdir"; then
5495
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5499
if test -n "$inst_prefix_dir"; then
5500
# Stick the inst_prefix_dir data into the link command.
5501
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5503
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4199
5506
$echo "$modename: warning: relinking \`$file'" 1>&2
4200
5507
$show "$relink_command"
4201
5508
if $run eval "$relink_command"; then :
4203
5510
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4309
5617
destfile="$destdir/$destfile"
5620
# If the file is missing, and there is a .exe on the end, strip it
5621
# because it is most likely a libtool script we actually want to
5626
if test ! -f "$file"; then
5627
file=`$echo $file|${SED} 's,.exe$,,'`
4312
5633
# Do a test to see if this is really a libtool program.
4314
5635
*cygwin*|*mingw*)
4315
wrapper=`echo $file | sed -e 's,.exe$,,'`
5636
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
4321
if (sed -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5642
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4322
5643
notinst_deplibs=
4323
5644
relink_command=
5646
# To insure that "foo" is sourced, and not "foo.exe",
5647
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5648
# which disallows the automatic-append-.exe behavior.
5650
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5651
*) wrapperdot=${wrapper} ;;
4325
5653
# If there is no directory component, then add one.
4327
*/* | *\\*) . $wrapper ;;
5655
*/* | *\\*) . ${wrapperdot} ;;
5656
*) . ./${wrapperdot} ;;
4331
5659
# Check the variables that should have been set.
4332
5660
if test -z "$notinst_deplibs"; then
4333
5661
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4491
5832
# Exit here if they wanted silent mode.
4492
test "$show" = ":" && exit 0
5833
test "$show" = : && exit $EXIT_SUCCESS
4494
echo "----------------------------------------------------------------------"
4495
echo "Libraries have been installed in:"
5835
$echo "----------------------------------------------------------------------"
5836
$echo "Libraries have been installed in:"
4496
5837
for libdir in $libdirs; do
4500
echo "If you ever happen to want to link against installed libraries"
4501
echo "in a given directory, LIBDIR, you must either use libtool, and"
4502
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4503
echo "flag during linking and do at least one of the following:"
5841
$echo "If you ever happen to want to link against installed libraries"
5842
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5843
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5844
$echo "flag during linking and do at least one of the following:"
4504
5845
if test -n "$shlibpath_var"; then
4505
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4506
echo " during execution"
5846
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5847
$echo " during execution"
4508
5849
if test -n "$runpath_var"; then
4509
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4510
echo " during linking"
5850
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5851
$echo " during linking"
4512
5853
if test -n "$hardcode_libdir_flag_spec"; then
4514
5855
eval flag=\"$hardcode_libdir_flag_spec\"
4516
echo " - use the \`$flag' linker flag"
5857
$echo " - use the \`$flag' linker flag"
4518
5859
if test -n "$admincmds"; then
4519
echo " - have your system administrator run these commands:$admincmds"
5860
$echo " - have your system administrator run these commands:$admincmds"
4521
5862
if test -f /etc/ld.so.conf; then
4522
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5863
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4525
echo "See any operating system documentation about shared libraries for"
4526
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4527
echo "----------------------------------------------------------------------"
5866
$echo "See any operating system documentation about shared libraries for"
5867
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5868
$echo "----------------------------------------------------------------------"
4531
5872
# libtool execute mode
4781
if test "$build_old_libs" = yes; then
4782
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4783
rmfiles="$rmfiles $dir/$oldobj"
6125
# Possibly a libtool object, so verify it.
6126
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6131
# Add PIC object to the list of files to remove.
6132
if test -n "$pic_object" \
6133
&& test "$pic_object" != none; then
6134
rmfiles="$rmfiles $dir/$pic_object"
6137
# Add non-PIC object to the list of files to remove.
6138
if test -n "$non_pic_object" \
6139
&& test "$non_pic_object" != none; then
6140
rmfiles="$rmfiles $dir/$non_pic_object"
4788
# Do a test to see if this is a libtool program.
4789
if test $mode = clean &&
4790
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6146
if test "$mode" = clean ; then
6150
file=`$echo $file|${SED} 's,.exe$,,'`
6151
noexename=`$echo $name|${SED} 's,.exe$,,'`
6152
# $file with .exe has already been added to rmfiles,
6153
# add $file without .exe
6154
rmfiles="$rmfiles $file"
6157
# Do a test to see if this is a libtool program.
6158
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4794
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4795
if test "$fast_install" = yes && test -n "$relink_command"; then
4796
rmfiles="$rmfiles $objdir/lt-$name"
6162
# note $name still contains .exe if it was in $file originally
6163
# as does the version of $file that was added into $rmfiles
6164
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6165
if test "$fast_install" = yes && test -n "$relink_command"; then
6166
rmfiles="$rmfiles $objdir/lt-$name"
6168
if test "X$noexename" != "X$name" ; then
6169
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
5015
6396
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5016
6397
$echo "$help" 1>&2
5022
6403
$echo "Try \`$modename --help' for more information about other modes."
6407
# The TAGs below are defined such that we never get into a situation
6408
# in which we disable both kinds of libraries. Given conflicting
6409
# choices, we go for a static library, that is the most portable,
6410
# since we can't tell whether shared libraries were disabled because
6411
# the user asked for that or because the platform doesn't support
6412
# them. This is particularly important on AIX, because we don't
6413
# support having both static and shared libraries enabled at the same
6414
# time on that platform, so we default to a shared-only configuration.
6415
# If a disable-shared tag is given, we'll fallback to a static-only
6416
# configuration. But we'll never go from static-only to shared-only.
6418
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6419
build_libtool_libs=no
6421
# ### END LIBTOOL TAG CONFIG: disable-shared
6423
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6424
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6425
# ### END LIBTOOL TAG CONFIG: disable-static
5026
6427
# Local Variables:
5027
6428
# mode:shell-script