33
33
# 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
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
# --no-quiet, --no-silent
43
# print informational messages (default)
44
# --no-warn don't display warning messages
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.6
69
# automake: $automake_version
70
# autoconf: $autoconf_version
71
# compiler flags: $LTCFLAGS
72
# linker: $LD (gnu? $with_gnu_ld)
73
# $progname: (GNU libtool) 2.4.2
74
# automake: $automake_version
75
# autoconf: $autoconf_version
72
77
# Report bugs to <bug-libtool@gnu.org>.
78
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
79
# General help using GNU software: <http://www.gnu.org/gethelp/>.
78
package_revision=1.3012
86
package_revision=1.3337
80
88
# Be Bourne compatible
81
89
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
158
196
# those functions but instead duplicate the functionality here.
159
197
func_dirname_and_basename ()
161
# Extract subdirectory from the argument.
162
func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
163
if test "X$func_dirname_result" = "X${1}"; then
164
func_dirname_result="${3}"
166
func_dirname_result="$func_dirname_result${2}"
168
func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
171
# 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
199
# Extract subdirectory from the argument.
200
func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
201
if test "X$func_dirname_result" = "X${1}"; then
202
func_dirname_result="${3}"
204
func_dirname_result="$func_dirname_result${2}"
206
func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
207
} # func_dirname_and_basename may be replaced by extended shell implementation
210
# func_stripname prefix suffix name
211
# strip PREFIX and SUFFIX off of NAME.
212
# PREFIX and SUFFIX must not contain globbing or regex special
213
# characters, hashes, percent signs, but SUFFIX may contain a leading
214
# dot (in which case that matches only a dot).
215
# func_strip_suffix prefix name
219
.*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
220
*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
222
} # func_stripname may be replaced by extended shell implementation
225
# These SED scripts presuppose an absolute path with a trailing slash.
226
pathcar='s,^/\([^/]*\).*$,\1,'
227
pathcdr='s,^/[^/]*,,'
228
removedotparts=':dotsl
232
collapseslashes='s@/\{1,\}@/@g'
233
finalslash='s,/*$,/,'
235
# func_normal_abspath PATH
236
# Remove doubled-up and trailing slashes, "." path components,
237
# and cancel out any ".." path components in PATH after making
238
# it an absolute path.
239
# value returned in "$func_normal_abspath_result"
240
func_normal_abspath ()
242
# Start from root dir and reassemble the path.
243
func_normal_abspath_result=
244
func_normal_abspath_tpath=$1
245
func_normal_abspath_altnamespace=
246
case $func_normal_abspath_tpath in
248
# Empty path, that just means $cwd.
249
func_stripname '' '/' "`pwd`"
250
func_normal_abspath_result=$func_stripname_result
253
# The next three entries are used to spot a run of precisely
254
# two leading slashes without using negated character classes;
255
# we take advantage of case's first-match behaviour.
257
# Unusual form of absolute path, do nothing.
260
# Not necessarily an ordinary path; POSIX reserves leading '//'
261
# and for example Cygwin uses it to access remote file shares
262
# over CIFS/SMB, so we conserve a leading double slash if found.
263
func_normal_abspath_altnamespace=/
266
# Absolute path, do nothing.
269
# Relative path, prepend $cwd.
270
func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
273
# Cancel out all the simple stuff to save iterations. We also want
274
# the path to end with a slash for ease of parsing, so make sure
275
# there is one (and only one) here.
276
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
277
-e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
279
# Processed it all yet?
280
if test "$func_normal_abspath_tpath" = / ; then
281
# If we ascended to the root using ".." the result may be empty now.
282
if test -z "$func_normal_abspath_result" ; then
283
func_normal_abspath_result=/
287
func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
289
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
291
# Figure out what to do with it
292
case $func_normal_abspath_tcomponent in
294
# Trailing empty path component, ignore it.
297
# Parent dir; strip last assembled component from result.
298
func_dirname "$func_normal_abspath_result"
299
func_normal_abspath_result=$func_dirname_result
302
# Actual path component, append it.
303
func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
307
# Restore leading double-slash if one was found on entry.
308
func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
311
# func_relative_path SRCDIR DSTDIR
312
# generates a relative path from SRCDIR to DSTDIR, with a trailing
313
# slash if non-empty, suitable for immediately appending a filename
314
# without needing to append a separator.
315
# value returned in "$func_relative_path_result"
316
func_relative_path ()
318
func_relative_path_result=
319
func_normal_abspath "$1"
320
func_relative_path_tlibdir=$func_normal_abspath_result
321
func_normal_abspath "$2"
322
func_relative_path_tbindir=$func_normal_abspath_result
324
# Ascend the tree starting from libdir
326
# check if we have found a prefix of bindir
327
case $func_relative_path_tbindir in
328
$func_relative_path_tlibdir)
329
# found an exact match
330
func_relative_path_tcancelled=
333
$func_relative_path_tlibdir*)
334
# found a matching prefix
335
func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
336
func_relative_path_tcancelled=$func_stripname_result
337
if test -z "$func_relative_path_result"; then
338
func_relative_path_result=.
343
func_dirname $func_relative_path_tlibdir
344
func_relative_path_tlibdir=${func_dirname_result}
345
if test "x$func_relative_path_tlibdir" = x ; then
346
# Have to descend all the way to the root!
347
func_relative_path_result=../$func_relative_path_result
348
func_relative_path_tcancelled=$func_relative_path_tbindir
351
func_relative_path_result=../$func_relative_path_result
356
# Now calculate path; take care to avoid doubling-up slashes.
357
func_stripname '' '/' "$func_relative_path_result"
358
func_relative_path_result=$func_stripname_result
359
func_stripname '/' '/' "$func_relative_path_tcancelled"
360
if test "x$func_stripname_result" != x ; then
361
func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
364
# Normalisation. If bindir is libdir, return empty string,
365
# else relative path ending with a slash; either way, target
366
# file name can be directly appended.
367
if test ! -z "$func_relative_path_result"; then
368
func_stripname './' '' "$func_relative_path_result/"
369
func_relative_path_result=$func_stripname_result
180
373
# 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
374
func_dirname_and_basename "$progpath"
184
375
progname=$func_basename_result
186
-*) progname=./$progname ;;
189
377
# Make sure we have an absolute path for reexecution:
190
378
case $progpath in
547
788
func_missing_arg ()
549
func_error "missing argument for $1"
792
func_error "missing argument for $1."
797
# func_split_short_opt shortopt
798
# Set func_split_short_opt_name and func_split_short_opt_arg shell
799
# variables after splitting SHORTOPT after the 2nd character.
800
func_split_short_opt ()
802
my_sed_short_opt='1s/^\(..\).*$/\1/;q'
803
my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
805
func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
806
func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
807
} # func_split_short_opt may be replaced by extended shell implementation
810
# func_split_long_opt longopt
811
# Set func_split_long_opt_name and func_split_long_opt_arg shell
812
# variables after splitting LONGOPT at the `=' sign.
813
func_split_long_opt ()
815
my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
816
my_sed_long_arg='1s/^--[^=]*=//'
818
func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
819
func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
820
} # func_split_long_opt may be replaced by extended shell implementation
559
# Check that we have a working $ECHO.
560
if test "X$1" = X--no-reexec; then
561
# Discard the --no-reexec flag, and continue.
563
elif test "X$1" = X--fallback-echo; then
564
# Avoid inline document here, it may be left over
566
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
567
# Yippee, $ECHO works!
570
# Restart under the correct shell, and then maybe $ECHO will work.
571
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
574
if test "X$1" = X--fallback-echo; then
575
# used as fallback echo
583
828
magic="%%%MAGIC variable%%%"
584
829
magic_exe="%%%MAGIC EXE variable%%%"
586
831
# Global variables.
591
834
lo2o="s/\\.lo\$/.${objext}/"
592
835
o2lo="s/\\.${objext}\$/.lo/"
593
836
extracted_archives=
594
837
extracted_serial=0
597
opt_duplicate_deps=false
601
839
# If this variable is set in any of the actions, the command in it
602
840
# will be execed at the end. This prevents here-documents from being
603
841
# left over by shells.
844
# func_append var value
845
# Append VALUE to the end of shell variable VAR.
848
eval "${1}=\$${1}\${2}"
849
} # func_append may be replaced by extended shell implementation
851
# func_append_quoted var value
852
# Quote VALUE and append to the end of shell variable VAR, separated
854
func_append_quoted ()
856
func_quote_for_eval "${2}"
857
eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
858
} # func_append_quoted may be replaced by extended shell implementation
861
# func_arith arithmetic-term...
864
func_arith_result=`expr "${@}"`
865
} # func_arith may be replaced by extended shell implementation
869
# STRING may not start with a hyphen.
872
func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
873
} # func_len may be replaced by extended shell implementation
879
func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
880
} # func_lo2o may be replaced by extended shell implementation
883
# func_xform libobj-or-source
886
func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
887
} # func_xform may be replaced by extended shell implementation
606
890
# func_fatal_configuration arg...
607
891
# Echo program name prefixed message to standard error, followed by
608
892
# a configuration failure hint, and exit.
1015
# Shorthand for --mode=foo, only valid as the first argument
1018
shift; set dummy --mode clean ${1+"$@"}; shift
1020
compile|compil|compi|comp|com|co|c)
1021
shift; set dummy --mode compile ${1+"$@"}; shift
1023
execute|execut|execu|exec|exe|ex|e)
1024
shift; set dummy --mode execute ${1+"$@"}; shift
1026
finish|finis|fini|fin|fi|f)
1027
shift; set dummy --mode finish ${1+"$@"}; shift
1029
install|instal|insta|inst|ins|in|i)
1030
shift; set dummy --mode install ${1+"$@"}; shift
1033
shift; set dummy --mode link ${1+"$@"}; shift
1035
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1036
shift; set dummy --mode uninstall ${1+"$@"}; shift
1046
opt_preserve_dup_deps=false
1058
# Parse options once, thoroughly. This comes as soon as possible in the
1059
# script to make things like `--version' happen as quickly as we can.
1061
# this just eases exit handling
1062
while test $# -gt 0; do
1066
--debug|-x) opt_debug='set -x'
1067
func_echo "enabling shell trace mode"
1070
--dry-run|--dryrun|-n)
1079
opt_dlopen="${opt_dlopen+$opt_dlopen
1083
--preserve-dup-deps)
1084
opt_preserve_dup_deps=:
1092
set dummy --mode finish ${1+"$@"}; shift
1099
opt_help=': help-all'
1102
test $# = 0 && func_missing_arg $opt && break
1106
# Valid mode arguments:
1107
clean|compile|execute|finish|install|link|relink|uninstall) ;;
1109
# Catch anything else as an error
1110
*) func_error "invalid argument for $opt"
1117
--no-silent|--no-quiet)
1119
func_append preserve_args " $opt"
1121
--no-warning|--no-warn)
1123
func_append preserve_args " $opt"
1127
func_append preserve_args " $opt"
1131
func_append preserve_args " $opt"
1136
func_append preserve_args " $opt"
1140
test $# = 0 && func_missing_arg $opt && break
1143
func_append preserve_args " $opt $optarg"
1144
func_enable_tag "$optarg"
1148
-\?|-h) func_usage ;;
1149
--help) func_help ;;
1150
--version) func_version ;;
1152
# Separate optargs to long options:
1154
func_split_long_opt "$opt"
1155
set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1159
# Separate non-argument short options:
1161
func_split_short_opt "$opt"
1162
set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1167
-*) func_fatal_help "unrecognized option \`$opt'" ;;
1168
*) set dummy "$opt" ${1+"$@"}; shift; break ;;
1174
# save first non-option argument
1175
if test "$#" -gt 0; then
1181
test "$opt_debug" = : || func_append preserve_args " --debug"
1184
*cygwin* | *mingw* | *pw32* | *cegcc*)
1185
# don't eliminate duplications in $postdeps and $predeps
1186
opt_duplicate_compiler_generated_deps=:
1189
opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1194
# Sanity checks first:
1195
func_check_version_match
1197
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1198
func_fatal_configuration "not configured to build any kind of library"
1202
eval std_shrext=\"$shrext_cmds\"
1204
# Only execute mode is allowed to have -dlopen flags.
1205
if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1206
func_error "unrecognized option \`-dlopen'"
1211
# Change the help message to a mode-specific one.
1212
generic_help="$help"
1213
help="Try \`$progname --help --mode=$opt_mode' for more information."
1217
# Bail if the options were screwed
1218
$exit_cmd $EXIT_FAILURE
858
1224
## ----------- ##
860
1226
## ----------- ##
863
# Sanity checks first:
864
func_check_version_match
866
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
867
func_fatal_configuration "not configured to build any kind of library"
870
test -z "$mode" && func_fatal_error "error: you must specify a MODE."
874
eval std_shrext=\"$shrext_cmds\"
877
# Only execute mode is allowed to have -dlopen flags.
878
if test -n "$execute_dlfiles" && test "$mode" != execute; then
879
func_error "unrecognized option \`-dlopen'"
884
# Change the help message to a mode-specific one.
886
help="Try \`$progname --help --mode=$mode' for more information."
1228
# func_try_sizelim file n
1229
# try to write at most the first N bytes from FILE to the standard output when
1230
# possible, otherwise put whole file
1233
if test -n "$DD"; then
1234
$DD if="$1" bs=$2 count=1 2>/dev/null
1235
if test $? -eq 127; then
1236
cat "$1" 2>/dev/null
1239
cat "$1" 2>/dev/null
890
1243
# func_lalib_p file
891
1244
# True iff FILE is a libtool `.la' library or `.lo' object file.
892
1245
# This function is only a basic sanity check; it will hardly flush out
1486
##################################################
1487
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1488
##################################################
1490
# func_convert_core_file_wine_to_w32 ARG
1491
# Helper function used by file name conversion functions when $build is *nix,
1492
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
1493
# correctly configured wine environment available, with the winepath program
1494
# in $build's $PATH.
1496
# ARG is the $build file name to be converted to w32 format.
1497
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
1498
# be empty on error (or when ARG is empty)
1499
func_convert_core_file_wine_to_w32 ()
1502
func_convert_core_file_wine_to_w32_result="$1"
1503
if test -n "$1"; then
1504
# Unfortunately, winepath does not exit with a non-zero error code, so we
1505
# are forced to check the contents of stdout. On the other hand, if the
1506
# command is not found, the shell will set an exit code of 127 and print
1507
# *an error message* to stdout. So we must check for both error code of
1508
# zero AND non-empty stdout, which explains the odd construction:
1509
func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1510
if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1511
func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1512
$SED -e "$lt_sed_naive_backslashify"`
1514
func_convert_core_file_wine_to_w32_result=
1518
# end: func_convert_core_file_wine_to_w32
1521
# func_convert_core_path_wine_to_w32 ARG
1522
# Helper function used by path conversion functions when $build is *nix, and
1523
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1524
# configured wine environment available, with the winepath program in $build's
1525
# $PATH. Assumes ARG has no leading or trailing path separator characters.
1527
# ARG is path to be converted from $build format to win32.
1528
# Result is available in $func_convert_core_path_wine_to_w32_result.
1529
# Unconvertible file (directory) names in ARG are skipped; if no directory names
1530
# are convertible, then the result may be empty.
1531
func_convert_core_path_wine_to_w32 ()
1534
# unfortunately, winepath doesn't convert paths, only file names
1535
func_convert_core_path_wine_to_w32_result=""
1536
if test -n "$1"; then
1539
for func_convert_core_path_wine_to_w32_f in $1; do
1541
func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1542
if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1543
if test -z "$func_convert_core_path_wine_to_w32_result"; then
1544
func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1546
func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1553
# end: func_convert_core_path_wine_to_w32
1556
# func_cygpath ARGS...
1557
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1558
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1559
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1560
# (2), returns the Cygwin file name or path in func_cygpath_result (input
1561
# file name or path is assumed to be in w32 format, as previously converted
1562
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
1563
# or path in func_cygpath_result (input file name or path is assumed to be in
1564
# Cygwin format). Returns an empty string on error.
1566
# ARGS are passed to cygpath, with the last one being the file name or path to
1569
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1570
# environment variable; do not put it in $PATH.
1574
if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1575
func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1576
if test "$?" -ne 0; then
1577
# on failure, ensure result is empty
1578
func_cygpath_result=
1581
func_cygpath_result=
1582
func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1588
# func_convert_core_msys_to_w32 ARG
1589
# Convert file name or path ARG from MSYS format to w32 format. Return
1590
# result in func_convert_core_msys_to_w32_result.
1591
func_convert_core_msys_to_w32 ()
1594
# awkward: cmd appends spaces to result
1595
func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1596
$SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1598
#end: func_convert_core_msys_to_w32
1601
# func_convert_file_check ARG1 ARG2
1602
# Verify that ARG1 (a file name in $build format) was converted to $host
1603
# format in ARG2. Otherwise, emit an error message, but continue (resetting
1604
# func_to_host_file_result to ARG1).
1605
func_convert_file_check ()
1608
if test -z "$2" && test -n "$1" ; then
1609
func_error "Could not determine host file name corresponding to"
1611
func_error "Continuing, but uninstalled executables may not work."
1613
func_to_host_file_result="$1"
1616
# end func_convert_file_check
1619
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1620
# Verify that FROM_PATH (a path in $build format) was converted to $host
1621
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1622
# func_to_host_file_result to a simplistic fallback value (see below).
1623
func_convert_path_check ()
1626
if test -z "$4" && test -n "$3"; then
1627
func_error "Could not determine the host path corresponding to"
1629
func_error "Continuing, but uninstalled executables may not work."
1630
# Fallback. This is a deliberately simplistic "conversion" and
1631
# should not be "improved". See libtool.info.
1632
if test "x$1" != "x$2"; then
1633
lt_replace_pathsep_chars="s|$1|$2|g"
1634
func_to_host_path_result=`echo "$3" |
1635
$SED -e "$lt_replace_pathsep_chars"`
1637
func_to_host_path_result="$3"
1641
# end func_convert_path_check
1644
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1645
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1646
# and appending REPL if ORIG matches BACKPAT.
1647
func_convert_path_front_back_pathsep ()
1651
$1 ) func_to_host_path_result="$3$func_to_host_path_result"
1655
$2 ) func_append func_to_host_path_result "$3"
1659
# end func_convert_path_front_back_pathsep
1662
##################################################
1663
# $build to $host FILE NAME CONVERSION FUNCTIONS #
1664
##################################################
1665
# invoked via `$to_host_file_cmd ARG'
1667
# In each case, ARG is the path to be converted from $build to $host format.
1668
# Result will be available in $func_to_host_file_result.
1671
# func_to_host_file ARG
1672
# Converts the file name ARG from $build format to $host format. Return result
1673
# in func_to_host_file_result.
1674
func_to_host_file ()
1677
$to_host_file_cmd "$1"
1679
# end func_to_host_file
1682
# func_to_tool_file ARG LAZY
1683
# converts the file name ARG from $build format to toolchain format. Return
1684
# result in func_to_tool_file_result. If the conversion in use is listed
1685
# in (the comma separated) LAZY, no conversion takes place.
1686
func_to_tool_file ()
1690
*,"$to_tool_file_cmd",*)
1691
func_to_tool_file_result=$1
1694
$to_tool_file_cmd "$1"
1695
func_to_tool_file_result=$func_to_host_file_result
1699
# end func_to_tool_file
1702
# func_convert_file_noop ARG
1703
# Copy ARG to func_to_host_file_result.
1704
func_convert_file_noop ()
1706
func_to_host_file_result="$1"
1708
# end func_convert_file_noop
1711
# func_convert_file_msys_to_w32 ARG
1712
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1713
# conversion to w32 is not available inside the cwrapper. Returns result in
1714
# func_to_host_file_result.
1715
func_convert_file_msys_to_w32 ()
1718
func_to_host_file_result="$1"
1719
if test -n "$1"; then
1720
func_convert_core_msys_to_w32 "$1"
1721
func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1723
func_convert_file_check "$1" "$func_to_host_file_result"
1725
# end func_convert_file_msys_to_w32
1728
# func_convert_file_cygwin_to_w32 ARG
1729
# Convert file name ARG from Cygwin to w32 format. Returns result in
1730
# func_to_host_file_result.
1731
func_convert_file_cygwin_to_w32 ()
1734
func_to_host_file_result="$1"
1735
if test -n "$1"; then
1736
# because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1737
# LT_CYGPATH in this case.
1738
func_to_host_file_result=`cygpath -m "$1"`
1740
func_convert_file_check "$1" "$func_to_host_file_result"
1742
# end func_convert_file_cygwin_to_w32
1745
# func_convert_file_nix_to_w32 ARG
1746
# Convert file name ARG from *nix to w32 format. Requires a wine environment
1747
# and a working winepath. Returns result in func_to_host_file_result.
1748
func_convert_file_nix_to_w32 ()
1751
func_to_host_file_result="$1"
1752
if test -n "$1"; then
1753
func_convert_core_file_wine_to_w32 "$1"
1754
func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1756
func_convert_file_check "$1" "$func_to_host_file_result"
1758
# end func_convert_file_nix_to_w32
1761
# func_convert_file_msys_to_cygwin ARG
1762
# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1763
# Returns result in func_to_host_file_result.
1764
func_convert_file_msys_to_cygwin ()
1767
func_to_host_file_result="$1"
1768
if test -n "$1"; then
1769
func_convert_core_msys_to_w32 "$1"
1770
func_cygpath -u "$func_convert_core_msys_to_w32_result"
1771
func_to_host_file_result="$func_cygpath_result"
1773
func_convert_file_check "$1" "$func_to_host_file_result"
1775
# end func_convert_file_msys_to_cygwin
1778
# func_convert_file_nix_to_cygwin ARG
1779
# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
1780
# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
1781
# in func_to_host_file_result.
1782
func_convert_file_nix_to_cygwin ()
1785
func_to_host_file_result="$1"
1786
if test -n "$1"; then
1787
# convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1788
func_convert_core_file_wine_to_w32 "$1"
1789
func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1790
func_to_host_file_result="$func_cygpath_result"
1792
func_convert_file_check "$1" "$func_to_host_file_result"
1794
# end func_convert_file_nix_to_cygwin
1797
#############################################
1798
# $build to $host PATH CONVERSION FUNCTIONS #
1799
#############################################
1800
# invoked via `$to_host_path_cmd ARG'
1802
# In each case, ARG is the path to be converted from $build to $host format.
1803
# The result will be available in $func_to_host_path_result.
1805
# Path separators are also converted from $build format to $host format. If
1806
# ARG begins or ends with a path separator character, it is preserved (but
1807
# converted to $host format) on output.
1809
# All path conversion functions are named using the following convention:
1810
# file name conversion function : func_convert_file_X_to_Y ()
1811
# path conversion function : func_convert_path_X_to_Y ()
1812
# where, for any given $build/$host combination the 'X_to_Y' value is the
1813
# same. If conversion functions are added for new $build/$host combinations,
1814
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
1818
# func_init_to_host_path_cmd
1819
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
1820
# appropriate value, based on the value of $to_host_file_cmd.
1822
func_init_to_host_path_cmd ()
1825
if test -z "$to_host_path_cmd"; then
1826
func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1827
to_host_path_cmd="func_convert_path_${func_stripname_result}"
1832
# func_to_host_path ARG
1833
# Converts the path ARG from $build format to $host format. Return result
1834
# in func_to_host_path_result.
1835
func_to_host_path ()
1838
func_init_to_host_path_cmd
1839
$to_host_path_cmd "$1"
1841
# end func_to_host_path
1844
# func_convert_path_noop ARG
1845
# Copy ARG to func_to_host_path_result.
1846
func_convert_path_noop ()
1848
func_to_host_path_result="$1"
1850
# end func_convert_path_noop
1853
# func_convert_path_msys_to_w32 ARG
1854
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1855
# conversion to w32 is not available inside the cwrapper. Returns result in
1856
# func_to_host_path_result.
1857
func_convert_path_msys_to_w32 ()
1860
func_to_host_path_result="$1"
1861
if test -n "$1"; then
1862
# Remove leading and trailing path separator characters from ARG. MSYS
1863
# behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1864
# and winepath ignores them completely.
1865
func_stripname : : "$1"
1866
func_to_host_path_tmp1=$func_stripname_result
1867
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1868
func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1869
func_convert_path_check : ";" \
1870
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1871
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1874
# end func_convert_path_msys_to_w32
1877
# func_convert_path_cygwin_to_w32 ARG
1878
# Convert path ARG from Cygwin to w32 format. Returns result in
1879
# func_to_host_file_result.
1880
func_convert_path_cygwin_to_w32 ()
1883
func_to_host_path_result="$1"
1884
if test -n "$1"; then
1885
# See func_convert_path_msys_to_w32:
1886
func_stripname : : "$1"
1887
func_to_host_path_tmp1=$func_stripname_result
1888
func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1889
func_convert_path_check : ";" \
1890
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1891
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1894
# end func_convert_path_cygwin_to_w32
1897
# func_convert_path_nix_to_w32 ARG
1898
# Convert path ARG from *nix to w32 format. Requires a wine environment and
1899
# a working winepath. Returns result in func_to_host_file_result.
1900
func_convert_path_nix_to_w32 ()
1903
func_to_host_path_result="$1"
1904
if test -n "$1"; then
1905
# See func_convert_path_msys_to_w32:
1906
func_stripname : : "$1"
1907
func_to_host_path_tmp1=$func_stripname_result
1908
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1909
func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1910
func_convert_path_check : ";" \
1911
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1912
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1915
# end func_convert_path_nix_to_w32
1918
# func_convert_path_msys_to_cygwin ARG
1919
# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1920
# Returns result in func_to_host_file_result.
1921
func_convert_path_msys_to_cygwin ()
1924
func_to_host_path_result="$1"
1925
if test -n "$1"; then
1926
# See func_convert_path_msys_to_w32:
1927
func_stripname : : "$1"
1928
func_to_host_path_tmp1=$func_stripname_result
1929
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1930
func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1931
func_to_host_path_result="$func_cygpath_result"
1932
func_convert_path_check : : \
1933
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1934
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1937
# end func_convert_path_msys_to_cygwin
1940
# func_convert_path_nix_to_cygwin ARG
1941
# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
1942
# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
1943
# func_to_host_file_result.
1944
func_convert_path_nix_to_cygwin ()
1947
func_to_host_path_result="$1"
1948
if test -n "$1"; then
1949
# Remove leading and trailing path separator characters from
1950
# ARG. msys behavior is inconsistent here, cygpath turns them
1951
# into '.;' and ';.', and winepath ignores them completely.
1952
func_stripname : : "$1"
1953
func_to_host_path_tmp1=$func_stripname_result
1954
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1955
func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1956
func_to_host_path_result="$func_cygpath_result"
1957
func_convert_path_check : : \
1958
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1959
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1962
# end func_convert_path_nix_to_cygwin
1100
1965
# func_mode_compile arg...
1101
1966
func_mode_compile ()
1795
2730
# Exit here if they wanted silent mode.
1796
2731
$opt_silent && exit $EXIT_SUCCESS
1798
$ECHO "X----------------------------------------------------------------------" | $Xsed
1799
$ECHO "Libraries have been installed in:"
1800
for libdir in $libdirs; do
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:"
1808
if test -n "$shlibpath_var"; then
1809
$ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
1810
$ECHO " during execution"
1812
if test -n "$runpath_var"; then
1813
$ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
1814
$ECHO " during linking"
1816
if test -n "$hardcode_libdir_flag_spec"; then
1818
eval flag=\"$hardcode_libdir_flag_spec\"
1820
$ECHO " - use the \`$flag' linker flag"
1822
if test -n "$admincmds"; then
1823
$ECHO " - have your system administrator run these commands:$admincmds"
1825
if test -f /etc/ld.so.conf; then
1826
$ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1830
$ECHO "See any operating system documentation about shared libraries for"
1832
solaris2.[6789]|solaris2.1[0-9])
1833
$ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1837
$ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
1840
$ECHO "X----------------------------------------------------------------------" | $Xsed
2733
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2734
echo "----------------------------------------------------------------------"
2735
echo "Libraries have been installed in:"
2736
for libdir in $libdirs; do
2740
echo "If you ever happen to want to link against installed libraries"
2741
echo "in a given directory, LIBDIR, you must either use libtool, and"
2742
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2743
echo "flag during linking and do at least one of the following:"
2744
if test -n "$shlibpath_var"; then
2745
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2746
echo " during execution"
2748
if test -n "$runpath_var"; then
2749
echo " - add LIBDIR to the \`$runpath_var' environment variable"
2750
echo " during linking"
2752
if test -n "$hardcode_libdir_flag_spec"; then
2754
eval flag=\"$hardcode_libdir_flag_spec\"
2756
$ECHO " - use the \`$flag' linker flag"
2758
if test -n "$admincmds"; then
2759
$ECHO " - have your system administrator run these commands:$admincmds"
2761
if test -f /etc/ld.so.conf; then
2762
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2766
echo "See any operating system documentation about shared libraries for"
2768
solaris2.[6789]|solaris2.1[0-9])
2769
echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2773
echo "more information, such as the ld(1) and ld.so(8) manual pages."
2776
echo "----------------------------------------------------------------------"
1841
2778
exit $EXIT_SUCCESS
1844
test "$mode" = finish && func_mode_finish ${1+"$@"}
2781
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
1847
2784
# func_mode_install arg...
2590
3598
$ECHO "$win32_libid_type"
3601
# func_cygming_dll_for_implib ARG
3603
# Platform-specific function to extract the
3604
# name of the DLL associated with the specified
3605
# import library ARG.
3606
# Invoked by eval'ing the libtool variable
3607
# $sharedlib_from_linklib_cmd
3608
# Result is available in the variable
3609
# $sharedlib_from_linklib_result
3610
func_cygming_dll_for_implib ()
3613
sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3616
# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3618
# The is the core of a fallback implementation of a
3619
# platform-specific function to extract the name of the
3620
# DLL associated with the specified import library LIBNAME.
3622
# SECTION_NAME is either .idata$6 or .idata$7, depending
3623
# on the platform and compiler that created the implib.
3625
# Echos the name of the DLL associated with the
3626
# specified import library.
3627
func_cygming_dll_for_implib_fallback_core ()
3630
match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3631
$OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3632
$SED '/^Contents of section '"$match_literal"':/{
3633
# Place marker at beginning of archive member dllname section
3638
# These lines can sometimes be longer than 43 characters, but
3639
# are always uninteresting
3640
/:[ ]*file format pe[i]\{,1\}-/d
3641
/^In archive [^:]*:/d
3642
# Ensure marker is printed
3644
# Remove all lines with less than 43 characters
3646
# From remaining lines, remove first 43 characters
3649
# Join marker and all lines until next marker into a single line
3650
/^====MARK====/ b para
3659
# Remove trailing dots and whitespace
3663
# we now have a list, one entry per line, of the stringified
3664
# contents of the appropriate section of all members of the
3665
# archive which possess that section. Heuristic: eliminate
3666
# all those which have a first or second character that is
3667
# a '.' (that is, objdump's representation of an unprintable
3668
# character.) This should work for all archives with less than
3669
# 0x302f exports -- but will fail for DLLs whose name actually
3670
# begins with a literal '.' or a single character followed by
3673
# Of those that remain, print the first one.
3674
$SED -e '/^\./d;/^.\./d;q'
3677
# func_cygming_gnu_implib_p ARG
3678
# This predicate returns with zero status (TRUE) if
3679
# ARG is a GNU/binutils-style import library. Returns
3680
# with nonzero status (FALSE) otherwise.
3681
func_cygming_gnu_implib_p ()
3684
func_to_tool_file "$1" func_convert_file_msys_to_w32
3685
func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
3686
test -n "$func_cygming_gnu_implib_tmp"
3689
# func_cygming_ms_implib_p ARG
3690
# This predicate returns with zero status (TRUE) if
3691
# ARG is an MS-style import library. Returns
3692
# with nonzero status (FALSE) otherwise.
3693
func_cygming_ms_implib_p ()
3696
func_to_tool_file "$1" func_convert_file_msys_to_w32
3697
func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3698
test -n "$func_cygming_ms_implib_tmp"
3701
# func_cygming_dll_for_implib_fallback ARG
3702
# Platform-specific function to extract the
3703
# name of the DLL associated with the specified
3704
# import library ARG.
3706
# This fallback implementation is for use when $DLLTOOL
3707
# does not support the --identify-strict option.
3708
# Invoked by eval'ing the libtool variable
3709
# $sharedlib_from_linklib_cmd
3710
# Result is available in the variable
3711
# $sharedlib_from_linklib_result
3712
func_cygming_dll_for_implib_fallback ()
3715
if func_cygming_gnu_implib_p "$1" ; then
3716
# binutils import library
3717
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3718
elif func_cygming_ms_implib_p "$1" ; then
3719
# ms-generated import library
3720
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3723
sharedlib_from_linklib_result=""
2595
3728
# func_extract_an_archive dir oldlib
2750
3898
# When we are sourced in execute mode, \$file and \$ECHO are already set.
2751
3899
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.
3902
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3905
# A function that is used when there is no print builtin or printf.
3906
func_fallback_echo ()
3908
eval 'cat <<_LTECHO_EOF
3915
# Very basic option parsing. These options are (a) specific to
3916
# the libtool wrapper, (b) are identical between the wrapper
3917
# /script/ and the wrapper /executable/ which is used only on
3918
# windows platforms, and (c) all begin with the string "--lt-"
3919
# (application programs are unlikely to have options which match
3922
# There are only two supported options: --lt-debug and
3923
# --lt-dump-script. There is, deliberately, no --lt-help.
3925
# The first argument to this parsing function should be the
3926
# script's $0 value, followed by "$@".
3928
func_parse_lt_options ()
3934
case \"\$lt_opt\" in
3935
--lt-debug) lt_option_debug=1 ;;
3937
lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3938
test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3939
lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3940
cat \"\$lt_dump_D/\$lt_dump_F\"
3944
\$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3950
# Print the debug banner immediately:
3951
if test -n \"\$lt_option_debug\"; then
3952
echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3956
# Used when --lt-debug. Prints its arguments to stdout
3957
# (redirection is the responsibility of the caller)
3958
func_lt_dump_args ()
3963
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3964
lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3968
# Core function for launching the target application
3969
func_exec_program_core ()
3973
# Backslashes separate directories on plain windows
3974
*-*-mingw | *-*-os2* | *-cegcc*)
3976
if test -n \"\$lt_option_debug\"; then
3977
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3978
func_lt_dump_args \${1+\"\$@\"} 1>&2
3980
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3986
if test -n \"\$lt_option_debug\"; then
3987
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3988
func_lt_dump_args \${1+\"\$@\"} 1>&2
3990
exec \"\$progdir/\$program\" \${1+\"\$@\"}
3995
\$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3999
# A function to encapsulate launching the target application
4000
# Strips options in the --lt-* namespace from \$@ and
4001
# launches target application with the remaining arguments.
4002
func_exec_program ()
4010
*) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
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+\"\$@\"}
4015
func_exec_program_core \${1+\"\$@\"}
4019
func_parse_lt_options \"\$0\" \${1+\"\$@\"}
2769
4021
# Find the directory that this script lives in.
2770
thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4022
thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
2771
4023
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2773
4025
# Follow symbolic links until we get to the real thisdir.
2774
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4026
file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
2775
4027
while test -n \"\$file\"; do
2776
destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4028
destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
2778
4030
# If there was a directory component, then change thisdir.
2779
4031
if test \"x\$destdir\" != \"x\$file\"; then
2878
4125
# Some systems cannot cope with colon-terminated $shlibpath_var
2879
4126
# The second colon is a workaround for a bug in BeOS R4 sed
2880
$shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4127
$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
2882
4129
export $shlibpath_var
2886
# fixup the dll searchpath if we need to.
2887
if test -n "$dllsearchpath"; then
2889
# Add the dll search path components to the executable PATH
2890
PATH=$dllsearchpath:\$PATH
2895
4134
if test \"\$libtool_execute_magic\" != \"$magic\"; then
2896
4135
# 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
4136
func_exec_program \${1+\"\$@\"}
2917
4139
# The program doesn't exist.
2918
4140
\$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2919
4141
\$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2920
$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4142
\$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
# func_to_host_path arg
2959
# Convert paths to host format when used with build tools.
2960
# Intended for use with "native" mingw (where libtool itself
2961
# is running under the msys shell), or in the following cross-
2962
# build environments:
2964
# mingw (msys) mingw [e.g. native]
2967
# where wine is equipped with the `winepath' executable.
2968
# In the native mingw case, the (msys) shell automatically
2969
# converts paths for any non-msys applications it launches,
2970
# but that facility isn't available from inside the cwrapper.
2971
# Similar accommodations are necessary for $host mingw and
2972
# $build cygwin. Calling this function does no harm for other
2973
# $host/$build combinations not listed above.
2975
# ARG is the path (on $build) that should be converted to
2976
# the proper representation for $host. The result is stored
2977
# in $func_to_host_path_result.
2978
func_to_host_path ()
2980
func_to_host_path_result="$1"
2981
if test -n "$1" ; then
2984
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
2986
*mingw* ) # actually, msys
2987
# awkward: cmd appends spaces to result
2988
lt_sed_strip_trailing_spaces="s/[ ]*\$//"
2989
func_to_host_path_tmp1=`( cmd //c echo "$1" |\
2990
$SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
2991
func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2992
$SED -e "$lt_sed_naive_backslashify"`
2995
func_to_host_path_tmp1=`cygpath -w "$1"`
2996
func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2997
$SED -e "$lt_sed_naive_backslashify"`
3000
# Unfortunately, winepath does not exit with a non-zero
3001
# error code, so we are forced to check the contents of
3002
# stdout. On the other hand, if the command is not
3003
# found, the shell will set an exit code of 127 and print
3004
# *an error message* to stdout. So we must check for both
3005
# error code of zero AND non-empty stdout, which explains
3006
# the odd construction:
3007
func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3008
if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3009
func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3010
$SED -e "$lt_sed_naive_backslashify"`
3012
# Allow warning below.
3013
func_to_host_path_result=""
3017
if test -z "$func_to_host_path_result" ; then
3018
func_error "Could not determine host path corresponding to"
3020
func_error "Continuing, but uninstalled executables may not work."
3022
func_to_host_path_result="$1"
3028
# end: func_to_host_path
3030
# func_to_host_pathlist arg
3032
# Convert pathlists to host format when used with build tools.
3033
# See func_to_host_path(), above. This function supports the
3034
# following $build/$host combinations (but does no harm for
3035
# combinations not listed here):
3037
# mingw (msys) mingw [e.g. native]
3041
# Path separators are also converted from $build format to
3042
# $host format. If ARG begins or ends with a path separator
3043
# character, it is preserved (but converted to $host format)
3046
# ARG is a pathlist (on $build) that should be converted to
3047
# the proper representation on $host. The result is stored
3048
# in $func_to_host_pathlist_result.
3049
func_to_host_pathlist ()
3051
func_to_host_pathlist_result="$1"
3052
if test -n "$1" ; then
3055
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3056
# Remove leading and trailing path separator characters from
3057
# ARG. msys behavior is inconsistent here, cygpath turns them
3058
# 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|:*$||'`
3065
*mingw* ) # Actually, msys.
3066
# 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"`
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" |\
3076
$SED -e "$lt_sed_naive_backslashify"`
3079
# unfortunately, winepath doesn't convert pathlists
3080
func_to_host_pathlist_result=""
3081
func_to_host_pathlist_oldIFS=$IFS
3083
for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
3084
IFS=$func_to_host_pathlist_oldIFS
3085
if test -n "$func_to_host_pathlist_f" ; then
3086
func_to_host_path "$func_to_host_pathlist_f"
3087
if test -n "$func_to_host_path_result" ; then
3088
if test -z "$func_to_host_pathlist_result" ; then
3089
func_to_host_pathlist_result="$func_to_host_path_result"
3091
func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
3097
IFS=$func_to_host_pathlist_oldIFS
3100
if test -z "$func_to_host_pathlist_result" ; then
3101
func_error "Could not determine the host path(s) corresponding to"
3103
func_error "Continuing, but uninstalled executables may not work."
3104
# Fallback. This may break if $1 contains DOS-style drive
3105
# specifications. The fix is not to complicate the expression
3106
# below, but for the user to provide a working wine installation
3107
# with winepath so that path translation in the cross-to-mingw
3108
# case works properly.
3109
lt_replace_pathsep_nix_to_dos="s|:|;|g"
3110
func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
3111
$SED -e "$lt_replace_pathsep_nix_to_dos"`
3113
# Now, add the leading and trailing path separators back
3115
:* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3119
*: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
3126
# end: func_to_host_pathlist
3128
4150
# func_emit_cwrapperexe_src
3129
4151
# emit the source code for a wrapper executable on stdout
3479
4519
lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3480
4520
lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4521
/* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4522
be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4523
because on Windows, both *_VARNAMEs are PATH but uninstalled
4524
libraries must come first. */
4525
lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3481
4526
lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3482
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>")));
4528
lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4529
nonnull (lt_argv_zero));
3552
4530
for (i = 0; i < newargc; i++)
3554
LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
4532
lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4533
i, nonnull (newargz[i]));