33
34
# Provide generalized library-building support services.
35
# --config show all configuration variables
36
# --debug enable verbose shell tracing
37
# -n, --dry-run display commands without modifying any files
38
# --features display basic configuration information and exit
39
# --mode=MODE use operation mode MODE
40
# --preserve-dup-deps don't remove duplicate dependency libraries
41
# --quiet, --silent don't print informational messages
42
# --tag=TAG use configuration variables from tag TAG
43
# -v, --verbose print informational messages (default)
44
# --version print version information
45
# -h, --help print short or long help message
36
# --config show all configuration variables
37
# --debug enable verbose shell tracing
38
# -n, --dry-run display commands without modifying any files
39
# --features display basic configuration information and exit
40
# --mode=MODE use operation mode MODE
41
# --preserve-dup-deps don't remove duplicate dependency libraries
42
# --quiet, --silent don't print informational messages
43
# --no-quiet, --no-silent
44
# print informational messages (default)
45
# --tag=TAG use configuration variables from tag TAG
46
# -v, --verbose print more informational messages than default
47
# --no-verbose don't print the extra informational messages
48
# --version print version information
49
# -h, --help, --help-all print short, long, or detailed help message
47
51
# MODE must be one of the following:
49
# clean remove files from the build directory
50
# compile compile a source file into a libtool object
51
# execute automatically set library path, then run a program
52
# finish complete the installation of libtool libraries
53
# install install libraries or executables
54
# link create a library or an executable
55
# uninstall remove libraries from an installed directory
53
# clean remove files from the build directory
54
# compile compile a source file into a libtool object
55
# execute automatically set library path, then run a program
56
# finish complete the installation of libtool libraries
57
# install install libraries or executables
58
# link create a library or an executable
59
# uninstall remove libraries from an installed directory
57
# MODE-ARGS vary depending on the MODE.
61
# MODE-ARGS vary depending on the MODE. When passed as first option,
62
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
58
63
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
60
65
# When reporting a bug, please describe a test case to reproduce it and
61
66
# include the following information:
66
# compiler flags: $LTCFLAGS
67
# linker: $LD (gnu? $with_gnu_ld)
68
# $progname: (GNU libtool) 2.2.6b
69
# automake: $automake_version
70
# autoconf: $autoconf_version
71
# compiler flags: $LTCFLAGS
72
# linker: $LD (gnu? $with_gnu_ld)
73
# $progname: (GNU libtool) 2.2.10
74
# automake: $automake_version
75
# autoconf: $autoconf_version
72
77
# Report bugs to <bug-libtool@gnu.org>.
78
package_revision=1.3017
83
package_revision=1.3175
80
85
# Be Bourne compatible
81
86
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
159
178
func_dirname_and_basename ()
161
180
# Extract subdirectory from the argument.
162
func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
181
func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
163
182
if test "X$func_dirname_result" = "X${1}"; then
164
183
func_dirname_result="${3}"
166
185
func_dirname_result="$func_dirname_result${2}"
168
func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
187
func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
171
190
# Generated shell functions inserted here.
173
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
174
# is ksh but when the shell is invoked as "sh" and the current value of
175
# the _XPG environment variable is not equal to 1 (one), the special
176
# positional parameter $0, within a function call, is the name of the
192
# These SED scripts presuppose an absolute path with a trailing slash.
193
pathcar='s,^/\([^/]*\).*$,\1,'
194
pathcdr='s,^/[^/]*,,'
195
removedotparts=':dotsl
199
collapseslashes='s@/\{1,\}@/@g'
200
finalslash='s,/*$,/,'
202
# func_normal_abspath PATH
203
# Remove doubled-up and trailing slashes, "." path components,
204
# and cancel out any ".." path components in PATH after making
205
# it an absolute path.
206
# value returned in "$func_normal_abspath_result"
207
func_normal_abspath ()
209
# Start from root dir and reassemble the path.
210
func_normal_abspath_result=
211
func_normal_abspath_tpath=$1
212
func_normal_abspath_altnamespace=
213
case $func_normal_abspath_tpath in
215
# Empty path, that just means $cwd.
216
func_stripname '' '/' "`pwd`"
217
func_normal_abspath_result=$func_stripname_result
220
# The next three entries are used to spot a run of precisely
221
# two leading slashes without using negated character classes;
222
# we take advantage of case's first-match behaviour.
224
# Unusual form of absolute path, do nothing.
227
# Not necessarily an ordinary path; POSIX reserves leading '//'
228
# and for example Cygwin uses it to access remote file shares
229
# over CIFS/SMB, so we conserve a leading double slash if found.
230
func_normal_abspath_altnamespace=/
233
# Absolute path, do nothing.
236
# Relative path, prepend $cwd.
237
func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
240
# Cancel out all the simple stuff to save iterations. We also want
241
# the path to end with a slash for ease of parsing, so make sure
242
# there is one (and only one) here.
243
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
244
-e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
246
# Processed it all yet?
247
if test "$func_normal_abspath_tpath" = / ; then
248
# If we ascended to the root using ".." the result may be empty now.
249
if test -z "$func_normal_abspath_result" ; then
250
func_normal_abspath_result=/
254
func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
256
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
258
# Figure out what to do with it
259
case $func_normal_abspath_tcomponent in
261
# Trailing empty path component, ignore it.
264
# Parent dir; strip last assembled component from result.
265
func_dirname "$func_normal_abspath_result"
266
func_normal_abspath_result=$func_dirname_result
269
# Actual path component, append it.
270
func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
274
# Restore leading double-slash if one was found on entry.
275
func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
278
# func_relative_path SRCDIR DSTDIR
279
# generates a relative path from SRCDIR to DSTDIR, with a trailing
280
# slash if non-empty, suitable for immediately appending a filename
281
# without needing to append a separator.
282
# value returned in "$func_relative_path_result"
283
func_relative_path ()
285
func_relative_path_result=
286
func_normal_abspath "$1"
287
func_relative_path_tlibdir=$func_normal_abspath_result
288
func_normal_abspath "$2"
289
func_relative_path_tbindir=$func_normal_abspath_result
291
# Ascend the tree starting from libdir
293
# check if we have found a prefix of bindir
294
case $func_relative_path_tbindir in
295
$func_relative_path_tlibdir)
296
# found an exact match
297
func_relative_path_tcancelled=
300
$func_relative_path_tlibdir*)
301
# found a matching prefix
302
func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
303
func_relative_path_tcancelled=$func_stripname_result
304
if test -z "$func_relative_path_result"; then
305
func_relative_path_result=.
310
func_dirname $func_relative_path_tlibdir
311
func_relative_path_tlibdir=${func_dirname_result}
312
if test "x$func_relative_path_tlibdir" = x ; then
313
# Have to descend all the way to the root!
314
func_relative_path_result=../$func_relative_path_result
315
func_relative_path_tcancelled=$func_relative_path_tbindir
318
func_relative_path_result=../$func_relative_path_result
323
# Now calculate path; take care to avoid doubling-up slashes.
324
func_stripname '' '/' "$func_relative_path_result"
325
func_relative_path_result=$func_stripname_result
326
func_stripname '/' '/' "$func_relative_path_tcancelled"
327
if test "x$func_stripname_result" != x ; then
328
func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
331
# Normalisation. If bindir is libdir, return empty string,
332
# else relative path ending with a slash; either way, target
333
# file name can be directly appended.
334
if test ! -z "$func_relative_path_result"; then
335
func_stripname './' '' "$func_relative_path_result/"
336
func_relative_path_result=$func_stripname_result
180
340
# The name of this program:
181
# In the unlikely event $progname began with a '-', it would play havoc with
182
# func_echo (imagine progname=-n), so we prepend ./ in that case:
183
341
func_dirname_and_basename "$progpath"
184
342
progname=$func_basename_result
186
-*) progname=./$progname ;;
189
344
# Make sure we have an absolute path for reexecution:
190
345
case $progpath in
1795
1995
# Exit here if they wanted silent mode.
1796
1996
$opt_silent && exit $EXIT_SUCCESS
1798
$ECHO "X----------------------------------------------------------------------" | $Xsed
1799
$ECHO "Libraries have been installed in:"
1998
echo "----------------------------------------------------------------------"
1999
echo "Libraries have been installed in:"
1800
2000
for libdir in $libdirs; do
1801
2001
$ECHO " $libdir"
1804
$ECHO "If you ever happen to want to link against installed libraries"
1805
$ECHO "in a given directory, LIBDIR, you must either use libtool, and"
1806
$ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
1807
$ECHO "flag during linking and do at least one of the following:"
2004
echo "If you ever happen to want to link against installed libraries"
2005
echo "in a given directory, LIBDIR, you must either use libtool, and"
2006
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2007
echo "flag during linking and do at least one of the following:"
1808
2008
if test -n "$shlibpath_var"; then
1809
$ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
1810
$ECHO " during execution"
2009
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2010
echo " during execution"
1812
2012
if test -n "$runpath_var"; then
1813
$ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
1814
$ECHO " during linking"
2013
echo " - add LIBDIR to the \`$runpath_var' environment variable"
2014
echo " during linking"
1816
2016
if test -n "$hardcode_libdir_flag_spec"; then
2684
2922
func_extract_an_archive "$my_xdir" "$my_xabs"
2687
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2925
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
2690
2928
func_extract_archives_result="$my_oldobjs"
2695
# func_emit_wrapper_part1 [arg=no]
2697
# Emit the first part of a libtool wrapper script on stdout.
2698
# For more information, see the description associated with
2699
# func_emit_wrapper(), below.
2700
func_emit_wrapper_part1 ()
2932
# func_emit_wrapper [arg=no]
2934
# Emit a libtool wrapper script on stdout.
2935
# Don't directly open a file because we may want to
2936
# incorporate the script contents within a cygwin/mingw
2937
# wrapper executable. Must ONLY be called from within
2938
# func_mode_link because it depends on a number of variables
2941
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2942
# variable will take. If 'yes', then the emitted script
2943
# will assume that the directory in which it is stored is
2944
# the $objdir directory. This is a cygwin/mingw-specific
2946
func_emit_wrapper ()
2702
func_emit_wrapper_part1_arg1=no
2703
if test -n "$1" ; then
2704
func_emit_wrapper_part1_arg1=$1
2948
func_emit_wrapper_arg1=${1-no}
2750
2992
# When we are sourced in execute mode, \$file and \$ECHO are already set.
2751
2993
if test \"\$libtool_execute_magic\" != \"$magic\"; then
2754
# Make sure echo works.
2755
if test \"X\$1\" = X--no-reexec; then
2756
# Discard the --no-reexec flag, and continue.
2758
elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2759
# Yippee, \$ECHO works!
2762
# Restart under the correct shell, and then maybe \$ECHO will work.
2763
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2996
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
2999
# A function that is used when there is no print builtin or printf.
3000
func_fallback_echo ()
3002
eval 'cat <<_LTECHO_EOF
3009
# Very basic option parsing. These options are (a) specific to
3010
# the libtool wrapper, (b) are identical between the wrapper
3011
# /script/ and the wrapper /executable/ which is used only on
3012
# windows platforms, and (c) all begin with the string "--lt-"
3013
# (application programs are unlikely to have options which match
3016
# There are only two supported options: --lt-debug and
3017
# --lt-dump-script. There is, deliberately, no --lt-help.
3019
# The first argument to this parsing function should be the
3020
# script's $0 value, followed by "$@".
3022
func_parse_lt_options ()
3028
case \"\$lt_opt\" in
3029
--lt-debug) lt_option_debug=1 ;;
3031
lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3032
test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3033
lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3034
cat \"\$lt_dump_D/\$lt_dump_F\"
3038
\$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3044
# Print the debug banner immediately:
3045
if test -n \"\$lt_option_debug\"; then
3046
echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3050
# Used when --lt-debug. Prints its arguments to stdout
3051
# (redirection is the responsibility of the caller)
3052
func_lt_dump_args ()
3057
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3058
lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3062
# Core function for launching the target application
3063
func_exec_program_core ()
3067
# Backslashes separate directories on plain windows
3068
*-*-mingw | *-*-os2* | *-cegcc*)
3070
if test -n \"\$lt_option_debug\"; then
3071
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3072
func_lt_dump_args \${1+\"\$@\"} 1>&2
3074
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3080
if test -n \"\$lt_option_debug\"; then
3081
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3082
func_lt_dump_args \${1+\"\$@\"} 1>&2
3084
exec \"\$progdir/\$program\" \${1+\"\$@\"}
3089
\$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3093
# A function to encapsulate launching the target application
3094
# Strips options in the --lt-* namespace from \$@ and
3095
# launches target application with the remaining arguments.
3096
func_exec_program ()
3102
*) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3106
func_exec_program_core \${1+\"\$@\"}
3110
func_parse_lt_options \"\$0\" \${1+\"\$@\"}
2769
3112
# Find the directory that this script lives in.
2770
thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3113
thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
2771
3114
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2773
3116
# Follow symbolic links until we get to the real thisdir.
2774
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3117
file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
2775
3118
while test -n \"\$file\"; do
2776
destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3119
destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
2778
3121
# If there was a directory component, then change thisdir.
2779
3122
if test \"x\$destdir\" != \"x\$file\"; then
2895
3221
if test \"\$libtool_execute_magic\" != \"$magic\"; then
2896
3222
# Run the actual program with our arguments.
2899
# Backslashes separate directories on plain windows
2900
*-*-mingw | *-*-os2* | *-cegcc*)
2902
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2908
exec \"\$progdir/\$program\" \${1+\"\$@\"}
2913
\$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3223
func_exec_program \${1+\"\$@\"}
2917
3226
# The program doesn't exist.
2918
3227
\$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2919
3228
\$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2920
$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3229
\$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2926
# end: func_emit_wrapper_part2
2929
# func_emit_wrapper [arg=no]
2931
# Emit a libtool wrapper script on stdout.
2932
# Don't directly open a file because we may want to
2933
# incorporate the script contents within a cygwin/mingw
2934
# wrapper executable. Must ONLY be called from within
2935
# func_mode_link because it depends on a number of variables
2938
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2939
# variable will take. If 'yes', then the emitted script
2940
# will assume that the directory in which it is stored is
2941
# the $objdir directory. This is a cygwin/mingw-specific
2943
func_emit_wrapper ()
2945
func_emit_wrapper_arg1=no
2946
if test -n "$1" ; then
2947
func_emit_wrapper_arg1=$1
2950
# split this up so that func_emit_cwrapperexe_src
2951
# can call each part independently.
2952
func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
2953
func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
2957
3237
# func_to_host_path arg
3049
3325
func_to_host_pathlist ()
3051
3327
func_to_host_pathlist_result="$1"
3052
if test -n "$1" ; then
3328
if test -n "$1"; then
3055
3331
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3056
3332
# Remove leading and trailing path separator characters from
3057
3333
# ARG. msys behavior is inconsistent here, cygpath turns them
3058
3334
# into '.;' and ';.', and winepath ignores them completely.
3059
func_to_host_pathlist_tmp2="$1"
3060
# Once set for this call, this variable should not be
3061
# reassigned. It is used in tha fallback case.
3062
func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3063
$SED -e 's|^:*||' -e 's|:*$||'`
3335
func_stripname : : "$1"
3336
func_to_host_pathlist_tmp1=$func_stripname_result
3065
3338
*mingw* ) # Actually, msys.
3066
3339
# Awkward: cmd appends spaces to result.
3067
lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3068
func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3069
$SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3070
func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3071
$SED -e "$lt_sed_naive_backslashify"`
3340
func_to_host_pathlist_result=`
3341
( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
3342
$SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3074
func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3075
func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3345
func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
3076
3346
$SED -e "$lt_sed_naive_backslashify"`
3271
3550
int make_executable (const char *path);
3272
3551
int check_executable (const char *path);
3273
3552
char *strendzap (char *str, const char *pat);
3274
void lt_fatal (const char *message, ...);
3553
void lt_debugprintf (const char *file, int line, const char *fmt, ...);
3554
void lt_fatal (const char *file, int line, const char *message, ...);
3555
static const char *nonnull (const char *s);
3556
static const char *nonempty (const char *s);
3275
3557
void lt_setenv (const char *name, const char *value);
3276
3558
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3277
void lt_opt_process_env_set (const char *arg);
3278
void lt_opt_process_env_prepend (const char *arg);
3279
void lt_opt_process_env_append (const char *arg);
3280
int lt_split_name_value (const char *arg, char** name, char** value);
3281
3559
void lt_update_exe_path (const char *name, const char *value);
3282
3560
void lt_update_lib_path (const char *name, const char *value);
3284
static const char *script_text_part1 =
3287
func_emit_wrapper_part1 yes |
3288
$SED -e 's/\([\\"]\)/\\\1/g' \
3289
-e 's/^/ "/' -e 's/$/\\n"/'
3293
static const char *script_text_part2 =
3295
func_emit_wrapper_part2 yes |
3296
$SED -e 's/\([\\"]\)/\\\1/g' \
3297
-e 's/^/ "/' -e 's/$/\\n"/'
3561
char **prepare_spawn (char **argv);
3562
void lt_dump_script (FILE *f);
3301
3566
const char * MAGIC_EXE = "$magic_exe";
3394
printf ("%s", script_text_part1);
3395
printf ("%s", script_text_part2);
3648
lt_dump_script (stdout);
3651
if (strcmp (argv[i], debug_opt) == 0)
3656
if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
3658
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3659
namespace, but it is not one of the ones we know about and
3660
have already dealt with, above (inluding dump-script), then
3661
report an error. Otherwise, targets might begin to believe
3662
they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3663
namespace. The first time any user complains about this, we'll
3664
need to make LTWRAPPER_OPTION_PREFIX a configure-time option
3665
or a configure.ac-settable value.
3667
lt_fatal (__FILE__, __LINE__,
3668
"unrecognized %s option: '%s'",
3669
ltwrapper_option_prefix, argv[i]);
3672
newargz[++newargc] = xstrdup (argv[i]);
3400
newargz = XMALLOC (char *, argc + 1);
3674
newargz[++newargc] = NULL;
3678
/* The GNU banner must be the first non-error debug message */
3679
lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
3682
lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
3683
lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
3401
3685
tmp_pathspec = find_executable (argv[0]);
3402
3686
if (tmp_pathspec == NULL)
3403
lt_fatal ("Couldn't find %s", argv[0]);
3404
LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3687
lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
3688
lt_debugprintf (__FILE__, __LINE__,
3689
"(main) found exe (before symlink chase) at: %s\n",
3407
3692
actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3408
LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3409
actual_cwrapper_path));
3693
lt_debugprintf (__FILE__, __LINE__,
3694
"(main) found exe (after symlink chase) at: %s\n",
3695
actual_cwrapper_path);
3410
3696
XFREE (tmp_pathspec);
3412
actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
3698
actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
3413
3699
strendzap (actual_cwrapper_path, actual_cwrapper_name);
3415
3701
/* wrapper name transforms */
3481
3768
lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3482
3769
lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3485
for (i = 1; i < argc; i++)
3487
if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3489
if (argv[i][env_set_opt_len] == '=')
3491
const char *p = argv[i] + env_set_opt_len + 1;
3492
lt_opt_process_env_set (p);
3494
else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
3496
lt_opt_process_env_set (argv[++i]); /* don't copy */
3499
lt_fatal ("%s missing required argument", env_set_opt);
3502
if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
3504
if (argv[i][env_prepend_opt_len] == '=')
3506
const char *p = argv[i] + env_prepend_opt_len + 1;
3507
lt_opt_process_env_prepend (p);
3509
else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
3511
lt_opt_process_env_prepend (argv[++i]); /* don't copy */
3514
lt_fatal ("%s missing required argument", env_prepend_opt);
3517
if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
3519
if (argv[i][env_append_opt_len] == '=')
3521
const char *p = argv[i] + env_append_opt_len + 1;
3522
lt_opt_process_env_append (p);
3524
else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
3526
lt_opt_process_env_append (argv[++i]); /* don't copy */
3529
lt_fatal ("%s missing required argument", env_append_opt);
3532
if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
3534
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3535
namespace, but it is not one of the ones we know about and
3536
have already dealt with, above (inluding dump-script), then
3537
report an error. Otherwise, targets might begin to believe
3538
they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3539
namespace. The first time any user complains about this, we'll
3540
need to make LTWRAPPER_OPTION_PREFIX a configure-time option
3541
or a configure.ac-settable value.
3543
lt_fatal ("Unrecognized option in %s namespace: '%s'",
3544
ltwrapper_option_prefix, argv[i]);
3547
newargz[++newargc] = xstrdup (argv[i]);
3549
newargz[++newargc] = NULL;
3551
LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
3771
lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
3772
nonnull (lt_argv_zero));
3552
3773
for (i = 0; i < newargc; i++)
3554
LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
3775
lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
3776
i, nonnull (newargz[i]));
4067
lt_debugprintf (const char *file, int line, const char *fmt, ...)
4072
(void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
4073
va_start (args, fmt);
4074
(void) vfprintf (stderr, fmt, args);
3837
lt_error_core (int exit_status, const char *mode,
4080
lt_error_core (int exit_status, const char *file,
4081
int line, const char *mode,
3838
4082
const char *message, va_list ap)
3840
fprintf (stderr, "%s: %s: ", program_name, mode);
4084
fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
3841
4085
vfprintf (stderr, message, ap);
3842
4086
fprintf (stderr, ".\n");
3849
lt_fatal (const char *message, ...)
4093
lt_fatal (const char *file, int line, const char *message, ...)
3852
4096
va_start (ap, message);
3853
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4097
lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
4102
nonnull (const char *s)
4104
return s ? s : "(null)";
4108
nonempty (const char *s)
4110
return (s && !*s) ? "(empty)" : nonnull (s);
3858
4114
lt_setenv (const char *name, const char *value)
3860
LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
3861
(name ? name : "<NULL>"),
3862
(value ? value : "<NULL>")));
4116
lt_debugprintf (__FILE__, __LINE__,
4117
"(lt_setenv) setting '%s' to '%s'\n",
4118
nonnull (name), nonnull (value));
3864
4120
#ifdef HAVE_SETENV
3865
4121
/* always make a copy, for consistency with !HAVE_SETENV */
3904
4160
return new_value;
3908
lt_split_name_value (const char *arg, char** name, char** value)
3915
p = strchr (arg, (int)'=');
3920
*value = xstrdup (++p);
3922
len = strlen (arg) - strlen (*value);
3923
*name = XMALLOC (char, len);
3924
strncpy (*name, arg, len-1);
3925
(*name)[len - 1] = '\0';
3931
lt_opt_process_env_set (const char *arg)
3936
if (lt_split_name_value (arg, &name, &value) != 0)
3940
lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
3943
lt_setenv (name, value);
3949
lt_opt_process_env_prepend (const char *arg)
3953
char *new_value = NULL;
3955
if (lt_split_name_value (arg, &name, &value) != 0)
3959
lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
3962
new_value = lt_extend_str (getenv (name), value, 0);
3963
lt_setenv (name, new_value);
3970
lt_opt_process_env_append (const char *arg)
3974
char *new_value = NULL;
3976
if (lt_split_name_value (arg, &name, &value) != 0)
3980
lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
3983
new_value = lt_extend_str (getenv (name), value, 1);
3984
lt_setenv (name, new_value);
3991
4164
lt_update_exe_path (const char *name, const char *value)
3993
LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
3994
(name ? name : "<NULL>"),
3995
(value ? value : "<NULL>")));
4166
lt_debugprintf (__FILE__, __LINE__,
4167
"(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4168
nonnull (name), nonnull (value));
3997
4170
if (name && *name && value && *value)
4204
/* Prepares an argument vector before calling spawn().
4205
Note that spawn() does not by itself call the command interpreter
4206
(getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4207
({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4209
v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4210
}) ? "cmd.exe" : "command.com").
4211
Instead it simply concatenates the arguments, separated by ' ', and calls
4212
CreateProcess(). We must quote the arguments since Win32 CreateProcess()
4213
interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4215
- Space and tab are interpreted as delimiters. They are not treated as
4216
delimiters if they are surrounded by double quotes: "...".
4217
- Unescaped double quotes are removed from the input. Their only effect is
4218
that within double quotes, space and tab are treated like normal
4220
- Backslashes not followed by double quotes are not special.
4221
- But 2*n+1 backslashes followed by a double quote become
4222
n backslashes followed by a double quote (n >= 0):
4227
#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4228
#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4230
prepare_spawn (char **argv)
4236
/* Count number of arguments. */
4237
for (argc = 0; argv[argc] != NULL; argc++)
4240
/* Allocate new argument vector. */
4241
new_argv = XMALLOC (char *, argc + 1);
4243
/* Put quoted arguments into the new argument vector. */
4244
for (i = 0; i < argc; i++)
4246
const char *string = argv[i];
4248
if (string[0] == '\0')
4249
new_argv[i] = xstrdup ("\"\"");
4250
else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
4252
int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
4254
unsigned int backslashes;
4256
char *quoted_string;
4263
for (s = string; *s != '\0'; s++)
4267
length += backslashes + 1;
4275
length += backslashes + 1;
4277
quoted_string = XMALLOC (char, length + 1);
4283
for (s = string; *s != '\0'; s++)
4289
for (j = backslashes + 1; j > 0; j--)
4301
for (j = backslashes; j > 0; j--)
4307
new_argv[i] = quoted_string;
4310
new_argv[i] = (char *) string;
4312
new_argv[argc] = NULL;
4321
void lt_dump_script (FILE* f)
4324
func_emit_wrapper yes |
4325
$SED -e 's/\([\\"]\)/\\\1/g' \
4326
-e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
4029
4332
# end: func_emit_cwrapperexe_src
4334
# func_win32_import_lib_p ARG
4335
# True if ARG is an import lib, as indicated by $file_magic_cmd
4336
func_win32_import_lib_p ()
4339
case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
4031
4345
# func_mode_link arg...
4032
4346
func_mode_link ()
4754
5079
arg="$func_quote_for_eval_result"
4757
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4758
# -r[0-9][0-9]* specifies the processor on the SGI compiler
4759
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4760
# +DA*, +DD* enable 64-bit mode on the HP compiler
4761
# -q* pass through compiler args for the IBM compiler
4762
# -m*, -t[45]*, -txscale* pass through architecture-specific
4763
# compiler args for GCC
4764
# -F/path gives path to uninstalled frameworks, gcc on darwin
4765
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4766
# @file GCC response files
5082
# Flags to be passed through unchanged, with rationale:
5083
# -64, -mips[0-9] enable 64-bit mode for the SGI compiler
5084
# -r[0-9][0-9]* specify processor for the SGI compiler
5085
# -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5086
# +DA*, +DD* enable 64-bit mode for the HP compiler
5087
# -q* compiler args for the IBM compiler
5088
# -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5089
# -F/path path to uninstalled frameworks, gcc on darwin
5090
# -p, -pg, --coverage, -fprofile-* profiling flags for GCC
5091
# @file GCC response files
5092
# -tp=* Portland pgcc target processor selection
4767
5093
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4768
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
5094
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
4769
5095
func_quote_for_eval "$arg"
4770
5096
arg="$func_quote_for_eval_result"
4771
5097
func_append compile_command " $arg"
5826
6153
# Just print a warning and add the library to dependency_libs so
5827
6154
# that the program can be linked against the static library.
5829
6156
$ECHO "*** Warning: This system can not link to static lib archive $lib."
5830
$ECHO "*** I have the capability to make that library automatically link in when"
5831
$ECHO "*** you link to this library. But I can only do this if you have a"
5832
$ECHO "*** shared version of the library, which you do not appear to have."
6157
echo "*** I have the capability to make that library automatically link in when"
6158
echo "*** you link to this library. But I can only do this if you have a"
6159
echo "*** shared version of the library, which you do not appear to have."
5833
6160
if test "$module" = yes; then
5834
$ECHO "*** But as you try to build a module library, libtool will still create "
5835
$ECHO "*** a static module, that should work as long as the dlopening application"
5836
$ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
6161
echo "*** But as you try to build a module library, libtool will still create "
6162
echo "*** a static module, that should work as long as the dlopening application"
6163
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
5837
6164
if test -z "$global_symbol_pipe"; then
5839
$ECHO "*** However, this would only work if libtool was able to extract symbol"
5840
$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5841
$ECHO "*** not find such a program. So, this module is probably useless."
5842
$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
6166
echo "*** However, this would only work if libtool was able to extract symbol"
6167
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6168
echo "*** not find such a program. So, this module is probably useless."
6169
echo "*** \`nm' from GNU binutils and a full rebuild may help."
5844
6171
if test "$build_old_libs" = no; then
5845
6172
build_libtool_libs=module
6604
6932
newdeplibs="$newdeplibs $i"
6606
6934
droppeddeps=yes
6608
6936
$ECHO "*** Warning: dynamic linker does not accept needed library $i."
6609
$ECHO "*** I have the capability to make that library automatically link in when"
6610
$ECHO "*** you link to this library. But I can only do this if you have a"
6611
$ECHO "*** shared version of the library, which you do not appear to have"
6612
$ECHO "*** because a test_compile did reveal that the linker did not use this one"
6613
$ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
6937
echo "*** I have the capability to make that library automatically link in when"
6938
echo "*** you link to this library. But I can only do this if you have a"
6939
echo "*** shared version of the library, which you do not appear to have"
6940
echo "*** because a test_compile did reveal that the linker did not use this one"
6941
echo "*** as a dynamic dependency that programs can get resolved with at runtime."
6617
6945
droppeddeps=yes
6619
6947
$ECHO "*** Warning! Library $i is needed by this library but I was not able to"
6620
$ECHO "*** make it link in! You will probably need to install it or some"
6621
$ECHO "*** library that it depends on before this library will be fully"
6622
$ECHO "*** functional. Installing it before continuing would be even better."
6948
echo "*** make it link in! You will probably need to install it or some"
6949
echo "*** library that it depends on before this library will be fully"
6950
echo "*** functional. Installing it before continuing would be even better."
6758
7086
none | unknown | *)
6760
tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6761
-e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
7088
tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
6762
7089
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6763
7090
for i in $predeps $postdeps ; do
6764
7091
# can't use Xsed below, because $i might contain '/'
6765
tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
7092
tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
6768
if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
6769
$GREP . >/dev/null; then
7095
case $tmp_deplibs in
6771
7098
if test "X$deplibs_check_method" = "Xnone"; then
6772
$ECHO "*** Warning: inter-library dependencies are not supported in this platform."
7099
echo "*** Warning: inter-library dependencies are not supported in this platform."
6774
$ECHO "*** Warning: inter-library dependencies are not known to be supported."
7101
echo "*** Warning: inter-library dependencies are not known to be supported."
6776
$ECHO "*** All declared inter-library dependencies are being dropped."
7103
echo "*** All declared inter-library dependencies are being dropped."
6777
7104
droppeddeps=yes
6781
7109
versuffix=$versuffix_save
6788
7116
*-*-rhapsody* | *-*-darwin1.[012])
6789
7117
# On Rhapsody replace the C library with the System framework
6790
newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7118
newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
6794
7122
if test "$droppeddeps" = yes; then
6795
7123
if test "$module" = yes; then
6797
$ECHO "*** Warning: libtool could not satisfy all declared inter-library"
7125
echo "*** Warning: libtool could not satisfy all declared inter-library"
6798
7126
$ECHO "*** dependencies of module $libname. Therefore, libtool will create"
6799
$ECHO "*** a static module, that should work as long as the dlopening"
6800
$ECHO "*** application is linked with the -dlopen flag."
7127
echo "*** a static module, that should work as long as the dlopening"
7128
echo "*** application is linked with the -dlopen flag."
6801
7129
if test -z "$global_symbol_pipe"; then
6803
$ECHO "*** However, this would only work if libtool was able to extract symbol"
6804
$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6805
$ECHO "*** not find such a program. So, this module is probably useless."
6806
$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
7131
echo "*** However, this would only work if libtool was able to extract symbol"
7132
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7133
echo "*** not find such a program. So, this module is probably useless."
7134
echo "*** \`nm' from GNU binutils and a full rebuild may help."
6808
7136
if test "$build_old_libs" = no; then
6809
7137
oldlibs="$output_objdir/$libname.$libext"
6813
7141
build_libtool_libs=no
6816
$ECHO "*** The inter-library dependencies that have been dropped here will be"
6817
$ECHO "*** automatically added whenever a program is linked with this library"
6818
$ECHO "*** or is declared to -dlopen it."
7144
echo "*** The inter-library dependencies that have been dropped here will be"
7145
echo "*** automatically added whenever a program is linked with this library"
7146
echo "*** or is declared to -dlopen it."
6820
7148
if test "$allow_undefined" = no; then
6822
$ECHO "*** Since this library must not contain undefined symbols,"
6823
$ECHO "*** because either the platform does not support them or"
6824
$ECHO "*** it was explicitly requested with -no-undefined,"
6825
$ECHO "*** libtool will only create a static version of it."
7150
echo "*** Since this library must not contain undefined symbols,"
7151
echo "*** because either the platform does not support them or"
7152
echo "*** it was explicitly requested with -no-undefined,"
7153
echo "*** libtool will only create a static version of it."
6826
7154
if test "$build_old_libs" = no; then
6827
7155
oldlibs="$output_objdir/$libname.$libext"
6828
7156
build_libtool_libs=module
8123
8444
# place dlname in correct position for cygwin
8445
# In fact, it would be nice if we could use this code for all target
8446
# systems that can't hard-code library paths into their executables
8447
# and that have no shared library path variable independent of PATH,
8448
# but it turns out we can't easily determine that from inspecting
8449
# libtool variables, so we have to hard-code the OSs to which it
8450
# applies here; at the moment, that means platforms that use the PE
8451
# object format with DLL files. See the long comment at the top of
8452
# tests/bindir.at for full details.
8124
8453
tdlname=$dlname
8125
8454
case $host,$output,$installed,$module,$dlname in
8126
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
8455
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
8456
# If a -bindir argument was supplied, place the dll there.
8457
if test "x$bindir" != x ;
8459
func_relative_path "$install_libdir" "$bindir"
8460
tdlname=$func_relative_path_result$dlname
8462
# Otherwise fall back on heuristic.
8463
tdlname=../bin/$dlname
8128
8467
$ECHO > $output "\
8129
8468
# $outputname - a libtool library file