Updated libtool support for libtool 1.5.8
authorSam Lantinga <slouken@libsdl.org>
Sat, 21 Aug 2004 20:35:50 +0000
changeset 9473bb035750537
parent 946 8520712f8ef0
child 948 ac488ad4ef1d
Updated libtool support for libtool 1.5.8
acinclude.m4
ltmain.sh
     1.1 --- a/acinclude.m4	Sat Aug 21 14:54:49 2004 +0000
     1.2 +++ b/acinclude.m4	Sat Aug 21 20:35:50 2004 +0000
     1.3 @@ -334,8 +334,9 @@
     1.4    rm -f conf.esdtest
     1.5  ])
     1.6  
     1.7 +# Based on libtool-1.5.8
     1.8  # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
     1.9 -## Copyright 1996, 1997, 1998, 1999, 2000, 2001
    1.10 +## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
    1.11  ## Free Software Foundation, Inc.
    1.12  ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    1.13  ##
    1.14 @@ -536,6 +537,8 @@
    1.15    old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
    1.16  fi
    1.17  
    1.18 +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
    1.19 +
    1.20  # Only perform the check for file, if the check method requires it
    1.21  case $deplibs_check_method in
    1.22  file_magic*)
    1.23 @@ -653,7 +656,7 @@
    1.24  
    1.25  # The HP-UX ksh and POSIX shell print the target directory to stdout
    1.26  # if CDPATH is set.
    1.27 -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
    1.28 +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
    1.29  
    1.30  if test -z "$ECHO"; then
    1.31  if test "X${echo_test_string+set}" != Xset; then
    1.32 @@ -836,7 +839,7 @@
    1.33          x86_64-*linux*)
    1.34            LD="${LD-ld} -m elf_i386"
    1.35            ;;
    1.36 -        ppc64-*linux*)
    1.37 +        ppc64-*linux*|powerpc64-*linux*)
    1.38            LD="${LD-ld} -m elf32ppclinux"
    1.39            ;;
    1.40          s390x-*linux*)
    1.41 @@ -900,7 +903,8 @@
    1.42  # ----------------------------------------------------------------
    1.43  # Check whether the given compiler option works
    1.44  AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
    1.45 -[AC_CACHE_CHECK([$1], [$2],
    1.46 +[AC_REQUIRE([LT_AC_PROG_SED])
    1.47 +AC_CACHE_CHECK([$1], [$2],
    1.48    [$2=no
    1.49    ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
    1.50     printf "$lt_simple_compile_test_code" > conftest.$ac_ext
    1.51 @@ -976,7 +980,7 @@
    1.52  AC_MSG_CHECKING([the maximum length of command line arguments])
    1.53  AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
    1.54    i=0
    1.55 -  testring="ABCD"
    1.56 +  teststring="ABCD"
    1.57  
    1.58    case $build_os in
    1.59    msdosdjgpp*)
    1.60 @@ -1005,20 +1009,40 @@
    1.61      lt_cv_sys_max_cmd_len=8192;
    1.62      ;;
    1.63  
    1.64 +  amigaos*)
    1.65 +    # On AmigaOS with pdksh, this test takes hours, literally.
    1.66 +    # So we just punt and use a minimum line length of 8192.
    1.67 +    lt_cv_sys_max_cmd_len=8192;
    1.68 +    ;;
    1.69 +
    1.70 +  netbsd* | freebsd* | openbsd* | darwin* )
    1.71 +    # This has been around since 386BSD, at least.  Likely further.
    1.72 +    if test -x /sbin/sysctl; then
    1.73 +      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
    1.74 +    elif test -x /usr/sbin/sysctl; then
    1.75 +      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
    1.76 +    else
    1.77 +      lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
    1.78 +    fi
    1.79 +    # And add a safety zone
    1.80 +    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
    1.81 +    ;;
    1.82 +
    1.83   *)
    1.84      # If test is not a shell built-in, we'll probably end up computing a
    1.85      # maximum length that is only half of the actual maximum length, but
    1.86      # we can't tell.
    1.87 -    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
    1.88 -	       = "XX$testring") >/dev/null 2>&1 &&
    1.89 -	    new_result=`expr "X$testring" : ".*" 2>&1` &&
    1.90 +    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
    1.91 +    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
    1.92 +	       = "XX$teststring") >/dev/null 2>&1 &&
    1.93 +	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
    1.94  	    lt_cv_sys_max_cmd_len=$new_result &&
    1.95  	    test $i != 17 # 1/2 MB should be enough
    1.96      do
    1.97        i=`expr $i + 1`
    1.98 -      testring=$testring$testring
    1.99 +      teststring=$teststring$teststring
   1.100      done
   1.101 -    testring=
   1.102 +    teststring=
   1.103      # Add a significant safety factor because C++ compilers can tack on massive
   1.104      # amounts of additional arguments before passing them to the linker.
   1.105      # It appears as though 1/2 is a usable value.
   1.106 @@ -1168,7 +1192,7 @@
   1.107      lt_cv_dlopen_self=yes
   1.108      ])
   1.109     ;;
   1.110 -    
   1.111 +
   1.112    *)
   1.113      AC_CHECK_FUNC([shl_load],
   1.114  	  [lt_cv_dlopen="shl_load"],
   1.115 @@ -1257,13 +1281,6 @@
   1.116     mkdir out
   1.117     printf "$lt_simple_compile_test_code" > conftest.$ac_ext
   1.118  
   1.119 -   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
   1.120 -   # that will create temporary files in the current directory regardless of
   1.121 -   # the output directory.  Thus, making CWD read-only will cause this test
   1.122 -   # to fail, enabling locking or at least warning the user not to do parallel
   1.123 -   # builds.
   1.124 -   chmod -w .
   1.125 -
   1.126     lt_compiler_flag="-o out/conftest2.$ac_objext"
   1.127     # Insert the option either (1) after the last *FLAGS variable, or
   1.128     # (2) before a word containing "conftest.", or (3) at the end.
   1.129 @@ -1287,8 +1304,11 @@
   1.130       fi
   1.131     fi
   1.132     chmod u+w .
   1.133 -   $rm conftest* out/*
   1.134 -   rmdir out
   1.135 +   $rm conftest*
   1.136 +   # SGI C++ compiler will create directory out/ii_files/ for
   1.137 +   # template instantiation
   1.138 +   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
   1.139 +   $rm out/* && rmdir out
   1.140     cd ..
   1.141     rmdir conftest
   1.142     $rm conftest*
   1.143 @@ -1347,8 +1367,8 @@
   1.144  [AC_MSG_CHECKING([how to hardcode library paths into programs])
   1.145  _LT_AC_TAGVAR(hardcode_action, $1)=
   1.146  if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
   1.147 -   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
   1.148 -   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
   1.149 +   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
   1.150 +   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
   1.151  
   1.152    # We can hardcode non-existant directories.
   1.153    if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
   1.154 @@ -1405,7 +1425,7 @@
   1.155     *)
   1.156    AC_MSG_RESULT([no])
   1.157      ;;
   1.158 -  esac  
   1.159 +  esac
   1.160  fi
   1.161  ])# AC_LIBTOOL_SYS_LIB_STRIP
   1.162  
   1.163 @@ -1418,7 +1438,7 @@
   1.164  library_names_spec=
   1.165  libname_spec='lib$name'
   1.166  soname_spec=
   1.167 -shrext=".so"
   1.168 +shrext_cmds=".so"
   1.169  postinstall_cmds=
   1.170  postuninstall_cmds=
   1.171  finish_cmds=
   1.172 @@ -1506,7 +1526,7 @@
   1.173  amigaos*)
   1.174    library_names_spec='$libname.ixlibrary $libname.a'
   1.175    # Create ${libname}_ixlibrary.a entries in /sys/libs.
   1.176 -  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
   1.177 +  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
   1.178    ;;
   1.179  
   1.180  beos*)
   1.181 @@ -1515,7 +1535,7 @@
   1.182    shlibpath_var=LIBRARY_PATH
   1.183    ;;
   1.184  
   1.185 -bsdi4*)
   1.186 +bsdi[[45]]*)
   1.187    version_type=linux
   1.188    need_version=no
   1.189    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   1.190 @@ -1531,7 +1551,7 @@
   1.191  
   1.192  cygwin* | mingw* | pw32*)
   1.193    version_type=windows
   1.194 -  shrext=".dll"
   1.195 +  shrext_cmds=".dll"
   1.196    need_version=no
   1.197    need_lib_prefix=no
   1.198  
   1.199 @@ -1594,17 +1614,16 @@
   1.200    version_type=darwin
   1.201    need_lib_prefix=no
   1.202    need_version=no
   1.203 -  # FIXME: Relying on posixy $() will cause problems for
   1.204 -  #        cross-compilation, but unfortunately the echo tests do not
   1.205 -  #        yet detect zsh echo's removal of \ escapes.
   1.206    library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
   1.207    soname_spec='${libname}${release}${major}$shared_ext'
   1.208    shlibpath_overrides_runpath=yes
   1.209    shlibpath_var=DYLD_LIBRARY_PATH
   1.210 -  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
   1.211 +  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   1.212    # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   1.213 -  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
   1.214 -  sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
   1.215 +  if test "$GCC" = yes; then
   1.216 +    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
   1.217 +  else
   1.218 +    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
   1.219    fi
   1.220    sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   1.221    ;;
   1.222 @@ -1622,6 +1641,18 @@
   1.223    dynamic_linker=no
   1.224    ;;
   1.225  
   1.226 +kfreebsd*-gnu)
   1.227 +  version_type=linux
   1.228 +  need_lib_prefix=no
   1.229 +  need_version=no
   1.230 +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
   1.231 +  soname_spec='${libname}${release}${shared_ext}$major'
   1.232 +  shlibpath_var=LD_LIBRARY_PATH
   1.233 +  shlibpath_overrides_runpath=no
   1.234 +  hardcode_into_libs=yes
   1.235 +  dynamic_linker='GNU ld.so'
   1.236 +  ;;
   1.237 +
   1.238  freebsd*)
   1.239    objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   1.240    version_type=freebsd-$objformat
   1.241 @@ -1670,7 +1701,7 @@
   1.242    need_version=no
   1.243    case "$host_cpu" in
   1.244    ia64*)
   1.245 -    shrext='.so'
   1.246 +    shrext_cmds='.so'
   1.247      hardcode_into_libs=yes
   1.248      dynamic_linker="$host_os dld.so"
   1.249      shlibpath_var=LD_LIBRARY_PATH
   1.250 @@ -1685,7 +1716,7 @@
   1.251      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   1.252      ;;
   1.253     hppa*64*)
   1.254 -     shrext='.sl'
   1.255 +     shrext_cmds='.sl'
   1.256       hardcode_into_libs=yes
   1.257       dynamic_linker="$host_os dld.sl"
   1.258       shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
   1.259 @@ -1696,7 +1727,7 @@
   1.260       sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   1.261       ;;
   1.262     *)
   1.263 -    shrext='.sl'
   1.264 +    shrext_cmds='.sl'
   1.265      dynamic_linker="$host_os dld.sl"
   1.266      shlibpath_var=SHLIB_PATH
   1.267      shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
   1.268 @@ -1765,6 +1796,12 @@
   1.269    # before this can be enabled.
   1.270    hardcode_into_libs=yes
   1.271  
   1.272 +  # Append ld.so.conf contents to the search path
   1.273 +  if test -f /etc/ld.so.conf; then
   1.274 +    lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '`
   1.275 +    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   1.276 +  fi
   1.277 +
   1.278    # We used to test for /lib/ld.so.1 and disable shared libraries on
   1.279    # powerpc, because MkLinux only supported shared libraries with the
   1.280    # GNU dynamic linker.  Since this was broken with cross compilers,
   1.281 @@ -1774,6 +1811,18 @@
   1.282    dynamic_linker='GNU/Linux ld.so'
   1.283    ;;
   1.284  
   1.285 +knetbsd*-gnu)
   1.286 +  version_type=linux
   1.287 +  need_lib_prefix=no
   1.288 +  need_version=no
   1.289 +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
   1.290 +  soname_spec='${libname}${release}${shared_ext}$major'
   1.291 +  shlibpath_var=LD_LIBRARY_PATH
   1.292 +  shlibpath_overrides_runpath=no
   1.293 +  hardcode_into_libs=yes
   1.294 +  dynamic_linker='GNU ld.so'
   1.295 +  ;;
   1.296 +
   1.297  netbsd*)
   1.298    version_type=sunos
   1.299    need_lib_prefix=no
   1.300 @@ -1783,7 +1832,7 @@
   1.301      finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   1.302      dynamic_linker='NetBSD (a.out) ld.so'
   1.303    else
   1.304 -    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
   1.305 +    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
   1.306      soname_spec='${libname}${release}${shared_ext}$major'
   1.307      dynamic_linker='NetBSD ld.elf_so'
   1.308    fi
   1.309 @@ -1799,16 +1848,14 @@
   1.310    shlibpath_overrides_runpath=yes
   1.311    ;;
   1.312  
   1.313 -*qnx* | *nto*)
   1.314 -  version_type=qnx
   1.315 +nto-qnx*)
   1.316 +  version_type=linux
   1.317    need_lib_prefix=no
   1.318    need_version=no
   1.319 -  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   1.320 -  soname_spec='${libname}${release}.so$major'
   1.321 +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   1.322 +  soname_spec='${libname}${release}${shared_ext}$major'
   1.323    shlibpath_var=LD_LIBRARY_PATH
   1.324 -  shlibpath_overrides_runpath=no
   1.325 -  hardcode_into_libs=yes
   1.326 -  dynamic_linker='ldqnx.so'
   1.327 +  shlibpath_overrides_runpath=yes
   1.328    ;;
   1.329  
   1.330  openbsd*)
   1.331 @@ -1834,7 +1881,7 @@
   1.332  
   1.333  os2*)
   1.334    libname_spec='$name'
   1.335 -  shrext=".dll"
   1.336 +  shrext_cmds=".dll"
   1.337    need_lib_prefix=no
   1.338    library_names_spec='$libname${shared_ext} $libname.a'
   1.339    dynamic_linker='OS/2 ld.exe'
   1.340 @@ -2270,7 +2317,7 @@
   1.341  
   1.342  # AC_PROG_LD
   1.343  # ----------
   1.344 -# find the path to the GNU or non-GNU linker
   1.345 +# find the pathname to the GNU or non-GNU linker
   1.346  AC_DEFUN([AC_PROG_LD],
   1.347  [AC_ARG_WITH([gnu-ld],
   1.348      [AC_HELP_STRING([--with-gnu-ld],
   1.349 @@ -2296,7 +2343,7 @@
   1.350      # Accept absolute paths.
   1.351      [[\\/]]* | ?:[[\\/]]*)
   1.352        re_direlt='/[[^/]][[^/]]*/\.\./'
   1.353 -      # Canonicalize the path of ld
   1.354 +      # Canonicalize the pathname of ld
   1.355        ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
   1.356        while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
   1.357  	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
   1.358 @@ -2359,7 +2406,7 @@
   1.359  [AC_REQUIRE([AC_PROG_EGREP])dnl
   1.360  AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
   1.361  [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
   1.362 -case `"$LD" -v 2>&1 </dev/null` in
   1.363 +case `$LD -v 2>&1 </dev/null` in
   1.364  *GNU* | *'with BFD'*)
   1.365    lt_cv_prog_gnu_ld=yes
   1.366    ;;
   1.367 @@ -2385,6 +2432,15 @@
   1.368  *) reload_flag=" $reload_flag" ;;
   1.369  esac
   1.370  reload_cmds='$LD$reload_flag -o $output$reload_objs'
   1.371 +case $host_os in
   1.372 +  darwin*)
   1.373 +    if test "$GCC" = yes; then
   1.374 +      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
   1.375 +    else
   1.376 +      reload_cmds='$LD$reload_flag -o $output$reload_objs'
   1.377 +    fi
   1.378 +    ;;
   1.379 +esac
   1.380  ])# AC_PROG_LD_RELOAD_FLAG
   1.381  
   1.382  
   1.383 @@ -2418,35 +2474,32 @@
   1.384    lt_cv_deplibs_check_method=pass_all
   1.385    ;;
   1.386  
   1.387 -bsdi4*)
   1.388 +bsdi[[45]]*)
   1.389    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
   1.390    lt_cv_file_magic_cmd='/usr/bin/file -L'
   1.391    lt_cv_file_magic_test_file=/shlib/libc.so
   1.392    ;;
   1.393  
   1.394 -cygwin* | mingw* | pw32*)
   1.395 -  # win32_libid is a shell function defined in ltmain.sh
   1.396 +cygwin*)
   1.397 +  # func_win32_libid is a shell function defined in ltmain.sh
   1.398    #lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
   1.399    lt_cv_deplibs_check_method=pass_all
   1.400 -  lt_cv_file_magic_cmd='win32_libid'
   1.401 +  lt_cv_file_magic_cmd='func_win32_libid'
   1.402    ;;
   1.403  
   1.404 +mingw* | pw32*)
   1.405 +  # Base MSYS/MinGW do not provide the 'file' command needed by
   1.406 +  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
   1.407 +  #lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
   1.408 +  lt_cv_deplibs_check_method=pass_all
   1.409 +  lt_cv_file_magic_cmd='$OBJDUMP -f'
   1.410 +  ;;
   1.411 +
   1.412  darwin* | rhapsody*)
   1.413 -  # this will be overwritten by pass_all, but leave it in just in case
   1.414 -  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
   1.415 -  lt_cv_file_magic_cmd='/usr/bin/file -L'
   1.416 -  case "$host_os" in
   1.417 -  rhapsody* | darwin1.[[012]])
   1.418 -    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
   1.419 -    ;;
   1.420 -  *) # Darwin 1.3 on
   1.421 -    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
   1.422 -    ;;
   1.423 -  esac
   1.424    lt_cv_deplibs_check_method=pass_all
   1.425    ;;
   1.426  
   1.427 -freebsd*)
   1.428 +freebsd* | kfreebsd*-gnu)
   1.429    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   1.430      case $host_cpu in
   1.431      i*86 )
   1.432 @@ -2485,40 +2538,27 @@
   1.433    ;;
   1.434  
   1.435  irix5* | irix6* | nonstopux*)
   1.436 -  case $host_os in
   1.437 -  irix5* | nonstopux*)
   1.438 -    # this will be overridden with pass_all, but let us keep it just in case
   1.439 -    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
   1.440 -    ;;
   1.441 -  *)
   1.442 -    case $LD in
   1.443 -    *-32|*"-32 ") libmagic=32-bit;;
   1.444 -    *-n32|*"-n32 ") libmagic=N32;;
   1.445 -    *-64|*"-64 ") libmagic=64-bit;;
   1.446 -    *) libmagic=never-match;;
   1.447 -    esac
   1.448 -    # this will be overridden with pass_all, but let us keep it just in case
   1.449 -    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
   1.450 -    ;;
   1.451 +  case $LD in
   1.452 +  *-32|*"-32 ") libmagic=32-bit;;
   1.453 +  *-n32|*"-n32 ") libmagic=N32;;
   1.454 +  *-64|*"-64 ") libmagic=64-bit;;
   1.455 +  *) libmagic=never-match;;
   1.456    esac
   1.457 -  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
   1.458 -  lt_cv_deplibs_check_method=pass_all
   1.459 -  ;;
   1.460 -
   1.461 -*qnx* | *nto*)
   1.462    lt_cv_deplibs_check_method=pass_all
   1.463    ;;
   1.464  
   1.465  # This must be Linux ELF.
   1.466  linux*)
   1.467    case $host_cpu in
   1.468 -  alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*)
   1.469 +  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*)
   1.470      lt_cv_deplibs_check_method=pass_all ;;
   1.471    *)
   1.472      # glibc up to 2.1.1 does not perform some relocations on ARM
   1.473 +    # this will be overridden with pass_all, but let us keep it just in case
   1.474      lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
   1.475    esac
   1.476    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   1.477 +  lt_cv_deplibs_check_method=pass_all
   1.478    ;;
   1.479  
   1.480  netbsd*)
   1.481 @@ -2535,20 +2575,19 @@
   1.482    lt_cv_file_magic_test_file=/usr/lib/libnls.so
   1.483    ;;
   1.484  
   1.485 +nto-qnx*)
   1.486 +  lt_cv_deplibs_check_method=unknown
   1.487 +  ;;
   1.488 +
   1.489  openbsd*)
   1.490 -  lt_cv_file_magic_cmd=/usr/bin/file
   1.491 -  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
   1.492    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
   1.493 -    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
   1.494 +    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   1.495    else
   1.496 -    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
   1.497 +    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   1.498    fi
   1.499    ;;
   1.500  
   1.501  osf3* | osf4* | osf5*)
   1.502 -  # this will be overridden with pass_all, but let us keep it just in case
   1.503 -  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
   1.504 -  lt_cv_file_magic_test_file=/shlib/libc.so
   1.505    lt_cv_deplibs_check_method=pass_all
   1.506    ;;
   1.507  
   1.508 @@ -2558,7 +2597,6 @@
   1.509  
   1.510  solaris*)
   1.511    lt_cv_deplibs_check_method=pass_all
   1.512 -  lt_cv_file_magic_test_file=/lib/libc.so
   1.513    ;;
   1.514  
   1.515  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
   1.516 @@ -2598,7 +2636,7 @@
   1.517  
   1.518  # AC_PROG_NM
   1.519  # ----------
   1.520 -# find the path to a BSD-compatible name lister
   1.521 +# find the pathname to a BSD-compatible name lister
   1.522  AC_DEFUN([AC_PROG_NM],
   1.523  [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
   1.524  [if test -n "$NM"; then
   1.525 @@ -2736,7 +2774,7 @@
   1.526  AC_DEFUN([_LT_AC_LANG_CXX],
   1.527  [AC_REQUIRE([AC_PROG_CXX])
   1.528  AC_REQUIRE([AC_PROG_CXXCPP])
   1.529 -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`])
   1.530 +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
   1.531  ])# _LT_AC_LANG_CXX
   1.532  
   1.533  
   1.534 @@ -2752,7 +2790,7 @@
   1.535  # ---------------
   1.536  AC_DEFUN([_LT_AC_LANG_F77],
   1.537  [AC_REQUIRE([AC_PROG_F77])
   1.538 -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`])
   1.539 +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
   1.540  ])# _LT_AC_LANG_F77
   1.541  
   1.542  
   1.543 @@ -2773,7 +2811,7 @@
   1.544        [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
   1.545  	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
   1.546  	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
   1.547 -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`])
   1.548 +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
   1.549  ])# _LT_AC_LANG_GCJ
   1.550  
   1.551  
   1.552 @@ -2782,7 +2820,7 @@
   1.553  # enable support for Windows resource files
   1.554  AC_DEFUN([AC_LIBTOOL_RC],
   1.555  [AC_REQUIRE([LT_AC_PROG_RC])
   1.556 -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`])
   1.557 +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
   1.558  ])# AC_LIBTOOL_RC
   1.559  
   1.560  
   1.561 @@ -2824,7 +2862,7 @@
   1.562  fi
   1.563  if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
   1.564    AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
   1.565 -  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ 	]]" >/dev/null; then :
   1.566 +  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ 	]]" >/dev/null; then :
   1.567    else
   1.568      AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
   1.569      _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
   1.570 @@ -2851,9 +2889,9 @@
   1.571  AC_LIBTOOL_PROG_CC_C_O($1)
   1.572  AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
   1.573  AC_LIBTOOL_PROG_LD_SHLIBS($1)
   1.574 +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
   1.575  AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
   1.576  AC_LIBTOOL_SYS_LIB_STRIP
   1.577 -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
   1.578  AC_LIBTOOL_DLOPEN_SELF($1)
   1.579  
   1.580  # Report which librarie types wil actually be built
   1.581 @@ -2874,39 +2912,11 @@
   1.582    fi
   1.583    ;;
   1.584  
   1.585 -aix4*)
   1.586 +aix4* | aix5*)
   1.587    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
   1.588      test "$enable_shared" = yes && enable_static=no
   1.589    fi
   1.590 -  ;;
   1.591 -  darwin* | rhapsody*)
   1.592 -  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
   1.593 -    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
   1.594 -    case "$host_os" in
   1.595 -    rhapsody* | darwin1.[[012]])
   1.596 -      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
   1.597 -      ;;
   1.598 -    *) # Darwin 1.3 on
   1.599 -      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
   1.600 -      ;;
   1.601 -    esac
   1.602 -    # FIXME: Relying on posixy $() will cause problems for
   1.603 -    #        cross-compilation, but unfortunately the echo tests do not
   1.604 -    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
   1.605 -    #	       `"' quotes if we put them in here... so don't!
   1.606 -		output_verbose_link_cmd='echo'
   1.607 -    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
   1.608 -    _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
   1.609 -    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
   1.610 -		  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.611 -		  _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.612 -    _LT_AC_TAGVAR(hardcode_direct, $1)=no
   1.613 -    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
   1.614 -    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
   1.615 -    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
   1.616 -    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
   1.617 -    fi
   1.618 -    ;;  
   1.619 +    ;;
   1.620  esac
   1.621  AC_MSG_RESULT([$enable_shared])
   1.622  
   1.623 @@ -3041,7 +3051,7 @@
   1.624      # linker, instead of GNU ld.  If possible, this setting should
   1.625      # overridden to take advantage of the native linker features on
   1.626      # the platform it is being used on.
   1.627 -    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
   1.628 +    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
   1.629    fi
   1.630  
   1.631    # Commands to make compiler produce verbose output that lists
   1.632 @@ -3183,6 +3193,7 @@
   1.633      esac
   1.634      ;;
   1.635  
   1.636 +
   1.637    cygwin* | mingw* | pw32*)
   1.638      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
   1.639      # as there is no search path for DLLs.
   1.640 @@ -3192,9 +3203,17 @@
   1.641      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
   1.642  
   1.643      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
   1.644 +##      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
   1.645        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib'
   1.646        # If the export-symbols file already is a .def file (1st line
   1.647        # is EXPORTS), use it as is; otherwise, prepend...
   1.648 +##      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
   1.649 +##	cp $export_symbols $output_objdir/$soname.def;
   1.650 +##      else
   1.651 +##	echo EXPORTS > $output_objdir/$soname.def;
   1.652 +##	cat $export_symbols >> $output_objdir/$soname.def;
   1.653 +##      fi~
   1.654 +##      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
   1.655        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
   1.656  	cp $export_symbols $output_objdir/$soname.def;
   1.657        else
   1.658 @@ -3206,44 +3225,68 @@
   1.659        _LT_AC_TAGVAR(ld_shlibs, $1)=no
   1.660      fi
   1.661    ;;
   1.662 -
   1.663 -  darwin* | rhapsody*)
   1.664 -   if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
   1.665 -    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
   1.666 -    case "$host_os" in
   1.667 -    rhapsody* | darwin1.[[012]])
   1.668 -      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
   1.669 -      ;;
   1.670 -    *) # Darwin 1.3 on
   1.671 -      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
   1.672 -      ;;
   1.673 -    esac
   1.674 -    	lt_int_apple_cc_single_mod=no
   1.675 -    	output_verbose_link_cmd='echo'
   1.676 -    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
   1.677 -    	  lt_int_apple_cc_single_mod=yes
   1.678 -    	fi
   1.679 -    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
   1.680 -    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
   1.681 -    	else
   1.682 -        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
   1.683 +      darwin* | rhapsody*)
   1.684 +        case "$host_os" in
   1.685 +        rhapsody* | darwin1.[[012]])
   1.686 +         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
   1.687 +         ;;
   1.688 +       *) # Darwin 1.3 on
   1.689 +         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
   1.690 +           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
   1.691 +         else
   1.692 +           case ${MACOSX_DEPLOYMENT_TARGET} in
   1.693 +             10.[[012]])
   1.694 +               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
   1.695 +               ;;
   1.696 +             10.*)
   1.697 +               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
   1.698 +               ;;
   1.699 +           esac
   1.700 +         fi
   1.701 +         ;;
   1.702 +        esac
   1.703 +      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
   1.704 +      _LT_AC_TAGVAR(hardcode_direct, $1)=no
   1.705 +      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
   1.706 +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
   1.707 +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
   1.708 +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
   1.709 +
   1.710 +    if test "$GXX" = yes ; then
   1.711 +      lt_int_apple_cc_single_mod=no
   1.712 +      output_verbose_link_cmd='echo'
   1.713 +      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
   1.714 +       lt_int_apple_cc_single_mod=yes
   1.715        fi
   1.716 -      _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
   1.717 -
   1.718 -    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
   1.719        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
   1.720 -        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.721 +       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
   1.722        else
   1.723 -        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.724 +          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
   1.725 +        fi
   1.726 +        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
   1.727 +        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
   1.728 +          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
   1.729 +            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.730 +          else
   1.731 +            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.732 +          fi
   1.733 +            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.734 +      else
   1.735 +      case "$cc_basename" in
   1.736 +        xlc*)
   1.737 +         output_verbose_link_cmd='echo'
   1.738 +          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
   1.739 +          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
   1.740 +          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
   1.741 +          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.742 +          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.743 +          ;;
   1.744 +       *)
   1.745 +         _LT_AC_TAGVAR(ld_shlibs, $1)=no
   1.746 +          ;;
   1.747 +      esac
   1.748        fi
   1.749 -        _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
   1.750 -    _LT_AC_TAGVAR(hardcode_direct, $1)=no
   1.751 -    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
   1.752 -    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
   1.753 -    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
   1.754 -    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
   1.755 -   fi 
   1.756 -    ;;
   1.757 +        ;;
   1.758  
   1.759    dgux*)
   1.760      case $cc_basename in
   1.761 @@ -3269,7 +3312,7 @@
   1.762    freebsd-elf*)
   1.763      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
   1.764      ;;
   1.765 -  freebsd*)
   1.766 +  freebsd* | kfreebsd*-gnu)
   1.767      # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
   1.768      # conventions
   1.769      _LT_AC_TAGVAR(ld_shlibs, $1)=yes
   1.770 @@ -3300,7 +3343,7 @@
   1.771        # explicitly linking system object files so we need to strip them
   1.772        # from the output so that they don't get included in the library
   1.773        # dependencies.
   1.774 -      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
   1.775 +      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
   1.776        ;;
   1.777      *)
   1.778        if test "$GXX" = yes; then
   1.779 @@ -3449,9 +3492,20 @@
   1.780        icpc)
   1.781  	# Intel C++
   1.782  	with_gnu_ld=yes
   1.783 +	# version 8.0 and above of icpc choke on multiply defined symbols
   1.784 +	# if we add $predep_objects and $postdep_objects, however 7.1 and
   1.785 +	# earlier do not add the objects themselves.
   1.786 +	case `$CC -V 2>&1` in
   1.787 +	*"Version 7."*)
   1.788 +  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
   1.789 +  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
   1.790 +	  ;;
   1.791 +	*)  # Version 8.0 or newer
   1.792 +  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
   1.793 +  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
   1.794 +	  ;;
   1.795 +	esac
   1.796  	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
   1.797 -	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
   1.798 -	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
   1.799  	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
   1.800  	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
   1.801  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
   1.802 @@ -3508,6 +3562,20 @@
   1.803      # Workaround some broken pre-1.5 toolchains
   1.804      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
   1.805      ;;
   1.806 +  openbsd2*)
   1.807 +    # C++ shared libraries are fairly broken
   1.808 +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
   1.809 +    ;;
   1.810 +  openbsd*)
   1.811 +    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
   1.812 +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
   1.813 +    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
   1.814 +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
   1.815 +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
   1.816 +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
   1.817 +    fi
   1.818 +    output_verbose_link_cmd='echo'
   1.819 +    ;;
   1.820    osf3*)
   1.821      case $cc_basename in
   1.822        KCC)
   1.823 @@ -3763,8 +3831,6 @@
   1.824      # FIXME: insert proper C++ library support
   1.825      _LT_AC_TAGVAR(ld_shlibs, $1)=no
   1.826      ;;
   1.827 -  *qnx* | *nto*)
   1.828 -    ;;
   1.829    *)
   1.830      # FIXME: insert proper C++ library support
   1.831      _LT_AC_TAGVAR(ld_shlibs, $1)=no
   1.832 @@ -3785,9 +3851,9 @@
   1.833  AC_LIBTOOL_PROG_CC_C_O($1)
   1.834  AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
   1.835  AC_LIBTOOL_PROG_LD_SHLIBS($1)
   1.836 +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
   1.837  AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
   1.838  AC_LIBTOOL_SYS_LIB_STRIP
   1.839 -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
   1.840  AC_LIBTOOL_DLOPEN_SELF($1)
   1.841  
   1.842  AC_LIBTOOL_CONFIG($1)
   1.843 @@ -4009,7 +4075,7 @@
   1.844      postinstall_cmds='$RANLIB $lib'
   1.845    fi
   1.846    ;;
   1.847 -aix4*)
   1.848 +aix4* | aix5*)
   1.849    test "$enable_shared" = yes && enable_static=no
   1.850    ;;
   1.851  esac
   1.852 @@ -4029,9 +4095,10 @@
   1.853  AC_LIBTOOL_PROG_CC_C_O($1)
   1.854  AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
   1.855  AC_LIBTOOL_PROG_LD_SHLIBS($1)
   1.856 +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
   1.857  AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
   1.858  AC_LIBTOOL_SYS_LIB_STRIP
   1.859 -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
   1.860 +
   1.861  
   1.862  AC_LIBTOOL_CONFIG($1)
   1.863  
   1.864 @@ -4083,9 +4150,9 @@
   1.865  AC_LIBTOOL_PROG_CC_C_O($1)
   1.866  AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
   1.867  AC_LIBTOOL_PROG_LD_SHLIBS($1)
   1.868 +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
   1.869  AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
   1.870  AC_LIBTOOL_SYS_LIB_STRIP
   1.871 -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
   1.872  AC_LIBTOOL_DLOPEN_SELF($1)
   1.873  
   1.874  AC_LIBTOOL_CONFIG($1)
   1.875 @@ -4150,11 +4217,12 @@
   1.876    # without removal of \ escapes.
   1.877    if test -n "${ZSH_VERSION+set}" ; then
   1.878      setopt NO_GLOB_SUBST
   1.879 -  fi  
   1.880 +  fi
   1.881    # Now quote all the things that may contain metacharacters while being
   1.882    # careful not to overquote the AC_SUBSTed values.  We take copies of the
   1.883    # variables and quote the copies for generation of the libtool script.
   1.884 -  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
   1.885 +  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
   1.886 +    SED SHELL STRIP \
   1.887      libname_spec library_names_spec soname_spec extract_expsyms_cmds \
   1.888      old_striplib striplib file_magic_cmd finish_cmds finish_eval \
   1.889      deplibs_check_method reload_flag reload_cmds need_locks \
   1.890 @@ -4204,7 +4272,7 @@
   1.891      _LT_AC_TAGVAR(archive_cmds, $1) | \
   1.892      _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
   1.893      _LT_AC_TAGVAR(module_cmds, $1) | \
   1.894 -    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
   1.895 +    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
   1.896      _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
   1.897      _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
   1.898      extract_expsyms_cmds | reload_cmds | finish_cmds | \
   1.899 @@ -4274,7 +4342,7 @@
   1.900  
   1.901  # The HP-UX ksh and POSIX shell print the target directory to stdout
   1.902  # if CDPATH is set.
   1.903 -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
   1.904 +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
   1.905  
   1.906  # The names of the tagged configurations supported by this script.
   1.907  available_tags=
   1.908 @@ -4335,7 +4403,7 @@
   1.909  NM=$lt_NM
   1.910  
   1.911  # A symbol stripping program
   1.912 -STRIP=$STRIP
   1.913 +STRIP=$lt_STRIP
   1.914  
   1.915  # Used to examine libraries when file_magic_cmd begins "file"
   1.916  MAGIC_CMD=$MAGIC_CMD
   1.917 @@ -4366,7 +4434,7 @@
   1.918  libext="$libext"
   1.919  
   1.920  # Shared library suffix (normally ".so").
   1.921 -shrext='$shrext'
   1.922 +shrext_cmds='$shrext_cmds'
   1.923  
   1.924  # Executable file suffix (normally "").
   1.925  exeext="$exeext"
   1.926 @@ -4610,7 +4678,10 @@
   1.927    # If there is no Makefile yet, we rely on a make rule to execute
   1.928    # `config.status --recheck' to rerun these tests and create the
   1.929    # libtool script then.
   1.930 -  test -f Makefile && make "$ltmain"
   1.931 +  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
   1.932 +  if test -f "$ltmain_in"; then
   1.933 +    test -f Makefile && make "$ltmain"
   1.934 +  fi
   1.935  fi
   1.936  ])# AC_LIBTOOL_CONFIG
   1.937  
   1.938 @@ -4683,7 +4754,7 @@
   1.939    symcode='[[BCDEGQRST]]'
   1.940    ;;
   1.941  solaris* | sysv5*)
   1.942 -  symcode='[[BDT]]'
   1.943 +  symcode='[[BDRT]]'
   1.944    ;;
   1.945  sysv4)
   1.946    symcode='[[DFNSTU]]'
   1.947 @@ -4701,7 +4772,7 @@
   1.948  # If we're using GNU nm, then use its standard symbol codes.
   1.949  case `$NM -V 2>&1` in
   1.950  *GNU* | *'with BFD'*)
   1.951 -  symcode='[[ABCDGISTW]]' ;;
   1.952 +  symcode='[[ABCDGIRSTW]]' ;;
   1.953  esac
   1.954  
   1.955  # Try without a prefix undercore, then with it.
   1.956 @@ -4880,10 +4951,6 @@
   1.957  	;;
   1.958        esac
   1.959        ;;
   1.960 -    *qnx* | *nto*)
   1.961 -      # QNX uses GNU C++, but need to define -shared option too, otherwise it will coredumped.
   1.962 -      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
   1.963 -      ;;
   1.964      *)
   1.965        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
   1.966        ;;
   1.967 @@ -4907,6 +4974,16 @@
   1.968  	  ;;
   1.969  	esac
   1.970  	;;
   1.971 +       darwin*)
   1.972 +         # PIC is the default on this platform
   1.973 +         # Common symbols not allowed in MH_DYLIB files
   1.974 +         case "$cc_basename" in
   1.975 +           xlc*)
   1.976 +           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
   1.977 +           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
   1.978 +           ;;
   1.979 +         esac
   1.980 +       ;;
   1.981        dgux*)
   1.982  	case $cc_basename in
   1.983  	  ec++)
   1.984 @@ -4920,13 +4997,9 @@
   1.985  	    ;;
   1.986  	esac
   1.987  	;;
   1.988 -      freebsd*)
   1.989 +      freebsd* | kfreebsd*-gnu)
   1.990  	# FreeBSD uses GNU C++
   1.991  	;;
   1.992 -      *qnx* | *nto*)
   1.993 -	# QNX uses GNU C++, but need to define -shared option too, otherwise it will coredumped.
   1.994 -        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
   1.995 -        ;;
   1.996        hpux9* | hpux10* | hpux11*)
   1.997  	case $cc_basename in
   1.998  	  CC)
   1.999 @@ -4975,7 +5048,7 @@
  1.1000  	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  1.1001  	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  1.1002  	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
  1.1003 -	    ;; 
  1.1004 +	    ;;
  1.1005  	  cxx)
  1.1006  	    # Compaq C++
  1.1007  	    # Make sure the PIC flag is empty.  It appears that all Alpha
  1.1008 @@ -5147,10 +5220,6 @@
  1.1009  	;;
  1.1010        esac
  1.1011        ;;
  1.1012 -    *qnx* | *nto*)
  1.1013 -      # QNX uses GNU C++, but need to define -shared option too, otherwise it will coredumped.
  1.1014 -      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  1.1015 -      ;;
  1.1016  
  1.1017      *)
  1.1018        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  1.1019 @@ -5168,6 +5237,16 @@
  1.1020  	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
  1.1021        fi
  1.1022        ;;
  1.1023 +      darwin*)
  1.1024 +        # PIC is the default on this platform
  1.1025 +        # Common symbols not allowed in MH_DYLIB files
  1.1026 +       case "$cc_basename" in
  1.1027 +         xlc*)
  1.1028 +         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
  1.1029 +         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  1.1030 +         ;;
  1.1031 +       esac
  1.1032 +       ;;
  1.1033  
  1.1034      mingw* | pw32* | os2*)
  1.1035        # This hack is so that the source file can tell whether it is being
  1.1036 @@ -5191,11 +5270,6 @@
  1.1037        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
  1.1038        ;;
  1.1039  
  1.1040 -    *qnx* | *nto*)
  1.1041 -      # QNX uses GNU C++, but need to define -shared option too, otherwise it will coredumped.
  1.1042 -      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  1.1043 -      ;;
  1.1044 -
  1.1045      irix5* | irix6* | nonstopux*)
  1.1046        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  1.1047        # PIC (with -KPIC) is the default.
  1.1048 @@ -5209,12 +5283,12 @@
  1.1049  
  1.1050      linux*)
  1.1051        case $CC in
  1.1052 -      icc|ecc)
  1.1053 +      icc* | ecc*)
  1.1054  	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  1.1055  	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  1.1056  	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
  1.1057          ;;
  1.1058 -      ccc)
  1.1059 +      ccc*)
  1.1060          _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  1.1061          # All Alpha code is PIC.
  1.1062          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  1.1063 @@ -5344,7 +5418,7 @@
  1.1064    _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
  1.1065    _LT_AC_TAGVAR(hardcode_automatic, $1)=no
  1.1066    _LT_AC_TAGVAR(module_cmds, $1)=
  1.1067 -  _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
  1.1068 +  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
  1.1069    _LT_AC_TAGVAR(always_export_symbols, $1)=no
  1.1070    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
  1.1071    # include_expsyms should be a list of space-separated symbols to be *always*
  1.1072 @@ -5434,9 +5508,17 @@
  1.1073        _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
  1.1074  
  1.1075        if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
  1.1076 +##        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
  1.1077          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib'
  1.1078  	# If the export-symbols file already is a .def file (1st line
  1.1079  	# is EXPORTS), use it as is; otherwise, prepend...
  1.1080 +##	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  1.1081 +##	  cp $export_symbols $output_objdir/$soname.def;
  1.1082 +##	else
  1.1083 +##	  echo EXPORTS > $output_objdir/$soname.def;
  1.1084 +##	  cat $export_symbols >> $output_objdir/$soname.def;
  1.1085 +##	fi~
  1.1086 +##	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
  1.1087  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  1.1088  	  cp $export_symbols $output_objdir/$soname.def;
  1.1089  	else
  1.1090 @@ -5487,6 +5569,31 @@
  1.1091        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  1.1092        ;;
  1.1093  
  1.1094 +  linux*)
  1.1095 +    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  1.1096 +        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  1.1097 +	_LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
  1.1098 +      supports_anon_versioning=no
  1.1099 +      case `$LD -v 2>/dev/null` in
  1.1100 +        *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
  1.1101 +        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
  1.1102 +        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
  1.1103 +        *\ 2.11.*) ;; # other 2.11 versions
  1.1104 +        *) supports_anon_versioning=yes ;;
  1.1105 +      esac
  1.1106 +      if test $supports_anon_versioning = yes; then
  1.1107 +        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
  1.1108 +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
  1.1109 +$echo "local: *; };" >> $output_objdir/$libname.ver~
  1.1110 +        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
  1.1111 +      else
  1.1112 +        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
  1.1113 +      fi
  1.1114 +    else
  1.1115 +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
  1.1116 +    fi
  1.1117 +    ;;
  1.1118 +
  1.1119      *)
  1.1120        if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  1.1121  	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  1.1122 @@ -5649,7 +5756,7 @@
  1.1123        _LT_AC_TAGVAR(ld_shlibs, $1)=no
  1.1124        ;;
  1.1125  
  1.1126 -    bsdi4*)
  1.1127 +    bsdi[[45]]*)
  1.1128        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
  1.1129        ;;
  1.1130  
  1.1131 @@ -5663,7 +5770,7 @@
  1.1132        # Tell ltmain to make .lib files, not .a files.
  1.1133        libext=lib
  1.1134        # Tell ltmain to make .dll files, not .so files.
  1.1135 -      shrext=".dll"
  1.1136 +      shrext_cmds=".dll"
  1.1137        # FIXME: Setting linknames here is a bad hack.
  1.1138        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
  1.1139        # The linker will automatically build a .lib file if we build a DLL.
  1.1140 @@ -5675,44 +5782,53 @@
  1.1141        ;;
  1.1142  
  1.1143      darwin* | rhapsody*)
  1.1144 -    if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
  1.1145 +      case "$host_os" in
  1.1146 +        rhapsody* | darwin1.[[012]])
  1.1147 +         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
  1.1148 +         ;;
  1.1149 +       *) # Darwin 1.3 on
  1.1150 +         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
  1.1151 +           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
  1.1152 +         else
  1.1153 +           case ${MACOSX_DEPLOYMENT_TARGET} in
  1.1154 +             10.[[012]])
  1.1155 +               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
  1.1156 +               ;;
  1.1157 +             10.*)
  1.1158 +               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
  1.1159 +               ;;
  1.1160 +           esac
  1.1161 +         fi
  1.1162 +         ;;
  1.1163 +      esac
  1.1164        _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  1.1165 -      case "$host_os" in
  1.1166 -      rhapsody* | darwin1.[[012]])
  1.1167 -	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
  1.1168 -	;;
  1.1169 -      *) # Darwin 1.3 on
  1.1170 -	test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
  1.1171 -	;;
  1.1172 -      esac
  1.1173 -      # FIXME: Relying on posixy $() will cause problems for
  1.1174 -      #        cross-compilation, but unfortunately the echo tests do not
  1.1175 -      #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
  1.1176 -      #	       `"' quotes if we put them in here... so don't!
  1.1177 -    	lt_int_apple_cc_single_mod=no
  1.1178 -    	output_verbose_link_cmd='echo'
  1.1179 -    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
  1.1180 -    	  lt_int_apple_cc_single_mod=yes
  1.1181 -    	fi
  1.1182 -    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
  1.1183 -    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
  1.1184 -    	else
  1.1185 -        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
  1.1186 -      fi
  1.1187 -      _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
  1.1188 -      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
  1.1189 -        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
  1.1190 -          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  1.1191 -        else
  1.1192 -          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  1.1193 -        fi
  1.1194 -          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  1.1195        _LT_AC_TAGVAR(hardcode_direct, $1)=no
  1.1196        _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
  1.1197        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  1.1198 -      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
  1.1199 +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
  1.1200        _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  1.1201 -    fi  
  1.1202 +    if test "$GCC" = yes ; then
  1.1203 +    	output_verbose_link_cmd='echo'
  1.1204 +        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
  1.1205 +      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
  1.1206 +      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
  1.1207 +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  1.1208 +      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  1.1209 +    else
  1.1210 +      case "$cc_basename" in
  1.1211 +        xlc*)
  1.1212 +         output_verbose_link_cmd='echo'
  1.1213 +         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
  1.1214 +         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
  1.1215 +          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
  1.1216 +         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  1.1217 +          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  1.1218 +          ;;
  1.1219 +       *)
  1.1220 +         _LT_AC_TAGVAR(ld_shlibs, $1)=no
  1.1221 +          ;;
  1.1222 +      esac
  1.1223 +    fi
  1.1224        ;;
  1.1225  
  1.1226      dgux*)
  1.1227 @@ -5745,7 +5861,7 @@
  1.1228        ;;
  1.1229  
  1.1230      # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  1.1231 -    freebsd*)
  1.1232 +    freebsd* | kfreebsd*-gnu)
  1.1233        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
  1.1234        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  1.1235        _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  1.1236 @@ -5856,6 +5972,7 @@
  1.1237        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  1.1238        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  1.1239  	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  1.1240 +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
  1.1241  	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  1.1242  	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  1.1243        else
  1.1244 @@ -6062,7 +6179,7 @@
  1.1245        AC_MSG_CHECKING([whether -lc should be explicitly linked in])
  1.1246        $rm conftest*
  1.1247        printf "$lt_simple_compile_test_code" > conftest.$ac_ext
  1.1248 -  
  1.1249 +
  1.1250        if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
  1.1251          soname=conftest
  1.1252          lib=conftest
  1.1253 @@ -6221,7 +6338,7 @@
  1.1254      fi
  1.1255    done
  1.1256  done
  1.1257 +])
  1.1258  SED=$lt_cv_path_SED
  1.1259 -])
  1.1260  AC_MSG_RESULT([$SED])
  1.1261  ])
     2.1 --- a/ltmain.sh	Sat Aug 21 14:54:49 2004 +0000
     2.2 +++ b/ltmain.sh	Sat Aug 21 20:35:50 2004 +0000
     2.3 @@ -1,7 +1,8 @@
     2.4 +# Based on libtool-1.5.8
     2.5  # ltmain.sh - Provide generalized library-building support services.
     2.6  # NOTE: Changing this file will not affect anything until you rerun configure.
     2.7  #
     2.8 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
     2.9 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
    2.10  # Free Software Foundation, Inc.
    2.11  # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    2.12  #
    2.13 @@ -24,6 +25,34 @@
    2.14  # configuration script generated by Autoconf, you may include it under
    2.15  # the same distribution terms that you use for the rest of that program.
    2.16  
    2.17 +basename="s,^.*/,,g"
    2.18 +
    2.19 +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
    2.20 +# is ksh but when the shell is invoked as "sh" and the current value of
    2.21 +# the _XPG environment variable is not equal to 1 (one), the special
    2.22 +# positional parameter $0, within a function call, is the name of the
    2.23 +# function.
    2.24 +progpath="$0"
    2.25 +
    2.26 +# The name of this program:
    2.27 +progname=`echo "$progpath" | $SED $basename`
    2.28 +modename="$progname"
    2.29 +
    2.30 +# Global variables:
    2.31 +EXIT_SUCCESS=0
    2.32 +EXIT_FAILURE=1
    2.33 +
    2.34 +PROGRAM=ltmain.sh
    2.35 +PACKAGE=libtool
    2.36 +VERSION=1.5.8
    2.37 +TIMESTAMP=" (1.1220.2.117 2004/08/04 14:12:05)"
    2.38 +
    2.39 +# See if we are running on zsh, and set the options which allow our
    2.40 +# commands through without removal of \ escapes.
    2.41 +if test -n "${ZSH_VERSION+set}" ; then
    2.42 +  setopt NO_GLOB_SUBST
    2.43 +fi
    2.44 +
    2.45  # Check that we have a working $echo.
    2.46  if test "X$1" = X--no-reexec; then
    2.47    # Discard the --no-reexec flag, and continue.
    2.48 @@ -36,7 +65,7 @@
    2.49    :
    2.50  else
    2.51    # Restart under the correct shell, and then maybe $echo will work.
    2.52 -  exec $SHELL "$0" --no-reexec ${1+"$@"}
    2.53 +  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
    2.54  fi
    2.55  
    2.56  if test "X$1" = X--fallback-echo; then
    2.57 @@ -45,19 +74,9 @@
    2.58    cat <<EOF
    2.59  $*
    2.60  EOF
    2.61 -  exit 0
    2.62 +  exit $EXIT_SUCCESS
    2.63  fi
    2.64  
    2.65 -# The name of this program.
    2.66 -progname=`$echo "$0" | ${SED} 's%^.*/%%'`
    2.67 -modename="$progname"
    2.68 -
    2.69 -# Constants.
    2.70 -PROGRAM=ltmain.sh
    2.71 -PACKAGE=libtool
    2.72 -VERSION=1.5
    2.73 -TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)"
    2.74 -
    2.75  default_mode=
    2.76  help="Try \`$progname --help' for more information."
    2.77  magic="%%%MAGIC variable%%%"
    2.78 @@ -70,8 +89,8 @@
    2.79  Xsed="${SED}"' -e 1s/^X//'
    2.80  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
    2.81  # test EBCDIC or ASCII
    2.82 -case `echo A|od -x` in
    2.83 - *[Cc]1*) # EBCDIC based system
    2.84 +case `echo A|tr A '\301'` in
    2.85 + A) # EBCDIC based system
    2.86    SP2NL="tr '\100' '\n'"
    2.87    NL2SP="tr '\r\n' '\100\100'"
    2.88    ;;
    2.89 @@ -94,12 +113,13 @@
    2.90  fi
    2.91  
    2.92  # Make sure IFS has a sensible default
    2.93 -: ${IFS=" 	"}
    2.94 +: ${IFS=" 	
    2.95 +"}
    2.96  
    2.97  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
    2.98    $echo "$modename: not configured to build any kind of library" 1>&2
    2.99    $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
   2.100 -  exit 1
   2.101 +  exit $EXIT_FAILURE
   2.102  fi
   2.103  
   2.104  # Global variables.
   2.105 @@ -118,10 +138,13 @@
   2.106  # Shell function definitions:
   2.107  # This seems to be the best place for them
   2.108  
   2.109 +# func_win32_libid arg
   2.110 +# return the library type of file 'arg'
   2.111 +#
   2.112  # Need a lot of goo to handle *both* DLLs and import libs
   2.113  # Has to be a shell function in order to 'eat' the argument
   2.114  # that is supplied when $file_magic_command is called.
   2.115 -win32_libid () {
   2.116 +func_win32_libid () {
   2.117    win32_libid_type="unknown"
   2.118    win32_fileres=`file -L $1 2>/dev/null`
   2.119    case $win32_fileres in
   2.120 @@ -130,7 +153,7 @@
   2.121      ;;
   2.122    *ar\ archive*) # could be an import, or static
   2.123      if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
   2.124 -      grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
   2.125 +      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
   2.126        win32_nmres=`eval $NM -f posix -A $1 | \
   2.127  	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
   2.128        if test "X$win32_nmres" = "Ximport" ; then
   2.129 @@ -140,7 +163,7 @@
   2.130        fi
   2.131      fi
   2.132      ;;
   2.133 -  *DLL*) 
   2.134 +  *DLL*)
   2.135      win32_libid_type="x86 DLL"
   2.136      ;;
   2.137    *executable*) # but shell scripts are "executable" too...
   2.138 @@ -154,9 +177,192 @@
   2.139    $echo $win32_libid_type
   2.140  }
   2.141  
   2.142 +
   2.143 +# func_infer_tag arg
   2.144 +# Infer tagged configuration to use if any are available and
   2.145 +# if one wasn't chosen via the "--tag" command line option.
   2.146 +# Only attempt this if the compiler in the base compile
   2.147 +# command doesn't match the default compiler.
   2.148 +# arg is usually of the form 'gcc ...'
   2.149 +func_infer_tag () {
   2.150 +    if test -n "$available_tags" && test -z "$tagname"; then
   2.151 +      CC_quoted=
   2.152 +      for arg in $CC; do
   2.153 +	case $arg in
   2.154 +	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   2.155 +	  arg="\"$arg\""
   2.156 +	  ;;
   2.157 +	esac
   2.158 +	CC_quoted="$CC_quoted $arg"
   2.159 +      done
   2.160 +      case $@ in
   2.161 +      # Blanks in the command may have been stripped by the calling shell,
   2.162 +      # but not from the CC environment variable when configure was run.
   2.163 +      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
   2.164 +      # Blanks at the start of $base_compile will cause this to fail
   2.165 +      # if we don't check for them as well.
   2.166 +      *)
   2.167 +	for z in $available_tags; do
   2.168 +	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
   2.169 +	    # Evaluate the configuration.
   2.170 +	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
   2.171 +	    CC_quoted=
   2.172 +	    for arg in $CC; do
   2.173 +	    # Double-quote args containing other shell metacharacters.
   2.174 +	    case $arg in
   2.175 +	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   2.176 +	      arg="\"$arg\""
   2.177 +	      ;;
   2.178 +	    esac
   2.179 +	    CC_quoted="$CC_quoted $arg"
   2.180 +	  done
   2.181 +	    case "$@ " in
   2.182 +	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
   2.183 +	      # The compiler in the base compile command matches
   2.184 +	      # the one in the tagged configuration.
   2.185 +	      # Assume this is the tagged configuration we want.
   2.186 +	      tagname=$z
   2.187 +	      break
   2.188 +	      ;;
   2.189 +	    esac
   2.190 +	  fi
   2.191 +	done
   2.192 +	# If $tagname still isn't set, then no tagged configuration
   2.193 +	# was found and let the user know that the "--tag" command
   2.194 +	# line option must be used.
   2.195 +	if test -z "$tagname"; then
   2.196 +	  $echo "$modename: unable to infer tagged configuration"
   2.197 +	  $echo "$modename: specify a tag with \`--tag'" 1>&2
   2.198 +	  exit $EXIT_FAILURE
   2.199 +#        else
   2.200 +#          $echo "$modename: using $tagname tagged configuration"
   2.201 +	fi
   2.202 +	;;
   2.203 +      esac
   2.204 +    fi
   2.205 +}
   2.206 +
   2.207 +
   2.208 +# func_extract_archives gentop oldlib ...
   2.209 +func_extract_archives () {
   2.210 +    my_gentop="$1"; shift
   2.211 +    my_oldlibs=${1+"$@"}
   2.212 +    my_oldobjs=""
   2.213 +    my_xlib=""
   2.214 +    my_xabs=""
   2.215 +    my_xdir=""
   2.216 +    my_status=""
   2.217 +
   2.218 +    $show "${rm}r $my_gentop"
   2.219 +    $run ${rm}r "$my_gentop"
   2.220 +    $show "$mkdir $my_gentop"
   2.221 +    $run $mkdir "$my_gentop"
   2.222 +    my_status=$?
   2.223 +    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
   2.224 +      exit $my_status
   2.225 +    fi
   2.226 +
   2.227 +    for my_xlib in $my_oldlibs; do
   2.228 +      # Extract the objects.
   2.229 +      case $my_xlib in
   2.230 +	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
   2.231 +	*) my_xabs=`pwd`"/$my_xlib" ;;
   2.232 +      esac
   2.233 +      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
   2.234 +      my_xdir="$my_gentop/$my_xlib"
   2.235 +
   2.236 +      $show "${rm}r $my_xdir"
   2.237 +      $run ${rm}r "$my_xdir"
   2.238 +      $show "$mkdir $my_xdir"
   2.239 +      $run $mkdir "$my_xdir"
   2.240 +      status=$?
   2.241 +      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
   2.242 +	exit $status
   2.243 +      fi
   2.244 +      case $host in
   2.245 +      *-darwin*)
   2.246 +	$show "Extracting $my_xabs"
   2.247 +	# Do not bother doing anything if just a dry run
   2.248 +	if test -z "$run"; then
   2.249 +	  darwin_orig_dir=`pwd`
   2.250 +	  cd $my_xdir || exit $?
   2.251 +	  darwin_archive=$my_xabs
   2.252 +	  darwin_curdir=`pwd`
   2.253 +	  darwin_base_archive=`basename $darwin_archive`
   2.254 +	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
   2.255 +	  if test -n "$darwin_arches"; then 
   2.256 +	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
   2.257 +	    darwin_arch=
   2.258 +	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
   2.259 +	    for darwin_arch in  $darwin_arches ; do
   2.260 +	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
   2.261 +	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
   2.262 +	      # Remove the table of contents from the thin files.
   2.263 +	      $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
   2.264 +	      $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
   2.265 +	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
   2.266 +	      $AR -xo "${darwin_base_archive}"
   2.267 +	      rm "${darwin_base_archive}"
   2.268 +	      cd "$darwin_curdir"
   2.269 +	    done # $darwin_arches
   2.270 +      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
   2.271 +	    darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
   2.272 +	    darwin_file=
   2.273 +	    darwin_files=
   2.274 +	    for darwin_file in $darwin_filelist; do
   2.275 +	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
   2.276 +	      lipo -create -output "$darwin_file" $darwin_files
   2.277 +	    done # $darwin_filelist
   2.278 +	    rm -rf unfat-$$
   2.279 +	    cd "$darwin_orig_dir"
   2.280 +	  else
   2.281 +	    cd $darwin_orig_dir
   2.282 +	    (cd $my_xdir && $AR x $my_xabs) || exit $?
   2.283 +	  fi # $darwin_arches
   2.284 +	fi # $run
   2.285 +      ;;
   2.286 +      *)
   2.287 +	# We will extract separately just the conflicting names and we will
   2.288 +	# no longer touch any unique names. It is faster to leave these
   2.289 +	# extract automatically by $AR in one run.
   2.290 +	$show "(cd $my_xdir && $AR x $my_xabs)"
   2.291 +	$run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
   2.292 +	if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
   2.293 +	  :
   2.294 +	else
   2.295 +	  $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
   2.296 +	  $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
   2.297 +	  $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
   2.298 +	  do
   2.299 +	    i=1
   2.300 +	    while test "$i" -le "$count"
   2.301 +	    do
   2.302 +	      # Put our $i before any first dot (extension)
   2.303 +	      # Never overwrite any file
   2.304 +	      name_to="$name"
   2.305 +	      while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
   2.306 +	      do
   2.307 +		name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
   2.308 +	      done
   2.309 +	      $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
   2.310 +	      $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
   2.311 +	      i=`expr $i + 1`
   2.312 +	    done
   2.313 +	  done
   2.314 +	fi
   2.315 +	;;
   2.316 +      esac
   2.317 +      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
   2.318 +    done
   2.319 +
   2.320 +    func_extract_archives_result="$my_oldobjs"
   2.321 +}
   2.322  # End of Shell function definitions
   2.323  #####################################
   2.324  
   2.325 +# Darwin sucks
   2.326 +eval std_shrext=\"$shrext_cmds\"
   2.327 +
   2.328  # Parse our command line options once, thoroughly.
   2.329  while test "$#" -gt 0
   2.330  do
   2.331 @@ -176,12 +382,13 @@
   2.332        ;;
   2.333      tag)
   2.334        tagname="$arg"
   2.335 +      preserve_args="${preserve_args}=$arg"
   2.336  
   2.337        # Check whether tagname contains only valid characters
   2.338        case $tagname in
   2.339        *[!-_A-Za-z0-9,/]*)
   2.340  	$echo "$progname: invalid tag name: $tagname" 1>&2
   2.341 -	exit 1
   2.342 +	exit $EXIT_FAILURE
   2.343  	;;
   2.344        esac
   2.345  
   2.346 @@ -191,10 +398,10 @@
   2.347  	# not specially marked.
   2.348  	;;
   2.349        *)
   2.350 -	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
   2.351 +	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
   2.352  	  taglist="$taglist $tagname"
   2.353  	  # Evaluate the configuration.
   2.354 -	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
   2.355 +	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
   2.356  	else
   2.357  	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
   2.358  	fi
   2.359 @@ -223,21 +430,22 @@
   2.360      $echo "Copyright (C) 2003  Free Software Foundation, Inc."
   2.361      $echo "This is free software; see the source for copying conditions.  There is NO"
   2.362      $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
   2.363 -    exit 0
   2.364 +    exit $EXIT_SUCCESS
   2.365      ;;
   2.366  
   2.367    --config)
   2.368 -    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
   2.369 +    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
   2.370      # Now print the configurations for the tags.
   2.371      for tagname in $taglist; do
   2.372 -      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
   2.373 +      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
   2.374      done
   2.375 -    exit 0
   2.376 +    exit $EXIT_SUCCESS
   2.377      ;;
   2.378  
   2.379    --debug)
   2.380      $echo "$progname: enabling shell trace mode"
   2.381      set -x
   2.382 +    preserve_args="$preserve_args $arg"
   2.383      ;;
   2.384  
   2.385    --dry-run | -n)
   2.386 @@ -256,7 +464,7 @@
   2.387      else
   2.388        $echo "disable static libraries"
   2.389      fi
   2.390 -    exit 0
   2.391 +    exit $EXIT_SUCCESS
   2.392      ;;
   2.393  
   2.394    --finish) mode="finish" ;;
   2.395 @@ -268,6 +476,7 @@
   2.396  
   2.397    --quiet | --silent)
   2.398      show=:
   2.399 +    preserve_args="$preserve_args $arg"
   2.400      ;;
   2.401  
   2.402    --tag) prevopt="--tag" prev=tag ;;
   2.403 @@ -275,6 +484,7 @@
   2.404      set tag "$optarg" ${1+"$@"}
   2.405      shift
   2.406      prev=tag
   2.407 +    preserve_args="$preserve_args --tag"
   2.408      ;;
   2.409  
   2.410    -dlopen)
   2.411 @@ -285,7 +495,7 @@
   2.412    -*)
   2.413      $echo "$modename: unrecognized option \`$arg'" 1>&2
   2.414      $echo "$help" 1>&2
   2.415 -    exit 1
   2.416 +    exit $EXIT_FAILURE
   2.417      ;;
   2.418  
   2.419    *)
   2.420 @@ -298,7 +508,7 @@
   2.421  if test -n "$prevopt"; then
   2.422    $echo "$modename: option \`$prevopt' requires an argument" 1>&2
   2.423    $echo "$help" 1>&2
   2.424 -  exit 1
   2.425 +  exit $EXIT_FAILURE
   2.426  fi
   2.427  
   2.428  # If this variable is set in any of the actions, the command in it
   2.429 @@ -354,7 +564,7 @@
   2.430    if test -n "$execute_dlfiles" && test "$mode" != execute; then
   2.431      $echo "$modename: unrecognized option \`-dlopen'" 1>&2
   2.432      $echo "$help" 1>&2
   2.433 -    exit 1
   2.434 +    exit $EXIT_FAILURE
   2.435    fi
   2.436  
   2.437    # Change the help message to a mode-specific one.
   2.438 @@ -369,9 +579,11 @@
   2.439      # Get the compilation command and the source file.
   2.440      base_compile=
   2.441      srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
   2.442 +    suppress_opt=yes
   2.443      suppress_output=
   2.444      arg_mode=normal
   2.445      libobj=
   2.446 +    later=
   2.447  
   2.448      for arg
   2.449      do
   2.450 @@ -394,24 +606,19 @@
   2.451  	-o)
   2.452  	  if test -n "$libobj" ; then
   2.453  	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
   2.454 -	    exit 1
   2.455 +	    exit $EXIT_FAILURE
   2.456  	  fi
   2.457  	  arg_mode=target
   2.458  	  continue
   2.459  	  ;;
   2.460  
   2.461 -	-static)
   2.462 -	  build_old_libs=yes
   2.463 +	-static | -prefer-pic | -prefer-non-pic)
   2.464 +	  later="$later $arg"
   2.465  	  continue
   2.466  	  ;;
   2.467  
   2.468 -	-prefer-pic)
   2.469 -	  pic_mode=yes
   2.470 -	  continue
   2.471 -	  ;;
   2.472 -
   2.473 -	-prefer-non-pic)
   2.474 -	  pic_mode=no
   2.475 +	-no-suppress)
   2.476 +	  suppress_opt=no
   2.477  	  continue
   2.478  	  ;;
   2.479  
   2.480 @@ -424,7 +631,7 @@
   2.481  	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
   2.482  	  lastarg=
   2.483  	  save_ifs="$IFS"; IFS=','
   2.484 -	  for arg in $args; do
   2.485 + 	  for arg in $args; do
   2.486  	    IFS="$save_ifs"
   2.487  
   2.488  	    # Double-quote args containing other shell metacharacters.
   2.489 @@ -474,11 +681,11 @@
   2.490      case $arg_mode in
   2.491      arg)
   2.492        $echo "$modename: you must specify an argument for -Xcompile"
   2.493 -      exit 1
   2.494 +      exit $EXIT_FAILURE
   2.495        ;;
   2.496      target)
   2.497        $echo "$modename: you must specify a target with \`-o'" 1>&2
   2.498 -      exit 1
   2.499 +      exit $EXIT_FAILURE
   2.500        ;;
   2.501      *)
   2.502        # Get the name of the library object.
   2.503 @@ -511,50 +718,30 @@
   2.504      *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
   2.505      *)
   2.506        $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
   2.507 -      exit 1
   2.508 +      exit $EXIT_FAILURE
   2.509        ;;
   2.510      esac
   2.511  
   2.512 -    # Infer tagged configuration to use if any are available and
   2.513 -    # if one wasn't chosen via the "--tag" command line option.
   2.514 -    # Only attempt this if the compiler in the base compile
   2.515 -    # command doesn't match the default compiler.
   2.516 -    if test -n "$available_tags" && test -z "$tagname"; then
   2.517 -      case $base_compile in
   2.518 -      # Blanks in the command may have been stripped by the calling shell,
   2.519 -      # but not from the CC environment variable when configure was run.
   2.520 -      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
   2.521 -      # Blanks at the start of $base_compile will cause this to fail
   2.522 -      # if we don't check for them as well.
   2.523 -      *)
   2.524 -	for z in $available_tags; do
   2.525 -	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
   2.526 -	    # Evaluate the configuration.
   2.527 -	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
   2.528 -	    case "$base_compile " in
   2.529 -	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
   2.530 -	      # The compiler in the base compile command matches
   2.531 -	      # the one in the tagged configuration.
   2.532 -	      # Assume this is the tagged configuration we want.
   2.533 -	      tagname=$z
   2.534 -	      break
   2.535 -	      ;;
   2.536 -	    esac
   2.537 -	  fi
   2.538 -	done
   2.539 -	# If $tagname still isn't set, then no tagged configuration
   2.540 -	# was found and let the user know that the "--tag" command
   2.541 -	# line option must be used.
   2.542 -	if test -z "$tagname"; then
   2.543 -	  $echo "$modename: unable to infer tagged configuration"
   2.544 -	  $echo "$modename: specify a tag with \`--tag'" 1>&2
   2.545 -	  exit 1
   2.546 -#        else
   2.547 -#          $echo "$modename: using $tagname tagged configuration"
   2.548 -	fi
   2.549 +    func_infer_tag $base_compile
   2.550 +
   2.551 +    for arg in $later; do
   2.552 +      case $arg in
   2.553 +      -static)
   2.554 +	build_old_libs=yes
   2.555 +	continue
   2.556 +	;;
   2.557 +
   2.558 +      -prefer-pic)
   2.559 +	pic_mode=yes
   2.560 +	continue
   2.561 +	;;
   2.562 +
   2.563 +      -prefer-non-pic)
   2.564 +	pic_mode=no
   2.565 +	continue
   2.566  	;;
   2.567        esac
   2.568 -    fi
   2.569 +    done
   2.570  
   2.571      objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
   2.572      xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
   2.573 @@ -568,7 +755,7 @@
   2.574      if test -z "$base_compile"; then
   2.575        $echo "$modename: you must specify a compilation command" 1>&2
   2.576        $echo "$help" 1>&2
   2.577 -      exit 1
   2.578 +      exit $EXIT_FAILURE
   2.579      fi
   2.580  
   2.581      # Delete any leftover library objects.
   2.582 @@ -579,7 +766,7 @@
   2.583      fi
   2.584  
   2.585      $run $rm $removelist
   2.586 -    trap "$run $rm $removelist; exit 1" 1 2 15
   2.587 +    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
   2.588  
   2.589      # On Cygwin there's no "real" PIC flag so we must build both object types
   2.590      case $host_os in
   2.591 @@ -598,7 +785,7 @@
   2.592        output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
   2.593        lockfile="$output_obj.lock"
   2.594        removelist="$removelist $output_obj $lockfile"
   2.595 -      trap "$run $rm $removelist; exit 1" 1 2 15
   2.596 +      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
   2.597      else
   2.598        output_obj=
   2.599        need_locks=no
   2.600 @@ -608,7 +795,7 @@
   2.601      # Lock this critical section if it is needed
   2.602      # We use this script file to make the link, it avoids creating a new file
   2.603      if test "$need_locks" = yes; then
   2.604 -      until $run ln "$0" "$lockfile" 2>/dev/null; do
   2.605 +      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
   2.606  	$show "Waiting for $lockfile to be removed"
   2.607  	sleep 2
   2.608        done
   2.609 @@ -626,7 +813,7 @@
   2.610  compiler."
   2.611  
   2.612  	$run $rm $removelist
   2.613 -	exit 1
   2.614 +	exit $EXIT_FAILURE
   2.615        fi
   2.616        $echo $srcfile > "$lockfile"
   2.617      fi
   2.618 @@ -681,7 +868,7 @@
   2.619        if $run eval "$command"; then :
   2.620        else
   2.621  	test -n "$output_obj" && $run $rm $removelist
   2.622 -	exit 1
   2.623 +	exit $EXIT_FAILURE
   2.624        fi
   2.625  
   2.626        if test "$need_locks" = warn &&
   2.627 @@ -701,7 +888,7 @@
   2.628  compiler."
   2.629  
   2.630  	$run $rm $removelist
   2.631 -	exit 1
   2.632 +	exit $EXIT_FAILURE
   2.633        fi
   2.634  
   2.635        # Just move the object if needed, then go on to compile the next one
   2.636 @@ -722,7 +909,9 @@
   2.637  EOF
   2.638  
   2.639        # Allow error messages only from the first compilation.
   2.640 -      suppress_output=' >/dev/null 2>&1'
   2.641 +      if test "$suppress_opt" = yes; then
   2.642 +        suppress_output=' >/dev/null 2>&1'
   2.643 +      fi
   2.644      else
   2.645        # No PIC object so indicate it doesn't exist in the libtool
   2.646        # object file.
   2.647 @@ -751,7 +940,7 @@
   2.648        if $run eval "$command"; then :
   2.649        else
   2.650  	$run $rm $removelist
   2.651 -	exit 1
   2.652 +	exit $EXIT_FAILURE
   2.653        fi
   2.654  
   2.655        if test "$need_locks" = warn &&
   2.656 @@ -771,7 +960,7 @@
   2.657  compiler."
   2.658  
   2.659  	$run $rm $removelist
   2.660 -	exit 1
   2.661 +	exit $EXIT_FAILURE
   2.662        fi
   2.663  
   2.664        # Just move the object if needed
   2.665 @@ -809,7 +998,7 @@
   2.666        $run $rm "$lockfile"
   2.667      fi
   2.668  
   2.669 -    exit 0
   2.670 +    exit $EXIT_SUCCESS
   2.671      ;;
   2.672  
   2.673    # libtool link mode
   2.674 @@ -835,7 +1024,7 @@
   2.675        ;;
   2.676      esac
   2.677      libtool_args="$nonopt"
   2.678 -    base_compile="$nonopt"
   2.679 +    base_compile="$nonopt $@"
   2.680      compile_command="$nonopt"
   2.681      finalize_command="$nonopt"
   2.682  
   2.683 @@ -867,6 +1056,7 @@
   2.684      no_install=no
   2.685      objs=
   2.686      non_pic_objects=
   2.687 +    precious_files_regex=
   2.688      prefer_static_libs=no
   2.689      preload=no
   2.690      prev=
   2.691 @@ -880,6 +1070,8 @@
   2.692      vinfo=
   2.693      vinfo_number=no
   2.694  
   2.695 +    func_infer_tag $base_compile
   2.696 +
   2.697      # We need to know -static, to get the right output filenames.
   2.698      for arg
   2.699      do
   2.700 @@ -911,7 +1103,6 @@
   2.701      # Go through the arguments, transforming them on the way.
   2.702      while test "$#" -gt 0; do
   2.703        arg="$1"
   2.704 -      base_compile="$base_compile $arg"
   2.705        shift
   2.706        case $arg in
   2.707        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   2.708 @@ -975,7 +1166,7 @@
   2.709  	  export_symbols="$arg"
   2.710  	  if test ! -f "$arg"; then
   2.711  	    $echo "$modename: symbol file \`$arg' does not exist"
   2.712 -	    exit 1
   2.713 +	    exit $EXIT_FAILURE
   2.714  	  fi
   2.715  	  prev=
   2.716  	  continue
   2.717 @@ -990,6 +1181,11 @@
   2.718  	  prev=
   2.719  	  continue
   2.720  	  ;;
   2.721 +	precious_regex)
   2.722 +	  precious_files_regex="$arg"
   2.723 +	  prev=
   2.724 +	  continue
   2.725 +	  ;;
   2.726  	release)
   2.727  	  release="-$arg"
   2.728  	  prev=
   2.729 @@ -1022,7 +1218,7 @@
   2.730  		   test "$pic_object" = none && \
   2.731  		   test "$non_pic_object" = none; then
   2.732  		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
   2.733 -		  exit 1
   2.734 +		  exit $EXIT_FAILURE
   2.735  		fi
   2.736  
   2.737  		# Extract subdirectory from the argument.
   2.738 @@ -1075,7 +1271,7 @@
   2.739  		# Only an error if not doing a dry-run.
   2.740  		if test -z "$run"; then
   2.741  		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
   2.742 -		  exit 1
   2.743 +		  exit $EXIT_FAILURE
   2.744  		else
   2.745  		  # Dry-run case.
   2.746  
   2.747 @@ -1096,7 +1292,7 @@
   2.748  	    done
   2.749  	  else
   2.750  	    $echo "$modename: link input file \`$save_arg' does not exist"
   2.751 -	    exit 1
   2.752 +	    exit $EXIT_FAILURE
   2.753  	  fi
   2.754  	  arg=$save_arg
   2.755  	  prev=
   2.756 @@ -1108,7 +1304,7 @@
   2.757  	  [\\/]* | [A-Za-z]:[\\/]*) ;;
   2.758  	  *)
   2.759  	    $echo "$modename: only absolute run-paths are allowed" 1>&2
   2.760 -	    exit 1
   2.761 +	    exit $EXIT_FAILURE
   2.762  	    ;;
   2.763  	  esac
   2.764  	  if test "$prev" = rpath; then
   2.765 @@ -1158,6 +1354,11 @@
   2.766                esac
   2.767                ;;
   2.768     	  esac
   2.769 + 	  prev=
   2.770 + 	  continue
   2.771 + 	  ;;
   2.772 +	shrext)
   2.773 +  	  shrext_cmds="$arg"
   2.774  	  prev=
   2.775  	  continue
   2.776  	  ;;
   2.777 @@ -1209,7 +1410,7 @@
   2.778        -export-symbols | -export-symbols-regex)
   2.779  	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
   2.780  	  $echo "$modename: more than one -exported-symbols argument is not allowed"
   2.781 -	  exit 1
   2.782 +	  exit $EXIT_FAILURE
   2.783  	fi
   2.784  	if test "X$arg" = "X-export-symbols"; then
   2.785  	  prev=expsyms
   2.786 @@ -1245,7 +1446,7 @@
   2.787  	  absdir=`cd "$dir" && pwd`
   2.788  	  if test -z "$absdir"; then
   2.789  	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
   2.790 -	    exit 1
   2.791 +	    exit $EXIT_FAILURE
   2.792  	  fi
   2.793  	  dir="$absdir"
   2.794  	  ;;
   2.795 @@ -1300,6 +1501,11 @@
   2.796  	continue
   2.797  	;;
   2.798  
   2.799 +     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
   2.800 +	deplibs="$deplibs $arg"
   2.801 +	continue
   2.802 +	;;
   2.803 +
   2.804        -module)
   2.805  	module=yes
   2.806  	continue
   2.807 @@ -1364,6 +1570,11 @@
   2.808  
   2.809        -o) prev=output ;;
   2.810  
   2.811 +      -precious-files-regex)
   2.812 +	prev=precious_regex
   2.813 +	continue
   2.814 +	;;
   2.815 +
   2.816        -release)
   2.817  	prev=release
   2.818  	continue
   2.819 @@ -1386,7 +1597,7 @@
   2.820  	[\\/]* | [A-Za-z]:[\\/]*) ;;
   2.821  	*)
   2.822  	  $echo "$modename: only absolute run-paths are allowed" 1>&2
   2.823 -	  exit 1
   2.824 +	  exit $EXIT_FAILURE
   2.825  	  ;;
   2.826  	esac
   2.827  	case "$xrpath " in
   2.828 @@ -1514,7 +1725,7 @@
   2.829  	     test "$pic_object" = none && \
   2.830  	     test "$non_pic_object" = none; then
   2.831  	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
   2.832 -	    exit 1
   2.833 +	    exit $EXIT_FAILURE
   2.834  	  fi
   2.835  
   2.836  	  # Extract subdirectory from the argument.
   2.837 @@ -1567,7 +1778,7 @@
   2.838  	  # Only an error if not doing a dry-run.
   2.839  	  if test -z "$run"; then
   2.840  	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
   2.841 -	    exit 1
   2.842 +	    exit $EXIT_FAILURE
   2.843  	  else
   2.844  	    # Dry-run case.
   2.845  
   2.846 @@ -1634,48 +1845,7 @@
   2.847      if test -n "$prev"; then
   2.848        $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
   2.849        $echo "$help" 1>&2
   2.850 -      exit 1
   2.851 -    fi
   2.852 -
   2.853 -    # Infer tagged configuration to use if any are available and
   2.854 -    # if one wasn't chosen via the "--tag" command line option.
   2.855 -    # Only attempt this if the compiler in the base link
   2.856 -    # command doesn't match the default compiler.
   2.857 -    if test -n "$available_tags" && test -z "$tagname"; then
   2.858 -      case $base_compile in
   2.859 -      # Blanks in the command may have been stripped by the calling shell,
   2.860 -      # but not from the CC environment variable when configure was run.
   2.861 -      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
   2.862 -      # Blanks at the start of $base_compile will cause this to fail
   2.863 -      # if we don't check for them as well.
   2.864 -      *)
   2.865 -	for z in $available_tags; do
   2.866 -	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
   2.867 -	    # Evaluate the configuration.
   2.868 -	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
   2.869 -	    case $base_compile in
   2.870 -	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
   2.871 -	      # The compiler in $compile_command matches
   2.872 -	      # the one in the tagged configuration.
   2.873 -	      # Assume this is the tagged configuration we want.
   2.874 -	      tagname=$z
   2.875 -	      break
   2.876 -	      ;;
   2.877 -	    esac
   2.878 -	  fi
   2.879 -	done
   2.880 -	# If $tagname still isn't set, then no tagged configuration
   2.881 -	# was found and let the user know that the "--tag" command
   2.882 -	# line option must be used.
   2.883 -	if test -z "$tagname"; then
   2.884 -	  $echo "$modename: unable to infer tagged configuration"
   2.885 -	  $echo "$modename: specify a tag with \`--tag'" 1>&2
   2.886 -	  exit 1
   2.887 -#       else
   2.888 -#         $echo "$modename: using $tagname tagged configuration"
   2.889 -	fi
   2.890 -	;;
   2.891 -      esac
   2.892 +      exit $EXIT_FAILURE
   2.893      fi
   2.894  
   2.895      if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
   2.896 @@ -1719,7 +1889,7 @@
   2.897      "")
   2.898        $echo "$modename: you must specify an output file" 1>&2
   2.899        $echo "$help" 1>&2
   2.900 -      exit 1
   2.901 +      exit $EXIT_FAILURE
   2.902        ;;
   2.903      *.$libext) linkmode=oldlib ;;
   2.904      *.lo | *.$objext) linkmode=obj ;;
   2.905 @@ -1729,7 +1899,7 @@
   2.906  
   2.907      case $host in
   2.908      *cygwin* | *mingw* | *pw32*)
   2.909 -      # don't eliminate duplcations in $postdeps and $predeps
   2.910 +      # don't eliminate duplications in $postdeps and $predeps
   2.911        duplicate_compiler_generated_deps=yes
   2.912        ;;
   2.913      *)
   2.914 @@ -1782,7 +1952,7 @@
   2.915  	  *.la) ;;
   2.916  	  *)
   2.917  	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
   2.918 -	    exit 1
   2.919 +	    exit $EXIT_FAILURE
   2.920  	    ;;
   2.921  	  esac
   2.922  	done
   2.923 @@ -1820,6 +1990,15 @@
   2.924  	lib=
   2.925  	found=no
   2.926  	case $deplib in
   2.927 +	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
   2.928 +	  if test "$linkmode,$pass" = "prog,link"; then
   2.929 +	    compile_deplibs="$deplib $compile_deplibs"
   2.930 +	    finalize_deplibs="$deplib $finalize_deplibs"
   2.931 +	  else
   2.932 +	    deplibs="$deplib $deplibs"
   2.933 +	  fi
   2.934 +	  continue
   2.935 +	  ;;
   2.936  	-l*)
   2.937  	  if test "$linkmode" != lib && test "$linkmode" != prog; then
   2.938  	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
   2.939 @@ -1831,12 +2010,18 @@
   2.940  	  fi
   2.941  	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
   2.942  	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
   2.943 -	    # Search the libtool library
   2.944 -	    lib="$searchdir/lib${name}.la"
   2.945 -	    if test -f "$lib"; then
   2.946 -	      found=yes
   2.947 -	      break
   2.948 -	    fi
   2.949 +	    for search_ext in .la $std_shrext .so .a; do
   2.950 +	      # Search the libtool library
   2.951 +	      lib="$searchdir/lib${name}${search_ext}"
   2.952 +	      if test -f "$lib"; then
   2.953 +		if test "$search_ext" = ".la"; then
   2.954 +		  found=yes
   2.955 +		else
   2.956 +		  found=no
   2.957 +		fi
   2.958 +		break 2
   2.959 +	      fi
   2.960 +	    done
   2.961  	  done
   2.962  	  if test "$found" != yes; then
   2.963  	    # deplib doesn't seem to be a libtool library
   2.964 @@ -1913,11 +2098,11 @@
   2.965  	    fi
   2.966  	    if test "$pass" = scan; then
   2.967  	      deplibs="$deplib $deplibs"
   2.968 -	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
   2.969  	    else
   2.970  	      compile_deplibs="$deplib $compile_deplibs"
   2.971  	      finalize_deplibs="$deplib $finalize_deplibs"
   2.972  	    fi
   2.973 +	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
   2.974  	    ;;
   2.975  	  *)
   2.976  	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
   2.977 @@ -1945,7 +2130,22 @@
   2.978  	  fi
   2.979  	  case $linkmode in
   2.980  	  lib)
   2.981 -	    if test "$deplibs_check_method" != pass_all; then
   2.982 +	    valid_a_lib=no
   2.983 +	    case $deplibs_check_method in
   2.984 +	      match_pattern*)
   2.985 +		set dummy $deplibs_check_method
   2.986 +	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
   2.987 +		if eval $echo \"$deplib\" 2>/dev/null \
   2.988 +		    | $SED 10q \
   2.989 +		    | $EGREP "$match_pattern_regex" > /dev/null; then
   2.990 +		  valid_a_lib=yes
   2.991 +		fi
   2.992 +		;;
   2.993 +	      pass_all)
   2.994 +		valid_a_lib=yes
   2.995 +		;;
   2.996 +            esac
   2.997 +	    if test "$valid_a_lib" != yes; then
   2.998  	      $echo
   2.999  	      $echo "*** Warning: Trying to link with static lib archive $deplib."
  2.1000  	      $echo "*** I have the capability to make that library automatically link in when"
  2.1001 @@ -1996,14 +2196,14 @@
  2.1002  	if test "$found" = yes || test -f "$lib"; then :
  2.1003  	else
  2.1004  	  $echo "$modename: cannot find the library \`$lib'" 1>&2
  2.1005 -	  exit 1
  2.1006 +	  exit $EXIT_FAILURE
  2.1007  	fi
  2.1008  
  2.1009  	# Check to see that this really is a libtool archive.
  2.1010  	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  2.1011  	else
  2.1012  	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2.1013 -	  exit 1
  2.1014 +	  exit $EXIT_FAILURE
  2.1015  	fi
  2.1016  
  2.1017  	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  2.1018 @@ -2046,7 +2246,7 @@
  2.1019  	  if test -z "$libdir"; then
  2.1020  	    if test -z "$old_library"; then
  2.1021  	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2.1022 -	      exit 1
  2.1023 +	      exit $EXIT_FAILURE
  2.1024  	    fi
  2.1025  	    # It is a libtool convenience library, so add in its objects.
  2.1026  	    convenience="$convenience $ladir/$objdir/$old_library"
  2.1027 @@ -2063,12 +2263,12 @@
  2.1028  	    done
  2.1029  	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
  2.1030  	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
  2.1031 -	    exit 1
  2.1032 +	    exit $EXIT_FAILURE
  2.1033  	  fi
  2.1034  	  continue
  2.1035  	fi # $pass = conv
  2.1036  
  2.1037 -    
  2.1038 +
  2.1039  	# Get the name of the library we link against.
  2.1040  	linklib=
  2.1041  	for l in $old_library $library_names; do
  2.1042 @@ -2076,16 +2276,18 @@
  2.1043  	done
  2.1044  	if test -z "$linklib"; then
  2.1045  	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2.1046 -	  exit 1
  2.1047 +	  exit $EXIT_FAILURE
  2.1048  	fi
  2.1049  
  2.1050  	# This library was specified with -dlopen.
  2.1051  	if test "$pass" = dlopen; then
  2.1052  	  if test -z "$libdir"; then
  2.1053  	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  2.1054 -	    exit 1
  2.1055 +	    exit $EXIT_FAILURE
  2.1056  	  fi
  2.1057 -	  if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  2.1058 +	  if test -z "$dlname" ||
  2.1059 +	     test "$dlopen_support" != yes ||
  2.1060 +	     test "$build_libtool_libs" = no; then
  2.1061  	    # If there is no dlname, no dlopen support or we're linking
  2.1062  	    # statically, we need to preload.  We also need to preload any
  2.1063  	    # dependent libraries so libltdl's deplib preloader doesn't
  2.1064 @@ -2123,10 +2325,17 @@
  2.1065  	    absdir="$libdir"
  2.1066  	  fi
  2.1067  	else
  2.1068 -	  dir="$ladir/$objdir"
  2.1069 -	  absdir="$abs_ladir/$objdir"
  2.1070 -	  # Remove this search path later
  2.1071 -	  notinst_path="$notinst_path $abs_ladir"
  2.1072 +	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  2.1073 +	    dir="$ladir"
  2.1074 +	    absdir="$abs_ladir"
  2.1075 +	    # Remove this search path later
  2.1076 +	    notinst_path="$notinst_path $abs_ladir"
  2.1077 +	  else
  2.1078 +	    dir="$ladir/$objdir"
  2.1079 +	    absdir="$abs_ladir/$objdir"
  2.1080 +	    # Remove this search path later
  2.1081 +	    notinst_path="$notinst_path $abs_ladir"
  2.1082 +	  fi
  2.1083  	fi # $installed = yes
  2.1084  	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2.1085  
  2.1086 @@ -2134,7 +2343,7 @@
  2.1087  	if test "$pass" = dlpreopen; then
  2.1088  	  if test -z "$libdir"; then
  2.1089  	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  2.1090 -	    exit 1
  2.1091 +	    exit $EXIT_FAILURE
  2.1092  	  fi
  2.1093  	  # Prefer using a static library (so that no silly _DYNAMIC symbols
  2.1094  	  # are required to link).
  2.1095 @@ -2161,7 +2370,7 @@
  2.1096  	  continue
  2.1097  	fi
  2.1098  
  2.1099 -    
  2.1100 +
  2.1101  	if test "$linkmode" = prog && test "$pass" != link; then
  2.1102  	  newlib_search_path="$newlib_search_path $ladir"
  2.1103  	  deplibs="$lib $deplibs"
  2.1104 @@ -2248,17 +2457,18 @@
  2.1105  	    need_relink=yes
  2.1106  	  fi
  2.1107  	  # This is a shared library
  2.1108 -	
  2.1109 -      # Warn about portability, can't link against -module's on some systems (darwin)
  2.1110 -      if test "$shouldnotlink" = yes && test "$pass" = link ; then
  2.1111 +
  2.1112 +	  # Warn about portability, can't link against -module's on
  2.1113 +	  # some systems (darwin)
  2.1114 +	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
  2.1115  	    $echo
  2.1116  	    if test "$linkmode" = prog; then
  2.1117  	      $echo "*** Warning: Linking the executable $output against the loadable module"
  2.1118  	    else
  2.1119  	      $echo "*** Warning: Linking the shared library $output against the loadable module"
  2.1120  	    fi
  2.1121 -	    $echo "*** $linklib is not portable!"    
  2.1122 -      fi	  
  2.1123 +	    $echo "*** $linklib is not portable!"
  2.1124 +	  fi
  2.1125  	  if test "$linkmode" = lib &&
  2.1126  	     test "$hardcode_into_libs" = yes; then
  2.1127  	    # Hardcode the library path.
  2.1128 @@ -2316,9 +2526,10 @@
  2.1129  	    else
  2.1130  	      $show "extracting exported symbol list from \`$soname'"
  2.1131  	      save_ifs="$IFS"; IFS='~'
  2.1132 -	      eval cmds=\"$extract_expsyms_cmds\"
  2.1133 +	      cmds=$extract_expsyms_cmds
  2.1134  	      for cmd in $cmds; do
  2.1135  		IFS="$save_ifs"
  2.1136 +		eval cmd=\"$cmd\"
  2.1137  		$show "$cmd"
  2.1138  		$run eval "$cmd" || exit $?
  2.1139  	      done
  2.1140 @@ -2329,9 +2540,10 @@
  2.1141  	    if test -f "$output_objdir/$newlib"; then :; else
  2.1142  	      $show "generating import library for \`$soname'"
  2.1143  	      save_ifs="$IFS"; IFS='~'
  2.1144 -	      eval cmds=\"$old_archive_from_expsyms_cmds\"
  2.1145 +	      cmds=$old_archive_from_expsyms_cmds
  2.1146  	      for cmd in $cmds; do
  2.1147  		IFS="$save_ifs"
  2.1148 +		eval cmd=\"$cmd\"
  2.1149  		$show "$cmd"
  2.1150  		$run eval "$cmd" || exit $?
  2.1151  	      done
  2.1152 @@ -2354,9 +2566,9 @@
  2.1153  		case $host in
  2.1154  		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
  2.1155  		  *-*-darwin* )
  2.1156 -		    # if the lib is a module then we can not link against it, someone
  2.1157 -		    # is ignoring the new warnings I added
  2.1158 -		    if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
  2.1159 +		    # if the lib is a module then we can not link against
  2.1160 +		    # it, someone is ignoring the new warnings I added
  2.1161 +		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
  2.1162  		      $echo "** Warning, lib $linklib is a module, not a shared library"
  2.1163  		      if test -z "$old_library" ; then
  2.1164  		        $echo
  2.1165 @@ -2364,7 +2576,7 @@
  2.1166  		        $echo "** The link will probably fail, sorry"
  2.1167  		      else
  2.1168  		        add="$dir/$old_library"
  2.1169 -		      fi 
  2.1170 +		      fi
  2.1171  		    fi
  2.1172  		esac
  2.1173  	      elif test "$hardcode_minus_L" = no; then
  2.1174 @@ -2389,7 +2601,7 @@
  2.1175  		if test -n "$inst_prefix_dir"; then
  2.1176  		  case "$libdir" in
  2.1177  		    [\\/]*)
  2.1178 -		      add_dir="-L$inst_prefix_dir$libdir $add_dir"
  2.1179 +		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2.1180  		      ;;
  2.1181  		  esac
  2.1182  		fi
  2.1183 @@ -2406,7 +2618,7 @@
  2.1184  
  2.1185  	    if test "$lib_linked" != yes; then
  2.1186  	      $echo "$modename: configuration error: unsupported hardcode properties"
  2.1187 -	      exit 1
  2.1188 +	      exit $EXIT_FAILURE
  2.1189  	    fi
  2.1190  
  2.1191  	    if test -n "$add_shlibpath"; then
  2.1192 @@ -2449,7 +2661,8 @@
  2.1193  	      esac
  2.1194  	      add="-l$name"
  2.1195  	    elif test "$hardcode_automatic" = yes; then
  2.1196 -	      if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
  2.1197 +	      if test -n "$inst_prefix_dir" &&
  2.1198 +		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
  2.1199  	        add="$inst_prefix_dir$libdir/$linklib"
  2.1200  	      else
  2.1201  	        add="$libdir/$linklib"
  2.1202 @@ -2461,7 +2674,7 @@
  2.1203  	      if test -n "$inst_prefix_dir"; then
  2.1204  		case "$libdir" in
  2.1205  		  [\\/]*)
  2.1206 -		    add_dir="-L$inst_prefix_dir$libdir $add_dir"
  2.1207 +		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2.1208  		    ;;
  2.1209  		esac
  2.1210  	      fi
  2.1211 @@ -2529,7 +2742,8 @@
  2.1212  
  2.1213  	if test "$linkmode" = lib; then
  2.1214  	  if test -n "$dependency_libs" &&
  2.1215 -	     { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
  2.1216 +	     { test "$hardcode_into_libs" != yes ||
  2.1217 +	       test "$build_old_libs" = yes ||
  2.1218  	       test "$link_static" = yes; }; then
  2.1219  	    # Extract -R from dependency_libs
  2.1220  	    temp_deplibs=
  2.1221 @@ -2586,7 +2800,7 @@
  2.1222  		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  2.1223  		  if test -z "$libdir"; then
  2.1224  		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  2.1225 -		    exit 1
  2.1226 +		    exit $EXIT_FAILURE
  2.1227  		  fi
  2.1228  		  if test "$absdir" != "$libdir"; then
  2.1229  		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  2.1230 @@ -2596,7 +2810,8 @@
  2.1231  		depdepl=
  2.1232  		case $host in
  2.1233  		*-*-darwin*)
  2.1234 -		  # we do not want to link against static libs, but need to link against shared
  2.1235 +		  # we do not want to link against static libs,
  2.1236 +		  # but need to link against shared
  2.1237  		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  2.1238  		  if test -n "$deplibrary_names" ; then
  2.1239  		    for tmp in $deplibrary_names ; do
  2.1240 @@ -2604,7 +2819,7 @@
  2.1241  		    done
  2.1242  		    if test -f "$path/$depdepl" ; then
  2.1243  		      depdepl="$path/$depdepl"
  2.1244 -		   fi
  2.1245 +		    fi
  2.1246  		    # do not add paths which are already there
  2.1247  		    case " $newlib_search_path " in
  2.1248  		    *" $path "*) ;;
  2.1249 @@ -2614,28 +2829,23 @@
  2.1250  		  path=""
  2.1251  		  ;;
  2.1252  		*)
  2.1253 -		path="-L$path"
  2.1254 +		  path="-L$path"
  2.1255 +		  ;;
  2.1256 +		esac
  2.1257  		;;
  2.1258 -		esac
  2.1259 -		
  2.1260 -		;;
  2.1261 -		  -l*)
  2.1262 +	      -l*)
  2.1263  		case $host in
  2.1264  		*-*-darwin*)
  2.1265 -		 # Again, we only want to link against shared libraries
  2.1266 -		 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  2.1267 -		 for tmp in $newlib_search_path ; do
  2.1268 -		     if test -f "$tmp/lib$tmp_libs.dylib" ; then
  2.1269 -		       eval depdepl="$tmp/lib$tmp_libs.dylib"
  2.1270 -		       break
  2.1271 -		     fi  
  2.1272 -         done
  2.1273 -         path=""
  2.1274 +		  # Again, we only want to link against shared libraries
  2.1275 +		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  2.1276 +		  for tmp in $newlib_search_path ; do
  2.1277 +		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
  2.1278 +		      eval depdepl="$tmp/lib$tmp_libs.dylib"
  2.1279 +		      break
  2.1280 +		    fi
  2.1281 +		  done
  2.1282 +		  path=""
  2.1283  		  ;;
  2.1284 -		*) continue ;;
  2.1285 -		esac  		  
  2.1286 -		;;
  2.1287 -
  2.1288  	      *.framework)
  2.1289  		case $host in
  2.1290  		  *-*-darwin*)
  2.1291 @@ -2643,13 +2853,15 @@
  2.1292  		    ;;
  2.1293  		esac
  2.1294  		;;
  2.1295 -
  2.1296 +		*) continue ;;
  2.1297 +		esac
  2.1298 +		;;
  2.1299  	      *) continue ;;
  2.1300  	      esac
  2.1301  	      case " $deplibs " in
  2.1302  	      *" $depdepl "*) ;;
  2.1303 -	      *) deplibs="$deplibs $depdepl" ;;
  2.1304 -	      esac	      
  2.1305 +	      *) deplibs="$depdepl $deplibs" ;;
  2.1306 +	      esac
  2.1307  	      case " $deplibs " in
  2.1308  	      *" $path "*) ;;
  2.1309  	      *) deplibs="$deplibs $path" ;;
  2.1310 @@ -2739,7 +2951,8 @@
  2.1311  	  eval $var=\"$tmp_libs\"
  2.1312  	done # for var
  2.1313        fi
  2.1314 -      # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
  2.1315 +      # Last step: remove runtime libs from dependency_libs
  2.1316 +      # (they stay in deplibs)
  2.1317        tmp_libs=
  2.1318        for i in $dependency_libs ; do
  2.1319  	case " $predeps $postdeps $compiler_lib_search_path " in
  2.1320 @@ -2799,19 +3012,19 @@
  2.1321        case $outputname in
  2.1322        lib*)
  2.1323  	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2.1324 -	eval shared_ext=\"$shrext\"
  2.1325 +	eval shared_ext=\"$shrext_cmds\"
  2.1326  	eval libname=\"$libname_spec\"
  2.1327  	;;
  2.1328        *)
  2.1329  	if test "$module" = no; then
  2.1330  	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  2.1331  	  $echo "$help" 1>&2
  2.1332 -	  exit 1
  2.1333 +	  exit $EXIT_FAILURE
  2.1334  	fi
  2.1335  	if test "$need_lib_prefix" != no; then
  2.1336  	  # Add the "lib" prefix for modules if required
  2.1337  	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2.1338 -	  eval shared_ext=\"$shrext\"
  2.1339 +	  eval shared_ext=\"$shrext_cmds\"
  2.1340  	  eval libname=\"$libname_spec\"
  2.1341  	else
  2.1342  	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2.1343 @@ -2822,7 +3035,7 @@
  2.1344        if test -n "$objs"; then
  2.1345  	if test "$deplibs_check_method" != pass_all; then
  2.1346  	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  2.1347 -	  exit 1
  2.1348 +	  exit $EXIT_FAILURE
  2.1349  	else
  2.1350  	  $echo
  2.1351  	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
  2.1352 @@ -2870,13 +3083,13 @@
  2.1353  	if test -n "$8"; then
  2.1354  	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
  2.1355  	  $echo "$help" 1>&2
  2.1356 -	  exit 1
  2.1357 +	  exit $EXIT_FAILURE
  2.1358  	fi
  2.1359  
  2.1360  	# convert absolute version numbers to libtool ages
  2.1361  	# this retains compatibility with .la files and attempts
  2.1362  	# to make the code below a bit more comprehensible
  2.1363 -	
  2.1364 +
  2.1365  	case $vinfo_number in
  2.1366  	yes)
  2.1367  	  number_major="$2"
  2.1368 @@ -2920,7 +3133,7 @@
  2.1369  	*)
  2.1370  	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  2.1371  	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2.1372 -	  exit 1
  2.1373 +	  exit $EXIT_FAILURE
  2.1374  	  ;;
  2.1375  	esac
  2.1376  
  2.1377 @@ -2929,7 +3142,7 @@
  2.1378  	*)
  2.1379  	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  2.1380  	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2.1381 -	  exit 1
  2.1382 +	  exit $EXIT_FAILURE
  2.1383  	  ;;
  2.1384  	esac
  2.1385  
  2.1386 @@ -2938,14 +3151,14 @@
  2.1387  	*)
  2.1388  	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  2.1389  	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2.1390 -	  exit 1
  2.1391 +	  exit $EXIT_FAILURE
  2.1392  	  ;;
  2.1393  	esac
  2.1394  
  2.1395  	if test "$age" -gt "$current"; then
  2.1396  	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  2.1397  	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2.1398 -	  exit 1
  2.1399 +	  exit $EXIT_FAILURE
  2.1400  	fi
  2.1401  
  2.1402  	# Calculate the version variables.
  2.1403 @@ -2962,7 +3175,7 @@
  2.1404  	  versuffix="$major.$age.$revision"
  2.1405  	  # Darwin ld doesn't like 0 for these options...
  2.1406  	  minor_current=`expr $current + 1`
  2.1407 -	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  2.1408 +	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  2.1409  	  ;;
  2.1410  
  2.1411  	freebsd-aout)
  2.1412 @@ -2975,12 +3188,6 @@
  2.1413  	  versuffix=".$current";
  2.1414  	  ;;
  2.1415  
  2.1416 -        qnx)
  2.1417 -          major=".$current"
  2.1418 -          versuffix=".$current"
  2.1419 -          deplibs_check_method="pass_all"
  2.1420 -          ;;
  2.1421 -
  2.1422  	irix | nonstopux)
  2.1423  	  major=`expr $current - $age + 1`
  2.1424  
  2.1425 @@ -3040,7 +3247,7 @@
  2.1426  	*)
  2.1427  	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
  2.1428  	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  2.1429 -	  exit 1
  2.1430 +	  exit $EXIT_FAILURE
  2.1431  	  ;;
  2.1432  	esac
  2.1433  
  2.1434 @@ -3094,6 +3301,12 @@
  2.1435  	    *.$objext)
  2.1436  	       ;;
  2.1437  	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  2.1438 +	       if test "X$precious_files_regex" != "X"; then
  2.1439 +	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  2.1440 +	         then
  2.1441 +		   continue
  2.1442 +		 fi
  2.1443 +	       fi
  2.1444  	       removelist="$removelist $p"
  2.1445  	       ;;
  2.1446  	    *) ;;
  2.1447 @@ -3580,7 +3793,7 @@
  2.1448  	fi
  2.1449  
  2.1450  	# Get the real and link names of the library.
  2.1451 -	eval shared_ext=\"$shrext\"
  2.1452 +	eval shared_ext=\"$shrext_cmds\"
  2.1453  	eval library_names=\"$library_names_spec\"
  2.1454  	set dummy $library_names
  2.1455  	realname="$2"
  2.1456 @@ -3610,10 +3823,11 @@
  2.1457  	    $show "generating symbol list for \`$libname.la'"
  2.1458  	    export_symbols="$output_objdir/$libname.exp"
  2.1459  	    $run $rm $export_symbols
  2.1460 -	    eval cmds=\"$export_symbols_cmds\"
  2.1461 +	    cmds=$export_symbols_cmds
  2.1462  	    save_ifs="$IFS"; IFS='~'
  2.1463  	    for cmd in $cmds; do
  2.1464  	      IFS="$save_ifs"
  2.1465 +	      eval cmd=\"$cmd\"
  2.1466  	      if len=`expr "X$cmd" : ".*"` &&
  2.1467  	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  2.1468  	        $show "$cmd"
  2.1469 @@ -3643,12 +3857,12 @@
  2.1470  	for test_deplib in $deplibs; do
  2.1471  		case " $convenience " in
  2.1472  		*" $test_deplib "*) ;;
  2.1473 -		*) 
  2.1474 +		*)
  2.1475  			tmp_deplibs="$tmp_deplibs $test_deplib"
  2.1476  			;;
  2.1477  		esac
  2.1478  	done
  2.1479 -	deplibs="$tmp_deplibs" 
  2.1480 +	deplibs="$tmp_deplibs"
  2.1481  
  2.1482  	if test -n "$convenience"; then
  2.1483  	  if test -n "$whole_archive_flag_spec"; then
  2.1484 @@ -3656,67 +3870,13 @@
  2.1485  	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2.1486  	  else
  2.1487  	    gentop="$output_objdir/${outputname}x"
  2.1488 -	    $show "${rm}r $gentop"
  2.1489 -	    $run ${rm}r "$gentop"
  2.1490 -	    $show "$mkdir $gentop"
  2.1491 -	    $run $mkdir "$gentop"
  2.1492 -	    status=$?
  2.1493 -	    if test "$status" -ne 0 && test ! -d "$gentop"; then
  2.1494 -	      exit $status
  2.1495 -	    fi
  2.1496  	    generated="$generated $gentop"
  2.1497  
  2.1498 -	    for xlib in $convenience; do
  2.1499 -	      # Extract the objects.
  2.1500 -	      case $xlib in
  2.1501 -	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2.1502 -	      *) xabs=`pwd`"/$xlib" ;;
  2.1503 -	      esac
  2.1504 -	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2.1505 -	      xdir="$gentop/$xlib"
  2.1506 -
  2.1507 -	      $show "${rm}r $xdir"
  2.1508 -	      $run ${rm}r "$xdir"
  2.1509 -	      $show "$mkdir $xdir"
  2.1510 -	      $run $mkdir "$xdir"
  2.1511 -	      status=$?
  2.1512 -	      if test "$status" -ne 0 && test ! -d "$xdir"; then
  2.1513 -		exit $status
  2.1514 -	      fi
  2.1515 -	      # We will extract separately just the conflicting names and we will no
  2.1516 -	      # longer touch any unique names. It is faster to leave these extract
  2.1517 -	      # automatically by $AR in one run.
  2.1518 -	      $show "(cd $xdir && $AR x $xabs)"
  2.1519 -	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2.1520 -	      if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
  2.1521 -		:
  2.1522 -	      else
  2.1523 -		$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
  2.1524 -		$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
  2.1525 -		$AR t "$xabs" | sort | uniq -cd | while read -r count name
  2.1526 -		do
  2.1527 -		  i=1
  2.1528 -		  while test "$i" -le "$count"
  2.1529 -		  do
  2.1530 -		   # Put our $i before any first dot (extension)
  2.1531 -		   # Never overwrite any file
  2.1532 -		   name_to="$name"
  2.1533 -		   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
  2.1534 -		   do
  2.1535 -		     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
  2.1536 -		   done
  2.1537 -		   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
  2.1538 -		   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
  2.1539 -		   i=`expr $i + 1`
  2.1540 -		  done
  2.1541 -		done
  2.1542 -	      fi
  2.1543 -
  2.1544 -	      libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  2.1545 -	    done
  2.1546 +	    func_extract_archives $gentop $convenience
  2.1547 +	    libobjs="$libobjs $func_extract_archives_result"
  2.1548  	  fi
  2.1549  	fi
  2.1550 -
  2.1551 +	
  2.1552  	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2.1553  	  eval flag=\"$thread_safe_flag_spec\"
  2.1554  	  linker_flags="$linker_flags $flag"
  2.1555 @@ -3730,19 +3890,23 @@
  2.1556  	# Do each of the archive commands.
  2.1557  	if test "$module" = yes && test -n "$module_cmds" ; then
  2.1558  	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  2.1559 -	    eval cmds=\"$module_expsym_cmds\"
  2.1560 +	    eval test_cmds=\"$module_expsym_cmds\"
  2.1561 +	    cmds=$module_expsym_cmds
  2.1562  	  else
  2.1563 -	    eval cmds=\"$module_cmds\"
  2.1564 +	    eval test_cmds=\"$module_cmds\"
  2.1565 +	    cmds=$module_cmds
  2.1566  	  fi
  2.1567  	else
  2.1568  	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2.1569 -	  eval cmds=\"$archive_expsym_cmds\"
  2.1570 +	  eval test_cmds=\"$archive_expsym_cmds\"
  2.1571 +	  cmds=$archive_expsym_cmds
  2.1572  	else
  2.1573 -	  eval cmds=\"$archive_cmds\"
  2.1574 +	  eval test_cmds=\"$archive_cmds\"
  2.1575 +	  cmds=$archive_cmds
  2.1576  	  fi
  2.1577  	fi
  2.1578  
  2.1579 -	if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
  2.1580 +	if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
  2.1581  	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  2.1582  	  :
  2.1583  	else
  2.1584 @@ -3843,19 +4007,28 @@
  2.1585  	  # value of $libobjs for piecewise linking.
  2.1586  
  2.1587  	  # Do each of the archive commands.
  2.1588 +	  if test "$module" = yes && test -n "$module_cmds" ; then
  2.1589 +	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  2.1590 +	      cmds=$module_expsym_cmds
  2.1591 +	    else
  2.1592 +	      cmds=$module_cmds
  2.1593 +	    fi
  2.1594 +	  else
  2.1595  	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2.1596 -	    eval cmds=\"$archive_expsym_cmds\"
  2.1597 +	    cmds=$archive_expsym_cmds
  2.1598  	  else
  2.1599 -	    eval cmds=\"$archive_cmds\"
  2.1600 +	    cmds=$archive_cmds
  2.1601 +	    fi
  2.1602  	  fi
  2.1603  
  2.1604  	  # Append the command to remove the reloadable object files
  2.1605  	  # to the just-reset $cmds.
  2.1606 -	  eval cmds=\"\$cmds~$rm $delfiles\"
  2.1607 +	  eval cmds=\"\$cmds~\$rm $delfiles\"
  2.1608  	fi
  2.1609  	save_ifs="$IFS"; IFS='~'
  2.1610  	for cmd in $cmds; do
  2.1611  	  IFS="$save_ifs"
  2.1612 +	  eval cmd=\"$cmd\"
  2.1613  	  $show "$cmd"
  2.1614  	  $run eval "$cmd" || exit $?
  2.1615  	done
  2.1616 @@ -3864,7 +4037,7 @@
  2.1617  	# Restore the uninstalled library and exit
  2.1618  	if test "$mode" = relink; then
  2.1619  	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  2.1620 -	  exit 0
  2.1621 +	  exit $EXIT_SUCCESS
  2.1622  	fi
  2.1623  
  2.1624  	# Create links to the real library.
  2.1625 @@ -3912,7 +4085,7 @@
  2.1626        *.lo)
  2.1627  	if test -n "$objs$old_deplibs"; then
  2.1628  	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2.1629 -	  exit 1
  2.1630 +	  exit $EXIT_FAILURE
  2.1631  	fi
  2.1632  	libobj="$output"
  2.1633  	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2.1634 @@ -3941,64 +4114,10 @@
  2.1635  	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  2.1636  	else
  2.1637  	  gentop="$output_objdir/${obj}x"
  2.1638 -	  $show "${rm}r $gentop"
  2.1639 -	  $run ${rm}r "$gentop"
  2.1640 -	  $show "$mkdir $gentop"
  2.1641 -	  $run $mkdir "$gentop"
  2.1642 -	  status=$?
  2.1643 -	  if test "$status" -ne 0 && test ! -d "$gentop"; then
  2.1644 -	    exit $status
  2.1645 -	  fi
  2.1646  	  generated="$generated $gentop"
  2.1647  
  2.1648 -	  for xlib in $convenience; do
  2.1649 -	    # Extract the objects.
  2.1650 -	    case $xlib in
  2.1651 -	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2.1652 -	    *) xabs=`pwd`"/$xlib" ;;
  2.1653 -	    esac
  2.1654 -	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2.1655 -	    xdir="$gentop/$xlib"
  2.1656 -
  2.1657 -	    $show "${rm}r $xdir"
  2.1658 -	    $run ${rm}r "$xdir"
  2.1659 -	    $show "$mkdir $xdir"
  2.1660 -	    $run $mkdir "$xdir"
  2.1661 -	    status=$?
  2.1662 -	    if test "$status" -ne 0 && test ! -d "$xdir"; then
  2.1663 -	      exit $status
  2.1664 -	    fi
  2.1665 -	    # We will extract separately just the conflicting names and we will no
  2.1666 -	    # longer touch any unique names. It is faster to leave these extract
  2.1667 -	    # automatically by $AR in one run.
  2.1668 -	    $show "(cd $xdir && $AR x $xabs)"
  2.1669 -	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2.1670 -	    if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
  2.1671 -	      :
  2.1672 -	    else
  2.1673 -	      $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
  2.1674 -	      $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
  2.1675 -	      $AR t "$xabs" | sort | uniq -cd | while read -r count name
  2.1676 -	      do
  2.1677 -		i=1
  2.1678 -		while test "$i" -le "$count"
  2.1679 -		do
  2.1680 -		 # Put our $i before any first dot (extension)
  2.1681 -		 # Never overwrite any file
  2.1682 -		 name_to="$name"
  2.1683 -		 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
  2.1684 -		 do
  2.1685 -		   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
  2.1686 -		 done
  2.1687 -		 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
  2.1688 -		 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
  2.1689 -		 i=`expr $i + 1`
  2.1690 -		done
  2.1691 -	      done
  2.1692 -	    fi
  2.1693 -
  2.1694 -	    reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  2.1695 -	  done
  2.1696 +	  func_extract_archives $gentop $convenience
  2.1697 +	  reload_conv_objs="$reload_objs $func_extract_archives_result"
  2.1698  	fi
  2.1699        fi
  2.1700  
  2.1701 @@ -4006,10 +4125,11 @@
  2.1702        reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  2.1703  
  2.1704        output="$obj"
  2.1705 -      eval cmds=\"$reload_cmds\"
  2.1706 +      cmds=$reload_cmds
  2.1707        save_ifs="$IFS"; IFS='~'
  2.1708        for cmd in $cmds; do
  2.1709  	IFS="$save_ifs"
  2.1710 +	eval cmd=\"$cmd\"
  2.1711  	$show "$cmd"
  2.1712  	$run eval "$cmd" || exit $?
  2.1713        done
  2.1714 @@ -4022,7 +4142,7 @@
  2.1715  	  $run ${rm}r $gentop
  2.1716  	fi
  2.1717  
  2.1718 -	exit 0
  2.1719 +	exit $EXIT_SUCCESS
  2.1720        fi
  2.1721  
  2.1722        if test "$build_libtool_libs" != yes; then
  2.1723 @@ -4035,17 +4155,18 @@
  2.1724  	# accidentally link it into a program.
  2.1725  	# $show "echo timestamp > $libobj"
  2.1726  	# $run eval "echo timestamp > $libobj" || exit $?
  2.1727 -	exit 0
  2.1728 +	exit $EXIT_SUCCESS
  2.1729        fi
  2.1730  
  2.1731        if test -n "$pic_flag" || test "$pic_mode" != default; then
  2.1732  	# Only do commands if we really have different PIC objects.
  2.1733  	reload_objs="$libobjs $reload_conv_objs"
  2.1734  	output="$libobj"
  2.1735 -	eval cmds=\"$reload_cmds\"
  2.1736 +	cmds=$reload_cmds
  2.1737  	save_ifs="$IFS"; IFS='~'
  2.1738  	for cmd in $cmds; do
  2.1739  	  IFS="$save_ifs"
  2.1740 +	  eval cmd=\"$cmd\"
  2.1741  	  $show "$cmd"
  2.1742  	  $run eval "$cmd" || exit $?
  2.1743  	done
  2.1744 @@ -4057,7 +4178,7 @@
  2.1745  	$run ${rm}r $gentop
  2.1746        fi
  2.1747  
  2.1748 -      exit 0
  2.1749 +      exit $EXIT_SUCCESS
  2.1750        ;;
  2.1751  
  2.1752      prog)
  2.1753 @@ -4378,7 +4499,7 @@
  2.1754  	  ;;
  2.1755  	*)
  2.1756  	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  2.1757 -	  exit 1
  2.1758 +	  exit $EXIT_FAILURE
  2.1759  	  ;;
  2.1760  	esac
  2.1761        else
  2.1762 @@ -4466,7 +4587,7 @@
  2.1763  	# Link the executable and exit
  2.1764  	$show "$link_command"
  2.1765  	$run eval "$link_command" || exit $?
  2.1766 -	exit 0
  2.1767 +	exit $EXIT_SUCCESS
  2.1768        fi
  2.1769  
  2.1770        if test "$hardcode_action" = relink; then
  2.1771 @@ -4521,10 +4642,10 @@
  2.1772        fi
  2.1773  
  2.1774        # Quote $echo for shipping.
  2.1775 -      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  2.1776 -	case $0 in
  2.1777 -	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
  2.1778 -	*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  2.1779 +      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
  2.1780 +	case $progpath in
  2.1781 +	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  2.1782 +	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  2.1783  	esac
  2.1784  	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  2.1785        else
  2.1786 @@ -4550,7 +4671,7 @@
  2.1787  	    cwrappersource=`$echo ${objdir}/lt-${output}.c`
  2.1788  	    cwrapper=`$echo ${output}.exe`
  2.1789  	    $rm $cwrappersource $cwrapper
  2.1790 -	    trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
  2.1791 +	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  2.1792  
  2.1793  	    cat > $cwrappersource <<EOF
  2.1794  
  2.1795 @@ -4559,7 +4680,7 @@
  2.1796  
  2.1797     The $output program cannot be directly executed until all the libtool
  2.1798     libraries that it depends on are installed.
  2.1799 -   
  2.1800 +
  2.1801     This wrapper executable should never be moved out of the build directory.
  2.1802     If it is, it will not operate correctly.
  2.1803  
  2.1804 @@ -4575,7 +4696,6 @@
  2.1805  #include <malloc.h>
  2.1806  #include <stdarg.h>
  2.1807  #include <assert.h>
  2.1808 -#include <sys/stat.h>
  2.1809  
  2.1810  #if defined(PATH_MAX)
  2.1811  # define LT_PATHMAX PATH_MAX
  2.1812 @@ -4586,19 +4706,15 @@
  2.1813  #endif
  2.1814  
  2.1815  #ifndef DIR_SEPARATOR
  2.1816 -# define DIR_SEPARATOR '/'
  2.1817 -# define PATH_SEPARATOR ':'
  2.1818 +#define DIR_SEPARATOR '/'
  2.1819  #endif
  2.1820  
  2.1821  #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  2.1822    defined (__OS2__)
  2.1823 -# define HAVE_DOS_BASED_FILE_SYSTEM
  2.1824 -# ifndef DIR_SEPARATOR_2 
  2.1825 -#  define DIR_SEPARATOR_2 '\\'
  2.1826 -# endif
  2.1827 -# ifndef PATH_SEPARATOR_2 
  2.1828 -#  define PATH_SEPARATOR_2 ';'
  2.1829 -# endif
  2.1830 +#define HAVE_DOS_BASED_FILE_SYSTEM
  2.1831 +#ifndef DIR_SEPARATOR_2
  2.1832 +#define DIR_SEPARATOR_2 '\\'
  2.1833 +#endif
  2.1834  #endif
  2.1835  
  2.1836  #ifndef DIR_SEPARATOR_2
  2.1837 @@ -4608,30 +4724,17 @@
  2.1838          (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  2.1839  #endif /* DIR_SEPARATOR_2 */
  2.1840  
  2.1841 -#ifndef PATH_SEPARATOR_2
  2.1842 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  2.1843 -#else /* PATH_SEPARATOR_2 */
  2.1844 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  2.1845 -#endif /* PATH_SEPARATOR_2 */
  2.1846 -
  2.1847  #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
  2.1848  #define XFREE(stale) do { \
  2.1849    if (stale) { free ((void *) stale); stale = 0; } \
  2.1850  } while (0)
  2.1851  
  2.1852 -#if defined DEBUGWRAPPER
  2.1853 -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
  2.1854 -#else
  2.1855 -# define DEBUG(format, ...) 
  2.1856 -#endif
  2.1857 -
  2.1858  const char *program_name = NULL;
  2.1859  
  2.1860  void * xmalloc (size_t num);
  2.1861  char * xstrdup (const char *string);
  2.1862  char * basename (const char *name);
  2.1863 -char * find_executable(const char *wrapper);
  2.1864 -int    check_executable(const char *path);
  2.1865 +char * fnqualify(const char *path);
  2.1866  char * strendzap(char *str, const char *pat);
  2.1867  void lt_fatal (const char *message, ...);
  2.1868  
  2.1869 @@ -4640,10 +4743,8 @@
  2.1870  {
  2.1871    char **newargz;
  2.1872    int i;
  2.1873 -  
  2.1874 +
  2.1875    program_name = (char *) xstrdup ((char *) basename (argv[0]));
  2.1876 -  DEBUG("(main) argv[0]      : %s\n",argv[0]);
  2.1877 -  DEBUG("(main) program_name : %s\n",program_name);
  2.1878    newargz = XMALLOC(char *, argc+2);
  2.1879  EOF
  2.1880  
  2.1881 @@ -4652,23 +4753,13 @@
  2.1882  EOF
  2.1883  
  2.1884  	    cat >> $cwrappersource <<"EOF"
  2.1885 -  newargz[1] = find_executable(argv[0]);
  2.1886 -  if (newargz[1] == NULL)
  2.1887 -    lt_fatal("Couldn't find %s", argv[0]);
  2.1888 -  DEBUG("(main) found exe at : %s\n",newargz[1]);
  2.1889 +  newargz[1] = fnqualify(argv[0]);
  2.1890    /* we know the script has the same name, without the .exe */
  2.1891    /* so make sure newargz[1] doesn't end in .exe */
  2.1892 -  strendzap(newargz[1],".exe"); 
  2.1893 +  strendzap(newargz[1],".exe");
  2.1894    for (i = 1; i < argc; i++)
  2.1895      newargz[i+1] = xstrdup(argv[i]);
  2.1896    newargz[argc+1] = NULL;
  2.1897 -
  2.1898 -  for (i=0; i<argc+1; i++)
  2.1899 -  {
  2.1900 -    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
  2.1901 -    ;
  2.1902 -  }
  2.1903 -
  2.1904  EOF
  2.1905  
  2.1906  	    cat >> $cwrappersource <<EOF
  2.1907 @@ -4688,7 +4779,7 @@
  2.1908    return p;
  2.1909  }
  2.1910  
  2.1911 -char * 
  2.1912 +char *
  2.1913  xstrdup (const char *string)
  2.1914  {
  2.1915    return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
  2.1916 @@ -4702,7 +4793,7 @@
  2.1917  
  2.1918  #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  2.1919    /* Skip over the disk name in MSDOS pathnames. */
  2.1920 -  if (isalpha (name[0]) && name[1] == ':') 
  2.1921 +  if (isalpha (name[0]) && name[1] == ':')
  2.1922      name += 2;
  2.1923  #endif
  2.1924  
  2.1925 @@ -4712,134 +4803,35 @@
  2.1926    return (char *) base;
  2.1927  }
  2.1928  
  2.1929 -int
  2.1930 -check_executable(const char * path)
  2.1931 +char *
  2.1932 +fnqualify(const char *path)
  2.1933  {
  2.1934 -  struct stat st;
  2.1935 -
  2.1936 -  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
  2.1937 -  if ((!path) || (!*path))
  2.1938 -    return 0;
  2.1939 -
  2.1940 -  if ((stat (path, &st) >= 0) &&
  2.1941 -      (
  2.1942 -#ifdef S_IXOTH
  2.1943 -       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
  2.1944 +  size_t size;
  2.1945 +  char *p;
  2.1946 +  char tmp[LT_PATHMAX + 1];
  2.1947 +
  2.1948 +  assert(path != NULL);
  2.1949 +
  2.1950 +  /* Is it qualified already? */
  2.1951 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  2.1952 +  if (isalpha (path[0]) && path[1] == ':')
  2.1953 +    return xstrdup (path);
  2.1954  #endif
  2.1955 -#ifdef S_IXGRP
  2.1956 -       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
  2.1957 -#endif
  2.1958 -       ((st.st_mode & S_IXUSR) == S_IXUSR)))
  2.1959 -    return 1;
  2.1960 -  else
  2.1961 -    return 0;
  2.1962 -}
  2.1963 -
  2.1964 -/* Searches for the full path of the wrapper.  Returns
  2.1965 -   newly allocated full path name if found, NULL otherwise */
  2.1966 -char *
  2.1967 -find_executable (const char* wrapper)
  2.1968 -{
  2.1969 -  int has_slash = 0;
  2.1970 -  const char* p;
  2.1971 -  const char* p_next;
  2.1972 -  struct stat st;
  2.1973 -  /* static buffer for getcwd */
  2.1974 -  char tmp[LT_PATHMAX + 1];
  2.1975 -  int tmp_len;
  2.1976 -  char* concat_name;
  2.1977 -
  2.1978 -  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
  2.1979 -  
  2.1980 -  if ((wrapper == NULL) || (*wrapper == '\0'))
  2.1981 -    return NULL;
  2.1982 -
  2.1983 -  /* Absolute path? */
  2.1984 -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  2.1985 -  if (isalpha (wrapper[0]) && wrapper[1] == ':')
  2.1986 -  {
  2.1987 -    concat_name = xstrdup (wrapper);
  2.1988 -    if (check_executable(concat_name))
  2.1989 -      return concat_name;
  2.1990 -    XFREE(concat_name);
  2.1991 -  }
  2.1992 -  else
  2.1993 -  {
  2.1994 -#endif
  2.1995 -    if (IS_DIR_SEPARATOR (wrapper[0]))
  2.1996 -    {
  2.1997 -      concat_name = xstrdup (wrapper);
  2.1998 -      if (check_executable(concat_name))
  2.1999 -        return concat_name;
  2.2000 -      XFREE(concat_name);
  2.2001 -    }
  2.2002 -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  2.2003 -  }
  2.2004 -#endif
  2.2005 -
  2.2006 -  for (p = wrapper; *p; p++)
  2.2007 -    if (*p == '/')
  2.2008 -    {
  2.2009 -      has_slash = 1;
  2.2010 -      break;
  2.2011 -    }
  2.2012 -  if (!has_slash)
  2.2013 -  {
  2.2014 -    /* no slashes; search PATH */
  2.2015 -    const char* path = getenv ("PATH");
  2.2016 -    if (path != NULL)
  2.2017 -    {
  2.2018 -      for (p = path; *p; p = p_next)
  2.2019 -      {
  2.2020 -        const char* q;
  2.2021 -        size_t p_len;
  2.2022 -        for (q = p; *q; q++)
  2.2023 -          if (IS_PATH_SEPARATOR(*q))
  2.2024 -            break;
  2.2025 -        p_len = q - p;
  2.2026 -        p_next = (*q == '\0' ? q : q + 1);
  2.2027 -        if (p_len == 0)
  2.2028 -        {
  2.2029 -          /* empty path: current directory */
  2.2030 -          if (getcwd (tmp, LT_PATHMAX) == NULL)
  2.2031 -            lt_fatal ("getcwd failed");
  2.2032 -          tmp_len = strlen(tmp);
  2.2033 -          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
  2.2034 -          memcpy (concat_name, tmp, tmp_len);
  2.2035 -          concat_name[tmp_len] = '/';
  2.2036 -          strcpy (concat_name + tmp_len + 1, wrapper);
  2.2037 -        }
  2.2038 -        else
  2.2039 -        {
  2.2040 -          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
  2.2041 -          memcpy (concat_name, p, p_len);
  2.2042 -          concat_name[p_len] = '/';
  2.2043 -          strcpy (concat_name + p_len + 1, wrapper);
  2.2044 -        }
  2.2045 -        if (check_executable(concat_name))
  2.2046 -          return concat_name;
  2.2047 -        XFREE(concat_name);
  2.2048 -      }
  2.2049 -    }
  2.2050 -    /* not found in PATH; assume curdir */
  2.2051 -  }
  2.2052 -  /* Relative path | not found in path: prepend cwd */
  2.2053 +  if (IS_DIR_SEPARATOR (path[0]))
  2.2054 +    return xstrdup (path);
  2.2055 +
  2.2056 +  /* prepend the current directory */
  2.2057 +  /* doesn't handle '~' */
  2.2058    if (getcwd (tmp, LT_PATHMAX) == NULL)
  2.2059      lt_fatal ("getcwd failed");
  2.2060 -  tmp_len = strlen(tmp);
  2.2061 -  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
  2.2062 -  memcpy (concat_name, tmp, tmp_len);
  2.2063 -  concat_name[tmp_len] = '/';
  2.2064 -  strcpy (concat_name + tmp_len + 1, wrapper);
  2.2065 -
  2.2066 -  if (check_executable(concat_name))
  2.2067 -    return concat_name;
  2.2068 -  XFREE(concat_name);
  2.2069 -  return NULL;
  2.2070 +  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
  2.2071 +  p = XMALLOC(char, size);
  2.2072 +  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
  2.2073 +  return p;
  2.2074  }
  2.2075  
  2.2076  char *
  2.2077 -strendzap(char *str, const char *pat) 
  2.2078 +strendzap(char *str, const char *pat)
  2.2079  {
  2.2080    size_t len, patlen;
  2.2081  
  2.2082 @@ -4859,7 +4851,7 @@
  2.2083  }
  2.2084  
  2.2085  static void
  2.2086 -lt_error_core (int exit_status, const char * mode, 
  2.2087 +lt_error_core (int exit_status, const char * mode,
  2.2088            const char * message, va_list ap)
  2.2089  {
  2.2090    fprintf (stderr, "%s: %s: ", program_name, mode);
  2.2091 @@ -4888,7 +4880,7 @@
  2.2092  	  ;;
  2.2093  	esac
  2.2094  	$rm $output
  2.2095 -	trap "$rm $output; exit 1" 1 2 15
  2.2096 +	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
  2.2097  
  2.2098  	$echo > $output "\
  2.2099  #! $SHELL
  2.2100 @@ -4909,7 +4901,7 @@
  2.2101  
  2.2102  # The HP-UX ksh and POSIX shell print the target directory to stdout
  2.2103  # if CDPATH is set.
  2.2104 -if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
  2.2105 +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  2.2106  
  2.2107  relink_command=\"$relink_command\"
  2.2108  
  2.2109 @@ -4988,7 +4980,7 @@
  2.2110        else
  2.2111  	$echo \"\$relink_command_output\" >&2
  2.2112  	$rm \"\$progdir/\$file\"
  2.2113 -	exit 1
  2.2114 +	exit $EXIT_FAILURE
  2.2115        fi
  2.2116      fi
  2.2117  
  2.2118 @@ -5050,20 +5042,20 @@
  2.2119  	esac
  2.2120  	$echo >> $output "\
  2.2121        \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  2.2122 -      exit 1
  2.2123 +      exit $EXIT_FAILURE
  2.2124      fi
  2.2125    else
  2.2126      # The program doesn't exist.
  2.2127      \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  2.2128      \$echo \"This script is just a wrapper for \$program.\" 1>&2
  2.2129      $echo \"See the $PACKAGE documentation for more information.\" 1>&2
  2.2130 -    exit 1
  2.2131 +    exit $EXIT_FAILURE
  2.2132    fi
  2.2133  fi\
  2.2134  "
  2.2135  	chmod +x $output
  2.2136        fi
  2.2137 -      exit 0
  2.2138 +      exit $EXIT_SUCCESS
  2.2139        ;;
  2.2140      esac
  2.2141  
  2.2142 @@ -5086,76 +5078,21 @@
  2.2143  
  2.2144        if test -n "$addlibs"; then
  2.2145  	gentop="$output_objdir/${outputname}x"
  2.2146 -	$show "${rm}r $gentop"
  2.2147 -	$run ${rm}r "$gentop"
  2.2148 -	$show "$mkdir $gentop"
  2.2149 -	$run $mkdir "$gentop"
  2.2150 -	status=$?
  2.2151 -	if test "$status" -ne 0 && test ! -d "$gentop"; then
  2.2152 -	  exit $status
  2.2153 -	fi
  2.2154  	generated="$generated $gentop"
  2.2155  
  2.2156 -	# Add in members from convenience archives.
  2.2157 -	for xlib in $addlibs; do
  2.2158 -	  # Extract the objects.
  2.2159 -	  case $xlib in
  2.2160 -	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2.2161 -	  *) xabs=`pwd`"/$xlib" ;;
  2.2162 -	  esac
  2.2163 -	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2.2164 -	  xdir="$gentop/$xlib"
  2.2165 -
  2.2166 -	  $show "${rm}r $xdir"
  2.2167 -	  $run ${rm}r "$xdir"
  2.2168 -	  $show "$mkdir $xdir"
  2.2169 -	  $run $mkdir "$xdir"
  2.2170 -	  status=$?
  2.2171 -	  if test "$status" -ne 0 && test ! -d "$xdir"; then
  2.2172 -	    exit $status
  2.2173 -	  fi
  2.2174 -	  # We will extract separately just the conflicting names and we will no
  2.2175 -	  # longer touch any unique names. It is faster to leave these extract
  2.2176 -	  # automatically by $AR in one run.
  2.2177 -	  $show "(cd $xdir && $AR x $xabs)"
  2.2178 -	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2.2179 -	  if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
  2.2180 -	    :
  2.2181 -	  else
  2.2182 -	    $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
  2.2183 -	    $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
  2.2184 -	    $AR t "$xabs" | sort | uniq -cd | while read -r count name
  2.2185 -	    do
  2.2186 -	      i=1
  2.2187 -	      while test "$i" -le "$count"
  2.2188 -	      do
  2.2189 -	       # Put our $i before any first dot (extension)
  2.2190 -	       # Never overwrite any file
  2.2191 -	       name_to="$name"
  2.2192 -	       while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
  2.2193 -	       do
  2.2194 -		 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
  2.2195 -	       done
  2.2196 -	       $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
  2.2197 -	       $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
  2.2198 -	       i=`expr $i + 1`
  2.2199 -	      done
  2.2200 -	    done
  2.2201 -	  fi
  2.2202 -
  2.2203 -	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
  2.2204 -	done
  2.2205 +	func_extract_archives $gentop $addlibs
  2.2206 +	oldobjs="$oldobjs $func_extract_archives_result"
  2.2207        fi
  2.2208  
  2.2209        # Do each command in the archive commands.
  2.2210        if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  2.2211 -	eval cmds=\"$old_archive_from_new_cmds\"
  2.2212 +       cmds=$old_archive_from_new_cmds
  2.2213        else
  2.2214  	eval cmds=\"$old_archive_cmds\"
  2.2215  
  2.2216  	if len=`expr "X$cmds" : ".*"` &&
  2.2217  	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  2.2218 -	  :
  2.2219 +	  cmds=$old_archive_cmds
  2.2220  	else
  2.2221  	  # the command line is too long to link in one step, link in parts
  2.2222  	  $echo "using piecewise archive linking..."
  2.2223 @@ -5182,7 +5119,7 @@
  2.2224  	  for obj in $save_oldobjs
  2.2225  	  do
  2.2226  	    last_oldobj=$obj
  2.2227 -	  done  
  2.2228 +	  done
  2.2229  	  for obj in $save_oldobjs
  2.2230  	  do
  2.2231  	    oldobjs="$objlist $obj"
  2.2232 @@ -5196,7 +5133,7 @@
  2.2233  	      oldobjs=$objlist
  2.2234  	      if test "$obj" = "$last_oldobj" ; then
  2.2235  	        RANLIB=$save_RANLIB
  2.2236 -	      fi  
  2.2237 +	      fi
  2.2238  	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  2.2239  	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  2.2240  	      objlist=
  2.2241 @@ -5207,12 +5144,13 @@
  2.2242  	  if test "X$oldobjs" = "X" ; then
  2.2243  	    eval cmds=\"\$concat_cmds\"
  2.2244  	  else
  2.2245 -	    eval cmds=\"\$concat_cmds~$old_archive_cmds\"
  2.2246 +	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  2.2247  	  fi
  2.2248  	fi
  2.2249        fi
  2.2250        save_ifs="$IFS"; IFS='~'
  2.2251        for cmd in $cmds; do
  2.2252 +        eval cmd=\"$cmd\"
  2.2253  	IFS="$save_ifs"
  2.2254  	$show "$cmd"
  2.2255  	$run eval "$cmd" || exit $?
  2.2256 @@ -5244,8 +5182,12 @@
  2.2257  	fi
  2.2258        done
  2.2259        # Quote the link command for shipping.
  2.2260 -      relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
  2.2261 +      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  2.2262        relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  2.2263 +      if test "$hardcode_automatic" = yes ; then
  2.2264 +	relink_command=
  2.2265 +      fi
  2.2266 +
  2.2267  
  2.2268        # Only create the output if not a dry run.
  2.2269        if test -z "$run"; then
  2.2270 @@ -5264,7 +5206,7 @@
  2.2271  		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  2.2272  		if test -z "$libdir"; then
  2.2273  		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  2.2274 -		  exit 1
  2.2275 +		  exit $EXIT_FAILURE
  2.2276  		fi
  2.2277  		newdependency_libs="$newdependency_libs $libdir/$name"
  2.2278  		;;
  2.2279 @@ -5278,7 +5220,7 @@
  2.2280  	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  2.2281  	      if test -z "$libdir"; then
  2.2282  		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2.2283 -		exit 1
  2.2284 +		exit $EXIT_FAILURE
  2.2285  	      fi
  2.2286  	      newdlfiles="$newdlfiles $libdir/$name"
  2.2287  	    done
  2.2288 @@ -5289,11 +5231,30 @@
  2.2289  	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  2.2290  	      if test -z "$libdir"; then
  2.2291  		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2.2292 -		exit 1
  2.2293 +		exit $EXIT_FAILURE
  2.2294  	      fi
  2.2295  	      newdlprefiles="$newdlprefiles $libdir/$name"
  2.2296  	    done
  2.2297  	    dlprefiles="$newdlprefiles"
  2.2298 +	  else
  2.2299 +	    newdlfiles=
  2.2300 +	    for lib in $dlfiles; do
  2.2301 +	      case $lib in
  2.2302 +		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  2.2303 +		*) abs=`pwd`"/$lib" ;;
  2.2304 +	      esac
  2.2305 +	      newdlfiles="$newdlfiles $abs"
  2.2306 +	    done
  2.2307 +	    dlfiles="$newdlfiles"
  2.2308 +	    newdlprefiles=
  2.2309 +	    for lib in $dlprefiles; do
  2.2310 +	      case $lib in
  2.2311 +		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  2.2312 +		*) abs=`pwd`"/$lib" ;;
  2.2313 +	      esac
  2.2314 +	      newdlprefiles="$newdlprefiles $abs"
  2.2315 +	    done
  2.2316 +	    dlprefiles="$newdlprefiles"
  2.2317  	  fi
  2.2318  	  $rm $output
  2.2319  	  # place dlname in correct position for cygwin
  2.2320 @@ -5350,7 +5311,7 @@
  2.2321        $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  2.2322        ;;
  2.2323      esac
  2.2324 -    exit 0
  2.2325 +    exit $EXIT_SUCCESS
  2.2326      ;;
  2.2327  
  2.2328    # libtool install mode
  2.2329 @@ -5439,13 +5400,13 @@
  2.2330      if test -z "$install_prog"; then
  2.2331        $echo "$modename: you must specify an install program" 1>&2
  2.2332        $echo "$help" 1>&2
  2.2333 -      exit 1
  2.2334 +      exit $EXIT_FAILURE
  2.2335      fi
  2.2336  
  2.2337      if test -n "$prev"; then
  2.2338        $echo "$modename: the \`$prev' option requires an argument" 1>&2
  2.2339        $echo "$help" 1>&2
  2.2340 -      exit 1
  2.2341 +      exit $EXIT_FAILURE
  2.2342      fi
  2.2343  
  2.2344      if test -z "$files"; then
  2.2345 @@ -5455,7 +5416,7 @@
  2.2346  	$echo "$modename: you must specify a destination" 1>&2
  2.2347        fi
  2.2348        $echo "$help" 1>&2
  2.2349 -      exit 1
  2.2350 +      exit $EXIT_FAILURE
  2.2351      fi
  2.2352  
  2.2353      # Strip any trailing slash from the destination.
  2.2354 @@ -5476,7 +5437,7 @@
  2.2355        if test "$#" -gt 2; then
  2.2356  	$echo "$modename: \`$dest' is not a directory" 1>&2
  2.2357  	$echo "$help" 1>&2
  2.2358 -	exit 1
  2.2359 +	exit $EXIT_FAILURE
  2.2360        fi
  2.2361      fi
  2.2362      case $destdir in
  2.2363 @@ -5488,7 +5449,7 @@
  2.2364  	*)
  2.2365  	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  2.2366  	  $echo "$help" 1>&2
  2.2367 -	  exit 1
  2.2368 +	  exit $EXIT_FAILURE
  2.2369  	  ;;
  2.2370  	esac
  2.2371        done
  2.2372 @@ -5517,7 +5478,7 @@
  2.2373  	else
  2.2374  	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  2.2375  	  $echo "$help" 1>&2
  2.2376 -	  exit 1
  2.2377 +	  exit $EXIT_FAILURE
  2.2378  	fi
  2.2379  
  2.2380  	library_names=
  2.2381 @@ -5559,7 +5520,7 @@
  2.2382  	  # but it's something to keep an eye on.
  2.2383  	  if test "$inst_prefix_dir" = "$destdir"; then
  2.2384  	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  2.2385 -	    exit 1
  2.2386 +	    exit $EXIT_FAILURE
  2.2387  	  fi
  2.2388  
  2.2389  	  if test -n "$inst_prefix_dir"; then
  2.2390 @@ -5574,7 +5535,7 @@
  2.2391  	  if $run eval "$relink_command"; then :
  2.2392  	  else
  2.2393  	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  2.2394 -	    exit 1
  2.2395 +	    exit $EXIT_FAILURE
  2.2396  	  fi
  2.2397  	fi
  2.2398  
  2.2399 @@ -5609,10 +5570,11 @@
  2.2400  
  2.2401  	  # Do each command in the postinstall commands.
  2.2402  	  lib="$destdir/$realname"
  2.2403 -	  eval cmds=\"$postinstall_cmds\"
  2.2404 +	  cmds=$postinstall_cmds
  2.2405  	  save_ifs="$IFS"; IFS='~'
  2.2406  	  for cmd in $cmds; do
  2.2407  	    IFS="$save_ifs"
  2.2408 +	    eval cmd=\"$cmd\"
  2.2409  	    $show "$cmd"
  2.2410  	    $run eval "$cmd" || exit $?
  2.2411  	  done
  2.2412 @@ -5652,7 +5614,7 @@
  2.2413  	*)
  2.2414  	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  2.2415  	  $echo "$help" 1>&2
  2.2416 -	  exit 1
  2.2417 +	  exit $EXIT_FAILURE
  2.2418  	  ;;
  2.2419  	esac
  2.2420  
  2.2421 @@ -5670,7 +5632,7 @@
  2.2422  	  $show "$install_prog $staticobj $staticdest"
  2.2423  	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  2.2424  	fi
  2.2425 -	exit 0
  2.2426 +	exit $EXIT_SUCCESS
  2.2427  	;;
  2.2428  
  2.2429        *)
  2.2430 @@ -5724,7 +5686,7 @@
  2.2431  	  # Check the variables that should have been set.
  2.2432  	  if test -z "$notinst_deplibs"; then
  2.2433  	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  2.2434 -	    exit 1
  2.2435 +	    exit $EXIT_FAILURE
  2.2436  	  fi
  2.2437  
  2.2438  	  finalize=yes
  2.2439 @@ -5765,8 +5727,12 @@
  2.2440  	      tmpdir="/tmp"
  2.2441  	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
  2.2442  	      tmpdir="$tmpdir/libtool-$$"
  2.2443 -	      if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
  2.2444 +	      save_umask=`umask`
  2.2445 +	      umask 0077
  2.2446 +	      if $mkdir "$tmpdir"; then
  2.2447 +	        umask $save_umask
  2.2448  	      else
  2.2449 +	        umask $save_umask
  2.2450  		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  2.2451  		continue
  2.2452  	      fi
  2.2453 @@ -5825,16 +5791,17 @@
  2.2454        $show "$install_prog $file $oldlib"
  2.2455        $run eval "$install_prog \$file \$oldlib" || exit $?
  2.2456  
  2.2457 -      if test -n "$stripme" && test -n "$striplib"; then
  2.2458 +      if test -n "$stripme" && test -n "$old_striplib"; then
  2.2459  	$show "$old_striplib $oldlib"
  2.2460  	$run eval "$old_striplib $oldlib" || exit $?
  2.2461        fi
  2.2462  
  2.2463        # Do each command in the postinstall commands.
  2.2464 -      eval cmds=\"$old_postinstall_cmds\"
  2.2465 +      cmds=$old_postinstall_cmds
  2.2466        save_ifs="$IFS"; IFS='~'
  2.2467        for cmd in $cmds; do
  2.2468  	IFS="$save_ifs"
  2.2469 +	eval cmd=\"$cmd\"
  2.2470  	$show "$cmd"
  2.2471  	$run eval "$cmd" || exit $?
  2.2472        done
  2.2473 @@ -5848,9 +5815,9 @@
  2.2474      if test -n "$current_libdirs"; then
  2.2475        # Maybe just do a dry run.
  2.2476        test -n "$run" && current_libdirs=" -n$current_libdirs"
  2.2477 -      exec_cmd='$SHELL $0 --finish$current_libdirs'
  2.2478 +      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  2.2479      else
  2.2480 -      exit 0
  2.2481 +      exit $EXIT_SUCCESS
  2.2482      fi
  2.2483      ;;
  2.2484  
  2.2485 @@ -5869,10 +5836,11 @@
  2.2486        for libdir in $libdirs; do
  2.2487  	if test -n "$finish_cmds"; then
  2.2488  	  # Do each command in the finish commands.
  2.2489 -	  eval cmds=\"$finish_cmds\"
  2.2490 +	  cmds=$finish_cmds
  2.2491  	  save_ifs="$IFS"; IFS='~'
  2.2492  	  for cmd in $cmds; do
  2.2493  	    IFS="$save_ifs"
  2.2494 +	    eval cmd=\"$cmd\"
  2.2495  	    $show "$cmd"
  2.2496  	    $run eval "$cmd" || admincmds="$admincmds
  2.2497         $cmd"
  2.2498 @@ -5889,7 +5857,7 @@
  2.2499      fi
  2.2500  
  2.2501      # Exit here if they wanted silent mode.
  2.2502 -    test "$show" = : && exit 0
  2.2503 +    test "$show" = : && exit $EXIT_SUCCESS
  2.2504  
  2.2505      $echo "----------------------------------------------------------------------"
  2.2506      $echo "Libraries have been installed in:"
  2.2507 @@ -5925,7 +5893,7 @@
  2.2508      $echo "See any operating system documentation about shared libraries for"
  2.2509      $echo "more information, such as the ld(1) and ld.so(8) manual pages."
  2.2510      $echo "----------------------------------------------------------------------"
  2.2511 -    exit 0
  2.2512 +    exit $EXIT_SUCCESS
  2.2513      ;;
  2.2514  
  2.2515    # libtool execute mode
  2.2516 @@ -5937,7 +5905,7 @@
  2.2517      if test -z "$cmd"; then
  2.2518        $echo "$modename: you must specify a COMMAND" 1>&2
  2.2519        $echo "$help"
  2.2520 -      exit 1
  2.2521 +      exit $EXIT_FAILURE
  2.2522      fi
  2.2523  
  2.2524      # Handle -dlopen flags immediately.
  2.2525 @@ -5945,7 +5913,7 @@
  2.2526        if test ! -f "$file"; then
  2.2527  	$echo "$modename: \`$file' is not a file" 1>&2
  2.2528  	$echo "$help" 1>&2
  2.2529 -	exit 1
  2.2530 +	exit $EXIT_FAILURE
  2.2531        fi
  2.2532  
  2.2533        dir=
  2.2534 @@ -5956,7 +5924,7 @@
  2.2535  	else
  2.2536  	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2.2537  	  $echo "$help" 1>&2
  2.2538 -	  exit 1
  2.2539 +	  exit $EXIT_FAILURE
  2.2540  	fi
  2.2541  
  2.2542  	# Read the libtool library.
  2.2543 @@ -5983,7 +5951,7 @@
  2.2544  	  dir="$dir/$objdir"
  2.2545  	else
  2.2546  	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  2.2547 -	  exit 1
  2.2548 +	  exit $EXIT_FAILURE
  2.2549  	fi
  2.2550  	;;
  2.2551  
  2.2552 @@ -6063,7 +6031,7 @@
  2.2553  	$echo "export $shlibpath_var"
  2.2554        fi
  2.2555        $echo "$cmd$args"
  2.2556 -      exit 0
  2.2557 +      exit $EXIT_SUCCESS
  2.2558      fi
  2.2559      ;;
  2.2560  
  2.2561 @@ -6091,7 +6059,7 @@
  2.2562      if test -z "$rm"; then
  2.2563        $echo "$modename: you must specify an RM program" 1>&2
  2.2564        $echo "$help" 1>&2
  2.2565 -      exit 1
  2.2566 +      exit $EXIT_FAILURE
  2.2567      fi
  2.2568  
  2.2569      rmdirs=
  2.2570 @@ -6146,10 +6114,11 @@
  2.2571  	  if test "$mode" = uninstall; then
  2.2572  	    if test -n "$library_names"; then
  2.2573  	      # Do each command in the postuninstall commands.
  2.2574 -	      eval cmds=\"$postuninstall_cmds\"
  2.2575 +	      cmds=$postuninstall_cmds
  2.2576  	      save_ifs="$IFS"; IFS='~'
  2.2577  	      for cmd in $cmds; do
  2.2578  		IFS="$save_ifs"
  2.2579 +		eval cmd=\"$cmd\"
  2.2580  		$show "$cmd"
  2.2581  		$run eval "$cmd"
  2.2582  		if test "$?" -ne 0 && test "$rmforce" != yes; then
  2.2583 @@ -6161,10 +6130,11 @@
  2.2584  
  2.2585  	    if test -n "$old_library"; then
  2.2586  	      # Do each command in the old_postuninstall commands.
  2.2587 -	      eval cmds=\"$old_postuninstall_cmds\"
  2.2588 +	      cmds=$old_postuninstall_cmds
  2.2589  	      save_ifs="$IFS"; IFS='~'
  2.2590  	      for cmd in $cmds; do
  2.2591  		IFS="$save_ifs"
  2.2592 +		eval cmd=\"$cmd\"
  2.2593  		$show "$cmd"
  2.2594  		$run eval "$cmd"
  2.2595  		if test "$?" -ne 0 && test "$rmforce" != yes; then
  2.2596 @@ -6203,7 +6173,7 @@
  2.2597  	if test "$mode" = clean ; then
  2.2598  	  noexename=$name
  2.2599  	  case $file in
  2.2600 -	  *.exe) 
  2.2601 +	  *.exe)
  2.2602  	    file=`$echo $file|${SED} 's,.exe$,,'`
  2.2603  	    noexename=`$echo $name|${SED} 's,.exe$,,'`
  2.2604  	    # $file with .exe has already been added to rmfiles,
  2.2605 @@ -6248,20 +6218,20 @@
  2.2606    "")
  2.2607      $echo "$modename: you must specify a MODE" 1>&2
  2.2608      $echo "$generic_help" 1>&2
  2.2609 -    exit 1
  2.2610 +    exit $EXIT_FAILURE
  2.2611      ;;
  2.2612    esac
  2.2613  
  2.2614    if test -z "$exec_cmd"; then
  2.2615      $echo "$modename: invalid operation mode \`$mode'" 1>&2
  2.2616      $echo "$generic_help" 1>&2
  2.2617 -    exit 1
  2.2618 +    exit $EXIT_FAILURE
  2.2619    fi
  2.2620  fi # test -z "$show_help"
  2.2621  
  2.2622  if test -n "$exec_cmd"; then
  2.2623    eval exec $exec_cmd
  2.2624 -  exit 1
  2.2625 +  exit $EXIT_FAILURE
  2.2626  fi
  2.2627  
  2.2628  # We need to display help for each of the modes.
  2.2629 @@ -6297,7 +6267,7 @@
  2.2630  a more detailed description of MODE.
  2.2631  
  2.2632  Report bugs to <bug-libtool@gnu.org>."
  2.2633 -  exit 0
  2.2634 +  exit $EXIT_SUCCESS
  2.2635    ;;
  2.2636  
  2.2637  clean)
  2.2638 @@ -6409,6 +6379,8 @@
  2.2639    -no-undefined     declare that a library does not refer to external symbols
  2.2640    -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  2.2641    -objectlist FILE  Use a list of object files found in FILE to specify objects
  2.2642 +  -precious-files-regex REGEX
  2.2643 +                    don't remove output files matching REGEX
  2.2644    -release RELEASE  specify package release information
  2.2645    -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  2.2646    -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  2.2647 @@ -6450,14 +6422,14 @@
  2.2648  *)
  2.2649    $echo "$modename: invalid operation mode \`$mode'" 1>&2
  2.2650    $echo "$help" 1>&2
  2.2651 -  exit 1
  2.2652 +  exit $EXIT_FAILURE
  2.2653    ;;
  2.2654  esac
  2.2655  
  2.2656  $echo
  2.2657  $echo "Try \`$modename --help' for more information about other modes."
  2.2658  
  2.2659 -exit 0
  2.2660 +exit $EXIT_SUCCESS
  2.2661  
  2.2662  # The TAGs below are defined such that we never get into a situation
  2.2663  # in which we disable both kinds of libraries.  Given conflicting