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, 2005
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
47
TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
47
TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)"
49
# See if we are running on zsh, and set the options which allow our
50
# commands through without removal of \ escapes.
51
if test -n "${ZSH_VERSION+set}" ; then
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+"$@"}'='"$@"'
52
56
setopt NO_GLOB_SUBST
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
55
63
# Check that we have a working $echo.
56
64
if test "X$1" = X--no-reexec; then
105
113
# These must not be set unconditionally because not all systems understand
106
114
# e.g. LANG=C (notably SCO).
107
115
# We save the old values to restore during execute mode.
108
if test "${LC_ALL+set}" = set; then
109
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
111
if test "${LANG+set}" = set; then
112
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
115
131
# Make sure IFS has a sensible default
135
153
lo2o="s/\\.lo\$/.${objext}/"
136
154
o2lo="s/\\.${objext}\$/.lo/"
138
158
#####################################
139
159
# Shell function definitions:
140
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
142
199
# func_win32_libid arg
143
200
# return the library type of file 'arg'
1084
-all-static | -static)
1085
if test "X$arg" = "X-all-static"; then
1179
-all-static | -static | -static-libtool-libs)
1086
1182
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1087
1183
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1089
1185
if test -n "$link_static_flag"; then
1090
1186
dlopen_self=$dlopen_self_static
1093
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1094
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
1097
1203
build_libtool_libs=no
1098
1204
build_old_libs=yes
1099
prefer_static_libs=yes
1536
1670
# +DA*, +DD* enable 64-bit mode on the HP compiler
1537
1671
# -q* pass through compiler args for the IBM compiler
1538
1672
# -m* pass through architecture-specific compiler args for GCC
1539
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
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*|@*)
1541
1681
# Unknown arguments in both finalize_command and compile_command need
1542
1682
# to be aesthetically quoted because they are evaled later.
2559
2712
if test "$hardcode_direct" = no; then
2560
2713
add="$dir/$linklib"
2562
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2715
*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
2716
*-*-sysv4*uw2*) add_dir="-L$dir" ;;
2717
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2718
*-*-unixware7*) add_dir="-L$dir" ;;
2564
2720
# if the lib is a module then we can not link against
2565
2721
# it, someone is ignoring the new warnings I added
2566
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2722
if /usr/bin/file -L $add 2> /dev/null |
2723
$EGREP ": [^:]* bundle" >/dev/null ; then
2567
2724
$echo "** Warning, lib $linklib is a module, not a shared library"
2568
2725
if test -z "$old_library" ; then
2806
2963
# we do not want to link against static libs,
2807
2964
# but need to link against shared
2808
2965
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2966
eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2809
2967
if test -n "$deplibrary_names" ; then
2810
2968
for tmp in $deplibrary_names ; do
2813
if test -f "$path/$depdepl" ; then
2971
if test -f "$deplibdir/$depdepl" ; then
2972
depdepl="$deplibdir/$depdepl"
2973
elif test -f "$path/$depdepl" ; then
2814
2974
depdepl="$path/$depdepl"
2976
# Can't find it, oh well...
2816
2979
# do not add paths which are already there
2817
2980
case " $newlib_search_path " in
3315
3484
# Eliminate all temporary directories.
3316
for path in $notinst_path; do
3317
lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3318
deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3319
dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3485
#for path in $notinst_path; do
3486
# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3487
# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3488
# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3322
3491
if test -n "$xrpath"; then
3323
3492
# If the user specified any rpath flags, then add them.
4107
4312
reload_conv_objs=
4109
4314
# reload_cmds runs $LD directly, so let us get rid of
4110
# -Wl from whole_archive_flag_spec
4315
# -Wl from whole_archive_flag_spec and hope we can get by with
4316
# turning comma into space..
4113
4319
if test -n "$convenience"; then
4114
4320
if test -n "$whole_archive_flag_spec"; then
4115
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4321
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4322
reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4117
4324
gentop="$output_objdir/${obj}x"
4118
4325
generated="$generated $gentop"
4430
# move library search paths that coincide with paths to not yet
4431
# installed libraries to the beginning of the library search list
4433
for path in $notinst_path; do
4434
case " $new_libs " in
4435
*" -L$path/$objdir "*) ;;
4437
case " $compile_deplibs " in
4438
*" -L$path/$objdir "*)
4439
new_libs="$new_libs -L$path/$objdir" ;;
4444
for deplib in $compile_deplibs; do
4447
case " $new_libs " in
4449
*) new_libs="$new_libs $deplib" ;;
4452
*) new_libs="$new_libs $deplib" ;;
4455
compile_deplibs="$new_libs"
4222
4458
compile_command="$compile_command $compile_deplibs"
4223
4459
finalize_command="$finalize_command $finalize_deplibs"
4383
4624
export_symbols="$output_objdir/$outputname.exp"
4384
4625
$run $rm $export_symbols
4385
4626
$run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4628
*cygwin* | *mingw* )
4629
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4630
$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4387
$run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4634
$run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4388
4635
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4389
4636
$run eval 'mv "$nlist"T "$nlist"'
4638
*cygwin* | *mingw* )
4639
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4640
$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4505
4758
# Now compile the dynamic symbol file.
4506
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4507
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4759
$show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4760
$run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4509
4762
# Clean up the generated files.
4510
4763
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4511
4764
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4513
4766
# Transform the symbol file into the correct name.
4514
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4515
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4768
*cygwin* | *mingw* )
4769
if test -f "$output_objdir/${outputname}.def" ; then
4770
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4771
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4773
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4774
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4778
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4779
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4518
4784
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4525
4791
# really was required.
4527
4793
# Nullify the symbol file.
4528
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4529
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4794
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4795
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4532
4798
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4533
4799
# Replace the output file specification.
4534
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4800
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4535
4801
link_command="$compile_command$compile_rpath"
4537
4803
# We have no uninstalled library dependencies, so finalize right now.
4538
4804
$show "$link_command"
4539
4805
$run eval "$link_command"
4542
4808
# Delete the generated files.
4543
4809
if test -n "$dlsyms"; then
4741
5016
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4742
5017
#endif /* DIR_SEPARATOR_2 */
5019
#ifndef PATH_SEPARATOR_2
5020
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5021
#else /* PATH_SEPARATOR_2 */
5022
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5023
#endif /* PATH_SEPARATOR_2 */
4744
5025
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4745
5026
#define XFREE(stale) do { \
4746
5027
if (stale) { free ((void *) stale); stale = 0; } \
5030
/* -DDEBUG is fairly common in CFLAGS. */
5032
#if defined DEBUGWRAPPER
5033
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5035
# define DEBUG(format, ...)
4749
5038
const char *program_name = NULL;
4751
5040
void * xmalloc (size_t num);
4752
5041
char * xstrdup (const char *string);
4753
char * basename (const char *name);
4754
char * fnqualify(const char *path);
5042
const char * base_name (const char *name);
5043
char * find_executable(const char *wrapper);
5044
int check_executable(const char *path);
4755
5045
char * strendzap(char *str, const char *pat);
4756
5046
void lt_fatal (const char *message, ...);
4761
5051
char **newargz;
4764
program_name = (char *) xstrdup ((char *) basename (argv[0]));
5054
program_name = (char *) xstrdup (base_name (argv[0]));
5055
DEBUG("(main) argv[0] : %s\n",argv[0]);
5056
DEBUG("(main) program_name : %s\n",program_name);
4765
5057
newargz = XMALLOC(char *, argc+2);
4768
cat >> $cwrappersource <<EOF
4769
newargz[0] = "$SHELL";
5060
cat >> $cwrappersource <<EOF
5061
newargz[0] = (char *) xstrdup("$SHELL");
4772
cat >> $cwrappersource <<"EOF"
4773
newargz[1] = fnqualify(argv[0]);
5064
cat >> $cwrappersource <<"EOF"
5065
newargz[1] = find_executable(argv[0]);
5066
if (newargz[1] == NULL)
5067
lt_fatal("Couldn't find %s", argv[0]);
5068
DEBUG("(main) found exe at : %s\n",newargz[1]);
4774
5069
/* we know the script has the same name, without the .exe */
4775
5070
/* so make sure newargz[1] doesn't end in .exe */
4776
5071
strendzap(newargz[1],".exe");
4777
5072
for (i = 1; i < argc; i++)
4778
5073
newargz[i+1] = xstrdup(argv[i]);
4779
5074
newargz[argc+1] = NULL;
4782
cat >> $cwrappersource <<EOF
5076
for (i=0; i<argc+1; i++)
5078
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5086
cat >> $cwrappersource <<EOF
5087
execv("$SHELL",(char const **)newargz);
5091
cat >> $cwrappersource <<EOF
4783
5092
execv("$SHELL",newargz);
4786
cat >> $cwrappersource <<"EOF"
5097
cat >> $cwrappersource <<"EOF"
4808
basename (const char *name)
5119
base_name (const char *name)
4810
5121
const char *base;
4812
5123
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4813
5124
/* Skip over the disk name in MSDOS pathnames. */
4814
if (isalpha (name[0]) && name[1] == ':')
5125
if (isalpha ((unsigned char)name[0]) && name[1] == ':')
4818
5129
for (base = name; *name; name++)
4819
5130
if (IS_DIR_SEPARATOR (*name))
4820
5131
base = name + 1;
4821
return (char *) base;
5136
check_executable(const char * path)
5140
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5141
if ((!path) || (!*path))
5144
if ((stat (path, &st) >= 0) &&
5146
/* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5147
#if defined (S_IXOTH)
5148
((st.st_mode & S_IXOTH) == S_IXOTH) ||
5150
#if defined (S_IXGRP)
5151
((st.st_mode & S_IXGRP) == S_IXGRP) ||
5153
((st.st_mode & S_IXUSR) == S_IXUSR))
5160
/* Searches for the full path of the wrapper. Returns
5161
newly allocated full path name if found, NULL otherwise */
4825
fnqualify(const char *path)
5163
find_executable (const char* wrapper)
5168
/* static buffer for getcwd */
4829
5169
char tmp[LT_PATHMAX + 1];
4831
assert(path != NULL);
4833
/* Is it qualified already? */
4834
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4835
if (isalpha (path[0]) && path[1] == ':')
4836
return xstrdup (path);
4838
if (IS_DIR_SEPARATOR (path[0]))
4839
return xstrdup (path);
4841
/* prepend the current directory */
4842
/* doesn't handle '~' */
5173
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5175
if ((wrapper == NULL) || (*wrapper == '\0'))
5178
/* Absolute path? */
5179
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5180
if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5182
concat_name = xstrdup (wrapper);
5183
if (check_executable(concat_name))
5190
if (IS_DIR_SEPARATOR (wrapper[0]))
5192
concat_name = xstrdup (wrapper);
5193
if (check_executable(concat_name))
5197
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5201
for (p = wrapper; *p; p++)
5209
/* no slashes; search PATH */
5210
const char* path = getenv ("PATH");
5213
for (p = path; *p; p = p_next)
5217
for (q = p; *q; q++)
5218
if (IS_PATH_SEPARATOR(*q))
5221
p_next = (*q == '\0' ? q : q + 1);
5224
/* empty path: current directory */
5225
if (getcwd (tmp, LT_PATHMAX) == NULL)
5226
lt_fatal ("getcwd failed");
5227
tmp_len = strlen(tmp);
5228
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5229
memcpy (concat_name, tmp, tmp_len);
5230
concat_name[tmp_len] = '/';
5231
strcpy (concat_name + tmp_len + 1, wrapper);
5235
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5236
memcpy (concat_name, p, p_len);
5237
concat_name[p_len] = '/';
5238
strcpy (concat_name + p_len + 1, wrapper);
5240
if (check_executable(concat_name))
5245
/* not found in PATH; assume curdir */
5247
/* Relative path | not found in path: prepend cwd */
4843
5248
if (getcwd (tmp, LT_PATHMAX) == NULL)
4844
5249
lt_fatal ("getcwd failed");
4845
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4846
p = XMALLOC(char, size);
4847
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5250
tmp_len = strlen(tmp);
5251
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5252
memcpy (concat_name, tmp, tmp_len);
5253
concat_name[tmp_len] = '/';
5254
strcpy (concat_name + tmp_len + 1, wrapper);
5256
if (check_executable(concat_name))
4892
# we should really use a build-platform specific compiler
4893
# here, but OTOH, the wrappers (shell script and this C one)
4894
# are only useful if you want to execute the "real" binary.
4895
# Since the "real" binary is built for $host, then this
4896
# wrapper might as well be built for $host, too.
4897
$run $LTCC -s -o $cwrapper $cwrappersource
4901
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5303
# we should really use a build-platform specific compiler
5304
# here, but OTOH, the wrappers (shell script and this C one)
5305
# are only useful if you want to execute the "real" binary.
5306
# Since the "real" binary is built for $host, then this
5307
# wrapper might as well be built for $host, too.
5308
$run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5312
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4903
5314
$echo > $output "\
4917
5328
Xsed='${SED} -e 1s/^X//'
4918
5329
sed_quote_subst='$sed_quote_subst'
5331
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5332
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5335
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5336
# is contrary to our usage. Disable this feature.
5337
alias -g '\${1+\"\$@\"}'='\"\$@\"'
5338
setopt NO_GLOB_SUBST
5340
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5342
BIN_SH=xpg4; export BIN_SH # for Tru64
5343
DUALCASE=1; export DUALCASE # for MKS sh
4920
5345
# The HP-UX ksh and POSIX shell print the target directory to stdout
4921
5346
# if CDPATH is set.
4922
5347
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5798
6223
if test "$fast_install" = no && test -n "$relink_command"; then
5799
6224
if test "$finalize" = yes && test -z "$run"; then
5801
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5802
tmpdir="$tmpdir/libtool-$$"
5805
if $mkdir "$tmpdir"; then
5809
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
6225
tmpdir=`func_mktempdir`
5812
6226
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5813
6227
outputname="$tmpdir/$file"
5814
6228
# Replace the output file specification.
5815
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6229
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
5817
6231
$show "$relink_command"
5818
6232
if $run eval "$relink_command"; then :