2001-06-30 06:56:50 +08:00
|
|
|
## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
|
* update all copyright notices to 2000
* doc/libtool.texi (using libltdl): document new lt_dlinfo struct,
replace NULL with @code{NULL}, document lt_dlsetdata(),
lt_dlgetdata() and lt_dlgetinfo()
* libltdl/Makefile.am: increment interface version number
* libltdl/configure.in: set version number to 1.1
* libltdl/ltdl.c: make some variables public by moving them
to the info struct, add support for application specific data
within module handles, new lt_dlsetdata(), lt_dlgetdata() and
lt_dlgetinfo() functions,
fix memory leaks, minor cleanups
* libltdl/ltdl.h: ditto
* mdemo/main.c: demonstrate use of lt_dlgetinfo,
improved handling of errors
* ltconfig.in: set hardcode_into_libs = yes for GNU/Hurd, Linux
and Solaris, only hardcode *all* run-paths if hardcode_into_libs
is set to 'all', otherwise hardcode only user-specified rpaths
into libraries
* ltmain.in: minor cleanups, we don't need to add user-specified
rpaths to compile_rpath, finalize_rpath is sufficient
* ltconfig.in: transform linux* -> *linux-gnu* _after_ host_os has
been set! (reported by Bruno Haible <haible@ilog.fr>)
* configure.in: AC_SUBST reload_flag, deplibs_check_method
and file_magic_cmd
* README: use 'libtool --version' instead of 'ltconfig --version'
(suggested by Francios Pinard <pinard@iro.umontreal.ca>
2000-01-13 08:28:09 +08:00
|
|
|
## Copyright (C) 1999-2000 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-08-01 14:50:16 +08:00
|
|
|
# serial 4 AC_LIB_LTDL
|
1999-12-07 18:52:53 +08:00
|
|
|
|
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],
|
2001-08-01 14:50:16 +08:00
|
|
|
[AC_PREREQ(2.50)
|
|
|
|
AC_REQUIRE([AC_PROG_CC])
|
|
|
|
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])
|
|
|
|
AC_REQUIRE([AC_LTDL_FUNC_ARGZ])
|
1999-12-13 21:44:29 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
AC_CHECK_HEADERS([ctype.h errno.h malloc.h memory.h stdlib.h stdio.h])
|
|
|
|
AC_CHECK_HEADERS([dl.h sys/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([memcpy bcopy], [break])
|
|
|
|
AC_CHECK_FUNCS([memmove strcmp])
|
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
|
|
|
|
;;
|
|
|
|
aix[45]*)
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
|
|
|
gnu*)
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
|
|
|
irix[12345]*|irix6.[01]*)
|
|
|
|
# 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
|
|
|
|
;;
|
|
|
|
linux*)
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
|
|
|
netbsd*)
|
|
|
|
libltdl_cv_sys_dlopen_deplibs=yes
|
|
|
|
;;
|
|
|
|
osf[1234]*)
|
|
|
|
# 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
|
|
|
|
;;
|
|
|
|
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])
|
1999-12-07 18:52:53 +08:00
|
|
|
AC_CACHE_CHECK([which extension is used for shared libraries],
|
2001-08-01 14:50:16 +08:00
|
|
|
[libltdl_cv_shlibext],
|
|
|
|
[ac_last=
|
2000-09-17 04:08:07 +08:00
|
|
|
for ac_spec in $library_names_spec; do
|
|
|
|
ac_last="$ac_spec"
|
1999-12-07 18:52:53 +08:00
|
|
|
done
|
2000-09-17 04:08:07 +08:00
|
|
|
echo "$ac_last" | [sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//'] > conftest
|
2001-08-01 14:50:16 +08:00
|
|
|
libltdl_cv_shlibext=`cat conftest`
|
|
|
|
rm -f conftest
|
|
|
|
])
|
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
|
2001-08-05 20:20:45 +08:00
|
|
|
sys_search_path="$sys_search_path$ac_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],
|
|
|
|
[if test -n "$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],
|
1999-12-07 18:52:53 +08:00
|
|
|
[LIBADD_DL=
|
|
|
|
AC_SUBST(LIBADD_DL)
|
2001-06-30 08:40:38 +08:00
|
|
|
AC_LANG_PUSH([C])
|
2001-08-01 14:50:16 +08:00
|
|
|
AC_CHECK_LIB([dl], [dlopen],
|
|
|
|
[AC_DEFINE([HAVE_LIBDL], [1],
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define if you have the libdl library or equivalent.])
|
2001-08-01 14:50:16 +08:00
|
|
|
LIBADD_DL="-ldl"],
|
2001-06-30 08:40:38 +08:00
|
|
|
[AC_TRY_LINK([#if HAVE_DLFCN_H
|
|
|
|
# include <dlfcn.h>
|
|
|
|
#endif
|
2001-08-01 14:50:16 +08:00
|
|
|
],
|
|
|
|
[dlopen();],
|
|
|
|
[AC_DEFINE(HAVE_LIBDL, 1,
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define if you have the libdl library or equivalent.])],
|
2001-06-30 08:40:38 +08:00
|
|
|
[AC_CHECK_LIB(svld, dlopen,
|
2001-08-01 14:50:16 +08:00
|
|
|
[AC_DEFINE(HAVE_LIBDL, 1,
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define if you have the libdl library or equivalent.])
|
2001-08-01 14:50:16 +08:00
|
|
|
LIBADD_DL="-lsvld"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
2001-06-30 08:40:38 +08:00
|
|
|
|
|
|
|
AC_CHECK_FUNC(shl_load,
|
2001-08-01 14:50:16 +08:00
|
|
|
[AC_DEFINE([HAVE_SHL_LOAD], [1],
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define if you have the shl_load function.])],
|
2001-08-01 14:50:16 +08:00
|
|
|
[AC_CHECK_LIB([dld], [shl_load],
|
|
|
|
[AC_DEFINE([HAVE_SHL_LOAD], [1],
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define if you have the shl_load function.])
|
2001-08-01 14:50:16 +08:00
|
|
|
LIBADD_DL="$LIBADD_DL -ldld"
|
|
|
|
])
|
|
|
|
])
|
2001-06-30 08:40:38 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
AC_CHECK_LIB([dld], [dld_link],
|
|
|
|
[AC_DEFINE([HAVE_DLD], [1],
|
|
|
|
[Define if you have the GNU dld library.])
|
|
|
|
test x"$ac_cv_lib_dld_shl_load" = xyes || LIBADD_DL="$LIBADD_DL -ldld"
|
|
|
|
])
|
2001-06-30 08:40:38 +08:00
|
|
|
|
2001-08-01 14:50:16 +08:00
|
|
|
if test x"$ac_cv_func_dlopen" = xyes || test x"$ac_cv_lib_dl_dlopen" = xyes
|
2001-06-30 08:40:38 +08:00
|
|
|
then
|
|
|
|
lt_save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS $LIBADD_DL"
|
2001-08-01 14:50:16 +08:00
|
|
|
AC_CHECK_FUNCS([dlerror])
|
2001-06-30 08:40:38 +08:00
|
|
|
LIBS="$lt_save_LIBS"
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
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
|
|
|
|
if AC_TRY_EVAL(NM conftest.$ac_objext \| $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
|
1999-12-07 18:52:53 +08:00
|
|
|
else
|
2001-08-01 14:50:16 +08:00
|
|
|
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
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
2001-08-01 14:50:16 +08:00
|
|
|
else
|
|
|
|
echo "configure: cannot run $global_symbol_pipe" >&AC_FD_CC
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
|
|
|
else
|
2001-08-01 14:50:16 +08:00
|
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
|
|
cat conftest.c >&AC_FD_CC
|
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
|
|
|
|
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],
|
2001-08-01 14:50:16 +08:00
|
|
|
[libltdl_cv_need_uscore],
|
|
|
|
[libltdl_cv_need_uscore=unknown
|
|
|
|
save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS $LIBADD_DL"
|
|
|
|
_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-08-05 20:29:40 +08:00
|
|
|
[Define if dlsym() requires a leading underscode in symbol names.])
|
1999-12-07 18:52:53 +08:00
|
|
|
fi
|
2000-09-17 04:08:07 +08:00
|
|
|
])# AC_LTDL_DLSYM_USCORE
|
2001-08-01 14:50:16 +08:00
|
|
|
|
|
|
|
# AC_LTDL_FUNC_ARGZ
|
|
|
|
# -----------------
|
|
|
|
AC_DEFUN([AC_LTDL_FUNC_ARGZ],
|
|
|
|
[AC_CHECK_HEADERS([argz.h])
|
|
|
|
|
|
|
|
AC_CHECK_TYPES([error_t],
|
|
|
|
[],
|
|
|
|
[AC_DEFINE([error_t], [int],
|
2001-08-05 20:29:40 +08:00
|
|
|
[Define to a type to use for `error_t' if it is not otherwise available.])],
|
2001-08-01 14:50:16 +08:00
|
|
|
[#if HAVE_ARGZ_H
|
|
|
|
# include <argz.h>
|
|
|
|
#endif])
|
|
|
|
|
|
|
|
AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next])
|
|
|
|
])# AC_LTDL_FUNC_ARGZ
|