1
1
# ltmain.sh - Provide generalized library-building support services.
2
2
# NOTE: Changing this file will not affect anything until you rerun configure.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
5
5
# Free Software Foundation, Inc.
6
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
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.95 2004/04/11 05:50:42) Debian$Rev: 215 $"
27
50
# Check that we have a working $echo.
28
51
if test "X$1" = X--no-reexec; then
29
52
# Discard the --no-reexec flag, and continue.
38
61
# Restart under the correct shell, and then maybe $echo will work.
39
exec $SHELL "$0" --no-reexec ${1+"$@"}
62
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
42
65
if test "X$1" = X--fallback-echo; then
51
# The name of this program.
52
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
59
TIMESTAMP=" (1.1220.2.25 2003/08/01 19:08:35) Debian$Rev: 49 $"
62
75
help="Try \`$progname --help' for more information."
63
76
magic="%%%MAGIC variable%%%"
119
132
# Shell function definitions:
120
133
# This seems to be the best place for them
135
# func_win32_libid arg
136
# return the library type of file 'arg'
122
138
# Need a lot of goo to handle *both* DLLs and import libs
123
139
# Has to be a shell function in order to 'eat' the argument
124
140
# that is supplied when $file_magic_command is called.
141
func_win32_libid () {
126
142
win32_libid_type="unknown"
127
143
win32_fileres=`file -L $1 2>/dev/null`
128
144
case $win32_fileres in
132
148
*ar\ archive*) # could be an import, or static
133
149
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
134
grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
150
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
135
151
win32_nmres=`eval $NM -f posix -A $1 | \
136
152
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
137
153
if test "X$win32_nmres" = "Ximport" ; then
155
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"
158
238
# End of Shell function definitions
159
239
#####################################
242
eval std_shrext=\"$shrext_cmds\"
161
244
# Parse our command line options once, thoroughly.
162
245
while test "$#" -gt 0
192
276
# not specially marked.
195
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
279
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
196
280
taglist="$taglist $tagname"
197
281
# Evaluate the configuration.
198
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
282
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
200
284
$echo "$progname: ignoring unknown tag $tagname" 1>&2
224
308
$echo "Copyright (C) 2003 Free Software Foundation, Inc."
225
309
$echo "This is free software; see the source for copying conditions. There is NO"
226
310
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
231
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
315
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
232
316
# Now print the configurations for the tags.
233
317
for tagname in $taglist; do
234
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
318
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
240
324
$echo "$progname: enabling shell trace mode"
326
preserve_args="$preserve_args $arg"
512
596
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
514
598
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
519
# Infer tagged configuration to use if any are available and
520
# if one wasn't chosen via the "--tag" command line option.
521
# Only attempt this if the compiler in the base compile
522
# command doesn't match the default compiler.
523
if test -n "$available_tags" && test -z "$tagname"; then
524
case $base_compile in
525
# Blanks in the command may have been stripped by the calling shell,
526
# but not from the CC environment variable when configure was run.
527
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
528
# Blanks at the start of $base_compile will cause this to fail
529
# if we don't check for them as well.
531
for z in $available_tags; do
532
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
533
# Evaluate the configuration.
534
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
535
case "$base_compile " in
536
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
537
# The compiler in the base compile command matches
538
# the one in the tagged configuration.
539
# Assume this is the tagged configuration we want.
546
# If $tagname still isn't set, then no tagged configuration
547
# was found and let the user know that the "--tag" command
548
# line option must be used.
549
if test -z "$tagname"; then
550
$echo "$modename: unable to infer tagged configuration"
551
$echo "$modename: specify a tag with \`--tag'" 1>&2
554
# $echo "$modename: using $tagname tagged configuration"
603
func_infer_tag $base_compile
605
for arg in $later; do
560
624
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
561
625
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
599
663
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
600
664
lockfile="$output_obj.lock"
601
665
removelist="$removelist $output_obj $lockfile"
602
trap "$run $rm $removelist; exit 1" 1 2 15
666
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
609
673
# Lock this critical section if it is needed
610
674
# We use this script file to make the link, it avoids creating a new file
611
675
if test "$need_locks" = yes; then
612
until $run ln "$0" "$lockfile" 2>/dev/null; do
676
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
613
677
$show "Waiting for $lockfile to be removed"
725
789
# Allow error messages only from the first compilation.
726
suppress_output=' >/dev/null 2>&1'
790
if test "$suppress_opt" = yes; then
791
suppress_output=' >/dev/null 2>&1'
728
794
# No PIC object so indicate it doesn't exist in the libtool
912
981
# Go through the arguments, transforming them on the way.
913
982
while test "$#" -gt 0; do
915
base_compile="$base_compile $arg"
918
986
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1617
1705
if test -n "$prev"; then
1618
1706
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1619
1707
$echo "$help" 1>&2
1623
# Infer tagged configuration to use if any are available and
1624
# if one wasn't chosen via the "--tag" command line option.
1625
# Only attempt this if the compiler in the base link
1626
# command doesn't match the default compiler.
1627
if test -n "$available_tags" && test -z "$tagname"; then
1628
case $base_compile in
1629
# Blanks in the command may have been stripped by the calling shell,
1630
# but not from the CC environment variable when configure was run.
1631
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1632
# Blanks at the start of $base_compile will cause this to fail
1633
# if we don't check for them as well.
1635
for z in $available_tags; do
1636
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1637
# Evaluate the configuration.
1638
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1639
case $base_compile in
1640
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1641
# The compiler in $compile_command matches
1642
# the one in the tagged configuration.
1643
# Assume this is the tagged configuration we want.
1650
# If $tagname still isn't set, then no tagged configuration
1651
# was found and let the user know that the "--tag" command
1652
# line option must be used.
1653
if test -z "$tagname"; then
1654
$echo "$modename: unable to infer tagged configuration"
1655
$echo "$modename: specify a tag with \`--tag'" 1>&2
1658
# $echo "$modename: using $tagname tagged configuration"
1664
1711
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1792
1839
dlopen) libs="$dlfiles" ;;
1793
1840
dlpreopen) libs="$dlprefiles" ;;
1794
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1842
libs="$deplibs %DEPLIBS%"
1843
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
1797
1847
if test "$pass" = dlopen; then
1805
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"
1807
1866
if test "$linkmode" != lib && test "$linkmode" != prog; then
1808
1867
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1815
1874
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1816
1875
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1817
for search_ext in .la $shrext .so .a; do
1876
for search_ext in .la $std_shrext .so .a; do
1818
1877
# Search the libtool library
1819
1878
lib="$searchdir/lib${name}${search_ext}"
1820
1879
if test -f "$lib"; then
1891
1950
if test "$pass" = scan; then
1892
1951
deplibs="$deplib $deplibs"
1893
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1895
1953
compile_deplibs="$deplib $compile_deplibs"
1896
1954
finalize_deplibs="$deplib $finalize_deplibs"
1956
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1900
1959
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1973
2032
if test "$found" = yes || test -f "$lib"; then :
1975
2034
$echo "$modename: cannot find the library \`$lib'" 1>&2
1979
2038
# Check to see that this really is a libtool archive.
1980
2039
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1982
2041
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1986
2045
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2016
2075
if test -z "$libdir"; then
2017
2076
if test -z "$old_library"; then
2018
2077
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2021
2080
# It is a libtool convenience library, so add in its objects.
2022
2081
convenience="$convenience $ladir/$objdir/$old_library"
2047
2106
if test -z "$linklib"; then
2048
2107
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2052
2111
# This library was specified with -dlopen.
2053
2112
if test "$pass" = dlopen; then
2054
2113
if test -z "$libdir"; then
2055
2114
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2058
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
2059
2120
# If there is no dlname, no dlopen support or we're linking
2060
2121
# statically, we need to preload. We also need to preload any
2061
2122
# dependent libraries so libltdl's deplib preloader doesn't
2218
2279
need_relink=yes
2220
2281
# This is a shared library
2222
# Warn about portability, can't link against -module's on some systems (darwin)
2223
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2283
# Warn about portability, can't link against -module's on
2284
# some systems (darwin)
2285
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2225
2287
if test "$linkmode" = prog; then
2226
2288
$echo "*** Warning: Linking the executable $output against the loadable module"
2228
2290
$echo "*** Warning: Linking the shared library $output against the loadable module"
2230
$echo "*** $linklib is not portable!"
2292
$echo "*** $linklib is not portable!"
2232
2294
if test "$linkmode" = lib &&
2233
2295
test "$hardcode_into_libs" = yes; then
2234
2296
# Hardcode the library path.
2299
2362
if test -f "$output_objdir/$newlib"; then :; else
2300
2363
$show "generating import library for \`$soname'"
2301
2364
save_ifs="$IFS"; IFS='~'
2302
eval cmds=\"$old_archive_from_expsyms_cmds\"
2365
cmds=$old_archive_from_expsyms_cmds
2303
2366
for cmd in $cmds; do
2304
2367
IFS="$save_ifs"
2306
2370
$run eval "$cmd" || exit $?
2325
2389
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2327
# if the lib is a module then we can not link against it, someone
2328
# is ignoring the new warnings I added
2329
if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2391
# if the lib is a module then we can not link against
2392
# it, someone is ignoring the new warnings I added
2393
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2330
2394
$echo "** Warning, lib $linklib is a module, not a shared library"
2331
2395
if test -z "$old_library" ; then
2421
2485
elif test "$hardcode_automatic" = yes; then
2422
if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2486
if test -n "$inst_prefix_dir" &&
2487
test -f "$inst_prefix_dir$libdir/$linklib" ; then
2423
2488
add="$inst_prefix_dir$libdir/$linklib"
2425
2490
add="$libdir/$linklib"
2500
2565
if test "$linkmode" = lib; then
2501
2566
if test -n "$dependency_libs" &&
2502
{ test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2567
{ test "$hardcode_into_libs" != yes ||
2568
test "$build_old_libs" = yes ||
2503
2569
test "$link_static" = yes; }; then
2504
2570
# Extract -R from dependency_libs
2556
2622
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2557
2623
if test -z "$libdir"; then
2558
2624
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2561
2627
if test "$absdir" != "$libdir"; then
2562
2628
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2569
# we do not want to link against static libs, but need to link against shared
2635
# we do not want to link against static libs,
2636
# but need to link against shared
2570
2637
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2571
2638
if test -n "$deplibrary_names" ; then
2572
2639
for tmp in $deplibrary_names ; do
2575
2642
if test -f "$path/$depdepl" ; then
2576
2643
depdepl="$path/$depdepl"
2578
2645
# do not add paths which are already there
2579
2646
case " $newlib_search_path " in
2580
2647
*" $path "*) ;;
2581
2648
*) newlib_search_path="$newlib_search_path $path";;
2595
# Again, we only want to link against shared libraries
2596
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2597
for tmp in $newlib_search_path ; do
2598
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2599
eval depdepl="$tmp/lib$tmp_libs.dylib"
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"
2610
2676
case " $deplibs " in
2611
2677
*" $depdepl "*) ;;
2612
*) deplibs="$deplibs $depdepl" ;;
2678
*) deplibs="$depdepl $deplibs" ;;
2614
2680
case " $deplibs " in
2615
2681
*" $path "*) ;;
2616
2682
*) deplibs="$deplibs $path" ;;
2760
2827
case $outputname in
2762
2829
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2763
eval shared_ext=\"$shrext\"
2830
eval shared_ext=\"$shrext_cmds\"
2764
2831
eval libname=\"$libname_spec\"
2767
2834
if test "$module" = no; then
2768
2835
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2769
2836
$echo "$help" 1>&2
2772
2839
if test "$need_lib_prefix" != no; then
2773
2840
# Add the "lib" prefix for modules if required
2774
2841
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2775
eval shared_ext=\"$shrext\"
2842
eval shared_ext=\"$shrext_cmds\"
2776
2843
eval libname=\"$libname_spec\"
2778
2845
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2900
2972
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2901
2973
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2906
2978
if test "$age" -gt "$current"; then
2907
2979
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2908
2980
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2912
2984
# Calculate the version variables.
3558
3636
$show "generating symbol list for \`$libname.la'"
3559
3637
export_symbols="$output_objdir/$libname.exp"
3560
3638
$run $rm $export_symbols
3561
eval cmds=\"$export_symbols_cmds\"
3639
cmds=$export_symbols_cmds
3562
3640
save_ifs="$IFS"; IFS='~'
3563
3641
for cmd in $cmds; do
3564
3642
IFS="$save_ifs"
3565
3644
if len=`expr "X$cmd" : ".*"` &&
3566
3645
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3678
3757
# Do each of the archive commands.
3679
3758
if test "$module" = yes && test -n "$module_cmds" ; then
3680
3759
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3681
eval cmds=\"$module_expsym_cmds\"
3760
eval test_cmds=\"$module_expsym_cmds\"
3761
cmds=$module_expsym_cmds
3683
eval cmds=\"$module_cmds\"
3763
eval test_cmds=\"$module_cmds\"
3686
3767
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3687
eval cmds=\"$archive_expsym_cmds\"
3768
eval test_cmds=\"$archive_expsym_cmds\"
3769
cmds=$archive_expsym_cmds
3689
eval cmds=\"$archive_cmds\"
3771
eval test_cmds=\"$archive_cmds\"
3693
if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3776
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3694
3777
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3791
3874
# value of $libobjs for piecewise linking.
3793
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
3794
3884
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3795
eval cmds=\"$archive_expsym_cmds\"
3885
cmds=$archive_expsym_cmds
3797
eval cmds=\"$archive_cmds\"
3800
3891
# Append the command to remove the reloadable object files
3801
3892
# to the just-reset $cmds.
3802
eval cmds=\"\$cmds~$rm $delfiles\"
3893
eval cmds=\"\$cmds~\$rm $delfiles\"
3804
3895
save_ifs="$IFS"; IFS='~'
3805
3896
for cmd in $cmds; do
3806
3897
IFS="$save_ifs"
3808
3900
$run eval "$cmd" || exit $?
3983
4076
# accidentally link it into a program.
3984
4077
# $show "echo timestamp > $libobj"
3985
4078
# $run eval "echo timestamp > $libobj" || exit $?
3989
4082
if test -n "$pic_flag" || test "$pic_mode" != default; then
3990
4083
# Only do commands if we really have different PIC objects.
3991
4084
reload_objs="$libobjs $reload_conv_objs"
3992
4085
output="$libobj"
3993
eval cmds=\"$reload_cmds\"
3994
4087
save_ifs="$IFS"; IFS='~'
3995
4088
for cmd in $cmds; do
3996
4089
IFS="$save_ifs"
3998
4092
$run eval "$cmd" || exit $?
4468
4562
# Quote $echo for shipping.
4469
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4471
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4472
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4563
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4565
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4566
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4474
4568
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4495
4589
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4496
4590
cwrapper=`$echo ${output}.exe`
4497
4591
$rm $cwrappersource $cwrapper
4498
trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4592
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4500
4594
cat > $cwrappersource <<EOF
4505
4599
The $output program cannot be directly executed until all the libtool
4506
4600
libraries that it depends on are installed.
4508
4602
This wrapper executable should never be moved out of the build directory.
4509
4603
If it is, it will not operate correctly.
4580
4674
newargz[1] = fnqualify(argv[0]);
4581
4675
/* we know the script has the same name, without the .exe */
4582
4676
/* so make sure newargz[1] doesn't end in .exe */
4583
strendzap(newargz[1],".exe");
4677
strendzap(newargz[1],".exe");
4584
4678
for (i = 1; i < argc; i++)
4585
4679
newargz[i+1] = xstrdup(argv[i]);
4586
4680
newargz[argc+1] = NULL;
4678
lt_error_core (int exit_status, const char * mode,
4772
lt_error_core (int exit_status, const char * mode,
4679
4773
const char * message, va_list ap)
4681
4775
fprintf (stderr, "%s: %s: ", program_name, mode);
4867
4961
$echo >> $output "\
4868
4962
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4872
4966
# The program doesn't exist.
4873
4967
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4874
4968
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4875
4969
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
4880
4974
chmod +x $output
4966
5060
# Do each command in the archive commands.
4967
5061
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4968
eval cmds=\"$old_archive_from_new_cmds\"
5062
cmds=$old_archive_from_new_cmds
4970
5064
eval cmds=\"$old_archive_cmds\"
4972
5066
if len=`expr "X$cmds" : ".*"` &&
4973
5067
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5068
cmds=$old_archive_cmds
4976
5070
# the command line is too long to link in one step, link in parts
4977
5071
$echo "using piecewise archive linking..."
5023
5117
if test "X$oldobjs" = "X" ; then
5024
5118
eval cmds=\"\$concat_cmds\"
5026
eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5120
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5030
5124
save_ifs="$IFS"; IFS='~'
5031
5125
for cmd in $cmds; do
5032
5127
IFS="$save_ifs"
5034
5129
$run eval "$cmd" || exit $?
5062
5157
# Quote the link command for shipping.
5063
relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5158
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5064
5159
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5065
5160
if test "$hardcode_automatic" = yes ; then
5068
5165
# Only create the output if not a dry run.
5069
5166
if test -z "$run"; then
5070
5167
for installed in no yes; do
5603
5701
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5604
5702
tmpdir="$tmpdir/libtool-$$"
5605
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5705
if $mkdir "$tmpdir"; then
5607
5709
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5662
5764
$show "$install_prog $file $oldlib"
5663
5765
$run eval "$install_prog \$file \$oldlib" || exit $?
5665
if test -n "$stripme" && test -n "$striplib"; then
5767
if test -n "$stripme" && test -n "$old_striplib"; then
5666
5768
$show "$old_striplib $oldlib"
5667
5769
$run eval "$old_striplib $oldlib" || exit $?
5670
5772
# Do each command in the postinstall commands.
5671
eval cmds=\"$old_postinstall_cmds\"
5773
cmds=$old_postinstall_cmds
5672
5774
save_ifs="$IFS"; IFS='~'
5673
5775
for cmd in $cmds; do
5674
5776
IFS="$save_ifs"
5676
5779
$run eval "$cmd" || exit $?
5685
5788
if test -n "$current_libdirs"; then
5686
5789
# Maybe just do a dry run.
5687
5790
test -n "$run" && current_libdirs=" -n$current_libdirs"
5688
exec_cmd='$SHELL $0 --finish$current_libdirs'
5791
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5706
5809
for libdir in $libdirs; do
5707
5810
if test -n "$finish_cmds"; then
5708
5811
# Do each command in the finish commands.
5709
eval cmds=\"$finish_cmds\"
5710
5813
save_ifs="$IFS"; IFS='~'
5711
5814
for cmd in $cmds; do
5712
5815
IFS="$save_ifs"
5714
5818
$run eval "$cmd" || admincmds="$admincmds
5728
5832
# Exit here if they wanted silent mode.
5729
test "$show" = : && exit 0
5833
test "$show" = : && exit $EXIT_SUCCESS
5731
5835
$echo "----------------------------------------------------------------------"
5732
5836
$echo "Libraries have been installed in:"
5983
6087
if test "$mode" = uninstall; then
5984
6088
if test -n "$library_names"; then
5985
6089
# Do each command in the postuninstall commands.
5986
eval cmds=\"$postuninstall_cmds\"
6090
cmds=$postuninstall_cmds
5987
6091
save_ifs="$IFS"; IFS='~'
5988
6092
for cmd in $cmds; do
5989
6093
IFS="$save_ifs"
5991
6096
$run eval "$cmd"
5992
6097
if test "$?" -ne 0 && test "$rmforce" != yes; then
5999
6104
if test -n "$old_library"; then
6000
6105
# Do each command in the old_postuninstall commands.
6001
eval cmds=\"$old_postuninstall_cmds\"
6106
cmds=$old_postuninstall_cmds
6002
6107
save_ifs="$IFS"; IFS='~'
6003
6108
for cmd in $cmds; do
6004
6109
IFS="$save_ifs"
6006
6112
$run eval "$cmd"
6007
6113
if test "$?" -ne 0 && test "$rmforce" != yes; then
6040
6146
if test "$mode" = clean ; then
6041
6147
noexename=$name
6044
6150
file=`$echo $file|${SED} 's,.exe$,,'`
6045
6151
noexename=`$echo $name|${SED} 's,.exe$,,'`
6046
6152
# $file with .exe has already been added to rmfiles,
6086
6192
$echo "$modename: you must specify a MODE" 1>&2
6087
6193
$echo "$generic_help" 1>&2
6092
6198
if test -z "$exec_cmd"; then
6093
6199
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6094
6200
$echo "$generic_help" 1>&2
6097
6203
fi # test -z "$show_help"
6099
6205
if test -n "$exec_cmd"; then
6100
6206
eval exec $exec_cmd
6104
6210
# We need to display help for each of the modes.
6246
6352
-no-undefined declare that a library does not refer to external symbols
6247
6353
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6248
6354
-objectlist FILE Use a list of object files found in FILE to specify objects
6355
-precious-files-regex REGEX
6356
don't remove output files matching REGEX
6249
6357
-release RELEASE specify package release information
6250
6358
-rpath LIBDIR the created library will eventually be installed in LIBDIR
6251
6359
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries