CHECK_COMPILER_FLAG(g, [CFLAGS="$CFLAGS -g"])
CHECK_COMPILER_FLAG(O2, [CFLAGS="$CFLAGS -O2"])
+AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT])
+
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>
+#ifdef HAVE_TIME_H
#include <time.h>
+#endif
#include <unistd.h>
#include <netdb.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
int test() {
int a;
#include <ctype.h>
int test() {
int a = 0;
- a = isblank(12);
return a;
}
], [CFLAGS="$CFLAGS -std=c99"])
CHECK_COMPILER_FLAG_NEEDED(-D_POSIX_C_SOURCE=200112,
[
+#ifdef HAVE_TIME_H
#include <time.h>
+#endif
#include <netdb.h>
int test() {
#include <ctype.h>
#include <sys/time.h>
#include <unistd.h>
+#ifdef HAVE_GETOPT_H
#include <getopt.h>
+#endif
int test() {
int a;
return a;
}
], [CFLAGS="$CFLAGS -D__EXTENSIONS__"])
-# check that functions are defined
-AC_CHECK_DECLS([isascii, getopt, srandom, ctime_r, isblank, gai_strerror],, [echo "Cannot set compile environment; pass defines in CFLAGS=-D... ./configure"; exit 1], [
+AC_CHECK_DECLS([isascii, getopt, srandom, ctime_r, gai_strerror],, [echo "Cannot set compile environment; pass defines in CFLAGS=-D... ./configure"; exit 1], [
#include <stdlib.h>
#include <sys/time.h>
+#ifdef HAVE_TIME_H
#include <time.h>
+#endif
#include <netdb.h>
#include <unistd.h>
+#ifdef HAVE_GETOPT_H
#include <getopt.h>
+#endif
#include <stdbool.h>
#include <ctype.h>
])
14 February 2007: Wouter
- Included configure.ac changes from ldns.
+ - detect (some) headers before the standards check.
+ - do not use isblank to test c99, since its not available on solaris9.
13 February 2007: Wouter
- work on fake events, first fwd replay works.