2001-06-30 06:56:50 +08:00
|
|
|
## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
|
2004-01-02 09:59:11 +08:00
|
|
|
## Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
1999-12-07 18:52:53 +08:00
|
|
|
##
|
|
|
|
## 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.
|
|
|
|
|
2001-10-28 08:00:00 +08:00
|
|
|
# serial 6 AC_LIB_LTDL
|
|
|
|
|
2004-06-21 18:17:27 +08:00
|
|
|
# AC_WITH_LTDL([DIRECTORY])
|
|
|
|
# -------------------------
|
2001-10-28 08:00:00 +08:00
|
|
|
# Clients of libltdl can use this macro to allow the installer to
|
|
|
|
# choose between a shipped copy of the ltdl sources or a preinstalled
|
|
|
|
# version of the library.
|
|
|
|
AC_DEFUN([AC_WITH_LTDL],
|
2004-06-21 18:17:27 +08:00
|
|
|
[AC_ARG_WITH([included_ltdl],
|
|
|
|
[AC_HELP_STRING([--with-included-ltdl],
|
|
|
|
[use the GNU ltdl sources included here])])
|
2001-10-28 08:00:00 +08:00
|
|
|
|
|
|
|
if test "x$with_included_ltdl" != xyes; then
|
|
|
|
# We are not being forced to use the included libltdl sources, so
|
|
|
|
# decide whether there is a useful installed version we can use.
|
|
|
|
AC_CHECK_HEADER([ltdl.h],
|
|
|
|
[AC_CHECK_LIB([ltdl], [lt_dlcaller_register],
|
|
|
|
[with_included_ltdl=no],
|
2003-08-28 00:24:44 +08:00
|
|
|
[with_included_ltdl=yes])],
|
|
|
|
|
|
|
|
[],
|
|
|
|
[AC_INCLUDES_DEFAULT]
|
|
|
|
)
|
2001-10-28 08:00:00 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$enable_ltdl_install" != xyes; then
|
|
|
|
# If the user did not specify an installable libltdl, then default
|
|
|
|
# to a convenience lib.
|
|
|
|
AC_LIBLTDL_CONVENIENCE
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$with_included_ltdl" = xno; then
|
|
|
|
# If the included ltdl is not to be used. then Use the
|
|
|
|
# preinstalled libltdl we found.
|
|
|
|
AC_DEFINE([HAVE_LTDL], 1,
|
|
|
|
[Define this if a modern libltdl is already installed])
|
|
|
|
LIBLTDL=-lltdl
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Report our decision...
|
|
|
|
AC_MSG_CHECKING([whether to use included libltdl])
|
|
|
|
AC_MSG_RESULT([$with_included_ltdl])
|
|
|
|
|
2004-06-22 00:40:01 +08:00
|
|
|
AC_CONFIG_SUBDIRS(m4_if($#, 1, [$1], [libltdl]))
|
2001-10-28 08:00:00 +08:00
|
|
|
])# AC_WITH_LTDL
|
|
|
|
|
1999-12-07 18:52:53 +08:00
|
|
|
|
2004-06-21 18:17:27 +08:00
|
|
|
# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
|
|
|
|
# -----------------------------------
|
|
|
|
# sets LIBLTDL to the link flags for the libltdl convenience library and
|
|
|
|
# LTDLINCL to the include flags for the libltdl header and adds
|
|
|
|
# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
|
|
|
|
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
|
|
|
|
# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
|
|
|
|
# be prefixed with '${top_builddir}/' and LTDLINCL 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],
|
|
|
|
[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
|
2004-06-22 00:40:01 +08:00
|
|
|
LIBLTDL='${top_builddir}/'m4_if($#, 1, [$1], ['libltdl'])/libltdlc.la
|
2004-06-21 18:17:27 +08:00
|
|
|
LTDLINCL='-I${top_srcdir}/'m4_if($#, 1, [$1], ['libltdl'])
|
|
|
|
|
|
|
|
AC_SUBST([LIBLTDL])
|
|
|
|
AC_SUBST([LTDLINCL])
|
|
|
|
|
|
|
|
# For backwards non-gettext consistent compatibility...
|
|
|
|
INCLTDL="$LTDLINCL"
|
|
|
|
AC_SUBST([INCLTDL])
|
|
|
|
])# AC_LIBLTDL_CONVENIENCE
|
|
|
|
|
|
|
|
|
|
|
|
# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
|
|
|
|
# -----------------------------------
|
|
|
|
# sets LIBLTDL to the link flags for the libltdl installable library and
|
|
|
|
# LTDLINCL to the include flags for the libltdl header and adds
|
|
|
|
# --enable-ltdl-install to the configure arguments. Note that LIBLTDL
|
|
|
|
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
|
|
|
|
# DIRECTORY is not provided and an installed libltdl is not found, it is
|
|
|
|
# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
|
|
|
|
# and LTDLINCL 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 LT_INIT.
|
|
|
|
AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
|
|
|
|
[AC_CHECK_LIB(ltdl, lt_dlinit,
|
|
|
|
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
|
|
|
[if test x"$enable_ltdl_install" = xno; then
|
|
|
|
AC_MSG_WARN([libltdl not installed, but installation disabled])
|
|
|
|
else
|
|
|
|
enable_ltdl_install=yes
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
if test x"$enable_ltdl_install" = x"yes"; then
|
|
|
|
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
|
|
|
LIBLTDL='${top_builddir}/'m4_if($#, 1, [$1], ['libltdl'])/libltdl.la
|
|
|
|
LTDLINCL='-I${top_srcdir}/'m4_if($#, 1, [$1], ['libltdl'])
|
|
|
|
else
|
|
|
|
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
|
|
|
LIBLTDL="-lltdl"
|
|
|
|
LTDLINCL=
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST([LIBLTDL])
|
|
|
|
AC_SUBST([LTDLINCL])
|
|
|
|
|
|
|
|
# For backwards non-gettext consistent compatibility...
|
|
|
|
INCLTDL="$LTDLINCL"
|
|
|
|
AC_SUBST([INCLTDL])
|
|
|
|
])# AC_LIBLTDL_INSTALLABLE
|
|
|
|
|
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LIB_LTDL
|
|
|
|
# -----------
|
2001-08-01 14:50:16 +08:00
|
|
|
# Perform all the checks necessary for compilation of the ltdl objects
|
|
|
|
# -- including compiler checks and header checks.
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LIB_LTDL],
|
2004-06-21 18:17:27 +08:00
|
|
|
[AC_REQUIRE([AC_PROG_CC])
|
2001-08-01 14:50:16 +08:00
|
|
|
AC_REQUIRE([AC_C_CONST])
|
|
|
|
AC_REQUIRE([AC_HEADER_STDC])
|
|
|
|
AC_REQUIRE([AC_HEADER_DIRENT])
|
|
|
|
AC_REQUIRE([_LT_AC_CHECK_DLFCN])
|
|
|
|
AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])
|
|
|
|
AC_REQUIRE([AC_LTDL_SHLIBEXT])
|
|
|
|
AC_REQUIRE([AC_LTDL_SHLIBPATH])
|
|
|
|
AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])
|
|
|
|
AC_REQUIRE([AC_LTDL_OBJDIR])
|
|
|
|
AC_REQUIRE([AC_LTDL_DLPREOPEN])
|
|
|
|
AC_REQUIRE([AC_LTDL_DLLIB])
|
|
|
|
AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
|
|
|
|
AC_REQUIRE([AC_LTDL_DLSYM_USCORE])
|
|
|
|
AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])
|
2004-04-23 06:47:20 +08:00
|
|
|
AC_REQUIRE([gl_FUNC_ARGZ])
|
1999-12-13 21:44:29 +08:00
|
|
|
|
2004-01-17 06:03:19 +08:00
|
|
|
# In order that ltdl.c can compile, run AC_CONFIG_HEADERS for the user
|
|
|
|
# if they did not call it themself. This is so that ltdl.h can pick up
|
|
|
|
# the parent projects config.h file, The first file in AC_CONFIG_HEADERS
|
|
|
|
# must contain the definitions required by ltdl.c.
|
|
|
|
m4_ifset([AC_LIST_HEADERS],
|
|
|
|
[CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`],
|
|
|
|
[CONFIG_H=config.h;AC_CONFIG_HEADERS([config.h])])
|
|
|
|
AC_SUBST([CONFIG_H])
|
|
|
|
|
2004-04-08 21:51:15 +08:00
|
|
|
AC_CHECK_HEADERS([memory.h unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h],
|
2003-08-28 00:24:44 +08:00
|
|
|
[], [], [AC_INCLUDES_DEFAULT])
|
|
|
|
AC_CHECK_HEADERS([string.h strings.h], [break], [], [AC_INCLUDES_DEFAULT])
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2004-04-08 21:51:15 +08:00
|
|
|
AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])])
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LIB_LTDL
|
1999-12-07 18:52:53 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LTDL_ENABLE_INSTALL
|
|
|
|
# ----------------------
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_ENABLE_INSTALL],
|
2001-07-31 03:10:36 +08:00
|
|
|
[AC_ARG_ENABLE([ltdl-install],
|
|
|
|
[AC_HELP_STRING([--enable-ltdl-install], [install libltdl])])
|
1999-12-07 18:52:53 +08:00
|
|
|
|
|
|
|
AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
|
|
|
|
AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
|
2000-09-17 04:08:07 +08:00
|
|
|
])])# AC_LTDL_ENABLE_INSTALL
|
1999-12-07 18:52:53 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2001-02-03 03:02:38 +08:00
|
|
|
# AC_LTDL_SYS_DLOPEN_DEPLIBS
|
|
|
|
# --------------------------
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS],
|
2001-02-03 03:02:38 +08:00
|
|
|
[AC_REQUIRE([AC_CANONICAL_HOST])
|
|
|
|
AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
|
2001-08-01 14:50:16 +08:00
|
|
|
[libltdl_cv_sys_dlopen_deplibs],
|
|
|
|
[# PORTME does your system automatically load deplibs for dlopen?
|
|
|
|
# or its logical equivalent (e.g. shl_load for HP-UX < 11)
|
|
|
|
# For now, we just catch OSes we know something about -- in the
|
|
|
|
# future, we'll try test this programmatically.
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=unknown
|
|
|
|
case "$host_os" in
|
|
|
|
aix3*|aix4.1.*|aix4.2.*)
|
|
|
|
# Unknown whether this is true for these versions of AIX, but
|
|
|
|
# we want this `case' here to explicitly catch those versions.
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=unknown
|
|
|
|
;;
|
2002-06-24 06:39:50 +08:00
|
|
|
aix[[45]]*)
|
2001-08-01 14:50:16 +08:00
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
2003-02-24 07:49:34 +08:00
|
|
|
darwin*)
|
|
|
|
# Assuming the user has installed a libdl from somewhere, this is true
|
|
|
|
# If you are looking for one http://www.opendarwin.org/projects/dlcompat
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
2003-08-28 00:24:44 +08:00
|
|
|
;;
|
2003-09-21 20:50:48 +08:00
|
|
|
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
|
|
|
|
# GNU and its variants, using gnu ld.so (Glibc)
|
2001-08-01 14:50:16 +08:00
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
2002-06-24 06:43:39 +08:00
|
|
|
hpux10*|hpux11*)
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
2002-06-24 06:39:50 +08:00
|
|
|
irix[[12345]]*|irix6.[[01]]*)
|
2001-08-01 14:50:16 +08:00
|
|
|
# Catch all versions of IRIX before 6.2, and indicate that we don't
|
|
|
|
# know how it worked for any of those versions.
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=unknown
|
|
|
|
;;
|
|
|
|
irix*)
|
|
|
|
# The case above catches anything before 6.2, and it's known that
|
|
|
|
# at 6.2 and later dlopen does load deplibs.
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
|
|
|
netbsd*)
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
2001-09-03 11:26:55 +08:00
|
|
|
openbsd*)
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
2002-06-24 06:39:50 +08:00
|
|
|
osf[[1234]]*)
|
2001-08-01 14:50:16 +08:00
|
|
|
# dlopen did load deplibs (at least at 4.x), but until the 5.x series,
|
|
|
|
# it did *not* use an RPATH in a shared library to find objects the
|
|
|
|
# library depends on, so we explictly say `no'.
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=no
|
|
|
|
;;
|
|
|
|
osf5.0|osf5.0a|osf5.1)
|
|
|
|
# dlopen *does* load deplibs and with the right loader patch applied
|
|
|
|
# it even uses RPATH in a shared library to search for shared objects
|
|
|
|
# that the library depends on, but there's no easy way to know if that
|
|
|
|
# patch is installed. Since this is the case, all we can really
|
|
|
|
# say is unknown -- it depends on the patch being installed. If
|
|
|
|
# it is, this changes to `yes'. Without it, it would be `no'.
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=unknown
|
|
|
|
;;
|
|
|
|
osf*)
|
|
|
|
# the two cases above should catch all versions of osf <= 5.1. Read
|
|
|
|
# the comments above for what we know about them.
|
|
|
|
# At > 5.1, deplibs are loaded *and* any RPATH in a shared library
|
|
|
|
# is used to find them so we can finally say `yes'.
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
2004-05-18 00:41:23 +08:00
|
|
|
qnx*)
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
2001-08-01 14:50:16 +08:00
|
|
|
solaris*)
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
])
|
2001-02-03 03:02:38 +08:00
|
|
|
if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
|
2001-08-01 14:50:16 +08:00
|
|
|
AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define if the OS needs help to load dependent libraries for dlopen().])
|
2001-02-03 03:02:38 +08:00
|
|
|
fi
|
|
|
|
])# AC_LTDL_SYS_DLOPEN_DEPLIBS
|
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LTDL_SHLIBEXT
|
|
|
|
# ----------------
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_SHLIBEXT],
|
|
|
|
[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
|
2003-03-21 04:24:21 +08:00
|
|
|
AC_CACHE_CHECK([which extension is used for loadable modules],
|
2001-08-01 14:50:16 +08:00
|
|
|
[libltdl_cv_shlibext],
|
2003-03-21 04:24:21 +08:00
|
|
|
[
|
|
|
|
module=yes
|
2004-04-08 08:15:48 +08:00
|
|
|
eval libltdl_cv_shlibext=$shrext_cmds
|
2001-08-01 14:50:16 +08:00
|
|
|
])
|
1999-12-07 18:52:53 +08:00
|
|
|
if test -n "$libltdl_cv_shlibext"; then
|
|
|
|
AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define to the extension used for shared libraries, say, ".so".])
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LTDL_SHLIBEXT
|
1999-12-07 18:52:53 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LTDL_SHLIBPATH
|
|
|
|
# -----------------
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_SHLIBPATH],
|
|
|
|
[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
|
1999-12-07 18:52:53 +08:00
|
|
|
AC_CACHE_CHECK([which variable specifies run-time library path],
|
2001-08-01 14:50:16 +08:00
|
|
|
[libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"])
|
1999-12-07 18:52:53 +08:00
|
|
|
if test -n "$libltdl_cv_shlibpath_var"; then
|
|
|
|
AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define to the name of the environment variable that determines the dynamic library search path.])
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LTDL_SHLIBPATH
|
1999-12-07 18:52:53 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LTDL_SYSSEARCHPATH
|
|
|
|
# ---------------------
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_SYSSEARCHPATH],
|
|
|
|
[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
|
2000-01-20 04:34:37 +08:00
|
|
|
AC_CACHE_CHECK([for the default library search path],
|
2001-08-01 14:50:16 +08:00
|
|
|
[libltdl_cv_sys_search_path],
|
|
|
|
[libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
|
2000-01-20 04:34:37 +08:00
|
|
|
if test -n "$libltdl_cv_sys_search_path"; then
|
|
|
|
sys_search_path=
|
|
|
|
for dir in $libltdl_cv_sys_search_path; do
|
|
|
|
if test -z "$sys_search_path"; then
|
|
|
|
sys_search_path="$dir"
|
|
|
|
else
|
2002-10-23 03:29:28 +08:00
|
|
|
sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
|
2000-01-20 04:34:37 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define to the system default library search path.])
|
2000-01-20 04:34:37 +08:00
|
|
|
fi
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LTDL_SYSSEARCHPATH
|
2000-01-20 04:34:37 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LTDL_OBJDIR
|
|
|
|
# --------------
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_OBJDIR],
|
1999-12-07 18:52:53 +08:00
|
|
|
[AC_CACHE_CHECK([for objdir],
|
2001-08-01 14:50:16 +08:00
|
|
|
[libltdl_cv_objdir],
|
|
|
|
[libltdl_cv_objdir="$objdir"
|
|
|
|
if test -n "$objdir"; then
|
|
|
|
:
|
1999-12-07 18:52:53 +08:00
|
|
|
else
|
2001-08-01 14:50:16 +08:00
|
|
|
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
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
2001-08-01 14:50:16 +08:00
|
|
|
])
|
1999-12-07 18:52:53 +08:00
|
|
|
AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define to the sub-directory in which libtool stores uninstalled libraries.])
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LTDL_OBJDIR
|
1999-12-07 18:52:53 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LTDL_DLPREOPEN
|
|
|
|
# -----------------
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_DLPREOPEN],
|
2001-08-01 14:50:16 +08:00
|
|
|
[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
|
1999-12-07 18:52:53 +08:00
|
|
|
AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
|
2001-08-01 14:50:16 +08:00
|
|
|
[libltdl_cv_preloaded_symbols],
|
2002-05-18 00:07:25 +08:00
|
|
|
[if test -n "$lt_cv_sys_global_symbol_pipe"; then
|
1999-12-07 18:52:53 +08:00
|
|
|
libltdl_cv_preloaded_symbols=yes
|
|
|
|
else
|
|
|
|
libltdl_cv_preloaded_symbols=no
|
|
|
|
fi
|
2001-08-01 14:50:16 +08:00
|
|
|
])
|
|
|
|
if test x"$libltdl_cv_preloaded_symbols" = xyes; then
|
1999-12-07 18:52:53 +08:00
|
|
|
AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define if libtool can extract symbol lists from object files.])
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LTDL_DLPREOPEN
|
1999-12-07 18:52:53 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LTDL_DLLIB
|
|
|
|
# -------------
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_DLLIB],
|
This pervasive changeset makes two intertwined deep changes to the
operation of libtool (neither would work alone). First, there is
a new feature that allows libraries to preopen modules. This
entails a backwards incompatible change to the libltdl API for
separating out the preloaded symbol lists by owner. Second, in
the tradition of "eating our own dogfood", libltdl now preloads
its own dlloaders. The internal API for dlloaders has also had to
change in a backwards incompatible way in support of the new
library preloading feature. If you don't use preloaded libraries,
you needn't change your project sources, though you will need to
recompile against the new libltdl. The API changes are mostly
confined to dlloaders, so you probably needn't worry about those
(unless you have written a custom loader that you want libltdl to
use):
* configure.ac (AC_CONFIG_FILES): Add libltdl/loaders/Makefile.
* libltdl/configure.ac (AC_CONFIG_FILES): Add loaders/Makefile.
* libltdl/loaders: New directory for module loaders, to simplify
Makefile rules, and to give the loaders themselves names that are
unique in the first few characters.
* libtoolize.in (func_copy_all_files): Copy recursively to pick up
the loaders directory contents.
* libltdl/loaders/Makefile.am: New file. Move module building
rules to here...
* libltdl/Makefile.am: ...from here.
(VERSION_INFO): Bumped version info to signify interface changes.
(libltdl_la_CPPFLAGS, libltdlc_la_CPPFLAGS): Set LTDLOPEN
appropriately for each library.
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: Moved from here...
* libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c: ...to here.
(get_vtable): New entry function for each.
* libltdl/loaders/preopen.c (lt_dlsymlists_t): Replaced by...
(symlist_chain): ...a new structure which maps lists of preloaded
symbols from the object that loads them.
(lt_dlpreload_open): New function to automatically open all
preloaded modules belonging to a named object (ORIGINATOR).
* libltdl/lt__alloc.c (lt__zalloc): New function to return a block
of zeroed out new memory.
* libltdl/lt__alloc.h (lt__zalloc): Prototype it.
* libltdl/lt__private.h (lt__alloc_die_callback): Add missing
prototype.
(lt__error_strings): Make this opaque to callers.
* libltdl/lt_error.c (lt__error_strings): Move the implementation
to here.
* libltdl/lt_dlloader.h (lt_user_dlloader): Add extra fields to
make originator focused preloading possible. *BREAKS BACKWARDS
COMPATIBILITY*
(lt_dlloader_add): Take advantage of new fields to simplify
paramater list.
* libltdl/lt_system.h (LT_STR): New ANSI stringification macro.
(LT_CONC): Fix it to work from within macros.
* libltdl/ltdl.c (loader_init, loader_init_callback): Simplify
dlloader loading.
(get_vtable, preloaded_symbols): Point these at the preopen.c
symbols to bootstrap the loader chain.
(lt_dlinit): Load the preopen dlloader manually, and then use it
to load any other preloaded dlloaders.
(lt_dlloader_add): Simplify parameter list. Populate new
fields. Chain new loaders according to priority field.
* libltdl/ltdl.h (lt_dlsymlist): Add a new originator field.
(lt_dlpreload_callback_func): Type of a callback for automatic
lt_dlpreload_open loading.
(LTDL_SET_PRELOADED_SYMBOLS): Adjust to hook into preloaded
symbols from the "@PROGRAM@" originator.
* tests/demo/dlmain.c (main): Use mangled preloaded_symbols symbol.
* tests/pdemo/longer_file_name_dlmain.c (main): Ditto.
* ltmain.in: Don't spew spurious warnings when dlopening and
dlpreopening modules.
(func_generate_dlsyms): Factored out from multiple copies in the
rest of the code. Generate originator keyed symbol lists.
(func_extract_archives): Also factored. Extract the contents of
convenience archives for linking with dependent libraries when
--whole-archive is not available.
[darwin]: Don't try to link $old_library unless it exists, and
$lib is a bundle.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Check for all possible dynamic
loading libraries/apis rather that stopping when an acceptable one
is discovered.
(LT_DLLOADERS): New variable for holding dlloaders that can be
preloaded.
* doc/libtool.texi: Document interface changes.
* NEWS: Updated.
2004-07-15 20:14:48 +08:00
|
|
|
[m4_pattern_allow([^LT_DLLOADERS$])
|
|
|
|
LT_DLLOADERS=
|
|
|
|
AC_SUBST([LT_DLLOADERS])
|
|
|
|
|
2001-06-30 08:40:38 +08:00
|
|
|
AC_LANG_PUSH([C])
|
2001-09-23 00:43:43 +08:00
|
|
|
|
This pervasive changeset makes two intertwined deep changes to the
operation of libtool (neither would work alone). First, there is
a new feature that allows libraries to preopen modules. This
entails a backwards incompatible change to the libltdl API for
separating out the preloaded symbol lists by owner. Second, in
the tradition of "eating our own dogfood", libltdl now preloads
its own dlloaders. The internal API for dlloaders has also had to
change in a backwards incompatible way in support of the new
library preloading feature. If you don't use preloaded libraries,
you needn't change your project sources, though you will need to
recompile against the new libltdl. The API changes are mostly
confined to dlloaders, so you probably needn't worry about those
(unless you have written a custom loader that you want libltdl to
use):
* configure.ac (AC_CONFIG_FILES): Add libltdl/loaders/Makefile.
* libltdl/configure.ac (AC_CONFIG_FILES): Add loaders/Makefile.
* libltdl/loaders: New directory for module loaders, to simplify
Makefile rules, and to give the loaders themselves names that are
unique in the first few characters.
* libtoolize.in (func_copy_all_files): Copy recursively to pick up
the loaders directory contents.
* libltdl/loaders/Makefile.am: New file. Move module building
rules to here...
* libltdl/Makefile.am: ...from here.
(VERSION_INFO): Bumped version info to signify interface changes.
(libltdl_la_CPPFLAGS, libltdlc_la_CPPFLAGS): Set LTDLOPEN
appropriately for each library.
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: Moved from here...
* libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c: ...to here.
(get_vtable): New entry function for each.
* libltdl/loaders/preopen.c (lt_dlsymlists_t): Replaced by...
(symlist_chain): ...a new structure which maps lists of preloaded
symbols from the object that loads them.
(lt_dlpreload_open): New function to automatically open all
preloaded modules belonging to a named object (ORIGINATOR).
* libltdl/lt__alloc.c (lt__zalloc): New function to return a block
of zeroed out new memory.
* libltdl/lt__alloc.h (lt__zalloc): Prototype it.
* libltdl/lt__private.h (lt__alloc_die_callback): Add missing
prototype.
(lt__error_strings): Make this opaque to callers.
* libltdl/lt_error.c (lt__error_strings): Move the implementation
to here.
* libltdl/lt_dlloader.h (lt_user_dlloader): Add extra fields to
make originator focused preloading possible. *BREAKS BACKWARDS
COMPATIBILITY*
(lt_dlloader_add): Take advantage of new fields to simplify
paramater list.
* libltdl/lt_system.h (LT_STR): New ANSI stringification macro.
(LT_CONC): Fix it to work from within macros.
* libltdl/ltdl.c (loader_init, loader_init_callback): Simplify
dlloader loading.
(get_vtable, preloaded_symbols): Point these at the preopen.c
symbols to bootstrap the loader chain.
(lt_dlinit): Load the preopen dlloader manually, and then use it
to load any other preloaded dlloaders.
(lt_dlloader_add): Simplify parameter list. Populate new
fields. Chain new loaders according to priority field.
* libltdl/ltdl.h (lt_dlsymlist): Add a new originator field.
(lt_dlpreload_callback_func): Type of a callback for automatic
lt_dlpreload_open loading.
(LTDL_SET_PRELOADED_SYMBOLS): Adjust to hook into preloaded
symbols from the "@PROGRAM@" originator.
* tests/demo/dlmain.c (main): Use mangled preloaded_symbols symbol.
* tests/pdemo/longer_file_name_dlmain.c (main): Ditto.
* ltmain.in: Don't spew spurious warnings when dlopening and
dlpreopening modules.
(func_generate_dlsyms): Factored out from multiple copies in the
rest of the code. Generate originator keyed symbol lists.
(func_extract_archives): Also factored. Extract the contents of
convenience archives for linking with dependent libraries when
--whole-archive is not available.
[darwin]: Don't try to link $old_library unless it exists, and
$lib is a bundle.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Check for all possible dynamic
loading libraries/apis rather that stopping when an acceptable one
is discovered.
(LT_DLLOADERS): New variable for holding dlloaders that can be
preloaded.
* doc/libtool.texi: Document interface changes.
* NEWS: Updated.
2004-07-15 20:14:48 +08:00
|
|
|
LIBADD_DLOPEN=
|
|
|
|
AC_CHECK_LIB([dl], [dlopen],
|
|
|
|
[AC_DEFINE([HAVE_LIBDL], [1],
|
|
|
|
[Define if you have the libdl library or equivalent.])
|
|
|
|
LIBADD_DLOPEN="-ldl" libltdl_cv_lib_dl_dlopen="yes"
|
|
|
|
LT_DLLOADERS="$LT_DLLOADERS dlopen.la"],
|
|
|
|
[AC_TRY_LINK([#if HAVE_DLFCN_H
|
2001-06-30 08:40:38 +08:00
|
|
|
# include <dlfcn.h>
|
|
|
|
#endif
|
This pervasive changeset makes two intertwined deep changes to the
operation of libtool (neither would work alone). First, there is
a new feature that allows libraries to preopen modules. This
entails a backwards incompatible change to the libltdl API for
separating out the preloaded symbol lists by owner. Second, in
the tradition of "eating our own dogfood", libltdl now preloads
its own dlloaders. The internal API for dlloaders has also had to
change in a backwards incompatible way in support of the new
library preloading feature. If you don't use preloaded libraries,
you needn't change your project sources, though you will need to
recompile against the new libltdl. The API changes are mostly
confined to dlloaders, so you probably needn't worry about those
(unless you have written a custom loader that you want libltdl to
use):
* configure.ac (AC_CONFIG_FILES): Add libltdl/loaders/Makefile.
* libltdl/configure.ac (AC_CONFIG_FILES): Add loaders/Makefile.
* libltdl/loaders: New directory for module loaders, to simplify
Makefile rules, and to give the loaders themselves names that are
unique in the first few characters.
* libtoolize.in (func_copy_all_files): Copy recursively to pick up
the loaders directory contents.
* libltdl/loaders/Makefile.am: New file. Move module building
rules to here...
* libltdl/Makefile.am: ...from here.
(VERSION_INFO): Bumped version info to signify interface changes.
(libltdl_la_CPPFLAGS, libltdlc_la_CPPFLAGS): Set LTDLOPEN
appropriately for each library.
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: Moved from here...
* libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c: ...to here.
(get_vtable): New entry function for each.
* libltdl/loaders/preopen.c (lt_dlsymlists_t): Replaced by...
(symlist_chain): ...a new structure which maps lists of preloaded
symbols from the object that loads them.
(lt_dlpreload_open): New function to automatically open all
preloaded modules belonging to a named object (ORIGINATOR).
* libltdl/lt__alloc.c (lt__zalloc): New function to return a block
of zeroed out new memory.
* libltdl/lt__alloc.h (lt__zalloc): Prototype it.
* libltdl/lt__private.h (lt__alloc_die_callback): Add missing
prototype.
(lt__error_strings): Make this opaque to callers.
* libltdl/lt_error.c (lt__error_strings): Move the implementation
to here.
* libltdl/lt_dlloader.h (lt_user_dlloader): Add extra fields to
make originator focused preloading possible. *BREAKS BACKWARDS
COMPATIBILITY*
(lt_dlloader_add): Take advantage of new fields to simplify
paramater list.
* libltdl/lt_system.h (LT_STR): New ANSI stringification macro.
(LT_CONC): Fix it to work from within macros.
* libltdl/ltdl.c (loader_init, loader_init_callback): Simplify
dlloader loading.
(get_vtable, preloaded_symbols): Point these at the preopen.c
symbols to bootstrap the loader chain.
(lt_dlinit): Load the preopen dlloader manually, and then use it
to load any other preloaded dlloaders.
(lt_dlloader_add): Simplify parameter list. Populate new
fields. Chain new loaders according to priority field.
* libltdl/ltdl.h (lt_dlsymlist): Add a new originator field.
(lt_dlpreload_callback_func): Type of a callback for automatic
lt_dlpreload_open loading.
(LTDL_SET_PRELOADED_SYMBOLS): Adjust to hook into preloaded
symbols from the "@PROGRAM@" originator.
* tests/demo/dlmain.c (main): Use mangled preloaded_symbols symbol.
* tests/pdemo/longer_file_name_dlmain.c (main): Ditto.
* ltmain.in: Don't spew spurious warnings when dlopening and
dlpreopening modules.
(func_generate_dlsyms): Factored out from multiple copies in the
rest of the code. Generate originator keyed symbol lists.
(func_extract_archives): Also factored. Extract the contents of
convenience archives for linking with dependent libraries when
--whole-archive is not available.
[darwin]: Don't try to link $old_library unless it exists, and
$lib is a bundle.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Check for all possible dynamic
loading libraries/apis rather that stopping when an acceptable one
is discovered.
(LT_DLLOADERS): New variable for holding dlloaders that can be
preloaded.
* doc/libtool.texi: Document interface changes.
* NEWS: Updated.
2004-07-15 20:14:48 +08:00
|
|
|
], [dlopen(0, 0);],
|
2001-09-23 00:43:43 +08:00
|
|
|
[AC_DEFINE([HAVE_LIBDL], [1],
|
Factor out the individual loaders, in preparation for preloading
them as libtool modules. Currently loader-preopen.c is linked
unconditionally and other appropriate loaders discovered by
AC_LTDL_DLLIB are built and linked in:
* libltdl/Makefile.am (libltdl_la_SOURCES): Add loader-preopen
module.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Use AC_LIBOBJ to add appropriate
loaders to libltdl.
* libltdl/lt_system.h (LT_SCOPE): Moved to here.
* libltdl/ltdl.h (lt_dlloader, lt_user_data, lt_module)
(lt_module_open, lt_module_close, lt_find_sym, lt_dlloader_exit)
(struct lt_user_dlloader, lt_dlloader_next, lt_dlloader_find)
(lt_dlloader_name, lt_dlloader_data, lt_dlloader_add)
(lt_dlloader_remove): Moved declarations...
* libltdl/lt_loader.h: ...to here.
* libltdl/ltdl.c: Include lt_loader.h. Move loader implementation
code from here...
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c, libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: ...to here.
* tests/cdemo/Makefile.am, tests/demo/Makefile.am,
tests/depdemo/Makefile.am, tests/f77demo/Makefile.am,
tests/mdemo/Makefile.am, tests/mdemo2/Makefile.am,
tests/pdemo/Makefile.am, tests/tagdemo/Makefile.am (AM_CPPFLAGS):
Add -I$(top_srcdir)/../.. so that libltdl include files can be
written as #include <libltdl/lt_dlloader.h> and found correctly.
2004-04-13 22:31:05 +08:00
|
|
|
[Define if you have the libdl library or equivalent.])
|
|
|
|
libltdl_cv_func_dlopen="yes"
|
This pervasive changeset makes two intertwined deep changes to the
operation of libtool (neither would work alone). First, there is
a new feature that allows libraries to preopen modules. This
entails a backwards incompatible change to the libltdl API for
separating out the preloaded symbol lists by owner. Second, in
the tradition of "eating our own dogfood", libltdl now preloads
its own dlloaders. The internal API for dlloaders has also had to
change in a backwards incompatible way in support of the new
library preloading feature. If you don't use preloaded libraries,
you needn't change your project sources, though you will need to
recompile against the new libltdl. The API changes are mostly
confined to dlloaders, so you probably needn't worry about those
(unless you have written a custom loader that you want libltdl to
use):
* configure.ac (AC_CONFIG_FILES): Add libltdl/loaders/Makefile.
* libltdl/configure.ac (AC_CONFIG_FILES): Add loaders/Makefile.
* libltdl/loaders: New directory for module loaders, to simplify
Makefile rules, and to give the loaders themselves names that are
unique in the first few characters.
* libtoolize.in (func_copy_all_files): Copy recursively to pick up
the loaders directory contents.
* libltdl/loaders/Makefile.am: New file. Move module building
rules to here...
* libltdl/Makefile.am: ...from here.
(VERSION_INFO): Bumped version info to signify interface changes.
(libltdl_la_CPPFLAGS, libltdlc_la_CPPFLAGS): Set LTDLOPEN
appropriately for each library.
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: Moved from here...
* libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c: ...to here.
(get_vtable): New entry function for each.
* libltdl/loaders/preopen.c (lt_dlsymlists_t): Replaced by...
(symlist_chain): ...a new structure which maps lists of preloaded
symbols from the object that loads them.
(lt_dlpreload_open): New function to automatically open all
preloaded modules belonging to a named object (ORIGINATOR).
* libltdl/lt__alloc.c (lt__zalloc): New function to return a block
of zeroed out new memory.
* libltdl/lt__alloc.h (lt__zalloc): Prototype it.
* libltdl/lt__private.h (lt__alloc_die_callback): Add missing
prototype.
(lt__error_strings): Make this opaque to callers.
* libltdl/lt_error.c (lt__error_strings): Move the implementation
to here.
* libltdl/lt_dlloader.h (lt_user_dlloader): Add extra fields to
make originator focused preloading possible. *BREAKS BACKWARDS
COMPATIBILITY*
(lt_dlloader_add): Take advantage of new fields to simplify
paramater list.
* libltdl/lt_system.h (LT_STR): New ANSI stringification macro.
(LT_CONC): Fix it to work from within macros.
* libltdl/ltdl.c (loader_init, loader_init_callback): Simplify
dlloader loading.
(get_vtable, preloaded_symbols): Point these at the preopen.c
symbols to bootstrap the loader chain.
(lt_dlinit): Load the preopen dlloader manually, and then use it
to load any other preloaded dlloaders.
(lt_dlloader_add): Simplify parameter list. Populate new
fields. Chain new loaders according to priority field.
* libltdl/ltdl.h (lt_dlsymlist): Add a new originator field.
(lt_dlpreload_callback_func): Type of a callback for automatic
lt_dlpreload_open loading.
(LTDL_SET_PRELOADED_SYMBOLS): Adjust to hook into preloaded
symbols from the "@PROGRAM@" originator.
* tests/demo/dlmain.c (main): Use mangled preloaded_symbols symbol.
* tests/pdemo/longer_file_name_dlmain.c (main): Ditto.
* ltmain.in: Don't spew spurious warnings when dlopening and
dlpreopening modules.
(func_generate_dlsyms): Factored out from multiple copies in the
rest of the code. Generate originator keyed symbol lists.
(func_extract_archives): Also factored. Extract the contents of
convenience archives for linking with dependent libraries when
--whole-archive is not available.
[darwin]: Don't try to link $old_library unless it exists, and
$lib is a bundle.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Check for all possible dynamic
loading libraries/apis rather that stopping when an acceptable one
is discovered.
(LT_DLLOADERS): New variable for holding dlloaders that can be
preloaded.
* doc/libtool.texi: Document interface changes.
* NEWS: Updated.
2004-07-15 20:14:48 +08:00
|
|
|
LT_DLLOADERS="$LT_DLLOADERS dlopen.la"],
|
|
|
|
[AC_CHECK_LIB([svld], [dlopen],
|
|
|
|
[AC_DEFINE([HAVE_LIBDL], [1],
|
2001-09-23 00:43:43 +08:00
|
|
|
[Define if you have the libdl library or equivalent.])
|
This pervasive changeset makes two intertwined deep changes to the
operation of libtool (neither would work alone). First, there is
a new feature that allows libraries to preopen modules. This
entails a backwards incompatible change to the libltdl API for
separating out the preloaded symbol lists by owner. Second, in
the tradition of "eating our own dogfood", libltdl now preloads
its own dlloaders. The internal API for dlloaders has also had to
change in a backwards incompatible way in support of the new
library preloading feature. If you don't use preloaded libraries,
you needn't change your project sources, though you will need to
recompile against the new libltdl. The API changes are mostly
confined to dlloaders, so you probably needn't worry about those
(unless you have written a custom loader that you want libltdl to
use):
* configure.ac (AC_CONFIG_FILES): Add libltdl/loaders/Makefile.
* libltdl/configure.ac (AC_CONFIG_FILES): Add loaders/Makefile.
* libltdl/loaders: New directory for module loaders, to simplify
Makefile rules, and to give the loaders themselves names that are
unique in the first few characters.
* libtoolize.in (func_copy_all_files): Copy recursively to pick up
the loaders directory contents.
* libltdl/loaders/Makefile.am: New file. Move module building
rules to here...
* libltdl/Makefile.am: ...from here.
(VERSION_INFO): Bumped version info to signify interface changes.
(libltdl_la_CPPFLAGS, libltdlc_la_CPPFLAGS): Set LTDLOPEN
appropriately for each library.
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: Moved from here...
* libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c: ...to here.
(get_vtable): New entry function for each.
* libltdl/loaders/preopen.c (lt_dlsymlists_t): Replaced by...
(symlist_chain): ...a new structure which maps lists of preloaded
symbols from the object that loads them.
(lt_dlpreload_open): New function to automatically open all
preloaded modules belonging to a named object (ORIGINATOR).
* libltdl/lt__alloc.c (lt__zalloc): New function to return a block
of zeroed out new memory.
* libltdl/lt__alloc.h (lt__zalloc): Prototype it.
* libltdl/lt__private.h (lt__alloc_die_callback): Add missing
prototype.
(lt__error_strings): Make this opaque to callers.
* libltdl/lt_error.c (lt__error_strings): Move the implementation
to here.
* libltdl/lt_dlloader.h (lt_user_dlloader): Add extra fields to
make originator focused preloading possible. *BREAKS BACKWARDS
COMPATIBILITY*
(lt_dlloader_add): Take advantage of new fields to simplify
paramater list.
* libltdl/lt_system.h (LT_STR): New ANSI stringification macro.
(LT_CONC): Fix it to work from within macros.
* libltdl/ltdl.c (loader_init, loader_init_callback): Simplify
dlloader loading.
(get_vtable, preloaded_symbols): Point these at the preopen.c
symbols to bootstrap the loader chain.
(lt_dlinit): Load the preopen dlloader manually, and then use it
to load any other preloaded dlloaders.
(lt_dlloader_add): Simplify parameter list. Populate new
fields. Chain new loaders according to priority field.
* libltdl/ltdl.h (lt_dlsymlist): Add a new originator field.
(lt_dlpreload_callback_func): Type of a callback for automatic
lt_dlpreload_open loading.
(LTDL_SET_PRELOADED_SYMBOLS): Adjust to hook into preloaded
symbols from the "@PROGRAM@" originator.
* tests/demo/dlmain.c (main): Use mangled preloaded_symbols symbol.
* tests/pdemo/longer_file_name_dlmain.c (main): Ditto.
* ltmain.in: Don't spew spurious warnings when dlopening and
dlpreopening modules.
(func_generate_dlsyms): Factored out from multiple copies in the
rest of the code. Generate originator keyed symbol lists.
(func_extract_archives): Also factored. Extract the contents of
convenience archives for linking with dependent libraries when
--whole-archive is not available.
[darwin]: Don't try to link $old_library unless it exists, and
$lib is a bundle.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Check for all possible dynamic
loading libraries/apis rather that stopping when an acceptable one
is discovered.
(LT_DLLOADERS): New variable for holding dlloaders that can be
preloaded.
* doc/libtool.texi: Document interface changes.
* NEWS: Updated.
2004-07-15 20:14:48 +08:00
|
|
|
LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
|
|
|
|
LT_DLLOADERS="$LT_DLLOADERS dlopen.la"])])])
|
|
|
|
if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
|
|
|
|
then
|
|
|
|
lt_save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS $LIBADD_DLOPEN"
|
|
|
|
AC_CHECK_FUNCS([dlerror])
|
|
|
|
LIBS="$lt_save_LIBS"
|
|
|
|
fi
|
|
|
|
AC_SUBST([LIBADD_DLOPEN])
|
|
|
|
|
|
|
|
LIBADD_SHL_LOAD=
|
|
|
|
AC_CHECK_FUNC([shl_load],
|
|
|
|
[AC_DEFINE([HAVE_SHL_LOAD], [1],
|
|
|
|
[Define if you have the shl_load function.])
|
|
|
|
LT_DLLOADERS="$LT_DLLOADERS shl_load.la"],
|
|
|
|
[AC_CHECK_LIB([dld], [shl_load],
|
|
|
|
[AC_DEFINE([HAVE_SHL_LOAD], [1],
|
|
|
|
[Define if you have the shl_load function.])
|
|
|
|
LT_DLLOADERS="$LT_DLLOADERS shl_load.la"
|
|
|
|
LIBADD_SHL_LOAD="-ldld"])])
|
|
|
|
AC_SUBST([LIBADD_SHL_LOAD])
|
|
|
|
|
|
|
|
AC_CHECK_FUNC([_dyld_func_lookup],
|
|
|
|
[AC_DEFINE([HAVE_DYLD], [1],
|
|
|
|
[Define if you have the _dyld_func_lookup function.])
|
|
|
|
LT_DLLOADERS="$LT_DLLOADERS dyld.la"])
|
Factor out the individual loaders, in preparation for preloading
them as libtool modules. Currently loader-preopen.c is linked
unconditionally and other appropriate loaders discovered by
AC_LTDL_DLLIB are built and linked in:
* libltdl/Makefile.am (libltdl_la_SOURCES): Add loader-preopen
module.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Use AC_LIBOBJ to add appropriate
loaders to libltdl.
* libltdl/lt_system.h (LT_SCOPE): Moved to here.
* libltdl/ltdl.h (lt_dlloader, lt_user_data, lt_module)
(lt_module_open, lt_module_close, lt_find_sym, lt_dlloader_exit)
(struct lt_user_dlloader, lt_dlloader_next, lt_dlloader_find)
(lt_dlloader_name, lt_dlloader_data, lt_dlloader_add)
(lt_dlloader_remove): Moved declarations...
* libltdl/lt_loader.h: ...to here.
* libltdl/ltdl.c: Include lt_loader.h. Move loader implementation
code from here...
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c, libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: ...to here.
* tests/cdemo/Makefile.am, tests/demo/Makefile.am,
tests/depdemo/Makefile.am, tests/f77demo/Makefile.am,
tests/mdemo/Makefile.am, tests/mdemo2/Makefile.am,
tests/pdemo/Makefile.am, tests/tagdemo/Makefile.am (AM_CPPFLAGS):
Add -I$(top_srcdir)/../.. so that libltdl include files can be
written as #include <libltdl/lt_dlloader.h> and found correctly.
2004-04-13 22:31:05 +08:00
|
|
|
|
|
|
|
case $host_os in
|
|
|
|
beos*)
|
This pervasive changeset makes two intertwined deep changes to the
operation of libtool (neither would work alone). First, there is
a new feature that allows libraries to preopen modules. This
entails a backwards incompatible change to the libltdl API for
separating out the preloaded symbol lists by owner. Second, in
the tradition of "eating our own dogfood", libltdl now preloads
its own dlloaders. The internal API for dlloaders has also had to
change in a backwards incompatible way in support of the new
library preloading feature. If you don't use preloaded libraries,
you needn't change your project sources, though you will need to
recompile against the new libltdl. The API changes are mostly
confined to dlloaders, so you probably needn't worry about those
(unless you have written a custom loader that you want libltdl to
use):
* configure.ac (AC_CONFIG_FILES): Add libltdl/loaders/Makefile.
* libltdl/configure.ac (AC_CONFIG_FILES): Add loaders/Makefile.
* libltdl/loaders: New directory for module loaders, to simplify
Makefile rules, and to give the loaders themselves names that are
unique in the first few characters.
* libtoolize.in (func_copy_all_files): Copy recursively to pick up
the loaders directory contents.
* libltdl/loaders/Makefile.am: New file. Move module building
rules to here...
* libltdl/Makefile.am: ...from here.
(VERSION_INFO): Bumped version info to signify interface changes.
(libltdl_la_CPPFLAGS, libltdlc_la_CPPFLAGS): Set LTDLOPEN
appropriately for each library.
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: Moved from here...
* libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c: ...to here.
(get_vtable): New entry function for each.
* libltdl/loaders/preopen.c (lt_dlsymlists_t): Replaced by...
(symlist_chain): ...a new structure which maps lists of preloaded
symbols from the object that loads them.
(lt_dlpreload_open): New function to automatically open all
preloaded modules belonging to a named object (ORIGINATOR).
* libltdl/lt__alloc.c (lt__zalloc): New function to return a block
of zeroed out new memory.
* libltdl/lt__alloc.h (lt__zalloc): Prototype it.
* libltdl/lt__private.h (lt__alloc_die_callback): Add missing
prototype.
(lt__error_strings): Make this opaque to callers.
* libltdl/lt_error.c (lt__error_strings): Move the implementation
to here.
* libltdl/lt_dlloader.h (lt_user_dlloader): Add extra fields to
make originator focused preloading possible. *BREAKS BACKWARDS
COMPATIBILITY*
(lt_dlloader_add): Take advantage of new fields to simplify
paramater list.
* libltdl/lt_system.h (LT_STR): New ANSI stringification macro.
(LT_CONC): Fix it to work from within macros.
* libltdl/ltdl.c (loader_init, loader_init_callback): Simplify
dlloader loading.
(get_vtable, preloaded_symbols): Point these at the preopen.c
symbols to bootstrap the loader chain.
(lt_dlinit): Load the preopen dlloader manually, and then use it
to load any other preloaded dlloaders.
(lt_dlloader_add): Simplify parameter list. Populate new
fields. Chain new loaders according to priority field.
* libltdl/ltdl.h (lt_dlsymlist): Add a new originator field.
(lt_dlpreload_callback_func): Type of a callback for automatic
lt_dlpreload_open loading.
(LTDL_SET_PRELOADED_SYMBOLS): Adjust to hook into preloaded
symbols from the "@PROGRAM@" originator.
* tests/demo/dlmain.c (main): Use mangled preloaded_symbols symbol.
* tests/pdemo/longer_file_name_dlmain.c (main): Ditto.
* ltmain.in: Don't spew spurious warnings when dlopening and
dlpreopening modules.
(func_generate_dlsyms): Factored out from multiple copies in the
rest of the code. Generate originator keyed symbol lists.
(func_extract_archives): Also factored. Extract the contents of
convenience archives for linking with dependent libraries when
--whole-archive is not available.
[darwin]: Don't try to link $old_library unless it exists, and
$lib is a bundle.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Check for all possible dynamic
loading libraries/apis rather that stopping when an acceptable one
is discovered.
(LT_DLLOADERS): New variable for holding dlloaders that can be
preloaded.
* doc/libtool.texi: Document interface changes.
* NEWS: Updated.
2004-07-15 20:14:48 +08:00
|
|
|
LT_DLLOADERS="$LT_DLLOADERS load_add_on.la"
|
Factor out the individual loaders, in preparation for preloading
them as libtool modules. Currently loader-preopen.c is linked
unconditionally and other appropriate loaders discovered by
AC_LTDL_DLLIB are built and linked in:
* libltdl/Makefile.am (libltdl_la_SOURCES): Add loader-preopen
module.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Use AC_LIBOBJ to add appropriate
loaders to libltdl.
* libltdl/lt_system.h (LT_SCOPE): Moved to here.
* libltdl/ltdl.h (lt_dlloader, lt_user_data, lt_module)
(lt_module_open, lt_module_close, lt_find_sym, lt_dlloader_exit)
(struct lt_user_dlloader, lt_dlloader_next, lt_dlloader_find)
(lt_dlloader_name, lt_dlloader_data, lt_dlloader_add)
(lt_dlloader_remove): Moved declarations...
* libltdl/lt_loader.h: ...to here.
* libltdl/ltdl.c: Include lt_loader.h. Move loader implementation
code from here...
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c, libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: ...to here.
* tests/cdemo/Makefile.am, tests/demo/Makefile.am,
tests/depdemo/Makefile.am, tests/f77demo/Makefile.am,
tests/mdemo/Makefile.am, tests/mdemo2/Makefile.am,
tests/pdemo/Makefile.am, tests/tagdemo/Makefile.am (AM_CPPFLAGS):
Add -I$(top_srcdir)/../.. so that libltdl include files can be
written as #include <libltdl/lt_dlloader.h> and found correctly.
2004-04-13 22:31:05 +08:00
|
|
|
;;
|
|
|
|
cygwin* | mingw* | os2* | pw32*)
|
This pervasive changeset makes two intertwined deep changes to the
operation of libtool (neither would work alone). First, there is
a new feature that allows libraries to preopen modules. This
entails a backwards incompatible change to the libltdl API for
separating out the preloaded symbol lists by owner. Second, in
the tradition of "eating our own dogfood", libltdl now preloads
its own dlloaders. The internal API for dlloaders has also had to
change in a backwards incompatible way in support of the new
library preloading feature. If you don't use preloaded libraries,
you needn't change your project sources, though you will need to
recompile against the new libltdl. The API changes are mostly
confined to dlloaders, so you probably needn't worry about those
(unless you have written a custom loader that you want libltdl to
use):
* configure.ac (AC_CONFIG_FILES): Add libltdl/loaders/Makefile.
* libltdl/configure.ac (AC_CONFIG_FILES): Add loaders/Makefile.
* libltdl/loaders: New directory for module loaders, to simplify
Makefile rules, and to give the loaders themselves names that are
unique in the first few characters.
* libtoolize.in (func_copy_all_files): Copy recursively to pick up
the loaders directory contents.
* libltdl/loaders/Makefile.am: New file. Move module building
rules to here...
* libltdl/Makefile.am: ...from here.
(VERSION_INFO): Bumped version info to signify interface changes.
(libltdl_la_CPPFLAGS, libltdlc_la_CPPFLAGS): Set LTDLOPEN
appropriately for each library.
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: Moved from here...
* libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c: ...to here.
(get_vtable): New entry function for each.
* libltdl/loaders/preopen.c (lt_dlsymlists_t): Replaced by...
(symlist_chain): ...a new structure which maps lists of preloaded
symbols from the object that loads them.
(lt_dlpreload_open): New function to automatically open all
preloaded modules belonging to a named object (ORIGINATOR).
* libltdl/lt__alloc.c (lt__zalloc): New function to return a block
of zeroed out new memory.
* libltdl/lt__alloc.h (lt__zalloc): Prototype it.
* libltdl/lt__private.h (lt__alloc_die_callback): Add missing
prototype.
(lt__error_strings): Make this opaque to callers.
* libltdl/lt_error.c (lt__error_strings): Move the implementation
to here.
* libltdl/lt_dlloader.h (lt_user_dlloader): Add extra fields to
make originator focused preloading possible. *BREAKS BACKWARDS
COMPATIBILITY*
(lt_dlloader_add): Take advantage of new fields to simplify
paramater list.
* libltdl/lt_system.h (LT_STR): New ANSI stringification macro.
(LT_CONC): Fix it to work from within macros.
* libltdl/ltdl.c (loader_init, loader_init_callback): Simplify
dlloader loading.
(get_vtable, preloaded_symbols): Point these at the preopen.c
symbols to bootstrap the loader chain.
(lt_dlinit): Load the preopen dlloader manually, and then use it
to load any other preloaded dlloaders.
(lt_dlloader_add): Simplify parameter list. Populate new
fields. Chain new loaders according to priority field.
* libltdl/ltdl.h (lt_dlsymlist): Add a new originator field.
(lt_dlpreload_callback_func): Type of a callback for automatic
lt_dlpreload_open loading.
(LTDL_SET_PRELOADED_SYMBOLS): Adjust to hook into preloaded
symbols from the "@PROGRAM@" originator.
* tests/demo/dlmain.c (main): Use mangled preloaded_symbols symbol.
* tests/pdemo/longer_file_name_dlmain.c (main): Ditto.
* ltmain.in: Don't spew spurious warnings when dlopening and
dlpreopening modules.
(func_generate_dlsyms): Factored out from multiple copies in the
rest of the code. Generate originator keyed symbol lists.
(func_extract_archives): Also factored. Extract the contents of
convenience archives for linking with dependent libraries when
--whole-archive is not available.
[darwin]: Don't try to link $old_library unless it exists, and
$lib is a bundle.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Check for all possible dynamic
loading libraries/apis rather that stopping when an acceptable one
is discovered.
(LT_DLLOADERS): New variable for holding dlloaders that can be
preloaded.
* doc/libtool.texi: Document interface changes.
* NEWS: Updated.
2004-07-15 20:14:48 +08:00
|
|
|
LT_DLLOADERS="$LT_DLLOADERS loadlibrary.la"
|
Factor out the individual loaders, in preparation for preloading
them as libtool modules. Currently loader-preopen.c is linked
unconditionally and other appropriate loaders discovered by
AC_LTDL_DLLIB are built and linked in:
* libltdl/Makefile.am (libltdl_la_SOURCES): Add loader-preopen
module.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Use AC_LIBOBJ to add appropriate
loaders to libltdl.
* libltdl/lt_system.h (LT_SCOPE): Moved to here.
* libltdl/ltdl.h (lt_dlloader, lt_user_data, lt_module)
(lt_module_open, lt_module_close, lt_find_sym, lt_dlloader_exit)
(struct lt_user_dlloader, lt_dlloader_next, lt_dlloader_find)
(lt_dlloader_name, lt_dlloader_data, lt_dlloader_add)
(lt_dlloader_remove): Moved declarations...
* libltdl/lt_loader.h: ...to here.
* libltdl/ltdl.c: Include lt_loader.h. Move loader implementation
code from here...
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c, libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: ...to here.
* tests/cdemo/Makefile.am, tests/demo/Makefile.am,
tests/depdemo/Makefile.am, tests/f77demo/Makefile.am,
tests/mdemo/Makefile.am, tests/mdemo2/Makefile.am,
tests/pdemo/Makefile.am, tests/tagdemo/Makefile.am (AM_CPPFLAGS):
Add -I$(top_srcdir)/../.. so that libltdl include files can be
written as #include <libltdl/lt_dlloader.h> and found correctly.
2004-04-13 22:31:05 +08:00
|
|
|
;;
|
|
|
|
esac
|
2001-06-30 08:40:38 +08:00
|
|
|
|
This pervasive changeset makes two intertwined deep changes to the
operation of libtool (neither would work alone). First, there is
a new feature that allows libraries to preopen modules. This
entails a backwards incompatible change to the libltdl API for
separating out the preloaded symbol lists by owner. Second, in
the tradition of "eating our own dogfood", libltdl now preloads
its own dlloaders. The internal API for dlloaders has also had to
change in a backwards incompatible way in support of the new
library preloading feature. If you don't use preloaded libraries,
you needn't change your project sources, though you will need to
recompile against the new libltdl. The API changes are mostly
confined to dlloaders, so you probably needn't worry about those
(unless you have written a custom loader that you want libltdl to
use):
* configure.ac (AC_CONFIG_FILES): Add libltdl/loaders/Makefile.
* libltdl/configure.ac (AC_CONFIG_FILES): Add loaders/Makefile.
* libltdl/loaders: New directory for module loaders, to simplify
Makefile rules, and to give the loaders themselves names that are
unique in the first few characters.
* libtoolize.in (func_copy_all_files): Copy recursively to pick up
the loaders directory contents.
* libltdl/loaders/Makefile.am: New file. Move module building
rules to here...
* libltdl/Makefile.am: ...from here.
(VERSION_INFO): Bumped version info to signify interface changes.
(libltdl_la_CPPFLAGS, libltdlc_la_CPPFLAGS): Set LTDLOPEN
appropriately for each library.
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: Moved from here...
* libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c: ...to here.
(get_vtable): New entry function for each.
* libltdl/loaders/preopen.c (lt_dlsymlists_t): Replaced by...
(symlist_chain): ...a new structure which maps lists of preloaded
symbols from the object that loads them.
(lt_dlpreload_open): New function to automatically open all
preloaded modules belonging to a named object (ORIGINATOR).
* libltdl/lt__alloc.c (lt__zalloc): New function to return a block
of zeroed out new memory.
* libltdl/lt__alloc.h (lt__zalloc): Prototype it.
* libltdl/lt__private.h (lt__alloc_die_callback): Add missing
prototype.
(lt__error_strings): Make this opaque to callers.
* libltdl/lt_error.c (lt__error_strings): Move the implementation
to here.
* libltdl/lt_dlloader.h (lt_user_dlloader): Add extra fields to
make originator focused preloading possible. *BREAKS BACKWARDS
COMPATIBILITY*
(lt_dlloader_add): Take advantage of new fields to simplify
paramater list.
* libltdl/lt_system.h (LT_STR): New ANSI stringification macro.
(LT_CONC): Fix it to work from within macros.
* libltdl/ltdl.c (loader_init, loader_init_callback): Simplify
dlloader loading.
(get_vtable, preloaded_symbols): Point these at the preopen.c
symbols to bootstrap the loader chain.
(lt_dlinit): Load the preopen dlloader manually, and then use it
to load any other preloaded dlloaders.
(lt_dlloader_add): Simplify parameter list. Populate new
fields. Chain new loaders according to priority field.
* libltdl/ltdl.h (lt_dlsymlist): Add a new originator field.
(lt_dlpreload_callback_func): Type of a callback for automatic
lt_dlpreload_open loading.
(LTDL_SET_PRELOADED_SYMBOLS): Adjust to hook into preloaded
symbols from the "@PROGRAM@" originator.
* tests/demo/dlmain.c (main): Use mangled preloaded_symbols symbol.
* tests/pdemo/longer_file_name_dlmain.c (main): Ditto.
* ltmain.in: Don't spew spurious warnings when dlopening and
dlpreopening modules.
(func_generate_dlsyms): Factored out from multiple copies in the
rest of the code. Generate originator keyed symbol lists.
(func_extract_archives): Also factored. Extract the contents of
convenience archives for linking with dependent libraries when
--whole-archive is not available.
[darwin]: Don't try to link $old_library unless it exists, and
$lib is a bundle.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Check for all possible dynamic
loading libraries/apis rather that stopping when an acceptable one
is discovered.
(LT_DLLOADERS): New variable for holding dlloaders that can be
preloaded.
* doc/libtool.texi: Document interface changes.
* NEWS: Updated.
2004-07-15 20:14:48 +08:00
|
|
|
AC_CHECK_LIB([dld], [dld_link],
|
|
|
|
[AC_DEFINE([HAVE_DLD], [1],
|
|
|
|
[Define if you have the GNU dld library.])
|
|
|
|
LT_DLLOADERS="$LT_DLLOADERS dld_link.la"])
|
|
|
|
AC_SUBST([LIBADD_DLD_LINK])
|
|
|
|
|
|
|
|
m4_pattern_allow([^LT_DLPREOPEN$])
|
|
|
|
LT_DLPREOPEN=
|
|
|
|
for lt_loader in $LT_DLLOADERS; do
|
|
|
|
LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen loaders/$lt_loader "
|
|
|
|
done
|
|
|
|
AC_SUBST([LT_DLPREOPEN])
|
|
|
|
|
|
|
|
dnl This isn't used anymore, but set it for backwards compatibility
|
|
|
|
LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
|
|
|
|
AC_SUBST([LIBADD_DL])
|
|
|
|
|
2001-06-30 08:40:38 +08:00
|
|
|
AC_LANG_POP
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LTDL_DLLIB
|
1999-12-07 18:52:53 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LTDL_SYMBOL_USCORE
|
|
|
|
# ---------------------
|
2001-08-01 14:50:16 +08:00
|
|
|
# does the compiler prefix global symbols with an underscore?
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_SYMBOL_USCORE],
|
2001-08-01 14:50:16 +08:00
|
|
|
[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
|
|
|
|
AC_CACHE_CHECK([for _ prefix in compiled symbols],
|
|
|
|
[ac_cv_sys_symbol_underscore],
|
|
|
|
[ac_cv_sys_symbol_underscore=no
|
|
|
|
cat > conftest.$ac_ext <<EOF
|
1999-12-07 18:52:53 +08:00
|
|
|
void nm_test_func(){}
|
|
|
|
int main(){nm_test_func;return 0;}
|
|
|
|
EOF
|
2001-08-01 14:50:16 +08:00
|
|
|
if AC_TRY_EVAL(ac_compile); then
|
|
|
|
# Now try to grab the symbols.
|
|
|
|
ac_nlist=conftest.nm
|
2002-05-18 00:07:25 +08:00
|
|
|
if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
|
2001-08-01 14:50:16 +08:00
|
|
|
# See whether the symbols have a leading underscore.
|
Don't assume that egrep and fgrep exist. POSIX 1003.1-2001 no
longer requires them; you're supposed to use grep -E and grep -F
instead. Also, don't assume that "test -a" works, since POSIX
doesn't require it.
* libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER, _LT_AC_LANG_C_CONFIG,
_LT_AC_LANG_CXX_CONFIG, AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE,
AC_LIBTOOL_PROG_LD_SHLIBS):
egrep -> grep, when that makes no difference.
* libtoolize.in: Likewise.
* ltdl.m4 (AC_LTDL_SYMBOL_USCORE): Likewise.
* ltmain.in: Likewise.
* demo/Makefile.am (hc-direct): Likewise.
* pdemo/Makefile.am (hc-direct): Likewise.
* tests/build-relink.test, tests/build-relink2.test,
tests/cdemo-conf.test, tests/cdemo-shared.test,
tests/cdemo-static.test, tests/demo-conf.test,
tests/demo-nofast.test, tests/demo-shared.test,
tests/demo-static.test, tests/depdemo-conf.test,
tests/depdemo-nofast.test, tests/depdemo-shared.test,
tests/depdemo-static.test, tests/hardcode.test,
tests/mdemo-conf.test, tests/mdemo-shared.test,
tests/mdemo-static.test, tests/pdemo-conf.test,
tests/tagdemo-conf.test, tests/tagdemo-shared.test,
tests/tagdemo-static.test: Likewise.
* libtool.m4 (AC_PROG_EGREP):
New macro, defined if Autoconf doesn't define.
(AC_PATH_TOOL_PREFIX, AC_PROG_LD_GNU): Use it.
(AC_PROG_LD, AC_PROG_NM, AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE):
Use shell pattern matching rather than egrep.
(AC_LIBTOOL_CONFIG): Set lt_EGREP and EGREP.
* demo/Makefile.am (SET_HARDCODE_FLAGS): Use sed instead of egrep.
* pdemo/Makefile.am (SET_HARDCODE_FLAGS): Likewise.
* tests/defs (EGREP, FGREP): New vars.
* ltmain.in: egrep -> $EGREP
* tests/assign.test, tests/demo-exec.test, tests/demo-inst.test,
tests/pdemo-exec.test, tests/pdemo-inst.test, tests/sh.test:
Likewise.
* tests/hardcode.test: fgrep -> $FGREP
* tests/f77demo-exec.test: test -a -> test &&
2002-11-19 17:42:39 +08:00
|
|
|
if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
|
2001-08-01 14:50:16 +08:00
|
|
|
ac_cv_sys_symbol_underscore=yes
|
1999-12-07 18:52:53 +08:00
|
|
|
else
|
Don't assume that egrep and fgrep exist. POSIX 1003.1-2001 no
longer requires them; you're supposed to use grep -E and grep -F
instead. Also, don't assume that "test -a" works, since POSIX
doesn't require it.
* libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER, _LT_AC_LANG_C_CONFIG,
_LT_AC_LANG_CXX_CONFIG, AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE,
AC_LIBTOOL_PROG_LD_SHLIBS):
egrep -> grep, when that makes no difference.
* libtoolize.in: Likewise.
* ltdl.m4 (AC_LTDL_SYMBOL_USCORE): Likewise.
* ltmain.in: Likewise.
* demo/Makefile.am (hc-direct): Likewise.
* pdemo/Makefile.am (hc-direct): Likewise.
* tests/build-relink.test, tests/build-relink2.test,
tests/cdemo-conf.test, tests/cdemo-shared.test,
tests/cdemo-static.test, tests/demo-conf.test,
tests/demo-nofast.test, tests/demo-shared.test,
tests/demo-static.test, tests/depdemo-conf.test,
tests/depdemo-nofast.test, tests/depdemo-shared.test,
tests/depdemo-static.test, tests/hardcode.test,
tests/mdemo-conf.test, tests/mdemo-shared.test,
tests/mdemo-static.test, tests/pdemo-conf.test,
tests/tagdemo-conf.test, tests/tagdemo-shared.test,
tests/tagdemo-static.test: Likewise.
* libtool.m4 (AC_PROG_EGREP):
New macro, defined if Autoconf doesn't define.
(AC_PATH_TOOL_PREFIX, AC_PROG_LD_GNU): Use it.
(AC_PROG_LD, AC_PROG_NM, AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE):
Use shell pattern matching rather than egrep.
(AC_LIBTOOL_CONFIG): Set lt_EGREP and EGREP.
* demo/Makefile.am (SET_HARDCODE_FLAGS): Use sed instead of egrep.
* pdemo/Makefile.am (SET_HARDCODE_FLAGS): Likewise.
* tests/defs (EGREP, FGREP): New vars.
* ltmain.in: egrep -> $EGREP
* tests/assign.test, tests/demo-exec.test, tests/demo-inst.test,
tests/pdemo-exec.test, tests/pdemo-inst.test, tests/sh.test:
Likewise.
* tests/hardcode.test: fgrep -> $FGREP
* tests/f77demo-exec.test: test -a -> test &&
2002-11-19 17:42:39 +08:00
|
|
|
if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
|
2001-08-01 14:50:16 +08:00
|
|
|
:
|
|
|
|
else
|
2003-08-27 22:56:07 +08:00
|
|
|
echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
|
2001-08-01 14:50:16 +08:00
|
|
|
fi
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
2001-08-01 14:50:16 +08:00
|
|
|
else
|
2003-08-27 22:56:07 +08:00
|
|
|
echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
|
|
|
else
|
2003-08-27 22:56:07 +08:00
|
|
|
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
|
|
|
|
cat conftest.c >&AS_MESSAGE_LOG_FD
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
2001-08-01 14:50:16 +08:00
|
|
|
rm -rf conftest*
|
|
|
|
])
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LTDL_SYMBOL_USCORE
|
1999-12-07 18:52:53 +08:00
|
|
|
|
2000-12-02 03:13:20 +08:00
|
|
|
|
2000-09-17 04:08:07 +08:00
|
|
|
# AC_LTDL_DLSYM_USCORE
|
|
|
|
# --------------------
|
2001-07-06 09:08:58 +08:00
|
|
|
AC_DEFUN([AC_LTDL_DLSYM_USCORE],
|
2001-08-01 14:50:16 +08:00
|
|
|
[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
|
1999-12-07 18:52:53 +08:00
|
|
|
if test x"$ac_cv_sys_symbol_underscore" = xyes; then
|
2002-05-18 00:07:25 +08:00
|
|
|
if test x"$libltdl_cv_func_dlopen" = xyes ||
|
|
|
|
test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
|
1999-12-07 18:52:53 +08:00
|
|
|
AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
|
2001-08-01 14:50:16 +08:00
|
|
|
[libltdl_cv_need_uscore],
|
|
|
|
[libltdl_cv_need_uscore=unknown
|
|
|
|
save_LIBS="$LIBS"
|
This pervasive changeset makes two intertwined deep changes to the
operation of libtool (neither would work alone). First, there is
a new feature that allows libraries to preopen modules. This
entails a backwards incompatible change to the libltdl API for
separating out the preloaded symbol lists by owner. Second, in
the tradition of "eating our own dogfood", libltdl now preloads
its own dlloaders. The internal API for dlloaders has also had to
change in a backwards incompatible way in support of the new
library preloading feature. If you don't use preloaded libraries,
you needn't change your project sources, though you will need to
recompile against the new libltdl. The API changes are mostly
confined to dlloaders, so you probably needn't worry about those
(unless you have written a custom loader that you want libltdl to
use):
* configure.ac (AC_CONFIG_FILES): Add libltdl/loaders/Makefile.
* libltdl/configure.ac (AC_CONFIG_FILES): Add loaders/Makefile.
* libltdl/loaders: New directory for module loaders, to simplify
Makefile rules, and to give the loaders themselves names that are
unique in the first few characters.
* libtoolize.in (func_copy_all_files): Copy recursively to pick up
the loaders directory contents.
* libltdl/loaders/Makefile.am: New file. Move module building
rules to here...
* libltdl/Makefile.am: ...from here.
(VERSION_INFO): Bumped version info to signify interface changes.
(libltdl_la_CPPFLAGS, libltdlc_la_CPPFLAGS): Set LTDLOPEN
appropriately for each library.
* libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c, libltdl/loader-load_add_on.c,
libltdl/loader-loadlibrary.c libltdl/loader-preopen.c,
libltdl/loader-shl_load.c: Moved from here...
* libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c: ...to here.
(get_vtable): New entry function for each.
* libltdl/loaders/preopen.c (lt_dlsymlists_t): Replaced by...
(symlist_chain): ...a new structure which maps lists of preloaded
symbols from the object that loads them.
(lt_dlpreload_open): New function to automatically open all
preloaded modules belonging to a named object (ORIGINATOR).
* libltdl/lt__alloc.c (lt__zalloc): New function to return a block
of zeroed out new memory.
* libltdl/lt__alloc.h (lt__zalloc): Prototype it.
* libltdl/lt__private.h (lt__alloc_die_callback): Add missing
prototype.
(lt__error_strings): Make this opaque to callers.
* libltdl/lt_error.c (lt__error_strings): Move the implementation
to here.
* libltdl/lt_dlloader.h (lt_user_dlloader): Add extra fields to
make originator focused preloading possible. *BREAKS BACKWARDS
COMPATIBILITY*
(lt_dlloader_add): Take advantage of new fields to simplify
paramater list.
* libltdl/lt_system.h (LT_STR): New ANSI stringification macro.
(LT_CONC): Fix it to work from within macros.
* libltdl/ltdl.c (loader_init, loader_init_callback): Simplify
dlloader loading.
(get_vtable, preloaded_symbols): Point these at the preopen.c
symbols to bootstrap the loader chain.
(lt_dlinit): Load the preopen dlloader manually, and then use it
to load any other preloaded dlloaders.
(lt_dlloader_add): Simplify parameter list. Populate new
fields. Chain new loaders according to priority field.
* libltdl/ltdl.h (lt_dlsymlist): Add a new originator field.
(lt_dlpreload_callback_func): Type of a callback for automatic
lt_dlpreload_open loading.
(LTDL_SET_PRELOADED_SYMBOLS): Adjust to hook into preloaded
symbols from the "@PROGRAM@" originator.
* tests/demo/dlmain.c (main): Use mangled preloaded_symbols symbol.
* tests/pdemo/longer_file_name_dlmain.c (main): Ditto.
* ltmain.in: Don't spew spurious warnings when dlopening and
dlpreopening modules.
(func_generate_dlsyms): Factored out from multiple copies in the
rest of the code. Generate originator keyed symbol lists.
(func_extract_archives): Also factored. Extract the contents of
convenience archives for linking with dependent libraries when
--whole-archive is not available.
[darwin]: Don't try to link $old_library unless it exists, and
$lib is a bundle.
* m4/ltdl.m4 (AC_LTDL_DLLIB): Check for all possible dynamic
loading libraries/apis rather that stopping when an acceptable one
is discovered.
(LT_DLLOADERS): New variable for holding dlloaders that can be
preloaded.
* doc/libtool.texi: Document interface changes.
* NEWS: Updated.
2004-07-15 20:14:48 +08:00
|
|
|
LIBS="$LIBS $LIBADD_DLOPEN"
|
2001-08-01 14:50:16 +08:00
|
|
|
_LT_AC_TRY_DLOPEN_SELF(
|
|
|
|
[libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
|
|
|
|
[], [libltdl_cv_need_uscore=cross])
|
|
|
|
LIBS="$save_LIBS"
|
2000-12-02 03:13:20 +08:00
|
|
|
])
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x"$libltdl_cv_need_uscore" = xyes; then
|
|
|
|
AC_DEFINE(NEED_USCORE, 1,
|
2001-10-13 07:32:13 +08:00
|
|
|
[Define if dlsym() requires a leading underscore in symbol names.])
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LTDL_DLSYM_USCORE
|