3
# libtool - Provide generalized library-building support services.
4
# Generated automatically by config.status (alarmclock) 1.0
5
# Libtool was configured on host TommyPC:
6
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
8
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
9
# 2006, 2007, 2008 Free Software Foundation, Inc.
10
# Written by Gordon Matzigkeit, 1996
12
# This file is part of GNU Libtool.
14
# GNU Libtool is free software; you can redistribute it and/or
15
# modify it under the terms of the GNU General Public License as
16
# published by the Free Software Foundation; either version 2 of
17
# the License, or (at your option) any later version.
19
# As a special exception to the GNU General Public License,
20
# if you distribute this file as part of a program or library that
21
# is built using GNU Libtool, you may include this file under the
22
# same distribution terms that you use for the rest of that program.
24
# GNU Libtool is distributed in the hope that it will be useful,
25
# but WITHOUT ANY WARRANTY; without even the implied warranty of
26
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
# GNU General Public License for more details.
29
# You should have received a copy of the GNU General Public License
30
# along with GNU Libtool; see the file COPYING. If not, a copy
31
# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
32
# obtained by writing to the Free Software Foundation, Inc.,
33
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
36
# The names of the tagged configurations supported by this script.
39
# ### BEGIN LIBTOOL CONFIG
41
# Which release of libtool.m4 was used?
45
# Whether or not to build shared libraries.
46
build_libtool_libs=yes
48
# Whether or not to build static libraries.
51
# What type of objects to build.
54
# Whether or not to optimize for fast installation.
59
host=i686-pc-linux-gnu
64
build=i686-pc-linux-gnu
67
# A sed program that does not truncate output.
70
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
71
Xsed="$SED -e 1s/^X//"
73
# A grep program that handles long lines.
79
# A literal string matcher.
82
# A BSD- or MS-compatible name lister.
85
# Whether we need soft or hard links.
88
# What is the maximum length of a command?
91
# Object file suffix (normally "o").
94
# Executable file suffix (normally "").
97
# whether the shell understands "unset".
100
# turn spaces into newlines.
101
SP2NL="tr \\040 \\012"
103
# turn newlines into spaces.
104
NL2SP="tr \\015\\012 \\040\\040"
106
# How to create reloadable object files.
108
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
110
# An object symbol dumper.
113
# Method to check whether dependent libraries are shared objects.
114
deplibs_check_method="pass_all"
116
# Command to use when deplibs_check_method == "file_magic".
117
file_magic_cmd="\$MAGIC_CMD"
123
# A symbol stripping program.
126
# Commands used to install an old-style archive.
128
old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
129
old_postuninstall_cmds=""
134
# LTCC compiler flags.
137
# Take the output of nm and produce a listing of raw symbols and C names.
138
global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
140
# Transform the output of nm in a proper C declaration.
141
global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
143
# Transform the output of nm in a C name address pair.
144
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
146
# Transform the output of nm in a C name address pair when lib prefix is needed.
147
global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'"
149
# The name of the directory that contains temporary libtool files.
152
# Shell to use when invoking shell scripts.
155
# An echo program that does not interpret backslashes.
158
# Used to examine libraries when file_magic_cmd begins with "file".
161
# Must we lock files when doing compilation?
164
# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
167
# Tool to change global to local symbols on Mac OS X.
170
# Tool to manipulate fat objects and archives on Mac OS X.
173
# ldd/readelf like tool for Mach-O binaries on Mac OS X.
176
# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
179
# Old archive suffix (normally "a").
182
# Shared library suffix (normally ".so").
185
# The commands to extract the exported symbol list from a shared archive.
186
extract_expsyms_cmds=""
188
# Variables whose values should be saved in libtool wrapper scripts and
189
# restored at link time.
190
variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
192
# Do we need the "lib" prefix for modules?
195
# Do we need a version for libraries?
198
# Library versioning type.
201
# Shared library runtime path variable.
202
runpath_var=LD_RUN_PATH
204
# Shared library path variable.
205
shlibpath_var=LD_LIBRARY_PATH
207
# Is shlibpath searched before the hard-coded library search path?
208
shlibpath_overrides_runpath=no
210
# Format of library name prefix.
211
libname_spec="lib\$name"
213
# List of archive names. First name is the real one, the rest are links.
214
# The last name is the one that the linker finds with -lNAME
215
library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
217
# The coded name of the library, if different from the real name.
218
soname_spec="\${libname}\${release}\${shared_ext}\$major"
220
# Command to use after installation of a shared archive.
223
# Command to use after uninstallation of a shared archive.
224
postuninstall_cmds=""
226
# Commands used to finish a libtool library installation in a directory.
227
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
229
# As "finish_cmds", except a single script fragment to be evaled but
233
# Whether we should hardcode library paths into libraries.
234
hardcode_into_libs=yes
236
# Compile-time system search path for libraries.
237
sys_lib_search_path_spec="/usr/lib/gcc/i586-redhat-linux/4.4.1 /usr/lib /lib"
239
# Run-time system search path for libraries.
240
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib/qt-3.3/lib /usr/lib/xulrunner-1.9.1 "
242
# Whether dlopen is supported.
243
dlopen_support=unknown
245
# Whether dlopen of programs is supported.
248
# Whether dlopen of statically linked programs is supported.
249
dlopen_self_static=unknown
251
# Commands to strip libraries.
252
old_striplib="strip --strip-debug"
253
striplib="strip --strip-unneeded"
256
# The linker used to build libraries.
259
# Commands used to build an old-style archive.
260
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
262
# A language specific compiler.
265
# Is the compiler the GNU compiler?
268
# Compiler flag to turn off builtin functions.
269
no_builtin_flag=" -fno-builtin"
271
# How to pass a linker flag through the compiler.
274
# Additional compiler flags for building library objects.
275
pic_flag=" -fPIC -DPIC"
277
# Compiler flag to prevent dynamic linking.
280
# Does compiler simultaneously support -c and -o options?
283
# Whether or not to add -lc for building shared libraries.
284
build_libtool_need_lc=no
286
# Whether or not to disallow shared libs when runtime libs are static.
287
allow_libtool_libs_with_static_runtimes=no
289
# Compiler flag to allow reflexive dlopens.
290
export_dynamic_flag_spec="\${wl}--export-dynamic"
292
# Compiler flag to generate shared objects directly from archives.
293
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
295
# Whether the compiler copes with passing no objects directly.
296
compiler_needs_object="no"
298
# Create an old-style archive from a shared archive.
299
old_archive_from_new_cmds=""
301
# Create a temporary old-style archive to link instead of a shared archive.
302
old_archive_from_expsyms_cmds=""
304
# Commands used to build a shared archive.
305
archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
306
archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
307
cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
308
echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
309
\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
311
# Commands used to build a loadable module if different from building
314
module_expsym_cmds=""
316
# Whether we are building with GNU ld or not.
319
# Flag that allows shared libraries with undefined symbols to be built.
320
allow_undefined_flag=""
322
# Flag that enforces no undefined symbols.
325
# Flag to hardcode $libdir into a binary during linking.
326
# This must work even if $libdir does not exist
327
hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
329
# If ld is used when linking, flag to hardcode $libdir into a binary
330
# during linking. This must work even if $libdir does not exist.
331
hardcode_libdir_flag_spec_ld=""
333
# Whether we need a single "-rpath" flag with a separated argument.
334
hardcode_libdir_separator=""
336
# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
337
# DIR into the resulting binary.
340
# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
341
# DIR into the resulting binary and the resulting library dependency is
342
# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
343
# library is relocated.
344
hardcode_direct_absolute=no
346
# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
347
# into the resulting binary.
350
# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
351
# into the resulting binary.
352
hardcode_shlibpath_var=unsupported
354
# Set to "yes" if building a shared library automatically hardcodes DIR
355
# into the library and all subsequent libraries and executables linked
357
hardcode_automatic=no
359
# Set to yes if linker adds runtime paths of dependent libraries
360
# to runtime path list.
363
# Whether libtool must link a program against all its dependency libraries.
364
link_all_deplibs=unknown
366
# Fix the shell variable $srcfile for the compiler.
369
# Set to "yes" if exported symbols are required.
370
always_export_symbols=no
372
# The commands to list exported symbols.
373
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
375
# Symbols that should not be listed in the preloaded symbols.
376
exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
378
# Symbols that must always be exported.
381
# Commands necessary for linking programs (against libraries) with templates.
384
# Specify filename containing input files.
387
# How to hardcode a shared library path into an executable.
388
hardcode_action=immediate
390
# ### END LIBTOOL CONFIG
392
# Generated from ltmain.m4sh.
394
# ltmain.sh (GNU libtool) 2.2.6
395
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
397
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
398
# This is free software; see the source for copying conditions. There is NO
399
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
401
# GNU Libtool is free software; you can redistribute it and/or modify
402
# it under the terms of the GNU General Public License as published by
403
# the Free Software Foundation; either version 2 of the License, or
404
# (at your option) any later version.
406
# As a special exception to the GNU General Public License,
407
# if you distribute this file as part of a program or library that
408
# is built using GNU Libtool, you may include this file under the
409
# same distribution terms that you use for the rest of that program.
411
# GNU Libtool is distributed in the hope that it will be useful, but
412
# WITHOUT ANY WARRANTY; without even the implied warranty of
413
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
414
# General Public License for more details.
416
# You should have received a copy of the GNU General Public License
417
# along with GNU Libtool; see the file COPYING. If not, a copy
418
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
419
# or obtained by writing to the Free Software Foundation, Inc.,
420
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
422
# Usage: $progname [OPTION]... [MODE-ARG]...
424
# Provide generalized library-building support services.
426
# --config show all configuration variables
427
# --debug enable verbose shell tracing
428
# -n, --dry-run display commands without modifying any files
429
# --features display basic configuration information and exit
430
# --mode=MODE use operation mode MODE
431
# --preserve-dup-deps don't remove duplicate dependency libraries
432
# --quiet, --silent don't print informational messages
433
# --tag=TAG use configuration variables from tag TAG
434
# -v, --verbose print informational messages (default)
435
# --version print version information
436
# -h, --help print short or long help message
438
# MODE must be one of the following:
440
# clean remove files from the build directory
441
# compile compile a source file into a libtool object
442
# execute automatically set library path, then run a program
443
# finish complete the installation of libtool libraries
444
# install install libraries or executables
445
# link create a library or an executable
446
# uninstall remove libraries from an installed directory
448
# MODE-ARGS vary depending on the MODE.
449
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
451
# When reporting a bug, please describe a test case to reproduce it and
452
# include the following information:
454
# host-triplet: $host
457
# compiler flags: $LTCFLAGS
458
# linker: $LD (gnu? $with_gnu_ld)
459
# $progname: (GNU libtool) 2.2.6
460
# automake: $automake_version
461
# autoconf: $autoconf_version
463
# Report bugs to <bug-libtool@gnu.org>.
469
package_revision=1.3012
471
# Be Bourne compatible
472
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
475
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
476
# is contrary to our usage. Disable this feature.
477
alias -g '${1+"$@"}'='"$@"'
480
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
482
BIN_SH=xpg4; export BIN_SH # for Tru64
483
DUALCASE=1; export DUALCASE # for MKS sh
485
# NLS nuisances: We save the old values to restore during execute mode.
486
# Only set LANG and LC_ALL to C if already set.
487
# These must not be set unconditionally because not all systems understand
488
# e.g. LANG=C (notably SCO).
491
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
493
eval "if test \"\${$lt_var+set}\" = set; then
494
save_$lt_var=\$$lt_var
497
lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
498
lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
510
: ${EGREP="/bin/grep -E"}
511
: ${FGREP="/bin/grep -F"}
512
: ${GREP="/bin/grep"}
519
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
520
: ${Xsed="$SED -e 1s/^X//"}
525
EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
526
EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
528
exit_status=$EXIT_SUCCESS
530
# Make sure IFS has a sensible default
535
dirname="s,/[^/]*$,,"
538
# func_dirname_and_basename file append nondir_replacement
539
# perform func_basename and func_dirname in a single function
541
# dirname: Compute the dirname of FILE. If nonempty,
542
# add APPEND to the result, otherwise set result
543
# to NONDIR_REPLACEMENT.
544
# value returned in "$func_dirname_result"
545
# basename: Compute filename of FILE.
546
# value retuned in "$func_basename_result"
547
# Implementation must be kept synchronized with func_dirname
548
# and func_basename. For efficiency, we do not delegate to
549
# those functions but instead duplicate the functionality here.
550
func_dirname_and_basename ()
552
# Extract subdirectory from the argument.
553
func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
554
if test "X$func_dirname_result" = "X${1}"; then
555
func_dirname_result="${3}"
557
func_dirname_result="$func_dirname_result${2}"
559
func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
562
# Generated shell functions inserted here.
564
# func_dirname file append nondir_replacement
565
# Compute the dirname of FILE. If nonempty, add APPEND to the result,
566
# otherwise set result to NONDIR_REPLACEMENT.
570
*/*) func_dirname_result="${1%/*}${2}" ;;
571
* ) func_dirname_result="${3}" ;;
578
func_basename_result="${1##*/}"
581
# func_dirname_and_basename file append nondir_replacement
582
# perform func_basename and func_dirname in a single function
584
# dirname: Compute the dirname of FILE. If nonempty,
585
# add APPEND to the result, otherwise set result
586
# to NONDIR_REPLACEMENT.
587
# value returned in "$func_dirname_result"
588
# basename: Compute filename of FILE.
589
# value retuned in "$func_basename_result"
590
# Implementation must be kept synchronized with func_dirname
591
# and func_basename. For efficiency, we do not delegate to
592
# those functions but instead duplicate the functionality here.
593
func_dirname_and_basename ()
596
*/*) func_dirname_result="${1%/*}${2}" ;;
597
* ) func_dirname_result="${3}" ;;
599
func_basename_result="${1##*/}"
602
# func_stripname prefix suffix name
603
# strip PREFIX and SUFFIX off of NAME.
604
# PREFIX and SUFFIX must not contain globbing or regex special
605
# characters, hashes, percent signs, but SUFFIX may contain a leading
606
# dot (in which case that matches only a dot).
609
# pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
610
# positional parameters, so assign one to ordinary parameter first.
611
func_stripname_result=${3}
612
func_stripname_result=${func_stripname_result#"${1}"}
613
func_stripname_result=${func_stripname_result%"${2}"}
619
func_opt_split_opt=${1%%=*}
620
func_opt_split_arg=${1#*=}
627
*.lo) func_lo2o_result=${1%.lo}.${objext} ;;
628
*) func_lo2o_result=${1} ;;
632
# func_xform libobj-or-source
635
func_xform_result=${1%.*}.lo
638
# func_arith arithmetic-term...
641
func_arith_result=$(( $* ))
645
# STRING may not start with a hyphen.
648
func_len_result=${#1}
652
# func_append var value
653
# Append VALUE to the end of shell variable VAR.
658
# Generated shell functions inserted here.
660
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
661
# is ksh but when the shell is invoked as "sh" and the current value of
662
# the _XPG environment variable is not equal to 1 (one), the special
663
# positional parameter $0, within a function call, is the name of the
667
# The name of this program:
668
# In the unlikely event $progname began with a '-', it would play havoc with
669
# func_echo (imagine progname=-n), so we prepend ./ in that case:
670
func_dirname_and_basename "$progpath"
671
progname=$func_basename_result
673
-*) progname=./$progname ;;
676
# Make sure we have an absolute path for reexecution:
678
[\\/]*|[A-Za-z]:\\*) ;;
680
progdir=$func_dirname_result
681
progdir=`cd "$progdir" && pwd`
682
progpath="$progdir/$progname"
687
for progdir in $PATH; do
689
test -x "$progdir/$progname" && break
692
test -n "$progdir" || progdir=`pwd`
693
progpath="$progdir/$progname"
697
# Sed substitution that helps us do robust quoting. It backslashifies
698
# metacharacters that are still active within double-quoted strings.
699
Xsed="${SED}"' -e 1s/^X//'
700
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
702
# Same as above, but do not quote variable references.
703
double_quote_subst='s/\(["`\\]\)/\\\1/g'
705
# Re-`\' parameter expansions in output of double_quote_subst that were
706
# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
707
# in input to double_quote_subst, that '$' was protected from expansion.
708
# Since each input `\' is now two `\'s, look for any number of runs of
709
# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
714
sed_double_backslash="\
718
s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
729
# Echo program name prefixed message, along with the current mode
730
# name if it has been set yet.
733
$ECHO "$progname${mode+: }$mode: $*"
736
# func_verbose arg...
737
# Echo program name prefixed message in verbose mode only.
740
$opt_verbose && func_echo ${1+"$@"}
742
# A bug in bash halts the script if the last line of a function
743
# fails when set -e is in force, so we need another command to
749
# Echo program name prefixed message to standard error.
752
$ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
755
# func_warning arg...
756
# Echo program name prefixed warning message to standard error.
759
$opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
765
# func_fatal_error arg...
766
# Echo program name prefixed message to standard error, and exit.
773
# func_fatal_help arg...
774
# Echo program name prefixed message to standard error, followed by
775
# a help hint, and exit.
779
func_fatal_error "$help"
781
help="Try \`$progname --help' for more information." ## default
784
# func_grep expression filename
785
# Check whether EXPRESSION matches any line of FILENAME, without output.
788
$GREP "$1" "$2" >/dev/null 2>&1
792
# func_mkdir_p directory-path
793
# Make sure the entire path to DIRECTORY-PATH is available.
796
my_directory_path="$1"
799
if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
801
# Protect directory names starting with `-'
802
case $my_directory_path in
803
-*) my_directory_path="./$my_directory_path" ;;
806
# While some portion of DIR does not yet exist...
807
while test ! -d "$my_directory_path"; do
808
# ...make a list in topmost first order. Use a colon delimited
809
# list incase some portion of path contains whitespace.
810
my_dir_list="$my_directory_path:$my_dir_list"
812
# If the last portion added has no slash in it, the list is done
813
case $my_directory_path in */*) ;; *) break ;; esac
815
# ...otherwise throw away the child directory and loop
816
my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
818
my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
820
save_mkdir_p_IFS="$IFS"; IFS=':'
821
for my_dir in $my_dir_list; do
822
IFS="$save_mkdir_p_IFS"
823
# mkdir can fail with a `File exist' error if two processes
824
# try to create one of the directories concurrently. Don't
826
$MKDIR "$my_dir" 2>/dev/null || :
828
IFS="$save_mkdir_p_IFS"
830
# Bail out if we (or some other process) failed to create a directory.
831
test -d "$my_directory_path" || \
832
func_fatal_error "Failed to create \`$1'"
837
# func_mktempdir [string]
838
# Make a temporary directory that won't clash with other running
839
# libtool processes, and avoids race conditions if possible. If
840
# given, STRING is the basename for that directory.
843
my_template="${TMPDIR-/tmp}/${1-$progname}"
845
if test "$opt_dry_run" = ":"; then
846
# Return a directory name, but don't create it in dry-run mode
847
my_tmpdir="${my_template}-$$"
850
# If mktemp works, use that first and foremost
851
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
853
if test ! -d "$my_tmpdir"; then
854
# Failing that, at least try and use $RANDOM to avoid a race
855
my_tmpdir="${my_template}-${RANDOM-0}$$"
857
save_mktempdir_umask=`umask`
860
umask $save_mktempdir_umask
863
# If we're not in dry-run mode, bomb out on failure
864
test -d "$my_tmpdir" || \
865
func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
868
$ECHO "X$my_tmpdir" | $Xsed
872
# func_quote_for_eval arg
873
# Aesthetically quote ARG to be evaled later.
874
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
875
# is double-quoted, suitable for a subsequent eval, whereas
876
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
877
# which are still active within double quotes backslashified.
878
func_quote_for_eval ()
882
func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
884
func_quote_for_eval_unquoted_result="$1" ;;
887
case $func_quote_for_eval_unquoted_result in
888
# Double-quote args containing shell metacharacters to delay
889
# word splitting, command substitution and and variable
890
# expansion for a subsequent eval.
891
# Many Bourne shells cannot handle close brackets correctly
892
# in scan sets, so we specify it separately.
893
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
894
func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
897
func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
902
# func_quote_for_expand arg
903
# Aesthetically quote ARG to be evaled later; same as above,
904
# but do not quote variable references.
905
func_quote_for_expand ()
909
my_arg=`$ECHO "X$1" | $Xsed \
910
-e "$double_quote_subst" -e "$sed_double_backslash"` ;;
916
# Double-quote args containing shell metacharacters to delay
917
# word splitting and command substitution for a subsequent eval.
918
# Many Bourne shells cannot handle close brackets correctly
919
# in scan sets, so we specify it separately.
920
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
925
func_quote_for_expand_result="$my_arg"
929
# func_show_eval cmd [fail_exp]
930
# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
931
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
932
# is given, then evaluate it.
938
${opt_silent-false} || {
939
func_quote_for_expand "$my_cmd"
940
eval "func_echo $func_quote_for_expand_result"
943
if ${opt_dry_run-false}; then :; else
946
if test "$my_status" -eq 0; then :; else
947
eval "(exit $my_status); $my_fail_exp"
953
# func_show_eval_locale cmd [fail_exp]
954
# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
955
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
956
# is given, then evaluate it. Use the saved locale for evaluation.
957
func_show_eval_locale ()
962
${opt_silent-false} || {
963
func_quote_for_expand "$my_cmd"
964
eval "func_echo $func_quote_for_expand_result"
967
if ${opt_dry_run-false}; then :; else
968
eval "$lt_user_locale
971
eval "$lt_safe_locale"
972
if test "$my_status" -eq 0; then :; else
973
eval "(exit $my_status); $my_fail_exp"
983
# Echo version message to standard output and exit.
986
$SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
989
s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
996
# Echo short help message to standard output and exit.
999
$SED -n '/^# Usage:/,/# -h/ {
1002
s/\$progname/'$progname'/
1006
$ECHO "run \`$progname --help | more' for full usage"
1011
# Echo long help message to standard output and exit.
1014
$SED -n '/^# Usage:/,/# Report bugs to/ {
1017
s*\$progname*'$progname'*
1019
s*\$SHELL*'"$SHELL"'*
1021
s*\$LTCFLAGS*'"$LTCFLAGS"'*
1023
s/\$with_gnu_ld/'"$with_gnu_ld"'/
1024
s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1025
s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1031
# func_missing_arg argname
1032
# Echo program name prefixed message to standard error and set global
1036
func_error "missing argument for $1"
1046
# Check that we have a working $ECHO.
1047
if test "X$1" = X--no-reexec; then
1048
# Discard the --no-reexec flag, and continue.
1050
elif test "X$1" = X--fallback-echo; then
1051
# Avoid inline document here, it may be left over
1053
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
1054
# Yippee, $ECHO works!
1057
# Restart under the correct shell, and then maybe $ECHO will work.
1058
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
1061
if test "X$1" = X--fallback-echo; then
1062
# used as fallback echo
1070
magic="%%%MAGIC variable%%%"
1071
magic_exe="%%%MAGIC EXE variable%%%"
1078
lo2o="s/\\.lo\$/.${objext}/"
1079
o2lo="s/\\.${objext}\$/.lo/"
1084
opt_duplicate_deps=false
1088
# If this variable is set in any of the actions, the command in it
1089
# will be execed at the end. This prevents here-documents from being
1090
# left over by shells.
1093
# func_fatal_configuration arg...
1094
# Echo program name prefixed message to standard error, followed by
1095
# a configuration failure hint, and exit.
1096
func_fatal_configuration ()
1098
func_error ${1+"$@"}
1099
func_error "See the $PACKAGE documentation for more information."
1100
func_fatal_error "Fatal configuration error."
1105
# Display the configuration for all the tags in this script.
1108
re_begincf='^# ### BEGIN LIBTOOL'
1109
re_endcf='^# ### END LIBTOOL'
1111
# Default configuration.
1112
$SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1114
# Now print the configurations for the tags.
1115
for tagname in $taglist; do
1116
$SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1123
# Display the features supported by this script.
1127
if test "$build_libtool_libs" = yes; then
1128
$ECHO "enable shared libraries"
1130
$ECHO "disable shared libraries"
1132
if test "$build_old_libs" = yes; then
1133
$ECHO "enable static libraries"
1135
$ECHO "disable static libraries"
1141
# func_enable_tag tagname
1142
# Verify that TAGNAME is valid, and either flag an error and exit, or
1143
# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1150
re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1151
re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1152
sed_extractcf="/$re_begincf/,/$re_endcf/p"
1157
func_fatal_error "invalid tag name: $tagname"
1161
# Don't test for the "default" C tag, as we know it's
1162
# there but not specially marked.
1166
if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1167
taglist="$taglist $tagname"
1169
# Evaluate the configuration. Be careful to quote the path
1170
# and the sed script, to avoid splitting on whitespace, but
1171
# also don't use non-portable quotes within backquotes within
1172
# quotes we have to do it in 2 steps:
1173
extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1176
func_error "ignoring unknown tag $tagname"
1182
# Parse options once, thoroughly. This comes as soon as possible in
1183
# the script to make things like `libtool --version' happen quickly.
1186
# Shorthand for --mode=foo, only valid as the first argument
1189
shift; set dummy --mode clean ${1+"$@"}; shift
1191
compile|compil|compi|comp|com|co|c)
1192
shift; set dummy --mode compile ${1+"$@"}; shift
1194
execute|execut|execu|exec|exe|ex|e)
1195
shift; set dummy --mode execute ${1+"$@"}; shift
1197
finish|finis|fini|fin|fi|f)
1198
shift; set dummy --mode finish ${1+"$@"}; shift
1200
install|instal|insta|inst|ins|in|i)
1201
shift; set dummy --mode install ${1+"$@"}; shift
1204
shift; set dummy --mode link ${1+"$@"}; shift
1206
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1207
shift; set dummy --mode uninstall ${1+"$@"}; shift
1211
# Parse non-mode specific arguments:
1212
while test "$#" -gt 0; do
1217
--config) func_config ;;
1219
--debug) preserve_args="$preserve_args $opt"
1220
func_echo "enabling shell trace mode"
1225
-dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
1226
execute_dlfiles="$execute_dlfiles $1"
1230
--dry-run | -n) opt_dry_run=: ;;
1231
--features) func_features ;;
1232
--finish) mode="finish" ;;
1234
--mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
1236
# Valid mode arguments:
1246
# Catch anything else as an error
1247
*) func_error "invalid argument for $opt"
1257
--preserve-dup-deps)
1258
opt_duplicate_deps=: ;;
1260
--quiet|--silent) preserve_args="$preserve_args $opt"
1264
--verbose| -v) preserve_args="$preserve_args $opt"
1268
--tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
1269
preserve_args="$preserve_args $opt $1"
1270
func_enable_tag "$1" # tagname is set here
1274
# Separate optargs to long options:
1275
-dlopen=*|--mode=*|--tag=*)
1276
func_opt_split "$opt"
1277
set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
1281
-\?|-h) func_usage ;;
1282
--help) opt_help=: ;;
1283
--version) func_version ;;
1285
-*) func_fatal_help "unrecognized option \`$opt'" ;;
1295
*cygwin* | *mingw* | *pw32* | *cegcc*)
1296
# don't eliminate duplications in $postdeps and $predeps
1297
opt_duplicate_compiler_generated_deps=:
1300
opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
1304
# Having warned about all mis-specified options, bail out if
1305
# anything was wrong.
1306
$exit_cmd $EXIT_FAILURE
1309
# func_check_version_match
1310
# Ensure that we are using m4 macros, and libtool script from the same
1311
# release of libtool.
1312
func_check_version_match ()
1314
if test "$package_revision" != "$macro_revision"; then
1315
if test "$VERSION" != "$macro_version"; then
1316
if test -z "$macro_version"; then
1318
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1319
$progname: definition of this LT_INIT comes from an older release.
1320
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1321
$progname: and run autoconf again.
1325
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1326
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1327
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1328
$progname: and run autoconf again.
1333
$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1334
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
1335
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
1336
$progname: of $PACKAGE $VERSION and run autoconf again.
1350
# Sanity checks first:
1351
func_check_version_match
1353
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1354
func_fatal_configuration "not configured to build any kind of library"
1357
test -z "$mode" && func_fatal_error "error: you must specify a MODE."
1361
eval std_shrext=\"$shrext_cmds\"
1364
# Only execute mode is allowed to have -dlopen flags.
1365
if test -n "$execute_dlfiles" && test "$mode" != execute; then
1366
func_error "unrecognized option \`-dlopen'"
1371
# Change the help message to a mode-specific one.
1372
generic_help="$help"
1373
help="Try \`$progname --help --mode=$mode' for more information."
1378
# True iff FILE is a libtool `.la' library or `.lo' object file.
1379
# This function is only a basic sanity check; it will hardly flush out
1380
# determined imposters.
1384
$SED -e 4q "$1" 2>/dev/null \
1385
| $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1388
# func_lalib_unsafe_p file
1389
# True iff FILE is a libtool `.la' library or `.lo' object file.
1390
# This function implements the same check as func_lalib_p without
1391
# resorting to external programs. To this end, it redirects stdin and
1392
# closes it afterwards, without saving the original file descriptor.
1393
# As a safety measure, use it only where a negative result would be
1394
# fatal anyway. Works if `file' does not exist.
1395
func_lalib_unsafe_p ()
1398
if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1399
for lalib_p_l in 1 2 3 4
1402
case "$lalib_p_line" in
1403
\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1408
test "$lalib_p" = yes
1411
# func_ltwrapper_script_p file
1412
# True iff FILE is a libtool wrapper script
1413
# This function is only a basic sanity check; it will hardly flush out
1414
# determined imposters.
1415
func_ltwrapper_script_p ()
1420
# func_ltwrapper_executable_p file
1421
# True iff FILE is a libtool wrapper executable
1422
# This function is only a basic sanity check; it will hardly flush out
1423
# determined imposters.
1424
func_ltwrapper_executable_p ()
1426
func_ltwrapper_exec_suffix=
1429
*) func_ltwrapper_exec_suffix=.exe ;;
1431
$GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1434
# func_ltwrapper_scriptname file
1435
# Assumes file is an ltwrapper_executable
1436
# uses $file to determine the appropriate filename for a
1437
# temporary ltwrapper_script.
1438
func_ltwrapper_scriptname ()
1440
func_ltwrapper_scriptname_result=""
1441
if func_ltwrapper_executable_p "$1"; then
1442
func_dirname_and_basename "$1" "" "."
1443
func_stripname '' '.exe' "$func_basename_result"
1444
func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1448
# func_ltwrapper_p file
1449
# True iff FILE is a libtool wrapper script or wrapper executable
1450
# This function is only a basic sanity check; it will hardly flush out
1451
# determined imposters.
1454
func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1458
# func_execute_cmds commands fail_cmd
1459
# Execute tilde-delimited COMMANDS.
1460
# If FAIL_CMD is given, eval that upon failure.
1461
# FAIL_CMD may read-access the current command in variable CMD!
1462
func_execute_cmds ()
1465
save_ifs=$IFS; IFS='~'
1469
func_show_eval "$cmd" "${2-:}"
1476
# Source FILE, adding directory component if necessary.
1477
# Note that it is not necessary on cygwin/mingw to append a dot to
1478
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1479
# behavior happens only for exec(3), not for open(2)! Also, sourcing
1480
# `FILE.' does not work on cygwin managed mounts.
1485
*/* | *\\*) . "$1" ;;
1491
# func_infer_tag arg
1492
# Infer tagged configuration to use if any are available and
1493
# if one wasn't chosen via the "--tag" command line option.
1494
# Only attempt this if the compiler in the base compile
1495
# command doesn't match the default compiler.
1496
# arg is usually of the form 'gcc ...'
1500
if test -n "$available_tags" && test -z "$tagname"; then
1503
func_quote_for_eval "$arg"
1504
CC_quoted="$CC_quoted $func_quote_for_eval_result"
1507
# Blanks in the command may have been stripped by the calling shell,
1508
# but not from the CC environment variable when configure was run.
1509
" $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1510
# Blanks at the start of $base_compile will cause this to fail
1511
# if we don't check for them as well.
1513
for z in $available_tags; do
1514
if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1515
# Evaluate the configuration.
1516
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1519
# Double-quote args containing other shell metacharacters.
1520
func_quote_for_eval "$arg"
1521
CC_quoted="$CC_quoted $func_quote_for_eval_result"
1524
" $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1525
# The compiler in the base compile command matches
1526
# the one in the tagged configuration.
1527
# Assume this is the tagged configuration we want.
1534
# If $tagname still isn't set, then no tagged configuration
1535
# was found and let the user know that the "--tag" command
1536
# line option must be used.
1537
if test -z "$tagname"; then
1538
func_echo "unable to infer tagged configuration"
1539
func_fatal_error "specify a tag with \`--tag'"
1541
# func_verbose "using $tagname tagged configuration"
1550
# func_write_libtool_object output_name pic_name nonpic_name
1551
# Create a libtool object file (analogous to a ".la" file),
1552
# but don't create it if we're doing a dry run.
1553
func_write_libtool_object ()
1556
if test "$build_libtool_libs" = yes; then
1562
if test "$build_old_libs" = yes; then
1563
write_oldobj=\'${3}\'
1569
cat >${write_libobj}T <<EOF
1570
# $write_libobj - a libtool object file
1571
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1573
# Please DO NOT delete this file!
1574
# It is necessary for linking the library.
1576
# Name of the PIC object.
1577
pic_object=$write_lobj
1579
# Name of the non-PIC object
1580
non_pic_object=$write_oldobj
1583
$MV "${write_libobj}T" "${write_libobj}"
1587
# func_mode_compile arg...
1588
func_mode_compile ()
1591
# Get the compilation command and the source file.
1593
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1605
# do not "continue". Instead, add this to base_compile
1617
# Accept any command-line options.
1620
test -n "$libobj" && \
1621
func_fatal_error "you cannot specify \`-o' more than once"
1626
-pie | -fpie | -fPIE)
1627
pie_flag="$pie_flag $arg"
1631
-shared | -static | -prefer-pic | -prefer-non-pic)
1642
arg_mode=arg # the next one goes into the "base_compile" arg list
1643
continue # The current "srcfile" will either be retained or
1644
;; # replaced later. I would guess that would be a bug.
1647
func_stripname '-Wc,' '' "$arg"
1648
args=$func_stripname_result
1650
save_ifs="$IFS"; IFS=','
1651
for arg in $args; do
1653
func_quote_for_eval "$arg"
1654
lastarg="$lastarg $func_quote_for_eval_result"
1657
func_stripname ' ' '' "$lastarg"
1658
lastarg=$func_stripname_result
1660
# Add the arguments to base_compile.
1661
base_compile="$base_compile $lastarg"
1666
# Accept the current argument as the source file.
1667
# The previous "srcfile" becomes the current argument.
1674
esac # case $arg_mode
1676
# Aesthetically quote the previous argument.
1677
func_quote_for_eval "$lastarg"
1678
base_compile="$base_compile $func_quote_for_eval_result"
1683
func_fatal_error "you must specify an argument for -Xcompile"
1686
func_fatal_error "you must specify a target with \`-o'"
1689
# Get the name of the library object.
1690
test -z "$libobj" && {
1691
func_basename "$srcfile"
1692
libobj="$func_basename_result"
1697
# Recognize several different file suffixes.
1698
# If the user specifies -o file.o, it is replaced with file.lo
1701
*.ada | *.adb | *.ads | *.asm | \
1702
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1703
*.[fF][09]? | *.for | *.java | *.obj | *.sx)
1704
func_xform "$libobj"
1705
libobj=$func_xform_result
1710
*.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1712
func_fatal_error "cannot determine name of library object from \`$libobj'"
1716
func_infer_tag $base_compile
1718
for arg in $later; do
1721
test "$build_libtool_libs" != yes && \
1722
func_fatal_configuration "can not build a shared library"
1728
build_libtool_libs=no
1745
func_quote_for_eval "$libobj"
1746
test "X$libobj" != "X$func_quote_for_eval_result" \
1747
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1748
&& func_warning "libobj name \`$libobj' may not contain shell special characters."
1749
func_dirname_and_basename "$obj" "/" ""
1750
objname="$func_basename_result"
1751
xdir="$func_dirname_result"
1752
lobj=${xdir}$objdir/$objname
1754
test -z "$base_compile" && \
1755
func_fatal_help "you must specify a compilation command"
1757
# Delete any leftover library objects.
1758
if test "$build_old_libs" = yes; then
1759
removelist="$obj $lobj $libobj ${libobj}T"
1761
removelist="$lobj $libobj ${libobj}T"
1764
# On Cygwin there's no "real" PIC flag so we must build both object types
1766
cygwin* | mingw* | pw32* | os2* | cegcc*)
1770
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1771
# non-PIC code in shared libraries is not supported
1775
# Calculate the filename of the output object if compiler does
1776
# not support -o with -c
1777
if test "$compiler_c_o" = no; then
1778
output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1779
lockfile="$output_obj.lock"
1786
# Lock this critical section if it is needed
1787
# We use this script file to make the link, it avoids creating a new file
1788
if test "$need_locks" = yes; then
1789
until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
1790
func_echo "Waiting for $lockfile to be removed"
1793
elif test "$need_locks" = warn; then
1794
if test -f "$lockfile"; then
1796
*** ERROR, $lockfile exists and contains:
1797
`cat $lockfile 2>/dev/null`
1799
This indicates that another process is trying to use the same
1800
temporary object file, and libtool could not work around it because
1801
your compiler does not support \`-c' and \`-o' together. If you
1802
repeat this compilation, it may succeed, by chance, but you had better
1803
avoid parallel builds (make -j) in this platform, or get a better
1806
$opt_dry_run || $RM $removelist
1809
removelist="$removelist $output_obj"
1810
$ECHO "$srcfile" > "$lockfile"
1813
$opt_dry_run || $RM $removelist
1814
removelist="$removelist $lockfile"
1815
trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1817
if test -n "$fix_srcfile_path"; then
1818
eval srcfile=\"$fix_srcfile_path\"
1820
func_quote_for_eval "$srcfile"
1821
qsrcfile=$func_quote_for_eval_result
1823
# Only build a PIC object if we are building libtool libraries.
1824
if test "$build_libtool_libs" = yes; then
1825
# Without this assignment, base_compile gets emptied.
1826
fbsd_hideous_sh_bug=$base_compile
1828
if test "$pic_mode" != no; then
1829
command="$base_compile $qsrcfile $pic_flag"
1831
# Don't build PIC code
1832
command="$base_compile $qsrcfile"
1835
func_mkdir_p "$xdir$objdir"
1837
if test -z "$output_obj"; then
1838
# Place PIC objects in $objdir
1839
command="$command -o $lobj"
1842
func_show_eval_locale "$command" \
1843
'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1845
if test "$need_locks" = warn &&
1846
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1848
*** ERROR, $lockfile contains:
1849
`cat $lockfile 2>/dev/null`
1851
but it should contain:
1854
This indicates that another process is trying to use the same
1855
temporary object file, and libtool could not work around it because
1856
your compiler does not support \`-c' and \`-o' together. If you
1857
repeat this compilation, it may succeed, by chance, but you had better
1858
avoid parallel builds (make -j) in this platform, or get a better
1861
$opt_dry_run || $RM $removelist
1865
# Just move the object if needed, then go on to compile the next one
1866
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1867
func_show_eval '$MV "$output_obj" "$lobj"' \
1868
'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1871
# Allow error messages only from the first compilation.
1872
if test "$suppress_opt" = yes; then
1873
suppress_output=' >/dev/null 2>&1'
1877
# Only build a position-dependent object if we build old libraries.
1878
if test "$build_old_libs" = yes; then
1879
if test "$pic_mode" != yes; then
1880
# Don't build PIC code
1881
command="$base_compile $qsrcfile$pie_flag"
1883
command="$base_compile $qsrcfile $pic_flag"
1885
if test "$compiler_c_o" = yes; then
1886
command="$command -o $obj"
1889
# Suppress compiler output if we already did a PIC compilation.
1890
command="$command$suppress_output"
1891
func_show_eval_locale "$command" \
1892
'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1894
if test "$need_locks" = warn &&
1895
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1897
*** ERROR, $lockfile contains:
1898
`cat $lockfile 2>/dev/null`
1900
but it should contain:
1903
This indicates that another process is trying to use the same
1904
temporary object file, and libtool could not work around it because
1905
your compiler does not support \`-c' and \`-o' together. If you
1906
repeat this compilation, it may succeed, by chance, but you had better
1907
avoid parallel builds (make -j) in this platform, or get a better
1910
$opt_dry_run || $RM $removelist
1914
# Just move the object if needed
1915
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1916
func_show_eval '$MV "$output_obj" "$obj"' \
1917
'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1922
func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1924
# Unlock the critical section if it was locked
1925
if test "$need_locks" != no; then
1926
removelist=$lockfile
1935
test "$mode" = compile && func_mode_compile ${1+"$@"}
1940
# We need to display help for each of the modes.
1943
# Generic help is extracted from the usage comments
1944
# at the start of this file.
1950
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1952
Remove files from the build directory.
1954
RM is the name of the program to use to delete files associated with each FILE
1955
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1958
If FILE is a libtool library, object or program, all the files associated
1959
with it are deleted. Otherwise, only FILE itself is deleted using RM."
1964
"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1966
Compile a source file into a libtool library object.
1968
This mode accepts the following additional options:
1970
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
1971
-no-suppress do not suppress compiler output for multiple passes
1972
-prefer-pic try to building PIC objects only
1973
-prefer-non-pic try to building non-PIC objects only
1974
-shared do not build a \`.o' file suitable for static linking
1975
-static only build a \`.o' file suitable for static linking
1977
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1978
from the given SOURCEFILE.
1980
The output file name is determined by removing the directory component from
1981
SOURCEFILE, then substituting the C source code suffix \`.c' with the
1982
library object suffix, \`.lo'."
1987
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
1989
Automatically set library path, then run a program.
1991
This mode accepts the following additional options:
1993
-dlopen FILE add the directory containing FILE to the library path
1995
This mode sets the library path environment variable according to \`-dlopen'
1998
If any of the ARGS are libtool executable wrappers, then they are translated
1999
into their corresponding uninstalled binary, and any of their required library
2000
directories are added to the library path.
2002
Then, COMMAND is executed, with ARGS as arguments."
2007
"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2009
Complete the installation of libtool libraries.
2011
Each LIBDIR is a directory that contains libtool libraries.
2013
The commands that this mode executes may require superuser privileges. Use
2014
the \`--dry-run' option if you just want to see what would be executed."
2019
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2021
Install executables or libraries.
2023
INSTALL-COMMAND is the installation command. The first component should be
2024
either the \`install' or \`cp' program.
2026
The following components of INSTALL-COMMAND are treated specially:
2028
-inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2030
The rest of the components are interpreted as arguments to that command (only
2031
BSD-compatible install options are recognized)."
2036
"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2038
Link object files or libraries together to form another library, or to
2039
create an executable program.
2041
LINK-COMMAND is a command using the C compiler that you would use to create
2042
a program from several object files.
2044
The following components of LINK-COMMAND are treated specially:
2046
-all-static do not do any dynamic linking at all
2047
-avoid-version do not add a version suffix if possible
2048
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2049
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2050
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2051
-export-symbols SYMFILE
2052
try to export only the symbols listed in SYMFILE
2053
-export-symbols-regex REGEX
2054
try to export only the symbols matching REGEX
2055
-LLIBDIR search LIBDIR for required installed libraries
2056
-lNAME OUTPUT-FILE requires the installed library libNAME
2057
-module build a library that can dlopened
2058
-no-fast-install disable the fast-install mode
2059
-no-install link a not-installable executable
2060
-no-undefined declare that a library does not refer to external symbols
2061
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2062
-objectlist FILE Use a list of object files found in FILE to specify objects
2063
-precious-files-regex REGEX
2064
don't remove output files matching REGEX
2065
-release RELEASE specify package release information
2066
-rpath LIBDIR the created library will eventually be installed in LIBDIR
2067
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2068
-shared only do dynamic linking of libtool libraries
2069
-shrext SUFFIX override the standard shared library file extension
2070
-static do not do any dynamic linking of uninstalled libtool libraries
2071
-static-libtool-libs
2072
do not do any dynamic linking of libtool libraries
2073
-version-info CURRENT[:REVISION[:AGE]]
2074
specify library version info [each variable defaults to 0]
2075
-weak LIBNAME declare that the target provides the LIBNAME interface
2077
All other options (arguments beginning with \`-') are ignored.
2079
Every other argument is treated as a filename. Files ending in \`.la' are
2080
treated as uninstalled libtool libraries, other files are standard or library
2083
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2084
only library objects (\`.lo' files) may be specified, and \`-rpath' is
2085
required, except when creating a convenience library.
2087
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2088
using \`ar' and \`ranlib', or on Windows using \`lib'.
2090
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2091
is created, otherwise an executable program is created."
2096
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2098
Remove libraries from an installation directory.
2100
RM is the name of the program to use to delete files associated with each FILE
2101
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2104
If FILE is a libtool library, all the files associated with it are deleted.
2105
Otherwise, only FILE itself is deleted using RM."
2109
func_fatal_help "invalid operation mode \`$mode'"
2114
$ECHO "Try \`$progname --help' for more information about other modes."
2119
# Now that we've collected a possible --mode arg, show help if necessary
2120
$opt_help && func_mode_help
2123
# func_mode_execute arg...
2124
func_mode_execute ()
2127
# The first argument is the command name.
2130
func_fatal_help "you must specify a COMMAND"
2132
# Handle -dlopen flags immediately.
2133
for file in $execute_dlfiles; do
2135
|| func_fatal_help "\`$file' is not a file"
2140
# Check to see that this really is a libtool archive.
2141
func_lalib_unsafe_p "$file" \
2142
|| func_fatal_help "\`$lib' is not a valid libtool archive"
2144
# Read the libtool library.
2149
# Skip this library if it cannot be dlopened.
2150
if test -z "$dlname"; then
2151
# Warn if it was a shared library.
2152
test -n "$library_names" && \
2153
func_warning "\`$file' was not linked with \`-export-dynamic'"
2157
func_dirname "$file" "" "."
2158
dir="$func_dirname_result"
2160
if test -f "$dir/$objdir/$dlname"; then
2163
if test ! -f "$dir/$dlname"; then
2164
func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2170
# Just add the directory containing the .lo file.
2171
func_dirname "$file" "" "."
2172
dir="$func_dirname_result"
2176
func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2181
# Get the absolute pathname.
2182
absdir=`cd "$dir" && pwd`
2183
test -n "$absdir" && dir="$absdir"
2185
# Now add the directory to shlibpath_var.
2186
if eval "test -z \"\$$shlibpath_var\""; then
2187
eval "$shlibpath_var=\"\$dir\""
2189
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2193
# This variable tells wrapper scripts just to set shlibpath_var
2194
# rather than running their programs.
2195
libtool_execute_magic="$magic"
2197
# Check if any of the arguments is a wrapper script.
2204
# Do a test to see if this is really a libtool program.
2205
if func_ltwrapper_script_p "$file"; then
2207
# Transform arg to wrapped name.
2208
file="$progdir/$program"
2209
elif func_ltwrapper_executable_p "$file"; then
2210
func_ltwrapper_scriptname "$file"
2211
func_source "$func_ltwrapper_scriptname_result"
2212
# Transform arg to wrapped name.
2213
file="$progdir/$program"
2217
# Quote arguments (to preserve shell metacharacters).
2218
func_quote_for_eval "$file"
2219
args="$args $func_quote_for_eval_result"
2222
if test "X$opt_dry_run" = Xfalse; then
2223
if test -n "$shlibpath_var"; then
2224
# Export the shlibpath_var.
2225
eval "export $shlibpath_var"
2228
# Restore saved environment variables
2229
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2231
eval "if test \"\${save_$lt_var+set}\" = set; then
2232
$lt_var=\$save_$lt_var; export $lt_var
2238
# Now prepare to actually exec the command.
2239
exec_cmd="\$cmd$args"
2241
# Display what would be done.
2242
if test -n "$shlibpath_var"; then
2243
eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2244
$ECHO "export $shlibpath_var"
2251
test "$mode" = execute && func_mode_execute ${1+"$@"}
2254
# func_mode_finish arg...
2261
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2264
libdirs="$libdirs $dir"
2267
for libdir in $libdirs; do
2268
if test -n "$finish_cmds"; then
2269
# Do each command in the finish commands.
2270
func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
2273
if test -n "$finish_eval"; then
2274
# Do the single finish_eval.
2275
eval cmds=\"$finish_eval\"
2276
$opt_dry_run || eval "$cmds" || admincmds="$admincmds
2282
# Exit here if they wanted silent mode.
2283
$opt_silent && exit $EXIT_SUCCESS
2285
$ECHO "X----------------------------------------------------------------------" | $Xsed
2286
$ECHO "Libraries have been installed in:"
2287
for libdir in $libdirs; do
2291
$ECHO "If you ever happen to want to link against installed libraries"
2292
$ECHO "in a given directory, LIBDIR, you must either use libtool, and"
2293
$ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
2294
$ECHO "flag during linking and do at least one of the following:"
2295
if test -n "$shlibpath_var"; then
2296
$ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
2297
$ECHO " during execution"
2299
if test -n "$runpath_var"; then
2300
$ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
2301
$ECHO " during linking"
2303
if test -n "$hardcode_libdir_flag_spec"; then
2305
eval flag=\"$hardcode_libdir_flag_spec\"
2307
$ECHO " - use the \`$flag' linker flag"
2309
if test -n "$admincmds"; then
2310
$ECHO " - have your system administrator run these commands:$admincmds"
2312
if test -f /etc/ld.so.conf; then
2313
$ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2317
$ECHO "See any operating system documentation about shared libraries for"
2319
solaris2.[6789]|solaris2.1[0-9])
2320
$ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2324
$ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
2327
$ECHO "X----------------------------------------------------------------------" | $Xsed
2331
test "$mode" = finish && func_mode_finish ${1+"$@"}
2334
# func_mode_install arg...
2335
func_mode_install ()
2338
# There may be an optional sh(1) argument at the beginning of
2339
# install_prog (especially on Windows NT).
2340
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2341
# Allow the use of GNU shtool's install command.
2342
$ECHO "X$nonopt" | $GREP shtool >/dev/null; then
2343
# Aesthetically quote it.
2344
func_quote_for_eval "$nonopt"
2345
install_prog="$func_quote_for_eval_result "
2353
# The real first argument should be the name of the installation program.
2354
# Aesthetically quote it.
2355
func_quote_for_eval "$arg"
2356
install_prog="$install_prog$func_quote_for_eval_result"
2358
# We need to accept at least all the BSD install flags.
2368
if test -n "$dest"; then
2369
files="$files $dest"
2377
case " $install_prog " in
2392
# If the previous option needed an argument, then skip it.
2393
if test -n "$prev"; then
2402
# Aesthetically quote the argument.
2403
func_quote_for_eval "$arg"
2404
install_prog="$install_prog $func_quote_for_eval_result"
2407
test -z "$install_prog" && \
2408
func_fatal_help "you must specify an install program"
2410
test -n "$prev" && \
2411
func_fatal_help "the \`$prev' option requires an argument"
2413
if test -z "$files"; then
2414
if test -z "$dest"; then
2415
func_fatal_help "no file or destination specified"
2417
func_fatal_help "you must specify a destination"
2421
# Strip any trailing slash from the destination.
2422
func_stripname '' '/' "$dest"
2423
dest=$func_stripname_result
2425
# Check to see that the destination is a directory.
2426
test -d "$dest" && isdir=yes
2427
if test "$isdir" = yes; then
2431
func_dirname_and_basename "$dest" "" "."
2432
destdir="$func_dirname_result"
2433
destname="$func_basename_result"
2435
# Not a directory, so check to see that there is only one file specified.
2436
set dummy $files; shift
2437
test "$#" -gt 1 && \
2438
func_fatal_help "\`$dest' is not a directory"
2441
[\\/]* | [A-Za-z]:[\\/]*) ;;
2443
for file in $files; do
2447
func_fatal_help "\`$destdir' must be an absolute directory name"
2454
# This variable tells wrapper scripts just to set variables rather
2455
# than running their programs.
2456
libtool_install_magic="$magic"
2461
for file in $files; do
2463
# Do each installation.
2466
# Do the static libraries later.
2467
staticlibs="$staticlibs $file"
2471
# Check to see that this really is a libtool archive.
2472
func_lalib_unsafe_p "$file" \
2473
|| func_fatal_help "\`$file' is not a valid libtool archive"
2480
# Add the libdir to current_libdirs if it is the destination.
2481
if test "X$destdir" = "X$libdir"; then
2482
case "$current_libdirs " in
2484
*) current_libdirs="$current_libdirs $libdir" ;;
2487
# Note the libdir as a future libdir.
2488
case "$future_libdirs " in
2490
*) future_libdirs="$future_libdirs $libdir" ;;
2494
func_dirname "$file" "/" ""
2495
dir="$func_dirname_result"
2498
if test -n "$relink_command"; then
2499
# Determine the prefix the user has applied to our future dir.
2500
inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2502
# Don't allow the user to place us outside of our expected
2503
# location b/c this prevents finding dependent libraries that
2504
# are installed to the same prefix.
2505
# At present, this check doesn't affect windows .dll's that
2506
# are installed into $libdir/../bin (currently, that works fine)
2507
# but it's something to keep an eye on.
2508
test "$inst_prefix_dir" = "$destdir" && \
2509
func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2511
if test -n "$inst_prefix_dir"; then
2512
# Stick the inst_prefix_dir data into the link command.
2513
relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2515
relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2518
func_warning "relinking \`$file'"
2519
func_show_eval "$relink_command" \
2520
'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2523
# See the names of the shared library.
2524
set dummy $library_names; shift
2525
if test -n "$1"; then
2530
test -n "$relink_command" && srcname="$realname"T
2532
# Install the shared library and build the symlinks.
2533
func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2537
cygwin* | mingw* | pw32* | cegcc*)
2545
if test -n "$tstripme" && test -n "$striplib"; then
2546
func_show_eval "$striplib $destdir/$realname" 'exit $?'
2549
if test "$#" -gt 0; then
2550
# Delete the old symlinks, and create new ones.
2551
# Try `ln -sf' first, because the `ln' binary might depend on
2552
# the symlink we replace! Solaris /bin/ln does not understand -f,
2553
# so we also need to try rm && ln -s.
2556
test "$linkname" != "$realname" \
2557
&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2561
# Do each command in the postinstall commands.
2562
lib="$destdir/$realname"
2563
func_execute_cmds "$postinstall_cmds" 'exit $?'
2566
# Install the pseudo-library for information purposes.
2567
func_basename "$file"
2568
name="$func_basename_result"
2569
instname="$dir/$name"i
2570
func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2572
# Maybe install the static library, too.
2573
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
2577
# Install (i.e. copy) a libtool object.
2579
# Figure out destination file name, if it wasn't already specified.
2580
if test -n "$destname"; then
2581
destfile="$destdir/$destname"
2583
func_basename "$file"
2584
destfile="$func_basename_result"
2585
destfile="$destdir/$destfile"
2588
# Deduce the name of the destination old-style object file.
2591
func_lo2o "$destfile"
2592
staticdest=$func_lo2o_result
2595
staticdest="$destfile"
2599
func_fatal_help "cannot copy a libtool object to \`$destfile'"
2603
# Install the libtool object if requested.
2604
test -n "$destfile" && \
2605
func_show_eval "$install_prog $file $destfile" 'exit $?'
2607
# Install the old object if enabled.
2608
if test "$build_old_libs" = yes; then
2609
# Deduce the name of the old-style object file.
2611
staticobj=$func_lo2o_result
2612
func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
2618
# Figure out destination file name, if it wasn't already specified.
2619
if test -n "$destname"; then
2620
destfile="$destdir/$destname"
2622
func_basename "$file"
2623
destfile="$func_basename_result"
2624
destfile="$destdir/$destfile"
2627
# If the file is missing, and there is a .exe on the end, strip it
2628
# because it is most likely a libtool script we actually want to
2633
if test ! -f "$file"; then
2634
func_stripname '' '.exe' "$file"
2635
file=$func_stripname_result
2641
# Do a test to see if this is really a libtool program.
2644
if func_ltwrapper_executable_p "$file"; then
2645
func_ltwrapper_scriptname "$file"
2646
wrapper=$func_ltwrapper_scriptname_result
2648
func_stripname '' '.exe' "$file"
2649
wrapper=$func_stripname_result
2656
if func_ltwrapper_script_p "$wrapper"; then
2660
func_source "$wrapper"
2662
# Check the variables that should have been set.
2663
test -z "$generated_by_libtool_version" && \
2664
func_fatal_error "invalid libtool wrapper script \`$wrapper'"
2667
for lib in $notinst_deplibs; do
2668
# Check to see that each library is installed.
2670
if test -f "$lib"; then
2673
libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2674
if test -n "$libdir" && test ! -f "$libfile"; then
2675
func_warning "\`$lib' has not been installed in \`$libdir'"
2681
func_source "$wrapper"
2684
if test "$fast_install" = no && test -n "$relink_command"; then
2686
if test "$finalize" = yes; then
2687
tmpdir=`func_mktempdir`
2688
func_basename "$file$stripped_ext"
2689
file="$func_basename_result"
2690
outputname="$tmpdir/$file"
2691
# Replace the output file specification.
2692
relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2695
func_quote_for_expand "$relink_command"
2696
eval "func_echo $func_quote_for_expand_result"
2698
if eval "$relink_command"; then :
2700
func_error "error: relink \`$file' with the above command before installing it"
2701
$opt_dry_run || ${RM}r "$tmpdir"
2706
func_warning "cannot relink \`$file'"
2710
# Install the binary that we compiled earlier.
2711
file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2715
# remove .exe since cygwin /usr/bin/install will append another
2717
case $install_prog,$host in
2718
*/usr/bin/install*,*cygwin*)
2719
case $file:$destfile in
2724
destfile=$destfile.exe
2727
func_stripname '' '.exe' "$destfile"
2728
destfile=$func_stripname_result
2733
func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
2734
$opt_dry_run || if test -n "$outputname"; then
2741
for file in $staticlibs; do
2742
func_basename "$file"
2743
name="$func_basename_result"
2745
# Set up the ranlib parameters.
2746
oldlib="$destdir/$name"
2748
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2750
if test -n "$stripme" && test -n "$old_striplib"; then
2751
func_show_eval "$old_striplib $oldlib" 'exit $?'
2754
# Do each command in the postinstall commands.
2755
func_execute_cmds "$old_postinstall_cmds" 'exit $?'
2758
test -n "$future_libdirs" && \
2759
func_warning "remember to run \`$progname --finish$future_libdirs'"
2761
if test -n "$current_libdirs"; then
2762
# Maybe just do a dry run.
2763
$opt_dry_run && current_libdirs=" -n$current_libdirs"
2764
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2770
test "$mode" = install && func_mode_install ${1+"$@"}
2773
# func_generate_dlsyms outputname originator pic_p
2774
# Extract symbols from dlprefiles and create ${outputname}S.o with
2775
# a dlpreopen symbol table.
2776
func_generate_dlsyms ()
2782
my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2785
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2786
if test -n "$NM" && test -n "$global_symbol_pipe"; then
2787
my_dlsyms="${my_outputname}S.c"
2789
func_error "not configured to extract global symbols from dlpreopened files"
2793
if test -n "$my_dlsyms"; then
2797
# Discover the nlist of each of the dlfiles.
2798
nlist="$output_objdir/${my_outputname}.nm"
2800
func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
2802
# Parse the name list into a source file.
2803
func_verbose "creating $output_objdir/$my_dlsyms"
2805
$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
2806
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2807
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2813
/* External symbol declarations for the compiler. */\
2816
if test "$dlself" = yes; then
2817
func_verbose "generating symbol list for \`$output'"
2819
$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2821
# Add our own program objects to the symbol list.
2822
progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2823
for progfile in $progfiles; do
2824
func_verbose "extracting global C symbols from \`$progfile'"
2825
$opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2828
if test -n "$exclude_expsyms"; then
2830
eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2831
eval '$MV "$nlist"T "$nlist"'
2835
if test -n "$export_symbols_regex"; then
2837
eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2838
eval '$MV "$nlist"T "$nlist"'
2842
# Prepare the list of exported symbols
2843
if test -z "$export_symbols"; then
2844
export_symbols="$output_objdir/$outputname.exp"
2847
eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2849
*cygwin* | *mingw* | *cegcc* )
2850
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2851
eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2857
eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2858
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2859
eval '$MV "$nlist"T "$nlist"'
2861
*cygwin | *mingw* | *cegcc* )
2862
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2863
eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2870
for dlprefile in $dlprefiles; do
2871
func_verbose "extracting global C symbols from \`$dlprefile'"
2872
func_basename "$dlprefile"
2873
name="$func_basename_result"
2875
eval '$ECHO ": $name " >> "$nlist"'
2876
eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2881
# Make sure we have at least an empty file.
2882
test -f "$nlist" || : > "$nlist"
2884
if test -n "$exclude_expsyms"; then
2885
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2886
$MV "$nlist"T "$nlist"
2889
# Try sorting and uniquifying the output.
2890
if $GREP -v "^: " < "$nlist" |
2891
if sort -k 3 </dev/null >/dev/null 2>&1; then
2896
uniq > "$nlist"S; then
2899
$GREP -v "^: " < "$nlist" > "$nlist"S
2902
if test -f "$nlist"S; then
2903
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2905
$ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2908
$ECHO >> "$output_objdir/$my_dlsyms" "\
2910
/* The mapping between symbol names and symbols. */
2917
*cygwin* | *mingw* | *cegcc* )
2918
$ECHO >> "$output_objdir/$my_dlsyms" "\
2919
/* DATA imports from DLLs on WIN32 con't be const, because
2920
runtime relocations are performed -- see ld's documentation
2921
on pseudo-relocs. */"
2924
echo >> "$output_objdir/$my_dlsyms" "\
2925
/* This system does not cope well with relocations in const data */"
2928
lt_dlsym_const=const ;;
2931
$ECHO >> "$output_objdir/$my_dlsyms" "\
2932
extern $lt_dlsym_const lt_dlsymlist
2933
lt_${my_prefix}_LTX_preloaded_symbols[];
2934
$lt_dlsym_const lt_dlsymlist
2935
lt_${my_prefix}_LTX_preloaded_symbols[] =
2937
{ \"$my_originator\", (void *) 0 },"
2939
case $need_lib_prefix in
2941
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2944
eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2947
$ECHO >> "$output_objdir/$my_dlsyms" "\
2951
/* This works around a problem in FreeBSD linker */
2952
#ifdef FREEBSD_WORKAROUND
2953
static const void *lt_preloaded_setup() {
2954
return lt_${my_prefix}_LTX_preloaded_symbols;
2964
pic_flag_for_symtable=
2965
case "$compile_command " in
2969
# compiling the symbol table file with pic_flag works around
2970
# a FreeBSD bug that causes programs to crash when -lm is
2971
# linked before any other PIC object. But we must not use
2972
# pic_flag when linking with -static. The problem exists in
2973
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2974
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2975
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2977
pic_flag_for_symtable=" $pic_flag" ;;
2979
if test "X$my_pic_p" != Xno; then
2980
pic_flag_for_symtable=" $pic_flag"
2987
for arg in $LTCFLAGS; do
2989
-pie | -fpie | -fPIE) ;;
2990
*) symtab_cflags="$symtab_cflags $arg" ;;
2994
# Now compile the dynamic symbol file.
2995
func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
2997
# Clean up the generated files.
2998
func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3000
# Transform the symbol file into the correct name.
3001
symfileobj="$output_objdir/${my_outputname}S.$objext"
3003
*cygwin* | *mingw* | *cegcc* )
3004
if test -f "$output_objdir/$my_outputname.def"; then
3005
compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3006
finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3008
compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3009
finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3013
compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3014
finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3019
func_fatal_error "unknown suffix for \`$my_dlsyms'"
3023
# We keep going just in case the user didn't refer to
3024
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3025
# really was required.
3027
# Nullify the symbol file.
3028
compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3029
finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3033
# func_win32_libid arg
3034
# return the library type of file 'arg'
3036
# Need a lot of goo to handle *both* DLLs and import libs
3037
# Has to be a shell function in order to 'eat' the argument
3038
# that is supplied when $file_magic_command is called.
3042
win32_libid_type="unknown"
3043
win32_fileres=`file -L $1 2>/dev/null`
3044
case $win32_fileres in
3045
*ar\ archive\ import\ library*) # definitely import
3046
win32_libid_type="x86 archive import"
3048
*ar\ archive*) # could be an import, or static
3049
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3050
$EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
3051
win32_nmres=`eval $NM -f posix -A $1 |
3060
case $win32_nmres in
3061
import*) win32_libid_type="x86 archive import";;
3062
*) win32_libid_type="x86 archive static";;
3067
win32_libid_type="x86 DLL"
3069
*executable*) # but shell scripts are "executable" too...
3070
case $win32_fileres in
3071
*MS\ Windows\ PE\ Intel*)
3072
win32_libid_type="x86 DLL"
3077
$ECHO "$win32_libid_type"
3082
# func_extract_an_archive dir oldlib
3083
func_extract_an_archive ()
3086
f_ex_an_ar_dir="$1"; shift
3087
f_ex_an_ar_oldlib="$1"
3088
func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
3089
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3092
func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3097
# func_extract_archives gentop oldlib ...
3098
func_extract_archives ()
3101
my_gentop="$1"; shift
3102
my_oldlibs=${1+"$@"}
3108
for my_xlib in $my_oldlibs; do
3109
# Extract the objects.
3111
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
3112
*) my_xabs=`pwd`"/$my_xlib" ;;
3114
func_basename "$my_xlib"
3115
my_xlib="$func_basename_result"
3118
case " $extracted_archives " in
3120
func_arith $extracted_serial + 1
3121
extracted_serial=$func_arith_result
3122
my_xlib_u=lt$extracted_serial-$my_xlib ;;
3126
extracted_archives="$extracted_archives $my_xlib_u"
3127
my_xdir="$my_gentop/$my_xlib_u"
3129
func_mkdir_p "$my_xdir"
3133
func_verbose "Extracting $my_xabs"
3134
# Do not bother doing anything if just a dry run
3136
darwin_orig_dir=`pwd`
3137
cd $my_xdir || exit $?
3138
darwin_archive=$my_xabs
3140
darwin_base_archive=`basename "$darwin_archive"`
3141
darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3142
if test -n "$darwin_arches"; then
3143
darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3145
func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3146
for darwin_arch in $darwin_arches ; do
3147
func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3148
$LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3149
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3150
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
3152
$RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3153
done # $darwin_arches
3154
## Okay now we've a bunch of thin objects, gotta fatten them up :)
3155
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3158
for darwin_file in $darwin_filelist; do
3159
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
3160
$LIPO -create -output "$darwin_file" $darwin_files
3161
done # $darwin_filelist
3163
cd "$darwin_orig_dir"
3166
func_extract_an_archive "$my_xdir" "$my_xabs"
3171
func_extract_an_archive "$my_xdir" "$my_xabs"
3174
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3177
func_extract_archives_result="$my_oldobjs"
3182
# func_emit_wrapper_part1 [arg=no]
3184
# Emit the first part of a libtool wrapper script on stdout.
3185
# For more information, see the description associated with
3186
# func_emit_wrapper(), below.
3187
func_emit_wrapper_part1 ()
3189
func_emit_wrapper_part1_arg1=no
3190
if test -n "$1" ; then
3191
func_emit_wrapper_part1_arg1=$1
3197
# $output - temporary wrapper script for $objdir/$outputname
3198
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3200
# The $output program cannot be directly executed until all the libtool
3201
# libraries that it depends on are installed.
3203
# This wrapper script should never be moved out of the build directory.
3204
# If it is, it will not operate correctly.
3206
# Sed substitution that helps us do robust quoting. It backslashifies
3207
# metacharacters that are still active within double-quoted strings.
3208
Xsed='${SED} -e 1s/^X//'
3209
sed_quote_subst='$sed_quote_subst'
3211
# Be Bourne compatible
3212
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3215
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3216
# is contrary to our usage. Disable this feature.
3217
alias -g '\${1+\"\$@\"}'='\"\$@\"'
3218
setopt NO_GLOB_SUBST
3220
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3222
BIN_SH=xpg4; export BIN_SH # for Tru64
3223
DUALCASE=1; export DUALCASE # for MKS sh
3225
# The HP-UX ksh and POSIX shell print the target directory to stdout
3227
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3229
relink_command=\"$relink_command\"
3231
# This environment variable determines our operation mode.
3232
if test \"\$libtool_install_magic\" = \"$magic\"; then
3233
# install mode needs the following variables:
3234
generated_by_libtool_version='$macro_version'
3235
notinst_deplibs='$notinst_deplibs'
3237
# When we are sourced in execute mode, \$file and \$ECHO are already set.
3238
if test \"\$libtool_execute_magic\" != \"$magic\"; then
3241
# Make sure echo works.
3242
if test \"X\$1\" = X--no-reexec; then
3243
# Discard the --no-reexec flag, and continue.
3245
elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
3246
# Yippee, \$ECHO works!
3249
# Restart under the correct shell, and then maybe \$ECHO will work.
3250
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3256
# Find the directory that this script lives in.
3257
thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3258
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3260
# Follow symbolic links until we get to the real thisdir.
3261
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3262
while test -n \"\$file\"; do
3263
destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3265
# If there was a directory component, then change thisdir.
3266
if test \"x\$destdir\" != \"x\$file\"; then
3267
case \"\$destdir\" in
3268
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3269
*) thisdir=\"\$thisdir/\$destdir\" ;;
3273
file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3274
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3278
# end: func_emit_wrapper_part1
3280
# func_emit_wrapper_part2 [arg=no]
3282
# Emit the second part of a libtool wrapper script on stdout.
3283
# For more information, see the description associated with
3284
# func_emit_wrapper(), below.
3285
func_emit_wrapper_part2 ()
3287
func_emit_wrapper_part2_arg1=no
3288
if test -n "$1" ; then
3289
func_emit_wrapper_part2_arg1=$1
3294
# Usually 'no', except on cygwin/mingw when embedded into
3296
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
3297
if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
3298
# special case for '.'
3299
if test \"\$thisdir\" = \".\"; then
3302
# remove .libs from thisdir
3303
case \"\$thisdir\" in
3304
*[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
3305
$objdir ) thisdir=. ;;
3309
# Try to get the absolute directory name.
3310
absdir=\`cd \"\$thisdir\" && pwd\`
3311
test -n \"\$absdir\" && thisdir=\"\$absdir\"
3314
if test "$fast_install" = yes; then
3316
program=lt-'$outputname'$exeext
3317
progdir=\"\$thisdir/$objdir\"
3319
if test ! -f \"\$progdir/\$program\" ||
3320
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3321
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3323
file=\"\$\$-\$program\"
3325
if test ! -d \"\$progdir\"; then
3326
$MKDIR \"\$progdir\"
3328
$RM \"\$progdir/\$file\"
3333
# relink executable if necessary
3334
if test -n \"\$relink_command\"; then
3335
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3337
$ECHO \"\$relink_command_output\" >&2
3338
$RM \"\$progdir/\$file\"
3343
$MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3344
{ $RM \"\$progdir/\$program\";
3345
$MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3346
$RM \"\$progdir/\$file\"
3350
program='$outputname'
3351
progdir=\"\$thisdir/$objdir\"
3357
if test -f \"\$progdir/\$program\"; then"
3359
# Export our shlibpath_var if we have one.
3360
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3362
# Add our own library path to $shlibpath_var
3363
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3365
# Some systems cannot cope with colon-terminated $shlibpath_var
3366
# The second colon is a workaround for a bug in BeOS R4 sed
3367
$shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3369
export $shlibpath_var
3373
# fixup the dll searchpath if we need to.
3374
if test -n "$dllsearchpath"; then
3376
# Add the dll search path components to the executable PATH
3377
PATH=$dllsearchpath:\$PATH
3382
if test \"\$libtool_execute_magic\" != \"$magic\"; then
3383
# Run the actual program with our arguments.
3386
# Backslashes separate directories on plain windows
3387
*-*-mingw | *-*-os2* | *-cegcc*)
3389
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3395
exec \"\$progdir/\$program\" \${1+\"\$@\"}
3400
\$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3404
# The program doesn't exist.
3405
\$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
3406
\$ECHO \"This script is just a wrapper for \$program.\" 1>&2
3407
$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3413
# end: func_emit_wrapper_part2
3416
# func_emit_wrapper [arg=no]
3418
# Emit a libtool wrapper script on stdout.
3419
# Don't directly open a file because we may want to
3420
# incorporate the script contents within a cygwin/mingw
3421
# wrapper executable. Must ONLY be called from within
3422
# func_mode_link because it depends on a number of variables
3425
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3426
# variable will take. If 'yes', then the emitted script
3427
# will assume that the directory in which it is stored is
3428
# the $objdir directory. This is a cygwin/mingw-specific
3430
func_emit_wrapper ()
3432
func_emit_wrapper_arg1=no
3433
if test -n "$1" ; then
3434
func_emit_wrapper_arg1=$1
3437
# split this up so that func_emit_cwrapperexe_src
3438
# can call each part independently.
3439
func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
3440
func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
3444
# func_to_host_path arg
3446
# Convert paths to host format when used with build tools.
3447
# Intended for use with "native" mingw (where libtool itself
3448
# is running under the msys shell), or in the following cross-
3449
# build environments:
3451
# mingw (msys) mingw [e.g. native]
3454
# where wine is equipped with the `winepath' executable.
3455
# In the native mingw case, the (msys) shell automatically
3456
# converts paths for any non-msys applications it launches,
3457
# but that facility isn't available from inside the cwrapper.
3458
# Similar accommodations are necessary for $host mingw and
3459
# $build cygwin. Calling this function does no harm for other
3460
# $host/$build combinations not listed above.
3462
# ARG is the path (on $build) that should be converted to
3463
# the proper representation for $host. The result is stored
3464
# in $func_to_host_path_result.
3465
func_to_host_path ()
3467
func_to_host_path_result="$1"
3468
if test -n "$1" ; then
3471
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3473
*mingw* ) # actually, msys
3474
# awkward: cmd appends spaces to result
3475
lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3476
func_to_host_path_tmp1=`( cmd //c echo "$1" |\
3477
$SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3478
func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3479
$SED -e "$lt_sed_naive_backslashify"`
3482
func_to_host_path_tmp1=`cygpath -w "$1"`
3483
func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3484
$SED -e "$lt_sed_naive_backslashify"`
3487
# Unfortunately, winepath does not exit with a non-zero
3488
# error code, so we are forced to check the contents of
3489
# stdout. On the other hand, if the command is not
3490
# found, the shell will set an exit code of 127 and print
3491
# *an error message* to stdout. So we must check for both
3492
# error code of zero AND non-empty stdout, which explains
3493
# the odd construction:
3494
func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3495
if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3496
func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3497
$SED -e "$lt_sed_naive_backslashify"`
3499
# Allow warning below.
3500
func_to_host_path_result=""
3504
if test -z "$func_to_host_path_result" ; then
3505
func_error "Could not determine host path corresponding to"
3507
func_error "Continuing, but uninstalled executables may not work."
3509
func_to_host_path_result="$1"
3515
# end: func_to_host_path
3517
# func_to_host_pathlist arg
3519
# Convert pathlists to host format when used with build tools.
3520
# See func_to_host_path(), above. This function supports the
3521
# following $build/$host combinations (but does no harm for
3522
# combinations not listed here):
3524
# mingw (msys) mingw [e.g. native]
3528
# Path separators are also converted from $build format to
3529
# $host format. If ARG begins or ends with a path separator
3530
# character, it is preserved (but converted to $host format)
3533
# ARG is a pathlist (on $build) that should be converted to
3534
# the proper representation on $host. The result is stored
3535
# in $func_to_host_pathlist_result.
3536
func_to_host_pathlist ()
3538
func_to_host_pathlist_result="$1"
3539
if test -n "$1" ; then
3542
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3543
# Remove leading and trailing path separator characters from
3544
# ARG. msys behavior is inconsistent here, cygpath turns them
3545
# into '.;' and ';.', and winepath ignores them completely.
3546
func_to_host_pathlist_tmp2="$1"
3547
# Once set for this call, this variable should not be
3548
# reassigned. It is used in tha fallback case.
3549
func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3550
$SED -e 's|^:*||' -e 's|:*$||'`
3552
*mingw* ) # Actually, msys.
3553
# Awkward: cmd appends spaces to result.
3554
lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3555
func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3556
$SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3557
func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3558
$SED -e "$lt_sed_naive_backslashify"`
3561
func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3562
func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3563
$SED -e "$lt_sed_naive_backslashify"`
3566
# unfortunately, winepath doesn't convert pathlists
3567
func_to_host_pathlist_result=""
3568
func_to_host_pathlist_oldIFS=$IFS
3570
for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
3571
IFS=$func_to_host_pathlist_oldIFS
3572
if test -n "$func_to_host_pathlist_f" ; then
3573
func_to_host_path "$func_to_host_pathlist_f"
3574
if test -n "$func_to_host_path_result" ; then
3575
if test -z "$func_to_host_pathlist_result" ; then
3576
func_to_host_pathlist_result="$func_to_host_path_result"
3578
func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
3584
IFS=$func_to_host_pathlist_oldIFS
3587
if test -z "$func_to_host_pathlist_result" ; then
3588
func_error "Could not determine the host path(s) corresponding to"
3590
func_error "Continuing, but uninstalled executables may not work."
3591
# Fallback. This may break if $1 contains DOS-style drive
3592
# specifications. The fix is not to complicate the expression
3593
# below, but for the user to provide a working wine installation
3594
# with winepath so that path translation in the cross-to-mingw
3595
# case works properly.
3596
lt_replace_pathsep_nix_to_dos="s|:|;|g"
3597
func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
3598
$SED -e "$lt_replace_pathsep_nix_to_dos"`
3600
# Now, add the leading and trailing path separators back
3602
:* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3606
*: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
3613
# end: func_to_host_pathlist
3615
# func_emit_cwrapperexe_src
3616
# emit the source code for a wrapper executable on stdout
3617
# Must ONLY be called from within func_mode_link because
3618
# it depends on a number of variable set therein.
3619
func_emit_cwrapperexe_src ()
3623
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3624
Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3626
The $output program cannot be directly executed until all the libtool
3627
libraries that it depends on are installed.
3629
This wrapper executable should never be moved out of the build directory.
3630
If it is, it will not operate correctly.
3632
Currently, it simply execs the wrapper *script* "$SHELL $output",
3633
but could eventually absorb all of the scripts functionality and
3634
exec $objdir/$outputname directly.
3641
# include <direct.h>
3642
# include <process.h>
3644
# define setmode _setmode
3646
# include <unistd.h>
3647
# include <stdint.h>
3650
# define HAVE_SETENV
3651
# ifdef __STRICT_ANSI__
3652
char *realpath (const char *, char *);
3653
int putenv (char *);
3654
int setenv (const char *, const char *, int);
3665
#include <sys/stat.h>
3667
#if defined(PATH_MAX)
3668
# define LT_PATHMAX PATH_MAX
3669
#elif defined(MAXPATHLEN)
3670
# define LT_PATHMAX MAXPATHLEN
3672
# define LT_PATHMAX 1024
3683
# define S_IXUSR _S_IEXEC
3685
# ifndef _INTPTR_T_DEFINED
3686
# define intptr_t int
3690
#ifndef DIR_SEPARATOR
3691
# define DIR_SEPARATOR '/'
3692
# define PATH_SEPARATOR ':'
3695
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3697
# define HAVE_DOS_BASED_FILE_SYSTEM
3698
# define FOPEN_WB "wb"
3699
# ifndef DIR_SEPARATOR_2
3700
# define DIR_SEPARATOR_2 '\\'
3702
# ifndef PATH_SEPARATOR_2
3703
# define PATH_SEPARATOR_2 ';'
3707
#ifndef DIR_SEPARATOR_2
3708
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3709
#else /* DIR_SEPARATOR_2 */
3710
# define IS_DIR_SEPARATOR(ch) \
3711
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3712
#endif /* DIR_SEPARATOR_2 */
3714
#ifndef PATH_SEPARATOR_2
3715
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3716
#else /* PATH_SEPARATOR_2 */
3717
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3718
#endif /* PATH_SEPARATOR_2 */
3721
# define FOPEN_WB "wb"
3725
# define FOPEN_WB "w"
3728
# define _O_BINARY 0
3731
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3732
#define XFREE(stale) do { \
3733
if (stale) { free ((void *) stale); stale = 0; } \
3736
#undef LTWRAPPER_DEBUGPRINTF
3737
#if defined DEBUGWRAPPER
3738
# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3740
ltwrapper_debugprintf (const char *fmt, ...)
3743
va_start (args, fmt);
3744
(void) vfprintf (stderr, fmt, args);
3748
# define LTWRAPPER_DEBUGPRINTF(args)
3751
const char *program_name = NULL;
3753
void *xmalloc (size_t num);
3754
char *xstrdup (const char *string);
3755
const char *base_name (const char *name);
3756
char *find_executable (const char *wrapper);
3757
char *chase_symlinks (const char *pathspec);
3758
int make_executable (const char *path);
3759
int check_executable (const char *path);
3760
char *strendzap (char *str, const char *pat);
3761
void lt_fatal (const char *message, ...);
3762
void lt_setenv (const char *name, const char *value);
3763
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3764
void lt_opt_process_env_set (const char *arg);
3765
void lt_opt_process_env_prepend (const char *arg);
3766
void lt_opt_process_env_append (const char *arg);
3767
int lt_split_name_value (const char *arg, char** name, char** value);
3768
void lt_update_exe_path (const char *name, const char *value);
3769
void lt_update_lib_path (const char *name, const char *value);
3771
static const char *script_text_part1 =
3774
func_emit_wrapper_part1 yes |
3775
$SED -e 's/\([\\"]\)/\\\1/g' \
3776
-e 's/^/ "/' -e 's/$/\\n"/'
3780
static const char *script_text_part2 =
3782
func_emit_wrapper_part2 yes |
3783
$SED -e 's/\([\\"]\)/\\\1/g' \
3784
-e 's/^/ "/' -e 's/$/\\n"/'
3788
const char * MAGIC_EXE = "$magic_exe";
3789
const char * LIB_PATH_VARNAME = "$shlibpath_var";
3792
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3793
func_to_host_pathlist "$temp_rpath"
3795
const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
3799
const char * LIB_PATH_VALUE = "";
3803
if test -n "$dllsearchpath"; then
3804
func_to_host_pathlist "$dllsearchpath:"
3806
const char * EXE_PATH_VARNAME = "PATH";
3807
const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
3811
const char * EXE_PATH_VARNAME = "";
3812
const char * EXE_PATH_VALUE = "";
3816
if test "$fast_install" = yes; then
3818
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
3822
const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
3829
#define LTWRAPPER_OPTION_PREFIX "--lt-"
3830
#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
3832
static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
3833
static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3835
static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
3837
static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3838
static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
3839
/* argument is putenv-style "foo=bar", value of foo is set to bar */
3841
static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3842
static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
3843
/* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3845
static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3846
static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
3847
/* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3850
main (int argc, char *argv[])
3855
char *actual_cwrapper_path;
3856
char *actual_cwrapper_name;
3859
intptr_t rval = 127;
3863
program_name = (char *) xstrdup (base_name (argv[0]));
3864
LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
3865
LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3867
/* very simple arg parsing; don't want to rely on getopt */
3868
for (i = 1; i < argc; i++)
3870
if (strcmp (argv[i], dumpscript_opt) == 0)
3874
*mingw* | *cygwin* )
3875
# make stdout use "unix" line endings
3876
echo " setmode(1,_O_BINARY);"
3881
printf ("%s", script_text_part1);
3882
printf ("%s", script_text_part2);
3887
newargz = XMALLOC (char *, argc + 1);
3888
tmp_pathspec = find_executable (argv[0]);
3889
if (tmp_pathspec == NULL)
3890
lt_fatal ("Couldn't find %s", argv[0]);
3891
LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3894
actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3895
LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3896
actual_cwrapper_path));
3897
XFREE (tmp_pathspec);
3899
actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
3900
strendzap (actual_cwrapper_path, actual_cwrapper_name);
3902
/* wrapper name transforms */
3903
strendzap (actual_cwrapper_name, ".exe");
3904
tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
3905
XFREE (actual_cwrapper_name);
3906
actual_cwrapper_name = tmp_pathspec;
3909
/* target_name transforms -- use actual target program name; might have lt- prefix */
3910
target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
3911
strendzap (target_name, ".exe");
3912
tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
3913
XFREE (target_name);
3914
target_name = tmp_pathspec;
3917
LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
3923
XMALLOC (char, (strlen (actual_cwrapper_path) +
3924
strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
3925
strcpy (newargz[0], actual_cwrapper_path);
3926
strcat (newargz[0], "$objdir");
3927
strcat (newargz[0], "/");
3931
/* stop here, and copy&