]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
removed AC_CHECK_DECLS
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Tue, 13 Feb 2007 14:32:12 +0000 (14:32 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Tue, 13 Feb 2007 14:32:12 +0000 (14:32 +0000)
added big all-or-nothing on flags test
fixed flag function to include spaces

configure.ac

index 34dd167eccf15d5e322a4f69f9b11dd31855647b..a5bbaf283583cafb0fe4ca55cac64d4b19f26fd9 100644 (file)
@@ -52,7 +52,7 @@ AC_DEFUN([CHECK_COMPILER_FLAG_NEEDED],
 [
 AC_REQUIRE([AC_PROG_CC])
 AC_MSG_CHECKING(whether we need $1 as a flag for $CC)
-cache=`echo $1 | sed 'y%.=/+-%___p_%'`
+cache=`echo $1 | sed 'y%.=/+- %___p__%'`
 AC_CACHE_VAL(cv_prog_cc_flag_needed_$cache,
 [
 echo '$2' > conftest.c
@@ -98,6 +98,30 @@ AC_C_CONST
 AC_LANG_C
 AC_TYPE_SIZE_T
 CHECK_COMPILER_FLAG(O2, [CFLAGS="$CFLAGS -O2"])
+
+CHECK_COMPILER_FLAG_NEEDED(-std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600,
+[
+#include <stdlib.h>
+#include <ctype.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+int test() {  
+        int a;
+        char **opts = NULL;
+        struct timeval tv;
+       char *t;
+       time_t time = 0;
+       char *buf = NULL;
+       t = ctime_r(&time, buf);
+        tv.tv_usec = 10;
+        srandom(32);
+        a = getopt(2, opts, "a");
+        a = isascii(32);
+        return a;
+}
+], [CFLAGS="$CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600"])
+
 CHECK_COMPILER_FLAG_NEEDED(-std=c99,
 [
 #include <stdbool.h>
@@ -153,16 +177,8 @@ int test() {
         return a;
 }
 ], [CFLAGS="$CFLAGS -D__EXTENSIONS__"])
-# check that the functions are available
-AC_CHECK_DECLS([isascii, getopt, srandom, ctime_r, isblank],, [echo "Cannot set compile environment; pass defines in CFLAGS=-D... ./configure"; exit 1], [
-#include <stdlib.h>
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
-#include <getopt.h>
-#include <stdbool.h>
-#include <ctype.h>
-])
+
+
 
 AC_C_INLINE
 AC_CHECK_TYPE(int8_t, char)