]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
acx to version 19,
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Mon, 5 Dec 2011 15:50:40 +0000 (15:50 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Mon, 5 Dec 2011 15:50:40 +0000 (15:50 +0000)
Fix ACX_MALLOC for redefined malloc error,
Fix GETADDRINFO_WITH_INCLUDES to add -lws2_32.

acx_nlnetlabs.m4

index 06f23810c9f94d534f03c7ce706630e308d28463..116c1a04a717d523a16fdf20fb946ac3565b01ac 100644 (file)
@@ -2,8 +2,10 @@
 # Copyright 2009, Wouter Wijngaards, NLnet Labs.   
 # BSD licensed.
 #
-# Version 17
+# Version 19
 # 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc.
+#           Fix ACX_MALLOC for redefined malloc error.
+#           Fix GETADDRINFO_WITH_INCLUDES to add -lws2_32
 # 2011-11-10 Fix FLTO test to not drop a.out in current directory.
 # 2011-11-01 Fix FLTO test for llvm on Lion.
 # 2011-08-01 Fix nonblock test (broken at v13).
@@ -800,6 +802,7 @@ dnl see if on windows
 if test "$ac_cv_header_windows_h" = "yes"; then
        AC_DEFINE(USE_WINSOCK, 1, [Whether the windows socket API is used])
        USE_WINSOCK="1"
+       LIBS="$LIBS -lws2_32"
 fi
 ],
 dnl no quick getaddrinfo, try mingw32 and winsock2 library.
@@ -1057,10 +1060,20 @@ dnl detect malloc and provide malloc compat prototype.
 dnl $1: unique name for compat code
 AC_DEFUN([ACX_FUNC_MALLOC],
 [
-       AC_FUNC_MALLOC
-       if test "$ac_cv_func_malloc_0_nonnull" = no; then
-               AC_DEFINE_UNQUOTED([malloc], [rpl_malloc_$1], [Define if  replacement function should be used.])
-       fi
+       AC_MSG_CHECKING([for GNU libc compatible malloc])
+       AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+#include <stdlib.h>
+#else
+char *malloc ();
+#endif
+]], [ if(malloc(0) != 0) return 1;])
+],
+       [AC_MSG_RESULT([no])
+       AC_DEFINE_UNQUOTED([malloc], [rpl_malloc_$1], [Define if  replacement function should be used.])] ,
+       [AC_MSG_RESULT([yes])],
+       [AC_MSG_RESULT([no (crosscompile)])
+       AC_DEFINE_UNQUOTED([malloc], [rpl_malloc_$1], [Define if  replacement function should be used.])] )
 ])
 
 dnl Define fallback for fseeko and ftello if needed.