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, 2004
5
# Free Software Foundation, Inc.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
5
# 2007, 2008 Free Software Foundation, Inc.
6
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8
8
# This program is free software; you can redistribute it and/or modify
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
50
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
46
VERSION="1.5.26 Debian 1.5.26-1"
47
TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
49
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
50
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
53
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
54
# is contrary to our usage. Disable this feature.
55
alias -g '${1+"$@"}'='"$@"'
58
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
60
BIN_SH=xpg4; export BIN_SH # for Tru64
61
DUALCASE=1; export DUALCASE # for MKS sh
53
63
# Check that we have a working $echo.
54
64
if test "X$1" = X--no-reexec; then
102
113
# These must not be set unconditionally because not all systems understand
103
114
# e.g. LANG=C (notably SCO).
104
115
# We save the old values to restore during execute mode.
105
if test "${LC_ALL+set}" = set; then
106
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
108
if test "${LANG+set}" = set; then
109
save_LANG="$LANG"; LANG=C; export LANG
117
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
119
eval "if test \"\${$lt_var+set}\" = set; then
120
save_$lt_var=\$$lt_var
121
lt_env=\"$lt_var=\$$lt_var \$lt_env\"
127
if test -n "$lt_env"; then
112
131
# Make sure IFS has a sensible default
116
136
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
117
137
$echo "$modename: not configured to build any kind of library" 1>&2
131
153
lo2o="s/\\.lo\$/.${objext}/"
132
154
o2lo="s/\\.${objext}\$/.lo/"
134
158
#####################################
135
159
# Shell function definitions:
136
160
# This seems to be the best place for them
162
# func_mktempdir [string]
163
# Make a temporary directory that won't clash with other running
164
# libtool processes, and avoids race conditions if possible. If
165
# given, STRING is the basename for that directory.
168
my_template="${TMPDIR-/tmp}/${1-$progname}"
170
if test "$run" = ":"; then
171
# Return a directory name, but don't create it in dry-run mode
172
my_tmpdir="${my_template}-$$"
175
# If mktemp works, use that first and foremost
176
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
178
if test ! -d "$my_tmpdir"; then
179
# Failing that, at least try and use $RANDOM to avoid a race
180
my_tmpdir="${my_template}-${RANDOM-0}$$"
182
save_mktempdir_umask=`umask`
185
umask $save_mktempdir_umask
188
# If we're not in dry-run mode, bomb out on failure
189
test -d "$my_tmpdir" || {
190
$echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
195
$echo "X$my_tmpdir" | $Xsed
138
199
# func_win32_libid arg
139
200
# return the library type of file 'arg'
141
202
# Need a lot of goo to handle *both* DLLs and import libs
142
203
# Has to be a shell function in order to 'eat' the argument
143
204
# that is supplied when $file_magic_command is called.
144
func_win32_libid () {
145
207
win32_libid_type="unknown"
146
208
win32_fileres=`file -L $1 2>/dev/null`
147
209
case $win32_fileres in
311
# func_extract_an_archive dir oldlib
312
func_extract_an_archive ()
314
f_ex_an_ar_dir="$1"; shift
315
f_ex_an_ar_oldlib="$1"
317
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
318
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
319
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
322
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
327
# func_extract_archives gentop oldlib ...
328
func_extract_archives ()
330
my_gentop="$1"; shift
338
$show "${rm}r $my_gentop"
339
$run ${rm}r "$my_gentop"
340
$show "$mkdir $my_gentop"
341
$run $mkdir "$my_gentop"
343
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
347
for my_xlib in $my_oldlibs; do
348
# Extract the objects.
350
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
351
*) my_xabs=`pwd`"/$my_xlib" ;;
353
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
356
case " $extracted_archives " in
358
extracted_serial=`expr $extracted_serial + 1`
359
my_xlib_u=lt$extracted_serial-$my_xlib ;;
363
extracted_archives="$extracted_archives $my_xlib_u"
364
my_xdir="$my_gentop/$my_xlib_u"
366
$show "${rm}r $my_xdir"
367
$run ${rm}r "$my_xdir"
368
$show "$mkdir $my_xdir"
369
$run $mkdir "$my_xdir"
371
if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
376
$show "Extracting $my_xabs"
377
# Do not bother doing anything if just a dry run
378
if test -z "$run"; then
379
darwin_orig_dir=`pwd`
380
cd $my_xdir || exit $?
381
darwin_archive=$my_xabs
383
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
384
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
385
if test -n "$darwin_arches"; then
386
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
388
$show "$darwin_base_archive has multiple architectures $darwin_arches"
389
for darwin_arch in $darwin_arches ; do
390
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
391
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
392
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
393
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
395
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
396
done # $darwin_arches
397
## Okay now we have a bunch of thin objects, gotta fatten them up :)
398
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
401
for darwin_file in $darwin_filelist; do
402
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
403
lipo -create -output "$darwin_file" $darwin_files
404
done # $darwin_filelist
406
cd "$darwin_orig_dir"
408
cd "$darwin_orig_dir"
409
func_extract_an_archive "$my_xdir" "$my_xabs"
414
func_extract_an_archive "$my_xdir" "$my_xabs"
417
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
419
func_extract_archives_result="$my_oldobjs"
241
421
# End of Shell function definitions
242
422
#####################################
245
425
eval std_shrext=\"$shrext_cmds\"
247
429
# Parse our command line options once, thoroughly.
248
430
while test "$#" -gt 0
960
-all-static | -static)
961
if test "X$arg" = "X-all-static"; then
1179
-all-static | -static | -static-libtool-libs)
962
1182
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
963
1183
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
965
1185
if test -n "$link_static_flag"; then
966
1186
dlopen_self=$dlopen_self_static
969
if test -z "$pic_flag" && test -n "$link_static_flag"; then
970
dlopen_self=$dlopen_self_static
1188
prefer_static_libs=yes
1191
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1192
dlopen_self=$dlopen_self_static
1194
prefer_static_libs=built
1196
-static-libtool-libs)
1197
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1198
dlopen_self=$dlopen_self_static
1200
prefer_static_libs=yes
973
1203
build_libtool_libs=no
974
1204
build_old_libs=yes
975
prefer_static_libs=yes
1356
1615
# Rhapsody C and math libraries are in the System framework
1357
1616
deplibs="$deplibs -framework System"
1619
*-*-sco3.2v5* | *-*-sco5v6*)
1620
# Causes problems with __ctype
1621
test "X$arg" = "X-lc" && continue
1623
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1624
# Compiler inserts libc in the correct place for threads to work
1625
test "X$arg" = "X-lc" && continue
1360
1628
elif test "X$arg" = "X-lc_r"; then
1362
*-*-openbsd* | *-*-freebsd*)
1630
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1363
1631
# Do not include libc_r directly, use -pthread flag.
1372
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1373
deplibs="$deplibs $arg"
1640
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1641
# classes, name mangling, and exception handling.
1643
compile_command="$compile_command $arg"
1644
compiler_flags="$compiler_flags $arg"
1645
finalize_command="$finalize_command $arg"
1650
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
1651
compiler_flags="$compiler_flags $arg"
1652
compile_command="$compile_command $arg"
1653
finalize_command="$finalize_command $arg"
1658
single_module="${wl}-multi_module"
1382
# gcc -m* arguments should be passed to the linker via $compiler_flags
1383
# in order to pass architecture information to the linker
1384
# (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1385
# but this is not reliable with gcc because gcc may use -mfoo to
1386
# select a different linker, different libraries, etc, while
1387
# -Wl,-mfoo simply passes -mfoo to the linker.
1667
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1668
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1669
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1670
# +DA*, +DD* enable 64-bit mode on the HP compiler
1671
# -q* pass through compiler args for the IBM compiler
1672
# -m* pass through architecture-specific compiler args for GCC
1673
# -m*, -t[45]*, -txscale* pass through architecture-specific
1674
# compiler args for GCC
1675
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
1676
# -F/path gives path to uninstalled frameworks, gcc on darwin
1677
# @file GCC response files
1678
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
1679
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
1389
1681
# Unknown arguments in both finalize_command and compile_command need
1390
1682
# to be aesthetically quoted because they are evaled later.
1391
1683
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1867
2164
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1870
if test "$pass" = conv; then
1871
deplibs="$deplib $deplibs"
1874
2167
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1875
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2168
if test "$linkmode" = lib; then
2169
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
2171
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
2173
for searchdir in $searchdirs; do
1876
2174
for search_ext in .la $std_shrext .so .a; do
1877
2175
# Search the libtool library
1878
2176
lib="$searchdir/lib${name}${search_ext}"
2229
2552
if test "$linkmode,$pass" = "prog,link"; then
2230
2553
if test -n "$library_names" &&
2231
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2554
{ { test "$prefer_static_libs" = no ||
2555
test "$prefer_static_libs,$installed" = "built,yes"; } ||
2556
test -z "$old_library"; }; then
2232
2557
# We need to hardcode the library path
2233
if test -n "$shlibpath_var"; then
2558
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2234
2559
# Make sure the rpath contains only unique directories.
2235
2560
case "$temp_rpath " in
2237
2562
*" $absdir "*) ;;
2238
*) temp_rpath="$temp_rpath $dir" ;;
2563
*) temp_rpath="$temp_rpath $absdir" ;;
2386
2715
if test "$hardcode_direct" = no; then
2387
2716
add="$dir/$linklib"
2389
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2718
*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
2719
*-*-sysv4*uw2*) add_dir="-L$dir" ;;
2720
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2721
*-*-unixware7*) add_dir="-L$dir" ;;
2391
2723
# if the lib is a module then we can not link against
2392
2724
# it, someone is ignoring the new warnings I added
2393
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2725
if /usr/bin/file -L $add 2> /dev/null |
2726
$EGREP ": [^:]* bundle" >/dev/null ; then
2394
2727
$echo "** Warning, lib $linklib is a module, not a shared library"
2395
2728
if test -z "$old_library" ; then
2635
2966
# we do not want to link against static libs,
2636
2967
# but need to link against shared
2637
2968
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2969
eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2638
2970
if test -n "$deplibrary_names" ; then
2639
2971
for tmp in $deplibrary_names ; do
2642
if test -f "$path/$depdepl" ; then
2974
if test -f "$deplibdir/$depdepl" ; then
2975
depdepl="$deplibdir/$depdepl"
2976
elif test -f "$path/$depdepl" ; then
2643
2977
depdepl="$path/$depdepl"
2979
# Can't find it, oh well...
2645
2982
# do not add paths which are already there
2646
2983
case " $newlib_search_path " in
2945
3289
# Check that each of the things are valid numbers.
2946
3290
case $current in
3291
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]) ;;
2949
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3293
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2950
3294
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2951
3295
exit $EXIT_FAILURE
2955
3299
case $revision in
3300
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]) ;;
2958
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3302
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2959
3303
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2960
3304
exit $EXIT_FAILURE
3309
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]) ;;
2967
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3311
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2968
3312
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2969
3313
exit $EXIT_FAILURE
3144
3492
# Eliminate all temporary directories.
3145
for path in $notinst_path; do
3146
lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3147
deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3148
dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3493
#for path in $notinst_path; do
3494
# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3495
# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3496
# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3151
3499
if test -n "$xrpath"; then
3152
3500
# If the user specified any rpath flags, then add them.
3283
3635
# Error occurred in the first compile. Let's try to salvage
3284
3636
# the situation: Compile a separate program for each library.
3285
3637
for i in $deplibs; do
3286
name="`expr $i : '-l\(.*\)'`"
3638
name=`expr $i : '-l\(.*\)'`
3287
3639
# If $name is empty we are operating on a -L argument.
3288
3640
if test "$name" != "" && test "$name" != "0"; then
3290
$LTCC -o conftest conftest.c $i
3292
if test "$?" -eq 0 ; then
3642
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3293
3643
ldd_output=`ldd conftest`
3294
3644
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3295
3645
case " $predeps $postdeps " in
3678
4064
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3680
4066
gentop="$output_objdir/${outputname}x"
3681
$show "${rm}r $gentop"
3682
$run ${rm}r "$gentop"
3683
$show "$mkdir $gentop"
3684
$run $mkdir "$gentop"
3686
if test "$status" -ne 0 && test ! -d "$gentop"; then
3689
4067
generated="$generated $gentop"
3691
for xlib in $convenience; do
3692
# Extract the objects.
3694
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3695
*) xabs=`pwd`"/$xlib" ;;
3697
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3698
xdir="$gentop/$xlib"
3700
$show "${rm}r $xdir"
3702
$show "$mkdir $xdir"
3705
if test "$status" -ne 0 && test ! -d "$xdir"; then
3708
# We will extract separately just the conflicting names and we will no
3709
# longer touch any unique names. It is faster to leave these extract
3710
# automatically by $AR in one run.
3711
$show "(cd $xdir && $AR x $xabs)"
3712
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3713
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3716
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3717
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3718
$AR t "$xabs" | sort | uniq -cd | while read -r count name
3721
while test "$i" -le "$count"
3723
# Put our $i before any first dot (extension)
3724
# Never overwrite any file
3726
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3728
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3730
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3731
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3737
libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4069
func_extract_archives $gentop $convenience
4070
libobjs="$libobjs $func_extract_archives_result"
3742
4074
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3743
4075
eval flag=\"$thread_safe_flag_spec\"
3744
4076
linker_flags="$linker_flags $flag"
3968
4320
reload_conv_objs=
3970
4322
# reload_cmds runs $LD directly, so let us get rid of
3971
# -Wl from whole_archive_flag_spec
4323
# -Wl from whole_archive_flag_spec and hope we can get by with
4324
# turning comma into space..
3974
4327
if test -n "$convenience"; then
3975
4328
if test -n "$whole_archive_flag_spec"; then
3976
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4329
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4330
reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
3978
4332
gentop="$output_objdir/${obj}x"
3979
$show "${rm}r $gentop"
3980
$run ${rm}r "$gentop"
3981
$show "$mkdir $gentop"
3982
$run $mkdir "$gentop"
3984
if test "$status" -ne 0 && test ! -d "$gentop"; then
3987
4333
generated="$generated $gentop"
3989
for xlib in $convenience; do
3990
# Extract the objects.
3992
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3993
*) xabs=`pwd`"/$xlib" ;;
3995
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3996
xdir="$gentop/$xlib"
3998
$show "${rm}r $xdir"
4000
$show "$mkdir $xdir"
4003
if test "$status" -ne 0 && test ! -d "$xdir"; then
4006
# We will extract separately just the conflicting names and we will no
4007
# longer touch any unique names. It is faster to leave these extract
4008
# automatically by $AR in one run.
4009
$show "(cd $xdir && $AR x $xabs)"
4010
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4011
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4014
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4015
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4016
$AR t "$xabs" | sort | uniq -cd | while read -r count name
4019
while test "$i" -le "$count"
4021
# Put our $i before any first dot (extension)
4022
# Never overwrite any file
4024
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4026
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4028
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4029
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4035
reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4335
func_extract_archives $gentop $convenience
4336
reload_conv_objs="$reload_objs $func_extract_archives_result"
4438
# move library search paths that coincide with paths to not yet
4439
# installed libraries to the beginning of the library search list
4441
for path in $notinst_path; do
4442
case " $new_libs " in
4443
*" -L$path/$objdir "*) ;;
4445
case " $compile_deplibs " in
4446
*" -L$path/$objdir "*)
4447
new_libs="$new_libs -L$path/$objdir" ;;
4452
for deplib in $compile_deplibs; do
4455
case " $new_libs " in
4457
*) new_libs="$new_libs $deplib" ;;
4460
*) new_libs="$new_libs $deplib" ;;
4463
compile_deplibs="$new_libs"
4137
4466
compile_command="$compile_command $compile_deplibs"
4138
4467
finalize_command="$finalize_command $finalize_deplibs"
4296
4630
# Prepare the list of exported symbols
4297
4631
if test -z "$export_symbols"; then
4298
export_symbols="$output_objdir/$output.exp"
4632
export_symbols="$output_objdir/$outputname.exp"
4299
4633
$run $rm $export_symbols
4300
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4634
$run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4636
*cygwin* | *mingw* )
4637
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4638
$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4302
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4303
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4642
$run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4643
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4304
4644
$run eval 'mv "$nlist"T "$nlist"'
4646
*cygwin* | *mingw* )
4647
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4648
$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4401
4766
# Now compile the dynamic symbol file.
4402
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4403
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4767
$show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4768
$run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4405
4770
# Clean up the generated files.
4406
4771
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4407
4772
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4409
4774
# Transform the symbol file into the correct name.
4410
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4411
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4776
*cygwin* | *mingw* )
4777
if test -f "$output_objdir/${outputname}.def" ; then
4778
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4779
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4781
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4782
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4786
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4787
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4414
4792
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4421
4799
# really was required.
4423
4801
# Nullify the symbol file.
4424
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4425
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4802
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4803
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4428
4806
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4429
4807
# Replace the output file specification.
4430
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4808
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4431
4809
link_command="$compile_command$compile_rpath"
4433
4811
# We have no uninstalled library dependencies, so finalize right now.
4434
4812
$show "$link_command"
4435
4813
$run eval "$link_command"
4438
4816
# Delete the generated files.
4439
4817
if test -n "$dlsyms"; then
4637
5024
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4638
5025
#endif /* DIR_SEPARATOR_2 */
5027
#ifndef PATH_SEPARATOR_2
5028
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5029
#else /* PATH_SEPARATOR_2 */
5030
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5031
#endif /* PATH_SEPARATOR_2 */
4640
5033
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4641
5034
#define XFREE(stale) do { \
4642
5035
if (stale) { free ((void *) stale); stale = 0; } \
5038
/* -DDEBUG is fairly common in CFLAGS. */
5040
#if defined DEBUGWRAPPER
5041
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5043
# define DEBUG(format, ...)
4645
5046
const char *program_name = NULL;
4647
5048
void * xmalloc (size_t num);
4648
5049
char * xstrdup (const char *string);
4649
char * basename (const char *name);
4650
char * fnqualify(const char *path);
5050
const char * base_name (const char *name);
5051
char * find_executable(const char *wrapper);
5052
int check_executable(const char *path);
4651
5053
char * strendzap(char *str, const char *pat);
4652
5054
void lt_fatal (const char *message, ...);
4657
5059
char **newargz;
4660
program_name = (char *) xstrdup ((char *) basename (argv[0]));
5062
program_name = (char *) xstrdup (base_name (argv[0]));
5063
DEBUG("(main) argv[0] : %s\n",argv[0]);
5064
DEBUG("(main) program_name : %s\n",program_name);
4661
5065
newargz = XMALLOC(char *, argc+2);
4664
cat >> $cwrappersource <<EOF
4665
newargz[0] = "$SHELL";
5068
cat >> $cwrappersource <<EOF
5069
newargz[0] = (char *) xstrdup("$SHELL");
4668
cat >> $cwrappersource <<"EOF"
4669
newargz[1] = fnqualify(argv[0]);
5072
cat >> $cwrappersource <<"EOF"
5073
newargz[1] = find_executable(argv[0]);
5074
if (newargz[1] == NULL)
5075
lt_fatal("Couldn't find %s", argv[0]);
5076
DEBUG("(main) found exe at : %s\n",newargz[1]);
4670
5077
/* we know the script has the same name, without the .exe */
4671
5078
/* so make sure newargz[1] doesn't end in .exe */
4672
5079
strendzap(newargz[1],".exe");
4673
5080
for (i = 1; i < argc; i++)
4674
5081
newargz[i+1] = xstrdup(argv[i]);
4675
5082
newargz[argc+1] = NULL;
4678
cat >> $cwrappersource <<EOF
5084
for (i=0; i<argc+1; i++)
5086
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5094
cat >> $cwrappersource <<EOF
5095
execv("$SHELL",(char const **)newargz);
5099
cat >> $cwrappersource <<EOF
4679
5100
execv("$SHELL",newargz);
4682
cat >> $cwrappersource <<"EOF"
5105
cat >> $cwrappersource <<"EOF"
4703
basename (const char *name)
5127
base_name (const char *name)
4705
5129
const char *base;
4707
5131
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4708
5132
/* Skip over the disk name in MSDOS pathnames. */
4709
if (isalpha (name[0]) && name[1] == ':')
5133
if (isalpha ((unsigned char)name[0]) && name[1] == ':')
4713
5137
for (base = name; *name; name++)
4714
5138
if (IS_DIR_SEPARATOR (*name))
4715
5139
base = name + 1;
4716
return (char *) base;
5144
check_executable(const char * path)
5148
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5149
if ((!path) || (!*path))
5152
if ((stat (path, &st) >= 0) &&
5154
/* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5155
#if defined (S_IXOTH)
5156
((st.st_mode & S_IXOTH) == S_IXOTH) ||
5158
#if defined (S_IXGRP)
5159
((st.st_mode & S_IXGRP) == S_IXGRP) ||
5161
((st.st_mode & S_IXUSR) == S_IXUSR))
5168
/* Searches for the full path of the wrapper. Returns
5169
newly allocated full path name if found, NULL otherwise */
4720
fnqualify(const char *path)
5171
find_executable (const char* wrapper)
5176
/* static buffer for getcwd */
4724
5177
char tmp[LT_PATHMAX + 1];
4726
assert(path != NULL);
4728
/* Is it qualified already? */
4729
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4730
if (isalpha (path[0]) && path[1] == ':')
4731
return xstrdup (path);
4733
if (IS_DIR_SEPARATOR (path[0]))
4734
return xstrdup (path);
4736
/* prepend the current directory */
4737
/* doesn't handle '~' */
5181
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5183
if ((wrapper == NULL) || (*wrapper == '\0'))
5186
/* Absolute path? */
5187
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5188
if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5190
concat_name = xstrdup (wrapper);
5191
if (check_executable(concat_name))
5198
if (IS_DIR_SEPARATOR (wrapper[0]))
5200
concat_name = xstrdup (wrapper);
5201
if (check_executable(concat_name))
5205
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5209
for (p = wrapper; *p; p++)
5217
/* no slashes; search PATH */
5218
const char* path = getenv ("PATH");
5221
for (p = path; *p; p = p_next)
5225
for (q = p; *q; q++)
5226
if (IS_PATH_SEPARATOR(*q))
5229
p_next = (*q == '\0' ? q : q + 1);
5232
/* empty path: current directory */
5233
if (getcwd (tmp, LT_PATHMAX) == NULL)
5234
lt_fatal ("getcwd failed");
5235
tmp_len = strlen(tmp);
5236
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5237
memcpy (concat_name, tmp, tmp_len);
5238
concat_name[tmp_len] = '/';
5239
strcpy (concat_name + tmp_len + 1, wrapper);
5243
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5244
memcpy (concat_name, p, p_len);
5245
concat_name[p_len] = '/';
5246
strcpy (concat_name + p_len + 1, wrapper);
5248
if (check_executable(concat_name))
5253
/* not found in PATH; assume curdir */
5255
/* Relative path | not found in path: prepend cwd */
4738
5256
if (getcwd (tmp, LT_PATHMAX) == NULL)
4739
5257
lt_fatal ("getcwd failed");
4740
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4741
p = XMALLOC(char, size);
4742
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5258
tmp_len = strlen(tmp);
5259
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5260
memcpy (concat_name, tmp, tmp_len);
5261
concat_name[tmp_len] = '/';
5262
strcpy (concat_name + tmp_len + 1, wrapper);
5264
if (check_executable(concat_name))
4787
# we should really use a build-platform specific compiler
4788
# here, but OTOH, the wrappers (shell script and this C one)
4789
# are only useful if you want to execute the "real" binary.
4790
# Since the "real" binary is built for $host, then this
4791
# wrapper might as well be built for $host, too.
4792
$run $LTCC -s -o $cwrapper $cwrappersource
4796
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5311
# we should really use a build-platform specific compiler
5312
# here, but OTOH, the wrappers (shell script and this C one)
5313
# are only useful if you want to execute the "real" binary.
5314
# Since the "real" binary is built for $host, then this
5315
# wrapper might as well be built for $host, too.
5316
$run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5320
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4798
5322
$echo > $output "\
4812
5336
Xsed='${SED} -e 1s/^X//'
4813
5337
sed_quote_subst='$sed_quote_subst'
5339
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5340
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5343
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5344
# is contrary to our usage. Disable this feature.
5345
alias -g '\${1+\"\$@\"}'='\"\$@\"'
5346
setopt NO_GLOB_SUBST
5348
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5350
BIN_SH=xpg4; export BIN_SH # for Tru64
5351
DUALCASE=1; export DUALCASE # for MKS sh
4815
5353
# The HP-UX ksh and POSIX shell print the target directory to stdout
4816
5354
# if CDPATH is set.
4817
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
5355
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4819
5357
relink_command=\"$relink_command\"
4943
5481
# Backslashes separate directories on plain windows
4944
5482
*-*-mingw | *-*-os2*)
4945
5483
$echo >> $output "\
4946
exec \$progdir\\\\\$program \${1+\"\$@\"}
5484
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4951
5489
$echo >> $output "\
4952
exec \$progdir/\$program \${1+\"\$@\"}
5490
exec \"\$progdir/\$program\" \${1+\"\$@\"}
4956
5494
$echo >> $output "\
4957
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5495
\$echo \"\$0: cannot exec \$program \$*\"
4958
5496
exit $EXIT_FAILURE
4961
5499
# The program doesn't exist.
4962
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5500
\$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4963
5501
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4964
5502
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
4965
5503
exit $EXIT_FAILURE
4992
5530
if test -n "$addlibs"; then
4993
5531
gentop="$output_objdir/${outputname}x"
4994
$show "${rm}r $gentop"
4995
$run ${rm}r "$gentop"
4996
$show "$mkdir $gentop"
4997
$run $mkdir "$gentop"
4999
if test "$status" -ne 0 && test ! -d "$gentop"; then
5002
5532
generated="$generated $gentop"
5004
# Add in members from convenience archives.
5005
for xlib in $addlibs; do
5006
# Extract the objects.
5008
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5009
*) xabs=`pwd`"/$xlib" ;;
5011
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5012
xdir="$gentop/$xlib"
5014
$show "${rm}r $xdir"
5016
$show "$mkdir $xdir"
5019
if test "$status" -ne 0 && test ! -d "$xdir"; then
5022
# We will extract separately just the conflicting names and we will no
5023
# longer touch any unique names. It is faster to leave these extract
5024
# automatically by $AR in one run.
5025
$show "(cd $xdir && $AR x $xabs)"
5026
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5027
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5030
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5031
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5032
$AR t "$xabs" | sort | uniq -cd | while read -r count name
5035
while test "$i" -le "$count"
5037
# Put our $i before any first dot (extension)
5038
# Never overwrite any file
5040
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5042
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5044
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5045
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5051
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5534
func_extract_archives $gentop $addlibs
5535
oldobjs="$oldobjs $func_extract_archives_result"
5055
5538
# Do each command in the archive commands.
5056
5539
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5057
5540
cmds=$old_archive_from_new_cmds
5542
# POSIX demands no paths to be encoded in archives. We have
5543
# to avoid creating archives with duplicate basenames if we
5544
# might have to extract them afterwards, e.g., when creating a
5545
# static archive out of a convenience library, or when linking
5546
# the entirety of a libtool archive into another (currently
5547
# not supported by libtool).
5548
if (for obj in $oldobjs
5550
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5551
done | sort | sort -uc >/dev/null 2>&1); then
5554
$echo "copying selected object files to avoid basename conflicts..."
5556
if test -z "$gentop"; then
5557
gentop="$output_objdir/${outputname}x"
5558
generated="$generated $gentop"
5560
$show "${rm}r $gentop"
5561
$run ${rm}r "$gentop"
5562
$show "$mkdir $gentop"
5563
$run $mkdir "$gentop"
5565
if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5570
save_oldobjs=$oldobjs
5573
for obj in $save_oldobjs
5575
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5576
case " $oldobjs " in
5577
" ") oldobjs=$obj ;;
5580
# Make sure we don't pick an alternate name that also
5582
newobj=lt$counter-$objbase
5583
counter=`expr $counter + 1`
5584
case " $oldobjs " in
5585
*[\ /]"$newobj "*) ;;
5586
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5589
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5590
$run ln "$obj" "$gentop/$newobj" ||
5591
$run cp "$obj" "$gentop/$newobj"
5592
oldobjs="$oldobjs $gentop/$newobj"
5594
*) oldobjs="$oldobjs $obj" ;;
5059
5599
eval cmds=\"$old_archive_cmds\"
5061
5601
if len=`expr "X$cmds" : ".*"` &&
5638
6180
notinst_deplibs=
5639
6181
relink_command=
5641
# To insure that "foo" is sourced, and not "foo.exe",
5642
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5643
# which disallows the automatic-append-.exe behavior.
5645
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5646
*) wrapperdot=${wrapper} ;;
6183
# Note that it is not necessary on cygwin/mingw to append a dot to
6184
# foo even if both foo and FILE.exe exist: automatic-append-.exe
6185
# behavior happens only for exec(3), not for open(2)! Also, sourcing
6186
# `FILE.' does not work on cygwin managed mounts.
5648
6188
# If there is no directory component, then add one.
5650
*/* | *\\*) . ${wrapperdot} ;;
5651
*) . ./${wrapperdot} ;;
6190
*/* | *\\*) . ${wrapper} ;;
6191
*) . ./${wrapper} ;;
5654
6194
# Check the variables that should have been set.
5678
6218
relink_command=
5679
# To insure that "foo" is sourced, and not "foo.exe",
5680
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5681
# which disallows the automatic-append-.exe behavior.
5683
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5684
*) wrapperdot=${wrapper} ;;
6219
# Note that it is not necessary on cygwin/mingw to append a dot to
6220
# foo even if both foo and FILE.exe exist: automatic-append-.exe
6221
# behavior happens only for exec(3), not for open(2)! Also, sourcing
6222
# `FILE.' does not work on cygwin managed mounts.
5686
6224
# If there is no directory component, then add one.
5688
*/* | *\\*) . ${wrapperdot} ;;
5689
*) . ./${wrapperdot} ;;
6226
*/* | *\\*) . ${wrapper} ;;
6227
*) . ./${wrapper} ;;
5693
6231
if test "$fast_install" = no && test -n "$relink_command"; then
5694
6232
if test "$finalize" = yes && test -z "$run"; then
5696
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5697
tmpdir="$tmpdir/libtool-$$"
5700
if $mkdir "$tmpdir"; then
5704
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
6233
tmpdir=`func_mktempdir`
5707
6234
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5708
6235
outputname="$tmpdir/$file"
5709
6236
# Replace the output file specification.
5710
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6237
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
5712
6239
$show "$relink_command"
5713
6240
if $run eval "$relink_command"; then :