]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/configure.in (stdlib.h, unistd.h, stdio.h): check
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Wed, 16 Dec 1998 02:39:15 +0000 (02:39 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 16 Dec 1998 02:39:15 +0000 (02:39 +0000)
* libltdl/ltdl.c: include them

ChangeLog
libltdl/configure.in
libltdl/ltdl.c

index 3d00404cb1a2221ff72ed0fd593c6e2dc0c6ec54..ce2c3f5eeeddf34bf1147da6f52677b6ab7add68 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1998-12-16  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * 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
index cf2c09721dde3f5b16bb50e9089ef335993316df..c7d2b429e4f8d4619bcd8442fae3287976b33868 100644 (file)
@@ -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 <dlfcn.h>
 #include <stdio.h>
 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
 
index c39e8dd194943248b8c305bf85a314af4bb117c1..b6985e52cb5001a25a10102a1abad3af88aefe42 100644 (file)
@@ -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 <string.h>
 #endif
 
-#ifdef HAVE_STRINGS_H
+#if HAVE_STRINGS_H
 #include <strings.h>
 #endif
 
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#if HAVE_STDIO_H
 #include <stdio.h>
+#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 */