18
18
# You should have received a copy of the GNU General Public License
19
19
# along with this program; if not, write to the Free Software
20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
22
# As a special exception to the GNU General Public License, if you
23
23
# distribute this file as part of a program that contains a
24
24
# configuration script generated by Autoconf, you may include it under
25
25
# the same distribution terms that you use for the rest of that program.
29
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30
# is ksh but when the shell is invoked as "sh" and the current value of
31
# the _XPG environment variable is not equal to 1 (one), the special
32
# positional parameter $0, within a function call, is the name of the
36
# The name of this program:
37
progname=`echo "$progpath" | $SED $basename`
47
TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)"
49
# See if we are running on zsh, and set the options which allow our
50
# commands through without removal of \ escapes.
51
if test -n "${ZSH_VERSION+set}" ; then
27
55
# Check that we have a working $echo.
28
56
if test "X$1" = X--no-reexec; then
29
57
# Discard the --no-reexec flag, and continue.
105
134
lo2o="s/\\.lo\$/.${objext}/"
106
135
o2lo="s/\\.${objext}\$/.lo/"
136
quote_scanset='[[~#^*{};<>?'"'"' ]'
138
#####################################
139
# Shell function definitions:
140
# This seems to be the best place for them
142
# func_win32_libid arg
143
# return the library type of file 'arg'
145
# Need a lot of goo to handle *both* DLLs and import libs
146
# Has to be a shell function in order to 'eat' the argument
147
# that is supplied when $file_magic_command is called.
150
win32_libid_type="unknown"
151
win32_fileres=`file -L $1 2>/dev/null`
152
case $win32_fileres in
153
*ar\ archive\ import\ library*) # definitely import
154
win32_libid_type="x86 archive import"
156
*ar\ archive*) # could be an import, or static
157
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
158
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
159
win32_nmres=`eval $NM -f posix -A $1 | \
160
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
161
if test "X$win32_nmres" = "Ximport" ; then
162
win32_libid_type="x86 archive import"
164
win32_libid_type="x86 archive static"
169
win32_libid_type="x86 DLL"
171
*executable*) # but shell scripts are "executable" too...
172
case $win32_fileres in
173
*MS\ Windows\ PE\ Intel*)
174
win32_libid_type="x86 DLL"
179
$echo $win32_libid_type
184
# Infer tagged configuration to use if any are available and
185
# if one wasn't chosen via the "--tag" command line option.
186
# Only attempt this if the compiler in the base compile
187
# command doesn't match the default compiler.
188
# arg is usually of the form 'gcc ...'
191
if test -n "$available_tags" && test -z "$tagname"; then
195
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
199
CC_quoted="$CC_quoted $arg"
202
# Blanks in the command may have been stripped by the calling shell,
203
# but not from the CC environment variable when configure was run.
204
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
205
# Blanks at the start of $base_compile will cause this to fail
206
# if we don't check for them as well.
208
for z in $available_tags; do
209
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
210
# Evaluate the configuration.
211
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
214
# Double-quote args containing other shell metacharacters.
216
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
220
CC_quoted="$CC_quoted $arg"
223
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
224
# The compiler in the base compile command matches
225
# the one in the tagged configuration.
226
# Assume this is the tagged configuration we want.
233
# If $tagname still isn't set, then no tagged configuration
234
# was found and let the user know that the "--tag" command
235
# line option must be used.
236
if test -z "$tagname"; then
237
$echo "$modename: unable to infer tagged configuration"
238
$echo "$modename: specify a tag with \`--tag'" 1>&2
241
# $echo "$modename: using $tagname tagged configuration"
249
# func_extract_an_archive dir oldlib
250
func_extract_an_archive ()
252
f_ex_an_ar_dir="$1"; shift
253
f_ex_an_ar_oldlib="$1"
255
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
256
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
257
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
260
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
265
# func_extract_archives gentop oldlib ...
266
func_extract_archives ()
268
my_gentop="$1"; shift
276
$show "${rm}r $my_gentop"
277
$run ${rm}r "$my_gentop"
278
$show "$mkdir $my_gentop"
279
$run $mkdir "$my_gentop"
281
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
285
for my_xlib in $my_oldlibs; do
286
# Extract the objects.
288
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
289
*) my_xabs=`pwd`"/$my_xlib" ;;
291
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
292
my_xdir="$my_gentop/$my_xlib"
294
$show "${rm}r $my_xdir"
295
$run ${rm}r "$my_xdir"
296
$show "$mkdir $my_xdir"
297
$run $mkdir "$my_xdir"
299
if test "$status" -ne 0 && test ! -d "$my_xdir"; then
304
$show "Extracting $my_xabs"
305
# Do not bother doing anything if just a dry run
306
if test -z "$run"; then
307
darwin_orig_dir=`pwd`
308
cd $my_xdir || exit $?
309
darwin_archive=$my_xabs
311
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
312
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
313
if test -n "$darwin_arches"; then
314
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
316
$show "$darwin_base_archive has multiple architectures $darwin_arches"
317
for darwin_arch in $darwin_arches ; do
318
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
319
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
320
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
321
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
323
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
324
done # $darwin_arches
325
## Okay now we have a bunch of thin objects, gotta fatten them up :)
326
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
329
for darwin_file in $darwin_filelist; do
330
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
331
lipo -create -output "$darwin_file" $darwin_files
332
done # $darwin_filelist
334
cd "$darwin_orig_dir"
336
cd "$darwin_orig_dir"
337
func_extract_an_archive "$my_xdir" "$my_xabs"
342
func_extract_an_archive "$my_xdir" "$my_xabs"
345
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
347
func_extract_archives_result="$my_oldobjs"
349
# End of Shell function definitions
350
#####################################
353
eval std_shrext=\"$shrext_cmds\"
108
355
# Parse our command line options once, thoroughly.
356
while test "$#" -gt 0
270
567
modename="$modename: compile"
271
568
# Get the compilation command and the source file.
570
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
284
# Aesthetically quote the previous argument.
286
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
289
# Double-quote args containing other shell metacharacters.
290
# Many Bourne shells cannot handle close brackets correctly
291
# in scan sets, so we specify it separately.
292
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
297
# Add the previous argument to base_compile.
298
if test -z "$base_compile"; then
299
base_compile="$lastarg"
301
base_compile="$base_compile $lastarg"
307
# Accept any command-line options.
310
if test "$user_target" != "no"; then
311
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
338
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
340
save_ifs="$IFS"; IFS=','
344
# Double-quote args containing other shell metacharacters.
345
# Many Bourne shells cannot handle close brackets correctly
346
# in scan sets, so we specify it separately.
348
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
352
lastarg="$lastarg $arg"
355
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
357
# Add the arguments to base_compile.
358
if test -z "$base_compile"; then
359
base_compile="$lastarg"
361
base_compile="$base_compile $lastarg"
369
# The next one is the -o target name
374
# We got the output file
581
# do not "continue". Instead, add this to base_compile
381
# Accept the current argument as the source file.
593
# Accept any command-line options.
596
if test -n "$libobj" ; then
597
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
604
-static | -prefer-pic | -prefer-non-pic)
615
arg_mode=arg # the next one goes into the "base_compile" arg list
616
continue # The current "srcfile" will either be retained or
617
;; # replaced later. I would guess that would be a bug.
620
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
622
save_ifs="$IFS"; IFS=','
626
# Double-quote args containing other shell metacharacters.
627
# Many Bourne shells cannot handle close brackets correctly
628
# in scan sets, so we specify it separately.
630
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
634
lastarg="$lastarg $arg"
637
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
639
# Add the arguments to base_compile.
640
base_compile="$base_compile $lastarg"
645
# Accept the current argument as the source file.
646
# The previous "srcfile" becomes the current argument.
653
esac # case $arg_mode
385
655
# Aesthetically quote the previous argument.
387
# Backslashify any backslashes, double quotes, and dollar signs.
388
# These are the only characters that are still specially
389
# interpreted inside of double-quoted scrings.
390
656
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
392
659
# Double-quote args containing other shell metacharacters.
393
660
# Many Bourne shells cannot handle close brackets correctly
394
# in scan sets, so we specify it separately.
396
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
661
# in scan sets, and some SunOS ksh mistreat backslash-escaping
662
# in scan sets (worked around with variable expansion),
663
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
664
# at all, so we specify them separately.
665
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
397
666
lastarg="\"$lastarg\""
401
# Add the previous argument to base_compile.
402
if test -z "$base_compile"; then
403
base_compile="$lastarg"
405
base_compile="$base_compile $lastarg"
670
base_compile="$base_compile $lastarg"
675
$echo "$modename: you must specify an argument for -Xcompile"
679
$echo "$modename: you must specify a target with \`-o'" 1>&2
413
683
# Get the name of the library object.
414
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
417
$echo "$modename: you must specify a target with \`-o'" 1>&2
684
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
422
688
# Recognize several different file suffixes.
423
689
# If the user specifies -o file.o, it is replaced with file.lo
426
692
*.ada) xform=ada ;;
427
693
*.adb) xform=adb ;;
441
710
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
443
712
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
717
func_infer_tag $base_compile
719
for arg in $later; do
738
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
740
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
741
qlibobj="\"$qlibobj\"" ;;
743
if test "X$libobj" != "X$qlibobj"; then
744
$echo "$modename: libobj name \`$libobj' may not contain shell special characters."
747
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
748
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
749
if test "X$xdir" = "X$obj"; then
754
lobj=${xdir}$objdir/$objname
448
756
if test -z "$base_compile"; then
449
757
$echo "$modename: you must specify a compilation command" 1>&2
450
758
$echo "$help" 1>&2
454
762
# Delete any leftover library objects.
455
763
if test "$build_old_libs" = yes; then
456
removelist="$obj $libobj"
764
removelist="$obj $lobj $libobj ${libobj}T"
766
removelist="$lobj $libobj ${libobj}T"
461
769
$run $rm $removelist
462
trap "$run $rm $removelist; exit 1" 1 2 15
770
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
464
772
# On Cygwin there's no "real" PIC flag so we must build both object types
520
848
fbsd_hideous_sh_bug=$base_compile
522
850
if test "$pic_mode" != no; then
523
# All platforms use -DPIC, to notify preprocessed assembler code.
524
command="$base_compile $srcfile $pic_flag -DPIC"
851
command="$base_compile $qsrcfile $pic_flag"
526
853
# Don't build PIC code
527
command="$base_compile $srcfile"
529
if test "$build_old_libs" = yes; then
531
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
532
if test "X$dir" = "X$libobj"; then
537
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
539
if test -d "$dir"; then
546
if test $status -ne 0 && test ! -d $dir; then
551
if test "$compiler_o_lo" = yes; then
553
command="$command -o $output_obj"
554
elif test "$compiler_c_o" = yes; then
556
command="$command -o $output_obj"
559
$run $rm "$output_obj"
854
command="$base_compile $qsrcfile"
857
if test ! -d "${xdir}$objdir"; then
858
$show "$mkdir ${xdir}$objdir"
859
$run $mkdir ${xdir}$objdir
861
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
866
if test -z "$output_obj"; then
867
# Place PIC objects in $objdir
868
command="$command -o $lobj"
871
$run $rm "$lobj" "$output_obj"
561
874
if $run eval "$command"; then :
563
876
test -n "$output_obj" && $run $rm $removelist
567
880
if test "$need_locks" = warn &&
568
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
881
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
570
883
*** ERROR, $lockfile contains:
571
884
`cat $lockfile 2>/dev/null`
583
896
$run $rm $removelist
587
900
# Just move the object if needed, then go on to compile the next one
588
if test x"$output_obj" != x"$libobj"; then
589
$show "$mv $output_obj $libobj"
590
if $run $mv $output_obj $libobj; then :
598
# If we have no pic_flag, then copy the object into place and finish.
599
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
600
test "$build_old_libs" = yes; then
601
# Rename the .lo from within objdir to obj
602
if test -f $obj; then
607
$show "$mv $libobj $obj"
608
if $run $mv $libobj $obj; then :
615
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
616
if test "X$xdir" = "X$obj"; then
621
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
622
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
623
# Now arrange that obj and lo_libobj become the same file
624
$show "(cd $xdir && $LN_S $baseobj $libobj)"
625
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
626
# Unlock the critical section if it was locked
627
if test "$need_locks" != no; then
901
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
902
$show "$mv $output_obj $lobj"
903
if $run $mv $output_obj $lobj; then :
911
# Append the name of the PIC object to the libtool object file.
912
test -z "$run" && cat >> ${libobj}T <<EOF
913
pic_object='$objdir/$objname'
638
917
# Allow error messages only from the first compilation.
639
suppress_output=' >/dev/null 2>&1'
918
if test "$suppress_opt" = yes; then
919
suppress_output=' >/dev/null 2>&1'
922
# No PIC object so indicate it doesn't exist in the libtool
924
test -z "$run" && cat >> ${libobj}T <<EOF
642
930
# Only build a position-dependent object if we build old libraries.
643
931
if test "$build_old_libs" = yes; then
644
932
if test "$pic_mode" != yes; then
645
933
# Don't build PIC code
646
command="$base_compile $srcfile"
934
command="$base_compile $qsrcfile"
648
# All platforms use -DPIC, to notify preprocessed assembler code.
649
command="$base_compile $srcfile $pic_flag -DPIC"
936
command="$base_compile $qsrcfile $pic_flag"
651
938
if test "$compiler_c_o" = yes; then
652
939
command="$command -o $obj"
656
942
# Suppress compiler output if we already did a PIC compilation.
657
943
command="$command$suppress_output"
658
$run $rm "$output_obj"
944
$run $rm "$obj" "$output_obj"
660
946
if $run eval "$command"; then :
662
948
$run $rm $removelist
666
952
if test "$need_locks" = warn &&
667
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
953
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
669
955
*** ERROR, $lockfile contains:
670
956
`cat $lockfile 2>/dev/null`
697
# Create an invalid libtool object if no PIC, so that we do not
698
# accidentally link it into a program.
699
if test "$build_libtool_libs" != yes; then
700
$show "echo timestamp > $libobj"
701
$run eval "echo timestamp > \$libobj" || exit $?
703
# Move the .lo from within objdir
704
$show "$mv $libobj $lo_libobj"
705
if $run $mv $libobj $lo_libobj; then :
983
# Append the name of the non-PIC object the libtool object file.
984
# Only append if the libtool object file exists.
985
test -z "$run" && cat >> ${libobj}T <<EOF
986
# Name of the non-PIC object.
987
non_pic_object='$objname'
991
# Append the name of the non-PIC object the libtool object file.
992
# Only append if the libtool object file exists.
993
test -z "$run" && cat >> ${libobj}T <<EOF
994
# Name of the non-PIC object.
1000
$run $mv "${libobj}T" "${libobj}"
714
1002
# Unlock the critical section if it was locked
715
1003
if test "$need_locks" != no; then
716
1004
$run $rm "$lockfile"
722
1010
# libtool link mode
892
1186
inst_prefix_dir="$arg"
1191
precious_files_regex="$arg"
1201
if test -f "$arg"; then
1204
for fil in `cat $save_arg`
1206
# moreargs="$moreargs $fil"
1208
# A libtool-controlled object.
1210
# Check to see that this really is a libtool object.
1211
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1216
# If there is no directory component, then add one.
1218
*/* | *\\*) . $arg ;;
1222
if test -z "$pic_object" || \
1223
test -z "$non_pic_object" ||
1224
test "$pic_object" = none && \
1225
test "$non_pic_object" = none; then
1226
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1230
# Extract subdirectory from the argument.
1231
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1232
if test "X$xdir" = "X$arg"; then
1238
if test "$pic_object" != none; then
1239
# Prepend the subdirectory the object is found in.
1240
pic_object="$xdir$pic_object"
1242
if test "$prev" = dlfiles; then
1243
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1244
dlfiles="$dlfiles $pic_object"
1248
# If libtool objects are unsupported, then we need to preload.
1253
# CHECK ME: I think I busted this. -Ossama
1254
if test "$prev" = dlprefiles; then
1255
# Preload the old-style object.
1256
dlprefiles="$dlprefiles $pic_object"
1261
libobjs="$libobjs $pic_object"
1266
if test "$non_pic_object" != none; then
1267
# Prepend the subdirectory the object is found in.
1268
non_pic_object="$xdir$non_pic_object"
1270
# A standard non-PIC object
1271
non_pic_objects="$non_pic_objects $non_pic_object"
1272
if test -z "$pic_object" || test "$pic_object" = none ; then
1273
arg="$non_pic_object"
1277
# Only an error if not doing a dry-run.
1278
if test -z "$run"; then
1279
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1284
# Extract subdirectory from the argument.
1285
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1286
if test "X$xdir" = "X$arg"; then
1292
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1293
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1294
libobjs="$libobjs $pic_object"
1295
non_pic_objects="$non_pic_objects $non_pic_object"
1300
$echo "$modename: link input file \`$save_arg' does not exist"
902
1308
# We need an absolute path.
904
1310
[\\/]* | [A-Za-z]:[\\/]*) ;;
906
1312
$echo "$modename: only absolute run-paths are allowed" 1>&2
910
1316
if test "$prev" = rpath; then
1054
1488
# These systems don't actually have a C library (as such)
1055
1489
test "X$arg" = "X-lc" && continue
1491
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1058
1492
# Do not include libc due to us having libc/libc_r.
1059
1493
test "X$arg" = "X-lc" && continue
1062
elif test "X$arg" = "X-lc_r"; then
1065
# Do not include libc_r directly, use -pthread flag.
1495
*-*-rhapsody* | *-*-darwin1.[012])
1496
# Rhapsody C and math libraries are in the System framework
1497
deplibs="$deplibs -framework System"
1500
elif test "X$arg" = "X-lc_r"; then
1502
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1503
# Do not include libc_r directly, use -pthread flag.
1070
1508
deplibs="$deplibs $arg"
1512
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1513
# classes, name mangling, and exception handling.
1515
compile_command="$compile_command $arg"
1516
compiler_flags="$compiler_flags $arg"
1517
finalize_command="$finalize_command $arg"
1522
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1523
compiler_flags="$compiler_flags $arg"
1524
compile_command="$compile_command $arg"
1525
finalize_command="$finalize_command $arg"
1534
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1535
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1536
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1537
# +DA*, +DD* enable 64-bit mode on the HP compiler
1538
# -q* pass through compiler args for the IBM compiler
1539
# -m* pass through architecture-specific compiler args for GCC
1540
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1542
# Unknown arguments in both finalize_command and compile_command need
1543
# to be aesthetically quoted because they are evaled later.
1544
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1546
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1550
compile_command="$compile_command $arg"
1551
finalize_command="$finalize_command $arg"
1552
if test "$with_gcc" = "yes" ; then
1553
compiler_flags="$compiler_flags $arg"
1079
1563
-no-fast-install)
1080
1564
fast_install=no
1203
1707
# Some other compiler flag.
1205
1709
# Unknown arguments in both finalize_command and compile_command need
1206
1710
# to be aesthetically quoted because they are evaled later.
1207
1711
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1209
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1713
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1216
# A library or standard object.
1217
if test "$prev" = dlfiles; then
1218
# This file was specified with -dlopen.
1219
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1220
dlfiles="$dlfiles $arg"
1224
# If libtool objects are unsupported, then we need to preload.
1229
if test "$prev" = dlprefiles; then
1230
# Preload the old-style object.
1231
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1720
# A standard object.
1725
# A libtool-controlled object.
1727
# Check to see that this really is a libtool object.
1728
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1733
# If there is no directory component, then add one.
1235
*.lo) libobjs="$libobjs $arg" ;;
1236
*) objs="$objs $arg" ;;
1735
*/* | *\\*) . $arg ;;
1739
if test -z "$pic_object" || \
1740
test -z "$non_pic_object" ||
1741
test "$pic_object" = none && \
1742
test "$non_pic_object" = none; then
1743
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1747
# Extract subdirectory from the argument.
1748
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1749
if test "X$xdir" = "X$arg"; then
1755
if test "$pic_object" != none; then
1756
# Prepend the subdirectory the object is found in.
1757
pic_object="$xdir$pic_object"
1759
if test "$prev" = dlfiles; then
1760
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1761
dlfiles="$dlfiles $pic_object"
1765
# If libtool objects are unsupported, then we need to preload.
1770
# CHECK ME: I think I busted this. -Ossama
1771
if test "$prev" = dlprefiles; then
1772
# Preload the old-style object.
1773
dlprefiles="$dlprefiles $pic_object"
1778
libobjs="$libobjs $pic_object"
1783
if test "$non_pic_object" != none; then
1784
# Prepend the subdirectory the object is found in.
1785
non_pic_object="$xdir$non_pic_object"
1787
# A standard non-PIC object
1788
non_pic_objects="$non_pic_objects $non_pic_object"
1789
if test -z "$pic_object" || test "$pic_object" = none ; then
1790
arg="$non_pic_object"
1794
# Only an error if not doing a dry-run.
1795
if test -z "$run"; then
1796
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1801
# Extract subdirectory from the argument.
1802
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1803
if test "X$xdir" = "X$arg"; then
1809
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1810
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1811
libobjs="$libobjs $pic_object"
1812
non_pic_objects="$non_pic_objects $non_pic_object"
1336
1913
*) linkmode=prog ;; # Anything else should be a program.
1917
*cygwin* | *mingw* | *pw32*)
1918
# don't eliminate duplications in $postdeps and $predeps
1919
duplicate_compiler_generated_deps=yes
1922
duplicate_compiler_generated_deps=$duplicate_deps
1339
1925
specialdeplibs=
1341
1928
# Find all interdependent deplibs by searching for libraries
1342
1929
# that are linked more than once (e.g. -la -lb -la)
1343
1930
for deplib in $deplibs; do
1345
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1931
if test "X$duplicate_deps" = "Xyes" ; then
1933
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1347
1936
libs="$libs $deplib"
1939
if test "$linkmode" = lib; then
1940
libs="$predeps $libs $compiler_lib_search_path $postdeps"
1942
# Compute libraries that are listed more than once in $predeps
1943
# $postdeps and mark them as special (i.e., whose duplicates are
1944
# not to be eliminated).
1946
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1947
for pre_post_dep in $predeps $postdeps; do
1948
case "$pre_post_deps " in
1949
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1951
pre_post_deps="$pre_post_deps $pre_post_dep"
1350
1958
newdependency_libs=
1351
1959
newlib_search_path=
1379
1987
for pass in $passes; do
1380
if test $linkmode = prog; then
1381
# Determine which files to process
1988
if test "$linkmode,$pass" = "lib,link" ||
1989
test "$linkmode,$pass" = "prog,scan"; then
1993
if test "$linkmode" = prog; then
1385
save_deplibs="$deplibs" # Collect dlpreopened libraries
1995
dlopen) libs="$dlfiles" ;;
1388
1996
dlpreopen) libs="$dlprefiles" ;;
1389
1997
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2000
if test "$pass" = dlopen; then
2001
# Collect dlpreopened libraries
2002
save_deplibs="$deplibs"
1392
2005
for deplib in $libs; do
1395
2008
case $deplib in
2009
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2010
if test "$linkmode,$pass" = "prog,link"; then
2011
compile_deplibs="$deplib $compile_deplibs"
2012
finalize_deplibs="$deplib $finalize_deplibs"
2014
compiler_flags="$compiler_flags $deplib"
1397
if test $linkmode = oldlib && test $linkmode = obj; then
1398
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1401
if test $pass = conv; then
1402
deplibs="$deplib $deplibs"
2019
if test "$linkmode" != lib && test "$linkmode" != prog; then
2020
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1405
2023
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1406
2024
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1407
# Search the libtool library
1408
lib="$searchdir/lib${name}.la"
1409
if test -f "$lib"; then
2025
for search_ext in .la $std_shrext .so .a; do
2026
# Search the libtool library
2027
lib="$searchdir/lib${name}${search_ext}"
2028
if test -f "$lib"; then
2029
if test "$search_ext" = ".la"; then
1414
2038
if test "$found" != yes; then
1415
2039
# deplib doesn't seem to be a libtool library
1418
2042
finalize_deplibs="$deplib $finalize_deplibs"
1420
2044
deplibs="$deplib $deplibs"
1421
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
2045
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2048
else # deplib is a libtool library
2049
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2050
# We need to do some special things here, and not later.
2051
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2052
case " $predeps $postdeps " in
2054
if (${SED} -e '2q' $lib |
2055
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2059
*/* | *\\*) . $lib ;;
2062
for l in $old_library $library_names; do
2065
if test "X$ll" = "X$old_library" ; then # only static version available
2067
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2068
test "X$ladir" = "X$lib" && ladir="."
2069
lib=$ladir/$old_library
2070
if test "$linkmode,$pass" = "prog,link"; then
2071
compile_deplibs="$deplib $compile_deplibs"
2072
finalize_deplibs="$deplib $finalize_deplibs"
2074
deplibs="$deplib $deplibs"
2075
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1427
2087
case $linkmode in
1429
2089
deplibs="$deplib $deplibs"
1430
test $pass = conv && continue
2090
test "$pass" = conv && continue
1431
2091
newdependency_libs="$deplib $newdependency_libs"
1432
2092
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1435
if test $pass = conv; then
2095
if test "$pass" = conv; then
1436
2096
deplibs="$deplib $deplibs"
1439
if test $pass = scan; then
2099
if test "$pass" = scan; then
1440
2100
deplibs="$deplib $deplibs"
1441
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1443
2102
compile_deplibs="$deplib $compile_deplibs"
1444
2103
finalize_deplibs="$deplib $finalize_deplibs"
2105
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1448
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
2108
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1450
2110
esac # linkmode
1454
if test $pass = link; then
2114
if test "$pass" = link; then
1455
2115
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1456
2116
# Make sure the xrpath contains only unique directories.
1457
2117
case "$xrpath " in
1465
2125
*.la) lib="$deplib" ;;
1467
if test $pass = conv; then
2127
if test "$pass" = conv; then
1468
2128
deplibs="$deplib $deplibs"
1471
2131
case $linkmode in
1473
if test "$deplibs_check_method" != pass_all; then
1475
echo "*** Warning: This library needs some functionality provided by $deplib."
1476
echo "*** I have the capability to make that library automatically link in when"
1477
echo "*** you link to this library. But I can only do this if you have a"
1478
echo "*** shared version of the library, which you do not appear to have."
2134
case $deplibs_check_method in
2136
set dummy $deplibs_check_method
2137
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2138
if eval $echo \"$deplib\" 2>/dev/null \
2140
| $EGREP "$match_pattern_regex" > /dev/null; then
2148
if test "$valid_a_lib" != yes; then
2150
$echo "*** Warning: Trying to link with static lib archive $deplib."
2151
$echo "*** I have the capability to make that library automatically link in when"
2152
$echo "*** you link to this library. But I can only do this if you have a"
2153
$echo "*** shared version of the library, which you do not appear to have"
2154
$echo "*** because the file extensions .$libext of this argument makes me believe"
2155
$echo "*** that it is just a static archive that I should not used here."
1481
echo "*** Warning: Linking the shared library $output against the"
1482
echo "*** static library $deplib is not portable!"
2158
$echo "*** Warning: Linking the shared library $output against the"
2159
$echo "*** static library $deplib is not portable!"
1483
2160
deplibs="$deplib $deplibs"
1488
if test $pass != link; then
2165
if test "$pass" != link; then
1489
2166
deplibs="$deplib $deplibs"
1491
2168
compile_deplibs="$deplib $compile_deplibs"
1586
2272
if test -z "$linklib"; then
1587
2273
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1591
2277
# This library was specified with -dlopen.
1592
if test $pass = dlopen; then
2278
if test "$pass" = dlopen; then
1593
2279
if test -z "$libdir"; then
1594
2280
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1597
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2283
if test -z "$dlname" ||
2284
test "$dlopen_support" != yes ||
2285
test "$build_libtool_libs" = no; then
1598
2286
# If there is no dlname, no dlopen support or we're linking
1599
# statically, we need to preload.
1600
dlprefiles="$dlprefiles $lib"
2287
# statically, we need to preload. We also need to preload any
2288
# dependent libraries so libltdl's deplib preloader doesn't
2289
# bomb out in the load deplibs phase.
2290
dlprefiles="$dlprefiles $lib $dependency_libs"
1602
2292
newdlfiles="$newdlfiles $lib"
1684
2383
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1686
2385
# Need to link against all dependency_libs?
1687
if test $linkalldeplibs = yes; then
2386
if test "$linkalldeplibs" = yes; then
1688
2387
deplibs="$deplib $deplibs"
1690
2389
# Need to hardcode shared library paths
1691
2390
# or/and link against static libraries
1692
2391
newdependency_libs="$deplib $newdependency_libs"
1694
case "$tmp_libs " in
1695
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2393
if test "X$duplicate_deps" = "Xyes" ; then
2394
case "$tmp_libs " in
2395
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1697
2398
tmp_libs="$tmp_libs $deplib"
1698
2399
done # for deplib
1700
2401
fi # $linkmode = prog...
2403
if test "$linkmode,$pass" = "prog,link"; then
2404
if test -n "$library_names" &&
2405
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2406
# We need to hardcode the library path
2407
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2408
# Make sure the rpath contains only unique directories.
2409
case "$temp_rpath " in
2412
*) temp_rpath="$temp_rpath $dir" ;;
2416
# Hardcode the library path.
2417
# Skip directories that are in the system default run-time
2419
case " $sys_lib_dlsearch_path " in
2422
case "$compile_rpath " in
2424
*) compile_rpath="$compile_rpath $absdir"
2428
case " $sys_lib_dlsearch_path " in
2431
case "$finalize_rpath " in
2433
*) finalize_rpath="$finalize_rpath $libdir"
2437
fi # $linkmode,$pass = prog,link...
2439
if test "$alldeplibs" = yes &&
2440
{ test "$deplibs_check_method" = pass_all ||
2441
{ test "$build_libtool_libs" = yes &&
2442
test -n "$library_names"; }; }; then
2443
# We only need to search for static libraries
1702
2448
link_static=no # Whether the deplib will be linked statically
1703
2449
if test -n "$library_names" &&
1704
2450
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1705
# Link against this shared library
1707
if test "$linkmode,$pass" = "prog,link" ||
1708
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1709
# Hardcode the library path.
1710
# Skip directories that are in the system default run-time
1712
case " $sys_lib_dlsearch_path " in
1715
case "$compile_rpath " in
1717
*) compile_rpath="$compile_rpath $absdir"
1721
case " $sys_lib_dlsearch_path " in
1724
case "$finalize_rpath " in
1726
*) finalize_rpath="$finalize_rpath $libdir"
1730
if test $linkmode = prog; then
1731
# We need to hardcode the library path
1732
if test -n "$shlibpath_var"; then
1733
# Make sure the rpath contains only unique directories.
1734
case "$temp_rpath " in
1737
*) temp_rpath="$temp_rpath $dir" ;;
1741
fi # $linkmode,$pass = prog,link...
1743
if test "$alldeplibs" = yes &&
1744
{ test "$deplibs_check_method" = pass_all ||
1745
{ test "$build_libtool_libs" = yes &&
1746
test -n "$library_names"; }; }; then
1747
# We only need to search for static libraries
1751
2451
if test "$installed" = no; then
1752
2452
notinst_deplibs="$notinst_deplibs $lib"
1753
2453
need_relink=yes
2455
# This is a shared library
2457
# Warn about portability, can't link against -module's on
2458
# some systems (darwin)
2459
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2461
if test "$linkmode" = prog; then
2462
$echo "*** Warning: Linking the executable $output against the loadable module"
2464
$echo "*** Warning: Linking the shared library $output against the loadable module"
2466
$echo "*** $linklib is not portable!"
2468
if test "$linkmode" = lib &&
2469
test "$hardcode_into_libs" = yes; then
2470
# Hardcode the library path.
2471
# Skip directories that are in the system default run-time
2473
case " $sys_lib_dlsearch_path " in
2476
case "$compile_rpath " in
2478
*) compile_rpath="$compile_rpath $absdir"
2482
case " $sys_lib_dlsearch_path " in
2485
case "$finalize_rpath " in
2487
*) finalize_rpath="$finalize_rpath $libdir"
1756
2493
if test -n "$old_archive_from_expsyms_cmds"; then
1757
2494
# figure out the soname
1956
2706
# Just print a warning and add the library to dependency_libs so
1957
2707
# that the program can be linked against the static library.
1959
echo "*** Warning: This library needs some functionality provided by $lib."
1960
echo "*** I have the capability to make that library automatically link in when"
1961
echo "*** you link to this library. But I can only do this if you have a"
1962
echo "*** shared version of the library, which you do not appear to have."
2709
$echo "*** Warning: This system can not link to static lib archive $lib."
2710
$echo "*** I have the capability to make that library automatically link in when"
2711
$echo "*** you link to this library. But I can only do this if you have a"
2712
$echo "*** shared version of the library, which you do not appear to have."
1963
2713
if test "$module" = yes; then
1964
echo "*** Therefore, libtool will create a static module, that should work "
1965
echo "*** as long as the dlopening application is linked with the -dlopen flag."
2714
$echo "*** But as you try to build a module library, libtool will still create "
2715
$echo "*** a static module, that should work as long as the dlopening application"
2716
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1966
2717
if test -z "$global_symbol_pipe"; then
1968
echo "*** However, this would only work if libtool was able to extract symbol"
1969
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1970
echo "*** not find such a program. So, this module is probably useless."
1971
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2719
$echo "*** However, this would only work if libtool was able to extract symbol"
2720
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2721
$echo "*** not find such a program. So, this module is probably useless."
2722
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
1973
2724
if test "$build_old_libs" = no; then
1974
2725
build_libtool_libs=module
2039
2793
if grep "^installed=no" $deplib > /dev/null; then
2040
path="-L$absdir/$objdir"
2794
path="$absdir/$objdir"
2042
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2796
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2043
2797
if test -z "$libdir"; then
2044
2798
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2047
2801
if test "$absdir" != "$libdir"; then
2048
2802
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2809
# we do not want to link against static libs,
2810
# but need to link against shared
2811
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2812
if test -n "$deplibrary_names" ; then
2813
for tmp in $deplibrary_names ; do
2816
if test -f "$path/$depdepl" ; then
2817
depdepl="$path/$depdepl"
2819
# do not add paths which are already there
2820
case " $newlib_search_path " in
2822
*) newlib_search_path="$newlib_search_path $path";;
2835
# Again, we only want to link against shared libraries
2836
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2837
for tmp in $newlib_search_path ; do
2838
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2839
eval depdepl="$tmp/lib$tmp_libs.dylib"
2055
2850
case " $deplibs " in
2056
2851
*" $path "*) ;;
2057
*) deplibs="$deplibs $path" ;;
2852
*) deplibs="$path $deplibs" ;;
2854
case " $deplibs " in
2856
*) deplibs="$depdepl $deplibs" ;;
2060
2859
fi # link_all_deplibs != no
2061
2860
fi # linkmode = lib
2062
2861
done # for deplib in $libs
2063
if test $pass = dlpreopen; then
2862
dependency_libs="$newdependency_libs"
2863
if test "$pass" = dlpreopen; then
2064
2864
# Link the dlpreopened libraries before other libraries
2065
2865
for deplib in $save_deplibs; do
2066
2866
deplibs="$deplib $deplibs"
2069
if test $pass != dlopen; then
2070
test $pass != scan && dependency_libs="$newdependency_libs"
2071
if test $pass != conv; then
2869
if test "$pass" != dlopen; then
2870
if test "$pass" != conv; then
2072
2871
# Make sure lib_search_path contains only unique directories.
2073
2872
lib_search_path=
2074
2873
for dir in $newlib_search_path; do
2090
2889
eval tmp_libs=\"\$$var\"
2092
2891
for deplib in $tmp_libs; do
2892
# FIXME: Pedantically, this is the right thing to do, so
2893
# that some nasty dependency loop isn't accidentally
2895
#new_libs="$deplib $new_libs"
2896
# Pragmatically, this seems to cause very few problems in
2093
2898
case $deplib in
2094
2899
-L*) new_libs="$deplib $new_libs" ;;
2902
# And here is the reason: when a library appears more
2903
# than once as an explicit dependence of a library, or
2904
# is implicitly linked in more than once by the
2905
# compiler, it is considered special, and multiple
2906
# occurrences thereof are not removed. Compare this
2907
# with having the same library being listed as a
2908
# dependency of multiple other libraries: in this case,
2909
# we know (pedantically, we assume) the library does not
2910
# need to be listed more than once, so we keep only the
2911
# last copy. This is not always right, but it is rare
2912
# enough that we require users that really mean to play
2913
# such unportable linking tricks to link the library
2914
# using -Wl,-lname, so that libtool does not consider it
2915
# for duplicate removal.
2096
2916
case " $specialdeplibs " in
2097
2917
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2235
3072
if test -n "$8"; then
2236
3073
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2237
3074
$echo "$help" 1>&2
3078
# convert absolute version numbers to libtool ages
3079
# this retains compatibility with .la files and attempts
3080
# to make the code below a bit more comprehensible
3082
case $vinfo_number in
3086
number_revision="$4"
3088
# There are really only two kinds -- those that
3089
# use the current revision as the major version
3090
# and those that subtract age and use age as
3091
# a minor version. But, then there is irix
3092
# which has an extra 1 added just for fun
3094
case $version_type in
3095
darwin|linux|osf|windows)
3096
current=`expr $number_major + $number_minor`
3098
revision="$number_revision"
3100
freebsd-aout|freebsd-elf|sunos)
3101
current="$number_major"
3102
revision="$number_minor"
3106
current=`expr $number_major + $number_minor - 1`
3108
revision="$number_minor"
2245
3119
# Check that each of the things are valid numbers.
2246
3120
case $current in
2247
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3121
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2249
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3123
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2250
3124
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2255
3129
case $revision in
2256
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3130
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2258
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3132
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2259
3133
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2265
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3139
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2267
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3141
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2268
3142
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2273
if test $age -gt $current; then
3147
if test "$age" -gt "$current"; then
2274
3148
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2275
3149
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2279
3153
# Calculate the version variables.
2516
3416
int main() { return 0; }
2519
$CC -o conftest conftest.c $deplibs
2520
if test $? -eq 0 ; then
3419
$LTCC -o conftest conftest.c $deplibs
3420
if test "$?" -eq 0 ; then
2521
3421
ldd_output=`ldd conftest`
2522
3422
for i in $deplibs; do
2523
3423
name="`expr $i : '-l\(.*\)'`"
2524
3424
# If $name is empty we are operating on a -L argument.
2525
if test -n "$name" && test "$name" != "0"; then
2526
libname=`eval \\$echo \"$libname_spec\"`
2527
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2528
set dummy $deplib_matches
2530
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2531
newdeplibs="$newdeplibs $i"
2535
echo "*** Warning: This library needs some functionality provided by $i."
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."
2541
newdeplibs="$newdeplibs $i"
2545
# Error occured in the first compile. Let's try to salvage the situation:
2546
# Compile a seperate program for each library.
2547
for i in $deplibs; do
2548
name="`expr $i : '-l\(.*\)'`"
2549
# If $name is empty we are operating on a -L argument.
2550
if test -n "$name" && test "$name" != "0"; then
2552
$CC -o conftest conftest.c $i
2554
if test $? -eq 0 ; then
2555
ldd_output=`ldd conftest`
3425
if test "$name" != "" && test "$name" -ne "0"; then
3426
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3427
case " $predeps $postdeps " in
3429
newdeplibs="$newdeplibs $i"
3434
if test -n "$i" ; then
2556
3435
libname=`eval \\$echo \"$libname_spec\"`
2557
3436
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2558
3437
set dummy $deplib_matches
2561
3440
newdeplibs="$newdeplibs $i"
2563
3442
droppeddeps=yes
2565
echo "*** Warning: This library needs some functionality provided by $i."
2566
echo "*** I have the capability to make that library automatically link in when"
2567
echo "*** you link to this library. But I can only do this if you have a"
2568
echo "*** shared version of the library, which you do not appear to have."
3444
$echo "*** Warning: dynamic linker does not accept needed library $i."
3445
$echo "*** I have the capability to make that library automatically link in when"
3446
$echo "*** you link to this library. But I can only do this if you have a"
3447
$echo "*** shared version of the library, which I believe you do not have"
3448
$echo "*** because a test_compile did reveal that the linker did not use it for"
3449
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3453
newdeplibs="$newdeplibs $i"
3457
# Error occurred in the first compile. Let's try to salvage
3458
# the situation: Compile a separate program for each library.
3459
for i in $deplibs; do
3460
name="`expr $i : '-l\(.*\)'`"
3461
# If $name is empty we are operating on a -L argument.
3462
if test "$name" != "" && test "$name" != "0"; then
3464
$LTCC -o conftest conftest.c $i
3466
if test "$?" -eq 0 ; then
3467
ldd_output=`ldd conftest`
3468
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3469
case " $predeps $postdeps " in
3471
newdeplibs="$newdeplibs $i"
3476
if test -n "$i" ; then
3477
libname=`eval \\$echo \"$libname_spec\"`
3478
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3479
set dummy $deplib_matches
3481
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3482
newdeplibs="$newdeplibs $i"
3486
$echo "*** Warning: dynamic linker does not accept needed library $i."
3487
$echo "*** I have the capability to make that library automatically link in when"
3488
$echo "*** you link to this library. But I can only do this if you have a"
3489
$echo "*** shared version of the library, which you do not appear to have"
3490
$echo "*** because a test_compile did reveal that the linker did not use this one"
3491
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2571
3495
droppeddeps=yes
2573
echo "*** Warning! Library $i is needed by this library but I was not able to"
2574
echo "*** make it link in! You will probably need to install it or some"
2575
echo "*** library that it depends on before this library will be fully"
2576
echo "*** functional. Installing it before continuing would be even better."
3497
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3498
$echo "*** make it link in! You will probably need to install it or some"
3499
$echo "*** library that it depends on before this library will be fully"
3500
$echo "*** functional. Installing it before continuing would be even better."
2579
3503
newdeplibs="$newdeplibs $i"
2587
3511
for a_deplib in $deplibs; do
2588
3512
name="`expr $a_deplib : '-l\(.*\)'`"
2589
3513
# If $name is empty we are operating on a -L argument.
2590
if test -n "$name" && test "$name" != "0"; then
2591
libname=`eval \\$echo \"$libname_spec\"`
2592
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2593
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2594
for potent_lib in $potential_libs; do
3514
if test "$name" != "" && test "$name" != "0"; then
3515
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3516
case " $predeps $postdeps " in
3518
newdeplibs="$newdeplibs $a_deplib"
3523
if test -n "$a_deplib" ; then
3524
libname=`eval \\$echo \"$libname_spec\"`
3525
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3526
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3527
for potent_lib in $potential_libs; do
2595
3528
# Follow soft links.
2596
3529
if ls -lLd "$potent_lib" 2>/dev/null \
2597
3530
| grep " -> " >/dev/null; then
2605
3538
potlib="$potent_lib"
2606
3539
while test -h "$potlib" 2>/dev/null; do
2607
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
3540
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2608
3541
case $potliblink in
2609
3542
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2610
3543
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2613
3546
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2615
| egrep "$file_magic_regex" > /dev/null; then
3548
| $EGREP "$file_magic_regex" > /dev/null; then
2616
3549
newdeplibs="$newdeplibs $a_deplib"
2622
3556
if test -n "$a_deplib" ; then
2623
3557
droppeddeps=yes
2625
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2626
echo "*** I have the capability to make that library automatically link in when"
2627
echo "*** you link to this library. But I can only do this if you have a"
2628
echo "*** shared version of the library, which you do not appear to have."
3559
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3560
$echo "*** I have the capability to make that library automatically link in when"
3561
$echo "*** you link to this library. But I can only do this if you have a"
3562
$echo "*** shared version of the library, which you do not appear to have"
3563
$echo "*** because I did check the linker path looking for a file starting"
3564
if test -z "$potlib" ; then
3565
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3567
$echo "*** with $libname and none of the candidates passed a file format test"
3568
$echo "*** using a file magic. Last file checked: $potlib"
2631
3572
# Add a -L argument.
2640
3581
name="`expr $a_deplib : '-l\(.*\)'`"
2641
3582
# If $name is empty we are operating on a -L argument.
2642
3583
if test -n "$name" && test "$name" != "0"; then
2643
libname=`eval \\$echo \"$libname_spec\"`
2644
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2645
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2646
for potent_lib in $potential_libs; do
2647
if eval echo \"$potent_lib\" 2>/dev/null \
2649
| egrep "$match_pattern_regex" > /dev/null; then
2650
newdeplibs="$newdeplibs $a_deplib"
3584
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3585
case " $predeps $postdeps " in
3587
newdeplibs="$newdeplibs $a_deplib"
3592
if test -n "$a_deplib" ; then
3593
libname=`eval \\$echo \"$libname_spec\"`
3594
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3595
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3596
for potent_lib in $potential_libs; do
3597
potlib="$potent_lib" # see symlink-check above in file_magic test
3598
if eval $echo \"$potent_lib\" 2>/dev/null \
3600
| $EGREP "$match_pattern_regex" > /dev/null; then
3601
newdeplibs="$newdeplibs $a_deplib"
2656
3608
if test -n "$a_deplib" ; then
2657
3609
droppeddeps=yes
2659
echo "*** Warning: This library needs some functionality provided by $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."
3611
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3612
$echo "*** I have the capability to make that library automatically link in when"
3613
$echo "*** you link to this library. But I can only do this if you have a"
3614
$echo "*** shared version of the library, which you do not appear to have"
3615
$echo "*** because I did check the linker path looking for a file starting"
3616
if test -z "$potlib" ; then
3617
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3619
$echo "*** with $libname and none of the candidates passed a file format test"
3620
$echo "*** using a regex pattern. Last file checked: $potlib"
2665
3624
# Add a -L argument.
2670
3629
none | unknown | *)
2672
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2673
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2674
grep . >/dev/null; then
3631
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3632
-e 's/ -[LR][^ ]*//g'`
3633
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3634
for i in $predeps $postdeps ; do
3635
# can't use Xsed below, because $i might contain '/'
3636
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3639
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3640
| grep . >/dev/null; then
2676
3642
if test "X$deplibs_check_method" = "Xnone"; then
2677
echo "*** Warning: inter-library dependencies are not supported in this platform."
3643
$echo "*** Warning: inter-library dependencies are not supported in this platform."
2679
echo "*** Warning: inter-library dependencies are not known to be supported."
3645
$echo "*** Warning: inter-library dependencies are not known to be supported."
2681
echo "*** All declared inter-library dependencies are being dropped."
3647
$echo "*** All declared inter-library dependencies are being dropped."
2682
3648
droppeddeps=yes
2699
3665
if test "$droppeddeps" = yes; then
2700
3666
if test "$module" = yes; then
2702
echo "*** Warning: libtool could not satisfy all declared inter-library"
2703
echo "*** dependencies of module $libname. Therefore, libtool will create"
2704
echo "*** a static module, that should work as long as the dlopening"
2705
echo "*** application is linked with the -dlopen flag."
3668
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3669
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3670
$echo "*** a static module, that should work as long as the dlopening"
3671
$echo "*** application is linked with the -dlopen flag."
2706
3672
if test -z "$global_symbol_pipe"; then
2708
echo "*** However, this would only work if libtool was able to extract symbol"
2709
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2710
echo "*** not find such a program. So, this module is probably useless."
2711
echo "*** \`nm' from GNU binutils and a full rebuild may help."
3674
$echo "*** However, this would only work if libtool was able to extract symbol"
3675
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3676
$echo "*** not find such a program. So, this module is probably useless."
3677
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2713
3679
if test "$build_old_libs" = no; then
2714
3680
oldlibs="$output_objdir/$libname.$libext"
2718
3684
build_libtool_libs=no
2721
echo "*** The inter-library dependencies that have been dropped here will be"
2722
echo "*** automatically added whenever a program is linked with this library"
2723
echo "*** or is declared to -dlopen it."
3687
$echo "*** The inter-library dependencies that have been dropped here will be"
3688
$echo "*** automatically added whenever a program is linked with this library"
3689
$echo "*** or is declared to -dlopen it."
2725
if test $allow_undefined = no; then
2727
echo "*** Since this library must not contain undefined symbols,"
2728
echo "*** because either the platform does not support them or"
2729
echo "*** it was explicitly requested with -no-undefined,"
2730
echo "*** libtool will only create a static version of it."
3691
if test "$allow_undefined" = no; then
3693
$echo "*** Since this library must not contain undefined symbols,"
3694
$echo "*** because either the platform does not support them or"
3695
$echo "*** it was explicitly requested with -no-undefined,"
3696
$echo "*** libtool will only create a static version of it."
2731
3697
if test "$build_old_libs" = no; then
2732
3698
oldlibs="$output_objdir/$libname.$libext"
2733
3699
build_libtool_libs=module
2870
3835
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3839
for test_deplib in $deplibs; do
3840
case " $convenience " in
3841
*" $test_deplib "*) ;;
3843
tmp_deplibs="$tmp_deplibs $test_deplib"
3847
deplibs="$tmp_deplibs"
2873
3849
if test -n "$convenience"; then
2874
3850
if test -n "$whole_archive_flag_spec"; then
3851
save_libobjs=$libobjs
2875
3852
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2877
3854
gentop="$output_objdir/${outputname}x"
2878
$show "${rm}r $gentop"
2879
$run ${rm}r "$gentop"
2880
$show "mkdir $gentop"
2881
$run mkdir "$gentop"
2883
if test $status -ne 0 && test ! -d "$gentop"; then
2886
3855
generated="$generated $gentop"
2888
for xlib in $convenience; do
2889
# Extract the objects.
2891
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2892
*) xabs=`pwd`"/$xlib" ;;
2894
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2895
xdir="$gentop/$xlib"
2897
$show "${rm}r $xdir"
2902
if test $status -ne 0 && test ! -d "$xdir"; then
2905
$show "(cd $xdir && $AR x $xabs)"
2906
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2908
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3857
func_extract_archives $gentop $convenience
3858
libobjs="$libobjs $func_extract_archives_result"
2913
3862
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2914
3863
eval flag=\"$thread_safe_flag_spec\"
2915
3864
linker_flags="$linker_flags $flag"
2923
3872
# Do each of the archive commands.
3873
if test "$module" = yes && test -n "$module_cmds" ; then
3874
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3875
eval test_cmds=\"$module_expsym_cmds\"
3876
cmds=$module_expsym_cmds
3878
eval test_cmds=\"$module_cmds\"
2924
3882
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2925
eval cmds=\"$archive_expsym_cmds\"
2927
eval cmds=\"$archive_cmds\"
3883
eval test_cmds=\"$archive_expsym_cmds\"
3884
cmds=$archive_expsym_cmds
3886
eval test_cmds=\"$archive_cmds\"
3891
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3892
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3895
# The command line is too long to link in one step, link piecewise.
3896
$echo "creating reloadable object files..."
3898
# Save the value of $output and $libobjs because we want to
3899
# use them later. If we have whole_archive_flag_spec, we
3900
# want to use save_libobjs as it was before
3901
# whole_archive_flag_spec was expanded, because we can't
3902
# assume the linker understands whole_archive_flag_spec.
3903
# This may have to be revisited, in case too many
3904
# convenience libraries get linked in and end up exceeding
3906
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3907
save_libobjs=$libobjs
3910
output_la=`$echo "X$output" | $Xsed -e "$basename"`
3912
# Clear the reloadable object creation command queue and
3913
# initialize k to one.
3920
output=$output_objdir/$output_la-${k}.$objext
3921
# Loop over the list of objects to be linked.
3922
for obj in $save_libobjs
3924
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3925
if test "X$objlist" = X ||
3926
{ len=`expr "X$test_cmds" : ".*"` &&
3927
test "$len" -le "$max_cmd_len"; }; then
3928
objlist="$objlist $obj"
3930
# The command $test_cmds is almost too long, add a
3931
# command to the queue.
3932
if test "$k" -eq 1 ; then
3933
# The first file doesn't have a previous command to add.
3934
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3936
# All subsequent reloadable object files will link in
3937
# the last one created.
3938
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3940
last_robj=$output_objdir/$output_la-${k}.$objext
3942
output=$output_objdir/$output_la-${k}.$objext
3947
# Handle the remaining objects by creating one last
3948
# reloadable object file. All subsequent reloadable object
3949
# files will link in the last one created.
3950
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3951
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3953
if ${skipped_export-false}; then
3954
$show "generating symbol list for \`$libname.la'"
3955
export_symbols="$output_objdir/$libname.exp"
3956
$run $rm $export_symbols
3958
# Append the command to create the export file.
3959
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3962
# Set up a command to remove the reloadable object files
3963
# after they are used.
3965
while test "$i" -lt "$k"
3968
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3971
$echo "creating a temporary reloadable object file: $output"
3973
# Loop through the commands generated above and execute them.
3974
save_ifs="$IFS"; IFS='~'
3975
for cmd in $concat_cmds; do
3978
$run eval "$cmd" || exit $?
3983
# Restore the value of output.
3986
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3987
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3989
# Expand the library linking commands again to reset the
3990
# value of $libobjs for piecewise linking.
3992
# Do each of the archive commands.
3993
if test "$module" = yes && test -n "$module_cmds" ; then
3994
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3995
cmds=$module_expsym_cmds
4000
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4001
cmds=$archive_expsym_cmds
4007
# Append the command to remove the reloadable object files
4008
# to the just-reset $cmds.
4009
eval cmds=\"\$cmds~\$rm $delfiles\"
2929
4011
save_ifs="$IFS"; IFS='~'
2930
4012
for cmd in $cmds; do
2931
4013
IFS="$save_ifs"
2933
4016
$run eval "$cmd" || exit $?
3300
4353
if test -n "$exclude_expsyms"; then
3301
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4354
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3302
4355
$run eval '$mv "$nlist"T "$nlist"'
3305
4358
if test -n "$export_symbols_regex"; then
3306
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4359
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3307
4360
$run eval '$mv "$nlist"T "$nlist"'
3310
4363
# Prepare the list of exported symbols
3311
4364
if test -z "$export_symbols"; then
3312
export_symbols="$output_objdir/$output.exp"
4365
export_symbols="$output_objdir/$outputname.exp"
3313
4366
$run $rm $export_symbols
3314
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4367
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3316
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3317
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4369
$run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4370
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3318
4371
$run eval 'mv "$nlist"T "$nlist"'
3322
4375
for arg in $dlprefiles; do
3323
4376
$show "extracting global C symbols from \`$arg'"
3324
name=`echo "$arg" | sed -e 's%^.*/%%'`
3325
$run eval 'echo ": $name " >> "$nlist"'
4377
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4378
$run eval '$echo ": $name " >> "$nlist"'
3326
4379
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3578
4656
# win32 will think the script is a binary if it has
3579
4657
# a .exe suffix, so we strip it off here.
3580
4658
case $output in
3581
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
4659
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3583
4661
# test for cygwin because mv fails w/o .exe extensions
3585
*cygwin*) exeext=.exe ;;
4665
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4669
*cygwin* | *mingw* )
4670
cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4671
cwrapper=`$echo ${output}.exe`
4672
$rm $cwrappersource $cwrapper
4673
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4675
cat > $cwrappersource <<EOF
4677
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4678
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4680
The $output program cannot be directly executed until all the libtool
4681
libraries that it depends on are installed.
4683
This wrapper executable should never be moved out of the build directory.
4684
If it is, it will not operate correctly.
4686
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4687
but could eventually absorb all of the scripts functionality and
4688
exec $objdir/$outputname directly.
4691
cat >> $cwrappersource<<"EOF"
4699
#if defined(PATH_MAX)
4700
# define LT_PATHMAX PATH_MAX
4701
#elif defined(MAXPATHLEN)
4702
# define LT_PATHMAX MAXPATHLEN
4704
# define LT_PATHMAX 1024
4707
#ifndef DIR_SEPARATOR
4708
#define DIR_SEPARATOR '/'
4711
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4713
#define HAVE_DOS_BASED_FILE_SYSTEM
4714
#ifndef DIR_SEPARATOR_2
4715
#define DIR_SEPARATOR_2 '\\'
4719
#ifndef DIR_SEPARATOR_2
4720
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4721
#else /* DIR_SEPARATOR_2 */
4722
# define IS_DIR_SEPARATOR(ch) \
4723
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4724
#endif /* DIR_SEPARATOR_2 */
4726
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4727
#define XFREE(stale) do { \
4728
if (stale) { free ((void *) stale); stale = 0; } \
4731
const char *program_name = NULL;
4733
void * xmalloc (size_t num);
4734
char * xstrdup (const char *string);
4735
char * basename (const char *name);
4736
char * fnqualify(const char *path);
4737
char * strendzap(char *str, const char *pat);
4738
void lt_fatal (const char *message, ...);
4741
main (int argc, char *argv[])
4746
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4747
newargz = XMALLOC(char *, argc+2);
4750
cat >> $cwrappersource <<EOF
4751
newargz[0] = "$SHELL";
4754
cat >> $cwrappersource <<"EOF"
4755
newargz[1] = fnqualify(argv[0]);
4756
/* we know the script has the same name, without the .exe */
4757
/* so make sure newargz[1] doesn't end in .exe */
4758
strendzap(newargz[1],".exe");
4759
for (i = 1; i < argc; i++)
4760
newargz[i+1] = xstrdup(argv[i]);
4761
newargz[argc+1] = NULL;
4764
cat >> $cwrappersource <<EOF
4765
execv("$SHELL",newargz);
4768
cat >> $cwrappersource <<"EOF"
4772
xmalloc (size_t num)
4774
void * p = (void *) malloc (num);
4776
lt_fatal ("Memory exhausted");
4782
xstrdup (const char *string)
4784
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4789
basename (const char *name)
4793
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4794
/* Skip over the disk name in MSDOS pathnames. */
4795
if (isalpha (name[0]) && name[1] == ':')
4799
for (base = name; *name; name++)
4800
if (IS_DIR_SEPARATOR (*name))
4802
return (char *) base;
4806
fnqualify(const char *path)
4810
char tmp[LT_PATHMAX + 1];
4812
assert(path != NULL);
4814
/* Is it qualified already? */
4815
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4816
if (isalpha (path[0]) && path[1] == ':')
4817
return xstrdup (path);
4819
if (IS_DIR_SEPARATOR (path[0]))
4820
return xstrdup (path);
4822
/* prepend the current directory */
4823
/* doesn't handle '~' */
4824
if (getcwd (tmp, LT_PATHMAX) == NULL)
4825
lt_fatal ("getcwd failed");
4826
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4827
p = XMALLOC(char, size);
4828
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4833
strendzap(char *str, const char *pat)
4837
assert(str != NULL);
4838
assert(pat != NULL);
4841
patlen = strlen(pat);
4845
str += len - patlen;
4846
if (strcmp(str, pat) == 0)
4853
lt_error_core (int exit_status, const char * mode,
4854
const char * message, va_list ap)
4856
fprintf (stderr, "%s: %s: ", program_name, mode);
4857
vfprintf (stderr, message, ap);
4858
fprintf (stderr, ".\n");
4860
if (exit_status >= 0)
4865
lt_fatal (const char *message, ...)
4868
va_start (ap, message);
4869
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4873
# we should really use a build-platform specific compiler
4874
# here, but OTOH, the wrappers (shell script and this C one)
4875
# are only useful if you want to execute the "real" binary.
4876
# Since the "real" binary is built for $host, then this
4877
# wrapper might as well be built for $host, too.
4878
$run $LTCC -s -o $cwrapper $cwrappersource
3589
trap "$rm $output; exit 1" 1 2 15
4882
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
3591
4884
$echo > $output "\
3789
5070
oldobjs="$libobjs_save"
3790
5071
build_libtool_libs=no
3792
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
5073
oldobjs="$old_deplibs $non_pic_objects"
3794
5075
addlibs="$old_convenience"
3797
5078
if test -n "$addlibs"; then
3798
5079
gentop="$output_objdir/${outputname}x"
3799
$show "${rm}r $gentop"
3800
$run ${rm}r "$gentop"
3801
$show "mkdir $gentop"
3802
$run mkdir "$gentop"
3804
if test $status -ne 0 && test ! -d "$gentop"; then
3807
5080
generated="$generated $gentop"
3809
# Add in members from convenience archives.
3810
for xlib in $addlibs; do
3811
# Extract the objects.
3813
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3814
*) xabs=`pwd`"/$xlib" ;;
3816
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3817
xdir="$gentop/$xlib"
3819
$show "${rm}r $xdir"
3824
if test $status -ne 0 && test ! -d "$xdir"; then
3827
$show "(cd $xdir && $AR x $xabs)"
3828
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3830
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5082
func_extract_archives $gentop $addlibs
5083
oldobjs="$oldobjs $func_extract_archives_result"
3834
5086
# Do each command in the archive commands.
3835
5087
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3836
eval cmds=\"$old_archive_from_new_cmds\"
5088
cmds=$old_archive_from_new_cmds
3838
# Ensure that we have .o objects in place in case we decided
3839
# not to build a shared library, and have fallen back to building
3840
# static libs even though --disable-static was passed!
3841
for oldobj in $oldobjs; do
3842
if test ! -f $oldobj; then
3843
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3844
if test "X$xdir" = "X$oldobj"; then
5090
# POSIX demands no paths to be encoded in archives. We have
5091
# to avoid creating archives with duplicate basenames if we
5092
# might have to extract them afterwards, e.g., when creating a
5093
# static archive out of a convenience library, or when linking
5094
# the entirety of a libtool archive into another (currently
5095
# not supported by libtool).
5096
if (for obj in $oldobjs
5098
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5099
done | sort | sort -uc >/dev/null 2>&1); then
5102
$echo "copying selected object files to avoid basename conflicts..."
5104
if test -z "$gentop"; then
5105
gentop="$output_objdir/${outputname}x"
5106
generated="$generated $gentop"
5108
$show "${rm}r $gentop"
5109
$run ${rm}r "$gentop"
5110
$show "$mkdir $gentop"
5111
$run $mkdir "$gentop"
5113
if test "$status" -ne 0 && test ! -d "$gentop"; then
3849
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3850
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3851
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
3852
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
5118
save_oldobjs=$oldobjs
5121
for obj in $save_oldobjs
5123
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5124
case " $oldobjs " in
5125
" ") oldobjs=$obj ;;
5128
# Make sure we don't pick an alternate name that also
5130
newobj=lt$counter-$objbase
5131
counter=`expr $counter + 1`
5132
case " $oldobjs " in
5133
*[\ /]"$newobj "*) ;;
5134
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5137
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5138
$run ln "$obj" "$gentop/$newobj" ||
5139
$run cp "$obj" "$gentop/$newobj"
5140
oldobjs="$oldobjs $gentop/$newobj"
5142
*) oldobjs="$oldobjs $obj" ;;
3856
5147
eval cmds=\"$old_archive_cmds\"
5149
if len=`expr "X$cmds" : ".*"` &&
5150
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5151
cmds=$old_archive_cmds
5153
# the command line is too long to link in one step, link in parts
5154
$echo "using piecewise archive linking..."
5159
save_oldobjs=$oldobjs
5161
# Is there a better way of finding the last object in the list?
5162
for obj in $save_oldobjs
5166
for obj in $save_oldobjs
5168
oldobjs="$objlist $obj"
5169
objlist="$objlist $obj"
5170
eval test_cmds=\"$old_archive_cmds\"
5171
if len=`expr "X$test_cmds" : ".*"` &&
5172
test "$len" -le "$max_cmd_len"; then
5175
# the above command should be used before it gets too long
5177
if test "$obj" = "$last_oldobj" ; then
5180
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5181
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5187
if test "X$oldobjs" = "X" ; then
5188
eval cmds=\"\$concat_cmds\"
5190
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
3858
5194
save_ifs="$IFS"; IFS='~'
3859
5195
for cmd in $cmds; do
3860
5197
IFS="$save_ifs"
3862
5199
$run eval "$cmd" || exit $?
3931
5272
for lib in $dlprefiles; do
3932
5273
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3933
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5274
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3934
5275
if test -z "$libdir"; then
3935
5276
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3938
5279
newdlprefiles="$newdlprefiles $libdir/$name"
3940
5281
dlprefiles="$newdlprefiles"
5284
for lib in $dlfiles; do
5286
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5287
*) abs=`pwd`"/$lib" ;;
5289
newdlfiles="$newdlfiles $abs"
5291
dlfiles="$newdlfiles"
5293
for lib in $dlprefiles; do
5295
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5296
*) abs=`pwd`"/$lib" ;;
5298
newdlprefiles="$newdlprefiles $abs"
5300
dlprefiles="$newdlprefiles"
3943
5303
# place dlname in correct position for cygwin
3944
5304
tdlname=$dlname
3945
5305
case $host,$output,$installed,$module,$dlname in
3946
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5306
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3948
5308
$echo > $output "\
3949
5309
# $outputname - a libtool library file
4191
5554
if test -n "$relink_command"; then
4192
5555
# Determine the prefix the user has applied to our future dir.
4193
inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
5556
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
4195
5558
# Don't allow the user to place us outside of our expected
4196
5559
# location b/c this prevents finding dependent libraries that
4197
5560
# are installed to the same prefix.
5561
# At present, this check doesn't affect windows .dll's that
5562
# are installed into $libdir/../bin (currently, that works fine)
5563
# but it's something to keep an eye on.
4198
5564
if test "$inst_prefix_dir" = "$destdir"; then
4199
5565
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4203
5569
if test -n "$inst_prefix_dir"; then
4204
5570
# Stick the inst_prefix_dir data into the link command.
4205
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5571
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4207
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
5573
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4210
5576
$echo "$modename: warning: relinking \`$file'" 1>&2
4320
5687
destfile="$destdir/$destfile"
5690
# If the file is missing, and there is a .exe on the end, strip it
5691
# because it is most likely a libtool script we actually want to
5696
if test ! -f "$file"; then
5697
file=`$echo $file|${SED} 's,.exe$,,'`
4323
5703
# Do a test to see if this is really a libtool program.
4324
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5706
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5712
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4325
5713
notinst_deplibs=
4326
5714
relink_command=
5716
# To insure that "foo" is sourced, and not "foo.exe",
5717
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5718
# which disallows the automatic-append-.exe behavior.
5720
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5721
*) wrapperdot=${wrapper} ;;
4328
5723
# If there is no directory component, then add one.
4330
*/* | *\\*) . $file ;;
5725
*/* | *\\*) . ${wrapperdot} ;;
5726
*) . ./${wrapperdot} ;;
4334
5729
# Check the variables that should have been set.
4335
5730
if test -z "$notinst_deplibs"; then
4336
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
5731
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4494
5902
# Exit here if they wanted silent mode.
4495
test "$show" = ":" && exit 0
5903
test "$show" = : && exit $EXIT_SUCCESS
4497
echo "----------------------------------------------------------------------"
4498
echo "Libraries have been installed in:"
5905
$echo "----------------------------------------------------------------------"
5906
$echo "Libraries have been installed in:"
4499
5907
for libdir in $libdirs; do
4503
echo "If you ever happen to want to link against installed libraries"
4504
echo "in a given directory, LIBDIR, you must either use libtool, and"
4505
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4506
echo "flag during linking and do at least one of the following:"
5911
$echo "If you ever happen to want to link against installed libraries"
5912
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5913
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5914
$echo "flag during linking and do at least one of the following:"
4507
5915
if test -n "$shlibpath_var"; then
4508
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4509
echo " during execution"
5916
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5917
$echo " during execution"
4511
5919
if test -n "$runpath_var"; then
4512
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4513
echo " during linking"
5920
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5921
$echo " during linking"
4515
5923
if test -n "$hardcode_libdir_flag_spec"; then
4517
5925
eval flag=\"$hardcode_libdir_flag_spec\"
4519
echo " - use the \`$flag' linker flag"
5927
$echo " - use the \`$flag' linker flag"
4521
5929
if test -n "$admincmds"; then
4522
echo " - have your system administrator run these commands:$admincmds"
5930
$echo " - have your system administrator run these commands:$admincmds"
4524
5932
if test -f /etc/ld.so.conf; then
4525
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5933
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4528
echo "See any operating system documentation about shared libraries for"
4529
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4530
echo "----------------------------------------------------------------------"
5936
$echo "See any operating system documentation about shared libraries for"
5937
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5938
$echo "----------------------------------------------------------------------"
4534
5942
# libtool execute mode
4784
if test "$build_old_libs" = yes; then
4785
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4786
rmfiles="$rmfiles $dir/$oldobj"
6195
# Possibly a libtool object, so verify it.
6196
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6201
# Add PIC object to the list of files to remove.
6202
if test -n "$pic_object" \
6203
&& test "$pic_object" != none; then
6204
rmfiles="$rmfiles $dir/$pic_object"
6207
# Add non-PIC object to the list of files to remove.
6208
if test -n "$non_pic_object" \
6209
&& test "$non_pic_object" != none; then
6210
rmfiles="$rmfiles $dir/$non_pic_object"
4791
# Do a test to see if this is a libtool program.
4792
if test $mode = clean &&
4793
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6216
if test "$mode" = clean ; then
6220
file=`$echo $file|${SED} 's,.exe$,,'`
6221
noexename=`$echo $name|${SED} 's,.exe$,,'`
6222
# $file with .exe has already been added to rmfiles,
6223
# add $file without .exe
6224
rmfiles="$rmfiles $file"
6227
# Do a test to see if this is a libtool program.
6228
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4797
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4798
if test "$fast_install" = yes && test -n "$relink_command"; then
4799
rmfiles="$rmfiles $objdir/lt-$name"
6232
# note $name still contains .exe if it was in $file originally
6233
# as does the version of $file that was added into $rmfiles
6234
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6235
if test "$fast_install" = yes && test -n "$relink_command"; then
6236
rmfiles="$rmfiles $objdir/lt-$name"
6238
if test "X$noexename" != "X$name" ; then
6239
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
5018
6466
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5019
6467
$echo "$help" 1>&2
5025
6473
$echo "Try \`$modename --help' for more information about other modes."
6477
# The TAGs below are defined such that we never get into a situation
6478
# in which we disable both kinds of libraries. Given conflicting
6479
# choices, we go for a static library, that is the most portable,
6480
# since we can't tell whether shared libraries were disabled because
6481
# the user asked for that or because the platform doesn't support
6482
# them. This is particularly important on AIX, because we don't
6483
# support having both static and shared libraries enabled at the same
6484
# time on that platform, so we default to a shared-only configuration.
6485
# If a disable-shared tag is given, we'll fallback to a static-only
6486
# configuration. But we'll never go from static-only to shared-only.
6488
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6489
build_libtool_libs=no
6491
# ### END LIBTOOL TAG CONFIG: disable-shared
6493
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6494
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6495
# ### END LIBTOOL TAG CONFIG: disable-static
5029
6497
# Local Variables:
5030
6498
# mode:shell-script