libtool/libltdl/configure.in
Thomas Tanner a5f6b87d4a * cdemo/configure.in: renamed AM_PROG_LIBTOOL to AC_PROG_LIBTOOL
* demo/configure.in: likewise
* depdemo/configure.in: likewise
* libltdl/configure.in: likewise
* mdemo/configure.in: likewise
* libltdl/ltdl.c: in find_module() check whether libdir is defined,
  tryall_dlopen(): move deallocation of an already opened handle
  to lt_dlopen(), allocate the directory in lt_dlopen() dynamically,
  minor cleanups, fixed memory leak (name)
* libtool.m4: renamed all AM_ macros to AC_ and added aliases for
  compatibilty, updated AC_SYS_NM_PARSE (no undefined symbols,
  don't count the symbols)
* ltconfig.in: added thread_safe_flag_spec (not used yet),
  added generic variable for linker options "linkopts" in
  all archive_cmds
* ltmain.in: added -thread-safe flag (unused)
1999-01-27 00:49:06 +00:00

145 lines
3.5 KiB
Plaintext

dnl Process this file with autoconf to create configure.
dnl Initialize the libltdl package.
AC_INIT(ltdl.c)
AM_INIT_AUTOMAKE(libltdl,1.0,-)
AM_MAINTAINER_MODE
AC_ARG_ENABLE(ltdl-install,
[--enable-ltdl-install install libltdl])
AM_CONDITIONAL(INSTALL_LTDL, test x$enable_ltdl_install = xyes)
if test x$enable_ltdl_install = xyes; then
LIBLIBS=libltdl.la
NOINSTLIBS=
else
LIBLIBS=
NOINSTLIBS=libltdl.la
fi
AC_SUBST(LIBLIBS)
AC_SUBST(NOINSTLIBS)
AC_PROG_CC
AC_C_CONST
AC_C_INLINE
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_CACHE_CHECK([which extension is used for shared libraries],
libltdl_cv_shlibext, [dnl
(
rm -f conftest
./libtool --config > conftest
. ./conftest
last=
for spec in $library_names_spec; do
last="$spec"
done
rm -f conftest
changequote(, )
echo "$last" | sed 's/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
changequote([, ])
)
libltdl_cv_shlibext=`cat conftest`
rm -f conftest
])
if test -n "$libltdl_cv_shlibext"; then
AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext")
fi
AC_CACHE_CHECK([which variable specifies run-time library path],
libltdl_cv_shlibpath_var, [dnl
(
rm -f conftest
./libtool --config > conftest
. ./conftest
rm -f conftest
echo "$shlibpath_var" > conftest
)
libltdl_cv_shlibpath_var=`cat conftest`
rm -f conftest
])
if test -n "$libltdl_cv_shlibpath_var"; then
AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var")
fi
AC_CACHE_CHECK([for objdir],
libltdl_cv_objdir, [dnl
(
rm -f conftest
./libtool --config > conftest
. ./conftest
rm -f conftest
echo "$objdir" > conftest
)
libltdl_cv_objdir=`cat conftest`
rm -f conftest
])
test -z "$libltdl_cv_objdir" && libltdl_cv_objdir=".libs"
AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/")
AC_HEADER_STDC
AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h)
AC_CHECK_HEADERS(string.h strings.h, break)
AC_CHECK_FUNCS(strdup strchr strrchr index rindex)
AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
libltdl_cv_preloaded_symbols, [dnl
if grep '^global_symbol_pipe=..*$' ./libtool >/dev/null; then
libltdl_cv_preloaded_symbols=yes
else
libltdl_cv_preloaded_symbols=no
fi
])
if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
AC_DEFINE(HAVE_PRELOADED_SYMBOLS)
fi
test_dlerror=no
LIBADD_DL=
AC_CHECK_FUNCS(dlopen, [AC_DEFINE(HAVE_LIBDL) test_dlerror=yes],
[AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL) LIBADD_DL="-ldl" test_dlerror=yes],
[AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD) LIBADD_DL="-ldld"],
[AC_CHECK_FUNCS(shl_load, AC_DEFINE(HAVE_SHL_LOAD))]
)]
)]
)
AC_SUBST(LIBADD_DL)
if test "$test_dlerror" = yes; then
LIBS_SAVE="$LIBS"
LIBS="$LIBS $LIBADD_DL"
AC_CHECK_FUNCS(dlerror)
LIBS="$LIBS_SAVE"
fi
AC_SYS_SYMBOL_UNDERSCORE
if test x"$USE_SYMBOL_UNDERSCORE" = xyes; then
if test x"$ac_cv_func_dlopen" = xyes ||
test x"$ac_cv_lib_dl_dlopen" = xyes ; then
AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
libltdl_cv_need_uscore, [dnl
AC_TRY_RUN([
#include <dlfcn.h>
#include <stdio.h>
fnord() { int i=42;}
main() { void *self, *ptr1, *ptr2; self=dlopen(0,RTLD_LAZY);
if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
if(ptr1 && !ptr2) exit(0); } exit(1); }
], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
libltdl_cv_need_uscore=no
)])
fi
fi
if test x"$libltdl_cv_need_uscore" = xyes; then
AC_DEFINE(NEED_USCORE)
fi
dnl Output the makefile
AC_OUTPUT(Makefile)
# Local Variables:
# mode:shell-script
# sh-indentation:2
# End: