diff --git a/ChangeLog b/ChangeLog index 3d00404c..ce2c3f5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 1998-12-16 Alexandre Oliva + * libltdl/configure.in (stdlib.h, unistd.h, stdio.h): check + * libltdl/ltdl.c: include them + * demo/configure.in (BINARY_HELLDL): test whether dlopen is supported at configure time * demo/Makefile.am (helldl): use automake conditionals to build diff --git a/libltdl/configure.in b/libltdl/configure.in index cf2c0972..c7d2b429 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -6,7 +6,7 @@ AC_PROG_CC AM_PROG_LIBTOOL AC_HEADER_STDC -AC_CHECK_HEADERS(malloc.h dlfcn.h dl.h) +AC_CHECK_HEADERS(malloc.h stdlib.h unistd.h stdio.h dlfcn.h dl.h) AC_CHECK_HEADERS(string.h strings.h, break) AC_CHECK_FUNCS(strdup strrchr) @@ -20,22 +20,21 @@ AC_CHECK_FUNCS(dlopen, AC_DEFINE(HAVE_LIBDL), ) AC_SUBST(LIBADD_DL) -AC_MSG_CHECKING(for underscore before symbols) -AC_CACHE_VAL(libltdl_cv_uscore,[ +AC_CACHE_CHECK([for underscore before symbols], libltdl_cv_uscore, [ echo "main(){int i=1;} fnord(){int i=23; int ltuae=42;}" > conftest.c ${CC} -c conftest.c > /dev/null if (nm conftest.$ac_objext | grep _fnord) > /dev/null; then libltdl_cv_uscore=yes else libltdl_cv_uscore=no - fi]) -AC_MSG_RESULT($libltdl_cv_uscore) -rm -f conftest* + fi + rm -f conftest* +]) if test $libltdl_cv_uscore = yes; then if test $ac_cv_func_dlopen = yes || test $ac_cv_lib_dl_dlopen = yes ; then - AC_MSG_CHECKING(whether we have to add an underscore for dlsym) - AC_CACHE_VAL(libltdl_cv_need_uscore,AC_TRY_RUN([ + AC_CACHE_CHECK([whether we have to add an underscore for dlsym], + libltdl_cv_need_uscore,AC_TRY_RUN([ #include #include fnord() { int i=42;} @@ -46,8 +45,6 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY); [libltdl_cv_need_uscore=yes AC_DEFINE(NEED_USCORE)], libltdl_cv_need_uscore=no)) - - AC_MSG_RESULT($libltdl_cv_need_uscore) fi fi diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index c39e8dd1..b6985e52 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -19,17 +19,31 @@ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define _LTDL_COMPILE_ -#include "ltdl.h" - -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif +#if HAVE_MALLOC_H +#include +#endif + +#if HAVE_STDLIB_H +#include +#endif + +#if HAVE_UNISTD_H +#include +#endif + +#if HAVE_STDIO_H #include +#endif + +#include "ltdl.h" typedef struct lt_dlhandle_t { struct lt_dlhandle_t *next; @@ -87,7 +101,7 @@ strrchr(str, ch) #endif -#ifdef STATIC +#ifdef LIBTOOL_STATIC /* emulate dynamic linking using dld_preloaded_symbols */