[
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
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>
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)