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.6b
69
# automake: $automake_version
70
# autoconf: $autoconf_version
71
# compiler flags: $LTCFLAGS
72
# linker: $LD (gnu? $with_gnu_ld)
73
# $progname: (GNU libtool) 2.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.3017
85
package_revision=1.3337
80
87
# Be Bourne compatible
81
88
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
158
195
# those functions but instead duplicate the functionality here.
159
196
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
198
# Extract subdirectory from the argument.
199
func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
200
if test "X$func_dirname_result" = "X${1}"; then
201
func_dirname_result="${3}"
203
func_dirname_result="$func_dirname_result${2}"
205
func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
206
} # func_dirname_and_basename may be replaced by extended shell implementation
209
# func_stripname prefix suffix name
210
# strip PREFIX and SUFFIX off of NAME.
211
# PREFIX and SUFFIX must not contain globbing or regex special
212
# characters, hashes, percent signs, but SUFFIX may contain a leading
213
# dot (in which case that matches only a dot).
214
# func_strip_suffix prefix name
218
.*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
219
*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
221
} # func_stripname may be replaced by extended shell implementation
224
# These SED scripts presuppose an absolute path with a trailing slash.
225
pathcar='s,^/\([^/]*\).*$,\1,'
226
pathcdr='s,^/[^/]*,,'
227
removedotparts=':dotsl
231
collapseslashes='s@/\{1,\}@/@g'
232
finalslash='s,/*$,/,'
234
# func_normal_abspath PATH
235
# Remove doubled-up and trailing slashes, "." path components,
236
# and cancel out any ".." path components in PATH after making
237
# it an absolute path.
238
# value returned in "$func_normal_abspath_result"
239
func_normal_abspath ()
241
# Start from root dir and reassemble the path.
242
func_normal_abspath_result=
243
func_normal_abspath_tpath=$1
244
func_normal_abspath_altnamespace=
245
case $func_normal_abspath_tpath in
247
# Empty path, that just means $cwd.
248
func_stripname '' '/' "`pwd`"
249
func_normal_abspath_result=$func_stripname_result
252
# The next three entries are used to spot a run of precisely
253
# two leading slashes without using negated character classes;
254
# we take advantage of case's first-match behaviour.
256
# Unusual form of absolute path, do nothing.
259
# Not necessarily an ordinary path; POSIX reserves leading '//'
260
# and for example Cygwin uses it to access remote file shares
261
# over CIFS/SMB, so we conserve a leading double slash if found.
262
func_normal_abspath_altnamespace=/
265
# Absolute path, do nothing.
268
# Relative path, prepend $cwd.
269
func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
272
# Cancel out all the simple stuff to save iterations. We also want
273
# the path to end with a slash for ease of parsing, so make sure
274
# there is one (and only one) here.
275
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
276
-e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
278
# Processed it all yet?
279
if test "$func_normal_abspath_tpath" = / ; then
280
# If we ascended to the root using ".." the result may be empty now.
281
if test -z "$func_normal_abspath_result" ; then
282
func_normal_abspath_result=/
286
func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
288
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
290
# Figure out what to do with it
291
case $func_normal_abspath_tcomponent in
293
# Trailing empty path component, ignore it.
296
# Parent dir; strip last assembled component from result.
297
func_dirname "$func_normal_abspath_result"
298
func_normal_abspath_result=$func_dirname_result
301
# Actual path component, append it.
302
func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
306
# Restore leading double-slash if one was found on entry.
307
func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
310
# func_relative_path SRCDIR DSTDIR
311
# generates a relative path from SRCDIR to DSTDIR, with a trailing
312
# slash if non-empty, suitable for immediately appending a filename
313
# without needing to append a separator.
314
# value returned in "$func_relative_path_result"
315
func_relative_path ()
317
func_relative_path_result=
318
func_normal_abspath "$1"
319
func_relative_path_tlibdir=$func_normal_abspath_result
320
func_normal_abspath "$2"
321
func_relative_path_tbindir=$func_normal_abspath_result
323
# Ascend the tree starting from libdir
325
# check if we have found a prefix of bindir
326
case $func_relative_path_tbindir in
327
$func_relative_path_tlibdir)
328
# found an exact match
329
func_relative_path_tcancelled=
332
$func_relative_path_tlibdir*)
333
# found a matching prefix
334
func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
335
func_relative_path_tcancelled=$func_stripname_result
336
if test -z "$func_relative_path_result"; then
337
func_relative_path_result=.
342
func_dirname $func_relative_path_tlibdir
343
func_relative_path_tlibdir=${func_dirname_result}
344
if test "x$func_relative_path_tlibdir" = x ; then
345
# Have to descend all the way to the root!
346
func_relative_path_result=../$func_relative_path_result
347
func_relative_path_tcancelled=$func_relative_path_tbindir
350
func_relative_path_result=../$func_relative_path_result
355
# Now calculate path; take care to avoid doubling-up slashes.
356
func_stripname '' '/' "$func_relative_path_result"
357
func_relative_path_result=$func_stripname_result
358
func_stripname '/' '/' "$func_relative_path_tcancelled"
359
if test "x$func_stripname_result" != x ; then
360
func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
363
# Normalisation. If bindir is libdir, return empty string,
364
# else relative path ending with a slash; either way, target
365
# file name can be directly appended.
366
if test ! -z "$func_relative_path_result"; then
367
func_stripname './' '' "$func_relative_path_result/"
368
func_relative_path_result=$func_stripname_result
180
372
# 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
373
func_dirname_and_basename "$progpath"
184
374
progname=$func_basename_result
186
-*) progname=./$progname ;;
189
376
# Make sure we have an absolute path for reexecution:
190
377
case $progpath in
547
787
func_missing_arg ()
549
func_error "missing argument for $1"
791
func_error "missing argument for $1."
796
# func_split_short_opt shortopt
797
# Set func_split_short_opt_name and func_split_short_opt_arg shell
798
# variables after splitting SHORTOPT after the 2nd character.
799
func_split_short_opt ()
801
my_sed_short_opt='1s/^\(..\).*$/\1/;q'
802
my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
804
func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
805
func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
806
} # func_split_short_opt may be replaced by extended shell implementation
809
# func_split_long_opt longopt
810
# Set func_split_long_opt_name and func_split_long_opt_arg shell
811
# variables after splitting LONGOPT at the `=' sign.
812
func_split_long_opt ()
814
my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
815
my_sed_long_arg='1s/^--[^=]*=//'
817
func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
818
func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
819
} # 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
827
magic="%%%MAGIC variable%%%"
584
828
magic_exe="%%%MAGIC EXE variable%%%"
586
830
# Global variables.
591
833
lo2o="s/\\.lo\$/.${objext}/"
592
834
o2lo="s/\\.${objext}\$/.lo/"
593
835
extracted_archives=
594
836
extracted_serial=0
597
opt_duplicate_deps=false
601
838
# If this variable is set in any of the actions, the command in it
602
839
# will be execed at the end. This prevents here-documents from being
603
840
# left over by shells.
843
# func_append var value
844
# Append VALUE to the end of shell variable VAR.
847
eval "${1}=\$${1}\${2}"
848
} # func_append may be replaced by extended shell implementation
850
# func_append_quoted var value
851
# Quote VALUE and append to the end of shell variable VAR, separated
853
func_append_quoted ()
855
func_quote_for_eval "${2}"
856
eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
857
} # func_append_quoted may be replaced by extended shell implementation
860
# func_arith arithmetic-term...
863
func_arith_result=`expr "${@}"`
864
} # func_arith may be replaced by extended shell implementation
868
# STRING may not start with a hyphen.
871
func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
872
} # func_len may be replaced by extended shell implementation
878
func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
879
} # func_lo2o may be replaced by extended shell implementation
882
# func_xform libobj-or-source
885
func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
886
} # func_xform may be replaced by extended shell implementation
606
889
# func_fatal_configuration arg...
607
890
# Echo program name prefixed message to standard error, followed by
608
891
# a configuration failure hint, and exit.
1014
# Shorthand for --mode=foo, only valid as the first argument
1017
shift; set dummy --mode clean ${1+"$@"}; shift
1019
compile|compil|compi|comp|com|co|c)
1020
shift; set dummy --mode compile ${1+"$@"}; shift
1022
execute|execut|execu|exec|exe|ex|e)
1023
shift; set dummy --mode execute ${1+"$@"}; shift
1025
finish|finis|fini|fin|fi|f)
1026
shift; set dummy --mode finish ${1+"$@"}; shift
1028
install|instal|insta|inst|ins|in|i)
1029
shift; set dummy --mode install ${1+"$@"}; shift
1032
shift; set dummy --mode link ${1+"$@"}; shift
1034
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1035
shift; set dummy --mode uninstall ${1+"$@"}; shift
1045
opt_preserve_dup_deps=false
1057
# Parse options once, thoroughly. This comes as soon as possible in the
1058
# script to make things like `--version' happen as quickly as we can.
1060
# this just eases exit handling
1061
while test $# -gt 0; do
1065
--debug|-x) opt_debug='set -x'
1066
func_echo "enabling shell trace mode"
1069
--dry-run|--dryrun|-n)
1078
opt_dlopen="${opt_dlopen+$opt_dlopen
1082
--preserve-dup-deps)
1083
opt_preserve_dup_deps=:
1091
set dummy --mode finish ${1+"$@"}; shift
1098
opt_help=': help-all'
1101
test $# = 0 && func_missing_arg $opt && break
1105
# Valid mode arguments:
1106
clean|compile|execute|finish|install|link|relink|uninstall) ;;
1108
# Catch anything else as an error
1109
*) func_error "invalid argument for $opt"
1116
--no-silent|--no-quiet)
1118
func_append preserve_args " $opt"
1120
--no-warning|--no-warn)
1122
func_append preserve_args " $opt"
1126
func_append preserve_args " $opt"
1130
func_append preserve_args " $opt"
1135
func_append preserve_args " $opt"
1139
test $# = 0 && func_missing_arg $opt && break
1142
func_append preserve_args " $opt $optarg"
1143
func_enable_tag "$optarg"
1147
-\?|-h) func_usage ;;
1148
--help) func_help ;;
1149
--version) func_version ;;
1151
# Separate optargs to long options:
1153
func_split_long_opt "$opt"
1154
set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1158
# Separate non-argument short options:
1160
func_split_short_opt "$opt"
1161
set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1166
-*) func_fatal_help "unrecognized option \`$opt'" ;;
1167
*) set dummy "$opt" ${1+"$@"}; shift; break ;;
1173
# save first non-option argument
1174
if test "$#" -gt 0; then
1180
test "$opt_debug" = : || func_append preserve_args " --debug"
1183
*cygwin* | *mingw* | *pw32* | *cegcc*)
1184
# don't eliminate duplications in $postdeps and $predeps
1185
opt_duplicate_compiler_generated_deps=:
1188
opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1193
# Sanity checks first:
1194
func_check_version_match
1196
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1197
func_fatal_configuration "not configured to build any kind of library"
1201
eval std_shrext=\"$shrext_cmds\"
1203
# Only execute mode is allowed to have -dlopen flags.
1204
if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1205
func_error "unrecognized option \`-dlopen'"
1210
# Change the help message to a mode-specific one.
1211
generic_help="$help"
1212
help="Try \`$progname --help --mode=$opt_mode' for more information."
1216
# Bail if the options were screwed
1217
$exit_cmd $EXIT_FAILURE
858
1223
## ----------- ##
860
1225
## ----------- ##
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
1227
# func_lalib_p file
891
1228
# True iff FILE is a libtool `.la' library or `.lo' object file.
892
1229
# This function is only a basic sanity check; it will hardly flush out
1470
##################################################
1471
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1472
##################################################
1474
# func_convert_core_file_wine_to_w32 ARG
1475
# Helper function used by file name conversion functions when $build is *nix,
1476
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
1477
# correctly configured wine environment available, with the winepath program
1478
# in $build's $PATH.
1480
# ARG is the $build file name to be converted to w32 format.
1481
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
1482
# be empty on error (or when ARG is empty)
1483
func_convert_core_file_wine_to_w32 ()
1486
func_convert_core_file_wine_to_w32_result="$1"
1487
if test -n "$1"; then
1488
# Unfortunately, winepath does not exit with a non-zero error code, so we
1489
# are forced to check the contents of stdout. On the other hand, if the
1490
# command is not found, the shell will set an exit code of 127 and print
1491
# *an error message* to stdout. So we must check for both error code of
1492
# zero AND non-empty stdout, which explains the odd construction:
1493
func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1494
if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1495
func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1496
$SED -e "$lt_sed_naive_backslashify"`
1498
func_convert_core_file_wine_to_w32_result=
1502
# end: func_convert_core_file_wine_to_w32
1505
# func_convert_core_path_wine_to_w32 ARG
1506
# Helper function used by path conversion functions when $build is *nix, and
1507
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1508
# configured wine environment available, with the winepath program in $build's
1509
# $PATH. Assumes ARG has no leading or trailing path separator characters.
1511
# ARG is path to be converted from $build format to win32.
1512
# Result is available in $func_convert_core_path_wine_to_w32_result.
1513
# Unconvertible file (directory) names in ARG are skipped; if no directory names
1514
# are convertible, then the result may be empty.
1515
func_convert_core_path_wine_to_w32 ()
1518
# unfortunately, winepath doesn't convert paths, only file names
1519
func_convert_core_path_wine_to_w32_result=""
1520
if test -n "$1"; then
1523
for func_convert_core_path_wine_to_w32_f in $1; do
1525
func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1526
if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1527
if test -z "$func_convert_core_path_wine_to_w32_result"; then
1528
func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1530
func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1537
# end: func_convert_core_path_wine_to_w32
1540
# func_cygpath ARGS...
1541
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1542
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1543
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1544
# (2), returns the Cygwin file name or path in func_cygpath_result (input
1545
# file name or path is assumed to be in w32 format, as previously converted
1546
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
1547
# or path in func_cygpath_result (input file name or path is assumed to be in
1548
# Cygwin format). Returns an empty string on error.
1550
# ARGS are passed to cygpath, with the last one being the file name or path to
1553
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1554
# environment variable; do not put it in $PATH.
1558
if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1559
func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1560
if test "$?" -ne 0; then
1561
# on failure, ensure result is empty
1562
func_cygpath_result=
1565
func_cygpath_result=
1566
func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1572
# func_convert_core_msys_to_w32 ARG
1573
# Convert file name or path ARG from MSYS format to w32 format. Return
1574
# result in func_convert_core_msys_to_w32_result.
1575
func_convert_core_msys_to_w32 ()
1578
# awkward: cmd appends spaces to result
1579
func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1580
$SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1582
#end: func_convert_core_msys_to_w32
1585
# func_convert_file_check ARG1 ARG2
1586
# Verify that ARG1 (a file name in $build format) was converted to $host
1587
# format in ARG2. Otherwise, emit an error message, but continue (resetting
1588
# func_to_host_file_result to ARG1).
1589
func_convert_file_check ()
1592
if test -z "$2" && test -n "$1" ; then
1593
func_error "Could not determine host file name corresponding to"
1595
func_error "Continuing, but uninstalled executables may not work."
1597
func_to_host_file_result="$1"
1600
# end func_convert_file_check
1603
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1604
# Verify that FROM_PATH (a path in $build format) was converted to $host
1605
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1606
# func_to_host_file_result to a simplistic fallback value (see below).
1607
func_convert_path_check ()
1610
if test -z "$4" && test -n "$3"; then
1611
func_error "Could not determine the host path corresponding to"
1613
func_error "Continuing, but uninstalled executables may not work."
1614
# Fallback. This is a deliberately simplistic "conversion" and
1615
# should not be "improved". See libtool.info.
1616
if test "x$1" != "x$2"; then
1617
lt_replace_pathsep_chars="s|$1|$2|g"
1618
func_to_host_path_result=`echo "$3" |
1619
$SED -e "$lt_replace_pathsep_chars"`
1621
func_to_host_path_result="$3"
1625
# end func_convert_path_check
1628
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1629
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1630
# and appending REPL if ORIG matches BACKPAT.
1631
func_convert_path_front_back_pathsep ()
1635
$1 ) func_to_host_path_result="$3$func_to_host_path_result"
1639
$2 ) func_append func_to_host_path_result "$3"
1643
# end func_convert_path_front_back_pathsep
1646
##################################################
1647
# $build to $host FILE NAME CONVERSION FUNCTIONS #
1648
##################################################
1649
# invoked via `$to_host_file_cmd ARG'
1651
# In each case, ARG is the path to be converted from $build to $host format.
1652
# Result will be available in $func_to_host_file_result.
1655
# func_to_host_file ARG
1656
# Converts the file name ARG from $build format to $host format. Return result
1657
# in func_to_host_file_result.
1658
func_to_host_file ()
1661
$to_host_file_cmd "$1"
1663
# end func_to_host_file
1666
# func_to_tool_file ARG LAZY
1667
# converts the file name ARG from $build format to toolchain format. Return
1668
# result in func_to_tool_file_result. If the conversion in use is listed
1669
# in (the comma separated) LAZY, no conversion takes place.
1670
func_to_tool_file ()
1674
*,"$to_tool_file_cmd",*)
1675
func_to_tool_file_result=$1
1678
$to_tool_file_cmd "$1"
1679
func_to_tool_file_result=$func_to_host_file_result
1683
# end func_to_tool_file
1686
# func_convert_file_noop ARG
1687
# Copy ARG to func_to_host_file_result.
1688
func_convert_file_noop ()
1690
func_to_host_file_result="$1"
1692
# end func_convert_file_noop
1695
# func_convert_file_msys_to_w32 ARG
1696
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1697
# conversion to w32 is not available inside the cwrapper. Returns result in
1698
# func_to_host_file_result.
1699
func_convert_file_msys_to_w32 ()
1702
func_to_host_file_result="$1"
1703
if test -n "$1"; then
1704
func_convert_core_msys_to_w32 "$1"
1705
func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1707
func_convert_file_check "$1" "$func_to_host_file_result"
1709
# end func_convert_file_msys_to_w32
1712
# func_convert_file_cygwin_to_w32 ARG
1713
# Convert file name ARG from Cygwin to w32 format. Returns result in
1714
# func_to_host_file_result.
1715
func_convert_file_cygwin_to_w32 ()
1718
func_to_host_file_result="$1"
1719
if test -n "$1"; then
1720
# because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1721
# LT_CYGPATH in this case.
1722
func_to_host_file_result=`cygpath -m "$1"`
1724
func_convert_file_check "$1" "$func_to_host_file_result"
1726
# end func_convert_file_cygwin_to_w32
1729
# func_convert_file_nix_to_w32 ARG
1730
# Convert file name ARG from *nix to w32 format. Requires a wine environment
1731
# and a working winepath. Returns result in func_to_host_file_result.
1732
func_convert_file_nix_to_w32 ()
1735
func_to_host_file_result="$1"
1736
if test -n "$1"; then
1737
func_convert_core_file_wine_to_w32 "$1"
1738
func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1740
func_convert_file_check "$1" "$func_to_host_file_result"
1742
# end func_convert_file_nix_to_w32
1745
# func_convert_file_msys_to_cygwin ARG
1746
# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1747
# Returns result in func_to_host_file_result.
1748
func_convert_file_msys_to_cygwin ()
1751
func_to_host_file_result="$1"
1752
if test -n "$1"; then
1753
func_convert_core_msys_to_w32 "$1"
1754
func_cygpath -u "$func_convert_core_msys_to_w32_result"
1755
func_to_host_file_result="$func_cygpath_result"
1757
func_convert_file_check "$1" "$func_to_host_file_result"
1759
# end func_convert_file_msys_to_cygwin
1762
# func_convert_file_nix_to_cygwin ARG
1763
# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
1764
# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
1765
# in func_to_host_file_result.
1766
func_convert_file_nix_to_cygwin ()
1769
func_to_host_file_result="$1"
1770
if test -n "$1"; then
1771
# convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1772
func_convert_core_file_wine_to_w32 "$1"
1773
func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1774
func_to_host_file_result="$func_cygpath_result"
1776
func_convert_file_check "$1" "$func_to_host_file_result"
1778
# end func_convert_file_nix_to_cygwin
1781
#############################################
1782
# $build to $host PATH CONVERSION FUNCTIONS #
1783
#############################################
1784
# invoked via `$to_host_path_cmd ARG'
1786
# In each case, ARG is the path to be converted from $build to $host format.
1787
# The result will be available in $func_to_host_path_result.
1789
# Path separators are also converted from $build format to $host format. If
1790
# ARG begins or ends with a path separator character, it is preserved (but
1791
# converted to $host format) on output.
1793
# All path conversion functions are named using the following convention:
1794
# file name conversion function : func_convert_file_X_to_Y ()
1795
# path conversion function : func_convert_path_X_to_Y ()
1796
# where, for any given $build/$host combination the 'X_to_Y' value is the
1797
# same. If conversion functions are added for new $build/$host combinations,
1798
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
1802
# func_init_to_host_path_cmd
1803
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
1804
# appropriate value, based on the value of $to_host_file_cmd.
1806
func_init_to_host_path_cmd ()
1809
if test -z "$to_host_path_cmd"; then
1810
func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1811
to_host_path_cmd="func_convert_path_${func_stripname_result}"
1816
# func_to_host_path ARG
1817
# Converts the path ARG from $build format to $host format. Return result
1818
# in func_to_host_path_result.
1819
func_to_host_path ()
1822
func_init_to_host_path_cmd
1823
$to_host_path_cmd "$1"
1825
# end func_to_host_path
1828
# func_convert_path_noop ARG
1829
# Copy ARG to func_to_host_path_result.
1830
func_convert_path_noop ()
1832
func_to_host_path_result="$1"
1834
# end func_convert_path_noop
1837
# func_convert_path_msys_to_w32 ARG
1838
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1839
# conversion to w32 is not available inside the cwrapper. Returns result in
1840
# func_to_host_path_result.
1841
func_convert_path_msys_to_w32 ()
1844
func_to_host_path_result="$1"
1845
if test -n "$1"; then
1846
# Remove leading and trailing path separator characters from ARG. MSYS
1847
# behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1848
# and winepath ignores them completely.
1849
func_stripname : : "$1"
1850
func_to_host_path_tmp1=$func_stripname_result
1851
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1852
func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1853
func_convert_path_check : ";" \
1854
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1855
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1858
# end func_convert_path_msys_to_w32
1861
# func_convert_path_cygwin_to_w32 ARG
1862
# Convert path ARG from Cygwin to w32 format. Returns result in
1863
# func_to_host_file_result.
1864
func_convert_path_cygwin_to_w32 ()
1867
func_to_host_path_result="$1"
1868
if test -n "$1"; then
1869
# See func_convert_path_msys_to_w32:
1870
func_stripname : : "$1"
1871
func_to_host_path_tmp1=$func_stripname_result
1872
func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1873
func_convert_path_check : ";" \
1874
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1875
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1878
# end func_convert_path_cygwin_to_w32
1881
# func_convert_path_nix_to_w32 ARG
1882
# Convert path ARG from *nix to w32 format. Requires a wine environment and
1883
# a working winepath. Returns result in func_to_host_file_result.
1884
func_convert_path_nix_to_w32 ()
1887
func_to_host_path_result="$1"
1888
if test -n "$1"; then
1889
# See func_convert_path_msys_to_w32:
1890
func_stripname : : "$1"
1891
func_to_host_path_tmp1=$func_stripname_result
1892
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1893
func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1894
func_convert_path_check : ";" \
1895
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1896
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1899
# end func_convert_path_nix_to_w32
1902
# func_convert_path_msys_to_cygwin ARG
1903
# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1904
# Returns result in func_to_host_file_result.
1905
func_convert_path_msys_to_cygwin ()
1908
func_to_host_path_result="$1"
1909
if test -n "$1"; then
1910
# See func_convert_path_msys_to_w32:
1911
func_stripname : : "$1"
1912
func_to_host_path_tmp1=$func_stripname_result
1913
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1914
func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1915
func_to_host_path_result="$func_cygpath_result"
1916
func_convert_path_check : : \
1917
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1918
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1921
# end func_convert_path_msys_to_cygwin
1924
# func_convert_path_nix_to_cygwin ARG
1925
# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
1926
# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
1927
# func_to_host_file_result.
1928
func_convert_path_nix_to_cygwin ()
1931
func_to_host_path_result="$1"
1932
if test -n "$1"; then
1933
# Remove leading and trailing path separator characters from
1934
# ARG. msys behavior is inconsistent here, cygpath turns them
1935
# into '.;' and ';.', and winepath ignores them completely.
1936
func_stripname : : "$1"
1937
func_to_host_path_tmp1=$func_stripname_result
1938
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1939
func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1940
func_to_host_path_result="$func_cygpath_result"
1941
func_convert_path_check : : \
1942
"$func_to_host_path_tmp1" "$func_to_host_path_result"
1943
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1946
# end func_convert_path_nix_to_cygwin
1100
1949
# func_mode_compile arg...
1101
1950
func_mode_compile ()
1795
2714
# Exit here if they wanted silent mode.
1796
2715
$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
2717
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2718
echo "----------------------------------------------------------------------"
2719
echo "Libraries have been installed in:"
2720
for libdir in $libdirs; do
2724
echo "If you ever happen to want to link against installed libraries"
2725
echo "in a given directory, LIBDIR, you must either use libtool, and"
2726
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2727
echo "flag during linking and do at least one of the following:"
2728
if test -n "$shlibpath_var"; then
2729
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2730
echo " during execution"
2732
if test -n "$runpath_var"; then
2733
echo " - add LIBDIR to the \`$runpath_var' environment variable"
2734
echo " during linking"
2736
if test -n "$hardcode_libdir_flag_spec"; then
2738
eval flag=\"$hardcode_libdir_flag_spec\"
2740
$ECHO " - use the \`$flag' linker flag"
2742
if test -n "$admincmds"; then
2743
$ECHO " - have your system administrator run these commands:$admincmds"
2745
if test -f /etc/ld.so.conf; then
2746
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2750
echo "See any operating system documentation about shared libraries for"
2752
solaris2.[6789]|solaris2.1[0-9])
2753
echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2757
echo "more information, such as the ld(1) and ld.so(8) manual pages."
2760
echo "----------------------------------------------------------------------"
1841
2762
exit $EXIT_SUCCESS
1844
test "$mode" = finish && func_mode_finish ${1+"$@"}
2765
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
1847
2768
# func_mode_install arg...
2590
3582
$ECHO "$win32_libid_type"
3585
# func_cygming_dll_for_implib ARG
3587
# Platform-specific function to extract the
3588
# name of the DLL associated with the specified
3589
# import library ARG.
3590
# Invoked by eval'ing the libtool variable
3591
# $sharedlib_from_linklib_cmd
3592
# Result is available in the variable
3593
# $sharedlib_from_linklib_result
3594
func_cygming_dll_for_implib ()
3597
sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3600
# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3602
# The is the core of a fallback implementation of a
3603
# platform-specific function to extract the name of the
3604
# DLL associated with the specified import library LIBNAME.
3606
# SECTION_NAME is either .idata$6 or .idata$7, depending
3607
# on the platform and compiler that created the implib.
3609
# Echos the name of the DLL associated with the
3610
# specified import library.
3611
func_cygming_dll_for_implib_fallback_core ()
3614
match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3615
$OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3616
$SED '/^Contents of section '"$match_literal"':/{
3617
# Place marker at beginning of archive member dllname section
3622
# These lines can sometimes be longer than 43 characters, but
3623
# are always uninteresting
3624
/:[ ]*file format pe[i]\{,1\}-/d
3625
/^In archive [^:]*:/d
3626
# Ensure marker is printed
3628
# Remove all lines with less than 43 characters
3630
# From remaining lines, remove first 43 characters
3633
# Join marker and all lines until next marker into a single line
3634
/^====MARK====/ b para
3643
# Remove trailing dots and whitespace
3647
# we now have a list, one entry per line, of the stringified
3648
# contents of the appropriate section of all members of the
3649
# archive which possess that section. Heuristic: eliminate
3650
# all those which have a first or second character that is
3651
# a '.' (that is, objdump's representation of an unprintable
3652
# character.) This should work for all archives with less than
3653
# 0x302f exports -- but will fail for DLLs whose name actually
3654
# begins with a literal '.' or a single character followed by
3657
# Of those that remain, print the first one.
3658
$SED -e '/^\./d;/^.\./d;q'
3661
# func_cygming_gnu_implib_p ARG
3662
# This predicate returns with zero status (TRUE) if
3663
# ARG is a GNU/binutils-style import library. Returns
3664
# with nonzero status (FALSE) otherwise.
3665
func_cygming_gnu_implib_p ()
3668
func_to_tool_file "$1" func_convert_file_msys_to_w32
3669
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)$'`
3670
test -n "$func_cygming_gnu_implib_tmp"
3673
# func_cygming_ms_implib_p ARG
3674
# This predicate returns with zero status (TRUE) if
3675
# ARG is an MS-style import library. Returns
3676
# with nonzero status (FALSE) otherwise.
3677
func_cygming_ms_implib_p ()
3680
func_to_tool_file "$1" func_convert_file_msys_to_w32
3681
func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3682
test -n "$func_cygming_ms_implib_tmp"
3685
# func_cygming_dll_for_implib_fallback ARG
3686
# Platform-specific function to extract the
3687
# name of the DLL associated with the specified
3688
# import library ARG.
3690
# This fallback implementation is for use when $DLLTOOL
3691
# does not support the --identify-strict option.
3692
# Invoked by eval'ing the libtool variable
3693
# $sharedlib_from_linklib_cmd
3694
# Result is available in the variable
3695
# $sharedlib_from_linklib_result
3696
func_cygming_dll_for_implib_fallback ()
3699
if func_cygming_gnu_implib_p "$1" ; then
3700
# binutils import library
3701
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3702
elif func_cygming_ms_implib_p "$1" ; then
3703
# ms-generated import library
3704
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3707
sharedlib_from_linklib_result=""
2595
3712
# func_extract_an_archive dir oldlib
2750
3882
# When we are sourced in execute mode, \$file and \$ECHO are already set.
2751
3883
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.
3886
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3889
# A function that is used when there is no print builtin or printf.
3890
func_fallback_echo ()
3892
eval 'cat <<_LTECHO_EOF
3899
# Very basic option parsing. These options are (a) specific to
3900
# the libtool wrapper, (b) are identical between the wrapper
3901
# /script/ and the wrapper /executable/ which is used only on
3902
# windows platforms, and (c) all begin with the string "--lt-"
3903
# (application programs are unlikely to have options which match
3906
# There are only two supported options: --lt-debug and
3907
# --lt-dump-script. There is, deliberately, no --lt-help.
3909
# The first argument to this parsing function should be the
3910
# script's $0 value, followed by "$@".
3912
func_parse_lt_options ()
3918
case \"\$lt_opt\" in
3919
--lt-debug) lt_option_debug=1 ;;
3921
lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3922
test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3923
lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3924
cat \"\$lt_dump_D/\$lt_dump_F\"
3928
\$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3934
# Print the debug banner immediately:
3935
if test -n \"\$lt_option_debug\"; then
3936
echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3940
# Used when --lt-debug. Prints its arguments to stdout
3941
# (redirection is the responsibility of the caller)
3942
func_lt_dump_args ()
3947
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3948
lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3952
# Core function for launching the target application
3953
func_exec_program_core ()
3957
# Backslashes separate directories on plain windows
3958
*-*-mingw | *-*-os2* | *-cegcc*)
3960
if test -n \"\$lt_option_debug\"; then
3961
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3962
func_lt_dump_args \${1+\"\$@\"} 1>&2
3964
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3970
if test -n \"\$lt_option_debug\"; then
3971
\$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3972
func_lt_dump_args \${1+\"\$@\"} 1>&2
3974
exec \"\$progdir/\$program\" \${1+\"\$@\"}
3979
\$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3983
# A function to encapsulate launching the target application
3984
# Strips options in the --lt-* namespace from \$@ and
3985
# launches target application with the remaining arguments.
3986
func_exec_program ()
3994
*) 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+\"\$@\"}
3999
func_exec_program_core \${1+\"\$@\"}
4003
func_parse_lt_options \"\$0\" \${1+\"\$@\"}
2769
4005
# Find the directory that this script lives in.
2770
thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4006
thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
2771
4007
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2773
4009
# Follow symbolic links until we get to the real thisdir.
2774
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4010
file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
2775
4011
while test -n \"\$file\"; do
2776
destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4012
destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
2778
4014
# If there was a directory component, then change thisdir.
2779
4015
if test \"x\$destdir\" != \"x\$file\"; then
2878
4109
# Some systems cannot cope with colon-terminated $shlibpath_var
2879
4110
# The second colon is a workaround for a bug in BeOS R4 sed
2880
$shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4111
$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
2882
4113
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
4118
if test \"\$libtool_execute_magic\" != \"$magic\"; then
2896
4119
# 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
4120
func_exec_program \${1+\"\$@\"}
2917
4123
# The program doesn't exist.
2918
4124
\$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2919
4125
\$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2920
$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4126
\$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
4134
# func_emit_cwrapperexe_src
3129
4135
# emit the source code for a wrapper executable on stdout
3479
4503
lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3480
4504
lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4505
/* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4506
be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4507
because on Windows, both *_VARNAMEs are PATH but uninstalled
4508
libraries must come first. */
4509
lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3481
4510
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>")));
4512
lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4513
nonnull (lt_argv_zero));
3552
4514
for (i = 0; i < newargc; i++)
3554
LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
4516
lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4517
i, nonnull (newargz[i]));