From d8f705c7eb8d6c71ebc5cdaf16ff862bf5129355 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 22 Mar 2001 05:22:04 +0000 Subject: [PATCH] * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh, ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.198. --- ChangeLog | 5 + libtool.m4 | 223 +++++++++++----------- ltcf-c.sh | 211 ++++++++++++++------- ltcf-cxx.sh | 249 ++++++++++++++++--------- ltcf-gcj.sh | 157 +++++++++++----- ltconfig | 356 ++++++++++++++++++++++------------- ltmain.sh | 527 ++++++++++++++++++++++++++++++++++++++++------------ 7 files changed, 1173 insertions(+), 555 deletions(-) diff --git a/ChangeLog b/ChangeLog index aaaef9e47..b0c368fe0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-03-22 Alexandre Oliva + + * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh, + ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.198. + 2001-03-20 Michael Chastain * Makefile.in: all-m4 depends on all-texinfo. diff --git a/libtool.m4 b/libtool.m4 index cb004e223..324676aab 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -22,8 +22,9 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 45 AC_PROG_LIBTOOL -AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL]) +# serial 46 AC_PROG_LIBTOOL +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], @@ -50,7 +51,7 @@ dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ ])])])])])]) -AC_DEFUN(_AC_PROG_LIBTOOL, +AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl @@ -84,7 +85,7 @@ AC_SUBST(LIBTOOL)dnl exec 5>>./config.log ]) -AC_DEFUN(AC_LIBTOOL_SETUP, +AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.13)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl @@ -103,7 +104,7 @@ AC_REQUIRE([AC_EXEEXT])dnl dnl # Only perform the check for file, if the check method requires it -case "$deplibs_check_method" in +case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC @@ -119,8 +120,8 @@ libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" +test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], [libtool_flags="$libtool_flags --enable-dlopen"]) ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], @@ -138,12 +139,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$host" in +case $host in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in + case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -187,7 +188,7 @@ ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], DllMain (0, 0, 0);], [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) - case "$host/$CC" in + case $host/$CC in *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) # old mingw systems require "-dll" to link a DLL, while more recent ones # require "-mdll" @@ -207,23 +208,23 @@ esac ]) # AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) +AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN(AC_ENABLE_SHARED, [dnl -define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) @@ -242,21 +243,21 @@ enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl ]) # AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no)]) # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN(AC_ENABLE_STATIC, [dnl -define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) @@ -275,7 +276,8 @@ enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) # AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no)]) @@ -283,14 +285,14 @@ AC_ENABLE_STATIC(no)]) # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl -define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, changequote(<<, >>)dnl << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) @@ -309,22 +311,24 @@ enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl ]) # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no)]) # AC_LIBTOOL_PICMODE - implement the --with-pic flag # Usage: AC_LIBTOOL_PICMODE[(MODE)] # Where MODE is either `yes' or `no'. If omitted, it defaults to # `both'. -AC_DEFUN(AC_LIBTOOL_PICMODE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default)]) # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library -AC_DEFUN(AC_PATH_TOOL_PREFIX, +AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case "$MAGIC_CMD" in +[case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -343,7 +347,7 @@ dnl not every word. This closes a longstanding sh security hole. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -383,7 +387,7 @@ fi # AC_PATH_MAGIC - find a file program which can recognise a shared library -AC_DEFUN(AC_PATH_MAGIC, +AC_DEFUN([AC_PATH_MAGIC], [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -397,7 +401,7 @@ fi # AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN(AC_PROG_LD, +AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) @@ -405,7 +409,7 @@ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in @@ -415,12 +419,10 @@ if test "$ac_cv_prog_gcc" = yes; then *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac - case "$ac_prog" in + case $ac_prog in # Accept absolute paths. -changequote(,)dnl - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' -changequote([,])dnl + [[\\/]* | [A-Za-z]:[\\/]*)] + re_direlt=['/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do @@ -442,17 +444,17 @@ elif test "$with_gnu_ld" = yes; then else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL(ac_cv_path_LD, +AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - ac_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -461,9 +463,9 @@ AC_CACHE_VAL(ac_cv_path_LD, done IFS="$ac_save_ifs" else - ac_cv_path_LD="$LD" # Let the user override the test with a path. + lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) -LD="$ac_cv_path_LD" +LD="$lt_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else @@ -473,20 +475,20 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ]) -AC_DEFUN(AC_PROG_LD_GNU, -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, +AC_DEFUN([AC_PROG_LD_GNU], +[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. if $LD -v 2>&1 &5; then - ac_cv_prog_gnu_ld=yes + lt_cv_prog_gnu_ld=yes else - ac_cv_prog_gnu_ld=no + lt_cv_prog_gnu_ld=no fi]) -with_gnu_ld=$ac_cv_prog_gnu_ld +with_gnu_ld=$lt_cv_prog_gnu_ld ]) # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker # -- PORTME Some linkers may need a different reload flag. -AC_DEFUN(AC_PROG_LD_RELOAD_FLAG, +AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag @@ -495,7 +497,7 @@ test -n "$reload_flag" && reload_flag=" $reload_flag" # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics -AC_DEFUN(AC_DEPLIBS_CHECK_METHOD, +AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependant libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -512,8 +514,8 @@ lt_cv_deplibs_check_method='unknown' # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. -case "$host_os" in -aix4*) +case $host_os in +aix*) lt_cv_deplibs_check_method=pass_all ;; @@ -522,9 +524,7 @@ beos*) ;; bsdi4*) - changequote(,)dnl - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - changequote([, ])dnl + 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_test_file=/shlib/libc.so ;; @@ -534,15 +534,19 @@ cygwin* | mingw* |pw32*) lt_cv_file_magic_cmd='$OBJDUMP -f' ;; +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` + ;; + freebsd* ) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case "$host_cpu" in + case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. - changequote(,)dnl - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - changequote([, ])dnl + lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'] lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; @@ -556,30 +560,27 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -hpux10.20*) - # TODO: Does this work for hpux-11 too? - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' +hpux10.20*|hpux11*) + lt_cv_deplibs_check_method=['file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'] lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) - case "$host_os" in + case $host_os in irix5*) # 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;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case - changequote(,)dnl - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - changequote([, ])dnl + 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*` @@ -588,27 +589,30 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) - case "$host_cpu" in + case $host_cpu in alpha* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM - changequote(,)dnl - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; - changequote([, ])dnl + lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then : + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + [lt_cv_deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library'] else - changequote(,)dnl - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - changequote([, ])dnl - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'] fi + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + +newsos6) + [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'] + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; osf3* | osf4* | osf5*) @@ -628,14 +632,12 @@ solaris*) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case "$host_vendor" in + case $host_vendor in ncr) lt_cv_deplibs_check_method=pass_all ;; motorola) - changequote(,)dnl - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - changequote([, ])dnl + lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'] lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac @@ -648,12 +650,12 @@ deplibs_check_method=$lt_cv_deplibs_check_method # AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN(AC_PROG_NM, +AC_DEFUN([AC_PROG_NM], [AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(ac_cv_path_NM, +AC_CACHE_VAL(lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - ac_cv_path_NM="$NM" + lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do @@ -665,29 +667,29 @@ else # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - ac_cv_path_NM="$tmp_nm -B" + lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$tmp_nm -p" + lt_cv_path_NM="$tmp_nm -p" break else - ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) -NM="$ac_cv_path_NM" +NM="$lt_cv_path_NM" AC_MSG_RESULT([$NM]) ]) # AC_CHECK_LIBM - check for math library -AC_DEFUN(AC_CHECK_LIBM, +AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= -case "$host" in +case $host in *-*-beos* | *-*-cygwin* | *-*-pw32*) # These system don't have libm ;; @@ -711,8 +713,9 @@ esac # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. -AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case "$enable_ltdl_convenience" in +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; @@ -732,7 +735,8 @@ AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl # not flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then @@ -760,10 +764,10 @@ ifdef([AC_PROVIDE_IFELSE], [$2], [$3])])]) # AC_LIBTOOL_CXX - enable support for C++ libraries -AC_DEFUN(AC_LIBTOOL_CXX,[AC_REQUIRE([_AC_LIBTOOL_CXX])]) -AC_DEFUN(_AC_LIBTOOL_CXX, -[AC_REQUIRE([AC_PROG_LIBTOOL]) -AC_REQUIRE([AC_PROG_CXX]) +AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])]) + +AC_DEFUN([_AC_LIBTOOL_CXX], +[AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh" lt_save_CC="$CC" @@ -771,7 +775,7 @@ lt_save_CFLAGS="$CFLAGS" dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC dnl is set to the C++ compiler. AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \ -MAGIC_CMD="$MAGIC_CMD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ @@ -789,8 +793,9 @@ exec 5>>./config.log ]) # AC_LIBTOOL_GCJ - enable support for GCJ libraries -AC_DEFUN(AC_LIBTOOL_GCJ,[AC_REQUIRE([_AC_LIBTOOL_GCJ])]) -AC_DEFUN(_AC_LIBTOOL_GCJ, +AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])]) + +AC_DEFUN([_AC_LIBTOOL_GCJ], [AC_REQUIRE([AC_PROG_LIBTOOL]) AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], @@ -804,7 +809,7 @@ lt_save_CFLAGS="$CFLAGS" dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC dnl is set to the C++ compiler. AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \ -MAGIC_CMD="$MAGIC_CMD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ @@ -822,19 +827,19 @@ exec 5>>./config.log ]) dnl old names -AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl -AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl -AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl -AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl -AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl -AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl -AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) dnl This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL])dnl -AC_DEFUN([LT_AC_PROG_GCJ],[ - AC_CHECK_TOOL(GCJ, gcj, no) +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) diff --git a/ltcf-c.sh b/ltcf-c.sh index 2e62af762..3d99a49cc 100644 --- a/ltcf-c.sh +++ b/ltcf-c.sh @@ -38,7 +38,7 @@ lt_simple_compile_test_code="int some_variable = 0;" lt_simple_link_test_code='main(){return(0);}' ## Linker Characteristics -case "$host_os" in +case $host_os in cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using @@ -56,8 +56,8 @@ if test "$with_gnu_ld" = yes; then wlarc='${wl}' # See if GNU ld supports shared libraries. - case "$host_os" in - aix3* | aix4*) + case $host_os in + aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 @@ -117,7 +117,7 @@ EOF # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case "$host_os" in + case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 @@ -148,17 +148,23 @@ EOF $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~ - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \$# in - 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done~ + archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname-def; + else + echo EXPORTS > $output_objdir/$soname-def; + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \[$]# in + 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; + fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ @@ -167,6 +173,18 @@ EOF $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; + darwin*|rhapsody*) + allow_undefined_flag='-undefined warning' + archive_cmds='$CC $(if test "$module" = "yes"; then echo -bundle; else + echo -dynamiclib; fi) -o $lib $libobjs $deplibs $linkopts' + archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' + ## What we need is to hardcode the path to the library, not the search path + #hardcode_direct=yes + #hardcode_libdir_flag_spec='-install_name $libdir/$lib' + hardcode_shlibpath_var=no + whole_archive_flag_spec='-all_load' + ;; + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' @@ -236,7 +254,7 @@ EOF fi else # PORTME fill in a description of your system's linker (not GNU ld) - case "$host_os" in + case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes @@ -251,45 +269,91 @@ else fi ;; - aix4*) - hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' + aix4* | aix5*) + hardcode_direct=yes hardcode_libdir_separator=':' + link_all_deplibs=yes + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. if test "$with_gcc" = yes; then - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac shared_flag='-shared' else - shared_flag='${wl}-bM:SRE' - hardcode_direct=yes + # not using gcc + if test "$host_cpu" = ia64; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi fi - allow_undefined_flag=' ${wl}-berok' - archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' - case "$host_os" in aix4.[01]|aix4.[01].*) - # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on - always_export_symbols=yes ;; - esac - # We don't want to build shared libraries on unknown CPU types. - case $host_cpu in - powerpc | rs6000) ;; - *) ld_shlibs=no ;; - esac - ;; + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # Test if we are trying to use run time linking, or normal AIX style linking. + # If -brtl is somewhere in LDFLAGS, we need to do run time linking. + aix_use_runtimelinking=no + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then + aix_use_runtimelinking=yes + break + fi + done + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other run time loading flags (-brtl), -berok will + # link without error, but may produce a broken library. + allow_undefined_flag=' ${wl}-berok' + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + allow_undefined_flag=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + build_libtool_need_lc=yes + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' @@ -314,7 +378,7 @@ else old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w $srcfile`' + fix_srcfile_path='`cygpath -w "$srcfile"`' ;; freebsd1*) @@ -349,7 +413,7 @@ else ;; hpux9* | hpux10* | hpux11*) - case "$host_os" in + case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac @@ -378,11 +442,19 @@ else else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi - hardcode_libdir_flag_spec='${wl}-R$libdir' + hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' @@ -417,8 +489,10 @@ else else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='-rpath $libdir' hardcode_libdir_separator=: ;; @@ -438,7 +512,7 @@ else $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no - case "$host_os" in + case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; @@ -537,18 +611,18 @@ else ac_cv_prog_cc_wl='-Wl,' ac_cv_prog_cc_static='-static' - case "$host_os" in + case $host_os in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # we not sure about C++ programs. - ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC" + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_cv_prog_cc_static='-Bstatic' + else + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + fi ;; cygwin* | mingw* | os2*) # This hack is so that the source file can tell whether it is being @@ -572,10 +646,10 @@ else esac else # PORTME Check for PIC flags for the system compiler. - case "$host_os" in - aix3* | aix4*) + case $host_os in + aix*) # All AIX code is PIC. - ac_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC" ;; hpux9* | hpux10* | hpux11*) @@ -597,6 +671,11 @@ else ac_cv_prog_cc_pic='-DDLL_EXPORT' ;; + newsos6) + ac_cv_prog_cc_pic='-KPIC' + ac_cv_prog_cc_static='-Bstatic' + ;; + osf3* | osf4* | osf5*) # All OSF/1 code is PIC. ac_cv_prog_cc_wl='-Wl,' @@ -649,7 +728,7 @@ fi need_lc=yes if test "$enable_shared" = yes && test "$with_gcc" = yes; then - case "$archive_cmds" in + case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; @@ -669,7 +748,7 @@ if test "$enable_shared" = yes && test "$with_gcc" = yes; then cat conftest.err 1>&5 soname=conftest lib=conftest - libobjs=conftest.o + libobjs=conftest.$ac_objext deplibs= wl=$ac_cv_prog_cc_wl compiler_flags=-v diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh index ab9e62721..d7cdf6909 100644 --- a/ltcf-cxx.sh +++ b/ltcf-cxx.sh @@ -114,50 +114,110 @@ else wlarc= fi -# In general, the C++ compiler should always link C++ objects. -case $target in -*aix3* | *aix4*) - # AIX just has to be different, doesn't it? :-\ - LD=makeC++SharedLib_r - LDFLAGS="$LDFLAGS -p 0" - ;; -*) - LD="$CC" - LDFLAGS="$LDFLAGS" - ;; -esac - - # PORTME: fill in a description of your system's C++ link characteristics -case "$host_os" in +case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs=no - - # We don't want to build shared libraries on unknown CPU types. - case $host_cpu in - powerpc | rs6000) ;; - *) ld_shlibs=no ;; - esac ;; - aix4*) - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - # -bexpall does not export symbols beginning with underscore (_) + aix4* | aix5*) + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + if test "$with_gcc" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # Test if we are trying to use run time linking, or normal AIX style linking. + # If -brtl is somewhere in LDFLAGS, we need to do run time linking. + aix_use_runtimelinking=no + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then + aix_use_runtimelinking=yes + break + fi + done + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec=' ' - build_libtool_need_lc=yes + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + allow_undefined_flag=' -Wl,-G' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}-brtl \${wl}$exp_sym_flag:\$export_symbols" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + # Warning - without using the other run time loading flags, -berok will + # link without error, but may produce a broken library. + no_undefined_flag='${wl}-bnoerok' + allow_undefined_flag='${wl}-berok" + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + build_libtool_need_lc=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi ;; chorus*) - case "$cc_basename" in + case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs=no ;; - esac + esac ;; dgux*) - case "$cc_basename" in + case $cc_basename in ec++) # FIXME: insert proper C++ library support ld_shlibs=no @@ -179,23 +239,23 @@ case "$host_os" in ld_shlibs=no ;; hpux*) - case "$cc_basename" in + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + export_dynamic_flag_spec='${wl}-E' + + case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs=no ;; aCC) - case "$host_os" in + case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -207,13 +267,20 @@ case "$host_os" in output_verbose_link_cmds='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' ;; *) - # FIXME: insert proper C++ library support - ld_shlibs=no + if test $with_gcc = yes; then + case "$host_os" in + hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; + *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; + esac + else + # FIXME: insert proper C++ library support + ld_shlibs=no + fi ;; esac ;; irix5* | irix6*) - case "$cc_basename" in + case $cc_basename in CC) # SGI C++ archive_cmds='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' @@ -229,7 +296,7 @@ case "$host_os" in if test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else - archive_cmds='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' + archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' fi fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -239,7 +306,7 @@ case "$host_os" in esac ;; linux*) - case "$cc_basename" in + case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -296,7 +363,7 @@ case "$host_os" in ld_shlibs=no ;; mvs*) - case "$cc_basename" in + case $cc_basename in cxx) # FIXME: insert proper C++ library support ld_shlibs=no @@ -305,7 +372,7 @@ case "$host_os" in # FIXME: insert proper C++ library support ld_shlibs=no ;; - esac + esac ;; netbsd*) # NetBSD uses g++ - do we need to do anything? @@ -324,7 +391,7 @@ case "$host_os" in output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' fi - case "$cc_basename" in + case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -383,7 +450,7 @@ case "$host_os" in output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' fi - case "$cc_basename" in + case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -405,10 +472,10 @@ case "$host_os" in ld_shlibs=no ;; cxx) - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec='-rpath $libdir' hardcode_libdir_separator=: # Commands to make compiler produce verbose output that lists @@ -432,7 +499,7 @@ case "$host_os" in ld_shlibs=no ;; sco*) - case "$cc_basename" in + case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs=no @@ -444,7 +511,7 @@ case "$host_os" in esac ;; sunos4*) - case "$cc_basename" in + case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support @@ -462,7 +529,7 @@ case "$host_os" in esac ;; solaris*) - case "$cc_basename" in + case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag=' -ztext' @@ -472,7 +539,7 @@ case "$host_os" in hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no - case "$host_os" in + case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl @@ -511,9 +578,9 @@ case "$host_os" in # GNU C++ compiler with Solaris linker if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then if $CC --version | egrep -v '^2\.7' > /dev/null; then - archive_cmds='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' + archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -522,9 +589,9 @@ case "$host_os" in else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. - archive_cmds='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' + archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -535,10 +602,10 @@ case "$host_os" in hardcode_libdir_flag_spec='${wl}-R $wl$libdir' fi ;; - esac + esac ;; tandem*) - case "$cc_basename" in + case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support @@ -548,7 +615,7 @@ case "$host_os" in # FIXME: insert proper C++ library support ld_shlibs=no ;; - esac + esac ;; unixware*) # FIXME: insert proper C++ library support @@ -583,18 +650,18 @@ if test "$with_gcc" = yes; then ac_cv_prog_cc_wl='-Wl,' ac_cv_prog_cc_static='-static' - case "$host_os" in + case $host_os in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # we not sure about C++ programs. - ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC" + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_cv_prog_cc_static='-Bstatic' + else + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + fi ;; cygwin* | mingw* | os2*) # This hack is so that the source file can tell whether it is being @@ -617,20 +684,26 @@ if test "$with_gcc" = yes; then ;; esac else - case "$host_os" in - aix4*) + case $host_os in + aix4* | aix5*) # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_cv_prog_cc_static='-Bstatic' + else + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + fi ;; chorus*) - case "$cc_basename" in + case $cc_basename in cxch68) # Green Hills C++ Compiler # ac_cv_prog_cc_static="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; - esac + esac ;; dgux*) - case "$cc_basename" in + case $cc_basename in ec++) ac_cv_prog_cc_pic='-KPIC' ;; @@ -646,7 +719,7 @@ else # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) - case "$cc_basename" in + case $cc_basename in CC) ac_cv_prog_cc_wl='-Wl,' ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" @@ -662,7 +735,7 @@ else esac ;; irix5* | irix6*) - case "$cc_basename" in + case $cc_basename in CC) ac_cv_prog_cc_wl='-Wl,' ac_cv_prog_cc_static='-non_shared' @@ -673,7 +746,7 @@ else esac ;; linux*) - case "$cc_basename" in + case $cc_basename in KCC) # KAI C++ Compiler ac_cv_prog_cc_wl='--backend -Wl,' @@ -695,18 +768,18 @@ else m88k*) ;; mvs*) - case "$cc_basename" in + case $cc_basename in cxx) ac_cv_prog_cc_pic='-W c,exportall' ;; *) ;; - esac + esac ;; netbsd*) ;; osf3* | osf4* | osf5*) - case "$cc_basename" in + case $cc_basename in KCC) ac_cv_prog_cc_wl='--backend -Wl,' ;; @@ -729,7 +802,7 @@ else psos*) ;; sco*) - case "$cc_basename" in + case $cc_basename in CC) ac_cv_prog_cc_pic='-fPIC' ;; @@ -738,7 +811,7 @@ else esac ;; solaris*) - case "$cc_basename" in + case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ ac_cv_prog_cc_pic='-KPIC' @@ -751,10 +824,10 @@ else ;; *) ;; - esac + esac ;; sunos4*) - case "$cc_basename" in + case $cc_basename in CC) # Sun C++ 4.x ac_cv_prog_cc_pic='-pic' @@ -769,14 +842,14 @@ else esac ;; tandem*) - case "$cc_basename" in + case $cc_basename in NCC) # NonStop-UX NCC 3.20 ac_cv_prog_cc_pic='-KPIC' ;; *) ;; - esac + esac ;; unixware*) ;; diff --git a/ltcf-gcj.sh b/ltcf-gcj.sh index 2448bd8d8..cce8c22fe 100644 --- a/ltcf-gcj.sh +++ b/ltcf-gcj.sh @@ -41,7 +41,7 @@ lt_simple_compile_test_code="class foo {}" lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' ## Linker Characteristics -case "$host_os" in +case $host_os in cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using @@ -59,7 +59,7 @@ if test "$with_gnu_ld" = yes; then wlarc='${wl}' # See if GNU ld supports shared libraries. - case "$host_os" in + case $host_os in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no @@ -120,7 +120,7 @@ EOF # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case "$host_os" in + case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 @@ -151,17 +151,23 @@ EOF $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~ - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \$# in - 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done~ + archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname-def; + else + echo EXPORTS > $output_objdir/$soname-def; + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \[$]# in + 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; + fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_gcj_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ @@ -239,7 +245,7 @@ EOF fi else # PORTME fill in a description of your system's linker (not GNU ld) - case "$host_os" in + case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes @@ -254,45 +260,91 @@ else fi ;; - aix4*) - hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' + aix4* | aix5*) + hardcode_direct=yes hardcode_libdir_separator=':' + link_all_deplibs=yes + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. if test "$with_gcc" = yes; then - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac shared_flag='-shared' else - shared_flag='${wl}-bM:SRE' - hardcode_direct=yes + # not using gcc + if test "$host_cpu" = ia64; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi fi - allow_undefined_flag=' ${wl}-berok' - archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' - case "$host_os" in aix4.[01]|aix4.[01].*) - # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on - always_export_symbols=yes ;; - esac - # We don't want to build shared libraries on unknown CPU types. - case $host_cpu in - powerpc | rs6000) ;; - *) ld_shlibs=no ;; - esac - ;; + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # Test if we are trying to use run time linking, or normal AIX style linking. + # If -brtl is somewhere in LDFLAGS, we need to do run time linking. + aix_use_runtimelinking=no + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then + aix_use_runtimelinking=yes + break + fi + done + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other run time loading flags (-brtl), -berok will + # link without error, but may produce a broken library. + allow_undefined_flag=' ${wl}-berok' + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + allow_undefined_flag=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + build_libtool_need_lc=yes + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' @@ -317,7 +369,7 @@ else old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w $srcfile`' + fix_srcfile_path='`cygpath -w "$srcfile"`' ;; freebsd1*) @@ -352,7 +404,7 @@ else ;; hpux9* | hpux10* | hpux11*) - case "$host_os" in + case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac @@ -441,7 +493,7 @@ else $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no - case "$host_os" in + case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; @@ -539,7 +591,7 @@ fi ac_cv_prog_cc_wl='-Wl,' ac_cv_prog_cc_static='-static' - case "$host_os" in + case $host_os in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; @@ -575,3 +627,6 @@ fi # GCJ did not exist at the time GCC didn't implicitly link libc in. need_lc=no + +# All existing releases of GCJ support `-c -o'. +lt_cv_compiler_c_o=yes diff --git a/ltconfig b/ltconfig index 7130a6f57..739e6529d 100755 --- a/ltconfig +++ b/ltconfig @@ -1,7 +1,8 @@ #! /bin/sh # ltconfig - Create a system-specific libtool. -# Copyright (C) 1996-2000 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This file is free software; you can redistribute it and/or modify it @@ -181,7 +182,7 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` PROGRAM=ltconfig PACKAGE=libtool VERSION=1.4a -TIMESTAMP=" (1.641.2.122 2000/09/30 05:27:52)" +TIMESTAMP=" (1.641.2.198 2001/03/20 05:47:28)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" @@ -216,6 +217,7 @@ need_locks=yes ac_ext=c libext=a cache_file= +max_cmd_len= ## Dependencies to place before and after the object being linked: predep_objects= @@ -294,7 +296,7 @@ args= prev= for option do - case "$option" in + case $option in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac @@ -306,7 +308,7 @@ do continue fi - case "$option" in + case $option in --help) cat <&2 @@ -454,7 +455,7 @@ fi ltconfig_args= for arg do - case "$arg" in + case $arg in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ltconfig_args="$ltconfig_args '$arg'" ;; *) ltconfig_args="$ltconfig_args $arg" ;; @@ -537,7 +538,7 @@ if test "$verify_host" = yes; then echo $ac_n "checking host system type""... $ac_c" 1>&6 host_alias=$host - case "$host_alias" in + case $host_alias in "") # Force config.guess to use the C compiler. # CC_FOR_BUILD overrides the CC variable in config.guess but I had @@ -565,7 +566,7 @@ if test "$verify_host" = yes; then echo $ac_n "checking build system type... $ac_c" 1>&6 build_alias=$build - case "$build_alias" in + case $build_alias in NONE) case $nonopt in NONE) build_alias=$host_alias ;; @@ -600,12 +601,12 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case "$host_os" in +case $host_os in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac -case "$host_os" in +case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems @@ -674,7 +675,7 @@ compiler="$2" # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 -echo "$progname:675:checking for $compiler option to produce PIC" 1>&5 +echo "$progname:678:checking for $compiler option to produce PIC" 1>&5 if test -z "$ac_cv_prog_cc_pic"; then echo "$ac_t"none 1>&6 @@ -683,7 +684,7 @@ else # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6 - echo "$progname:684:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5 + echo "$progname:687:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5 if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \ test "X${ac_cv_prog_cc_pic_works}" != X; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -693,11 +694,11 @@ else echo $lt_simple_compile_test_code > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC" - if { (eval echo $progname:694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + if { (eval echo $progname:697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 - case "$host_os" in + case $host_os in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we @@ -745,7 +746,7 @@ if test -n "$ac_cv_prog_cc_shlib"; then fi echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6 -echo "$progname:746: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5 +echo "$progname:749: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5 if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \ test "X${ac_cv_prog_cc_static_works}" != X; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -754,7 +755,7 @@ else echo $lt_simple_link_test_code > conftest.$ac_ext save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static" - if { (eval echo $progname:755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_static_works=yes else ac_cv_prog_cc_static_works=no @@ -775,47 +776,81 @@ link_static_flag="$ac_cv_prog_cc_static" no_builtin_flag="$ac_cv_prog_cc_no_builtin" can_build_shared="$ac_cv_prog_cc_can_build_shared" +# find the maximum length of command line arguments +echo "$progname:780: finding the maximum length of command line arguments" 1>&5 +echo $ac_n "finding the maximum length of command line arguments... $ac_c" 1>&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + i=0 + testring="ABCDEF" + while test `$CONFIG_SHELL $0 --fallback-echo "X$testring" >/dev/null 2>&1` == `echo "X$testring" >/dev/null 2>&1` && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 32 # 1 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # add a significant safety factor because C++ compilers can tack on massive amounts + # of additional arguments before passing them to the linker. 1/4 should be good. + len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len - $len` +fi +echo "$progname:@lineno@: result: $lt_cv_sys_max_cmd_len" 1>&5 +echo "${ac_t}$lt_cv_sys_max_cmd_len" 1>&6 + +if test -n $lt_cv_sys_max_cmd_len ; then + max_cmd_len=$lt_cv_sys_max_cmd_len +else + max_cmd_len=none +fi + # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6 -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -$rm conftest* -echo $lt_simple_compile_test_code > conftest.$ac_ext -mkdir out -# 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 . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.$objext" -echo "$progname:792: checking if $compiler supports -c -o file.$objext" >&5 -if { (eval echo $progname:793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - echo "$ac_t"no 1>&6 - compiler_c_o=no - else - echo "$ac_t"yes 1>&6 - compiler_c_o=yes - fi +if test "${lt_cv_compiler_c_o+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 else - # Append any errors to the config.log. - cat out/conftest.err 1>&5 - compiler_c_o=no - echo "$ac_t"no 1>&6 + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + $rm conftest* + echo $lt_simple_compile_test_code > conftest.$ac_ext + mkdir out + # 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 . + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -o out/conftest2.$objext" + echo "$progname:829: checking if $compiler supports -c -o file.$objext" >&5 + if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s out/conftest.err; then + lt_cv_compiler_c_o=no + else + lt_cv_compiler_c_o=yes + fi + else + # Append any errors to the config.log. + cat out/conftest.err 1>&5 + lt_cv_compiler_c_o=no + fi + CFLAGS="$save_CFLAGS" + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm -r conftest 2>/dev/null fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null +compiler_c_o=$lt_cv_compiler_c_o +echo "${ac_t}$compiler_c_o" 1>&6 # Check to see if we can do hard links to lock some files if needed hard_links="nottested" @@ -845,8 +880,8 @@ if test "$with_gcc" = yes; then echo $lt_simple_compile_test_code > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - echo "$progname:846: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - if { (eval echo $progname:847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + echo "$progname:883: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + if { (eval echo $progname:884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -915,6 +950,10 @@ else echo "${ac_t}no" 1>&6 fi +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -934,25 +973,63 @@ sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 -case "$host_os" in +case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH - # AIX has no versioning support, so we append a major version to the name. + # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; -aix4*) - version_type=linux - # AIX has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - # We preserve .a as extension for shared libraries though AIX4.2 - # and later linker supports .so - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' - shlibpath_var=LIBPATH +aix4* | aix5*) + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + else + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + # We preserve .a as extension for shared libraries though AIX4.2 + # and later linker supports .so + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so instead of + # lib.a to let people know that these are not typical AIX shared libraries. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + else + # We preserve .a as extension for shared libraries though AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}.so$major.o' + fi + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + shlibpath_var=LIBPATH + deplibs_check_method=pass_all + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + can_build_shared=no + fi + ;; + esac + fi ;; amigaos*) @@ -989,11 +1066,21 @@ cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no - if test "$with_gcc" = yes; then + case $with_gcc,$host_os in + yes,cygwin*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + ;; + yes,mingw*) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - else + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` + ;; + yes,pw32*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' +;; + *) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - fi + ;; + esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH @@ -1001,6 +1088,15 @@ cygwin* | mingw* | pw32*) lt_cv_dlopen_libs= ;; +darwin* | rhapsody*) + library_names_spec='${libname}.`if test "$module" = "yes"; then echo so; else echo dylib; fi`' + need_lib_prefix=no + need_version=no + postinstall_cmds='chmod +x $lib' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + ;; + freebsd1*) dynamic_linker=no ;; @@ -1008,7 +1104,7 @@ freebsd1*) freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat - case "$version_type" in + case $version_type in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no @@ -1020,7 +1116,7 @@ freebsd*) ;; esac shlibpath_var=LD_LIBRARY_PATH - case "$host_os" in + case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; @@ -1062,12 +1158,12 @@ irix5* | irix6*) need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' - case "$host_os" in + case $host_os in irix5*) libsuff= shlibsuff= ;; *) - case "$LD" in # libtool.m4 will add one of these switches to LD + case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; @@ -1126,6 +1222,13 @@ netbsd*) hardcode_into_libs=yes ;; +newsos6) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then @@ -1192,7 +1295,7 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH - case "$host_vendor" in + case $host_vendor in motorola) need_lib_prefix=no need_version=no @@ -1253,7 +1356,7 @@ symxfrm='\1 \2\3 \3' global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. -case "$host_os" in +case $host_os in aix*) symcode='[BCDT]' ;; @@ -1276,7 +1379,7 @@ esac # Handle CRLF in mingw too chain opt_cr= -case "$host_os" in +case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; @@ -1305,14 +1408,14 @@ void nm_test_func(){} #ifdef __cplusplus } #endif -main(){nm_test_var='a';nm_test_func();return(0);} +int main(){nm_test_var='a';nm_test_func();return(0);} EOF - echo "$progname:1309: checking if global_symbol_pipe works" >&5 - if { (eval echo $progname:1310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + echo "$progname:1414: checking if global_symbol_pipe works" >&5 + if { (eval echo $progname:1415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm - if { echo "$progname:1313: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + if { echo "$progname:1418: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -1364,7 +1467,7 @@ EOF save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:1470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 @@ -1408,7 +1511,7 @@ echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in # configure.in, otherwise build static only libraries. -case "$host_os" in +case $host_os in cygwin* | mingw* | pw32* | os2*) if test x$can_build_shared = xyes; then test x$enable_win32_dll = xno && can_build_shared=no @@ -1422,7 +1525,7 @@ test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. -case "$host_os" in +case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then @@ -1468,14 +1571,14 @@ else if test "X${lt_cv_dlopen+set}" != Xset; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:1469: checking for dlopen in -ldl" >&5 +echo "$progname:1574: checking for dlopen in -ldl" >&5 if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:1594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_lib_dl_dlopen=yes else @@ -1507,12 +1610,12 @@ if test "X$ac_cv_lib_dl_dlopen" = Xyes; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:1508: checking for dlopen" >&5 +echo "$progname:1613: checking for dlopen" >&5 if test "X${ac_cv_func_dlopen+set}" = Xset; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1537,7 +1640,7 @@ dlopen(); ; return 0; } EOF -if { (eval echo $progname:1538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:1643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_dlopen=yes else @@ -1554,14 +1657,14 @@ if test "X$ac_cv_func_dlopen" = Xyes; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "$progname:1555: checking for dlopen in -lsvld" >&5 +echo "$progname:1660: checking for dlopen in -lsvld" >&5 if test "X${ac_cv_lib_svld_dlopen+set}" = Xset; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsvld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:1680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_lib_svld_dlopen=yes else @@ -1593,14 +1696,14 @@ if test "X$ac_cv_lib_svld_dlopen" = Xyes; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:1594: checking for dld_link in -ldld" >&5 +echo "$progname:1699: checking for dld_link in -ldld" >&5 if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:1719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_lib_dld_dld_link=yes else @@ -1632,12 +1735,12 @@ if test "X$ac_cv_lib_dld_dld_link" = Xyes; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:1633: checking for shl_load" >&5 +echo "$progname:1738: checking for shl_load" >&5 if test "X${ac_cv_func_shl_load+set}" = Xset; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1662,7 +1765,7 @@ shl_load(); ; return 0; } EOF -if { (eval echo $progname:1663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:1768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_shl_load=yes else @@ -1680,14 +1783,14 @@ if test "X$ac_cv_func_shl_load" = Xyes; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:1681: checking for shl_load in -ldld" >&5 +echo "$progname:1786: checking for shl_load in -ldld" >&5 if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:1807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_lib_dld_shl_load=yes else @@ -1743,23 +1846,23 @@ fi enable_dlopen=no fi - case "$lt_cv_dlopen" in + case $lt_cv_dlopen in dlopen) for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:1749: checking for $ac_hdr" >&5 +echo "$progname:1854: checking for $ac_hdr" >&5 if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; int main () { return(0); } EOF ac_try="$ac_compile >/dev/null 2>conftest.out" -{ (eval echo $progname:1760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo $progname:1865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1787,7 +1890,7 @@ done LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:1788: checking whether a program can dlopen itself" >&5 +echo "$progname:1893: checking whether a program can dlopen itself" >&5 if test "X${lt_cv_dlopen_self+set}" = Xset; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1795,7 +1898,7 @@ else lt_cv_dlopen_self=cross else cat > conftest.$ac_ext < @@ -1835,13 +1938,14 @@ else # endif #endif -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); +void fnord() { int i=42; } +int main() { + void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:1842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else @@ -1860,7 +1964,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:1861: checking whether a statically linked program can dlopen itself" >&5 +echo "$progname:1967: checking whether a statically linked program can dlopen itself" >&5 if test "X${lt_cv_dlopen_self_static+set}" = Xset; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1868,7 +1972,7 @@ else lt_cv_dlopen_self_static=cross else cat > conftest.$ac_ext < @@ -1908,13 +2012,14 @@ else # endif #endif -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); +void fnord() { int i=42; } +int main() { + void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:1915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else @@ -1933,12 +2038,12 @@ fi ;; esac - case "$lt_cv_dlopen_self" in + case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac - case "$lt_cv_dlopen_self_static" in + case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac @@ -1955,7 +2060,7 @@ LTSHELL="$SHELL" LTCONFIG_VERSION="$VERSION" # Only quote variables if we're using ltmain.sh. -case "$ltmain" in +case $ltmain in *.sh) # Now quote all the things that may contain metacharacters. for var in ltecho old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \ @@ -1980,7 +2085,7 @@ case "$ltmain" in sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o need_locks exclude_expsyms include_expsyms; do - case "$var" in + case $var in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ @@ -1996,7 +2101,7 @@ case "$ltmain" in esac done - case "$ltecho" in + case $ltecho in *'\$0 --fallback-echo"') ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; @@ -2185,6 +2290,9 @@ exeext="$exeext" pic_flag=$pic_flag pic_mode=$pic_mode +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + # Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o @@ -2373,11 +2481,11 @@ else echo "### END LIBTOOL TAG CONFIG: $tagname" >> "$ofile" fi -case "$ltmain" in +case $ltmain in *.sh) echo >> "$ofile" if test -z "$tagname"; then - case "$host_os" in + case $host_os in aix3*) cat <<\EOF >> "$ofile" @@ -2391,7 +2499,7 @@ fi EOF ;; esac - case "$host" in + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) cat <<'EOF' >> "$ofile" # This is a source program that is used to create dlls on Windows diff --git a/ltmain.sh b/ltmain.sh index 2bccd110f..b81cb285e 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -1,7 +1,8 @@ # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun ltconfig. # -# Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify @@ -55,7 +56,7 @@ modename="$progname" PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.4a -TIMESTAMP=" (1.641.2.122 2000/09/30 05:27:52)" +TIMESTAMP=" (1.641.2.198 2001/03/20 05:47:28)" default_mode= help="Try \`$progname --help' for more information." @@ -113,22 +114,22 @@ do arg="$1" shift - case "$arg" in + case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then - case "$prev" in + case $prev in execute_dlfiles) - eval "$prev=\"\$$prev \$arg\"" + execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" # Check whether tagname contains only valid characters - case "$tagname" in + case $tagname in *[!-_A-Za-z0-9,/]*) echo "$progname: invalid tag name: $tagname" 1>&2 exit 1 @@ -154,7 +155,7 @@ do fi # Have we seen a non-optional argument yet? - case "$arg" in + case $arg in --help) show_help=yes ;; @@ -241,12 +242,12 @@ if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then - case "$nonopt" in + case $nonopt in *cc | *++ | gcc* | *-gcc*) mode=link for arg do - case "$arg" in + case $arg in -c) mode=compile break @@ -291,7 +292,7 @@ if test -z "$show_help"; then help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. - case "$mode" in + case $mode in # libtool compile mode compile) modename="$modename: compile" @@ -305,14 +306,14 @@ if test -z "$show_help"; then user_target=no for arg do - case "$prev" in + case $prev in "") ;; xcompiler) # Aesthetically quote the previous argument. prev= lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in + case $arg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. @@ -332,7 +333,7 @@ if test -z "$show_help"; then esac # Accept any command-line options. - case "$arg" in + case $arg in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 @@ -371,7 +372,7 @@ if test -z "$show_help"; then # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. - case "$arg" in + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; @@ -391,7 +392,7 @@ if test -z "$show_help"; then ;; esac - case "$user_target" in + case $user_target in next) # The next one is the -o target name user_target=yes @@ -419,7 +420,7 @@ if test -z "$show_help"; then # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. - case "$lastarg" in + case $lastarg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; @@ -433,7 +434,7 @@ if test -z "$show_help"; then fi done - case "$user_target" in + case $user_target in set) ;; no) @@ -449,7 +450,7 @@ if test -z "$show_help"; then # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' - case "$libobj" in + case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; @@ -466,7 +467,7 @@ if test -z "$show_help"; then libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - case "$libobj" in + case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 @@ -544,7 +545,7 @@ if test -z "$show_help"; then trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types - case "$host_os" in + case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; @@ -777,7 +778,7 @@ EOF # libtool link mode link | relink) modename="$modename: link" - case "$host" in + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out @@ -843,7 +844,7 @@ EOF # We need to know -static, to get the right output filenames. for arg do - case "$arg" in + case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then @@ -873,7 +874,7 @@ EOF arg="$1" base_compile="$base_compile $arg" shift - case "$arg" in + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; @@ -883,14 +884,14 @@ EOF # If the previous option needs an argument, assign it. if test -n "$prev"; then - case "$prev" in + case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac - case "$prev" in + case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -898,7 +899,7 @@ EOF finalize_command="$finalize_command @SYMFILE@" preload=yes fi - case "$arg" in + case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then @@ -950,9 +951,116 @@ EOF prev= continue ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit 1 + fi + arg=$save_arg + prev= + continue + ;; rpath | xrpath) # We need an absolute path. - case "$arg" in + case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 @@ -998,7 +1106,7 @@ EOF prevarg="$arg" - case "$arg" in + case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" @@ -1061,7 +1169,7 @@ EOF -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. - case "$dir" in + case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` @@ -1079,9 +1187,9 @@ EOF lib_search_path="$lib_search_path $dir" ;; esac - case "$host" in + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case ":$dllsearchpath:" in + case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac @@ -1092,18 +1200,26 @@ EOF -l*) if test "$arg" = "-lc"; then - case "$host" in + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # These systems don't actually have c library (as such) continue ;; + *-*-rhapsody* | *-*-darwin*) + # Darwin C library is in the System framework + deplibs="$deplibs -framework System" + ;; esac elif test "$arg" = "-lm"; then - case "$host" in + case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have math library (as such) continue ;; + *-*-rhapsody* | *-*-darwin*) + # Darwin math library is in the System framework + deplibs="$deplibs -framework System" + ;; esac fi deplibs="$deplibs $arg" @@ -1121,7 +1237,7 @@ EOF ;; -no-install) - case "$host" in + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. @@ -1129,8 +1245,8 @@ EOF $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; - *-*-rhapsody*) - # rhapsody is a little odd... + *-*-rhapsody* | *-*-darwin*) + # Darwin C library is in the System framework deplibs="$deplibs -framework System" ;; *) @@ -1145,6 +1261,11 @@ EOF continue ;; + -objectlist) + prev=objectlist + continue + ;; + -o) prev=output ;; -release) @@ -1165,7 +1286,7 @@ EOF -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. - case "$dir" in + case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 @@ -1204,7 +1325,7 @@ EOF IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" - case "$flag" in + case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; @@ -1222,7 +1343,7 @@ EOF IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" - case "$flag" in + case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; @@ -1250,7 +1371,7 @@ EOF # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; @@ -1272,7 +1393,7 @@ EOF # Read the .lo file # If there is no directory component, then add one. - case "$arg" in + case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac @@ -1384,7 +1505,7 @@ EOF # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; @@ -1486,7 +1607,7 @@ EOF fi # Determine the type of output - case "$output" in + case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 @@ -1523,7 +1644,7 @@ EOF lib) passes="conv link" for file in $dlfiles $dlprefiles; do - case "$file" in + case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 @@ -1564,7 +1685,7 @@ EOF for deplib in $libs; do lib= found=no - case "$deplib" in + case $deplib in -l*) if test $linkmode != lib && test $linkmode != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 @@ -1714,7 +1835,7 @@ EOF installed=yes # Read the .la file - case "$lib" in + case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac @@ -1769,9 +1890,11 @@ EOF exit 1 fi 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 statically, - # we need to preload. - dlprefiles="$dlprefiles $lib" + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi @@ -1779,7 +1902,7 @@ EOF fi # We need an absolute path. - case "$ladir" in + case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` @@ -1854,7 +1977,7 @@ EOF tmp_libs= for deplib in $dependency_libs; do - case "$deplib" in + case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? @@ -2003,12 +2126,12 @@ EOF add_dir= add= lib_linked=yes - case "$hardcode_action" in + case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then - case "$host" in + case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" @@ -2042,7 +2165,7 @@ EOF fi if test -n "$add_shlibpath"; then - case ":$compile_shlibpath:" in + case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac @@ -2056,7 +2179,7 @@ EOF if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then - case ":$finalize_shlibpath:" in + case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac @@ -2075,7 +2198,7 @@ EOF add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then - case ":$finalize_shlibpath:" in + case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac @@ -2133,7 +2256,7 @@ EOF # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do - case "$libdir" in + case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; @@ -2161,13 +2284,13 @@ EOF if test $link_all_deplibs != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do - case "$deplib" in + case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. - case "$dir" in + case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` @@ -2232,7 +2355,7 @@ EOF eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do - case "$deplib" in + case $deplib in -L*) new_libs="$deplib $new_libs" ;; *) case " $specialdeplibs " in @@ -2249,7 +2372,7 @@ EOF done tmp_libs= for deplib in $new_libs; do - case "$deplib" in + case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; @@ -2306,7 +2429,7 @@ EOF lib) # Make sure we only generate libraries of the form `libNAME.la'. - case "$outputname" in + case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" @@ -2386,7 +2509,7 @@ EOF age="$4" # Check that each of the things are valid numbers. - case "$current" in + case $current in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 @@ -2395,7 +2518,7 @@ EOF ;; esac - case "$revision" in + case $revision in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 @@ -2404,7 +2527,7 @@ EOF ;; esac - case "$age" in + case $age in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 @@ -2423,7 +2546,7 @@ EOF major= versuffix= verstring= - case "$version_type" in + case $version_type in none) ;; irix) @@ -2531,7 +2654,7 @@ EOF removelist= tempremovelist=`echo "$output_objdir/*"` for p in $tempremovelist; do - case "$p" in + case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) @@ -2598,7 +2721,7 @@ EOF if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then - case "$host" in + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; @@ -2625,7 +2748,7 @@ EOF major="" newdeplibs= droppeddeps=no - case "$deplibs_check_method" in + case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check @@ -2650,7 +2773,7 @@ EOF for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" ; then + if test "$name" != "" -a "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches @@ -2675,7 +2798,7 @@ EOF for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" ; then + if test "$name" != "" -a "$name" != "0"; then $rm conftest $LTCC -o conftest conftest.c $i # Did it work? @@ -2715,7 +2838,7 @@ EOF for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" ; then + if test "$name" != "" -a "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` @@ -2733,7 +2856,7 @@ EOF potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case "$potliblink" in + case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac @@ -2808,6 +2931,21 @@ EOF echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." + + if test $allow_undefined = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi fi fi # Done checking deplibs! @@ -2834,7 +2972,7 @@ EOF hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) @@ -2943,6 +3081,7 @@ EOF if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" @@ -2958,7 +3097,7 @@ EOF for xlib in $convenience; do # Extract the objects. - case "$xlib" in + case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac @@ -2997,13 +3136,115 @@ EOF else eval cmds=\"$archive_cmds\" fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" + if len=`expr "X$cmds" : ".*"` && + test $len -le $max_cmd_len; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$save_output-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*"` && + test $len -le $max_cmd_len; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test $k -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$save_output-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$save_output-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + # Set up a command to remove the reloadale object files + # after they are used. + i=0 + while test $i -lt $k + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~$rm $delfiles\" + fi + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then @@ -3052,7 +3293,7 @@ EOF $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi - case "$output" in + case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 @@ -3097,7 +3338,7 @@ EOF for xlib in $convenience; do # Extract the objects. - case "$xlib" in + case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac @@ -3232,7 +3473,7 @@ EOF hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) @@ -3250,9 +3491,9 @@ EOF *) perm_rpath="$perm_rpath $libdir" ;; esac fi - case "$host" in + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case ":$dllsearchpath:" in + case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac @@ -3276,7 +3517,7 @@ EOF hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) @@ -3313,7 +3554,7 @@ EOF fi if test -n "$dlsyms"; then - case "$dlsyms" in + case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. @@ -3444,7 +3685,7 @@ static const void *lt_preloaded_setup() { fi pic_flag_for_symtable= - case "$host" in + case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use @@ -3512,7 +3753,7 @@ static const void *lt_preloaded_setup() { # We should set the shlibpath_var rpath= for dir in $temp_rpath; do - case "$dir" in + case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" @@ -3620,7 +3861,7 @@ static const void *lt_preloaded_setup() { # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case "$0" in + case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac @@ -3859,7 +4100,7 @@ fi\ # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. - case "$xlib" in + case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac @@ -3903,7 +4144,39 @@ fi\ # fi # done - eval cmds=\"$old_archive_cmds\" + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test $len -le $max_cmd_len; then + : + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*"` && + test $len -le $max_cmd_len; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + eval cmds=\"\$concat_cmds~$old_archive_cmds\" + fi fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do @@ -3920,7 +4193,7 @@ fi\ fi # Now create the libtool archive. - case "$output" in + case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" @@ -3952,7 +4225,7 @@ fi\ # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do - case "$deplib" in + case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` @@ -4050,7 +4323,7 @@ relink_command=\"$relink_command\"" $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case "$arg" in + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; @@ -4066,7 +4339,7 @@ relink_command=\"$relink_command\"" # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; @@ -4089,7 +4362,7 @@ relink_command=\"$relink_command\"" continue fi - case "$arg" in + case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; @@ -4114,7 +4387,7 @@ relink_command=\"$relink_command\"" # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; @@ -4165,11 +4438,11 @@ relink_command=\"$relink_command\"" exit 1 fi fi - case "$destdir" in + case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do - case "$file" in + case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 @@ -4191,7 +4464,7 @@ relink_command=\"$relink_command\"" for file in $files; do # Do each installation. - case "$file" in + case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" @@ -4210,7 +4483,7 @@ relink_command=\"$relink_command\"" old_library= relink_command= # If there is no directory component, then add one. - case "$file" in + case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac @@ -4306,7 +4579,7 @@ relink_command=\"$relink_command\"" fi # Deduce the name of the destination old-style object file. - case "$destfile" in + case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; @@ -4353,7 +4626,7 @@ relink_command=\"$relink_command\"" relink_command= # If there is no directory component, then add one. - case "$file" in + case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac @@ -4370,7 +4643,7 @@ relink_command=\"$relink_command\"" libdir= if test -f "$lib"; then # If there is no directory component, then add one. - case "$lib" in + case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac @@ -4384,7 +4657,7 @@ relink_command=\"$relink_command\"" relink_command= # If there is no directory component, then add one. - case "$file" in + case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac @@ -4563,7 +4836,7 @@ relink_command=\"$relink_command\"" fi dir= - case "$file" in + case $file in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : @@ -4578,7 +4851,7 @@ relink_command=\"$relink_command\"" library_names= # If there is no directory component, then add one. - case "$file" in + case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac @@ -4633,13 +4906,13 @@ relink_command=\"$relink_command\"" args= for file do - case "$file" in + case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. - case "$file" in + case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac @@ -4696,7 +4969,7 @@ relink_command=\"$relink_command\"" for arg do - case "$arg" in + case $arg in -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac @@ -4708,6 +4981,8 @@ relink_command=\"$relink_command\"" exit 1 fi + rmdirs= + for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then @@ -4719,9 +4994,17 @@ relink_command=\"$relink_command\"" name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test $mode = uninstall && objdir="$dir" + # Remember objdir for removal later, being careful to avoid duplicates + if test $mode = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + rmfiles="$file" - case "$name" in + case $name in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then @@ -4765,10 +5048,10 @@ relink_command=\"$relink_command\"" *.lo) # Possibly a libtool object, so verify it. - if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file - . ./$file + . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ @@ -4801,6 +5084,15 @@ relink_command=\"$relink_command\"" $show "$rm $rmfiles" $run $rm $rmfiles done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + exit 0 ;; @@ -4817,7 +5109,7 @@ relink_command=\"$relink_command\"" fi # test -z "$show_help" # We need to display help for each of the modes. -case "$mode" in +case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... @@ -4956,6 +5248,7 @@ The following components of LINK-COMMAND are treated specially: -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries