Commit 6be22e67 authored by Sam Lantinga's avatar Sam Lantinga

Updated libtool support for libtool 1.5.8

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40948
parent e68f3667
...@@ -334,8 +334,9 @@ int main () ...@@ -334,8 +334,9 @@ int main ()
rm -f conf.esdtest rm -f conf.esdtest
]) ])
# Based on libtool-1.5.8
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
## Copyright 1996, 1997, 1998, 1999, 2000, 2001 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
## Free Software Foundation, Inc. ## Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
## ##
...@@ -536,6 +537,8 @@ if test -n "$RANLIB"; then ...@@ -536,6 +537,8 @@ if test -n "$RANLIB"; then
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi fi
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
# Only perform the check for file, if the check method requires it # Only perform the check for file, if the check method requires it
case $deplibs_check_method in case $deplibs_check_method in
file_magic*) file_magic*)
...@@ -653,7 +656,7 @@ fi ...@@ -653,7 +656,7 @@ fi
# The HP-UX ksh and POSIX shell print the target directory to stdout # The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set. # if CDPATH is set.
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
if test -z "$ECHO"; then if test -z "$ECHO"; then
if test "X${echo_test_string+set}" != Xset; then if test "X${echo_test_string+set}" != Xset; then
...@@ -836,7 +839,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) ...@@ -836,7 +839,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
x86_64-*linux*) x86_64-*linux*)
LD="${LD-ld} -m elf_i386" LD="${LD-ld} -m elf_i386"
;; ;;
ppc64-*linux*) ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux" LD="${LD-ld} -m elf32ppclinux"
;; ;;
s390x-*linux*) s390x-*linux*)
...@@ -900,7 +903,8 @@ need_locks="$enable_libtool_lock" ...@@ -900,7 +903,8 @@ need_locks="$enable_libtool_lock"
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# Check whether the given compiler option works # Check whether the given compiler option works
AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
[AC_CACHE_CHECK([$1], [$2], [AC_REQUIRE([LT_AC_PROG_SED])
AC_CACHE_CHECK([$1], [$2],
[$2=no [$2=no
ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
printf "$lt_simple_compile_test_code" > conftest.$ac_ext printf "$lt_simple_compile_test_code" > conftest.$ac_ext
...@@ -976,7 +980,7 @@ AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], ...@@ -976,7 +980,7 @@ AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
AC_MSG_CHECKING([the maximum length of command line arguments]) AC_MSG_CHECKING([the maximum length of command line arguments])
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
i=0 i=0
testring="ABCD" teststring="ABCD"
case $build_os in case $build_os in
msdosdjgpp*) msdosdjgpp*)
...@@ -1005,20 +1009,40 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ...@@ -1005,20 +1009,40 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=8192; lt_cv_sys_max_cmd_len=8192;
;; ;;
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
lt_cv_sys_max_cmd_len=8192;
;;
netbsd* | freebsd* | openbsd* | darwin* )
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
elif test -x /usr/sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
else
lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
fi
# And add a safety zone
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
;;
*) *)
# If test is not a shell built-in, we'll probably end up computing a # If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but # maximum length that is only half of the actual maximum length, but
# we can't tell. # we can't tell.
while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
= "XX$testring") >/dev/null 2>&1 && while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
new_result=`expr "X$testring" : ".*" 2>&1` && = "XX$teststring") >/dev/null 2>&1 &&
new_result=`expr "X$teststring" : ".*" 2>&1` &&
lt_cv_sys_max_cmd_len=$new_result && lt_cv_sys_max_cmd_len=$new_result &&
test $i != 17 # 1/2 MB should be enough test $i != 17 # 1/2 MB should be enough
do do
i=`expr $i + 1` i=`expr $i + 1`
testring=$testring$testring teststring=$teststring$teststring
done done
testring= teststring=
# Add a significant safety factor because C++ compilers can tack on massive # Add a significant safety factor because C++ compilers can tack on massive
# amounts of additional arguments before passing them to the linker. # amounts of additional arguments before passing them to the linker.
# It appears as though 1/2 is a usable value. # It appears as though 1/2 is a usable value.
...@@ -1257,13 +1281,6 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], ...@@ -1257,13 +1281,6 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
mkdir out mkdir out
printf "$lt_simple_compile_test_code" > conftest.$ac_ext printf "$lt_simple_compile_test_code" > conftest.$ac_ext
# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
# that will create temporary files in the current directory regardless of
# the output directory. Thus, making CWD read-only will cause this test
# to fail, enabling locking or at least warning the user not to do parallel
# builds.
chmod -w .
lt_compiler_flag="-o out/conftest2.$ac_objext" lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or # Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end. # (2) before a word containing "conftest.", or (3) at the end.
...@@ -1287,8 +1304,11 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], ...@@ -1287,8 +1304,11 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
fi fi
fi fi
chmod u+w . chmod u+w .
$rm conftest* out/* $rm conftest*
rmdir out # SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
$rm out/* && rmdir out
cd .. cd ..
rmdir conftest rmdir conftest
$rm conftest* $rm conftest*
...@@ -1347,8 +1367,8 @@ AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], ...@@ -1347,8 +1367,8 @@ AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
[AC_MSG_CHECKING([how to hardcode library paths into programs]) [AC_MSG_CHECKING([how to hardcode library paths into programs])
_LT_AC_TAGVAR(hardcode_action, $1)= _LT_AC_TAGVAR(hardcode_action, $1)=
if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
# We can hardcode non-existant directories. # We can hardcode non-existant directories.
if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
...@@ -1418,7 +1438,7 @@ AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], ...@@ -1418,7 +1438,7 @@ AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
library_names_spec= library_names_spec=
libname_spec='lib$name' libname_spec='lib$name'
soname_spec= soname_spec=
shrext=".so" shrext_cmds=".so"
postinstall_cmds= postinstall_cmds=
postuninstall_cmds= postuninstall_cmds=
finish_cmds= finish_cmds=
...@@ -1506,7 +1526,7 @@ aix4* | aix5*) ...@@ -1506,7 +1526,7 @@ aix4* | aix5*)
amigaos*) amigaos*)
library_names_spec='$libname.ixlibrary $libname.a' library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs. # Create ${libname}_ixlibrary.a entries in /sys/libs.
finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;; ;;
beos*) beos*)
...@@ -1515,7 +1535,7 @@ beos*) ...@@ -1515,7 +1535,7 @@ beos*)
shlibpath_var=LIBRARY_PATH shlibpath_var=LIBRARY_PATH
;; ;;
bsdi4*) bsdi[[45]]*)
version_type=linux version_type=linux
need_version=no need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
...@@ -1531,7 +1551,7 @@ bsdi4*) ...@@ -1531,7 +1551,7 @@ bsdi4*)
cygwin* | mingw* | pw32*) cygwin* | mingw* | pw32*)
version_type=windows version_type=windows
shrext=".dll" shrext_cmds=".dll"
need_version=no need_version=no
need_lib_prefix=no need_lib_prefix=no
...@@ -1594,17 +1614,16 @@ darwin* | rhapsody*) ...@@ -1594,17 +1614,16 @@ darwin* | rhapsody*)
version_type=darwin version_type=darwin
need_lib_prefix=no need_lib_prefix=no
need_version=no need_version=no
# FIXME: Relying on posixy $() will cause problems for
# cross-compilation, but unfortunately the echo tests do not
# yet detect zsh echo's removal of \ escapes.
library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH shlibpath_var=DYLD_LIBRARY_PATH
shrext='$(test .$module = .yes && echo .so || echo .dylib)' shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
# Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then if test "$GCC" = yes; then
sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
else
sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
fi fi
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;; ;;
...@@ -1622,6 +1641,18 @@ freebsd1*) ...@@ -1622,6 +1641,18 @@ freebsd1*)
dynamic_linker=no dynamic_linker=no
;; ;;
kfreebsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='GNU ld.so'
;;
freebsd*) freebsd*)
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
version_type=freebsd-$objformat version_type=freebsd-$objformat
...@@ -1670,7 +1701,7 @@ hpux9* | hpux10* | hpux11*) ...@@ -1670,7 +1701,7 @@ hpux9* | hpux10* | hpux11*)
need_version=no need_version=no
case "$host_cpu" in case "$host_cpu" in
ia64*) ia64*)
shrext='.so' shrext_cmds='.so'
hardcode_into_libs=yes hardcode_into_libs=yes
dynamic_linker="$host_os dld.so" dynamic_linker="$host_os dld.so"
shlibpath_var=LD_LIBRARY_PATH shlibpath_var=LD_LIBRARY_PATH
...@@ -1685,7 +1716,7 @@ hpux9* | hpux10* | hpux11*) ...@@ -1685,7 +1716,7 @@ hpux9* | hpux10* | hpux11*)
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;; ;;
hppa*64*) hppa*64*)
shrext='.sl' shrext_cmds='.sl'
hardcode_into_libs=yes hardcode_into_libs=yes
dynamic_linker="$host_os dld.sl" dynamic_linker="$host_os dld.sl"
shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
...@@ -1696,7 +1727,7 @@ hpux9* | hpux10* | hpux11*) ...@@ -1696,7 +1727,7 @@ hpux9* | hpux10* | hpux11*)
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;; ;;
*) *)
shrext='.sl' shrext_cmds='.sl'
dynamic_linker="$host_os dld.sl" dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH shlibpath_var=SHLIB_PATH
shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
...@@ -1765,6 +1796,12 @@ linux*) ...@@ -1765,6 +1796,12 @@ linux*)
# before this can be enabled. # before this can be enabled.
hardcode_into_libs=yes hardcode_into_libs=yes
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on # We used to test for /lib/ld.so.1 and disable shared libraries on
# powerpc, because MkLinux only supported shared libraries with the # powerpc, because MkLinux only supported shared libraries with the
# GNU dynamic linker. Since this was broken with cross compilers, # GNU dynamic linker. Since this was broken with cross compilers,
...@@ -1774,6 +1811,18 @@ linux*) ...@@ -1774,6 +1811,18 @@ linux*)
dynamic_linker='GNU/Linux ld.so' dynamic_linker='GNU/Linux ld.so'
;; ;;
knetbsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='GNU ld.so'
;;
netbsd*) netbsd*)
version_type=sunos version_type=sunos
need_lib_prefix=no need_lib_prefix=no
...@@ -1783,7 +1832,7 @@ netbsd*) ...@@ -1783,7 +1832,7 @@ netbsd*)
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so' dynamic_linker='NetBSD (a.out) ld.so'
else else
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major' soname_spec='${libname}${release}${shared_ext}$major'
dynamic_linker='NetBSD ld.elf_so' dynamic_linker='NetBSD ld.elf_so'
fi fi
...@@ -1799,16 +1848,14 @@ newsos6) ...@@ -1799,16 +1848,14 @@ newsos6)
shlibpath_overrides_runpath=yes shlibpath_overrides_runpath=yes
;; ;;
*qnx* | *nto*) nto-qnx*)
version_type=qnx version_type=linux
need_lib_prefix=no need_lib_prefix=no
need_version=no need_version=no
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}.so$major' soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
dynamic_linker='ldqnx.so'
;; ;;
openbsd*) openbsd*)
...@@ -1834,7 +1881,7 @@ openbsd*) ...@@ -1834,7 +1881,7 @@ openbsd*)
os2*) os2*)
libname_spec='$name' libname_spec='$name'
shrext=".dll" shrext_cmds=".dll"
need_lib_prefix=no need_lib_prefix=no
library_names_spec='$libname${shared_ext} $libname.a' library_names_spec='$libname${shared_ext} $libname.a'
dynamic_linker='OS/2 ld.exe' dynamic_linker='OS/2 ld.exe'
...@@ -2270,7 +2317,7 @@ fi ...@@ -2270,7 +2317,7 @@ fi
# AC_PROG_LD # AC_PROG_LD
# ---------- # ----------
# find the path to the GNU or non-GNU linker # find the pathname to the GNU or non-GNU linker
AC_DEFUN([AC_PROG_LD], AC_DEFUN([AC_PROG_LD],
[AC_ARG_WITH([gnu-ld], [AC_ARG_WITH([gnu-ld],
[AC_HELP_STRING([--with-gnu-ld], [AC_HELP_STRING([--with-gnu-ld],
...@@ -2296,7 +2343,7 @@ if test "$GCC" = yes; then ...@@ -2296,7 +2343,7 @@ if test "$GCC" = yes; then
# Accept absolute paths. # Accept absolute paths.
[[\\/]]* | ?:[[\\/]]*) [[\\/]]* | ?:[[\\/]]*)
re_direlt='/[[^/]][[^/]]*/\.\./' re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the path of ld # Canonicalize the pathname of ld
ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
...@@ -2359,7 +2406,7 @@ AC_DEFUN([AC_PROG_LD_GNU], ...@@ -2359,7 +2406,7 @@ AC_DEFUN([AC_PROG_LD_GNU],
[AC_REQUIRE([AC_PROG_EGREP])dnl [AC_REQUIRE([AC_PROG_EGREP])dnl
AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
case `"$LD" -v 2>&1 </dev/null` in case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*) *GNU* | *'with BFD'*)
lt_cv_prog_gnu_ld=yes lt_cv_prog_gnu_ld=yes
;; ;;
...@@ -2385,6 +2432,15 @@ case $reload_flag in ...@@ -2385,6 +2432,15 @@ case $reload_flag in
*) reload_flag=" $reload_flag" ;; *) reload_flag=" $reload_flag" ;;
esac esac
reload_cmds='$LD$reload_flag -o $output$reload_objs' reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
darwin*)
if test "$GCC" = yes; then
reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
;;
esac
])# AC_PROG_LD_RELOAD_FLAG ])# AC_PROG_LD_RELOAD_FLAG
...@@ -2418,35 +2474,32 @@ beos*) ...@@ -2418,35 +2474,32 @@ beos*)
lt_cv_deplibs_check_method=pass_all lt_cv_deplibs_check_method=pass_all
;; ;;
bsdi4*) bsdi[[45]]*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_file_magic_test_file=/shlib/libc.so
;; ;;
cygwin* | mingw* | pw32*) cygwin*)
# win32_libid is a shell function defined in ltmain.sh # func_win32_libid is a shell function defined in ltmain.sh
#lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' #lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_deplibs_check_method=pass_all lt_cv_deplibs_check_method=pass_all
lt_cv_file_magic_cmd='win32_libid' lt_cv_file_magic_cmd='func_win32_libid'
;; ;;
darwin* | rhapsody*) mingw* | pw32*)
# this will be overwritten by pass_all, but leave it in just in case # Base MSYS/MinGW do not provide the 'file' command needed by
lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' # func_win32_libid shell function, so use a weaker test based on 'objdump'.
lt_cv_file_magic_cmd='/usr/bin/file -L' #lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
case "$host_os" in lt_cv_deplibs_check_method=pass_all
rhapsody* | darwin1.[[012]]) lt_cv_file_magic_cmd='$OBJDUMP -f'
lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
;;
*) # Darwin 1.3 on
lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
;; ;;
esac
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all lt_cv_deplibs_check_method=pass_all
;; ;;
freebsd*) freebsd* | kfreebsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in case $host_cpu in
i*86 ) i*86 )
...@@ -2485,40 +2538,27 @@ hpux10.20* | hpux11*) ...@@ -2485,40 +2538,27 @@ hpux10.20* | hpux11*)
;; ;;
irix5* | irix6* | nonstopux*) irix5* | irix6* | nonstopux*)
case $host_os in
irix5* | nonstopux*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
;;
*)
case $LD in case $LD in
*-32|*"-32 ") libmagic=32-bit;; *-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;; *-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;; *-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;; *) libmagic=never-match;;
esac esac
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
;;
esac
lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
lt_cv_deplibs_check_method=pass_all
;;
*qnx* | *nto*)
lt_cv_deplibs_check_method=pass_all lt_cv_deplibs_check_method=pass_all
;; ;;
# This must be Linux ELF. # This must be Linux ELF.
linux*) linux*)
case $host_cpu in case $host_cpu in
alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*)
lt_cv_deplibs_check_method=pass_all ;; lt_cv_deplibs_check_method=pass_all ;;
*) *)
# glibc up to 2.1.1 does not perform some relocations on ARM # glibc up to 2.1.1 does not perform some relocations on ARM
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
esac esac
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
lt_cv_deplibs_check_method=pass_all
;; ;;
netbsd*) netbsd*)
...@@ -2535,20 +2575,19 @@ newos6*) ...@@ -2535,20 +2575,19 @@ newos6*)
lt_cv_file_magic_test_file=/usr/lib/libnls.so lt_cv_file_magic_test_file=/usr/lib/libnls.so
;; ;;
nto-qnx*)
lt_cv_deplibs_check_method=unknown
;;
openbsd*) openbsd*)
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
else else
lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
fi fi
;; ;;
osf3* | osf4* | osf5*) osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
lt_cv_file_magic_test_file=/shlib/libc.so
lt_cv_deplibs_check_method=pass_all lt_cv_deplibs_check_method=pass_all
;; ;;
...@@ -2558,7 +2597,6 @@ sco3.2v5*) ...@@ -2558,7 +2597,6 @@ sco3.2v5*)
solaris*) solaris*)
lt_cv_deplibs_check_method=pass_all lt_cv_deplibs_check_method=pass_all
lt_cv_file_magic_test_file=/lib/libc.so
;; ;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
...@@ -2598,7 +2636,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown ...@@ -2598,7 +2636,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
# AC_PROG_NM # AC_PROG_NM
# ---------- # ----------
# find the path to a BSD-compatible name lister # find the pathname to a BSD-compatible name lister
AC_DEFUN([AC_PROG_NM], AC_DEFUN([AC_PROG_NM],
[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
[if test -n "$NM"; then [if test -n "$NM"; then
...@@ -2736,7 +2774,7 @@ AC_DEFUN([AC_LIBTOOL_CXX], ...@@ -2736,7 +2774,7 @@ AC_DEFUN([AC_LIBTOOL_CXX],
AC_DEFUN([_LT_AC_LANG_CXX], AC_DEFUN([_LT_AC_LANG_CXX],
[AC_REQUIRE([AC_PROG_CXX]) [AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([AC_PROG_CXXCPP]) AC_REQUIRE([AC_PROG_CXXCPP])
_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
])# _LT_AC_LANG_CXX ])# _LT_AC_LANG_CXX
...@@ -2752,7 +2790,7 @@ AC_DEFUN([AC_LIBTOOL_F77], ...@@ -2752,7 +2790,7 @@ AC_DEFUN([AC_LIBTOOL_F77],
# --------------- # ---------------
AC_DEFUN([_LT_AC_LANG_F77], AC_DEFUN([_LT_AC_LANG_F77],
[AC_REQUIRE([AC_PROG_F77]) [AC_REQUIRE([AC_PROG_F77])
_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
])# _LT_AC_LANG_F77 ])# _LT_AC_LANG_F77
...@@ -2773,7 +2811,7 @@ AC_DEFUN([_LT_AC_LANG_GCJ], ...@@ -2773,7 +2811,7 @@ AC_DEFUN([_LT_AC_LANG_GCJ],
[ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
[ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
[AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
])# _LT_AC_LANG_GCJ ])# _LT_AC_LANG_GCJ
...@@ -2782,7 +2820,7 @@ _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`]) ...@@ -2782,7 +2820,7 @@ _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`])
# enable support for Windows resource files # enable support for Windows resource files
AC_DEFUN([AC_LIBTOOL_RC], AC_DEFUN([AC_LIBTOOL_RC],
[AC_REQUIRE([LT_AC_PROG_RC]) [AC_REQUIRE([LT_AC_PROG_RC])
_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
])# AC_LIBTOOL_RC ])# AC_LIBTOOL_RC
...@@ -2824,7 +2862,7 @@ if test "$GCC" = no; then ...@@ -2824,7 +2862,7 @@ if test "$GCC" = no; then
fi fi
if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then :
else else
AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
_LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
...@@ -2851,9 +2889,9 @@ AC_LIBTOOL_PROG_COMPILER_PIC($1) ...@@ -2851,9 +2889,9 @@ AC_LIBTOOL_PROG_COMPILER_PIC($1)
AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_PROG_CC_C_O($1)
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1)
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_SYS_LIB_STRIP
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_DLOPEN_SELF($1)
# Report which librarie types wil actually be built # Report which librarie types wil actually be built
...@@ -2874,39 +2912,11 @@ aix3*) ...@@ -2874,39 +2912,11 @@ aix3*)
fi fi
;; ;;
aix4*) aix4* | aix5*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no test "$enable_shared" = yes && enable_static=no
fi fi
;; ;;
darwin* | rhapsody*)
if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
case "$host_os" in
rhapsody* | darwin1.[[012]])
_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
;;
*) # Darwin 1.3 on
test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
;;
esac
# FIXME: Relying on posixy $() will cause problems for
# cross-compilation, but unfortunately the echo tests do not
# yet detect zsh echo's removal of \ escapes. Also zsh mangles
# `"' quotes if we put them in here... so don't!
output_verbose_link_cmd='echo'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_automatic, $1)=yes
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
fi
;;
esac esac
AC_MSG_RESULT([$enable_shared]) AC_MSG_RESULT([$enable_shared])
...@@ -3041,7 +3051,7 @@ if test "$GXX" = yes; then ...@@ -3041,7 +3051,7 @@ if test "$GXX" = yes; then
# linker, instead of GNU ld. If possible, this setting should # linker, instead of GNU ld. If possible, this setting should
# overridden to take advantage of the native linker features on # overridden to take advantage of the native linker features on
# the platform it is being used on. # the platform it is being used on.
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
fi fi
# Commands to make compiler produce verbose output that lists # Commands to make compiler produce verbose output that lists
...@@ -3183,6 +3193,7 @@ case $host_os in ...@@ -3183,6 +3193,7 @@ case $host_os in
esac esac
;; ;;
cygwin* | mingw* | pw32*) cygwin* | mingw* | pw32*)
# _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs. # as there is no search path for DLLs.
...@@ -3192,9 +3203,17 @@ case $host_os in ...@@ -3192,9 +3203,17 @@ case $host_os in
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
## _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib'
# If the export-symbols file already is a .def file (1st line # If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend... # is EXPORTS), use it as is; otherwise, prepend...
## _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
## cp $export_symbols $output_objdir/$soname.def;
## else
## echo EXPORTS > $output_objdir/$soname.def;
## cat $export_symbols >> $output_objdir/$soname.def;
## fi~
## $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname.def; cp $export_symbols $output_objdir/$soname.def;
else else
...@@ -3206,42 +3225,66 @@ case $host_os in ...@@ -3206,42 +3225,66 @@ case $host_os in
_LT_AC_TAGVAR(ld_shlibs, $1)=no _LT_AC_TAGVAR(ld_shlibs, $1)=no
fi fi
;; ;;
darwin* | rhapsody*) darwin* | rhapsody*)
if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
case "$host_os" in case "$host_os" in
rhapsody* | darwin1.[[012]]) rhapsody* | darwin1.[[012]])
_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
;; ;;
*) # Darwin 1.3 on *) # Darwin 1.3 on
test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
else
case ${MACOSX_DEPLOYMENT_TARGET} in
10.[[012]])
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
;;
10.*)
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
;; ;;
esac esac
fi
;;
esac
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_automatic, $1)=yes
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
if test "$GXX" = yes ; then
lt_int_apple_cc_single_mod=no lt_int_apple_cc_single_mod=no
output_verbose_link_cmd='echo' output_verbose_link_cmd='echo'
if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
lt_int_apple_cc_single_mod=yes lt_int_apple_cc_single_mod=yes
fi fi
if test "X$lt_int_apple_cc_single_mod" = Xyes ; then if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
else else
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
fi fi
_LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
if test "X$lt_int_apple_cc_single_mod" = Xyes ; then if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else else
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
fi fi
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(hardcode_direct, $1)=no else
_LT_AC_TAGVAR(hardcode_automatic, $1)=yes case "$cc_basename" in
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported xlc*)
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' output_verbose_link_cmd='echo'
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
_LT_AC_TAGVAR(ld_shlibs, $1)=no
;;
esac
fi fi
;; ;;
...@@ -3269,7 +3312,7 @@ case $host_os in ...@@ -3269,7 +3312,7 @@ case $host_os in
freebsd-elf*) freebsd-elf*)
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
;; ;;
freebsd*) freebsd* | kfreebsd*-gnu)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions # conventions
_LT_AC_TAGVAR(ld_shlibs, $1)=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes
...@@ -3300,7 +3343,7 @@ case $host_os in ...@@ -3300,7 +3343,7 @@ case $host_os in
# explicitly linking system object files so we need to strip them # explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library # from the output so that they don't get included in the library
# dependencies. # dependencies.
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;; ;;
*) *)
if test "$GXX" = yes; then if test "$GXX" = yes; then
...@@ -3449,9 +3492,20 @@ case $host_os in ...@@ -3449,9 +3492,20 @@ case $host_os in
icpc) icpc)
# Intel C++ # Intel C++
with_gnu_ld=yes with_gnu_ld=yes
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no # version 8.0 and above of icpc choke on multiply defined symbols
# if we add $predep_objects and $postdep_objects, however 7.1 and
# earlier do not add the objects themselves.
case `$CC -V 2>&1` in
*"Version 7."*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
;;
*) # Version 8.0 or newer
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
;;
esac
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
...@@ -3508,6 +3562,20 @@ case $host_os in ...@@ -3508,6 +3562,20 @@ case $host_os in
# Workaround some broken pre-1.5 toolchains # Workaround some broken pre-1.5 toolchains
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
;; ;;
openbsd2*)
# C++ shared libraries are fairly broken
_LT_AC_TAGVAR(ld_shlibs, $1)=no
;;
openbsd*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
output_verbose_link_cmd='echo'
;;
osf3*) osf3*)
case $cc_basename in case $cc_basename in
KCC) KCC)
...@@ -3763,8 +3831,6 @@ case $host_os in ...@@ -3763,8 +3831,6 @@ case $host_os in
# FIXME: insert proper C++ library support # FIXME: insert proper C++ library support
_LT_AC_TAGVAR(ld_shlibs, $1)=no _LT_AC_TAGVAR(ld_shlibs, $1)=no
;; ;;
*qnx* | *nto*)
;;
*) *)
# FIXME: insert proper C++ library support # FIXME: insert proper C++ library support
_LT_AC_TAGVAR(ld_shlibs, $1)=no _LT_AC_TAGVAR(ld_shlibs, $1)=no
...@@ -3785,9 +3851,9 @@ AC_LIBTOOL_PROG_COMPILER_PIC($1) ...@@ -3785,9 +3851,9 @@ AC_LIBTOOL_PROG_COMPILER_PIC($1)
AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_PROG_CC_C_O($1)
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1)
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_SYS_LIB_STRIP
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_DLOPEN_SELF($1)
AC_LIBTOOL_CONFIG($1) AC_LIBTOOL_CONFIG($1)
...@@ -4009,7 +4075,7 @@ aix3*) ...@@ -4009,7 +4075,7 @@ aix3*)
postinstall_cmds='$RANLIB $lib' postinstall_cmds='$RANLIB $lib'
fi fi
;; ;;
aix4*) aix4* | aix5*)
test "$enable_shared" = yes && enable_static=no test "$enable_shared" = yes && enable_static=no
;; ;;
esac esac
...@@ -4029,9 +4095,10 @@ AC_LIBTOOL_PROG_COMPILER_PIC($1) ...@@ -4029,9 +4095,10 @@ AC_LIBTOOL_PROG_COMPILER_PIC($1)
AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_PROG_CC_C_O($1)
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1)
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_SYS_LIB_STRIP
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_CONFIG($1) AC_LIBTOOL_CONFIG($1)
...@@ -4083,9 +4150,9 @@ AC_LIBTOOL_PROG_COMPILER_PIC($1) ...@@ -4083,9 +4150,9 @@ AC_LIBTOOL_PROG_COMPILER_PIC($1)
AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_PROG_CC_C_O($1)
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1)
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_SYS_LIB_STRIP
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_DLOPEN_SELF($1)
AC_LIBTOOL_CONFIG($1) AC_LIBTOOL_CONFIG($1)
...@@ -4154,7 +4221,8 @@ if test -f "$ltmain"; then ...@@ -4154,7 +4221,8 @@ if test -f "$ltmain"; then
# Now quote all the things that may contain metacharacters while being # Now quote all the things that may contain metacharacters while being
# careful not to overquote the AC_SUBSTed values. We take copies of the # careful not to overquote the AC_SUBSTed values. We take copies of the
# variables and quote the copies for generation of the libtool script. # variables and quote the copies for generation of the libtool script.
for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
SED SHELL STRIP \
libname_spec library_names_spec soname_spec extract_expsyms_cmds \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
old_striplib striplib file_magic_cmd finish_cmds finish_eval \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
deplibs_check_method reload_flag reload_cmds need_locks \ deplibs_check_method reload_flag reload_cmds need_locks \
...@@ -4274,7 +4342,7 @@ Xsed="$SED -e s/^X//" ...@@ -4274,7 +4342,7 @@ Xsed="$SED -e s/^X//"
# The HP-UX ksh and POSIX shell print the target directory to stdout # The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set. # if CDPATH is set.
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# The names of the tagged configurations supported by this script. # The names of the tagged configurations supported by this script.
available_tags= available_tags=
...@@ -4335,7 +4403,7 @@ LN_S=$lt_LN_S ...@@ -4335,7 +4403,7 @@ LN_S=$lt_LN_S
NM=$lt_NM NM=$lt_NM
# A symbol stripping program # A symbol stripping program
STRIP=$STRIP STRIP=$lt_STRIP
# Used to examine libraries when file_magic_cmd begins "file" # Used to examine libraries when file_magic_cmd begins "file"
MAGIC_CMD=$MAGIC_CMD MAGIC_CMD=$MAGIC_CMD
...@@ -4366,7 +4434,7 @@ objext="$ac_objext" ...@@ -4366,7 +4434,7 @@ objext="$ac_objext"
libext="$libext" libext="$libext"
# Shared library suffix (normally ".so"). # Shared library suffix (normally ".so").
shrext='$shrext' shrext_cmds='$shrext_cmds'
# Executable file suffix (normally ""). # Executable file suffix (normally "").
exeext="$exeext" exeext="$exeext"
...@@ -4610,7 +4678,10 @@ else ...@@ -4610,7 +4678,10 @@ else
# If there is no Makefile yet, we rely on a make rule to execute # If there is no Makefile yet, we rely on a make rule to execute
# `config.status --recheck' to rerun these tests and create the # `config.status --recheck' to rerun these tests and create the
# libtool script then. # libtool script then.
ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
if test -f "$ltmain_in"; then
test -f Makefile && make "$ltmain" test -f Makefile && make "$ltmain"
fi
fi fi
])# AC_LIBTOOL_CONFIG ])# AC_LIBTOOL_CONFIG
...@@ -4683,7 +4754,7 @@ osf*) ...@@ -4683,7 +4754,7 @@ osf*)
symcode='[[BCDEGQRST]]' symcode='[[BCDEGQRST]]'
;; ;;
solaris* | sysv5*) solaris* | sysv5*)
symcode='[[BDT]]' symcode='[[BDRT]]'
;; ;;
sysv4) sysv4)
symcode='[[DFNSTU]]' symcode='[[DFNSTU]]'
...@@ -4701,7 +4772,7 @@ esac ...@@ -4701,7 +4772,7 @@ esac
# If we're using GNU nm, then use its standard symbol codes. # If we're using GNU nm, then use its standard symbol codes.
case `$NM -V 2>&1` in case `$NM -V 2>&1` in
*GNU* | *'with BFD'*) *GNU* | *'with BFD'*)
symcode='[[ABCDGISTW]]' ;; symcode='[[ABCDGIRSTW]]' ;;
esac esac
# Try without a prefix undercore, then with it. # Try without a prefix undercore, then with it.
...@@ -4880,10 +4951,6 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ...@@ -4880,10 +4951,6 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;; ;;
esac esac
;; ;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise it will coredumped.
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
*) *)
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;; ;;
...@@ -4907,6 +4974,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ...@@ -4907,6 +4974,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;; ;;
esac esac
;; ;;
darwin*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
case "$cc_basename" in
xlc*)
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
;;
esac
;;
dgux*) dgux*)
case $cc_basename in case $cc_basename in
ec++) ec++)
...@@ -4920,13 +4997,9 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ...@@ -4920,13 +4997,9 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;; ;;
esac esac
;; ;;
freebsd*) freebsd* | kfreebsd*-gnu)
# FreeBSD uses GNU C++ # FreeBSD uses GNU C++
;; ;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise it will coredumped.
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
hpux9* | hpux10* | hpux11*) hpux9* | hpux10* | hpux11*)
case $cc_basename in case $cc_basename in
CC) CC)
...@@ -5147,10 +5220,6 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ...@@ -5147,10 +5220,6 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;; ;;
esac esac
;; ;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise it will coredumped.
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
*) *)
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
...@@ -5168,6 +5237,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ...@@ -5168,6 +5237,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
fi fi
;; ;;
darwin*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
case "$cc_basename" in
xlc*)
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
;;
esac
;;
mingw* | pw32* | os2*) mingw* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being # This hack is so that the source file can tell whether it is being
...@@ -5191,11 +5270,6 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ...@@ -5191,11 +5270,6 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
;; ;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise it will coredumped.
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
irix5* | irix6* | nonstopux*) irix5* | irix6* | nonstopux*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# PIC (with -KPIC) is the default. # PIC (with -KPIC) is the default.
...@@ -5209,12 +5283,12 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ...@@ -5209,12 +5283,12 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
linux*) linux*)
case $CC in case $CC in
icc|ecc) icc* | ecc*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
;; ;;
ccc) ccc*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# All Alpha code is PIC. # All Alpha code is PIC.
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
...@@ -5434,9 +5508,17 @@ EOF ...@@ -5434,9 +5508,17 @@ EOF
_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
## _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib'
# If the export-symbols file already is a .def file (1st line # If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend... # is EXPORTS), use it as is; otherwise, prepend...
## _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
## cp $export_symbols $output_objdir/$soname.def;
## else
## echo EXPORTS > $output_objdir/$soname.def;
## cat $export_symbols >> $output_objdir/$soname.def;
## fi~
## $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname.def; cp $export_symbols $output_objdir/$soname.def;
else else
...@@ -5487,6 +5569,31 @@ EOF ...@@ -5487,6 +5569,31 @@ EOF
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
;; ;;
linux*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
supports_anon_versioning=no
case `$LD -v 2>/dev/null` in
*\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
*\ 2.11.*) ;; # other 2.11 versions
*) supports_anon_versioning=yes ;;
esac
if test $supports_anon_versioning = yes; then
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
else
_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
fi
else
_LT_AC_TAGVAR(ld_shlibs, $1)=no
fi
;;
*) *)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
...@@ -5649,7 +5756,7 @@ EOF ...@@ -5649,7 +5756,7 @@ EOF
_LT_AC_TAGVAR(ld_shlibs, $1)=no _LT_AC_TAGVAR(ld_shlibs, $1)=no
;; ;;
bsdi4*) bsdi[[45]]*)
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
;; ;;
...@@ -5663,7 +5770,7 @@ EOF ...@@ -5663,7 +5770,7 @@ EOF
# Tell ltmain to make .lib files, not .a files. # Tell ltmain to make .lib files, not .a files.
libext=lib libext=lib
# Tell ltmain to make .dll files, not .so files. # Tell ltmain to make .dll files, not .so files.
shrext=".dll" shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack. # FIXME: Setting linknames here is a bad hack.
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL. # The linker will automatically build a .lib file if we build a DLL.
...@@ -5675,43 +5782,52 @@ EOF ...@@ -5675,43 +5782,52 @@ EOF
;; ;;
darwin* | rhapsody*) darwin* | rhapsody*)
if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
case "$host_os" in case "$host_os" in
rhapsody* | darwin1.[[012]]) rhapsody* | darwin1.[[012]])
_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
;; ;;
*) # Darwin 1.3 on *) # Darwin 1.3 on
test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
else
case ${MACOSX_DEPLOYMENT_TARGET} in
10.[[012]])
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
;;
10.*)
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
;; ;;
esac esac
# FIXME: Relying on posixy $() will cause problems for
# cross-compilation, but unfortunately the echo tests do not
# yet detect zsh echo's removal of \ escapes. Also zsh mangles
# `"' quotes if we put them in here... so don't!
lt_int_apple_cc_single_mod=no
output_verbose_link_cmd='echo'
if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
lt_int_apple_cc_single_mod=yes
fi fi
if test "X$lt_int_apple_cc_single_mod" = Xyes ; then ;;
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' esac
else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
fi
_LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
fi
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else
case "$cc_basename" in
xlc*)
output_verbose_link_cmd='echo'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
_LT_AC_TAGVAR(ld_shlibs, $1)=no
;;
esac
fi fi
;; ;;
...@@ -5745,7 +5861,7 @@ EOF ...@@ -5745,7 +5861,7 @@ EOF
;; ;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries. # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd*) freebsd* | kfreebsd*-gnu)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_direct, $1)=yes
...@@ -5856,6 +5972,7 @@ EOF ...@@ -5856,6 +5972,7 @@ EOF
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
else else
...@@ -6221,7 +6338,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do ...@@ -6221,7 +6338,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
fi fi
done done
done done
SED=$lt_cv_path_SED
]) ])
SED=$lt_cv_path_SED
AC_MSG_RESULT([$SED]) AC_MSG_RESULT([$SED])
]) ])
# Based on libtool-1.5.8
# ltmain.sh - Provide generalized library-building support services. # ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure. # NOTE: Changing this file will not affect anything until you rerun configure.
# #
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# #
...@@ -24,6 +25,34 @@ ...@@ -24,6 +25,34 @@
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
basename="s,^.*/,,g"
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
# is ksh but when the shell is invoked as "sh" and the current value of
# the _XPG environment variable is not equal to 1 (one), the special
# positional parameter $0, within a function call, is the name of the
# function.
progpath="$0"
# The name of this program:
progname=`echo "$progpath" | $SED $basename`
modename="$progname"
# Global variables:
EXIT_SUCCESS=0
EXIT_FAILURE=1
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.5.8
TIMESTAMP=" (1.1220.2.117 2004/08/04 14:12:05)"
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes.
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
# Check that we have a working $echo. # Check that we have a working $echo.
if test "X$1" = X--no-reexec; then if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue. # Discard the --no-reexec flag, and continue.
...@@ -36,7 +65,7 @@ elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then ...@@ -36,7 +65,7 @@ elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
: :
else else
# Restart under the correct shell, and then maybe $echo will work. # Restart under the correct shell, and then maybe $echo will work.
exec $SHELL "$0" --no-reexec ${1+"$@"} exec $SHELL "$progpath" --no-reexec ${1+"$@"}
fi fi
if test "X$1" = X--fallback-echo; then if test "X$1" = X--fallback-echo; then
...@@ -45,19 +74,9 @@ if test "X$1" = X--fallback-echo; then ...@@ -45,19 +74,9 @@ if test "X$1" = X--fallback-echo; then
cat <<EOF cat <<EOF
$* $*
EOF EOF
exit 0 exit $EXIT_SUCCESS
fi fi
# The name of this program.
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.5
TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)"
default_mode= default_mode=
help="Try \`$progname --help' for more information." help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%" magic="%%%MAGIC variable%%%"
...@@ -70,8 +89,8 @@ rm="rm -f" ...@@ -70,8 +89,8 @@ rm="rm -f"
Xsed="${SED}"' -e 1s/^X//' Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# test EBCDIC or ASCII # test EBCDIC or ASCII
case `echo A|od -x` in case `echo A|tr A '\301'` in
*[Cc]1*) # EBCDIC based system A) # EBCDIC based system
SP2NL="tr '\100' '\n'" SP2NL="tr '\100' '\n'"
NL2SP="tr '\r\n' '\100\100'" NL2SP="tr '\r\n' '\100\100'"
;; ;;
...@@ -94,12 +113,13 @@ if test "${LANG+set}" = set; then ...@@ -94,12 +113,13 @@ if test "${LANG+set}" = set; then
fi fi
# Make sure IFS has a sensible default # Make sure IFS has a sensible default
: ${IFS=" "} : ${IFS="
"}
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
$echo "$modename: not configured to build any kind of library" 1>&2 $echo "$modename: not configured to build any kind of library" 1>&2
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Global variables. # Global variables.
...@@ -118,10 +138,13 @@ o2lo="s/\\.${objext}\$/.lo/" ...@@ -118,10 +138,13 @@ o2lo="s/\\.${objext}\$/.lo/"
# Shell function definitions: # Shell function definitions:
# This seems to be the best place for them # This seems to be the best place for them
# func_win32_libid arg
# return the library type of file 'arg'
#
# Need a lot of goo to handle *both* DLLs and import libs # Need a lot of goo to handle *both* DLLs and import libs
# Has to be a shell function in order to 'eat' the argument # Has to be a shell function in order to 'eat' the argument
# that is supplied when $file_magic_command is called. # that is supplied when $file_magic_command is called.
win32_libid () { func_win32_libid () {
win32_libid_type="unknown" win32_libid_type="unknown"
win32_fileres=`file -L $1 2>/dev/null` win32_fileres=`file -L $1 2>/dev/null`
case $win32_fileres in case $win32_fileres in
...@@ -130,7 +153,7 @@ win32_libid () { ...@@ -130,7 +153,7 @@ win32_libid () {
;; ;;
*ar\ archive*) # could be an import, or static *ar\ archive*) # could be an import, or static
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
win32_nmres=`eval $NM -f posix -A $1 | \ win32_nmres=`eval $NM -f posix -A $1 | \
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
if test "X$win32_nmres" = "Ximport" ; then if test "X$win32_nmres" = "Ximport" ; then
...@@ -154,9 +177,192 @@ win32_libid () { ...@@ -154,9 +177,192 @@ win32_libid () {
$echo $win32_libid_type $echo $win32_libid_type
} }
# func_infer_tag arg
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base compile
# command doesn't match the default compiler.
# arg is usually of the form 'gcc ...'
func_infer_tag () {
if test -n "$available_tags" && test -z "$tagname"; then
CC_quoted=
for arg in $CC; do
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
CC_quoted="$CC_quoted $arg"
done
case $@ in
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when configure was run.
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
for z in $available_tags; do
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
CC_quoted=
for arg in $CC; do
# Double-quote args containing other shell metacharacters.
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
CC_quoted="$CC_quoted $arg"
done
case "$@ " in
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
# The compiler in the base compile command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
tagname=$z
break
;;
esac
fi
done
# If $tagname still isn't set, then no tagged configuration
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
$echo "$modename: unable to infer tagged configuration"
$echo "$modename: specify a tag with \`--tag'" 1>&2
exit $EXIT_FAILURE
# else
# $echo "$modename: using $tagname tagged configuration"
fi
;;
esac
fi
}
# func_extract_archives gentop oldlib ...
func_extract_archives () {
my_gentop="$1"; shift
my_oldlibs=${1+"$@"}
my_oldobjs=""
my_xlib=""
my_xabs=""
my_xdir=""
my_status=""
$show "${rm}r $my_gentop"
$run ${rm}r "$my_gentop"
$show "$mkdir $my_gentop"
$run $mkdir "$my_gentop"
my_status=$?
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
exit $my_status
fi
for my_xlib in $my_oldlibs; do
# Extract the objects.
case $my_xlib in
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
my_xdir="$my_gentop/$my_xlib"
$show "${rm}r $my_xdir"
$run ${rm}r "$my_xdir"
$show "$mkdir $my_xdir"
$run $mkdir "$my_xdir"
status=$?
if test "$status" -ne 0 && test ! -d "$my_xdir"; then
exit $status
fi
case $host in
*-darwin*)
$show "Extracting $my_xabs"
# Do not bother doing anything if just a dry run
if test -z "$run"; then
darwin_orig_dir=`pwd`
cd $my_xdir || exit $?
darwin_archive=$my_xabs
darwin_curdir=`pwd`
darwin_base_archive=`basename $darwin_archive`
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
if test -n "$darwin_arches"; then
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
darwin_arch=
$show "$darwin_base_archive has multiple architectures $darwin_arches"
for darwin_arch in $darwin_arches ; do
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
# Remove the table of contents from the thin files.
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
$AR -xo "${darwin_base_archive}"
rm "${darwin_base_archive}"
cd "$darwin_curdir"
done # $darwin_arches
## Okay now we have a bunch of thin objects, gotta fatten them up :)
darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
lipo -create -output "$darwin_file" $darwin_files
done # $darwin_filelist
rm -rf unfat-$$
cd "$darwin_orig_dir"
else
cd $darwin_orig_dir
(cd $my_xdir && $AR x $my_xabs) || exit $?
fi # $darwin_arches
fi # $run
;;
*)
# We will extract separately just the conflicting names and we will
# no longer touch any unique names. It is faster to leave these
# extract automatically by $AR in one run.
$show "(cd $my_xdir && $AR x $my_xabs)"
$run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
$AR t "$my_xabs" | sort | uniq -cd | while read -r count name
do
i=1
while test "$i" -le "$count"
do
# Put our $i before any first dot (extension)
# Never overwrite any file
name_to="$name"
while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
do
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
done
$show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
$run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
i=`expr $i + 1`
done
done
fi
;;
esac
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
func_extract_archives_result="$my_oldobjs"
}
# End of Shell function definitions # End of Shell function definitions
##################################### #####################################
# Darwin sucks
eval std_shrext=\"$shrext_cmds\"
# Parse our command line options once, thoroughly. # Parse our command line options once, thoroughly.
while test "$#" -gt 0 while test "$#" -gt 0
do do
...@@ -176,12 +382,13 @@ do ...@@ -176,12 +382,13 @@ do
;; ;;
tag) tag)
tagname="$arg" tagname="$arg"
preserve_args="${preserve_args}=$arg"
# Check whether tagname contains only valid characters # Check whether tagname contains only valid characters
case $tagname in case $tagname in
*[!-_A-Za-z0-9,/]*) *[!-_A-Za-z0-9,/]*)
$echo "$progname: invalid tag name: $tagname" 1>&2 $echo "$progname: invalid tag name: $tagname" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
...@@ -191,10 +398,10 @@ do ...@@ -191,10 +398,10 @@ do
# not specially marked. # not specially marked.
;; ;;
*) *)
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
taglist="$taglist $tagname" taglist="$taglist $tagname"
# Evaluate the configuration. # Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
else else
$echo "$progname: ignoring unknown tag $tagname" 1>&2 $echo "$progname: ignoring unknown tag $tagname" 1>&2
fi fi
...@@ -223,21 +430,22 @@ do ...@@ -223,21 +430,22 @@ do
$echo "Copyright (C) 2003 Free Software Foundation, Inc." $echo "Copyright (C) 2003 Free Software Foundation, Inc."
$echo "This is free software; see the source for copying conditions. There is NO" $echo "This is free software; see the source for copying conditions. There is NO"
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit 0 exit $EXIT_SUCCESS
;; ;;
--config) --config)
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
# Now print the configurations for the tags. # Now print the configurations for the tags.
for tagname in $taglist; do for tagname in $taglist; do
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
done done
exit 0 exit $EXIT_SUCCESS
;; ;;
--debug) --debug)
$echo "$progname: enabling shell trace mode" $echo "$progname: enabling shell trace mode"
set -x set -x
preserve_args="$preserve_args $arg"
;; ;;
--dry-run | -n) --dry-run | -n)
...@@ -256,7 +464,7 @@ do ...@@ -256,7 +464,7 @@ do
else else
$echo "disable static libraries" $echo "disable static libraries"
fi fi
exit 0 exit $EXIT_SUCCESS
;; ;;
--finish) mode="finish" ;; --finish) mode="finish" ;;
...@@ -268,6 +476,7 @@ do ...@@ -268,6 +476,7 @@ do
--quiet | --silent) --quiet | --silent)
show=: show=:
preserve_args="$preserve_args $arg"
;; ;;
--tag) prevopt="--tag" prev=tag ;; --tag) prevopt="--tag" prev=tag ;;
...@@ -275,6 +484,7 @@ do ...@@ -275,6 +484,7 @@ do
set tag "$optarg" ${1+"$@"} set tag "$optarg" ${1+"$@"}
shift shift
prev=tag prev=tag
preserve_args="$preserve_args --tag"
;; ;;
-dlopen) -dlopen)
...@@ -285,7 +495,7 @@ do ...@@ -285,7 +495,7 @@ do
-*) -*)
$echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$modename: unrecognized option \`$arg'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
*) *)
...@@ -298,7 +508,7 @@ done ...@@ -298,7 +508,7 @@ done
if test -n "$prevopt"; then if test -n "$prevopt"; then
$echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# If this variable is set in any of the actions, the command in it # If this variable is set in any of the actions, the command in it
...@@ -354,7 +564,7 @@ if test -z "$show_help"; then ...@@ -354,7 +564,7 @@ if test -z "$show_help"; then
if test -n "$execute_dlfiles" && test "$mode" != execute; then if test -n "$execute_dlfiles" && test "$mode" != execute; then
$echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Change the help message to a mode-specific one. # Change the help message to a mode-specific one.
...@@ -369,9 +579,11 @@ if test -z "$show_help"; then ...@@ -369,9 +579,11 @@ if test -z "$show_help"; then
# Get the compilation command and the source file. # Get the compilation command and the source file.
base_compile= base_compile=
srcfile="$nonopt" # always keep a non-empty value in "srcfile" srcfile="$nonopt" # always keep a non-empty value in "srcfile"
suppress_opt=yes
suppress_output= suppress_output=
arg_mode=normal arg_mode=normal
libobj= libobj=
later=
for arg for arg
do do
...@@ -394,24 +606,19 @@ if test -z "$show_help"; then ...@@ -394,24 +606,19 @@ if test -z "$show_help"; then
-o) -o)
if test -n "$libobj" ; then if test -n "$libobj" ; then
$echo "$modename: you cannot specify \`-o' more than once" 1>&2 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
arg_mode=target arg_mode=target
continue continue
;; ;;
-static) -static | -prefer-pic | -prefer-non-pic)
build_old_libs=yes later="$later $arg"
continue continue
;; ;;
-prefer-pic) -no-suppress)
pic_mode=yes suppress_opt=no
continue
;;
-prefer-non-pic)
pic_mode=no
continue continue
;; ;;
...@@ -474,11 +681,11 @@ if test -z "$show_help"; then ...@@ -474,11 +681,11 @@ if test -z "$show_help"; then
case $arg_mode in case $arg_mode in
arg) arg)
$echo "$modename: you must specify an argument for -Xcompile" $echo "$modename: you must specify an argument for -Xcompile"
exit 1 exit $EXIT_FAILURE
;; ;;
target) target)
$echo "$modename: you must specify a target with \`-o'" 1>&2 $echo "$modename: you must specify a target with \`-o'" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
*) *)
# Get the name of the library object. # Get the name of the library object.
...@@ -511,50 +718,30 @@ if test -z "$show_help"; then ...@@ -511,50 +718,30 @@ if test -z "$show_help"; then
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
*) *)
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
# Infer tagged configuration to use if any are available and func_infer_tag $base_compile
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base compile for arg in $later; do
# command doesn't match the default compiler. case $arg in
if test -n "$available_tags" && test -z "$tagname"; then -static)
case $base_compile in build_old_libs=yes
# Blanks in the command may have been stripped by the calling shell, continue
# but not from the CC environment variable when configure was run.
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
for z in $available_tags; do
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
case "$base_compile " in
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
# The compiler in the base compile command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
tagname=$z
break
;; ;;
esac
fi -prefer-pic)
done pic_mode=yes
# If $tagname still isn't set, then no tagged configuration continue
# was found and let the user know that the "--tag" command ;;
# line option must be used.
if test -z "$tagname"; then -prefer-non-pic)
$echo "$modename: unable to infer tagged configuration" pic_mode=no
$echo "$modename: specify a tag with \`--tag'" 1>&2 continue
exit 1
# else
# $echo "$modename: using $tagname tagged configuration"
fi
;; ;;
esac esac
fi done
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
...@@ -568,7 +755,7 @@ if test -z "$show_help"; then ...@@ -568,7 +755,7 @@ if test -z "$show_help"; then
if test -z "$base_compile"; then if test -z "$base_compile"; then
$echo "$modename: you must specify a compilation command" 1>&2 $echo "$modename: you must specify a compilation command" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Delete any leftover library objects. # Delete any leftover library objects.
...@@ -579,7 +766,7 @@ if test -z "$show_help"; then ...@@ -579,7 +766,7 @@ if test -z "$show_help"; then
fi fi
$run $rm $removelist $run $rm $removelist
trap "$run $rm $removelist; exit 1" 1 2 15 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
# On Cygwin there's no "real" PIC flag so we must build both object types # On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in case $host_os in
...@@ -598,7 +785,7 @@ if test -z "$show_help"; then ...@@ -598,7 +785,7 @@ if test -z "$show_help"; then
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
lockfile="$output_obj.lock" lockfile="$output_obj.lock"
removelist="$removelist $output_obj $lockfile" removelist="$removelist $output_obj $lockfile"
trap "$run $rm $removelist; exit 1" 1 2 15 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
else else
output_obj= output_obj=
need_locks=no need_locks=no
...@@ -608,7 +795,7 @@ if test -z "$show_help"; then ...@@ -608,7 +795,7 @@ if test -z "$show_help"; then
# Lock this critical section if it is needed # Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file # We use this script file to make the link, it avoids creating a new file
if test "$need_locks" = yes; then if test "$need_locks" = yes; then
until $run ln "$0" "$lockfile" 2>/dev/null; do until $run ln "$progpath" "$lockfile" 2>/dev/null; do
$show "Waiting for $lockfile to be removed" $show "Waiting for $lockfile to be removed"
sleep 2 sleep 2
done done
...@@ -626,7 +813,7 @@ avoid parallel builds (make -j) in this platform, or get a better ...@@ -626,7 +813,7 @@ avoid parallel builds (make -j) in this platform, or get a better
compiler." compiler."
$run $rm $removelist $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
$echo $srcfile > "$lockfile" $echo $srcfile > "$lockfile"
fi fi
...@@ -681,7 +868,7 @@ EOF ...@@ -681,7 +868,7 @@ EOF
if $run eval "$command"; then : if $run eval "$command"; then :
else else
test -n "$output_obj" && $run $rm $removelist test -n "$output_obj" && $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
if test "$need_locks" = warn && if test "$need_locks" = warn &&
...@@ -701,7 +888,7 @@ avoid parallel builds (make -j) in this platform, or get a better ...@@ -701,7 +888,7 @@ avoid parallel builds (make -j) in this platform, or get a better
compiler." compiler."
$run $rm $removelist $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
# Just move the object if needed, then go on to compile the next one # Just move the object if needed, then go on to compile the next one
...@@ -722,7 +909,9 @@ pic_object='$objdir/$objname' ...@@ -722,7 +909,9 @@ pic_object='$objdir/$objname'
EOF EOF
# Allow error messages only from the first compilation. # Allow error messages only from the first compilation.
if test "$suppress_opt" = yes; then
suppress_output=' >/dev/null 2>&1' suppress_output=' >/dev/null 2>&1'
fi
else else
# No PIC object so indicate it doesn't exist in the libtool # No PIC object so indicate it doesn't exist in the libtool
# object file. # object file.
...@@ -751,7 +940,7 @@ EOF ...@@ -751,7 +940,7 @@ EOF
if $run eval "$command"; then : if $run eval "$command"; then :
else else
$run $rm $removelist $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
if test "$need_locks" = warn && if test "$need_locks" = warn &&
...@@ -771,7 +960,7 @@ avoid parallel builds (make -j) in this platform, or get a better ...@@ -771,7 +960,7 @@ avoid parallel builds (make -j) in this platform, or get a better
compiler." compiler."
$run $rm $removelist $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
# Just move the object if needed # Just move the object if needed
...@@ -809,7 +998,7 @@ EOF ...@@ -809,7 +998,7 @@ EOF
$run $rm "$lockfile" $run $rm "$lockfile"
fi fi
exit 0 exit $EXIT_SUCCESS
;; ;;
# libtool link mode # libtool link mode
...@@ -835,7 +1024,7 @@ EOF ...@@ -835,7 +1024,7 @@ EOF
;; ;;
esac esac
libtool_args="$nonopt" libtool_args="$nonopt"
base_compile="$nonopt" base_compile="$nonopt $@"
compile_command="$nonopt" compile_command="$nonopt"
finalize_command="$nonopt" finalize_command="$nonopt"
...@@ -867,6 +1056,7 @@ EOF ...@@ -867,6 +1056,7 @@ EOF
no_install=no no_install=no
objs= objs=
non_pic_objects= non_pic_objects=
precious_files_regex=
prefer_static_libs=no prefer_static_libs=no
preload=no preload=no
prev= prev=
...@@ -880,6 +1070,8 @@ EOF ...@@ -880,6 +1070,8 @@ EOF
vinfo= vinfo=
vinfo_number=no vinfo_number=no
func_infer_tag $base_compile
# We need to know -static, to get the right output filenames. # We need to know -static, to get the right output filenames.
for arg for arg
do do
...@@ -911,7 +1103,6 @@ EOF ...@@ -911,7 +1103,6 @@ EOF
# Go through the arguments, transforming them on the way. # Go through the arguments, transforming them on the way.
while test "$#" -gt 0; do while test "$#" -gt 0; do
arg="$1" arg="$1"
base_compile="$base_compile $arg"
shift shift
case $arg in case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
...@@ -975,7 +1166,7 @@ EOF ...@@ -975,7 +1166,7 @@ EOF
export_symbols="$arg" export_symbols="$arg"
if test ! -f "$arg"; then if test ! -f "$arg"; then
$echo "$modename: symbol file \`$arg' does not exist" $echo "$modename: symbol file \`$arg' does not exist"
exit 1 exit $EXIT_FAILURE
fi fi
prev= prev=
continue continue
...@@ -990,6 +1181,11 @@ EOF ...@@ -990,6 +1181,11 @@ EOF
prev= prev=
continue continue
;; ;;
precious_regex)
precious_files_regex="$arg"
prev=
continue
;;
release) release)
release="-$arg" release="-$arg"
prev= prev=
...@@ -1022,7 +1218,7 @@ EOF ...@@ -1022,7 +1218,7 @@ EOF
test "$pic_object" = none && \ test "$pic_object" = none && \
test "$non_pic_object" = none; then test "$non_pic_object" = none; then
$echo "$modename: cannot find name of object for \`$arg'" 1>&2 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Extract subdirectory from the argument. # Extract subdirectory from the argument.
...@@ -1075,7 +1271,7 @@ EOF ...@@ -1075,7 +1271,7 @@ EOF
# Only an error if not doing a dry-run. # Only an error if not doing a dry-run.
if test -z "$run"; then if test -z "$run"; then
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
exit 1 exit $EXIT_FAILURE
else else
# Dry-run case. # Dry-run case.
...@@ -1096,7 +1292,7 @@ EOF ...@@ -1096,7 +1292,7 @@ EOF
done done
else else
$echo "$modename: link input file \`$save_arg' does not exist" $echo "$modename: link input file \`$save_arg' does not exist"
exit 1 exit $EXIT_FAILURE
fi fi
arg=$save_arg arg=$save_arg
prev= prev=
...@@ -1108,7 +1304,7 @@ EOF ...@@ -1108,7 +1304,7 @@ EOF
[\\/]* | [A-Za-z]:[\\/]*) ;; [\\/]* | [A-Za-z]:[\\/]*) ;;
*) *)
$echo "$modename: only absolute run-paths are allowed" 1>&2 $echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
if test "$prev" = rpath; then if test "$prev" = rpath; then
...@@ -1161,6 +1357,11 @@ EOF ...@@ -1161,6 +1357,11 @@ EOF
prev= prev=
continue continue
;; ;;
shrext)
shrext_cmds="$arg"
prev=
continue
;;
*) *)
eval "$prev=\"\$arg\"" eval "$prev=\"\$arg\""
prev= prev=
...@@ -1209,7 +1410,7 @@ EOF ...@@ -1209,7 +1410,7 @@ EOF
-export-symbols | -export-symbols-regex) -export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: more than one -exported-symbols argument is not allowed" $echo "$modename: more than one -exported-symbols argument is not allowed"
exit 1 exit $EXIT_FAILURE
fi fi
if test "X$arg" = "X-export-symbols"; then if test "X$arg" = "X-export-symbols"; then
prev=expsyms prev=expsyms
...@@ -1245,7 +1446,7 @@ EOF ...@@ -1245,7 +1446,7 @@ EOF
absdir=`cd "$dir" && pwd` absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
dir="$absdir" dir="$absdir"
;; ;;
...@@ -1300,6 +1501,11 @@ EOF ...@@ -1300,6 +1501,11 @@ EOF
continue continue
;; ;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
deplibs="$deplibs $arg"
continue
;;
-module) -module)
module=yes module=yes
continue continue
...@@ -1364,6 +1570,11 @@ EOF ...@@ -1364,6 +1570,11 @@ EOF
-o) prev=output ;; -o) prev=output ;;
-precious-files-regex)
prev=precious_regex
continue
;;
-release) -release)
prev=release prev=release
continue continue
...@@ -1386,7 +1597,7 @@ EOF ...@@ -1386,7 +1597,7 @@ EOF
[\\/]* | [A-Za-z]:[\\/]*) ;; [\\/]* | [A-Za-z]:[\\/]*) ;;
*) *)
$echo "$modename: only absolute run-paths are allowed" 1>&2 $echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
case "$xrpath " in case "$xrpath " in
...@@ -1514,7 +1725,7 @@ EOF ...@@ -1514,7 +1725,7 @@ EOF
test "$pic_object" = none && \ test "$pic_object" = none && \
test "$non_pic_object" = none; then test "$non_pic_object" = none; then
$echo "$modename: cannot find name of object for \`$arg'" 1>&2 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Extract subdirectory from the argument. # Extract subdirectory from the argument.
...@@ -1567,7 +1778,7 @@ EOF ...@@ -1567,7 +1778,7 @@ EOF
# Only an error if not doing a dry-run. # Only an error if not doing a dry-run.
if test -z "$run"; then if test -z "$run"; then
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
exit 1 exit $EXIT_FAILURE
else else
# Dry-run case. # Dry-run case.
...@@ -1634,48 +1845,7 @@ EOF ...@@ -1634,48 +1845,7 @@ EOF
if test -n "$prev"; then if test -n "$prev"; then
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base link
# command doesn't match the default compiler.
if test -n "$available_tags" && test -z "$tagname"; then
case $base_compile in
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when configure was run.
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
for z in $available_tags; do
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
case $base_compile in
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
# The compiler in $compile_command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
tagname=$z
break
;;
esac
fi
done
# If $tagname still isn't set, then no tagged configuration
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
$echo "$modename: unable to infer tagged configuration"
$echo "$modename: specify a tag with \`--tag'" 1>&2
exit 1
# else
# $echo "$modename: using $tagname tagged configuration"
fi
;;
esac
fi fi
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
...@@ -1719,7 +1889,7 @@ EOF ...@@ -1719,7 +1889,7 @@ EOF
"") "")
$echo "$modename: you must specify an output file" 1>&2 $echo "$modename: you must specify an output file" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
*.$libext) linkmode=oldlib ;; *.$libext) linkmode=oldlib ;;
*.lo | *.$objext) linkmode=obj ;; *.lo | *.$objext) linkmode=obj ;;
...@@ -1729,7 +1899,7 @@ EOF ...@@ -1729,7 +1899,7 @@ EOF
case $host in case $host in
*cygwin* | *mingw* | *pw32*) *cygwin* | *mingw* | *pw32*)
# don't eliminate duplcations in $postdeps and $predeps # don't eliminate duplications in $postdeps and $predeps
duplicate_compiler_generated_deps=yes duplicate_compiler_generated_deps=yes
;; ;;
*) *)
...@@ -1782,7 +1952,7 @@ EOF ...@@ -1782,7 +1952,7 @@ EOF
*.la) ;; *.la) ;;
*) *)
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
done done
...@@ -1820,6 +1990,15 @@ EOF ...@@ -1820,6 +1990,15 @@ EOF
lib= lib=
found=no found=no
case $deplib in case $deplib in
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
fi
continue
;;
-l*) -l*)
if test "$linkmode" != lib && test "$linkmode" != prog; then if test "$linkmode" != lib && test "$linkmode" != prog; then
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
...@@ -1831,12 +2010,18 @@ EOF ...@@ -1831,12 +2010,18 @@ EOF
fi fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library # Search the libtool library
lib="$searchdir/lib${name}.la" lib="$searchdir/lib${name}${search_ext}"
if test -f "$lib"; then if test -f "$lib"; then
if test "$search_ext" = ".la"; then
found=yes found=yes
break else
found=no
fi fi
break 2
fi
done
done done
if test "$found" != yes; then if test "$found" != yes; then
# deplib doesn't seem to be a libtool library # deplib doesn't seem to be a libtool library
...@@ -1913,11 +2098,11 @@ EOF ...@@ -1913,11 +2098,11 @@ EOF
fi fi
if test "$pass" = scan; then if test "$pass" = scan; then
deplibs="$deplib $deplibs" deplibs="$deplib $deplibs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
else else
compile_deplibs="$deplib $compile_deplibs" compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs" finalize_deplibs="$deplib $finalize_deplibs"
fi fi
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;; ;;
*) *)
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
...@@ -1945,7 +2130,22 @@ EOF ...@@ -1945,7 +2130,22 @@ EOF
fi fi
case $linkmode in case $linkmode in
lib) lib)
if test "$deplibs_check_method" != pass_all; then valid_a_lib=no
case $deplibs_check_method in
match_pattern*)
set dummy $deplibs_check_method
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
if eval $echo \"$deplib\" 2>/dev/null \
| $SED 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
valid_a_lib=yes
fi
;;
pass_all)
valid_a_lib=yes
;;
esac
if test "$valid_a_lib" != yes; then
$echo $echo
$echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** Warning: Trying to link with static lib archive $deplib."
$echo "*** I have the capability to make that library automatically link in when" $echo "*** I have the capability to make that library automatically link in when"
...@@ -1996,14 +2196,14 @@ EOF ...@@ -1996,14 +2196,14 @@ EOF
if test "$found" = yes || test -f "$lib"; then : if test "$found" = yes || test -f "$lib"; then :
else else
$echo "$modename: cannot find the library \`$lib'" 1>&2 $echo "$modename: cannot find the library \`$lib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Check to see that this really is a libtool archive. # Check to see that this really is a libtool archive.
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
...@@ -2046,7 +2246,7 @@ EOF ...@@ -2046,7 +2246,7 @@ EOF
if test -z "$libdir"; then if test -z "$libdir"; then
if test -z "$old_library"; then if test -z "$old_library"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# It is a libtool convenience library, so add in its objects. # It is a libtool convenience library, so add in its objects.
convenience="$convenience $ladir/$objdir/$old_library" convenience="$convenience $ladir/$objdir/$old_library"
...@@ -2063,7 +2263,7 @@ EOF ...@@ -2063,7 +2263,7 @@ EOF
done done
elif test "$linkmode" != prog && test "$linkmode" != lib; then elif test "$linkmode" != prog && test "$linkmode" != lib; then
$echo "$modename: \`$lib' is not a convenience library" 1>&2 $echo "$modename: \`$lib' is not a convenience library" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
continue continue
fi # $pass = conv fi # $pass = conv
...@@ -2076,16 +2276,18 @@ EOF ...@@ -2076,16 +2276,18 @@ EOF
done done
if test -z "$linklib"; then if test -z "$linklib"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# This library was specified with -dlopen. # This library was specified with -dlopen.
if test "$pass" = dlopen; then if test "$pass" = dlopen; then
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no; then
# If there is no dlname, no dlopen support or we're linking # If there is no dlname, no dlopen support or we're linking
# statically, we need to preload. We also need to preload any # statically, we need to preload. We also need to preload any
# dependent libraries so libltdl's deplib preloader doesn't # dependent libraries so libltdl's deplib preloader doesn't
...@@ -2122,11 +2324,18 @@ EOF ...@@ -2122,11 +2324,18 @@ EOF
dir="$libdir" dir="$libdir"
absdir="$libdir" absdir="$libdir"
fi fi
else
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
dir="$ladir"
absdir="$abs_ladir"
# Remove this search path later
notinst_path="$notinst_path $abs_ladir"
else else
dir="$ladir/$objdir" dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir" absdir="$abs_ladir/$objdir"
# Remove this search path later # Remove this search path later
notinst_path="$notinst_path $abs_ladir" notinst_path="$notinst_path $abs_ladir"
fi
fi # $installed = yes fi # $installed = yes
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
...@@ -2134,7 +2343,7 @@ EOF ...@@ -2134,7 +2343,7 @@ EOF
if test "$pass" = dlpreopen; then if test "$pass" = dlpreopen; then
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Prefer using a static library (so that no silly _DYNAMIC symbols # Prefer using a static library (so that no silly _DYNAMIC symbols
# are required to link). # are required to link).
...@@ -2249,7 +2458,8 @@ EOF ...@@ -2249,7 +2458,8 @@ EOF
fi fi
# This is a shared library # This is a shared library
# Warn about portability, can't link against -module's on some systems (darwin) # Warn about portability, can't link against -module's on
# some systems (darwin)
if test "$shouldnotlink" = yes && test "$pass" = link ; then if test "$shouldnotlink" = yes && test "$pass" = link ; then
$echo $echo
if test "$linkmode" = prog; then if test "$linkmode" = prog; then
...@@ -2316,9 +2526,10 @@ EOF ...@@ -2316,9 +2526,10 @@ EOF
else else
$show "extracting exported symbol list from \`$soname'" $show "extracting exported symbol list from \`$soname'"
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
eval cmds=\"$extract_expsyms_cmds\" cmds=$extract_expsyms_cmds
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -2329,9 +2540,10 @@ EOF ...@@ -2329,9 +2540,10 @@ EOF
if test -f "$output_objdir/$newlib"; then :; else if test -f "$output_objdir/$newlib"; then :; else
$show "generating import library for \`$soname'" $show "generating import library for \`$soname'"
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
eval cmds=\"$old_archive_from_expsyms_cmds\" cmds=$old_archive_from_expsyms_cmds
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -2354,9 +2566,9 @@ EOF ...@@ -2354,9 +2566,9 @@ EOF
case $host in case $host in
*-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-sco3.2v5* ) add_dir="-L$dir" ;;
*-*-darwin* ) *-*-darwin* )
# if the lib is a module then we can not link against it, someone # if the lib is a module then we can not link against
# is ignoring the new warnings I added # it, someone is ignoring the new warnings I added
if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
$echo "** Warning, lib $linklib is a module, not a shared library" $echo "** Warning, lib $linklib is a module, not a shared library"
if test -z "$old_library" ; then if test -z "$old_library" ; then
$echo $echo
...@@ -2389,7 +2601,7 @@ EOF ...@@ -2389,7 +2601,7 @@ EOF
if test -n "$inst_prefix_dir"; then if test -n "$inst_prefix_dir"; then
case "$libdir" in case "$libdir" in
[\\/]*) [\\/]*)
add_dir="-L$inst_prefix_dir$libdir $add_dir" add_dir="$add_dir -L$inst_prefix_dir$libdir"
;; ;;
esac esac
fi fi
...@@ -2406,7 +2618,7 @@ EOF ...@@ -2406,7 +2618,7 @@ EOF
if test "$lib_linked" != yes; then if test "$lib_linked" != yes; then
$echo "$modename: configuration error: unsupported hardcode properties" $echo "$modename: configuration error: unsupported hardcode properties"
exit 1 exit $EXIT_FAILURE
fi fi
if test -n "$add_shlibpath"; then if test -n "$add_shlibpath"; then
...@@ -2449,7 +2661,8 @@ EOF ...@@ -2449,7 +2661,8 @@ EOF
esac esac
add="-l$name" add="-l$name"
elif test "$hardcode_automatic" = yes; then elif test "$hardcode_automatic" = yes; then
if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then if test -n "$inst_prefix_dir" &&
test -f "$inst_prefix_dir$libdir/$linklib" ; then
add="$inst_prefix_dir$libdir/$linklib" add="$inst_prefix_dir$libdir/$linklib"
else else
add="$libdir/$linklib" add="$libdir/$linklib"
...@@ -2461,7 +2674,7 @@ EOF ...@@ -2461,7 +2674,7 @@ EOF
if test -n "$inst_prefix_dir"; then if test -n "$inst_prefix_dir"; then
case "$libdir" in case "$libdir" in
[\\/]*) [\\/]*)
add_dir="-L$inst_prefix_dir$libdir $add_dir" add_dir="$add_dir -L$inst_prefix_dir$libdir"
;; ;;
esac esac
fi fi
...@@ -2529,7 +2742,8 @@ EOF ...@@ -2529,7 +2742,8 @@ EOF
if test "$linkmode" = lib; then if test "$linkmode" = lib; then
if test -n "$dependency_libs" && if test -n "$dependency_libs" &&
{ test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || { test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes ||
test "$link_static" = yes; }; then test "$link_static" = yes; }; then
# Extract -R from dependency_libs # Extract -R from dependency_libs
temp_deplibs= temp_deplibs=
...@@ -2586,7 +2800,7 @@ EOF ...@@ -2586,7 +2800,7 @@ EOF
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test "$absdir" != "$libdir"; then if test "$absdir" != "$libdir"; then
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
...@@ -2596,7 +2810,8 @@ EOF ...@@ -2596,7 +2810,8 @@ EOF
depdepl= depdepl=
case $host in case $host in
*-*-darwin*) *-*-darwin*)
# we do not want to link against static libs, but need to link against shared # we do not want to link against static libs,
# but need to link against shared
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do for tmp in $deplibrary_names ; do
...@@ -2617,7 +2832,6 @@ EOF ...@@ -2617,7 +2832,6 @@ EOF
path="-L$path" path="-L$path"
;; ;;
esac esac
;; ;;
-l*) -l*)
case $host in case $host in
...@@ -2632,10 +2846,6 @@ EOF ...@@ -2632,10 +2846,6 @@ EOF
done done
path="" path=""
;; ;;
*) continue ;;
esac
;;
*.framework) *.framework)
case $host in case $host in
*-*-darwin*) *-*-darwin*)
...@@ -2643,12 +2853,14 @@ EOF ...@@ -2643,12 +2853,14 @@ EOF
;; ;;
esac esac
;; ;;
*) continue ;;
esac
;;
*) continue ;; *) continue ;;
esac esac
case " $deplibs " in case " $deplibs " in
*" $depdepl "*) ;; *" $depdepl "*) ;;
*) deplibs="$deplibs $depdepl" ;; *) deplibs="$depdepl $deplibs" ;;
esac esac
case " $deplibs " in case " $deplibs " in
*" $path "*) ;; *" $path "*) ;;
...@@ -2739,7 +2951,8 @@ EOF ...@@ -2739,7 +2951,8 @@ EOF
eval $var=\"$tmp_libs\" eval $var=\"$tmp_libs\"
done # for var done # for var
fi fi
# Last step: remove runtime libs from dependency_libs (they stay in deplibs) # Last step: remove runtime libs from dependency_libs
# (they stay in deplibs)
tmp_libs= tmp_libs=
for i in $dependency_libs ; do for i in $dependency_libs ; do
case " $predeps $postdeps $compiler_lib_search_path " in case " $predeps $postdeps $compiler_lib_search_path " in
...@@ -2799,19 +3012,19 @@ EOF ...@@ -2799,19 +3012,19 @@ EOF
case $outputname in case $outputname in
lib*) lib*)
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
eval shared_ext=\"$shrext\" eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\" eval libname=\"$libname_spec\"
;; ;;
*) *)
if test "$module" = no; then if test "$module" = no; then
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test "$need_lib_prefix" != no; then if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required # Add the "lib" prefix for modules if required
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
eval shared_ext=\"$shrext\" eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\" eval libname=\"$libname_spec\"
else else
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
...@@ -2822,7 +3035,7 @@ EOF ...@@ -2822,7 +3035,7 @@ EOF
if test -n "$objs"; then if test -n "$objs"; then
if test "$deplibs_check_method" != pass_all; then if test "$deplibs_check_method" != pass_all; then
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
exit 1 exit $EXIT_FAILURE
else else
$echo $echo
$echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** Warning: Linking the shared library $output against the non-libtool"
...@@ -2870,7 +3083,7 @@ EOF ...@@ -2870,7 +3083,7 @@ EOF
if test -n "$8"; then if test -n "$8"; then
$echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$modename: too many parameters to \`-version-info'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# convert absolute version numbers to libtool ages # convert absolute version numbers to libtool ages
...@@ -2920,7 +3133,7 @@ EOF ...@@ -2920,7 +3133,7 @@ EOF
*) *)
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
...@@ -2929,7 +3142,7 @@ EOF ...@@ -2929,7 +3142,7 @@ EOF
*) *)
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
...@@ -2938,14 +3151,14 @@ EOF ...@@ -2938,14 +3151,14 @@ EOF
*) *)
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
if test "$age" -gt "$current"; then if test "$age" -gt "$current"; then
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Calculate the version variables. # Calculate the version variables.
...@@ -2962,7 +3175,7 @@ EOF ...@@ -2962,7 +3175,7 @@ EOF
versuffix="$major.$age.$revision" versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options... # Darwin ld doesn't like 0 for these options...
minor_current=`expr $current + 1` minor_current=`expr $current + 1`
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
;; ;;
freebsd-aout) freebsd-aout)
...@@ -2975,12 +3188,6 @@ EOF ...@@ -2975,12 +3188,6 @@ EOF
versuffix=".$current"; versuffix=".$current";
;; ;;
qnx)
major=".$current"
versuffix=".$current"
deplibs_check_method="pass_all"
;;
irix | nonstopux) irix | nonstopux)
major=`expr $current - $age + 1` major=`expr $current - $age + 1`
...@@ -3040,7 +3247,7 @@ EOF ...@@ -3040,7 +3247,7 @@ EOF
*) *)
$echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "$modename: unknown library version type \`$version_type'" 1>&2
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
...@@ -3094,6 +3301,12 @@ EOF ...@@ -3094,6 +3301,12 @@ EOF
*.$objext) *.$objext)
;; ;;
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
if test "X$precious_files_regex" != "X"; then
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
then
continue
fi
fi
removelist="$removelist $p" removelist="$removelist $p"
;; ;;
*) ;; *) ;;
...@@ -3580,7 +3793,7 @@ EOF ...@@ -3580,7 +3793,7 @@ EOF
fi fi
# Get the real and link names of the library. # Get the real and link names of the library.
eval shared_ext=\"$shrext\" eval shared_ext=\"$shrext_cmds\"
eval library_names=\"$library_names_spec\" eval library_names=\"$library_names_spec\"
set dummy $library_names set dummy $library_names
realname="$2" realname="$2"
...@@ -3610,10 +3823,11 @@ EOF ...@@ -3610,10 +3823,11 @@ EOF
$show "generating symbol list for \`$libname.la'" $show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp" export_symbols="$output_objdir/$libname.exp"
$run $rm $export_symbols $run $rm $export_symbols
eval cmds=\"$export_symbols_cmds\" cmds=$export_symbols_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
if len=`expr "X$cmd" : ".*"` && if len=`expr "X$cmd" : ".*"` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
$show "$cmd" $show "$cmd"
...@@ -3656,64 +3870,10 @@ EOF ...@@ -3656,64 +3870,10 @@ EOF
eval libobjs=\"\$libobjs $whole_archive_flag_spec\" eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
else else
gentop="$output_objdir/${outputname}x" gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "$mkdir $gentop"
$run $mkdir "$gentop"
status=$?
if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop" generated="$generated $gentop"
for xlib in $convenience; do func_extract_archives $gentop $convenience
# Extract the objects. libobjs="$libobjs $func_extract_archives_result"
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "$mkdir $xdir"
$run $mkdir "$xdir"
status=$?
if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
# We will extract separately just the conflicting names and we will no
# longer touch any unique names. It is faster to leave these extract
# automatically by $AR in one run.
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
$AR t "$xabs" | sort | uniq -cd | while read -r count name
do
i=1
while test "$i" -le "$count"
do
# Put our $i before any first dot (extension)
# Never overwrite any file
name_to="$name"
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
do
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
done
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
i=`expr $i + 1`
done
done
fi
libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
fi fi
fi fi
...@@ -3730,19 +3890,23 @@ EOF ...@@ -3730,19 +3890,23 @@ EOF
# Do each of the archive commands. # Do each of the archive commands.
if test "$module" = yes && test -n "$module_cmds" ; then if test "$module" = yes && test -n "$module_cmds" ; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
eval cmds=\"$module_expsym_cmds\" eval test_cmds=\"$module_expsym_cmds\"
cmds=$module_expsym_cmds
else else
eval cmds=\"$module_cmds\" eval test_cmds=\"$module_cmds\"
cmds=$module_cmds
fi fi
else else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds=\"$archive_expsym_cmds\" eval test_cmds=\"$archive_expsym_cmds\"
cmds=$archive_expsym_cmds
else else
eval cmds=\"$archive_cmds\" eval test_cmds=\"$archive_cmds\"
cmds=$archive_cmds
fi fi
fi fi
if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
: :
else else
...@@ -3843,19 +4007,28 @@ EOF ...@@ -3843,19 +4007,28 @@ EOF
# value of $libobjs for piecewise linking. # value of $libobjs for piecewise linking.
# Do each of the archive commands. # Do each of the archive commands.
if test "$module" = yes && test -n "$module_cmds" ; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
cmds=$module_expsym_cmds
else
cmds=$module_cmds
fi
else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds
else else
eval cmds=\"$archive_cmds\" cmds=$archive_cmds
fi
fi fi
# Append the command to remove the reloadable object files # Append the command to remove the reloadable object files
# to the just-reset $cmds. # to the just-reset $cmds.
eval cmds=\"\$cmds~$rm $delfiles\" eval cmds=\"\$cmds~\$rm $delfiles\"
fi fi
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -3864,7 +4037,7 @@ EOF ...@@ -3864,7 +4037,7 @@ EOF
# Restore the uninstalled library and exit # Restore the uninstalled library and exit
if test "$mode" = relink; then if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
exit 0 exit $EXIT_SUCCESS
fi fi
# Create links to the real library. # Create links to the real library.
...@@ -3912,7 +4085,7 @@ EOF ...@@ -3912,7 +4085,7 @@ EOF
*.lo) *.lo)
if test -n "$objs$old_deplibs"; then if test -n "$objs$old_deplibs"; then
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
libobj="$output" libobj="$output"
obj=`$echo "X$output" | $Xsed -e "$lo2o"` obj=`$echo "X$output" | $Xsed -e "$lo2o"`
...@@ -3941,64 +4114,10 @@ EOF ...@@ -3941,64 +4114,10 @@ EOF
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
else else
gentop="$output_objdir/${obj}x" gentop="$output_objdir/${obj}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "$mkdir $gentop"
$run $mkdir "$gentop"
status=$?
if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop" generated="$generated $gentop"
for xlib in $convenience; do func_extract_archives $gentop $convenience
# Extract the objects. reload_conv_objs="$reload_objs $func_extract_archives_result"
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "$mkdir $xdir"
$run $mkdir "$xdir"
status=$?
if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
# We will extract separately just the conflicting names and we will no
# longer touch any unique names. It is faster to leave these extract
# automatically by $AR in one run.
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
$AR t "$xabs" | sort | uniq -cd | while read -r count name
do
i=1
while test "$i" -le "$count"
do
# Put our $i before any first dot (extension)
# Never overwrite any file
name_to="$name"
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
do
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
done
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
i=`expr $i + 1`
done
done
fi
reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
fi fi
fi fi
...@@ -4006,10 +4125,11 @@ EOF ...@@ -4006,10 +4125,11 @@ EOF
reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
output="$obj" output="$obj"
eval cmds=\"$reload_cmds\" cmds=$reload_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -4022,7 +4142,7 @@ EOF ...@@ -4022,7 +4142,7 @@ EOF
$run ${rm}r $gentop $run ${rm}r $gentop
fi fi
exit 0 exit $EXIT_SUCCESS
fi fi
if test "$build_libtool_libs" != yes; then if test "$build_libtool_libs" != yes; then
...@@ -4035,17 +4155,18 @@ EOF ...@@ -4035,17 +4155,18 @@ EOF
# accidentally link it into a program. # accidentally link it into a program.
# $show "echo timestamp > $libobj" # $show "echo timestamp > $libobj"
# $run eval "echo timestamp > $libobj" || exit $? # $run eval "echo timestamp > $libobj" || exit $?
exit 0 exit $EXIT_SUCCESS
fi fi
if test -n "$pic_flag" || test "$pic_mode" != default; then if test -n "$pic_flag" || test "$pic_mode" != default; then
# Only do commands if we really have different PIC objects. # Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs" reload_objs="$libobjs $reload_conv_objs"
output="$libobj" output="$libobj"
eval cmds=\"$reload_cmds\" cmds=$reload_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -4057,7 +4178,7 @@ EOF ...@@ -4057,7 +4178,7 @@ EOF
$run ${rm}r $gentop $run ${rm}r $gentop
fi fi
exit 0 exit $EXIT_SUCCESS
;; ;;
prog) prog)
...@@ -4378,7 +4499,7 @@ static const void *lt_preloaded_setup() { ...@@ -4378,7 +4499,7 @@ static const void *lt_preloaded_setup() {
;; ;;
*) *)
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
else else
...@@ -4466,7 +4587,7 @@ static const void *lt_preloaded_setup() { ...@@ -4466,7 +4587,7 @@ static const void *lt_preloaded_setup() {
# Link the executable and exit # Link the executable and exit
$show "$link_command" $show "$link_command"
$run eval "$link_command" || exit $? $run eval "$link_command" || exit $?
exit 0 exit $EXIT_SUCCESS
fi fi
if test "$hardcode_action" = relink; then if test "$hardcode_action" = relink; then
...@@ -4521,10 +4642,10 @@ static const void *lt_preloaded_setup() { ...@@ -4521,10 +4642,10 @@ static const void *lt_preloaded_setup() {
fi fi
# Quote $echo for shipping. # Quote $echo for shipping.
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
case $0 in case $progpath in
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
*) qecho="$SHELL `pwd`/$0 --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
esac esac
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
else else
...@@ -4550,7 +4671,7 @@ static const void *lt_preloaded_setup() { ...@@ -4550,7 +4671,7 @@ static const void *lt_preloaded_setup() {
cwrappersource=`$echo ${objdir}/lt-${output}.c` cwrappersource=`$echo ${objdir}/lt-${output}.c`
cwrapper=`$echo ${output}.exe` cwrapper=`$echo ${output}.exe`
$rm $cwrappersource $cwrapper $rm $cwrappersource $cwrapper
trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
cat > $cwrappersource <<EOF cat > $cwrappersource <<EOF
...@@ -4575,7 +4696,6 @@ EOF ...@@ -4575,7 +4696,6 @@ EOF
#include <malloc.h> #include <malloc.h>
#include <stdarg.h> #include <stdarg.h>
#include <assert.h> #include <assert.h>
#include <sys/stat.h>
#if defined(PATH_MAX) #if defined(PATH_MAX)
# define LT_PATHMAX PATH_MAX # define LT_PATHMAX PATH_MAX
...@@ -4586,19 +4706,15 @@ EOF ...@@ -4586,19 +4706,15 @@ EOF
#endif #endif
#ifndef DIR_SEPARATOR #ifndef DIR_SEPARATOR
# define DIR_SEPARATOR '/' #define DIR_SEPARATOR '/'
# define PATH_SEPARATOR ':'
#endif #endif
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
defined (__OS2__) defined (__OS2__)
# define HAVE_DOS_BASED_FILE_SYSTEM #define HAVE_DOS_BASED_FILE_SYSTEM
# ifndef DIR_SEPARATOR_2 #ifndef DIR_SEPARATOR_2
# define DIR_SEPARATOR_2 '\\' #define DIR_SEPARATOR_2 '\\'
# endif #endif
# ifndef PATH_SEPARATOR_2
# define PATH_SEPARATOR_2 ';'
# endif
#endif #endif
#ifndef DIR_SEPARATOR_2 #ifndef DIR_SEPARATOR_2
...@@ -4608,30 +4724,17 @@ EOF ...@@ -4608,30 +4724,17 @@ EOF
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
#endif /* DIR_SEPARATOR_2 */ #endif /* DIR_SEPARATOR_2 */
#ifndef PATH_SEPARATOR_2
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
#else /* PATH_SEPARATOR_2 */
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
#endif /* PATH_SEPARATOR_2 */
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
#define XFREE(stale) do { \ #define XFREE(stale) do { \
if (stale) { free ((void *) stale); stale = 0; } \ if (stale) { free ((void *) stale); stale = 0; } \
} while (0) } while (0)
#if defined DEBUGWRAPPER
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
#else
# define DEBUG(format, ...)
#endif
const char *program_name = NULL; const char *program_name = NULL;
void * xmalloc (size_t num); void * xmalloc (size_t num);
char * xstrdup (const char *string); char * xstrdup (const char *string);
char * basename (const char *name); char * basename (const char *name);
char * find_executable(const char *wrapper); char * fnqualify(const char *path);
int check_executable(const char *path);
char * strendzap(char *str, const char *pat); char * strendzap(char *str, const char *pat);
void lt_fatal (const char *message, ...); void lt_fatal (const char *message, ...);
...@@ -4642,8 +4745,6 @@ main (int argc, char *argv[]) ...@@ -4642,8 +4745,6 @@ main (int argc, char *argv[])
int i; int i;
program_name = (char *) xstrdup ((char *) basename (argv[0])); program_name = (char *) xstrdup ((char *) basename (argv[0]));
DEBUG("(main) argv[0] : %s\n",argv[0]);
DEBUG("(main) program_name : %s\n",program_name);
newargz = XMALLOC(char *, argc+2); newargz = XMALLOC(char *, argc+2);
EOF EOF
...@@ -4652,23 +4753,13 @@ EOF ...@@ -4652,23 +4753,13 @@ EOF
EOF EOF
cat >> $cwrappersource <<"EOF" cat >> $cwrappersource <<"EOF"
newargz[1] = find_executable(argv[0]); newargz[1] = fnqualify(argv[0]);
if (newargz[1] == NULL)
lt_fatal("Couldn't find %s", argv[0]);
DEBUG("(main) found exe at : %s\n",newargz[1]);
/* we know the script has the same name, without the .exe */ /* we know the script has the same name, without the .exe */
/* so make sure newargz[1] doesn't end in .exe */ /* so make sure newargz[1] doesn't end in .exe */
strendzap(newargz[1],".exe"); strendzap(newargz[1],".exe");
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
newargz[i+1] = xstrdup(argv[i]); newargz[i+1] = xstrdup(argv[i]);
newargz[argc+1] = NULL; newargz[argc+1] = NULL;
for (i=0; i<argc+1; i++)
{
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
;
}
EOF EOF
cat >> $cwrappersource <<EOF cat >> $cwrappersource <<EOF
...@@ -4712,130 +4803,31 @@ basename (const char *name) ...@@ -4712,130 +4803,31 @@ basename (const char *name)
return (char *) base; return (char *) base;
} }
int
check_executable(const char * path)
{
struct stat st;
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
if ((!path) || (!*path))
return 0;
if ((stat (path, &st) >= 0) &&
(
#ifdef S_IXOTH
((st.st_mode & S_IXOTH) == S_IXOTH) ||
#endif
#ifdef S_IXGRP
((st.st_mode & S_IXGRP) == S_IXGRP) ||
#endif
((st.st_mode & S_IXUSR) == S_IXUSR)))
return 1;
else
return 0;
}
/* Searches for the full path of the wrapper. Returns
newly allocated full path name if found, NULL otherwise */
char * char *
find_executable (const char* wrapper) fnqualify(const char *path)
{ {
int has_slash = 0; size_t size;
const char* p; char *p;
const char* p_next;
struct stat st;
/* static buffer for getcwd */
char tmp[LT_PATHMAX + 1]; char tmp[LT_PATHMAX + 1];
int tmp_len;
char* concat_name;
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
if ((wrapper == NULL) || (*wrapper == '\0')) assert(path != NULL);
return NULL;
/* Absolute path? */ /* Is it qualified already? */
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
if (isalpha (wrapper[0]) && wrapper[1] == ':') if (isalpha (path[0]) && path[1] == ':')
{ return xstrdup (path);
concat_name = xstrdup (wrapper);
if (check_executable(concat_name))
return concat_name;
XFREE(concat_name);
}
else
{
#endif
if (IS_DIR_SEPARATOR (wrapper[0]))
{
concat_name = xstrdup (wrapper);
if (check_executable(concat_name))
return concat_name;
XFREE(concat_name);
}
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
}
#endif #endif
if (IS_DIR_SEPARATOR (path[0]))
return xstrdup (path);
for (p = wrapper; *p; p++) /* prepend the current directory */
if (*p == '/') /* doesn't handle '~' */
{
has_slash = 1;
break;
}
if (!has_slash)
{
/* no slashes; search PATH */
const char* path = getenv ("PATH");
if (path != NULL)
{
for (p = path; *p; p = p_next)
{
const char* q;
size_t p_len;
for (q = p; *q; q++)
if (IS_PATH_SEPARATOR(*q))
break;
p_len = q - p;
p_next = (*q == '\0' ? q : q + 1);
if (p_len == 0)
{
/* empty path: current directory */
if (getcwd (tmp, LT_PATHMAX) == NULL)
lt_fatal ("getcwd failed");
tmp_len = strlen(tmp);
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
concat_name[tmp_len] = '/';
strcpy (concat_name + tmp_len + 1, wrapper);
}
else
{
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
memcpy (concat_name, p, p_len);
concat_name[p_len] = '/';
strcpy (concat_name + p_len + 1, wrapper);
}
if (check_executable(concat_name))
return concat_name;
XFREE(concat_name);
}
}
/* not found in PATH; assume curdir */
}
/* Relative path | not found in path: prepend cwd */
if (getcwd (tmp, LT_PATHMAX) == NULL) if (getcwd (tmp, LT_PATHMAX) == NULL)
lt_fatal ("getcwd failed"); lt_fatal ("getcwd failed");
tmp_len = strlen(tmp); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); p = XMALLOC(char, size);
memcpy (concat_name, tmp, tmp_len); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
concat_name[tmp_len] = '/'; return p;
strcpy (concat_name + tmp_len + 1, wrapper);
if (check_executable(concat_name))
return concat_name;
XFREE(concat_name);
return NULL;
} }
char * char *
...@@ -4888,7 +4880,7 @@ EOF ...@@ -4888,7 +4880,7 @@ EOF
;; ;;
esac esac
$rm $output $rm $output
trap "$rm $output; exit 1" 1 2 15 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
$echo > $output "\ $echo > $output "\
#! $SHELL #! $SHELL
...@@ -4909,7 +4901,7 @@ sed_quote_subst='$sed_quote_subst' ...@@ -4909,7 +4901,7 @@ sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout # The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set. # if CDPATH is set.
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
relink_command=\"$relink_command\" relink_command=\"$relink_command\"
...@@ -4988,7 +4980,7 @@ else ...@@ -4988,7 +4980,7 @@ else
else else
$echo \"\$relink_command_output\" >&2 $echo \"\$relink_command_output\" >&2
$rm \"\$progdir/\$file\" $rm \"\$progdir/\$file\"
exit 1 exit $EXIT_FAILURE
fi fi
fi fi
...@@ -5050,20 +5042,20 @@ else ...@@ -5050,20 +5042,20 @@ else
esac esac
$echo >> $output "\ $echo >> $output "\
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
exit 1 exit $EXIT_FAILURE
fi fi
else else
# The program doesn't exist. # The program doesn't exist.
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
\$echo \"This script is just a wrapper for \$program.\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2
$echo \"See the $PACKAGE documentation for more information.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
fi\ fi\
" "
chmod +x $output chmod +x $output
fi fi
exit 0 exit $EXIT_SUCCESS
;; ;;
esac esac
...@@ -5086,76 +5078,21 @@ fi\ ...@@ -5086,76 +5078,21 @@ fi\
if test -n "$addlibs"; then if test -n "$addlibs"; then
gentop="$output_objdir/${outputname}x" gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "$mkdir $gentop"
$run $mkdir "$gentop"
status=$?
if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop" generated="$generated $gentop"
# Add in members from convenience archives. func_extract_archives $gentop $addlibs
for xlib in $addlibs; do oldobjs="$oldobjs $func_extract_archives_result"
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "$mkdir $xdir"
$run $mkdir "$xdir"
status=$?
if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
# We will extract separately just the conflicting names and we will no
# longer touch any unique names. It is faster to leave these extract
# automatically by $AR in one run.
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
$AR t "$xabs" | sort | uniq -cd | while read -r count name
do
i=1
while test "$i" -le "$count"
do
# Put our $i before any first dot (extension)
# Never overwrite any file
name_to="$name"
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
do
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
done
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
i=`expr $i + 1`
done
done
fi
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
done
fi fi
# Do each command in the archive commands. # Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\" cmds=$old_archive_from_new_cmds
else else
eval cmds=\"$old_archive_cmds\" eval cmds=\"$old_archive_cmds\"
if len=`expr "X$cmds" : ".*"` && if len=`expr "X$cmds" : ".*"` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
: cmds=$old_archive_cmds
else else
# the command line is too long to link in one step, link in parts # the command line is too long to link in one step, link in parts
$echo "using piecewise archive linking..." $echo "using piecewise archive linking..."
...@@ -5207,12 +5144,13 @@ fi\ ...@@ -5207,12 +5144,13 @@ fi\
if test "X$oldobjs" = "X" ; then if test "X$oldobjs" = "X" ; then
eval cmds=\"\$concat_cmds\" eval cmds=\"\$concat_cmds\"
else else
eval cmds=\"\$concat_cmds~$old_archive_cmds\" eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
fi fi
fi fi
fi fi
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
eval cmd=\"$cmd\"
IFS="$save_ifs" IFS="$save_ifs"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
...@@ -5244,8 +5182,12 @@ fi\ ...@@ -5244,8 +5182,12 @@ fi\
fi fi
done done
# Quote the link command for shipping. # Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
# Only create the output if not a dry run. # Only create the output if not a dry run.
if test -z "$run"; then if test -z "$run"; then
...@@ -5264,7 +5206,7 @@ fi\ ...@@ -5264,7 +5206,7 @@ fi\
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
newdependency_libs="$newdependency_libs $libdir/$name" newdependency_libs="$newdependency_libs $libdir/$name"
;; ;;
...@@ -5278,7 +5220,7 @@ fi\ ...@@ -5278,7 +5220,7 @@ fi\
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
newdlfiles="$newdlfiles $libdir/$name" newdlfiles="$newdlfiles $libdir/$name"
done done
...@@ -5289,11 +5231,30 @@ fi\ ...@@ -5289,11 +5231,30 @@ fi\
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
newdlprefiles="$newdlprefiles $libdir/$name" newdlprefiles="$newdlprefiles $libdir/$name"
done done
dlprefiles="$newdlprefiles" dlprefiles="$newdlprefiles"
else
newdlfiles=
for lib in $dlfiles; do
case $lib in
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
newdlfiles="$newdlfiles $abs"
done
dlfiles="$newdlfiles"
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
newdlprefiles="$newdlprefiles $abs"
done
dlprefiles="$newdlprefiles"
fi fi
$rm $output $rm $output
# place dlname in correct position for cygwin # place dlname in correct position for cygwin
...@@ -5350,7 +5311,7 @@ relink_command=\"$relink_command\"" ...@@ -5350,7 +5311,7 @@ relink_command=\"$relink_command\""
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
;; ;;
esac esac
exit 0 exit $EXIT_SUCCESS
;; ;;
# libtool install mode # libtool install mode
...@@ -5439,13 +5400,13 @@ relink_command=\"$relink_command\"" ...@@ -5439,13 +5400,13 @@ relink_command=\"$relink_command\""
if test -z "$install_prog"; then if test -z "$install_prog"; then
$echo "$modename: you must specify an install program" 1>&2 $echo "$modename: you must specify an install program" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test -n "$prev"; then if test -n "$prev"; then
$echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$modename: the \`$prev' option requires an argument" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test -z "$files"; then if test -z "$files"; then
...@@ -5455,7 +5416,7 @@ relink_command=\"$relink_command\"" ...@@ -5455,7 +5416,7 @@ relink_command=\"$relink_command\""
$echo "$modename: you must specify a destination" 1>&2 $echo "$modename: you must specify a destination" 1>&2
fi fi
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Strip any trailing slash from the destination. # Strip any trailing slash from the destination.
...@@ -5476,7 +5437,7 @@ relink_command=\"$relink_command\"" ...@@ -5476,7 +5437,7 @@ relink_command=\"$relink_command\""
if test "$#" -gt 2; then if test "$#" -gt 2; then
$echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$modename: \`$dest' is not a directory" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
fi fi
case $destdir in case $destdir in
...@@ -5488,7 +5449,7 @@ relink_command=\"$relink_command\"" ...@@ -5488,7 +5449,7 @@ relink_command=\"$relink_command\""
*) *)
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
done done
...@@ -5517,7 +5478,7 @@ relink_command=\"$relink_command\"" ...@@ -5517,7 +5478,7 @@ relink_command=\"$relink_command\""
else else
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
library_names= library_names=
...@@ -5559,7 +5520,7 @@ relink_command=\"$relink_command\"" ...@@ -5559,7 +5520,7 @@ relink_command=\"$relink_command\""
# but it's something to keep an eye on. # but it's something to keep an eye on.
if test "$inst_prefix_dir" = "$destdir"; then if test "$inst_prefix_dir" = "$destdir"; then
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test -n "$inst_prefix_dir"; then if test -n "$inst_prefix_dir"; then
...@@ -5574,7 +5535,7 @@ relink_command=\"$relink_command\"" ...@@ -5574,7 +5535,7 @@ relink_command=\"$relink_command\""
if $run eval "$relink_command"; then : if $run eval "$relink_command"; then :
else else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
fi fi
...@@ -5609,10 +5570,11 @@ relink_command=\"$relink_command\"" ...@@ -5609,10 +5570,11 @@ relink_command=\"$relink_command\""
# Do each command in the postinstall commands. # Do each command in the postinstall commands.
lib="$destdir/$realname" lib="$destdir/$realname"
eval cmds=\"$postinstall_cmds\" cmds=$postinstall_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -5652,7 +5614,7 @@ relink_command=\"$relink_command\"" ...@@ -5652,7 +5614,7 @@ relink_command=\"$relink_command\""
*) *)
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
...@@ -5670,7 +5632,7 @@ relink_command=\"$relink_command\"" ...@@ -5670,7 +5632,7 @@ relink_command=\"$relink_command\""
$show "$install_prog $staticobj $staticdest" $show "$install_prog $staticobj $staticdest"
$run eval "$install_prog \$staticobj \$staticdest" || exit $? $run eval "$install_prog \$staticobj \$staticdest" || exit $?
fi fi
exit 0 exit $EXIT_SUCCESS
;; ;;
*) *)
...@@ -5724,7 +5686,7 @@ relink_command=\"$relink_command\"" ...@@ -5724,7 +5686,7 @@ relink_command=\"$relink_command\""
# Check the variables that should have been set. # Check the variables that should have been set.
if test -z "$notinst_deplibs"; then if test -z "$notinst_deplibs"; then
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
finalize=yes finalize=yes
...@@ -5765,8 +5727,12 @@ relink_command=\"$relink_command\"" ...@@ -5765,8 +5727,12 @@ relink_command=\"$relink_command\""
tmpdir="/tmp" tmpdir="/tmp"
test -n "$TMPDIR" && tmpdir="$TMPDIR" test -n "$TMPDIR" && tmpdir="$TMPDIR"
tmpdir="$tmpdir/libtool-$$" tmpdir="$tmpdir/libtool-$$"
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : save_umask=`umask`
umask 0077
if $mkdir "$tmpdir"; then
umask $save_umask
else else
umask $save_umask
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
continue continue
fi fi
...@@ -5825,16 +5791,17 @@ relink_command=\"$relink_command\"" ...@@ -5825,16 +5791,17 @@ relink_command=\"$relink_command\""
$show "$install_prog $file $oldlib" $show "$install_prog $file $oldlib"
$run eval "$install_prog \$file \$oldlib" || exit $? $run eval "$install_prog \$file \$oldlib" || exit $?
if test -n "$stripme" && test -n "$striplib"; then if test -n "$stripme" && test -n "$old_striplib"; then
$show "$old_striplib $oldlib" $show "$old_striplib $oldlib"
$run eval "$old_striplib $oldlib" || exit $? $run eval "$old_striplib $oldlib" || exit $?
fi fi
# Do each command in the postinstall commands. # Do each command in the postinstall commands.
eval cmds=\"$old_postinstall_cmds\" cmds=$old_postinstall_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -5848,9 +5815,9 @@ relink_command=\"$relink_command\"" ...@@ -5848,9 +5815,9 @@ relink_command=\"$relink_command\""
if test -n "$current_libdirs"; then if test -n "$current_libdirs"; then
# Maybe just do a dry run. # Maybe just do a dry run.
test -n "$run" && current_libdirs=" -n$current_libdirs" test -n "$run" && current_libdirs=" -n$current_libdirs"
exec_cmd='$SHELL $0 --finish$current_libdirs' exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
else else
exit 0 exit $EXIT_SUCCESS
fi fi
;; ;;
...@@ -5869,10 +5836,11 @@ relink_command=\"$relink_command\"" ...@@ -5869,10 +5836,11 @@ relink_command=\"$relink_command\""
for libdir in $libdirs; do for libdir in $libdirs; do
if test -n "$finish_cmds"; then if test -n "$finish_cmds"; then
# Do each command in the finish commands. # Do each command in the finish commands.
eval cmds=\"$finish_cmds\" cmds=$finish_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || admincmds="$admincmds $run eval "$cmd" || admincmds="$admincmds
$cmd" $cmd"
...@@ -5889,7 +5857,7 @@ relink_command=\"$relink_command\"" ...@@ -5889,7 +5857,7 @@ relink_command=\"$relink_command\""
fi fi
# Exit here if they wanted silent mode. # Exit here if they wanted silent mode.
test "$show" = : && exit 0 test "$show" = : && exit $EXIT_SUCCESS
$echo "----------------------------------------------------------------------" $echo "----------------------------------------------------------------------"
$echo "Libraries have been installed in:" $echo "Libraries have been installed in:"
...@@ -5925,7 +5893,7 @@ relink_command=\"$relink_command\"" ...@@ -5925,7 +5893,7 @@ relink_command=\"$relink_command\""
$echo "See any operating system documentation about shared libraries for" $echo "See any operating system documentation about shared libraries for"
$echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "more information, such as the ld(1) and ld.so(8) manual pages."
$echo "----------------------------------------------------------------------" $echo "----------------------------------------------------------------------"
exit 0 exit $EXIT_SUCCESS
;; ;;
# libtool execute mode # libtool execute mode
...@@ -5937,7 +5905,7 @@ relink_command=\"$relink_command\"" ...@@ -5937,7 +5905,7 @@ relink_command=\"$relink_command\""
if test -z "$cmd"; then if test -z "$cmd"; then
$echo "$modename: you must specify a COMMAND" 1>&2 $echo "$modename: you must specify a COMMAND" 1>&2
$echo "$help" $echo "$help"
exit 1 exit $EXIT_FAILURE
fi fi
# Handle -dlopen flags immediately. # Handle -dlopen flags immediately.
...@@ -5945,7 +5913,7 @@ relink_command=\"$relink_command\"" ...@@ -5945,7 +5913,7 @@ relink_command=\"$relink_command\""
if test ! -f "$file"; then if test ! -f "$file"; then
$echo "$modename: \`$file' is not a file" 1>&2 $echo "$modename: \`$file' is not a file" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
dir= dir=
...@@ -5956,7 +5924,7 @@ relink_command=\"$relink_command\"" ...@@ -5956,7 +5924,7 @@ relink_command=\"$relink_command\""
else else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Read the libtool library. # Read the libtool library.
...@@ -5983,7 +5951,7 @@ relink_command=\"$relink_command\"" ...@@ -5983,7 +5951,7 @@ relink_command=\"$relink_command\""
dir="$dir/$objdir" dir="$dir/$objdir"
else else
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
;; ;;
...@@ -6063,7 +6031,7 @@ relink_command=\"$relink_command\"" ...@@ -6063,7 +6031,7 @@ relink_command=\"$relink_command\""
$echo "export $shlibpath_var" $echo "export $shlibpath_var"
fi fi
$echo "$cmd$args" $echo "$cmd$args"
exit 0 exit $EXIT_SUCCESS
fi fi
;; ;;
...@@ -6091,7 +6059,7 @@ relink_command=\"$relink_command\"" ...@@ -6091,7 +6059,7 @@ relink_command=\"$relink_command\""
if test -z "$rm"; then if test -z "$rm"; then
$echo "$modename: you must specify an RM program" 1>&2 $echo "$modename: you must specify an RM program" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
rmdirs= rmdirs=
...@@ -6146,10 +6114,11 @@ relink_command=\"$relink_command\"" ...@@ -6146,10 +6114,11 @@ relink_command=\"$relink_command\""
if test "$mode" = uninstall; then if test "$mode" = uninstall; then
if test -n "$library_names"; then if test -n "$library_names"; then
# Do each command in the postuninstall commands. # Do each command in the postuninstall commands.
eval cmds=\"$postuninstall_cmds\" cmds=$postuninstall_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" $run eval "$cmd"
if test "$?" -ne 0 && test "$rmforce" != yes; then if test "$?" -ne 0 && test "$rmforce" != yes; then
...@@ -6161,10 +6130,11 @@ relink_command=\"$relink_command\"" ...@@ -6161,10 +6130,11 @@ relink_command=\"$relink_command\""
if test -n "$old_library"; then if test -n "$old_library"; then
# Do each command in the old_postuninstall commands. # Do each command in the old_postuninstall commands.
eval cmds=\"$old_postuninstall_cmds\" cmds=$old_postuninstall_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" $run eval "$cmd"
if test "$?" -ne 0 && test "$rmforce" != yes; then if test "$?" -ne 0 && test "$rmforce" != yes; then
...@@ -6248,20 +6218,20 @@ relink_command=\"$relink_command\"" ...@@ -6248,20 +6218,20 @@ relink_command=\"$relink_command\""
"") "")
$echo "$modename: you must specify a MODE" 1>&2 $echo "$modename: you must specify a MODE" 1>&2
$echo "$generic_help" 1>&2 $echo "$generic_help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
if test -z "$exec_cmd"; then if test -z "$exec_cmd"; then
$echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$generic_help" 1>&2 $echo "$generic_help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
fi # test -z "$show_help" fi # test -z "$show_help"
if test -n "$exec_cmd"; then if test -n "$exec_cmd"; then
eval exec $exec_cmd eval exec $exec_cmd
exit 1 exit $EXIT_FAILURE
fi fi
# We need to display help for each of the modes. # We need to display help for each of the modes.
...@@ -6297,7 +6267,7 @@ MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for ...@@ -6297,7 +6267,7 @@ MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
a more detailed description of MODE. a more detailed description of MODE.
Report bugs to <bug-libtool@gnu.org>." Report bugs to <bug-libtool@gnu.org>."
exit 0 exit $EXIT_SUCCESS
;; ;;
clean) clean)
...@@ -6409,6 +6379,8 @@ The following components of LINK-COMMAND are treated specially: ...@@ -6409,6 +6379,8 @@ The following components of LINK-COMMAND are treated specially:
-no-undefined declare that a library does not refer to external symbols -no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
-objectlist FILE Use a list of object files found in FILE to specify objects -objectlist FILE Use a list of object files found in FILE to specify objects
-precious-files-regex REGEX
don't remove output files matching REGEX
-release RELEASE specify package release information -release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR -rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
...@@ -6450,14 +6422,14 @@ Otherwise, only FILE itself is deleted using RM." ...@@ -6450,14 +6422,14 @@ Otherwise, only FILE itself is deleted using RM."
*) *)
$echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
$echo $echo
$echo "Try \`$modename --help' for more information about other modes." $echo "Try \`$modename --help' for more information about other modes."
exit 0 exit $EXIT_SUCCESS
# The TAGs below are defined such that we never get into a situation # The TAGs below are defined such that we never get into a situation
# in which we disable both kinds of libraries. Given conflicting # in which we disable both kinds of libraries. Given conflicting
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment