aboutsummaryrefslogtreecommitdiff
path: root/libjava/libltdl
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-09-10 08:04:40 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-09-10 08:04:40 +0000
commit205f5ac60a175bc1739ef4edba1751c50d2aaa89 (patch)
treea4fd9fbd2edd47490b8d1386b9db7942536ab0d8 /libjava/libltdl
parent8a24138dca956850680b5c573c443222127a65ff (diff)
downloadgcc-205f5ac60a175bc1739ef4edba1751c50d2aaa89.zip
gcc-205f5ac60a175bc1739ef4edba1751c50d2aaa89.tar.gz
gcc-205f5ac60a175bc1739ef4edba1751c50d2aaa89.tar.bz2
* Updated from libtool multi-language branch.
From-SVN: r36295
Diffstat (limited to 'libjava/libltdl')
-rw-r--r--libjava/libltdl/ChangeLog4
-rw-r--r--libjava/libltdl/Makefile.am2
-rw-r--r--libjava/libltdl/Makefile.in40
-rw-r--r--libjava/libltdl/acinclude.m4947
-rw-r--r--libjava/libltdl/aclocal.m4948
-rw-r--r--libjava/libltdl/config.h.in33
-rwxr-xr-xlibjava/libltdl/configure2145
-rw-r--r--libjava/libltdl/configure.in351
-rw-r--r--libjava/libltdl/ltdl.c1301
9 files changed, 4265 insertions, 1506 deletions
diff --git a/libjava/libltdl/ChangeLog b/libjava/libltdl/ChangeLog
index 8a37f20..a013585 100644
--- a/libjava/libltdl/ChangeLog
+++ b/libjava/libltdl/ChangeLog
@@ -1,3 +1,7 @@
+2000-09-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * Updated from libtool multi-language branch.
+
2000-02-14 Tom Tromey <tromey@cygnus.com>
* ltdl.c: If HAVE_BOEHM_GC defined, includ gc.h.
diff --git a/libjava/libltdl/Makefile.am b/libjava/libltdl/Makefile.am
index 2e0f94d..7850029 100644
--- a/libjava/libltdl/Makefile.am
+++ b/libjava/libltdl/Makefile.am
@@ -16,7 +16,7 @@ noinst_LTLIBRARIES = libltdlc.la
endif
libltdl_la_SOURCES = ltdl.c
-libltdl_la_LDFLAGS = -version-info 1:2:1
+libltdl_la_LDFLAGS = -no-undefined -version-info 2:0:2
libltdl_la_LIBADD = $(LIBADD_DL)
libltdlc_la_SOURCES = ltdl.c
diff --git a/libjava/libltdl/Makefile.in b/libjava/libltdl/Makefile.in
index d4de792..bfea157 100644
--- a/libjava/libltdl/Makefile.in
+++ b/libjava/libltdl/Makefile.in
@@ -61,8 +61,13 @@ host_alias = @host_alias@
host_triplet = @host@
AS = @AS@
CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DLLTOOL = @DLLTOOL@
+EXEEXT = @EXEEXT@
GCINCS = @GCINCS@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
LIBADD_DL = @LIBADD_DL@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
@@ -70,22 +75,24 @@ LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
+STRIP = @STRIP@
VERSION = @VERSION@
-AUTOMAKE_OPTIONS = no-dependencies foreign no-installinfo
+AUTOMAKE_OPTIONS = no-dependencies foreign
INCLUDES = $(GCINCS)
-@INSTALL_LTDL_TRUE@include_HEADERS = @INSTALL_LTDL_TRUE@ltdl.h
-@INSTALL_LTDL_TRUE@lib_LTLIBRARIES = @INSTALL_LTDL_TRUE@libltdl.la
-@INSTALL_LTDL_FALSE@noinst_HEADERS = @INSTALL_LTDL_FALSE@ltdl.h
+@INSTALL_LTDL_TRUE@include_HEADERS = ltdl.h
+@INSTALL_LTDL_TRUE@lib_LTLIBRARIES = libltdl.la
+@INSTALL_LTDL_FALSE@noinst_HEADERS = ltdl.h
-@CONVENIENCE_LTDL_TRUE@noinst_LTLIBRARIES = @CONVENIENCE_LTDL_TRUE@libltdlc.la
+@CONVENIENCE_LTDL_TRUE@noinst_LTLIBRARIES = libltdlc.la
libltdl_la_SOURCES = ltdl.c
-libltdl_la_LDFLAGS = -version-info 1:2:1
+libltdl_la_LDFLAGS = -no-undefined -version-info 2:0:2
libltdl_la_LIBADD = $(LIBADD_DL)
libltdlc_la_SOURCES = ltdl.c
@@ -127,7 +134,7 @@ OBJECTS = $(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .lo .o .s
+.SUFFIXES: .S .c .lo .o .obj .s
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
@@ -208,6 +215,11 @@ maintainer-clean-noinstLTLIBRARIES:
.c.o:
$(COMPILE) -c $<
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+ $(COMPILE) -c `cygpath -w $<`
+
.s.o:
$(COMPILE) -c $<
@@ -216,6 +228,7 @@ maintainer-clean-noinstLTLIBRARIES:
mostlyclean-compile:
-rm -f *.o core *.core
+ -rm -f *.$(OBJEXT)
clean-compile:
@@ -349,8 +362,6 @@ check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
all-recursive-am: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -427,12 +438,11 @@ maintainer-clean-compile mostlyclean-libtool distclean-libtool \
clean-libtool maintainer-clean-libtool uninstall-includeHEADERS \
install-includeHEADERS tags mostlyclean-tags distclean-tags clean-tags \
maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-info-am install-info \
-all-recursive-am install-exec-am install-exec install-data-am \
-install-data install-am install uninstall-am uninstall all-redirect \
-all-am all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+installcheck-am installcheck all-recursive-am install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
ltdl.lo: ltdl.h config.h
diff --git a/libjava/libltdl/acinclude.m4 b/libjava/libltdl/acinclude.m4
index 47abe43..b838418 100644
--- a/libjava/libltdl/acinclude.m4
+++ b/libjava/libltdl/acinclude.m4
@@ -1,5 +1,5 @@
-## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
-## Copyright (C) 1996-1999 Free Software Foundation, Inc.
+## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
+## Copyright (C) 1996-1999,2000 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
## This program is free software; you can redistribute it and/or modify
@@ -21,27 +21,53 @@
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
-# serial 40 AC_PROG_LIBTOOL
-AC_DEFUN(AC_PROG_LIBTOOL,
+# serial 45 AC_PROG_LIBTOOL
+AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL])
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [AC_LIBTOOL_CXX],
+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])])])])
+
+AC_DEFUN(_AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
# Save cache, so that ltconfig can load it
AC_CACHE_SAVE
# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC="$MAGIC" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_CACHE_LOAD
# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -59,18 +85,29 @@ AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
dnl
-case "$target" in
-NONE) lt_target="$host" ;;
-*) lt_target="$target" ;;
+# Only perform the check for file, if the check method requires it
+case "$deplibs_check_method" in
+file_magic*)
+ if test "$file_magic_cmd" = '${MAGIC}'; then
+ AC_PATH_MAGIC
+ fi
+ ;;
esac
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
@@ -87,9 +124,15 @@ AC_ARG_ENABLE(libtool-lock,
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+AC_ARG_WITH(pic,
+ [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
+ pic_mode="$withval", pic_mode=default)
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$lt_target" in
+case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
@@ -114,7 +157,10 @@ case "$lt_target" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+ [AC_LANG_SAVE
+ AC_LANG_C
+ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_RESTORE])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
@@ -126,8 +172,31 @@ ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
+
+ # recent cygwin and mingw systems supply a stub DllMain which the user
+ # can override, but on older systems we have to supply one
+ AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
+ [AC_TRY_LINK([],
+ [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
+ DllMain (0, 0, 0);],
+ [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
+
+ case "$host/$CC" in
+ *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
+ # old mingw systems require "-dll" to link a DLL, while more recent ones
+ # require "-mdll"
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mdll"
+ AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
+ [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
+ CFLAGS="$SAVE_CFLAGS" ;;
+ *-*-cygwin*)
+ # cygwin systems need to pass --dll to the linker, and not link
+ # crt.o which will require a WinMain@16 definition.
+ lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
+ esac
;;
-])
+ ])
esac
])
@@ -233,10 +302,94 @@ esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
-# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
+# AC_LIBTOOL_PICMODE - implement the --with-pic flag
+# Usage: AC_LIBTOOL_PICMODE[(MODE)]
+# Where MODE is either `yes' or `no'. If omitted, it defaults to
+# `both'.
+AC_DEFUN(AC_LIBTOOL_PICMODE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)])
+
+
+# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
+AC_DEFUN(AC_PATH_TOOL_PREFIX,
+[AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC,
+[case "$MAGIC" in
+ /*)
+ lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC="$MAGIC"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="ifelse([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case "$deplibs_check_method" in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC="$lt_cv_path_MAGIC"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC="$ac_save_MAGIC"
+ ;;
+esac])
+MAGIC="$lt_cv_path_MAGIC"
+if test -n "$MAGIC"; then
+ AC_MSG_RESULT($MAGIC)
+else
+ AC_MSG_RESULT(no)
+fi
+])
+
+
+# AC_PATH_MAGIC - find a file program which can recognise a shared library
+AC_DEFUN(AC_PATH_MAGIC,
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
+if test -z "$lt_cv_path_MAGIC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
+ else
+ MAGIC=:
+ fi
+fi
+])
+
+
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
@@ -249,7 +402,13 @@ ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
- ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
@@ -316,8 +475,172 @@ if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
else
ac_cv_prog_gnu_ld=no
fi])
+with_gnu_ld=$ac_cv_prog_gnu_ld
])
+# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN(AC_PROG_LD_RELOAD_FLAG,
+[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
+[lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+])
+
+# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN(AC_DEPLIBS_CHECK_METHOD,
+[AC_CACHE_CHECK([how to recognise dependant libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='${MAGIC}'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case "$host_os" in
+aix4*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ changequote([, ])dnl
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin* | mingw*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='${OBJDUMP} -f'
+ ;;
+
+freebsd* )
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case "$host_cpu" in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ changequote([, ])dnl
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20*)
+ # TODO: Does this work for hpux-11 too?
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+
+irix5* | irix6*)
+ case "$host_os" in
+ irix5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case "$LD" in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ changequote(,)dnl
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ changequote([, ])dnl
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ case "$host_cpu" in
+ alpha* | i*86 | powerpc* | sparc* | ia64* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ changequote([, ])dnl
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
+ else
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ changequote([, ])dnl
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case "$host_vendor" in
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ motorola)
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ changequote([, ])dnl
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ esac
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+])
+
+
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
@@ -329,18 +652,20 @@ else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+ if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ # Tru64's nm complains that /dev/null is an invalid object file
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ ac_cv_path_NM="$tmp_nm -B"
break
- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
@@ -356,7 +681,7 @@ AC_MSG_RESULT([$NM])
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
-case "$lt_target" in
+case "$host" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
@@ -371,31 +696,35 @@ esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library, adds --enable-ltdl-convenience to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
+# the libltdl convenience library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-convenience to the
+# configure arguments. Note that LIBLTDL and INCLTDL are not
+# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
+# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
+# with '${top_builddir}/' and INCLTDL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library, and adds --enable-ltdl-install to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
+# the libltdl installable library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-install to the configure
+# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
+# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
+# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
+# with '${top_srcdir}/' (note the single quotes!). If your package is
+# not flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
@@ -408,8 +737,8 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
@@ -417,6 +746,74 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
fi
])
+# If this macro is not defined by Autoconf, define it here.
+ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [define([AC_PROVIDE_IFELSE],
+ [ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+# AC_LIBTOOL_CXX - enable support for C++ libraries
+AC_DEFUN(AC_LIBTOOL_CXX,[AC_REQUIRE([_AC_LIBTOOL_CXX])])
+AC_DEFUN(_AC_LIBTOOL_CXX,
+[AC_REQUIRE([AC_PROG_LIBTOOL])
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
+dnl is set to the C++ compiler.
+AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC="$MAGIC" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
+|| AC_MSG_ERROR([libtool tag configuration failed])
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+# AC_LIBTOOL_GCJ - enable support for GCJ libraries
+AC_DEFUN(AC_LIBTOOL_GCJ,[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
+AC_DEFUN(_AC_LIBTOOL_GCJ,
+[AC_REQUIRE([AC_PROG_LIBTOOL])
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
+dnl is set to the C++ compiler.
+AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="" \
+MAGIC="$MAGIC" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
+|| AC_MSG_ERROR([libtool tag configuration failed])
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
@@ -428,3 +825,465 @@ AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl
+
+AC_DEFUN([LT_AC_PROG_GCJ],[
+ AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
+])
+## ltdl.m4 - Configure ltdl for the target system. -*-Shell-script-*-
+## Copyright (C) 1999-2000 Free Software Foundation, Inc.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# serial 1 AC_LIB_LTDL
+
+AC_DEFUN(AC_LIB_LTDL,
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_C_CONST])dnl
+AC_REQUIRE([AC_C_INLINE])dnl
+
+dnl AC_LIB_LTDL must perform all the checks necessary for compilation
+dnl of the ltdl objects -- including compiler checks (above) and header
+dnl checks (below).
+AC_REQUIRE([AC_HEADER_STDC])dnl
+
+AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
+AC_CHECK_HEADERS(string.h strings.h, break)
+AC_CHECK_FUNCS(strchr index, break)
+AC_CHECK_FUNCS(strrchr rindex, break)
+AC_CHECK_FUNCS(strcmp)
+
+AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl
+AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl
+AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl
+AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl
+AC_REQUIRE([AC_LTDL_OBJDIR])dnl
+AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl
+AC_REQUIRE([AC_LTDL_DLLIB])dnl
+AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
+])
+
+AC_DEFUN(AC_LTDL_ENABLE_INSTALL,
+[AC_ARG_ENABLE(ltdl-install,
+[ --enable-ltdl-install install libltdl])
+
+AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
+AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
+])])
+
+
+AC_DEFUN(AC_LTDL_SNARF_CONFIG,
+[# Read the libtool configuration
+rm -f conftest
+./libtool --config > conftest
+. ./conftest
+rm -f conftest
+])
+
+AC_DEFUN(AC_LTDL_SHLIBEXT,
+[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
+AC_CACHE_CHECK([which extension is used for shared libraries],
+ libltdl_cv_shlibext, [dnl
+(
+ last=
+ for spec in $library_names_spec; do
+ last="$spec"
+ done
+changequote(, )
+ echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
+changequote([, ])
+)
+libltdl_cv_shlibext=`cat conftest`
+rm -f conftest
+])
+if test -n "$libltdl_cv_shlibext"; then
+ AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
+ [Define to the extension used for shared libraries, say, ".so". ])
+fi
+])
+
+AC_DEFUN(AC_LTDL_SHLIBPATH,
+[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
+AC_CACHE_CHECK([which variable specifies run-time library path],
+ libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"])
+if test -n "$libltdl_cv_shlibpath_var"; then
+ AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
+ [Define to the name of the environment variable that determines the dynamic library search path. ])
+fi
+])
+
+AC_DEFUN(AC_LTDL_SYSSEARCHPATH,
+[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
+AC_CACHE_CHECK([for the default library search path],
+ libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
+if test -n "$libltdl_cv_sys_search_path"; then
+ case "$host" in
+ *-*-mingw*) pathsep=";" ;;
+ *) pathsep=":" ;;
+ esac
+ sys_search_path=
+ for dir in $libltdl_cv_sys_search_path; do
+ if test -z "$sys_search_path"; then
+ sys_search_path="$dir"
+ else
+ sys_search_path="$sys_search_path$pathsep$dir"
+ fi
+ done
+ AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
+ [Define to the system default library search path. ])
+fi
+])
+
+AC_DEFUN(AC_LTDL_OBJDIR,
+[AC_CACHE_CHECK([for objdir],
+ libltdl_cv_objdir, [libltdl_cv_objdir="$objdir"
+if test -n "$objdir"; then
+ :
+else
+ rm -f .libs 2>/dev/null
+ mkdir .libs 2>/dev/null
+ if test -d .libs; then
+ libltdl_cv_objdir=.libs
+ else
+ # MS-DOS does not allow filenames that begin with a dot.
+ libltdl_cv_objdir=_libs
+ fi
+rmdir .libs 2>/dev/null
+fi])
+AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries. ])
+])
+
+AC_DEFUN(AC_LTDL_DLPREOPEN,
+[AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
+AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
+ libltdl_cv_preloaded_symbols, [dnl
+ if test -n "$global_symbol_pipe"; then
+ libltdl_cv_preloaded_symbols=yes
+ else
+ libltdl_cv_preloaded_symbols=no
+ fi
+])
+if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
+ AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
+ [Define if libtool can extract symbol lists from object files. ])
+fi
+])
+
+AC_DEFUN(AC_LTDL_DLLIB,
+[LIBADD_DL=
+AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
+ [Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"],
+[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
+ [Define if you have the libdl library or equivalent.])],
+[AC_CHECK_LIB(svld, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
+ [Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld"]
+)])])
+AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
+ [Define if you have the shl_load function.])],
+[AC_CHECK_LIB(dld, shl_load,
+ [AC_DEFINE(HAVE_SHL_LOAD, 1,
+ [Define if you have the shl_load function.])
+ LIBADD_DL="$LIBADD_DL -ldld"])
+])
+AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
+ [Define if you have the GNU dld library.])dnl
+test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
+AC_SUBST(LIBADD_DL)
+
+if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
+ LIBS_SAVE="$LIBS"
+ LIBS="$LIBS $LIBADD_DL"
+ AC_CHECK_FUNCS(dlerror)
+ LIBS="$LIBS_SAVE"
+fi
+])
+
+AC_DEFUN(AC_LTDL_GLOBAL_SYMBOL_PIPE,
+[dnl Check for command to grab the raw symbol name followed
+dnl by C symbol name from nm.
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output])
+AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
+[# These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix. What could be older than Ultrix?!! ;)}
+
+changequote(,)dnl
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+ ac_symcode='[BCDT]'
+ ;;
+cygwin* | mingw*)
+ ac_symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
+irix*)
+ ac_symcode='[BCDEGRST]'
+ ;;
+solaris*)
+ ac_symcode='[BDT]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ ac_symcode='[ABCDGISTW]'
+fi
+changequote([,])dnl
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ ac_pipe_works=no
+ rm -f conftest.$ac_ext
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+
+ # Try sorting and uniquifying the output.
+ if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+ mv -f "$ac_nlist"T "$ac_nlist"
+ else
+ rm -f "$ac_nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+ cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+ cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+changequote(,)dnl
+lt_preloaded_symbols[] =
+changequote([,])dnl
+{
+EOF
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+ cat <<\EOF >> conftest.c
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ ac_save_LIBS="$LIBS"
+ ac_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ ac_pipe_works=yes
+ else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+ fi
+ LIBS="$ac_save_LIBS"
+ CFLAGS="$ac_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ fi
+ else
+ echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
+ fi
+ else
+ echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ fi
+ else
+ echo "$progname: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$ac_pipe_works" = yes; then
+ if test x"$ac_symprfx" = x"_"; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ ac_cv_sys_symbol_underscore=no
+ fi
+ break
+ else
+ ac_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+ ac_result=no
+fi
+AC_MSG_RESULT($ac_result)
+])
+
+AC_DEFUN(AC_LTDL_SYMBOL_USCORE,
+[dnl does the compiler prefix global symbols with an underscore?
+AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
+AC_MSG_CHECKING([for _ prefix in compiled symbols])
+AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
+[ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+ :
+ else
+ echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ fi
+ fi
+ else
+ echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ fi
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+fi
+rm -rf conftest*
+])
+AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
+AC_LTDL_DLSYM_USCORE
+])
+
+AC_DEFUN(AC_LTDL_DLSYM_USCORE,
+[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
+if test x"$ac_cv_sys_symbol_underscore" = xyes; then
+ if test x"$ac_cv_func_dlopen" = xyes ||
+ test x"$ac_cv_lib_dl_dlopen" = xyes ; then
+ AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
+ libltdl_cv_need_uscore, [dnl
+ AC_TRY_RUN([
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LTDL_GLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LTDL_GLOBAL DL_GLOBAL
+# else
+# define LTDL_GLOBAL 0
+# endif
+#endif
+
+/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LTDL_LAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LTDL_LAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LTDL_LAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LTDL_LAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LTDL_LAZY_OR_NOW DL_NOW
+# else
+# define LTDL_LAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+fnord() { int i=42;}
+main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
+ if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
+ if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
+], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
+ libltdl_cv_need_uscore=cross
+)])
+ fi
+fi
+
+if test x"$libltdl_cv_need_uscore" = xyes; then
+ AC_DEFINE(NEED_USCORE, 1,
+ [Define if dlsym() requires a leading underscode in symbol names. ])
+fi
+])
diff --git a/libjava/libltdl/aclocal.m4 b/libjava/libltdl/aclocal.m4
index 5e6ad02..43a94db 100644
--- a/libjava/libltdl/aclocal.m4
+++ b/libjava/libltdl/aclocal.m4
@@ -11,27 +11,53 @@ dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
-# serial 40 AC_PROG_LIBTOOL
-AC_DEFUN(AC_PROG_LIBTOOL,
+# serial 45 AC_PROG_LIBTOOL
+AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL])
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [AC_LIBTOOL_CXX],
+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])])])])
+
+AC_DEFUN(_AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
# Save cache, so that ltconfig can load it
AC_CACHE_SAVE
# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC="$MAGIC" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_CACHE_LOAD
# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -49,18 +75,29 @@ AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
dnl
-case "$target" in
-NONE) lt_target="$host" ;;
-*) lt_target="$target" ;;
+# Only perform the check for file, if the check method requires it
+case "$deplibs_check_method" in
+file_magic*)
+ if test "$file_magic_cmd" = '${MAGIC}'; then
+ AC_PATH_MAGIC
+ fi
+ ;;
esac
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
@@ -77,9 +114,15 @@ AC_ARG_ENABLE(libtool-lock,
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+AC_ARG_WITH(pic,
+ [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
+ pic_mode="$withval", pic_mode=default)
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$lt_target" in
+case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
@@ -104,7 +147,10 @@ case "$lt_target" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+ [AC_LANG_SAVE
+ AC_LANG_C
+ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_RESTORE])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
@@ -116,8 +162,31 @@ ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
+
+ # recent cygwin and mingw systems supply a stub DllMain which the user
+ # can override, but on older systems we have to supply one
+ AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
+ [AC_TRY_LINK([],
+ [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
+ DllMain (0, 0, 0);],
+ [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
+
+ case "$host/$CC" in
+ *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
+ # old mingw systems require "-dll" to link a DLL, while more recent ones
+ # require "-mdll"
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mdll"
+ AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
+ [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
+ CFLAGS="$SAVE_CFLAGS" ;;
+ *-*-cygwin*)
+ # cygwin systems need to pass --dll to the linker, and not link
+ # crt.o which will require a WinMain@16 definition.
+ lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
+ esac
;;
-])
+ ])
esac
])
@@ -223,10 +292,94 @@ esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
-# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
+# AC_LIBTOOL_PICMODE - implement the --with-pic flag
+# Usage: AC_LIBTOOL_PICMODE[(MODE)]
+# Where MODE is either `yes' or `no'. If omitted, it defaults to
+# `both'.
+AC_DEFUN(AC_LIBTOOL_PICMODE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)])
+
+
+# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
+AC_DEFUN(AC_PATH_TOOL_PREFIX,
+[AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC,
+[case "$MAGIC" in
+ /*)
+ lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC="$MAGIC"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="ifelse([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case "$deplibs_check_method" in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC="$lt_cv_path_MAGIC"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC="$ac_save_MAGIC"
+ ;;
+esac])
+MAGIC="$lt_cv_path_MAGIC"
+if test -n "$MAGIC"; then
+ AC_MSG_RESULT($MAGIC)
+else
+ AC_MSG_RESULT(no)
+fi
+])
+
+
+# AC_PATH_MAGIC - find a file program which can recognise a shared library
+AC_DEFUN(AC_PATH_MAGIC,
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
+if test -z "$lt_cv_path_MAGIC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
+ else
+ MAGIC=:
+ fi
+fi
+])
+
+
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
@@ -239,7 +392,13 @@ ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
- ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
@@ -306,8 +465,172 @@ if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
else
ac_cv_prog_gnu_ld=no
fi])
+with_gnu_ld=$ac_cv_prog_gnu_ld
])
+# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN(AC_PROG_LD_RELOAD_FLAG,
+[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
+[lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+])
+
+# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN(AC_DEPLIBS_CHECK_METHOD,
+[AC_CACHE_CHECK([how to recognise dependant libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='${MAGIC}'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case "$host_os" in
+aix4*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ changequote([, ])dnl
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin* | mingw*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='${OBJDUMP} -f'
+ ;;
+
+freebsd* )
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case "$host_cpu" in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ changequote([, ])dnl
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20*)
+ # TODO: Does this work for hpux-11 too?
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+
+irix5* | irix6*)
+ case "$host_os" in
+ irix5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case "$LD" in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ changequote(,)dnl
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ changequote([, ])dnl
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ case "$host_cpu" in
+ alpha* | i*86 | powerpc* | sparc* | ia64* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ changequote([, ])dnl
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
+ else
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ changequote([, ])dnl
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case "$host_vendor" in
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ motorola)
+ changequote(,)dnl
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ changequote([, ])dnl
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ esac
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+])
+
+
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
@@ -319,18 +642,20 @@ else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+ if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ # Tru64's nm complains that /dev/null is an invalid object file
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ ac_cv_path_NM="$tmp_nm -B"
break
- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
@@ -346,7 +671,7 @@ AC_MSG_RESULT([$NM])
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
-case "$lt_target" in
+case "$host" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
@@ -361,31 +686,35 @@ esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library, adds --enable-ltdl-convenience to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
+# the libltdl convenience library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-convenience to the
+# configure arguments. Note that LIBLTDL and INCLTDL are not
+# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
+# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
+# with '${top_builddir}/' and INCLTDL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library, and adds --enable-ltdl-install to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
+# the libltdl installable library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-install to the configure
+# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
+# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
+# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
+# with '${top_srcdir}/' (note the single quotes!). If your package is
+# not flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
@@ -398,8 +727,8 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
@@ -407,6 +736,74 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
fi
])
+# If this macro is not defined by Autoconf, define it here.
+ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [define([AC_PROVIDE_IFELSE],
+ [ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+# AC_LIBTOOL_CXX - enable support for C++ libraries
+AC_DEFUN(AC_LIBTOOL_CXX,[AC_REQUIRE([_AC_LIBTOOL_CXX])])
+AC_DEFUN(_AC_LIBTOOL_CXX,
+[AC_REQUIRE([AC_PROG_LIBTOOL])
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
+dnl is set to the C++ compiler.
+AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC="$MAGIC" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
+|| AC_MSG_ERROR([libtool tag configuration failed])
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+# AC_LIBTOOL_GCJ - enable support for GCJ libraries
+AC_DEFUN(AC_LIBTOOL_GCJ,[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
+AC_DEFUN(_AC_LIBTOOL_GCJ,
+[AC_REQUIRE([AC_PROG_LIBTOOL])
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
+dnl is set to the C++ compiler.
+AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="" \
+MAGIC="$MAGIC" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
+|| AC_MSG_ERROR([libtool tag configuration failed])
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
@@ -419,6 +816,460 @@ AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl
+AC_DEFUN([LT_AC_PROG_GCJ],[
+ AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
+])
+
+# serial 1 AC_LIB_LTDL
+
+AC_DEFUN(AC_LIB_LTDL,
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_C_CONST])dnl
+AC_REQUIRE([AC_C_INLINE])dnl
+
+dnl AC_LIB_LTDL must perform all the checks necessary for compilation
+dnl of the ltdl objects -- including compiler checks (above) and header
+dnl checks (below).
+AC_REQUIRE([AC_HEADER_STDC])dnl
+
+AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
+AC_CHECK_HEADERS(string.h strings.h, break)
+AC_CHECK_FUNCS(strchr index, break)
+AC_CHECK_FUNCS(strrchr rindex, break)
+AC_CHECK_FUNCS(strcmp)
+
+AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl
+AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl
+AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl
+AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl
+AC_REQUIRE([AC_LTDL_OBJDIR])dnl
+AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl
+AC_REQUIRE([AC_LTDL_DLLIB])dnl
+AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
+])
+
+AC_DEFUN(AC_LTDL_ENABLE_INSTALL,
+[AC_ARG_ENABLE(ltdl-install,
+[ --enable-ltdl-install install libltdl])
+
+AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
+AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
+])])
+
+
+AC_DEFUN(AC_LTDL_SNARF_CONFIG,
+[# Read the libtool configuration
+rm -f conftest
+./libtool --config > conftest
+. ./conftest
+rm -f conftest
+])
+
+AC_DEFUN(AC_LTDL_SHLIBEXT,
+[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
+AC_CACHE_CHECK([which extension is used for shared libraries],
+ libltdl_cv_shlibext, [dnl
+(
+ last=
+ for spec in $library_names_spec; do
+ last="$spec"
+ done
+changequote(, )
+ echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
+changequote([, ])
+)
+libltdl_cv_shlibext=`cat conftest`
+rm -f conftest
+])
+if test -n "$libltdl_cv_shlibext"; then
+ AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
+ [Define to the extension used for shared libraries, say, ".so". ])
+fi
+])
+
+AC_DEFUN(AC_LTDL_SHLIBPATH,
+[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
+AC_CACHE_CHECK([which variable specifies run-time library path],
+ libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"])
+if test -n "$libltdl_cv_shlibpath_var"; then
+ AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
+ [Define to the name of the environment variable that determines the dynamic library search path. ])
+fi
+])
+
+AC_DEFUN(AC_LTDL_SYSSEARCHPATH,
+[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
+AC_CACHE_CHECK([for the default library search path],
+ libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
+if test -n "$libltdl_cv_sys_search_path"; then
+ case "$host" in
+ *-*-mingw*) pathsep=";" ;;
+ *) pathsep=":" ;;
+ esac
+ sys_search_path=
+ for dir in $libltdl_cv_sys_search_path; do
+ if test -z "$sys_search_path"; then
+ sys_search_path="$dir"
+ else
+ sys_search_path="$sys_search_path$pathsep$dir"
+ fi
+ done
+ AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
+ [Define to the system default library search path. ])
+fi
+])
+
+AC_DEFUN(AC_LTDL_OBJDIR,
+[AC_CACHE_CHECK([for objdir],
+ libltdl_cv_objdir, [libltdl_cv_objdir="$objdir"
+if test -n "$objdir"; then
+ :
+else
+ rm -f .libs 2>/dev/null
+ mkdir .libs 2>/dev/null
+ if test -d .libs; then
+ libltdl_cv_objdir=.libs
+ else
+ # MS-DOS does not allow filenames that begin with a dot.
+ libltdl_cv_objdir=_libs
+ fi
+rmdir .libs 2>/dev/null
+fi])
+AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries. ])
+])
+
+AC_DEFUN(AC_LTDL_DLPREOPEN,
+[AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
+AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
+ libltdl_cv_preloaded_symbols, [dnl
+ if test -n "$global_symbol_pipe"; then
+ libltdl_cv_preloaded_symbols=yes
+ else
+ libltdl_cv_preloaded_symbols=no
+ fi
+])
+if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
+ AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
+ [Define if libtool can extract symbol lists from object files. ])
+fi
+])
+
+AC_DEFUN(AC_LTDL_DLLIB,
+[LIBADD_DL=
+AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
+ [Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"],
+[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
+ [Define if you have the libdl library or equivalent.])],
+[AC_CHECK_LIB(svld, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
+ [Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld"]
+)])])
+AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
+ [Define if you have the shl_load function.])],
+[AC_CHECK_LIB(dld, shl_load,
+ [AC_DEFINE(HAVE_SHL_LOAD, 1,
+ [Define if you have the shl_load function.])
+ LIBADD_DL="$LIBADD_DL -ldld"])
+])
+AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
+ [Define if you have the GNU dld library.])dnl
+test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
+AC_SUBST(LIBADD_DL)
+
+if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
+ LIBS_SAVE="$LIBS"
+ LIBS="$LIBS $LIBADD_DL"
+ AC_CHECK_FUNCS(dlerror)
+ LIBS="$LIBS_SAVE"
+fi
+])
+
+AC_DEFUN(AC_LTDL_GLOBAL_SYMBOL_PIPE,
+[dnl Check for command to grab the raw symbol name followed
+dnl by C symbol name from nm.
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output])
+AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
+[# These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix. What could be older than Ultrix?!! ;)}
+
+changequote(,)dnl
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+ ac_symcode='[BCDT]'
+ ;;
+cygwin* | mingw*)
+ ac_symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
+irix*)
+ ac_symcode='[BCDEGRST]'
+ ;;
+solaris*)
+ ac_symcode='[BDT]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ ac_symcode='[ABCDGISTW]'
+fi
+changequote([,])dnl
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ ac_pipe_works=no
+ rm -f conftest.$ac_ext
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+
+ # Try sorting and uniquifying the output.
+ if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+ mv -f "$ac_nlist"T "$ac_nlist"
+ else
+ rm -f "$ac_nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+ cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+ cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+changequote(,)dnl
+lt_preloaded_symbols[] =
+changequote([,])dnl
+{
+EOF
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+ cat <<\EOF >> conftest.c
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ ac_save_LIBS="$LIBS"
+ ac_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ ac_pipe_works=yes
+ else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+ fi
+ LIBS="$ac_save_LIBS"
+ CFLAGS="$ac_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ fi
+ else
+ echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
+ fi
+ else
+ echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ fi
+ else
+ echo "$progname: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$ac_pipe_works" = yes; then
+ if test x"$ac_symprfx" = x"_"; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ ac_cv_sys_symbol_underscore=no
+ fi
+ break
+ else
+ ac_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+ ac_result=no
+fi
+AC_MSG_RESULT($ac_result)
+])
+
+AC_DEFUN(AC_LTDL_SYMBOL_USCORE,
+[dnl does the compiler prefix global symbols with an underscore?
+AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
+AC_MSG_CHECKING([for _ prefix in compiled symbols])
+AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
+[ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+ :
+ else
+ echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ fi
+ fi
+ else
+ echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ fi
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+fi
+rm -rf conftest*
+])
+AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
+AC_LTDL_DLSYM_USCORE
+])
+
+AC_DEFUN(AC_LTDL_DLSYM_USCORE,
+[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
+if test x"$ac_cv_sys_symbol_underscore" = xyes; then
+ if test x"$ac_cv_func_dlopen" = xyes ||
+ test x"$ac_cv_lib_dl_dlopen" = xyes ; then
+ AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
+ libltdl_cv_need_uscore, [dnl
+ AC_TRY_RUN([
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LTDL_GLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LTDL_GLOBAL DL_GLOBAL
+# else
+# define LTDL_GLOBAL 0
+# endif
+#endif
+
+/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LTDL_LAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LTDL_LAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LTDL_LAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LTDL_LAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LTDL_LAZY_OR_NOW DL_NOW
+# else
+# define LTDL_LAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+fnord() { int i=42;}
+main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
+ if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
+ if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
+], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
+ libltdl_cv_need_uscore=cross
+)])
+ fi
+fi
+
+if test x"$libltdl_cv_need_uscore" = xyes; then
+ AC_DEFINE(NEED_USCORE, 1,
+ [Define if dlsym() requires a leading underscode in symbol names. ])
+fi
+])
+
+# Define a conditional.
+
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
@@ -554,16 +1405,3 @@ AC_DEFUN(AM_MAINTAINER_MODE,
]
)
-# Define a conditional.
-
-AC_DEFUN(AM_CONDITIONAL,
-[AC_SUBST($1_TRUE)
-AC_SUBST($1_FALSE)
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi])
-
diff --git a/libjava/libltdl/config.h.in b/libjava/libltdl/config.h.in
index c61738d..95e3849 100644
--- a/libjava/libltdl/config.h.in
+++ b/libjava/libltdl/config.h.in
@@ -9,15 +9,6 @@
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define if you have the libdl library or equivalent. */
-#undef HAVE_LIBDL
-
-/* Define if you have the GNU dld library. */
-#undef HAVE_DLD
-
-/* Define if you have the shl_load function. */
-#undef HAVE_SHL_LOAD
-
/* Define if you are using the Boehm GC. */
#undef HAVE_BOEHM_GC
@@ -33,6 +24,9 @@
/* Define if you have the strchr function. */
#undef HAVE_STRCHR
+/* Define if you have the strcmp function. */
+#undef HAVE_STRCMP
+
/* Define if you have the strrchr function. */
#undef HAVE_STRRCHR
@@ -72,12 +66,33 @@
/* Define to the name of the environment variable that determines the dynamic library search path. */
#undef LTDL_SHLIBPATH_VAR
+/* Define to the system default library search path. */
+#undef LTDL_SYSSEARCHPATH
+
/* Define to the sub-directory in which libtool stores uninstalled libraries. */
#undef LTDL_OBJDIR
/* Define if libtool can extract symbol lists from object files. */
#undef HAVE_PRELOADED_SYMBOLS
+/* Define if you have the libdl library or equivalent. */
+#undef HAVE_LIBDL
+
+/* Define if you have the libdl library or equivalent. */
+#undef HAVE_LIBDL
+
+/* Define if you have the libdl library or equivalent. */
+#undef HAVE_LIBDL
+
+/* Define if you have the shl_load function. */
+#undef HAVE_SHL_LOAD
+
+/* Define if you have the shl_load function. */
+#undef HAVE_SHL_LOAD
+
+/* Define if you have the GNU dld library. */
+#undef HAVE_DLD
+
/* Define if dlsym() requires a leading underscode in symbol names. */
#undef NEED_USCORE
diff --git a/libjava/libltdl/configure b/libjava/libltdl/configure
index a0c3b6b..f0e6f22 100755
--- a/libjava/libltdl/configure
+++ b/libjava/libltdl/configure
@@ -12,6 +12,8 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
+ --with-auxdir=DIR path to autoconf auxiliary files"
+ac_help="$ac_help
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer"
ac_help="$ac_help
@@ -25,9 +27,11 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-libtool-lock avoid locking (might break parallel builds)"
ac_help="$ac_help
- --enable-ltdl-install install libltdl"
+ --with-pic try to use only PIC/non-PIC objects [default=use both]"
ac_help="$ac_help
--enable-java-gc=TYPE choose garbage collector [boehm]"
+ac_help="$ac_help
+ --enable-ltdl-install install libltdl"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -45,7 +49,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -160,7 +163,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -331,11 +333,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -501,16 +498,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -548,21 +541,94 @@ else
ac_n= ac_c='\c' ac_t=
fi
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:546: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 551 "configure"
+#include "confdefs.h"
+int main() {
-if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
- if test -f ${srcdir}/ltconfig && test -f ${srcdir}/ltmain.sh; then
- # if libltdl is libtoolized, it is assumed to be stand-alone and
- # installed unless the command line overrides it (tested above)
- enable_ltdl_install=yes
- else
- echo "configure: warning: *** The top-level configure must select either" 1>&2
- echo "configure: warning: *** A""C_LIBLTDL_INSTALLABLE or A""C_LIBLTDL_CONVENIENCE." 1>&2
- { echo "configure: error: *** Maybe you want to --enable-ltdl-install?" 1>&2; exit 1; }
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:579: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 584 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+
+# Check whether --with-auxdir or --without-auxdir was given.
+if test "${with_auxdir+set}" = set; then
+ withval="$with_auxdir"
+ ac_aux_dir=
+for ac_dir in $with_auxdir; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $with_auxdir" 1>&2; exit 1; }
fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-ac_aux_dir=
+else
+ ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
@@ -581,6 +647,21 @@ ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+fi
+
+
+if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
+ if test -f ${srcdir}/ltconfig && test -f ${srcdir}/ltmain.sh; then
+ # if libltdl is libtoolized, it is assumed to be stand-alone and
+ # installed unless the command line overrides it (tested above)
+ enable_ltdl_install=yes
+ else
+ echo "configure: warning: *** The top-level configure must select either" 1>&2
+ echo "configure: warning: *** A""C_LIBLTDL_INSTALLABLE or A""C_LIBLTDL_CONVENIENCE." 1>&2
+ { echo "configure: error: *** Maybe you want to --enable-ltdl-install?" 1>&2; exit 1; }
+ fi
+fi
+
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@@ -593,7 +674,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:597: checking for a BSD compatible install" >&5
+echo "configure:678: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -646,7 +727,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:650: checking whether build environment is sane" >&5
+echo "configure:731: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -703,7 +784,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:707: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:788: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -732,7 +813,7 @@ fi
PACKAGE=libltdl
-VERSION=1.0
+VERSION=1.1
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -742,7 +823,7 @@ fi
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:746: checking for working aclocal" >&5
+echo "configure:827: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -755,7 +836,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:759: checking for working autoconf" >&5
+echo "configure:840: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -768,7 +849,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:772: checking for working automake" >&5
+echo "configure:853: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -781,7 +862,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:785: checking for working autoheader" >&5
+echo "configure:866: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -794,7 +875,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:798: checking for working makeinfo" >&5
+echo "configure:879: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -811,7 +892,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:815: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:896: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
@@ -837,7 +918,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:841: checking for $ac_word" >&5
+echo "configure:922: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -867,7 +948,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:871: checking for $ac_word" >&5
+echo "configure:952: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -918,7 +999,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:922: checking for $ac_word" >&5
+echo "configure:1003: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -950,7 +1031,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:954: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1035: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -961,12 +1042,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 965 "configure"
+#line 1046 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -992,12 +1073,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:996: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1077: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1001: checking whether we are using GNU C" >&5
+echo "configure:1082: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1006,7 +1087,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1025,7 +1106,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1029: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1110: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1057,12 +1138,12 @@ else
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1061: checking for working const" >&5
+echo "configure:1142: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1066 "configure"
+#line 1147 "configure"
#include "confdefs.h"
int main() {
@@ -1111,7 +1192,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1132,21 +1213,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1136: checking for inline" >&5
+echo "configure:1217: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1143 "configure"
+#line 1224 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1171,6 +1252,8 @@ EOF
;;
esac
+
+
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
@@ -1247,7 +1330,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1251: checking host system type" >&5
+echo "configure:1334: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1268,7 +1351,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1272: checking build system type" >&5
+echo "configure:1355: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1285,36 +1368,6 @@ build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1292: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
withval="$with_gnu_ld"
@@ -1327,8 +1380,14 @@ ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1331: checking for ld used by GCC" >&5
- ac_prog=`($CC -print-prog-name=ld) 2>&5`
+echo "configure:1384: checking for ld used by GCC" >&5
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
case "$ac_prog" in
# Accept absolute paths.
[\\/]* | [A-Za-z]:[\\/]*)
@@ -1351,10 +1410,10 @@ echo "configure:1331: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1355: checking for GNU ld" >&5
+echo "configure:1414: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1358: checking for non-GNU ld" >&5
+echo "configure:1417: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1389,7 +1448,7 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1393: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1452: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1402,10 +1461,23 @@ fi
fi
echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$ac_cv_prog_gnu_ld
+
+echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
+echo "configure:1469: checking for $LD option to reload object files" >&5
+if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+
+echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1409: checking for BSD-compatible nm" >&5
+echo "configure:1481: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1416,18 +1488,20 @@ else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+ if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ # Tru64's nm complains that /dev/null is an invalid object file
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ ac_cv_path_NM="$tmp_nm -B"
break
- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
@@ -1441,7 +1515,7 @@ NM="$ac_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1445: checking whether ln -s works" >&5
+echo "configure:1519: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1461,12 +1535,484 @@ else
echo "$ac_t""no" 1>&6
fi
+echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
+echo "configure:1540: checking how to recognise dependant libraries" >&5
+if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_file_magic_cmd='${MAGIC}'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
-case "$target" in
-NONE) lt_target="$host" ;;
-*) lt_target="$target" ;;
+case "$host_os" in
+aix4*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin* | mingw*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='${OBJDUMP} -f'
+ ;;
+
+freebsd* )
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case "$host_cpu" in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20*)
+ # TODO: Does this work for hpux-11 too?
+ lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+
+irix5* | irix6*)
+ case "$host_os" in
+ irix5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case "$LD" in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ case "$host_cpu" in
+ alpha* | i*86 | powerpc* | sparc* | ia64* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
+ else
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case "$host_vendor" in
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ esac
+ ;;
esac
+fi
+
+echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:1683: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:1689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c) ;;
+ *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
+else
+ { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1709: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:1719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+if test $host != $build; then
+ ac_tool_prefix=${host_alias}-
+else
+ ac_tool_prefix=
+fi
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# Only perform the check for file, if the check method requires it
+case "$deplibs_check_method" in
+file_magic*)
+ if test "$file_magic_cmd" = '${MAGIC}'; then
+ echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
+echo "configure:1752: checking for ${ac_tool_prefix}file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$MAGIC" in
+ /*)
+ lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC="$MAGIC"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case "$deplibs_check_method" in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC="$lt_cv_path_MAGIC"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC="$ac_save_MAGIC"
+ ;;
+esac
+fi
+
+MAGIC="$lt_cv_path_MAGIC"
+if test -n "$MAGIC"; then
+ echo "$ac_t""$MAGIC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$lt_cv_path_MAGIC"; then
+ if test -n "$ac_tool_prefix"; then
+ echo $ac_n "checking for file""... $ac_c" 1>&6
+echo "configure:1814: checking for file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$MAGIC" in
+ /*)
+ lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC="$MAGIC"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case "$deplibs_check_method" in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC="$lt_cv_path_MAGIC"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC="$ac_save_MAGIC"
+ ;;
+esac
+fi
+
+MAGIC="$lt_cv_path_MAGIC"
+if test -n "$MAGIC"; then
+ echo "$ac_t""$MAGIC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ else
+ MAGIC=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1885: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_RANLIB"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1917: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ RANLIB=":"
+fi
+fi
+
+# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1952: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_STRIP"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1984: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_STRIP="strip"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ STRIP=":"
+fi
+fi
+
+
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
@@ -1475,7 +2021,7 @@ test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
-
+libtool_flags="$libtool_flags --enable-win32-dll"
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then
enableval="$enable_libtool_lock"
@@ -1485,13 +2031,24 @@ fi
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$lt_target" in
+case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 1494 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 2051 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
@@ -1512,19 +2069,27 @@ case "$lt_target" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1516: checking whether the C compiler needs -belf" >&5
+echo "configure:2073: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1521 "configure"
+
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 2086 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -1534,6 +2099,13 @@ else
lt_cv_cc_needs_belf=no
fi
rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
fi
echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
@@ -1543,7 +2115,279 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
fi
;;
+*-*-cygwin* | *-*-mingw*)
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2123: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+DLLTOOL="$ac_cv_prog_DLLTOOL"
+if test -n "$DLLTOOL"; then
+ echo "$ac_t""$DLLTOOL" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_DLLTOOL"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2155: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_DLLTOOL="dlltool"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
+fi
+fi
+DLLTOOL="$ac_cv_prog_DLLTOOL"
+if test -n "$DLLTOOL"; then
+ echo "$ac_t""$DLLTOOL" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ DLLTOOL="false"
+fi
+fi
+
+ # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2190: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AS"; then
+ ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AS="${ac_tool_prefix}as"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+AS="$ac_cv_prog_AS"
+if test -n "$AS"; then
+ echo "$ac_t""$AS" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_AS"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2222: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AS"; then
+ ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AS="as"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
+fi
+fi
+AS="$ac_cv_prog_AS"
+if test -n "$AS"; then
+ echo "$ac_t""$AS" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ AS="false"
+fi
+fi
+
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2257: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+OBJDUMP="$ac_cv_prog_OBJDUMP"
+if test -n "$OBJDUMP"; then
+ echo "$ac_t""$OBJDUMP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$ac_cv_prog_OBJDUMP"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2289: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_OBJDUMP="objdump"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
+fi
+fi
+OBJDUMP="$ac_cv_prog_OBJDUMP"
+if test -n "$OBJDUMP"; then
+ echo "$ac_t""$OBJDUMP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ OBJDUMP="false"
+fi
+fi
+
+
+ # recent cygwin and mingw systems supply a stub DllMain which the user
+ # can override, but on older systems we have to supply one
+ echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
+echo "configure:2325: checking if libtool should supply DllMain function" >&5
+if eval "test \"`echo '$''{'lt_cv_need_dllmain'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2330 "configure"
+#include "confdefs.h"
+
+int main() {
+extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
+ DllMain (0, 0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:2338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_need_dllmain=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_need_dllmain=yes
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_need_dllmain" 1>&6
+
+ case "$host/$CC" in
+ *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
+ # old mingw systems require "-dll" to link a DLL, while more recent ones
+ # require "-mdll"
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mdll"
+ echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
+echo "configure:2359: checking how to link DLLs" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_dll_switch'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2364 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_dll_switch=-mdll
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_cc_dll_switch=-dll
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
+ CFLAGS="$SAVE_CFLAGS" ;;
+ *-*-cygwin*)
+ # cygwin systems need to pass --dll to the linker, and not link
+ # crt.o which will require a WinMain@16 definition.
+ lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
+ esac
+ ;;
+
esac
@@ -1597,12 +2441,14 @@ rm -f confcache
# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC="$MAGIC" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
# Reload cache, that may have been modified by ltconfig
@@ -1616,7 +2462,7 @@ fi
# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -1626,16 +2472,14 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
exec 5>>./config.log
+
-# Check whether --enable-ltdl-install or --disable-ltdl-install was given.
-if test "${enable_ltdl_install+set}" = set; then
- enableval="$enable_ltdl_install"
- :
-fi
+
+
echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:1639: checking for garbage collector to use" >&5
+echo "configure:2483: checking for garbage collector to use" >&5
# Check whether --enable-java-gc or --disable-java-gc was given.
if test "${enable_java_gc+set}" = set; then
enableval="$enable_java_gc"
@@ -1657,90 +2501,8 @@ EOF
fi
-
-
-if test x"${enable_ltdl_install-no}" != xno; then
- INSTALL_LTDL_TRUE=
- INSTALL_LTDL_FALSE='#'
-else
- INSTALL_LTDL_TRUE='#'
- INSTALL_LTDL_FALSE=
-fi
-
-
-if test x"${enable_ltdl_convenience-no}" != xno; then
- CONVENIENCE_LTDL_TRUE=
- CONVENIENCE_LTDL_FALSE='#'
-else
- CONVENIENCE_LTDL_TRUE='#'
- CONVENIENCE_LTDL_FALSE=
-fi
-
-rm -f conftest
-./libtool --config > conftest
-. ./conftest
-rm -f conftest
-
-echo $ac_n "checking which extension is used for shared libraries""... $ac_c" 1>&6
-echo "configure:1686: checking which extension is used for shared libraries" >&5
-if eval "test \"`echo '$''{'libltdl_cv_shlibext'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- (
- last=
- for spec in $library_names_spec; do
- last="$spec"
- done
-
- echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
-
-)
-libltdl_cv_shlibext=`cat conftest`
-rm -f conftest
-
-fi
-
-echo "$ac_t""$libltdl_cv_shlibext" 1>&6
-if test -n "$libltdl_cv_shlibext"; then
- cat >> confdefs.h <<EOF
-#define LTDL_SHLIB_EXT "$libltdl_cv_shlibext"
-EOF
-
-fi
-
-echo $ac_n "checking which variable specifies run-time library path""... $ac_c" 1>&6
-echo "configure:1713: checking which variable specifies run-time library path" >&5
-if eval "test \"`echo '$''{'libltdl_cv_shlibpath_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- libltdl_cv_shlibpath_var="$shlibpath_var"
-fi
-
-echo "$ac_t""$libltdl_cv_shlibpath_var" 1>&6
-if test -n "$libltdl_cv_shlibpath_var"; then
- cat >> confdefs.h <<EOF
-#define LTDL_SHLIBPATH_VAR "$libltdl_cv_shlibpath_var"
-EOF
-
-fi
-
-echo $ac_n "checking for objdir""... $ac_c" 1>&6
-echo "configure:1729: checking for objdir" >&5
-if eval "test \"`echo '$''{'libltdl_cv_objdir'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- libltdl_cv_objdir="$objdir"
-fi
-
-echo "$ac_t""$libltdl_cv_objdir" 1>&6
-test -z "$libltdl_cv_objdir" && libltdl_cv_objdir=".libs"
-cat >> confdefs.h <<EOF
-#define LTDL_OBJDIR "$libltdl_cv_objdir/"
-EOF
-
-
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1744: checking how to run the C preprocessor" >&5
+echo "configure:2506: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1755,13 +2517,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1759 "configure"
+#line 2521 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1772,13 +2534,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1776 "configure"
+#line 2538 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1789,13 +2551,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1793 "configure"
+#line 2555 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1819,13 +2581,185 @@ else
fi
echo "$ac_t""$CPP" 1>&6
+# Read the libtool configuration
+rm -f conftest
+./libtool --config > conftest
+. ./conftest
+rm -f conftest
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
+echo "configure:2593: checking command to parse $NM output" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix. What could be older than Ultrix?!! ;)}
+
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+ ac_symcode='[BCDT]'
+ ;;
+cygwin* | mingw*)
+ ac_symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
+irix*)
+ ac_symcode='[BCDEGRST]'
+ ;;
+solaris*)
+ ac_symcode='[BDT]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ ac_symcode='[ABCDGISTW]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* \($ac_symcode\) *\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ ac_pipe_works=no
+ rm -f conftest.$ac_ext
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+ if { (eval echo configure:2656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+
+ if { (eval echo configure:2660: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+
+ # Try sorting and uniquifying the output.
+ if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+ mv -f "$ac_nlist"T "$ac_nlist"
+ else
+ rm -f "$ac_nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+ cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+ cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+ cat <<\EOF >> conftest.c
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ ac_save_LIBS="$LIBS"
+ ac_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if { (eval echo configure:2712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_pipe_works=yes
+ else
+ echo "configure: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ LIBS="$ac_save_LIBS"
+ CFLAGS="$ac_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $ac_nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $ac_nlist" >&5
+ fi
+ else
+ echo "cannot run $ac_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$ac_pipe_works" = yes; then
+ if test x"$ac_symprfx" = x"_"; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ ac_cv_sys_symbol_underscore=no
+ fi
+ break
+ else
+ ac_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+ ac_result=no
+fi
+echo "$ac_t""$ac_result" 1>&6
+
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1824: checking for ANSI C header files" >&5
+echo "configure:2758: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1829 "configure"
+#line 2763 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1833,7 +2767,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1850,7 +2784,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1854 "configure"
+#line 2788 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1868,7 +2802,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1872 "configure"
+#line 2806 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1889,7 +2823,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1893 "configure"
+#line 2827 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1900,7 +2834,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1923,199 +2857,132 @@ EOF
fi
-for ac_hdr in malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1931: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1936 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+# Check whether --enable-ltdl-install or --disable-ltdl-install was given.
+if test "${enable_ltdl_install+set}" = set; then
+ enableval="$enable_ltdl_install"
+ :
fi
-rm -f conftest*
+
+
+
+
+if test x"${enable_ltdl_install-no}" != xno; then
+ INSTALL_LTDL_TRUE=
+ INSTALL_LTDL_FALSE='#'
+else
+ INSTALL_LTDL_TRUE='#'
+ INSTALL_LTDL_FALSE=
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+
+
+if test x"${enable_ltdl_convenience-no}" != xno; then
+ CONVENIENCE_LTDL_TRUE=
+ CONVENIENCE_LTDL_FALSE='#'
else
- echo "$ac_t""no" 1>&6
+ CONVENIENCE_LTDL_TRUE='#'
+ CONVENIENCE_LTDL_FALSE=
fi
-done
-for ac_hdr in string.h strings.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1971: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking which extension is used for shared libraries""... $ac_c" 1>&6
+echo "configure:2888: checking which extension is used for shared libraries" >&5
+if eval "test \"`echo '$''{'libltdl_cv_shlibext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1976 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
+ (
+ last=
+ for spec in $library_names_spec; do
+ last="$spec"
+ done
+
+ echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
+
+)
+libltdl_cv_shlibext=`cat conftest`
+rm -f conftest
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+
+echo "$ac_t""$libltdl_cv_shlibext" 1>&6
+if test -n "$libltdl_cv_shlibext"; then
cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+#define LTDL_SHLIB_EXT "$libltdl_cv_shlibext"
EOF
- break
-else
- echo "$ac_t""no" 1>&6
+
fi
-done
-for ac_func in strchr index
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2010: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+echo $ac_n "checking which variable specifies run-time library path""... $ac_c" 1>&6
+echo "configure:2915: checking which variable specifies run-time library path" >&5
+if eval "test \"`echo '$''{'libltdl_cv_shlibpath_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2015 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
+ libltdl_cv_shlibpath_var="$shlibpath_var"
+fi
-int main() {
+echo "$ac_t""$libltdl_cv_shlibpath_var" 1>&6
+if test -n "$libltdl_cv_shlibpath_var"; then
+ cat >> confdefs.h <<EOF
+#define LTDL_SHLIBPATH_VAR "$libltdl_cv_shlibpath_var"
+EOF
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
+fi
-; return 0; }
-EOF
-if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+echo $ac_n "checking for the default library search path""... $ac_c" 1>&6
+echo "configure:2931: checking for the default library search path" >&5
+if eval "test \"`echo '$''{'libltdl_cv_sys_search_path'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+ libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+echo "$ac_t""$libltdl_cv_sys_search_path" 1>&6
+if test -n "$libltdl_cv_sys_search_path"; then
+ case "$host" in
+ *-*-mingw*) pathsep=";" ;;
+ *) pathsep=":" ;;
+ esac
+ sys_search_path=
+ for dir in $libltdl_cv_sys_search_path; do
+ if test -z "$sys_search_path"; then
+ sys_search_path="$dir"
+ else
+ sys_search_path="$sys_search_path$pathsep$dir"
+ fi
+ done
cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+#define LTDL_SYSSEARCHPATH "$sys_search_path"
EOF
- break
-else
- echo "$ac_t""no" 1>&6
+
fi
-done
-for ac_func in strrchr rindex
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2065: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+echo $ac_n "checking for objdir""... $ac_c" 1>&6
+echo "configure:2959: checking for objdir" >&5
+if eval "test \"`echo '$''{'libltdl_cv_objdir'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2070 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ libltdl_cv_objdir="$objdir"
+if test -n "$objdir"; then
+ :
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ rm -f .libs 2>/dev/null
+ mkdir .libs 2>/dev/null
+ if test -d .libs; then
+ libltdl_cv_objdir=.libs
+ else
+ # MS-DOS does not allow filenames that begin with a dot.
+ libltdl_cv_objdir=_libs
+ fi
+rmdir .libs 2>/dev/null
fi
-rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+echo "$ac_t""$libltdl_cv_objdir" 1>&6
+cat >> confdefs.h <<EOF
+#define LTDL_OBJDIR "$libltdl_cv_objdir/"
EOF
- break
-else
- echo "$ac_t""no" 1>&6
-fi
-done
echo $ac_n "checking whether libtool supports -dlopen/-dlpreopen""... $ac_c" 1>&6
-echo "configure:2119: checking whether libtool supports -dlopen/-dlpreopen" >&5
+echo "configure:2986: checking whether libtool supports -dlopen/-dlpreopen" >&5
if eval "test \"`echo '$''{'libltdl_cv_preloaded_symbols'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2137,7 +3004,7 @@ fi
LIBADD_DL=
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2141: checking for dlopen in -ldl" >&5
+echo "configure:3008: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2145,7 +3012,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2149 "configure"
+#line 3016 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2156,7 +3023,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:2160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2178,12 +3045,12 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:2182: checking for dlopen" >&5
+echo "configure:3049: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2187 "configure"
+#line 3054 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -2206,7 +3073,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:2210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -2226,17 +3093,61 @@ EOF
else
echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
+echo "configure:3098: checking for dlopen in -lsvld" >&5
+ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsvld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3106 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo configure:3117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_LIBDL 1
+EOF
+ LIBADD_DL="-lsvld"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
fi
fi
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:2235: checking for shl_load" >&5
+echo "configure:3146: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2240 "configure"
+#line 3151 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
@@ -2259,7 +3170,7 @@ shl_load();
; return 0; }
EOF
-if { (eval echo configure:2263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shl_load=yes"
else
@@ -2280,7 +3191,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:2284: checking for shl_load in -ldld" >&5
+echo "configure:3195: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2288,7 +3199,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2292 "configure"
+#line 3203 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2299,7 +3210,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:2303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2317,15 +3228,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
cat >> confdefs.h <<\EOF
#define HAVE_SHL_LOAD 1
EOF
- LIBADD_DL="$LIBADD_DL -ldld"
+
+ LIBADD_DL="$LIBADD_DL -ldld"
else
echo "$ac_t""no" 1>&6
fi
+
fi
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:2329: checking for dld_link in -ldld" >&5
+echo "configure:3242: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2333,7 +3246,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2337 "configure"
+#line 3250 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2344,7 +3257,7 @@ int main() {
dld_link()
; return 0; }
EOF
-if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2375,12 +3288,12 @@ if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; the
for ac_func in dlerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2379: checking for $ac_func" >&5
+echo "configure:3292: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2384 "configure"
+#line 3297 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2403,7 +3316,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2430,174 +3343,8 @@ done
LIBS="$LIBS_SAVE"
fi
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:2436: checking command to parse $NM output" >&5
-if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # These are sane defaults that work on at least a few old systems.
-# {They come from Ultrix. What could be older than Ultrix?!! ;)}
-
-# Character class describing NM global symbol codes.
-ac_symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Transform the above into a raw symbol and a C symbol.
-ac_symxfrm='\1 \2\3 \3'
-
-# Transform an extracted symbol line into a proper C declaration
-ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
-
-# Define system-specific variables.
-case "$host_os" in
-aix*)
- ac_symcode='[BCDT]'
- ;;
-cygwin* | mingw*)
- ac_symcode='[ABCDGISTW]'
- ;;
-hpux*)
- ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
- ;;
-irix*)
- ac_symcode='[BCDEGRST]'
- ;;
-solaris*)
- ac_symcode='[BDT]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
- ac_symcode='[ABCDGISTW]'
-fi
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* \($ac_symcode\) *\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- ac_pipe_works=no
- rm -f conftest.$ac_ext
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func;return 0;}
-EOF
-
- if { (eval echo configure:2499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
-
- if { (eval echo configure:2503: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
-
- # Try sorting and uniquifying the output.
- if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
- mv -f "$ac_nlist"T "$ac_nlist"
- else
- rm -f "$ac_nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
- if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
- cat <<EOF > conftest.c
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
-
- cat <<EOF >> conftest.c
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
- sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
- cat <<\EOF >> conftest.c
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- ac_save_LIBS="$LIBS"
- ac_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$no_builtin_flag"
- if { (eval echo configure:2555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- ac_pipe_works=yes
- else
- echo "configure: failed program was:" >&5
- cat conftest.c >&5
- fi
- LIBS="$ac_save_LIBS"
- CFLAGS="$ac_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $ac_nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $ac_nlist" >&5
- fi
- else
- echo "cannot run $ac_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.c >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$ac_pipe_works" = yes; then
- if test x"$ac_symprfx" = x"_"; then
- ac_cv_sys_symbol_underscore=yes
- else
- ac_cv_sys_symbol_underscore=no
- fi
- break
- else
- ac_cv_sys_global_symbol_pipe=
- fi
-done
-
-fi
-
-
-ac_result=yes
-if test -z "$ac_cv_sys_global_symbol_pipe"; then
- ac_result=no
-fi
-echo "$ac_t""$ac_result" 1>&6
-
echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:2601: checking for _ prefix in compiled symbols" >&5
+echo "configure:3348: checking for _ prefix in compiled symbols" >&5
if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2606,10 +3353,10 @@ cat > conftest.$ac_ext <<EOF
void nm_test_func(){}
int main(){nm_test_func;return 0;}
EOF
-if { (eval echo configure:2610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
# Now try to grab the symbols.
ac_nlist=conftest.nm
- if { (eval echo configure:2613: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+ if { (eval echo configure:3360: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
# See whether the symbols have a leading underscore.
if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
ac_cv_sys_symbol_underscore=yes
@@ -2632,12 +3379,11 @@ rm -rf conftest*
fi
echo "$ac_t""$ac_cv_sys_symbol_underscore" 1>&6
-
if test x"$ac_cv_sys_symbol_underscore" = xyes; then
if test x"$ac_cv_func_dlopen" = xyes ||
test x"$ac_cv_lib_dl_dlopen" = xyes ; then
echo $ac_n "checking whether we have to add an underscore for dlsym""... $ac_c" 1>&6
-echo "configure:2641: checking whether we have to add an underscore for dlsym" >&5
+echo "configure:3387: checking whether we have to add an underscore for dlsym" >&5
if eval "test \"`echo '$''{'libltdl_cv_need_uscore'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2646,7 +3392,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 2650 "configure"
+#line 3396 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -2690,10 +3436,10 @@ else
fnord() { int i=42;}
main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
- if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
+ if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo configure:2697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
libltdl_cv_need_uscore=no
else
@@ -2718,6 +3464,257 @@ EOF
fi
+
+
+
+for ac_hdr in malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3475: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3480 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in string.h strings.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3515: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3520 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in strchr index
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3554: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3559 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in strrchr rindex
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3609: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3614 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in strcmp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3664: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3669 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -2876,16 +3873,22 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
-s%@RANLIB@%$RANLIB%g
s%@LN_S@%$LN_S%g
+s%@OBJEXT@%$OBJEXT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@RANLIB@%$RANLIB%g
+s%@STRIP@%$STRIP%g
+s%@DLLTOOL@%$DLLTOOL%g
+s%@AS@%$AS%g
+s%@OBJDUMP@%$OBJDUMP%g
s%@LIBTOOL@%$LIBTOOL%g
s%@LIBTOOL_DEPS@%$LIBTOOL_DEPS%g
s%@GCINCS@%$GCINCS%g
+s%@CPP@%$CPP%g
s%@INSTALL_LTDL_TRUE@%$INSTALL_LTDL_TRUE%g
s%@INSTALL_LTDL_FALSE@%$INSTALL_LTDL_FALSE%g
s%@CONVENIENCE_LTDL_TRUE@%$CONVENIENCE_LTDL_TRUE%g
s%@CONVENIENCE_LTDL_FALSE@%$CONVENIENCE_LTDL_FALSE%g
-s%@CPP@%$CPP%g
s%@LIBADD_DL@%$LIBADD_DL%g
CEOF
diff --git a/libjava/libltdl/configure.in b/libjava/libltdl/configure.in
index 7586ff8..188fc10 100644
--- a/libjava/libltdl/configure.in
+++ b/libjava/libltdl/configure.in
@@ -2,6 +2,13 @@ dnl Process this file with autoconf to create configure.
AC_INIT(ltdl.c)
+dnl We shouldn't be using these internal macros of autoconf,
+dnl but CONFIG_AUX_DIR($with_auxdir) breaks automake.
+AC_ARG_WITH(auxdir,
+[ --with-auxdir=DIR path to autoconf auxiliary files],
+[AC_CONFIG_AUX_DIRS($with_auxdir)],
+[AC_CONFIG_AUX_DIR_DEFAULT])
+
if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
if test -f ${srcdir}/ltconfig && test -f ${srcdir}/ltmain.sh; then
# if libltdl is libtoolized, it is assumed to be stand-alone and
@@ -14,19 +21,18 @@ if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
fi
fi
-AM_INIT_AUTOMAKE(libltdl,1.0,-)
+AM_INIT_AUTOMAKE(libltdl,1.1,-)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_PROG_CC
AC_C_CONST
AC_C_INLINE
+
+AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
-AC_ARG_ENABLE(ltdl-install,
-[ --enable-ltdl-install install libltdl])
-
AC_MSG_CHECKING([for garbage collector to use])
AC_ARG_ENABLE(java-gc,
changequote(<<,>>)dnl
@@ -43,342 +49,7 @@ if test "$GC" = "boehm"; then
fi
AC_SUBST(GCINCS)
-AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
-AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
-
-dnl Read the libtool configuration
-rm -f conftest
-./libtool --config > conftest
-. ./conftest
-rm -f conftest
-
-AC_CACHE_CHECK([which extension is used for shared libraries],
- libltdl_cv_shlibext, [dnl
-(
- last=
- for spec in $library_names_spec; do
- last="$spec"
- done
-changequote(, )
- echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
-changequote([, ])
-)
-libltdl_cv_shlibext=`cat conftest`
-rm -f conftest
-])
-if test -n "$libltdl_cv_shlibext"; then
- AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
- [Define to the extension used for shared libraries, say, ".so". ])
-fi
-
-AC_CACHE_CHECK([which variable specifies run-time library path],
- libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"])
-if test -n "$libltdl_cv_shlibpath_var"; then
- AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
- [Define to the name of the environment variable that determines the dynamic library search path. ])
-fi
-
-AC_CACHE_CHECK([for objdir],
- libltdl_cv_objdir, [libltdl_cv_objdir="$objdir"])
-test -z "$libltdl_cv_objdir" && libltdl_cv_objdir=".libs"
-AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
- [Define to the sub-directory in which libtool stores uninstalled libraries. ])
-
-AC_HEADER_STDC
-AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
-AC_CHECK_HEADERS(string.h strings.h, break)
-AC_CHECK_FUNCS(strchr index, break)
-AC_CHECK_FUNCS(strrchr rindex, break)
-
-AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
- libltdl_cv_preloaded_symbols, [dnl
- if test -n "$global_symbol_pipe"; then
- libltdl_cv_preloaded_symbols=yes
- else
- libltdl_cv_preloaded_symbols=no
- fi
-])
-if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
- AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
- [Define if libtool can extract symbol lists from object files. ])
-fi
-
-LIBADD_DL=
-AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1) LIBADD_DL="-ldl"],
-[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1)])])
-AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1)],
-[AC_CHECK_LIB(dld, shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1) LIBADD_DL="$LIBADD_DL -ldld"])])
-AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1)dnl
-test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
-AC_SUBST(LIBADD_DL)
-
-if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
- LIBS_SAVE="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- AC_CHECK_FUNCS(dlerror)
- LIBS="$LIBS_SAVE"
-fi
-
-dnl Check for command to grab the raw symbol name followed
-dnl by C symbol name from nm.
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output])
-AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
-[# These are sane defaults that work on at least a few old systems.
-# {They come from Ultrix. What could be older than Ultrix?!! ;)}
-
-changequote(,)dnl
-# Character class describing NM global symbol codes.
-ac_symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Transform the above into a raw symbol and a C symbol.
-ac_symxfrm='\1 \2\3 \3'
-
-# Transform an extracted symbol line into a proper C declaration
-ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
-
-# Define system-specific variables.
-case "$host_os" in
-aix*)
- ac_symcode='[BCDT]'
- ;;
-cygwin* | mingw*)
- ac_symcode='[ABCDGISTW]'
- ;;
-hpux*)
- ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
- ;;
-irix*)
- ac_symcode='[BCDEGRST]'
- ;;
-solaris*)
- ac_symcode='[BDT]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
- ac_symcode='[ABCDGISTW]'
-fi
-changequote([,])dnl
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- ac_pipe_works=no
- rm -f conftest.$ac_ext
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func;return 0;}
-EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
-
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
-
- # Try sorting and uniquifying the output.
- if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
- mv -f "$ac_nlist"T "$ac_nlist"
- else
- rm -f "$ac_nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
- if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
- cat <<EOF > conftest.c
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
-
- cat <<EOF >> conftest.c
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-changequote(,)dnl
-lt_preloaded_symbols[] =
-changequote([,])dnl
-{
-EOF
- sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
- cat <<\EOF >> conftest.c
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- ac_save_LIBS="$LIBS"
- ac_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$no_builtin_flag"
- if AC_TRY_EVAL(ac_link) && test -s conftest; then
- ac_pipe_works=yes
- else
- echo "configure: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
- fi
- LIBS="$ac_save_LIBS"
- CFLAGS="$ac_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
- fi
- else
- echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
- fi
- else
- echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
- fi
- else
- echo "$progname: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$ac_pipe_works" = yes; then
- if test x"$ac_symprfx" = x"_"; then
- ac_cv_sys_symbol_underscore=yes
- else
- ac_cv_sys_symbol_underscore=no
- fi
- break
- else
- ac_cv_sys_global_symbol_pipe=
- fi
-done
-])
-
-ac_result=yes
-if test -z "$ac_cv_sys_global_symbol_pipe"; then
- ac_result=no
-fi
-AC_MSG_RESULT($ac_result)
-
-dnl does the compiler prefix global symbols with an underscore?
-AC_MSG_CHECKING([for _ prefix in compiled symbols])
-AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
-[ac_cv_sys_symbol_underscore=no
-cat > conftest.$ac_ext <<EOF
-void nm_test_func(){}
-int main(){nm_test_func;return 0;}
-EOF
-if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
- # See whether the symbols have a leading underscore.
- if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
- ac_cv_sys_symbol_underscore=yes
- else
- if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
- else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
- fi
- fi
- else
- echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
- fi
-else
- echo "configure: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
-fi
-rm -rf conftest*
-])
-AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
-
-if test x"$ac_cv_sys_symbol_underscore" = xyes; then
- if test x"$ac_cv_func_dlopen" = xyes ||
- test x"$ac_cv_lib_dl_dlopen" = xyes ; then
- AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
- libltdl_cv_need_uscore, [dnl
- AC_TRY_RUN([
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LTDL_GLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LTDL_GLOBAL DL_GLOBAL
-# else
-# define LTDL_GLOBAL 0
-# endif
-#endif
-
-/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LTDL_LAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LTDL_LAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LTDL_LAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LTDL_LAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LTDL_LAZY_OR_NOW DL_NOW
-# else
-# define LTDL_LAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-fnord() { int i=42;}
-main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
- if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
- if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
-], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
- libltdl_cv_need_uscore=cross
-)])
- fi
-fi
-
-if test x"$libltdl_cv_need_uscore" = xyes; then
- AC_DEFINE(NEED_USCORE, 1,
- [Define if dlsym() requires a leading underscode in symbol names. ])
-fi
+AC_LIB_LTDL
dnl Output the makefile
AC_OUTPUT(Makefile)
diff --git a/libjava/libltdl/ltdl.c b/libjava/libltdl/ltdl.c
index 4abbdd3..5ecbee5 100644
--- a/libjava/libltdl/ltdl.c
+++ b/libjava/libltdl/ltdl.c
@@ -1,27 +1,28 @@
/* ltdl.c -- system independent dlopen wrapper
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
+modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
-As a special exception to the GNU Library General Public License,
-if you distribute this file as part of a program that uses GNU libtool
-to create libraries and programs, you may include it under the same
+As a special exception to the GNU Lesser General Public License,
+if you distribute this file as part of a program or library that
+is built using GNU libtool, you may include it under the same
distribution terms that you use for the rest of that program.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+Lesser General Public License for more details.
-You should have received a copy of the GNU Library General Public
+You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
+
*/
#define _LTDL_COMPILE_
@@ -64,6 +65,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
#include "ltdl.h"
+#ifdef DLL_EXPORT
+# define LTDL_GLOBAL_DATA __declspec(dllexport)
+#else
+# define LTDL_GLOBAL_DATA
+#endif
+
/* max. filename length */
#ifndef LTDL_FILENAME_MAX
#define LTDL_FILENAME_MAX 1024
@@ -85,56 +92,57 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
/* This accounts for the _LTX_ separator */
#define LTDL_SYMBOL_OVERHEAD 5
+/* NOTE: typedefed in ltdl.h
+ This structure is used for the list of registered loaders. */
+struct lt_dlloader_t {
+ struct lt_dlloader_t *next;
+ const char *loader_name; /* identifying name for each loader */
+ const char *sym_prefix; /* prefix for symbols */
+ lt_module_open_t *module_open;
+ lt_module_close_t *module_close;
+ lt_find_sym_t *find_sym;
+ lt_dlloader_exit_t *dlloader_exit;
+ lt_dlloader_data_t dlloader_data;
+};
+
+typedef struct lt_dlhandle_t {
+ struct lt_dlhandle_t *next;
+ lt_dlloader_t *loader; /* dlopening interface */
+ lt_dlinfo info;
+ int depcount; /* number of dependencies */
+ lt_dlhandle *deplibs; /* dependencies */
+ lt_module_t module; /* system module handle */
+ lt_ptr_t system; /* system specific data */
+ lt_ptr_t app_private; /* application private data */
+} lt_dlhandle_t;
+
static const char objdir[] = LTDL_OBJDIR;
#ifdef LTDL_SHLIB_EXT
static const char shlib_ext[] = LTDL_SHLIB_EXT;
#endif
+#ifdef LTDL_SYSSEARCHPATH
+static const char sys_search_path[] = LTDL_SYSSEARCHPATH;
+#endif
-static const char unknown_error[] = "unknown error";
-static const char dlopen_not_supported_error[] = "dlopen support not available";
-static const char file_not_found_error[] = "file not found";
-static const char no_symbols_error[] = "no symbols defined";
-static const char cannot_open_error[] = "can't open the module";
-static const char cannot_close_error[] = "can't close the module";
-static const char symbol_error[] = "symbol not found";
-static const char memory_error[] = "not enough memory";
-static const char invalid_handle_error[] = "invalid handle";
-static const char buffer_overflow_error[] = "internal buffer overflow";
-static const char shutdown_error[] = "library already shutdown";
-
-#ifndef HAVE_PRELOADED_SYMBOLS
-/* If libtool won't define it, we'd better do */
-const lt_dlsymlist lt_preloaded_symbols[1] = { { 0, 0 } };
+/* Extract the diagnostic strings from the error table macro in the same
+ order as the enumberated indices in ltdl.h. */
+#define LTDL_ERROR(name, diagnostic) (diagnostic),
+static const char *ltdl_error_strings[] = {
+ ltdl_error_table
+ 0
+};
+#undef LTDL_ERROR
+
+#ifdef __STDC__
+# define LT_DLSTRERROR(name) ltdl_error_strings[LTDL_ERROR_##name]
+#else
+# define LT_DLSTRERROR(name) ltdl_error_strings[LTDL_ERROR_/**/name]
#endif
static const char *last_error = 0;
-lt_ptr_t (*lt_dlmalloc) LTDL_PARAMS((size_t size)) = (lt_ptr_t(*)LTDL_PARAMS((size_t)))malloc;
-void (*lt_dlfree) LTDL_PARAMS((lt_ptr_t ptr)) = (void(*)LTDL_PARAMS((lt_ptr_t)))free;
-
-typedef struct lt_dltype_t {
- struct lt_dltype_t *next;
- const char *sym_prefix; /* prefix for symbols */
- int (*mod_init) LTDL_PARAMS((void));
- int (*mod_exit) LTDL_PARAMS((void));
- int (*lib_open) LTDL_PARAMS((lt_dlhandle handle, const char *filename));
- int (*lib_close) LTDL_PARAMS((lt_dlhandle handle));
- lt_ptr_t (*find_sym) LTDL_PARAMS((lt_dlhandle handle, const char *symbol));
-} lt_dltype_t;
-
-#define LTDL_TYPE_TOP 0
-
-typedef struct lt_dlhandle_t {
- struct lt_dlhandle_t *next;
- lt_dltype_t *type; /* dlopening interface */
- char *filename; /* file name */
- char *name; /* module name */
- int usage; /* usage */
- int depcount; /* number of dependencies */
- lt_dlhandle *deplibs; /* dependencies */
- lt_ptr_t handle; /* system handle */
- lt_ptr_t system; /* system specific data */
-} lt_dlhandle_t;
+LTDL_GLOBAL_DATA lt_ptr_t (*lt_dlmalloc) LTDL_PARAMS((size_t size)) = (lt_ptr_t(*)LTDL_PARAMS((size_t)))malloc;
+LTDL_GLOBAL_DATA void (*lt_dlfree) LTDL_PARAMS((lt_ptr_t ptr)) = (void(*)LTDL_PARAMS((lt_ptr_t)))free;
#undef strdup
#define strdup xstrdup
@@ -153,6 +161,32 @@ strdup(str)
return tmp;
}
+#if ! HAVE_STRCMP
+
+#undef strcmp
+#define strcmp xstrcmp
+
+static inline int
+strcmp (str1, str2)
+ const char *str1;
+ const char *str2;
+{
+ if (str1 == str2)
+ return 0;
+ if (str1 == 0)
+ return -1;
+ if (str2 == 0)
+ return 1;
+
+ for (;*str1 && *str2; str1++, str2++)
+ if (*str1 != *str2)
+ break;
+
+ return (int)(*str1 - *str2);
+}
+#endif
+
+
#if ! HAVE_STRCHR
# if HAVE_INDEX
@@ -210,7 +244,11 @@ strrchr(str, ch)
#endif
-#if HAVE_LIBDL
+/* The Cygwin dlopen implementation prints a spurious error message to
+ stderr if its call to LoadLibrary() fails for any reason. We can
+ mitigate this by not using the Cygwin implementation, and falling
+ back to our own LoadLibrary() wrapper. */
+#if HAVE_LIBDL && !defined(__CYGWIN__)
/* dynamic linking with dlopen/dlsym */
@@ -250,44 +288,32 @@ strrchr(str, ch)
# endif
#endif
-static int
-sys_dl_init LTDL_PARAMS((void))
-{
- return 0;
-}
-
-static int
-sys_dl_exit LTDL_PARAMS((void))
-{
- return 0;
-}
-
-static int
-sys_dl_open (handle, filename)
- lt_dlhandle handle;
+static lt_module_t
+sys_dl_open (loader_data, filename)
+ lt_dlloader_data_t loader_data;
const char *filename;
{
- handle->handle = dlopen(filename, LTDL_GLOBAL | LTDL_LAZY_OR_NOW);
- if (!handle->handle) {
+ lt_module_t module = dlopen(filename, LTDL_GLOBAL | LTDL_LAZY_OR_NOW);
+ if (!module) {
#if HAVE_DLERROR
last_error = dlerror();
#else
- last_error = cannot_open_error;
+ last_error = LT_DLSTRERROR(CANNOT_OPEN);
#endif
- return 1;
}
- return 0;
+ return module;
}
static int
-sys_dl_close (handle)
- lt_dlhandle handle;
+sys_dl_close (loader_data, module)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
{
- if (dlclose(handle->handle) != 0) {
+ if (dlclose(module) != 0) {
#if HAVE_DLERROR
last_error = dlerror();
#else
- last_error = cannot_close_error;
+ last_error = LT_DLSTRERROR(CANNOT_CLOSE);
#endif
return 1;
}
@@ -295,34 +321,29 @@ sys_dl_close (handle)
}
static lt_ptr_t
-sys_dl_sym (handle, symbol)
- lt_dlhandle handle;
+sys_dl_sym (loader_data, module, symbol)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
const char *symbol;
{
- lt_ptr_t address = dlsym(handle->handle, symbol);
+ lt_ptr_t address = dlsym(module, symbol);
if (!address)
#if HAVE_DLERROR
last_error = dlerror();
#else
- last_error = symbol_error;
+ last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
#endif
return address;
}
-static
-lt_dltype_t
-#ifdef NEED_USCORE
-sys_dl = { LTDL_TYPE_TOP, "_", sys_dl_init, sys_dl_exit,
- sys_dl_open, sys_dl_close, sys_dl_sym };
-#else
-sys_dl = { LTDL_TYPE_TOP, 0, sys_dl_init, sys_dl_exit,
- sys_dl_open, sys_dl_close, sys_dl_sym };
-#endif
-
-#undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &sys_dl
-
+static struct lt_user_dlloader sys_dl = {
+# ifdef NEED_USCORE
+ "_",
+# else
+ 0,
+# endif
+ sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 };
#endif
#if HAVE_SHL_LOAD
@@ -368,168 +389,81 @@ sys_dl = { LTDL_TYPE_TOP, 0, sys_dl_init, sys_dl_exit,
#define LTDL_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH)
-static int
-sys_shl_init LTDL_PARAMS((void))
-{
- return 0;
-}
-
-static int
-sys_shl_exit LTDL_PARAMS((void))
-{
- return 0;
-}
-
-static int
-sys_shl_open (handle, filename)
- lt_dlhandle handle;
+static lt_module_t
+sys_shl_open (loader_data, filename)
+ lt_dlloader_data_t loader_data;
const char *filename;
{
- handle->handle = shl_load(filename, LTDL_BIND_FLAGS, 0L);
- if (!handle->handle) {
- last_error = cannot_open_error;
- return 1;
+ lt_module_t module = shl_load(filename, LTDL_BIND_FLAGS, 0L);
+ if (!module) {
+ last_error = LT_DLSTRERROR(CANNOT_OPEN);
}
- return 0;
+ return module;
}
static int
-sys_shl_close (handle)
- lt_dlhandle handle;
+sys_shl_close (loader_data, module)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
{
- if (shl_unload((shl_t) (handle->handle)) != 0) {
- last_error = cannot_close_error;
+ if (shl_unload((shl_t) (module)) != 0) {
+ last_error = LT_DLSTRERROR(CANNOT_CLOSE);
return 1;
}
return 0;
}
static lt_ptr_t
-sys_shl_sym (handle, symbol)
- lt_dlhandle handle;
+sys_shl_sym (loader_data, module, symbol)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
const char *symbol;
{
lt_ptr_t address;
- if (handle->handle && shl_findsym((shl_t*) &(handle->handle),
+ if (module && shl_findsym((shl_t*) &module,
symbol, TYPE_UNDEFINED, &address) == 0)
if (address)
return address;
- last_error = symbol_error;
+ last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
return 0;
}
-static
-lt_dltype_t
-sys_shl = { LTDL_TYPE_TOP, 0, sys_shl_init, sys_shl_exit,
- sys_shl_open, sys_shl_close, sys_shl_sym };
+static struct lt_user_dlloader
+sys_shl = { 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 };
#undef LTDL_TYPE_TOP
#define LTDL_TYPE_TOP &sys_shl
#endif
-#if HAVE_DLD
-
-/* dynamic linking with dld */
-
-#if HAVE_DLD_H
-#include <dld.h>
-#endif
-
-static int
-sys_dld_init LTDL_PARAMS((void))
-{
- return 0;
-}
-
-static int
-sys_dld_exit LTDL_PARAMS((void))
-{
- return 0;
-}
-
-static int
-sys_dld_open (handle, filename)
- lt_dlhandle handle;
- const char *filename;
-{
- handle->handle = strdup(filename);
- if (!handle->handle) {
- last_error = memory_error;
- return 1;
- }
- if (dld_link(filename) != 0) {
- last_error = cannot_open_error;
- lt_dlfree(handle->handle);
- return 1;
- }
- return 0;
-}
-
-static int
-sys_dld_close (handle)
- lt_dlhandle handle;
-{
- if (dld_unlink_by_file((char*)(handle->handle), 1) != 0) {
- last_error = cannot_close_error;
- return 1;
- }
- lt_dlfree(handle->filename);
- return 0;
-}
-
-static lt_ptr_t
-sys_dld_sym (handle, symbol)
- lt_dlhandle handle;
- const char *symbol;
-{
- lt_ptr_t address = dld_get_func(symbol);
-
- if (!address)
- last_error = symbol_error;
- return address;
-}
-
-static
-lt_dltype_t
-sys_dld = { LTDL_TYPE_TOP, 0, sys_dld_init, sys_dld_exit,
- sys_dld_open, sys_dld_close, sys_dld_sym };
-
-#undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &sys_dld
-
-#endif
-
#ifdef _WIN32
/* dynamic linking for Win32 */
#include <windows.h>
-static int
-sys_wll_init LTDL_PARAMS((void))
-{
- return 0;
-}
-
-static int
-sys_wll_exit LTDL_PARAMS((void))
-{
- return 0;
-}
-
/* Forward declaration; required to implement handle search below. */
static lt_dlhandle handles;
-static int
-sys_wll_open (handle, filename)
- lt_dlhandle handle;
+static lt_module_t
+sys_wll_open (loader_data, filename)
+ lt_dlloader_data_t loader_data;
const char *filename;
{
lt_dlhandle cur;
- char *searchname = NULL;
- char *ext = strrchr(filename, '.');
+ lt_module_t module;
+ char *searchname = 0;
+ char *ext;
+ char self_name_buf[MAX_PATH];
+
+ if (!filename) {
+ /* Get the name of main module */
+ *self_name_buf = 0;
+ GetModuleFileName(NULL, self_name_buf, sizeof(self_name_buf));
+ filename = ext = self_name_buf;
+ }
+ else ext = strrchr(filename, '.');
if (ext) {
/* FILENAME already has an extension. */
@@ -538,11 +472,15 @@ sys_wll_open (handle, filename)
/* Append a `.' to stop Windows from adding an
implicit `.dll' extension. */
searchname = (char*)lt_dlmalloc(2+ strlen(filename));
+ if (!searchname) {
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ return 0;
+ }
strcpy(searchname, filename);
strcat(searchname, ".");
}
-
- handle->handle = LoadLibrary(searchname);
+
+ module = LoadLibrary(searchname);
lt_dlfree(searchname);
/* libltdl expects this function to fail if it is unable
@@ -555,53 +493,50 @@ sys_wll_open (handle, filename)
find one. */
cur = handles;
while (cur) {
- if (!cur->handle) {
+ if (!cur->module) {
cur = 0;
break;
}
- if (cur->handle == handle->handle)
+ if (cur->module == module)
break;
cur = cur->next;
}
- if (cur || !handle->handle) {
- last_error = cannot_open_error;
- return 1;
+ if (cur || !module) {
+ last_error = LT_DLSTRERROR(CANNOT_OPEN);
+ return 0;
}
- return 0;
+ return module;
}
static int
-sys_wll_close (handle)
- lt_dlhandle handle;
+sys_wll_close (loader_data, module)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
{
- if (FreeLibrary(handle->handle) == 0) {
- last_error = cannot_close_error;
+ if (FreeLibrary(module) == 0) {
+ last_error = LT_DLSTRERROR(CANNOT_CLOSE);
return 1;
}
return 0;
}
static lt_ptr_t
-sys_wll_sym (handle, symbol)
- lt_dlhandle handle;
+sys_wll_sym (loader_data, module, symbol)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
const char *symbol;
{
- lt_ptr_t address = GetProcAddress(handle->handle, symbol);
+ lt_ptr_t address = GetProcAddress(module, symbol);
if (!address)
- last_error = symbol_error;
+ last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
return address;
}
-static
-lt_dltype_t
-sys_wll = { LTDL_TYPE_TOP, 0, sys_wll_init, sys_wll_exit,
- sys_wll_open, sys_wll_close, sys_wll_sym };
-
-#undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &sys_wll
+static struct lt_user_dlloader
+sys_wll = { 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 };
#endif
@@ -611,21 +546,9 @@ sys_wll = { LTDL_TYPE_TOP, 0, sys_wll_init, sys_wll_exit,
#include <kernel/image.h>
-static int
-sys_bedl_init LTDL_PARAMS((void))
-{
- return 0;
-}
-
-static int
-sys_bedl_exit LTDL_PARAMS((void))
-{
- return 0;
-}
-
-static int
-sys_bedl_open (handle, filename)
- lt_dlhandle handle;
+static lt_module_t
+sys_bedl_open (loader_data, filename)
+ lt_dlloader_data_t loader_data;
const char *filename;
{
image_id image = 0;
@@ -639,47 +562,101 @@ sys_bedl_open (handle, filename)
image = load_add_on(info.name);
}
if (image <= 0) {
- last_error = cannot_open_error;
- return 1;
+ last_error = LT_DLSTRERROR(CANNOT_OPEN);
+ return 0;
}
- handle->handle = (void*) image;
- return 0;
+
+ return (lt_module_t) image;
}
static int
-sys_bedl_close (handle)
- lt_dlhandle handle;
+sys_bedl_close (loader_data, module)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
{
- if (unload_add_on((image_id)handle->handle) != B_OK) {
- last_error = cannot_close_error;
+ if (unload_add_on((image_id)module) != B_OK) {
+ last_error = LT_DLSTRERROR(CANNOT_CLOSE);
return 1;
}
return 0;
}
static lt_ptr_t
-sys_bedl_sym (handle, symbol)
- lt_dlhandle handle;
+sys_bedl_sym (loader_data, module, symbol)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
const char *symbol;
{
lt_ptr_t address = 0;
- image_id image = (image_id)handle->handle;
+ image_id image = (image_id)module;
if (get_image_symbol(image, symbol, B_SYMBOL_TYPE_ANY,
&address) != B_OK) {
- last_error = symbol_error;
+ last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
return 0;
}
return address;
}
-static
-lt_dltype_t
-sys_bedl = { LTDL_TYPE_TOP, 0, sys_bedl_init, sys_bedl_exit,
- sys_bedl_open, sys_bedl_close, sys_bedl_sym };
+static struct lt_user_dlloader
+sys_bedl = { 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 };
-#undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &sys_bedl
+#endif
+
+#if HAVE_DLD
+
+/* dynamic linking with dld */
+
+#if HAVE_DLD_H
+#include <dld.h>
+#endif
+
+static lt_module_t
+sys_dld_open (loader_data, filename)
+ lt_dlloader_data_t loader_data;
+ const char *filename;
+{
+ lt_module_t module = strdup(filename);
+ if (!module) {
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ return 0;
+ }
+ if (dld_link(filename) != 0) {
+ last_error = LT_DLSTRERROR(CANNOT_OPEN);
+ lt_dlfree(module);
+ return 0;
+ }
+ return module;
+}
+
+static int
+sys_dld_close (loader_data, module)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
+{
+ if (dld_unlink_by_file((char*)(module), 1) != 0) {
+ last_error = LT_DLSTRERROR(CANNOT_CLOSE);
+ return 1;
+ }
+ lt_dlfree(module);
+ return 0;
+}
+
+static lt_ptr_t
+sys_dld_sym (loader_data, module, symbol)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
+ const char *symbol;
+{
+ lt_ptr_t address = dld_get_func(symbol);
+
+ if (!address)
+ last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
+ return address;
+}
+
+static struct lt_user_dlloader
+sys_dld = { 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0 };
#endif
@@ -694,7 +671,8 @@ static const lt_dlsymlist *default_preloaded_symbols = 0;
static lt_dlsymlists_t *preloaded_symbols = 0;
static int
-presym_init LTDL_PARAMS((void))
+presym_init (loader_data)
+ lt_dlloader_data_t loader_data;
{
preloaded_symbols = 0;
if (default_preloaded_symbols)
@@ -718,7 +696,8 @@ presym_free_symlists LTDL_PARAMS((void))
}
static int
-presym_exit LTDL_PARAMS((void))
+presym_exit (loader_data)
+ lt_dlloader_data_t loader_data;
{
presym_free_symlists();
return 0;
@@ -739,33 +718,25 @@ presym_add_symlist (preloaded)
tmp = (lt_dlsymlists_t*) lt_dlmalloc(sizeof(lt_dlsymlists_t));
if (!tmp) {
- last_error = memory_error;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 1;
}
tmp->syms = preloaded;
- tmp->next = 0;
- if (!preloaded_symbols)
- preloaded_symbols = tmp;
- else {
- /* append to the end */
- lists = preloaded_symbols;
- while (lists->next)
- lists = lists->next;
- lists->next = tmp;
- }
+ tmp->next = preloaded_symbols;
+ preloaded_symbols = tmp;
return 0;
}
-static int
-presym_open (handle, filename)
- lt_dlhandle handle;
+static lt_module_t
+presym_open (loader_data, filename)
+ lt_dlloader_data_t loader_data;
const char *filename;
{
lt_dlsymlists_t *lists = preloaded_symbols;
if (!lists) {
- last_error = no_symbols_error;
- return 1;
+ last_error = LT_DLSTRERROR(NO_SYMBOLS);
+ return 0;
}
if (!filename)
filename = "@PROGRAM@";
@@ -775,32 +746,33 @@ presym_open (handle, filename)
while (syms->name) {
if (!syms->address &&
strcmp(syms->name, filename) == 0) {
- handle->handle = (lt_ptr_t) syms;
- return 0;
+ return (lt_module_t) syms;
}
syms++;
}
lists = lists->next;
}
- last_error = file_not_found_error;
- return 1;
+ last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
+ return 0;
}
static int
-presym_close (handle)
- lt_dlhandle handle;
+presym_close (loader_data, module)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
{
/* Just to silence gcc -Wall */
- handle = 0;
+ module = 0;
return 0;
}
static lt_ptr_t
-presym_sym (handle, symbol)
- lt_dlhandle handle;
+presym_sym (loader_data, module, symbol)
+ lt_dlloader_data_t loader_data;
+ lt_module_t module;
const char *symbol;
{
- lt_dlsymlist *syms = (lt_dlsymlist*)(handle->handle);
+ lt_dlsymlist *syms = (lt_dlsymlist*)(module);
syms++;
while (syms->address) {
@@ -808,31 +780,24 @@ presym_sym (handle, symbol)
return syms->address;
syms++;
}
- last_error = symbol_error;
+ last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
return 0;
}
-static
-lt_dltype_t
-presym = { LTDL_TYPE_TOP, 0, presym_init, presym_exit,
- presym_open, presym_close, presym_sym };
+static struct lt_user_dlloader
+presym = { 0, presym_open, presym_close, presym_sym, presym_exit, 0 };
-#undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &presym
static char *user_search_path = 0;
+static lt_dlloader_t *loaders = 0;
static lt_dlhandle handles = 0;
static int initialized = 0;
-static lt_dltype_t *types = LTDL_TYPE_TOP;
-#undef LTDL_TYPE_TOP
-
int
lt_dlinit LTDL_PARAMS((void))
{
/* initialize libltdl */
- lt_dltype_t **type = &types;
- int typecount = 0;
+ int errors = 0;
if (initialized) { /* Initialize only at first call. */
initialized++;
@@ -840,17 +805,30 @@ lt_dlinit LTDL_PARAMS((void))
}
handles = 0;
user_search_path = 0; /* empty search path */
-
- while (*type) {
- if ((*type)->mod_init())
- *type = (*type)->next; /* Remove it from the list */
- else {
- type = &(*type)->next; /* Keep it */
- typecount++;
- }
+
+#if HAVE_LIBDL && !defined(__CYGWIN__)
+ errors += lt_dlloader_add (lt_dlloader_next(0), &sys_dl, "dlopen");
+#endif
+#if HAVE_SHL_LOAD
+ errors += lt_dlloader_add (lt_dlloader_next(0), &sys_shl, "dlopen");
+#endif
+#ifdef _WIN32
+ errors += lt_dlloader_add (lt_dlloader_next(0), &sys_wll, "dlopen");
+#endif
+#ifdef __BEOS__
+ errors += lt_dlloader_add (lt_dlloader_next(0), &sys_bedl, "dlopen");
+#endif
+#if HAVE_DLD
+ errors += lt_dlloader_add (lt_dlloader_next(0), &sys_dld, "dld");
+#endif
+ errors += lt_dlloader_add (lt_dlloader_next(0), &presym, "dlpreload");
+ if (presym_init(presym.dlloader_data)) {
+ last_error = LT_DLSTRERROR(INIT_LOADER);
+ return 1;
}
- if (typecount == 0) {
- last_error = dlopen_not_supported_error;
+
+ if (errors != 0) {
+ last_error = LT_DLSTRERROR(DLOPEN_NOT_SUPPORTED);
return 1;
}
last_error = 0;
@@ -882,11 +860,11 @@ int
lt_dlexit LTDL_PARAMS((void))
{
/* shut down libltdl */
- lt_dltype_t *type = types;
- int errors;
+ lt_dlloader_t *loader = loaders;
+ int errors, level;
if (!initialized) {
- last_error = shutdown_error;
+ last_error = LT_DLSTRERROR(SHUTDOWN);
return 1;
}
if (initialized != 1) { /* shut down only at last call. */
@@ -895,17 +873,27 @@ lt_dlexit LTDL_PARAMS((void))
}
/* close all modules */
errors = 0;
- while (handles) {
- /* FIXME: what if a module depends on another one? */
- if (lt_dlclose(handles))
- errors++;
+ for (level = 1; handles; level++) {
+ lt_dlhandle cur = handles;
+ while (cur) {
+ lt_dlhandle tmp = cur;
+ cur = cur->next;
+ if (tmp->info.ref_count <= level)
+ if (lt_dlclose(tmp))
+ errors++;
+ }
}
- initialized = 0;
- while (type) {
- if (type->mod_exit())
+ /* close all loaders */
+ while (loader) {
+ lt_dlloader_t *next = loader->next;
+ lt_dlloader_data_t data = loader->dlloader_data;
+ if (loader->dlloader_exit && loader->dlloader_exit(data))
errors++;
- type = type->next;
+ lt_dlfree (loader);
+ loader = next;
}
+
+ initialized = 0;
return errors;
}
@@ -914,46 +902,49 @@ tryall_dlopen (handle, filename)
lt_dlhandle *handle;
const char *filename;
{
- lt_dlhandle cur;
- lt_dltype_t *type = types;
+ lt_dlhandle cur = handles;
+ lt_dlloader_t *loader = loaders;
const char *saved_error = last_error;
/* check whether the module was already opened */
- cur = handles;
while (cur) {
- if (!cur->filename && !filename)
+ /* try to dlopen the program itself? */
+ if (!cur->info.filename && !filename)
break;
- if (cur->filename && filename &&
- strcmp(cur->filename, filename) == 0)
+ if (cur->info.filename && filename &&
+ strcmp(cur->info.filename, filename) == 0)
break;
cur = cur->next;
}
+
if (cur) {
- cur->usage++;
+ cur->info.ref_count++;
*handle = cur;
return 0;
}
cur = *handle;
if (filename) {
- cur->filename = strdup(filename);
- if (!cur->filename) {
- last_error = memory_error;
+ cur->info.filename = strdup(filename);
+ if (!cur->info.filename) {
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 1;
}
} else
- cur->filename = 0;
- while (type) {
- if (type->lib_open(cur, filename) == 0)
+ cur->info.filename = 0;
+ while (loader) {
+ lt_dlloader_data_t data = loader->dlloader_data;
+ cur->module = loader->module_open(data, filename);
+ if (cur->module != 0)
break;
- type = type->next;
+ loader = loader->next;
}
- if (!type) {
- if (cur->filename)
- lt_dlfree(cur->filename);
+ if (!loader) {
+ if (cur->info.filename)
+ lt_dlfree(cur->info.filename);
return 1;
}
- cur->type = type;
+ cur->loader = loader;
last_error = saved_error;
return 0;
}
@@ -981,15 +972,13 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
filename = (char*)
lt_dlmalloc(strlen(libdir)+1+strlen(dlname)+1);
if (!filename) {
- last_error = memory_error;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 1;
}
- strcpy(filename, libdir);
- strcat(filename, "/");
- strcat(filename, dlname);
- error = tryall_dlopen(handle, filename) == 0;
+ sprintf (filename, "%s/%s", libdir, dlname);
+ error = tryall_dlopen(handle, filename) != 0;
lt_dlfree(filename);
- if (error)
+ if (!error)
return 0;
}
/* try to open the not-installed module */
@@ -998,7 +987,7 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
lt_dlmalloc((dir ? strlen(dir) : 0)
+ strlen(objdir) + strlen(dlname) + 1);
if (!filename) {
- last_error = memory_error;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 1;
}
if (dir)
@@ -1008,12 +997,12 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
strcat(filename, objdir);
strcat(filename, dlname);
- error = tryall_dlopen(handle, filename) == 0;
+ error = tryall_dlopen(handle, filename) != 0;
lt_dlfree(filename);
- if (error)
+ if (!error)
return 0;
}
- /* hmm, maybe it was moved to another directory */
+ /* maybe it was moved to another directory */
{
filename = (char*)
lt_dlmalloc((dir ? strlen(dir) : 0)
@@ -1023,16 +1012,34 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
else
*filename = 0;
strcat(filename, dlname);
- error = tryall_dlopen(handle, filename) == 0;
+ error = tryall_dlopen(handle, filename) != 0;
lt_dlfree(filename);
- if (error)
+ if (!error)
return 0;
}
}
- last_error = file_not_found_error;
return 1;
}
+static char*
+canonicalize_path (path)
+ const char *path;
+{
+ char *canonical = 0;
+
+ if (path && *path) {
+ char *ptr = strdup (path);
+ canonical = ptr;
+#ifdef LTDL_DIRSEP_CHAR
+ /* Avoid this overhead where '/' is the only separator. */
+ while (ptr = strchr (ptr, LTDL_DIRSEP_CHAR))
+ *ptr++ = '/';
+#endif
+ }
+
+ return canonical;
+}
+
static lt_ptr_t
find_file (basename, search_path, pdir, handle)
const char *basename;
@@ -1043,24 +1050,31 @@ find_file (basename, search_path, pdir, handle)
/* when handle != NULL search a library, otherwise a file */
/* return NULL on failure, otherwise the file/handle */
+ lt_ptr_t result = 0;
char *filename = 0;
int filenamesize = 0;
- const char *next = search_path;
int lenbase = strlen(basename);
+ char *canonical = 0, *next = 0;
- if (!next || !*next) {
- last_error = file_not_found_error;
+ if (!search_path || !*search_path) {
+ last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
return 0;
}
+ canonical = canonicalize_path (search_path);
+ if (!canonical) {
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ goto cleanup;
+ }
+ next = canonical;
while (next) {
int lendir;
- const char *cur = next;
+ char *cur = next;
- next = strchr(cur, ':');
+ next = strchr(cur, LTDL_PATHSEP_CHAR);
if (!next)
next = cur + strlen(cur);
lendir = next - cur;
- if (*next == ':')
+ if (*next == LTDL_PATHSEP_CHAR)
++next;
else
next = 0;
@@ -1072,8 +1086,8 @@ find_file (basename, search_path, pdir, handle)
filenamesize = lendir + 1 + lenbase + 1;
filename = (char*) lt_dlmalloc(filenamesize);
if (!filename) {
- last_error = memory_error;
- return 0;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ goto cleanup;
}
}
strncpy(filename, cur, lendir);
@@ -1082,8 +1096,8 @@ find_file (basename, search_path, pdir, handle)
strcpy(filename+lendir, basename);
if (handle) {
if (tryall_dlopen(handle, filename) == 0) {
- lt_dlfree(filename);
- return (lt_ptr_t) handle;
+ result = (lt_ptr_t) handle;
+ goto cleanup;
}
} else {
FILE *file = fopen(filename, LTDL_READTEXT_MODE);
@@ -1097,39 +1111,142 @@ find_file (basename, search_path, pdir, handle)
strdup, but there would be some
memory overhead. */
*pdir = filename;
- } else
- lt_dlfree(filename);
- return (lt_ptr_t) file;
+ filename = 0;
+ }
+ result = (lt_ptr_t) file;
+ goto cleanup;
}
}
}
+ last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
+cleanup:
if (filename)
lt_dlfree(filename);
- last_error = file_not_found_error;
- return 0;
+ if (canonical)
+ lt_dlfree(canonical);
+ return result;
}
static int
load_deplibs(handle, deplibs)
lt_dlhandle handle;
- const char *deplibs;
+ char *deplibs;
{
- /* FIXME: load deplibs */
+ char *p, *save_search_path;
+ int i;
+ int ret = 1, depcount = 0;
+ char **names = 0;
+ lt_dlhandle *handles = 0;
+
handle->depcount = 0;
- handle->deplibs = 0;
- /* Just to silence gcc -Wall */
- deplibs = 0;
- return 0;
+ if (!deplibs)
+ return 0;
+ save_search_path = strdup(user_search_path);
+ if (user_search_path && !save_search_path) {
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ return 1;
+ }
+ p = deplibs;
+ /* extract search paths and count deplibs */
+ while (*p) {
+ if (!isspace(*p)) {
+ char *end = p+1;
+ while (*end && !isspace(*end)) end++;
+ if (strncmp(p, "-L", 2) == 0 ||
+ strncmp(p, "-R", 2) == 0) {
+ char save = *end;
+ *end = 0; /* set a temporary string terminator */
+ if (lt_dladdsearchdir(p+2))
+ goto cleanup;
+ *end = save;
+ } else
+ depcount++;
+ p = end;
+ } else
+ p++;
+ }
+ if (!depcount) {
+ ret = 0;
+ goto cleanup;
+ }
+ names = (char**)lt_dlmalloc(depcount * sizeof(char*));
+ if (!names)
+ goto cleanup;
+ handles = (lt_dlhandle*)lt_dlmalloc(depcount * sizeof(lt_dlhandle*));
+ if (!handles)
+ goto cleanup;
+ depcount = 0;
+ /* now only extract the actual deplibs */
+ p = deplibs;
+ while (*p) {
+ if (!isspace(*p)) {
+ char *end = p+1;
+ while (*end && !isspace(*end)) end++;
+ if (strncmp(p, "-L", 2) != 0 &&
+ strncmp(p, "-R", 2) != 0) {
+ char *name;
+ char save = *end;
+ *end = 0; /* set a temporary string terminator */
+ if (strncmp(p, "-l", 2) == 0) {
+ name = lt_dlmalloc(3+ /* "lib" */
+ strlen(p+2)+1);
+ if (name)
+ sprintf (name, "lib%s", p+2);
+ } else
+ name = strdup(p);
+ if (name)
+ names[depcount++] = name;
+ else
+ goto cleanup_names;
+ *end = save;
+ }
+ p = end;
+ } else
+ p++;
+ }
+ /* load the deplibs (in reverse order) */
+ for (i = 0; i < depcount; i++) {
+ lt_dlhandle handle = lt_dlopenext(names[depcount-1-i]);
+ if (!handle) {
+ int j;
+ for (j = 0; j < i; j++)
+ lt_dlclose(handles[j]);
+ last_error = LT_DLSTRERROR(DEPLIB_NOT_FOUND);
+ goto cleanup_names;
+ }
+ handles[i] = handle;
+ }
+ handle->depcount = depcount;
+ handle->deplibs = handles;
+ handles = 0;
+ ret = 0;
+cleanup_names:
+ for (i = 0; i < depcount; i++)
+ lt_dlfree(names[i]);
+cleanup:
+ if (names)
+ lt_dlfree(names);
+ if (handles)
+ lt_dlfree(handles);
+ /* restore the old search path */
+ if (user_search_path)
+ lt_dlfree(user_search_path);
+ user_search_path = save_search_path;
+ return ret;
}
static int
unload_deplibs(handle)
lt_dlhandle handle;
{
- /* FIXME: unload deplibs */
- /* Just to silence gcc -Wall */
- handle = 0;
- return 0;
+ int i;
+ int errors = 0;
+
+ if (!handle->depcount)
+ return 0;
+ for (i = 0; i < handle->depcount; i++)
+ errors += lt_dlclose(handle->deplibs[i]);
+ return errors;
}
static inline int
@@ -1148,7 +1265,7 @@ trim (dest, str)
if (len > 3 && str[0] == '\'') {
tmp = (char*) lt_dlmalloc(end - str);
if (!tmp) {
- last_error = memory_error;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 1;
}
strncpy(tmp, &str[1], (end - str) - 1);
@@ -1160,18 +1277,12 @@ trim (dest, str)
}
static inline int
-free_vars(dir, name, dlname, oldname, libdir, deplibs)
- char *dir;
- char *name;
+free_vars( dlname, oldname, libdir, deplibs)
char *dlname;
char *oldname;
char *libdir;
char *deplibs;
{
- if (dir)
- lt_dlfree(dir);
- if (name)
- lt_dlfree(name);
if (dlname)
lt_dlfree(dlname);
if (oldname)
@@ -1187,18 +1298,18 @@ lt_dlhandle
lt_dlopen (filename)
const char *filename;
{
- lt_dlhandle handle, newhandle;
- const char *basename, *ext;
+ lt_dlhandle handle = 0, newhandle;
+ const char *ext;
const char *saved_error = last_error;
- char *dir = 0, *name = 0;
+ char *canonical = 0, *basename = 0, *dir = 0, *name = 0;
if (!filename) {
handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
if (!handle) {
- last_error = memory_error;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 0;
}
- handle->usage = 0;
+ handle->info.ref_count = 0;
handle->depcount = 0;
handle->deplibs = 0;
newhandle = handle;
@@ -1208,18 +1319,26 @@ lt_dlopen (filename)
}
goto register_handle;
}
- basename = strrchr(filename, '/');
+ canonical = canonicalize_path (filename);
+ if (!canonical) {
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ if (handle)
+ lt_dlfree(handle);
+ return 0;
+ }
+ basename = strrchr(canonical, '/');
if (basename) {
basename++;
- dir = (char*) lt_dlmalloc(basename - filename + 1);
+ dir = (char*) lt_dlmalloc(basename - canonical + 1);
if (!dir) {
- last_error = memory_error;
- return 0;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ handle = 0;
+ goto cleanup;
}
- strncpy(dir, filename, basename - filename);
- dir[basename - filename] = '\0';
+ strncpy(dir, canonical, basename - canonical);
+ dir[basename - canonical] = '\0';
} else
- basename = filename;
+ basename = canonical;
/* check whether we open a libtool module (.la extension) */
ext = strrchr(basename, '.');
if (ext && strcmp(ext, ".la") == 0) {
@@ -1238,10 +1357,9 @@ lt_dlopen (filename)
/* extract the module name from the file name */
name = (char*) lt_dlmalloc(ext - basename + 1);
if (!name) {
- last_error = memory_error;
- if (dir)
- lt_dlfree(dir);
- return 0;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ handle = 0;
+ goto cleanup;
}
/* canonicalize the module name */
for (i = 0; i < ext - basename; i++)
@@ -1253,7 +1371,7 @@ lt_dlopen (filename)
/* now try to open the .la file */
file = fopen(filename, LTDL_READTEXT_MODE);
if (!file)
- last_error = file_not_found_error;
+ last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
if (!file && !dir) {
/* try other directories */
file = (FILE*) find_file(basename,
@@ -1269,19 +1387,23 @@ lt_dlopen (filename)
getenv(LTDL_SHLIBPATH_VAR),
&dir, 0);
#endif
+#ifdef LTDL_SYSSEARCHPATH
+ if (!file)
+ file = (FILE*) find_file(basename,
+ sys_search_path,
+ &dir, 0);
+#endif
}
if (!file) {
- if (name)
- lt_dlfree(name);
- if (dir)
- lt_dlfree(dir);
- return 0;
+ handle = 0;
+ goto cleanup;
}
line = (char*) lt_dlmalloc(LTDL_FILENAME_MAX);
if (!line) {
fclose(file);
- last_error = memory_error;
- return 0;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ handle = 0;
+ goto cleanup;
}
/* read the .la file */
while (!feof(file)) {
@@ -1322,6 +1444,22 @@ lt_dlopen (filename)
else
if (strcmp(line, "installed=no\n") == 0)
installed = 0;
+ else
+# undef STR_LIBRARY_NAMES
+# define STR_LIBRARY_NAMES "library_names="
+ if (! dlname &&
+ strncmp(line, STR_LIBRARY_NAMES,
+ sizeof(STR_LIBRARY_NAMES) - 1) == 0) {
+ char *last_libname;
+ error = trim(&dlname,
+ &line[sizeof(STR_LIBRARY_NAMES) - 1]);
+ if (! error && dlname &&
+ (last_libname = strrchr(dlname, ' ')) != NULL) {
+ last_libname = strdup(last_libname + 1);
+ free(dlname);
+ dlname = last_libname;
+ }
+ }
if (error)
break;
}
@@ -1333,11 +1471,12 @@ lt_dlopen (filename)
if (handle)
lt_dlfree(handle);
if (!error)
- last_error = memory_error;
- free_vars(name, dir, dlname, old_name, libdir, deplibs);
- return 0;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ free_vars(dlname, old_name, libdir, deplibs);
+ /* handle is already set to 0 */
+ goto cleanup;
}
- handle->usage = 0;
+ handle->info.ref_count = 0;
if (load_deplibs(handle, deplibs) == 0) {
newhandle = handle;
/* find_module may replace newhandle */
@@ -1348,24 +1487,23 @@ lt_dlopen (filename)
}
} else
error = 1;
+ free_vars(dlname, old_name, libdir, deplibs);
if (error) {
lt_dlfree(handle);
- free_vars(name, dir, dlname, old_name, libdir, deplibs);
- return 0;
+ handle = 0;
+ goto cleanup;
}
- if (handle != newhandle) {
+ if (handle != newhandle)
unload_deplibs(handle);
- }
} else {
/* not a libtool module */
handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
if (!handle) {
- last_error = memory_error;
- if (dir)
- lt_dlfree(dir);
- return 0;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ /* handle is already set to 0 */
+ goto cleanup;
}
- handle->usage = 0;
+ handle->info.ref_count = 0;
/* non-libtool modules don't have dependencies */
handle->depcount = 0;
handle->deplibs = 0;
@@ -1382,11 +1520,14 @@ lt_dlopen (filename)
getenv(LTDL_SHLIBPATH_VAR),
0, &newhandle)
#endif
+#ifdef LTDL_SYSSEARCHPATH
+ && !find_file(basename, sys_search_path,
+ 0, &newhandle)
+#endif
))) {
lt_dlfree(handle);
- if (dir)
- lt_dlfree(dir);
- return 0;
+ handle = 0;
+ goto cleanup;
}
}
register_handle:
@@ -1394,16 +1535,21 @@ register_handle:
lt_dlfree(handle);
handle = newhandle;
}
- if (!handle->usage) {
- handle->usage = 1;
- handle->name = name;
+ if (!handle->info.ref_count) {
+ handle->info.ref_count = 1;
+ handle->info.name = name;
handle->next = handles;
handles = handle;
- } else if (name)
- lt_dlfree(name);
+ name = 0; /* don't free this during `cleanup' */
+ }
+ last_error = saved_error;
+cleanup:
if (dir)
lt_dlfree(dir);
- last_error = saved_error;
+ if (name)
+ lt_dlfree(name);
+ if (canonical)
+ lt_dlfree(canonical);
return handle;
}
@@ -1420,7 +1566,7 @@ lt_dlopenext (filename)
return lt_dlopen(filename);
len = strlen(filename);
if (!len) {
- last_error = file_not_found_error;
+ last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
return 0;
}
/* try the normal file name */
@@ -1430,7 +1576,7 @@ lt_dlopenext (filename)
/* try "filename.la" */
tmp = (char*) lt_dlmalloc(len+4);
if (!tmp) {
- last_error = memory_error;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 0;
}
strcpy(tmp, filename);
@@ -1447,7 +1593,7 @@ lt_dlopenext (filename)
lt_dlfree(tmp);
tmp = (char*) lt_dlmalloc(len + strlen(shlib_ext) + 1);
if (!tmp) {
- last_error = memory_error;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 0;
}
strcpy(tmp, filename);
@@ -1461,7 +1607,7 @@ lt_dlopenext (filename)
return handle;
}
#endif
- last_error = file_not_found_error;
+ last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
lt_dlfree(tmp);
return 0;
}
@@ -1479,23 +1625,24 @@ lt_dlclose (handle)
cur = cur->next;
}
if (!cur) {
- last_error = invalid_handle_error;
+ last_error = LT_DLSTRERROR(INVALID_HANDLE);
return 1;
}
- handle->usage--;
- if (!handle->usage) {
+ handle->info.ref_count--;
+ if (!handle->info.ref_count) {
int error;
+ lt_dlloader_data_t data = handle->loader->dlloader_data;
if (handle != handles)
last->next = handle->next;
else
handles = handle->next;
- error = handle->type->lib_close(handle);
+ error = handle->loader->module_close(data, handle->module);
error += unload_deplibs(handle);
- if (handle->filename)
- lt_dlfree(handle->filename);
- if (handle->name)
- lt_dlfree(handle->name);
+ if (handle->info.filename)
+ lt_dlfree(handle->info.filename);
+ if (handle->info.name)
+ lt_dlfree(handle->info.name);
lt_dlfree(handle);
return error;
}
@@ -1511,41 +1658,43 @@ lt_dlsym (handle, symbol)
char lsym[LTDL_SYMBOL_LENGTH];
char *sym;
lt_ptr_t address;
+ lt_dlloader_data_t data;
if (!handle) {
- last_error = invalid_handle_error;
+ last_error = LT_DLSTRERROR(INVALID_HANDLE);
return 0;
}
if (!symbol) {
- last_error = symbol_error;
+ last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
return 0;
}
lensym = strlen(symbol);
- if (handle->type->sym_prefix)
- lensym += strlen(handle->type->sym_prefix);
- if (handle->name)
- lensym += strlen(handle->name);
+ if (handle->loader->sym_prefix)
+ lensym += strlen(handle->loader->sym_prefix);
+ if (handle->info.name)
+ lensym += strlen(handle->info.name);
if (lensym + LTDL_SYMBOL_OVERHEAD < LTDL_SYMBOL_LENGTH)
sym = lsym;
else
sym = (char*) lt_dlmalloc(lensym + LTDL_SYMBOL_OVERHEAD + 1);
if (!sym) {
- last_error = buffer_overflow_error;
+ last_error = LT_DLSTRERROR(BUFFER_OVERFLOW);
return 0;
}
- if (handle->name) {
+ data = handle->loader->dlloader_data;
+ if (handle->info.name) {
const char *saved_error = last_error;
/* this is a libtool module */
- if (handle->type->sym_prefix) {
- strcpy(sym, handle->type->sym_prefix);
- strcat(sym, handle->name);
+ if (handle->loader->sym_prefix) {
+ strcpy(sym, handle->loader->sym_prefix);
+ strcat(sym, handle->info.name);
} else
- strcpy(sym, handle->name);
+ strcpy(sym, handle->info.name);
strcat(sym, "_LTX_");
strcat(sym, symbol);
/* try "modulename_LTX_symbol" */
- address = handle->type->find_sym(handle, sym);
+ address = handle->loader->find_sym(data, handle->module, sym);
if (address) {
if (sym != lsym)
lt_dlfree(sym);
@@ -1554,12 +1703,12 @@ lt_dlsym (handle, symbol)
last_error = saved_error;
}
/* otherwise try "symbol" */
- if (handle->type->sym_prefix) {
- strcpy(sym, handle->type->sym_prefix);
+ if (handle->loader->sym_prefix) {
+ strcpy(sym, handle->loader->sym_prefix);
strcat(sym, symbol);
} else
strcpy(sym, symbol);
- address = handle->type->find_sym(handle, sym);
+ address = handle->loader->find_sym(data, handle->module, sym);
if (sym != lsym)
lt_dlfree(sym);
return address;
@@ -1583,7 +1732,7 @@ lt_dladdsearchdir (search_dir)
if (!user_search_path) {
user_search_path = strdup(search_dir);
if (!user_search_path) {
- last_error = memory_error;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 1;
}
} else {
@@ -1591,12 +1740,11 @@ lt_dladdsearchdir (search_dir)
lt_dlmalloc(strlen(user_search_path) +
strlen(search_dir) + 2); /* ':' + '\0' == 2 */
if (!new_search_path) {
- last_error = memory_error;
+ last_error = LT_DLSTRERROR(NO_MEMORY);
return 1;
}
- strcpy(new_search_path, user_search_path);
- strcat(new_search_path, ":");
- strcat(new_search_path, search_dir);
+ sprintf (new_search_path, "%s%c%s", user_search_path,
+ LTDL_PATHSEP_CHAR, search_dir);
lt_dlfree(user_search_path);
user_search_path = new_search_path;
}
@@ -1623,3 +1771,214 @@ lt_dlgetsearchpath LTDL_PARAMS((void))
{
return user_search_path;
}
+
+const lt_dlinfo *
+lt_dlgetinfo (handle)
+ lt_dlhandle handle;
+{
+ if (!handle) {
+ last_error = LT_DLSTRERROR(INVALID_HANDLE);
+ return 0;
+ }
+ return &(handle->info);
+}
+
+int
+lt_dlforeach (func, data)
+ int (*func) LTDL_PARAMS((lt_dlhandle handle, lt_ptr_t data));
+ lt_ptr_t data;
+{
+ lt_dlhandle cur = handles;
+ while (cur) {
+ lt_dlhandle tmp = cur;
+ cur = cur->next;
+ if (func(tmp, data))
+ return 1;
+ }
+ return 0;
+}
+
+int
+lt_dlloader_add (place, dlloader, loader_name)
+ lt_dlloader_t *place;
+ const struct lt_user_dlloader *dlloader;
+ const char *loader_name;
+{
+ lt_dlloader_t *node = 0, *ptr = 0;
+
+ if ((dlloader == 0) /* diagnose null parameters */
+ || (dlloader->module_open == 0)
+ || (dlloader->module_close == 0)
+ || (dlloader->find_sym == 0)) {
+ last_error = LT_DLSTRERROR(INVALID_LOADER);
+ return 1;
+ }
+
+ /* Create a new dlloader node with copies of the user callbacks. */
+ node = (lt_dlloader_t *) lt_dlmalloc (sizeof (lt_dlloader_t));
+ if (node == 0) {
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ return 1;
+ }
+ node->next = 0;
+ node->loader_name = loader_name;
+ node->sym_prefix = dlloader->sym_prefix;
+ node->dlloader_exit = dlloader->dlloader_exit;
+ node->module_open = dlloader->module_open;
+ node->module_close = dlloader->module_close;
+ node->find_sym = dlloader->find_sym;
+ node->dlloader_data = dlloader->dlloader_data;
+
+ if (!loaders)
+ /* If there are no loaders, NODE becomes the list! */
+ loaders = node;
+ else if (!place) {
+ /* If PLACE is not set, add NODE to the end of the
+ LOADERS list. */
+ for (ptr = loaders; ptr->next; ptr = ptr->next)
+ /*NOWORK*/;
+ ptr->next = node;
+ } else if (loaders == place) {
+ /* If PLACE is the first loader, NODE goes first. */
+ node->next = place;
+ loaders = node;
+ } else {
+ /* Find the node immediately preceding PLACE. */
+ for (ptr = loaders; ptr->next != place; ptr = ptr->next)
+ /*NOWORK*/;
+
+ if (ptr->next != place) {
+ last_error = LT_DLSTRERROR(INVALID_LOADER);
+ return 1;
+ }
+
+ /* Insert NODE between PTR and PLACE. */
+ node->next = place;
+ ptr->next = node;
+ }
+
+ return 0;
+}
+
+int
+lt_dlloader_remove (loader_name)
+ const char *loader_name;
+{
+ lt_dlloader_t *place = lt_dlloader_find (loader_name);
+ lt_dlhandle handle;
+ int result = 0;
+
+ if (!place) {
+ last_error = LT_DLSTRERROR(INVALID_LOADER);
+ return 1;
+ }
+
+ /* Fail if there are any open modules which use this loader. */
+ for (handle = handles; handle; handle = handle->next)
+ if (handle->loader == place) {
+ last_error = LT_DLSTRERROR(REMOVE_LOADER);
+ return 1;
+ }
+
+ if (place == loaders)
+ /* PLACE is the first loader in the list. */
+ loaders = loaders->next;
+ else {
+ /* Find the loader before the one being removed. */
+ lt_dlloader_t *prev;
+ for (prev = loaders; prev->next; prev = prev->next)
+ if (!strcmp (prev->next->loader_name, loader_name))
+ break;
+
+ place = prev->next;
+ prev->next = prev->next->next;
+ }
+ if (place->dlloader_exit)
+ result = place->dlloader_exit (place->dlloader_data);
+ lt_dlfree (place);
+
+ return result;
+}
+
+lt_dlloader_t *
+lt_dlloader_next (place)
+ lt_dlloader_t *place;
+{
+ return place ? place->next : loaders;
+}
+
+const char *
+lt_dlloader_name (place)
+ lt_dlloader_t *place;
+{
+ if (!place)
+ last_error = LT_DLSTRERROR(INVALID_LOADER);
+ return place ? place->loader_name : 0;
+}
+
+lt_dlloader_data_t *
+lt_dlloader_data (place)
+ lt_dlloader_t *place;
+{
+ if (!place)
+ last_error = LT_DLSTRERROR(INVALID_LOADER);
+ return place ? &(place->dlloader_data) : 0;
+}
+
+lt_dlloader_t *
+lt_dlloader_find (loader_name)
+ const char *loader_name;
+{
+ lt_dlloader_t *place = 0;
+
+ for (place = loaders; place; place = place->next)
+ if (strcmp (place->loader_name, loader_name) == 0)
+ break;
+
+ return place;
+}
+
+static const char **user_error_strings = 0;
+static int errorcode = LTDL_ERROR_MAX;
+
+int
+lt_dladderror (diagnostic)
+ const char *diagnostic;
+{
+ int index = errorcode - LTDL_ERROR_MAX;
+ const char **temp = 0;
+
+ /* realloc is not entirely portable, so simulate it using
+ lt_dlmalloc and lt_dlfree. */
+ temp = (const char **) lt_dlmalloc ((1+index) * sizeof(const char*));
+ if (temp == 0) {
+ last_error = LT_DLSTRERROR(NO_MEMORY);
+ return -1;
+ }
+
+ /* Build the new vector in the memory addressed by temp. */
+ temp[index] = diagnostic;
+ while (--index >= 0)
+ temp[index] = user_error_strings[index];
+
+ lt_dlfree (user_error_strings);
+ user_error_strings = temp;
+ return errorcode++;
+}
+
+int
+lt_dlseterror (index)
+ int index;
+{
+ if (index >= errorcode || index < 0) {
+ last_error = LT_DLSTRERROR(INVALID_ERRORCODE);
+ return 1;
+ }
+
+ if (index < LTDL_ERROR_MAX)
+ last_error = ltdl_error_strings[errorcode];
+ else
+ last_error = user_error_strings[errorcode - LTDL_ERROR_MAX];
+
+ return 0;
+}