libtool/libltdl/configure.in
1999-01-17 11:19:40 +00:00

108 lines
2.6 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
AM_PROG_LIBTOOL
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)
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
AM_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: