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
# RH: define SED for historic ltconfig's generated by Libtool 1.3
37
[ -z "$SED" ] && SED=sed
39
# The name of this program:
40
progname=`echo "$progpath" | $SED $basename`
50
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
27
53
# Check that we have a working $echo.
28
54
if test "X$1" = X--no-reexec; then
29
55
# Discard the --no-reexec flag, and continue.
38
64
# Restart under the correct shell, and then maybe $echo will work.
39
exec $SHELL "$0" --no-reexec ${1+"$@"}
65
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
42
68
if test "X$1" = X--fallback-echo; then
51
# define SED for historic ltconfig's generated by Libtool 1.3
52
test -z "$SED" && SED=sed
54
# The name of this program.
55
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
62
TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)"
65
78
help="Try \`$progname --help' for more information."
66
79
magic="%%%MAGIC variable%%%"
73
86
Xsed="${SED}"' -e 1s/^X//'
74
87
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
75
88
# test EBCDIC or ASCII
76
case `echo A|od -x` in
77
*[Cc]1*) # EBCDIC based system
89
case `echo A|tr A '\301'` in
90
A) # EBCDIC based system
78
91
SP2NL="tr '\100' '\n'"
79
92
NL2SP="tr '\r\n' '\100\100'"
99
112
# Make sure IFS has a sensible default
102
116
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
103
117
$echo "$modename: not configured to build any kind of library" 1>&2
104
118
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
108
122
# Global variables.
121
135
# Shell function definitions:
122
136
# This seems to be the best place for them
138
# func_win32_libid arg
139
# return the library type of file 'arg'
124
141
# Need a lot of goo to handle *both* DLLs and import libs
125
142
# Has to be a shell function in order to 'eat' the argument
126
143
# that is supplied when $file_magic_command is called.
144
func_win32_libid () {
128
145
win32_libid_type="unknown"
129
146
win32_fileres=`file -L $1 2>/dev/null`
130
147
case $win32_fileres in
134
151
*ar\ archive*) # could be an import, or static
135
152
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
136
grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
153
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
137
154
win32_nmres=`eval $NM -f posix -A $1 | \
138
155
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
139
156
if test "X$win32_nmres" = "Ximport" ; then
157
174
$echo $win32_libid_type
179
# Infer tagged configuration to use if any are available and
180
# if one wasn't chosen via the "--tag" command line option.
181
# Only attempt this if the compiler in the base compile
182
# command doesn't match the default compiler.
183
# arg is usually of the form 'gcc ...'
185
if test -n "$available_tags" && test -z "$tagname"; then
189
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
193
CC_quoted="$CC_quoted $arg"
196
# Blanks in the command may have been stripped by the calling shell,
197
# but not from the CC environment variable when configure was run.
198
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
199
# Blanks at the start of $base_compile will cause this to fail
200
# if we don't check for them as well.
202
for z in $available_tags; do
203
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
204
# Evaluate the configuration.
205
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
208
# Double-quote args containing other shell metacharacters.
210
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
214
CC_quoted="$CC_quoted $arg"
217
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
218
# The compiler in the base compile command matches
219
# the one in the tagged configuration.
220
# Assume this is the tagged configuration we want.
227
# If $tagname still isn't set, then no tagged configuration
228
# was found and let the user know that the "--tag" command
229
# line option must be used.
230
if test -z "$tagname"; then
231
$echo "$modename: unable to infer tagged configuration"
232
$echo "$modename: specify a tag with \`--tag'" 1>&2
235
# $echo "$modename: using $tagname tagged configuration"
160
241
# End of Shell function definitions
161
242
#####################################
245
eval std_shrext=\"$shrext_cmds\"
163
247
# Parse our command line options once, thoroughly.
164
248
while test "$#" -gt 0
194
279
# not specially marked.
197
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
282
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
198
283
taglist="$taglist $tagname"
199
284
# Evaluate the configuration.
200
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
285
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
202
287
$echo "$progname: ignoring unknown tag $tagname" 1>&2
226
311
$echo "Copyright (C) 2003 Free Software Foundation, Inc."
227
312
$echo "This is free software; see the source for copying conditions. There is NO"
228
313
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
233
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
318
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
234
319
# Now print the configurations for the tags.
235
320
for tagname in $taglist; do
236
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
321
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
242
327
$echo "$progname: enabling shell trace mode"
329
preserve_args="$preserve_args $arg"
514
599
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
516
601
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
521
# Infer tagged configuration to use if any are available and
522
# if one wasn't chosen via the "--tag" command line option.
523
# Only attempt this if the compiler in the base compile
524
# command doesn't match the default compiler.
525
if test -n "$available_tags" && test -z "$tagname"; then
526
case $base_compile in
527
# Blanks in the command may have been stripped by the calling shell,
528
# but not from the CC environment variable when configure was run.
529
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
530
# Blanks at the start of $base_compile will cause this to fail
531
# if we don't check for them as well.
533
for z in $available_tags; do
534
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
535
# Evaluate the configuration.
536
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
537
case "$base_compile " in
538
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
539
# The compiler in the base compile command matches
540
# the one in the tagged configuration.
541
# Assume this is the tagged configuration we want.
548
# If $tagname still isn't set, then no tagged configuration
549
# was found and let the user know that the "--tag" command
550
# line option must be used.
551
if test -z "$tagname"; then
552
$echo "$modename: unable to infer tagged configuration"
553
$echo "$modename: specify a tag with \`--tag'" 1>&2
556
# $echo "$modename: using $tagname tagged configuration"
606
func_infer_tag $base_compile
608
for arg in $later; do
562
627
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
563
628
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
601
666
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
602
667
lockfile="$output_obj.lock"
603
668
removelist="$removelist $output_obj $lockfile"
604
trap "$run $rm $removelist; exit 1" 1 2 15
669
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
611
676
# Lock this critical section if it is needed
612
677
# We use this script file to make the link, it avoids creating a new file
613
678
if test "$need_locks" = yes; then
614
until $run ln "$0" "$lockfile" 2>/dev/null; do
679
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
615
680
$show "Waiting for $lockfile to be removed"
727
792
# Allow error messages only from the first compilation.
728
suppress_output=' >/dev/null 2>&1'
793
if test "$suppress_opt" = yes; then
794
suppress_output=' >/dev/null 2>&1'
730
797
# No PIC object so indicate it doesn't exist in the libtool
914
984
# Go through the arguments, transforming them on the way.
915
985
while test "$#" -gt 0; do
917
base_compile="$base_compile $arg"
920
989
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1619
1708
if test -n "$prev"; then
1620
1709
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1621
1710
$echo "$help" 1>&2
1625
# Infer tagged configuration to use if any are available and
1626
# if one wasn't chosen via the "--tag" command line option.
1627
# Only attempt this if the compiler in the base link
1628
# command doesn't match the default compiler.
1629
if test -n "$available_tags" && test -z "$tagname"; then
1630
case $base_compile in
1631
# Blanks in the command may have been stripped by the calling shell,
1632
# but not from the CC environment variable when configure was run.
1633
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1634
# Blanks at the start of $base_compile will cause this to fail
1635
# if we don't check for them as well.
1637
for z in $available_tags; do
1638
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1639
# Evaluate the configuration.
1640
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1641
case $base_compile in
1642
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1643
# The compiler in $compile_command matches
1644
# the one in the tagged configuration.
1645
# Assume this is the tagged configuration we want.
1652
# If $tagname still isn't set, then no tagged configuration
1653
# was found and let the user know that the "--tag" command
1654
# line option must be used.
1655
if test -z "$tagname"; then
1656
$echo "$modename: unable to infer tagged configuration"
1657
$echo "$modename: specify a tag with \`--tag'" 1>&2
1660
# $echo "$modename: using $tagname tagged configuration"
1666
1714
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1807
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"
1809
1866
if test "$linkmode" != lib && test "$linkmode" != prog; then
1810
1867
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1817
1874
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1818
1875
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1819
# Search the libtool library
1820
lib="$searchdir/lib${name}.la"
1821
if test -f "$lib"; then
1876
for search_ext in .la $std_shrext .so .a; do
1877
# Search the libtool library
1878
lib="$searchdir/lib${name}${search_ext}"
1879
if test -f "$lib"; then
1880
if test "$search_ext" = ".la"; then
1826
1889
if test "$found" != yes; then
1827
1890
# deplib doesn't seem to be a libtool library
1887
1950
if test "$pass" = scan; then
1888
1951
deplibs="$deplib $deplibs"
1889
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1891
1953
compile_deplibs="$deplib $compile_deplibs"
1892
1954
finalize_deplibs="$deplib $finalize_deplibs"
1956
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1896
1959
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1969
2032
if test "$found" = yes || test -f "$lib"; then :
1971
2034
$echo "$modename: cannot find the library \`$lib'" 1>&2
1975
2038
# Check to see that this really is a libtool archive.
1976
2039
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1978
2041
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1982
2045
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2012
2075
if test -z "$libdir"; then
2013
2076
if test -z "$old_library"; then
2014
2077
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2017
2080
# It is a libtool convenience library, so add in its objects.
2018
2081
convenience="$convenience $ladir/$objdir/$old_library"
2043
2106
if test -z "$linklib"; then
2044
2107
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2048
2111
# This library was specified with -dlopen.
2049
2112
if test "$pass" = dlopen; then
2050
2113
if test -z "$libdir"; then
2051
2114
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2054
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
2055
2120
# If there is no dlname, no dlopen support or we're linking
2056
2121
# statically, we need to preload. We also need to preload any
2057
2122
# dependent libraries so libltdl's deplib preloader doesn't
2214
2279
need_relink=yes
2216
2281
# This is a shared library
2218
# Warn about portability, can't link against -module's on some systems (darwin)
2219
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
2221
2287
if test "$linkmode" = prog; then
2222
2288
$echo "*** Warning: Linking the executable $output against the loadable module"
2224
2290
$echo "*** Warning: Linking the shared library $output against the loadable module"
2226
$echo "*** $linklib is not portable!"
2292
$echo "*** $linklib is not portable!"
2228
2294
if test "$linkmode" = lib &&
2229
2295
test "$hardcode_into_libs" = yes; then
2230
2296
# Hardcode the library path.
2295
2362
if test -f "$output_objdir/$newlib"; then :; else
2296
2363
$show "generating import library for \`$soname'"
2297
2364
save_ifs="$IFS"; IFS='~'
2298
eval cmds=\"$old_archive_from_expsyms_cmds\"
2365
cmds=$old_archive_from_expsyms_cmds
2299
2366
for cmd in $cmds; do
2300
2367
IFS="$save_ifs"
2302
2370
$run eval "$cmd" || exit $?
2321
2389
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2323
# if the lib is a module then we can not link against it, someone
2324
# is ignoring the new warnings I added
2325
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
2326
2394
$echo "** Warning, lib $linklib is a module, not a shared library"
2327
2395
if test -z "$old_library" ; then
2417
2485
elif test "$hardcode_automatic" = yes; then
2418
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
2419
2488
add="$inst_prefix_dir$libdir/$linklib"
2421
2490
add="$libdir/$linklib"
2496
2565
if test "$linkmode" = lib; then
2497
2566
if test -n "$dependency_libs" &&
2498
{ test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2567
{ test "$hardcode_into_libs" != yes ||
2568
test "$build_old_libs" = yes ||
2499
2569
test "$link_static" = yes; }; then
2500
2570
# Extract -R from dependency_libs
2552
2622
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2553
2623
if test -z "$libdir"; then
2554
2624
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2557
2627
if test "$absdir" != "$libdir"; then
2558
2628
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2565
# 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
2566
2637
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2567
2638
if test -n "$deplibrary_names" ; then
2568
2639
for tmp in $deplibrary_names ; do
2571
2642
if test -f "$path/$depdepl" ; then
2572
2643
depdepl="$path/$depdepl"
2574
newlib_search_path="$newlib_search_path $path"
2645
# do not add paths which are already there
2646
case " $newlib_search_path " in
2648
*) newlib_search_path="$newlib_search_path $path";;
2587
# Again, we only want to link against shared libraries
2588
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2589
for tmp in $newlib_search_path ; do
2590
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2591
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"
2602
2676
case " $deplibs " in
2603
2677
*" $depdepl "*) ;;
2604
*) deplibs="$deplibs $depdepl" ;;
2678
*) deplibs="$depdepl $deplibs" ;;
2606
2680
case " $deplibs " in
2607
2681
*" $path "*) ;;
2608
2682
*) deplibs="$deplibs $path" ;;
2752
2827
case $outputname in
2754
2829
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2755
eval shared_ext=\"$shrext\"
2830
eval shared_ext=\"$shrext_cmds\"
2756
2831
eval libname=\"$libname_spec\"
2759
2834
if test "$module" = no; then
2760
2835
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2761
2836
$echo "$help" 1>&2
2764
2839
if test "$need_lib_prefix" != no; then
2765
2840
# Add the "lib" prefix for modules if required
2766
2841
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2767
eval shared_ext=\"$shrext\"
2842
eval shared_ext=\"$shrext_cmds\"
2768
2843
eval libname=\"$libname_spec\"
2770
2845
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2892
2967
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2893
2968
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2898
2973
if test "$age" -gt "$current"; then
2899
2974
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2900
2975
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2904
2979
# Calculate the version variables.
3550
3631
$show "generating symbol list for \`$libname.la'"
3551
3632
export_symbols="$output_objdir/$libname.exp"
3552
3633
$run $rm $export_symbols
3553
eval cmds=\"$export_symbols_cmds\"
3634
cmds=$export_symbols_cmds
3554
3635
save_ifs="$IFS"; IFS='~'
3555
3636
for cmd in $cmds; do
3556
3637
IFS="$save_ifs"
3557
3639
if len=`expr "X$cmd" : ".*"` &&
3558
3640
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3670
3752
# Do each of the archive commands.
3671
3753
if test "$module" = yes && test -n "$module_cmds" ; then
3672
3754
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3673
eval cmds=\"$module_expsym_cmds\"
3755
eval test_cmds=\"$module_expsym_cmds\"
3756
cmds=$module_expsym_cmds
3675
eval cmds=\"$module_cmds\"
3758
eval test_cmds=\"$module_cmds\"
3678
3762
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3679
eval cmds=\"$archive_expsym_cmds\"
3763
eval test_cmds=\"$archive_expsym_cmds\"
3764
cmds=$archive_expsym_cmds
3681
eval cmds=\"$archive_cmds\"
3766
eval test_cmds=\"$archive_cmds\"
3685
if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3771
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3686
3772
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3783
3869
# value of $libobjs for piecewise linking.
3785
3871
# Do each of the archive commands.
3872
if test "$module" = yes && test -n "$module_cmds" ; then
3873
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3874
cmds=$module_expsym_cmds
3786
3879
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3787
eval cmds=\"$archive_expsym_cmds\"
3880
cmds=$archive_expsym_cmds
3789
eval cmds=\"$archive_cmds\"
3792
3886
# Append the command to remove the reloadable object files
3793
3887
# to the just-reset $cmds.
3794
eval cmds=\"\$cmds~$rm $delfiles\"
3888
eval cmds=\"\$cmds~\$rm $delfiles\"
3796
3890
save_ifs="$IFS"; IFS='~'
3797
3891
for cmd in $cmds; do
3798
3892
IFS="$save_ifs"
3800
3895
$run eval "$cmd" || exit $?
3975
4071
# accidentally link it into a program.
3976
4072
# $show "echo timestamp > $libobj"
3977
4073
# $run eval "echo timestamp > $libobj" || exit $?
3981
4077
if test -n "$pic_flag" || test "$pic_mode" != default; then
3982
4078
# Only do commands if we really have different PIC objects.
3983
4079
reload_objs="$libobjs $reload_conv_objs"
3984
4080
output="$libobj"
3985
eval cmds=\"$reload_cmds\"
3986
4082
save_ifs="$IFS"; IFS='~'
3987
4083
for cmd in $cmds; do
3988
4084
IFS="$save_ifs"
3990
4087
$run eval "$cmd" || exit $?
4460
4557
# Quote $echo for shipping.
4461
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4463
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4464
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4558
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4560
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4561
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4466
4563
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4487
4584
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4488
4585
cwrapper=`$echo ${output}.exe`
4489
4586
$rm $cwrappersource $cwrapper
4490
trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4587
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4492
4589
cat > $cwrappersource <<EOF
4497
4594
The $output program cannot be directly executed until all the libtool
4498
4595
libraries that it depends on are installed.
4500
4597
This wrapper executable should never be moved out of the build directory.
4501
4598
If it is, it will not operate correctly.
4572
4669
newargz[1] = fnqualify(argv[0]);
4573
4670
/* we know the script has the same name, without the .exe */
4574
4671
/* so make sure newargz[1] doesn't end in .exe */
4575
strendzap(newargz[1],".exe");
4672
strendzap(newargz[1],".exe");
4576
4673
for (i = 1; i < argc; i++)
4577
4674
newargz[i+1] = xstrdup(argv[i]);
4578
4675
newargz[argc+1] = NULL;
4670
lt_error_core (int exit_status, const char * mode,
4767
lt_error_core (int exit_status, const char * mode,
4671
4768
const char * message, va_list ap)
4673
4770
fprintf (stderr, "%s: %s: ", program_name, mode);
4859
4956
$echo >> $output "\
4860
4957
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4864
4961
# The program doesn't exist.
4865
4962
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4866
4963
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4867
4964
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
4872
4969
chmod +x $output
4958
5055
# Do each command in the archive commands.
4959
5056
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4960
eval cmds=\"$old_archive_from_new_cmds\"
5057
cmds=$old_archive_from_new_cmds
4962
5059
eval cmds=\"$old_archive_cmds\"
4964
5061
if len=`expr "X$cmds" : ".*"` &&
4965
5062
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5063
cmds=$old_archive_cmds
4968
5065
# the command line is too long to link in one step, link in parts
4969
5066
$echo "using piecewise archive linking..."
5015
5112
if test "X$oldobjs" = "X" ; then
5016
5113
eval cmds=\"\$concat_cmds\"
5018
eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5115
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5022
5119
save_ifs="$IFS"; IFS='~'
5023
5120
for cmd in $cmds; do
5024
5122
IFS="$save_ifs"
5026
5124
$run eval "$cmd" || exit $?
5054
5152
# Quote the link command for shipping.
5055
relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5153
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5056
5154
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5155
if test "$hardcode_automatic" = yes ; then
5058
5160
# Only create the output if not a dry run.
5059
5161
if test -z "$run"; then
5097
5199
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5098
5200
if test -z "$libdir"; then
5099
5201
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5102
5204
newdlprefiles="$newdlprefiles $libdir/$name"
5104
5206
dlprefiles="$newdlprefiles"
5209
for lib in $dlfiles; do
5211
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5212
*) abs=`pwd`"/$lib" ;;
5214
newdlfiles="$newdlfiles $abs"
5216
dlfiles="$newdlfiles"
5218
for lib in $dlprefiles; do
5220
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5221
*) abs=`pwd`"/$lib" ;;
5223
newdlprefiles="$newdlprefiles $abs"
5225
dlprefiles="$newdlprefiles"
5107
5228
# place dlname in correct position for cygwin
5572
5694
if test "$finalize" = yes && test -z "$run"; then
5574
5696
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5575
tmpdir_mktemp=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
5576
if test "$?" = 0 ; then
5577
tmpdir="$tmpdir_mktemp"
5580
tmpdir="$tmpdir/libtool-$$"
5582
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5697
tmpdir="$tmpdir/libtool-$$"
5700
if $mkdir "$tmpdir"; then
5584
5704
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5639
5759
$show "$install_prog $file $oldlib"
5640
5760
$run eval "$install_prog \$file \$oldlib" || exit $?
5642
if test -n "$stripme" && test -n "$striplib"; then
5762
if test -n "$stripme" && test -n "$old_striplib"; then
5643
5763
$show "$old_striplib $oldlib"
5644
5764
$run eval "$old_striplib $oldlib" || exit $?
5647
5767
# Do each command in the postinstall commands.
5648
eval cmds=\"$old_postinstall_cmds\"
5768
cmds=$old_postinstall_cmds
5649
5769
save_ifs="$IFS"; IFS='~'
5650
5770
for cmd in $cmds; do
5651
5771
IFS="$save_ifs"
5653
5774
$run eval "$cmd" || exit $?
5662
5783
if test -n "$current_libdirs"; then
5663
5784
# Maybe just do a dry run.
5664
5785
test -n "$run" && current_libdirs=" -n$current_libdirs"
5665
exec_cmd='$SHELL $0 --finish$current_libdirs'
5786
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5683
5804
for libdir in $libdirs; do
5684
5805
if test -n "$finish_cmds"; then
5685
5806
# Do each command in the finish commands.
5686
eval cmds=\"$finish_cmds\"
5687
5808
save_ifs="$IFS"; IFS='~'
5688
5809
for cmd in $cmds; do
5689
5810
IFS="$save_ifs"
5691
5813
$run eval "$cmd" || admincmds="$admincmds
5705
5827
# Exit here if they wanted silent mode.
5706
test "$show" = : && exit 0
5828
test "$show" = : && exit $EXIT_SUCCESS
5708
5830
$echo "----------------------------------------------------------------------"
5709
5831
$echo "Libraries have been installed in:"
5960
6082
if test "$mode" = uninstall; then
5961
6083
if test -n "$library_names"; then
5962
6084
# Do each command in the postuninstall commands.
5963
eval cmds=\"$postuninstall_cmds\"
6085
cmds=$postuninstall_cmds
5964
6086
save_ifs="$IFS"; IFS='~'
5965
6087
for cmd in $cmds; do
5966
6088
IFS="$save_ifs"
5968
6091
$run eval "$cmd"
5969
6092
if test "$?" -ne 0 && test "$rmforce" != yes; then
5976
6099
if test -n "$old_library"; then
5977
6100
# Do each command in the old_postuninstall commands.
5978
eval cmds=\"$old_postuninstall_cmds\"
6101
cmds=$old_postuninstall_cmds
5979
6102
save_ifs="$IFS"; IFS='~'
5980
6103
for cmd in $cmds; do
5981
6104
IFS="$save_ifs"
5983
6107
$run eval "$cmd"
5984
6108
if test "$?" -ne 0 && test "$rmforce" != yes; then
6017
6141
if test "$mode" = clean ; then
6018
6142
noexename=$name
6021
6145
file=`$echo $file|${SED} 's,.exe$,,'`
6022
6146
noexename=`$echo $name|${SED} 's,.exe$,,'`
6023
6147
# $file with .exe has already been added to rmfiles,
6063
6187
$echo "$modename: you must specify a MODE" 1>&2
6064
6188
$echo "$generic_help" 1>&2
6069
6193
if test -z "$exec_cmd"; then
6070
6194
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6071
6195
$echo "$generic_help" 1>&2
6074
6198
fi # test -z "$show_help"
6076
6200
if test -n "$exec_cmd"; then
6077
6201
eval exec $exec_cmd
6081
6205
# We need to display help for each of the modes.
6223
6347
-no-undefined declare that a library does not refer to external symbols
6224
6348
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6225
6349
-objectlist FILE Use a list of object files found in FILE to specify objects
6350
-precious-files-regex REGEX
6351
don't remove output files matching REGEX
6226
6352
-release RELEASE specify package release information
6227
6353
-rpath LIBDIR the created library will eventually be installed in LIBDIR
6228
6354
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries