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
# --tag=TAG use configuration variables from tag TAG
45
# -v, --verbose print more informational messages than default
46
# --no-verbose don't print the extra informational messages
47
# --version print version information
48
# -h, --help, --help-all print short, long, or detailed help message
47
50
# 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
52
# clean remove files from the build directory
53
# compile compile a source file into a libtool object
54
# execute automatically set library path, then run a program
55
# finish complete the installation of libtool libraries
56
# install install libraries or executables
57
# link create a library or an executable
58
# uninstall remove libraries from an installed directory
57
# MODE-ARGS vary depending on the MODE.
60
# MODE-ARGS vary depending on the MODE. When passed as first option,
61
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
58
62
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
60
64
# When reporting a bug, please describe a test case to reproduce it and
61
65
# 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
70
# compiler flags: $LTCFLAGS
71
# linker: $LD (gnu? $with_gnu_ld)
72
# $progname: (GNU libtool) 2.4
73
# automake: $automake_version
74
# autoconf: $autoconf_version
72
76
# Report bugs to <bug-libtool@gnu.org>.
77
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
78
# General help using GNU software: <http://www.gnu.org/gethelp/>.
78
package_revision=1.3017
84
package_revision=1.3293
80
86
# Be Bourne compatible
81
87
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
158
199
# those functions but instead duplicate the functionality here.
159
200
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
202
# Extract subdirectory from the argument.
203
func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
204
if test "X$func_dirname_result" = "X${1}"; then
205
func_dirname_result="${3}"
207
func_dirname_result="$func_dirname_result${2}"
209
func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
210
} # func_dirname_and_basename may be replaced by extended shell implementation
213
# func_stripname prefix suffix name
214
# strip PREFIX and SUFFIX off of NAME.
215
# PREFIX and SUFFIX must not contain globbing or regex special
216
# characters, hashes, percent signs, but SUFFIX may contain a leading
217
# dot (in which case that matches only a dot).
218
# func_strip_suffix prefix name
222
.*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
223
*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
225
} # func_stripname may be replaced by extended shell implementation
228
# These SED scripts presuppose an absolute path with a trailing slash.
229
pathcar='s,^/\([^/]*\).*$,\1,'
230
pathcdr='s,^/[^/]*,,'
231
removedotparts=':dotsl
235
collapseslashes='s@/\{1,\}@/@g'
236
finalslash='s,/*$,/,'
238
# func_normal_abspath PATH
239
# Remove doubled-up and trailing slashes, "." path components,
240
# and cancel out any ".." path components in PATH after making
241
# it an absolute path.
242
# value returned in "$func_normal_abspath_result"
243
func_normal_abspath ()
245
# Start from root dir and reassemble the path.
246
func_normal_abspath_result=
247
func_normal_abspath_tpath=$1
248
func_normal_abspath_altnamespace=
249
case $func_normal_abspath_tpath in
251
# Empty path, that just means $cwd.
252
func_stripname '' '/' "`pwd`"
253
func_normal_abspath_result=$func_stripname_result
256
# The next three entries are used to spot a run of precisely
257
# two leading slashes without using negated character classes;
258
# we take advantage of case's first-match behaviour.
260
# Unusual form of absolute path, do nothing.
263
# Not necessarily an ordinary path; POSIX reserves leading '//'
264
# and for example Cygwin uses it to access remote file shares
265
# over CIFS/SMB, so we conserve a leading double slash if found.
266
func_normal_abspath_altnamespace=/
269
# Absolute path, do nothing.
272
# Relative path, prepend $cwd.
273
func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
276
# Cancel out all the simple stuff to save iterations. We also want
277
# the path to end with a slash for ease of parsing, so make sure
278
# there is one (and only one) here.
279
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
280
-e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
282
# Processed it all yet?
283
if test "$func_normal_abspath_tpath" = / ; then
284
# If we ascended to the root using ".." the result may be empty now.
285
if test -z "$func_normal_abspath_result" ; then
286
func_normal_abspath_result=/
290
func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
292
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
294
# Figure out what to do with it
295
case $func_normal_abspath_tcomponent in
297
# Trailing empty path component, ignore it.
300
# Parent dir; strip last assembled component from result.
301
func_dirname "$func_normal_abspath_result"
302
func_normal_abspath_result=$func_dirname_result
305
# Actual path component, append it.
306
func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
310
# Restore leading double-slash if one was found on entry.
311
func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
314
# func_relative_path SRCDIR DSTDIR
315
# generates a relative path from SRCDIR to DSTDIR, with a trailing
316
# slash if non-empty, suitable for immediately appending a filename
317
# without needing to append a separator.
318
# value returned in "$func_relative_path_result"
319
func_relative_path ()
321
func_relative_path_result=
322
func_normal_abspath "$1"
323
func_relative_path_tlibdir=$func_normal_abspath_result
324
func_normal_abspath "$2"
325
func_relative_path_tbindir=$func_normal_abspath_result
327
# Ascend the tree starting from libdir
329
# check if we have found a prefix of bindir
330
case $func_relative_path_tbindir in
331
$func_relative_path_tlibdir)
332
# found an exact match
333
func_relative_path_tcancelled=
336
$func_relative_path_tlibdir*)
337
# found a matching prefix
338
func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
339
func_relative_path_tcancelled=$func_stripname_result
340
if test -z "$func_relative_path_result"; then
341
func_relative_path_result=.
346
func_dirname $func_relative_path_tlibdir
347
func_relative_path_tlibdir=${func_dirname_result}
348
if test "x$func_relative_path_tlibdir" = x ; then
349
# Have to descend all the way to the root!
350
func_relative_path_result=../$func_relative_path_result
351
func_relative_path_tcancelled=$func_relative_path_tbindir
354
func_relative_path_result=../$func_relative_path_result
359
# Now calculate path; take care to avoid doubling-up slashes.
360
func_stripname '' '/' "$func_relative_path_result"
361
func_relative_path_result=$func_stripname_result
362
func_stripname '/' '/' "$func_relative_path_tcancelled"
363
if test "x$func_stripname_result" != x ; then
364
func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
367
# Normalisation. If bindir is libdir, return empty string,
368
# else relative path ending with a slash; either way, target
369
# file name can be directly appended.
370
if test ! -z "$func_relative_path_result"; then
371
func_stripname './' '' "$func_relative_path_result/"
372
func_relative_path_result=$func_stripname_result
180
376
# 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
377
func_dirname_and_basename "$progpath"
184
378
progname=$func_basename_result
186
-*) progname=./$progname ;;
189
380
# Make sure we have an absolute path for reexecution:
190
381
case $progpath in
547
791
func_missing_arg ()
549
func_error "missing argument for $1"
795
func_error "missing argument for $1."
800
# func_split_short_opt shortopt
801
# Set func_split_short_opt_name and func_split_short_opt_arg shell
802
# variables after splitting SHORTOPT after the 2nd character.
803
func_split_short_opt ()
805
my_sed_short_opt='1s/^\(..\).*$/\1/;q'
806
my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
808
func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
809
func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
810
} # func_split_short_opt may be replaced by extended shell implementation
813
# func_split_long_opt longopt
814
# Set func_split_long_opt_name and func_split_long_opt_arg shell
815
# variables after splitting LONGOPT at the `=' sign.
816
func_split_long_opt ()
818
my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
819
my_sed_long_arg='1s/^--[^=]*=//'
821
func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
822
func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
823
} # 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
831
magic="%%%MAGIC variable%%%"
584
832
magic_exe="%%%MAGIC EXE variable%%%"
586
834
# Global variables.
591
837
lo2o="s/\\.lo\$/.${objext}/"
592
838
o2lo="s/\\.${objext}\$/.lo/"
593
839
extracted_archives=
594
840
extracted_serial=0
597
opt_duplicate_deps=false
601
842
# If this variable is set in any of the actions, the command in it
602
843
# will be execed at the end. This prevents here-documents from being
603
844
# left over by shells.
847
# func_append var value
848
# Append VALUE to the end of shell variable VAR.
851
eval "${1}=\$${1}\${2}"
852
} # func_append may be replaced by extended shell implementation
854
# func_append_quoted var value
855
# Quote VALUE and append to the end of shell variable VAR, separated
857
func_append_quoted ()
859
func_quote_for_eval "${2}"
860
eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
861
} # func_append_quoted may be replaced by extended shell implementation
864
# func_arith arithmetic-term...
867
func_arith_result=`expr "${@}"`
868
} # func_arith may be replaced by extended shell implementation
872
# STRING may not start with a hyphen.
875
func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
876
} # func_len may be replaced by extended shell implementation
882
func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
883
} # func_lo2o may be replaced by extended shell implementation
886
# func_xform libobj-or-source
889
func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
890
} # func_xform may be replaced by extended shell implementation
606
893
# func_fatal_configuration arg...
607
894
# Echo program name prefixed message to standard error, followed by
608
895
# a configuration failure hint, and exit.
1018
# Shorthand for --mode=foo, only valid as the first argument
1021
shift; set dummy --mode clean ${1+"$@"}; shift
1023
compile|compil|compi|comp|com|co|c)
1024
shift; set dummy --mode compile ${1+"$@"}; shift
1026
execute|execut|execu|exec|exe|ex|e)
1027
shift; set dummy --mode execute ${1+"$@"}; shift
1029
finish|finis|fini|fin|fi|f)
1030
shift; set dummy --mode finish ${1+"$@"}; shift
1032
install|instal|insta|inst|ins|in|i)
1033
shift; set dummy --mode install ${1+"$@"}; shift
1036
shift; set dummy --mode link ${1+"$@"}; shift
1038
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1039
shift; set dummy --mode uninstall ${1+"$@"}; shift
1049
opt_preserve_dup_deps=false
1060
# Parse options once, thoroughly. This comes as soon as possible in the
1061
# script to make things like `--version' happen as quickly as we can.
1063
# this just eases exit handling
1064
while test $# -gt 0; do
1068
--debug|-x) opt_debug='set -x'
1069
func_echo "enabling shell trace mode"
1072
--dry-run|--dryrun|-n)
1081
opt_dlopen="${opt_dlopen+$opt_dlopen
1085
--preserve-dup-deps)
1086
opt_preserve_dup_deps=:
1094
set dummy --mode finish ${1+"$@"}; shift
1101
opt_help=': help-all'
1104
test $# = 0 && func_missing_arg $opt && break
1108
# Valid mode arguments:
1109
clean|compile|execute|finish|install|link|relink|uninstall) ;;
1111
# Catch anything else as an error
1112
*) func_error "invalid argument for $opt"
1119
--no-silent|--no-quiet)
1121
func_append preserve_args " $opt"
1125
func_append preserve_args " $opt"
1129
func_append preserve_args " $opt"
1134
func_append preserve_args " $opt"
1138
test $# = 0 && func_missing_arg $opt && break
1141
func_append preserve_args " $opt $optarg"
1142
func_enable_tag "$optarg"
1146
-\?|-h) func_usage ;;
1147
--help) func_help ;;
1148
--version) func_version ;;
1150
# Separate optargs to long options:
1152
func_split_long_opt "$opt"
1153
set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1157
# Separate non-argument short options:
1159
func_split_short_opt "$opt"
1160
set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1165
-*) func_fatal_help "unrecognized option \`$opt'" ;;
1166
*) set dummy "$opt" ${1+"$@"}; shift; break ;;
1172
# save first non-option argument
1173
if test "$#" -gt 0; then
1179
test "$opt_debug" = : || func_append preserve_args " --debug"
1182
*cygwin* | *mingw* | *pw32* | *cegcc*)
1183
# don't eliminate duplications in $postdeps and $predeps
1184
opt_duplicate_compiler_generated_deps=:
1187
opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1192
# Sanity checks first:
1193
func_check_version_match
1195
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1196
func_fatal_configuration "not configured to build any kind of library"
1200
eval std_shrext=\"$shrext_cmds\"
1202
# Only execute mode is allowed to have -dlopen flags.
1203
if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1204
func_error "unrecognized option \`-dlopen'"
1209
# Change the help message to a mode-specific one.
1210
generic_help="$help"
1211
help="Try \`$progname --help --mode=$opt_mode' for more information."
1215
# Bail if the options were screwed
1216
$exit_cmd $EXIT_FAILURE
858
1222
## ----------- ##
860
1224
## ----------- ##
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."
890
1226
# func_lalib_p file
891
1227
# True iff FILE is a libtool `.la' library or `.lo' object file.
892
1228
# This function is only a basic sanity check; it will hardly flush out
1469
##################################################
1470
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1471
##################################################
1473
# func_convert_core_file_wine_to_w32 ARG
1474
# Helper function used by file name conversion functions when $build is *nix,
1475
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
1476
# correctly configured wine environment available, with the winepath program
1477
# in $build's $PATH.
1479
# ARG is the $build file name to be converted to w32 format.
1480
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
1481
# be empty on error (or when ARG is empty)
1482
func_convert_core_file_wine_to_w32 ()
1485
func_convert_core_file_wine_to_w32_result="$1"
1486
if test -n "$1"; then
1487
# Unfortunately, winepath does not exit with a non-zero error code, so we
1488
# are forced to check the contents of stdout. On the other hand, if the
1489
# command is not found, the shell will set an exit code of 127 and print
1490
# *an error message* to stdout. So we must check for both error code of
1491
# zero AND non-empty stdout, which explains the odd construction:
1492
func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1493
if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1494
func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1495
$SED -e "$lt_sed_naive_backslashify"`
1497
func_convert_core_file_wine_to_w32_result=
1501
# end: func_convert_core_file_wine_to_w32
1504
# func_convert_core_path_wine_to_w32 ARG
1505
# Helper function used by path conversion functions when $build is *nix, and
1506
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1507
# configured wine environment available, with the winepath program in $build's
1508
# $PATH. Assumes ARG has no leading or trailing path separator characters.
1510
# ARG is path to be converted from $build format to win32.
1511
# Result is available in $func_convert_core_path_wine_to_w32_result.
1512
# Unconvertible file (directory) names in ARG are skipped; if no directory names
1513
# are convertible, then the result may be empty.
1514
func_convert_core_path_wine_to_w32 ()
1517
# unfortunately, winepath doesn't convert paths, only file names
1518
func_convert_core_path_wine_to_w32_result=""
1519
if test -n "$1"; then
1522
for func_convert_core_path_wine_to_w32_f in $1; do
1524
func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1525
if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1526
if test -z "$func_convert_core_path_wine_to_w32_result"; then
1527
func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1529
func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1536
# end: func_convert_core_path_wine_to_w32
1539
# func_cygpath ARGS...
1540
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1541
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1542
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1543
# (2), returns the Cygwin file name or path in func_cygpath_result (input
1544
# file name or path is assumed to be in w32 format, as previously converted
1545
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
1546
# or path in func_cygpath_result (input file name or path is assumed to be in
1547
# Cygwin format). Returns an empty string on error.
1549
# ARGS are passed to cygpath, with the last one being the file name or path to
1552
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1553
# environment variable; do not put it in $PATH.
1557
if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1558
func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1559
if test "$?" -ne 0; then
1560
# on failure, ensure result is empty
1561
func_cygpath_result=
1564
func_cygpath_result=
1565
func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1571
# func_convert_core_msys_to_w32 ARG
1572
# Convert file name or path ARG from MSYS format to w32 format. Return
1573
# result in func_convert_core_msys_to_w32_result.
1574
func_convert_core_msys_to_w32 ()
1577
# awkward: cmd appends spaces to result
1578
func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1579
$SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1581
#end: func_convert_core_msys_to_w32
1584
# func_convert_file_check ARG1 ARG2
1585
# Verify that ARG1 (a file name in $build format) was converted to $host
1586
# format in ARG2. Otherwise, emit an error message, but continue (resetting
1587
# func_to_host_file_result to ARG1).
1588
func_convert_file_check ()
1591
if test -z "$2" && test -n "$1" ; then
1592
func_error "Could not determine host file name corresponding to"
1594
func_error "Continuing, but uninstalled executables may not work."
1596
func_to_host_file_result="$1"
1599
# end func_convert_file_check
1602
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1603
# Verify that FROM_PATH (a path in $build format) was converted to $host
1604
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1605
# func_to_host_file_result to a simplistic fallback value (see below).
1606
func_convert_path_check ()
1609
if test -z "$4" && test -n "$3"; then
1610
func_error "Could not determine the host path corresponding to"
1612
func_error "Continuing, but uninstalled executables may not work."
1613
# Fallback. This is a deliberately simplistic "conversion" and
1614
# should not be "improved". See libtool.info.
1615
if test "x$1" != "x$2"; then
1616
lt_replace_pathsep_chars="s|$1|$2|g"
1617
func_to_host_path_result=`echo "$3" |
1618
$SED -e "$lt_replace_pathsep_chars"`
1620
func_to_host_path_result="$3"
1624
# end func_convert_path_check
1627
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1628
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1629
# and appending REPL if ORIG matches BACKPAT.
1630
func_convert_path_front_back_pathsep ()
1634
$1 ) func_to_host_path_result="$3$func_to_host_path_result"
1638
$2 ) func_append func_to_host_path_result "$3"
1642
# end func_convert_path_front_back_pathsep
1645
##################################################
1646
# $build to $host FILE NAME CONVERSION FUNCTIONS #
1647
##################################################
1648
# invoked via `$to_host_file_cmd ARG'
1650
# In each case, ARG is the path to be converted from $build to $host format.
1651
# Result will be available in $func_to_host_file_result.
1654
# func_to_host_file ARG
1655
# Converts the file name ARG from $build format to $host format. Return result
1656
# in func_to_host_file_result.
1657
func_to_host_file ()
1660
$to_host_file_cmd "$1"
1662
# end func_to_host_file
1665
# func_to_tool_file ARG LAZY
1666
# converts the file name ARG from $build format to toolchain format. Return
1667
# result in func_to_tool_file_result. If the conversion in use is listed
1668
# in (the comma separated) LAZY, no conversion takes place.
1669
func_to_tool_file ()
1673
*,"$to_tool_file_cmd",*)
1674
func_to_tool_file_result=$1
1677
$to_tool_file_cmd "$1"
1678
func_to_tool_file_result=$func_to_host_file_result
1682
# end func_to_tool_file
1685
# func_convert_file_noop ARG
1686
# Copy ARG to func_to_host_file_result.
1687
func_convert_file_noop ()
1689
func_to_host_file_result="$1"
1691
# end func_convert_file_noop
1694
# func_convert_file_msys_to_w32 ARG
1695
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1696
# conversion to w32 is not available inside the cwrapper. Returns result in
1697
# func_to_host_file_result.
1698
func_convert_file_msys_to_w32 ()
1701
func_to_host_file_result="$1"
1702
if test -n "$1"; then
1703
func_convert_core_msys_to_w32 "$1"
1704
func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1706
func_convert_file_check "$1" "$func_to_host_file_result"
1708
# end func_convert_file_msys_to_w32
1711
# func_convert_file_cygwin_to_w32 ARG
1712
# Convert file name ARG from Cygwin to w32 format. Returns result in
1713
# func_to_host_file_result.
1714
func_convert_file_cygwin_to_w32 ()
1717
func_to_host_file_result="$1"
1718
if test -n "$1"; then
1719
# because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1720
# LT_CYGPATH in this case.
1721
func_to_host_file_result=`cygpath -m "$1"`
1723
func_convert_file_check "$1" "$func_to_host_file_result"
1725
# end func_convert_file_cygwin_to_w32
1728
# func_convert_file_nix_to_w32 ARG
1729
# Convert file name ARG from *nix to w32 format. Requires a wine environment
1730
# and a working winepath. Returns result in func_to_host_file_result.
1731
func_convert_file_nix_to_w32 ()
1734
func_to_host_file_result="$1"
1735
if test -n "$1"; then
1736
func_convert_core_file_wine_to_w32 "$1"
1737
func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1739
func_convert_file_check "$1" "$func_to_host_file_result"
1741
# end func_convert_file_nix_to_w32
1744
# func_convert_file_msys_to_cygwin ARG
1745
# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1746
# Returns result in func_to_host_file_result.
1747
func_convert_file_msys_to_cygwin ()
1750
func_to_host_file_result="$1"
1751
if test -n "$1"; then
1752
func_convert_core_msys_to_w32 "$1"
1753
func_cygpath -u "$func_convert_core_msys_to_w32_result"
1754
func_to_host_file_result="$func_cygpath_result"
1756
func_convert_file_check "$1" "$func_to_host_file_result"
1758
# end func_convert_file_msys_to_cygwin
1761
# func_convert_file_nix_to_cygwin ARG
1762
# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
1763
# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
1764
# in func_to_host_file_result.
1765
func_convert_file_nix_to_cygwin ()
1768
func_to_host_file_result="$1"
1769
if test -n "$1"; then
1770
# convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1771
func_convert_core_file_wine_to_w32 "$1"
1772
func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1773
func_to_host_file_result="$func_cygpath_result"
1775
func_convert_file_check "$1" "$func_to_host_file_result"
1777
# end func_convert_file_nix_to_cygwin
1780
#############################################
1781
# $build to $host PATH CONVERSION FUNCTIONS #
1782
#############################################
1783
# invoked via `$to_host_path_cmd ARG'
1785
# In each case, ARG is the path to be converted from $build to $host format.
1786
# The result will be available in $func_to_host_path_result.
1788
# Path separators are also converted from $build format to $host format. If
1789
# ARG begins or ends with a path separator character, it is preserved (but
1790
# converted to $host format) on output.
1792
# All path conversion functions are named using the following convention:
1793
# file name conversion function : func_convert_file_X_to_Y ()
1794
# path conversion function : func_convert_path_X_to_Y ()
1795
# where, for any given $build/$host combination the 'X_to_Y' value is the
1796
# same. If conversion functions are added for new $build/$host combinations,
1797
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
1801
# func_init_to_host_path_cmd
1802
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
1803
# appropriate value, based on the value of $to_host_file_cmd.
1805
func_init_to_host_path_cmd ()
1808
if test -z "$to_host_path_cmd"; then
1809
func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1810
to_host_path_cmd="func_convert_path_${func_stripname_result}"
1815
# func_to_host_path ARG
1816
# Converts the path ARG from $build format to $host format. Return result
1817
# in func_to_host_path_result.
1818
func_to_host_path ()
1821
func_init_to_host_path_cmd
1822
$to_host_path_cmd "$1"
1824
# end func_to_host_path
1827
# func_convert_path_noop ARG
1828
# Copy ARG to func_to_host_path_result.
1829
func_convert_path_noop ()
1831
func_to_host_path_result="$1"
1833
# end func_convert_path_noop
1836
# func_convert_path_msys_to_w32 ARG
1837
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1838
# conversion to w32 is not available inside the cwrapper. Returns result in
1839
# func_to_host_path_result.
1840
func_convert_path_msys_to_w32 ()
1843
func_to_host_path_result="$1"
1844
if test -n "$1"; then
1845
# Remove leading and trailing path separator characters from ARG. MSYS
1846
# behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1847
# and winepath ignores them completely.
1848
func_stripname : : "$1"
1849
func_to_host_path_tmp1=$func_stripname_result
1850
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1851
func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1852
func_convert_path_check : ";" \
1853
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1854
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1857
# end func_convert_path_msys_to_w32
1860
# func_convert_path_cygwin_to_w32 ARG
1861
# Convert path ARG from Cygwin to w32 format. Returns result in
1862
# func_to_host_file_result.
1863
func_convert_path_cygwin_to_w32 ()
1866
func_to_host_path_result="$1"
1867
if test -n "$1"; then
1868
# See func_convert_path_msys_to_w32:
1869
func_stripname : : "$1"
1870
func_to_host_path_tmp1=$func_stripname_result
1871
func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1872
func_convert_path_check : ";" \
1873
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1874
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1877
# end func_convert_path_cygwin_to_w32
1880
# func_convert_path_nix_to_w32 ARG
1881
# Convert path ARG from *nix to w32 format. Requires a wine environment and
1882
# a working winepath. Returns result in func_to_host_file_result.
1883
func_convert_path_nix_to_w32 ()
1886
func_to_host_path_result="$1"
1887
if test -n "$1"; then
1888
# See func_convert_path_msys_to_w32:
1889
func_stripname : : "$1"
1890
func_to_host_path_tmp1=$func_stripname_result
1891
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1892
func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1893
func_convert_path_check : ";" \
1894
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1895
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1898
# end func_convert_path_nix_to_w32
1901
# func_convert_path_msys_to_cygwin ARG
1902
# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1903
# Returns result in func_to_host_file_result.
1904
func_convert_path_msys_to_cygwin ()
1907
func_to_host_path_result="$1"
1908
if test -n "$1"; then
1909
# See func_convert_path_msys_to_w32:
1910
func_stripname : : "$1"
1911
func_to_host_path_tmp1=$func_stripname_result
1912
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1913
func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1914
func_to_host_path_result="$func_cygpath_result"
1915
func_convert_path_check : : \
1916
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1917
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1920
# end func_convert_path_msys_to_cygwin
1923
# func_convert_path_nix_to_cygwin ARG
1924
# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
1925
# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
1926
# func_to_host_file_result.
1927
func_convert_path_nix_to_cygwin ()
1930
func_to_host_path_result="$1"
1931
if test -n "$1"; then
1932
# Remove leading and trailing path separator characters from
1933
# ARG. msys behavior is inconsistent here, cygpath turns them
1934
# into '.;' and ';.', and winepath ignores them completely.
1935
func_stripname : : "$1"
1936
func_to_host_path_tmp1=$func_stripname_result
1937
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1938
func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1939
func_to_host_path_result="$func_cygpath_result"
1940
func_convert_path_check : : \
1941
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1942
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1945
# end func_convert_path_nix_to_cygwin
1100
1948
# func_mode_compile arg...
1101
1949
func_mode_compile ()
1795
2713
# Exit here if they wanted silent mode.
1796
2714
$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
2716
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2717
echo "----------------------------------------------------------------------"
2718
echo "Libraries have been installed in:"
2719
for libdir in $libdirs; do
2723
echo "If you ever happen to want to link against installed libraries"
2724
echo "in a given directory, LIBDIR, you must either use libtool, and"
2725
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2726
echo "flag during linking and do at least one of the following:"
2727
if test -n "$shlibpath_var"; then
2728
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2729
echo " during execution"
2731
if test -n "$runpath_var"; then
2732
echo " - add LIBDIR to the \`$runpath_var' environment variable"
2733
echo " during linking"
2735
if test -n "$hardcode_libdir_flag_spec"; then
2737
eval flag=\"$hardcode_libdir_flag_spec\"
2739
$ECHO " - use the \`$flag' linker flag"
2741
if test -n "$admincmds"; then
2742
$ECHO " - have your system administrator run these commands:$admincmds"
2744
if test -f /etc/ld.so.conf; then
2745
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2749
echo "See any operating system documentation about shared libraries for"
2751
solaris2.[6789]|solaris2.1[0-9])
2752
echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2756
echo "more information, such as the ld(1) and ld.so(8) manual pages."
2759
echo "----------------------------------------------------------------------"
1841
2761
exit $EXIT_SUCCESS
1844
test "$mode" = finish && func_mode_finish ${1+"$@"}
2764
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
1847
2767
# func_mode_install arg...
2590
3579
$ECHO "$win32_libid_type"
3582
# func_cygming_dll_for_implib ARG
3584
# Platform-specific function to extract the
3585
# name of the DLL associated with the specified
3586
# import library ARG.
3587
# Invoked by eval'ing the libtool variable
3588
# $sharedlib_from_linklib_cmd
3589
# Result is available in the variable
3590
# $sharedlib_from_linklib_result
3591
func_cygming_dll_for_implib ()
3594
sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3597
# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3599
# The is the core of a fallback implementation of a
3600
# platform-specific function to extract the name of the
3601
# DLL associated with the specified import library LIBNAME.
3603
# SECTION_NAME is either .idata$6 or .idata$7, depending
3604
# on the platform and compiler that created the implib.
3606
# Echos the name of the DLL associated with the
3607
# specified import library.
3608
func_cygming_dll_for_implib_fallback_core ()
3611
match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3612
$OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3613
$SED '/^Contents of section '"$match_literal"':/{
3614
# Place marker at beginning of archive member dllname section
3619
# These lines can sometimes be longer than 43 characters, but
3620
# are always uninteresting
3621
/:[ ]*file format pe[i]\{,1\}-/d
3622
/^In archive [^:]*:/d
3623
# Ensure marker is printed
3625
# Remove all lines with less than 43 characters
3627
# From remaining lines, remove first 43 characters
3630
# Join marker and all lines until next marker into a single line
3631
/^====MARK====/ b para
3640
# Remove trailing dots and whitespace
3644
# we now have a list, one entry per line, of the stringified
3645
# contents of the appropriate section of all members of the
3646
# archive which possess that section. Heuristic: eliminate
3647
# all those which have a first or second character that is
3648
# a '.' (that is, objdump's representation of an unprintable
3649
# character.) This should work for all archives with less than
3650
# 0x302f exports -- but will fail for DLLs whose name actually
3651
# begins with a literal '.' or a single character followed by
3654
# Of those that remain, print the first one.
3655
$SED -e '/^\./d;/^.\./d;q'
3658
# func_cygming_gnu_implib_p ARG
3659
# This predicate returns with zero status (TRUE) if
3660
# ARG is a GNU/binutils-style import library. Returns
3661
# with nonzero status (FALSE) otherwise.
3662
func_cygming_gnu_implib_p ()
3665
func_to_tool_file "$1" func_convert_file_msys_to_w32
3666
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)$'`
3667
test -n "$func_cygming_gnu_implib_tmp"
3670
# func_cygming_ms_implib_p ARG
3671
# This predicate returns with zero status (TRUE) if
3672
# ARG is an MS-style import library. Returns
3673
# with nonzero status (FALSE) otherwise.
3674
func_cygming_ms_implib_p ()
3677
func_to_tool_file "$1" func_convert_file_msys_to_w32
3678
func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3679
test -n "$func_cygming_ms_implib_tmp"
3682
# func_cygming_dll_for_implib_fallback ARG
3683
# Platform-specific function to extract the
3684
# name of the DLL associated with the specified
3685
# import library ARG.
3687
# This fallback implementation is for use when $DLLTOOL
3688
# does not support the --identify-strict option.
3689
# Invoked by eval'ing the libtool variable
3690
# $sharedlib_from_linklib_cmd
3691
# Result is available in the variable
3692
# $sharedlib_from_linklib_result
3693
func_cygming_dll_for_implib_fallback ()
3696
if func_cygming_gnu_implib_p "$1" ; then
3697
# binutils import library
3698
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3699
elif func_cygming_ms_implib_p "$1" ; then
3700
# ms-generated import library
3701
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3704
sharedlib_from_linklib_result=""
2595
3709
# func_extract_an_archive dir oldlib
2750
3879
# When we are sourced in execute mode, \$file and \$ECHO are already set.
2751
3880
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+\"\$@\"}
3883
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3886
# A function that is used when there is no print builtin or printf.
3887
func_fallback_echo ()
3889
eval 'cat <<_LTECHO_EOF
3896
# Very basic option parsing. These options are (a) specific to
3897
# the libtool wrapper, (b) are identical between the wrapper
3898
# /script/ and the wrapper /executable/ which is used only on
3899
# windows platforms, and (c) all begin with the string "--lt-"
3900
# (application programs are unlikely to have options which match
3903
# There are only two supported options: --lt-debug and
3904
# --lt-dump-script. There is, deliberately, no --lt-help.
3906
# The first argument to this parsing function should be the
3907
# script's $0 value, followed by "$@".
3909
func_parse_lt_options ()
3915
case \"\$lt_opt\" in
3916
--lt-debug) lt_option_debug=1 ;;
3918
lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3919
test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3920
lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3921
cat \"\$lt_dump_D/\$lt_dump_F\"
3925
\$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3931
# Print the debug banner immediately:
3932
if test -n \"\$lt_option_debug\"; then
3933
echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3937
# Used when --lt-debug. Prints its arguments to stdout
3938
# (redirection is the responsibility of the caller)
3939
func_lt_dump_args ()
3944
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3945
lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3949
# Core function for launching the target application
3950
func_exec_program_core ()
3954
# Backslashes separate directories on plain windows
3955
*-*-mingw | *-*-os2* | *-cegcc*)
3957
if test -n \"\$lt_option_debug\"; then
3958
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3959
func_lt_dump_args \${1+\"\$@\"} 1>&2
3961
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3967
if test -n \"\$lt_option_debug\"; then
3968
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3969
func_lt_dump_args \${1+\"\$@\"} 1>&2
3971
exec \"\$progdir/\$program\" \${1+\"\$@\"}
3976
\$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3980
# A function to encapsulate launching the target application
3981
# Strips options in the --lt-* namespace from \$@ and
3982
# launches target application with the remaining arguments.
3983
func_exec_program ()
3989
*) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3993
func_exec_program_core \${1+\"\$@\"}
3997
func_parse_lt_options \"\$0\" \${1+\"\$@\"}
2769
3999
# Find the directory that this script lives in.
2770
thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4000
thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
2771
4001
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2773
4003
# Follow symbolic links until we get to the real thisdir.
2774
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4004
file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
2775
4005
while test -n \"\$file\"; do
2776
destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4006
destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
2778
4008
# If there was a directory component, then change thisdir.
2779
4009
if test \"x\$destdir\" != \"x\$file\"; then
2878
4103
# Some systems cannot cope with colon-terminated $shlibpath_var
2879
4104
# The second colon is a workaround for a bug in BeOS R4 sed
2880
$shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4105
$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
2882
4107
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
4112
if test \"\$libtool_execute_magic\" != \"$magic\"; then
2896
4113
# 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
4114
func_exec_program \${1+\"\$@\"}
2917
4117
# The program doesn't exist.
2918
4118
\$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2919
4119
\$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2920
$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4120
\$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
4128
# func_emit_cwrapperexe_src
3129
4129
# emit the source code for a wrapper executable on stdout
3479
4497
lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3480
4498
lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4499
/* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4500
be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4501
because on Windows, both *_VARNAMEs are PATH but uninstalled
4502
libraries must come first. */
4503
lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3481
4504
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>")));
4506
lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4507
nonnull (lt_argv_zero));
3552
4508
for (i = 0; i < newargc; i++)
3554
LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
4510
lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4511
i, nonnull (newargz[i]));