From: Jelte Jansen Date: Tue, 13 Feb 2007 14:32:12 +0000 (+0000) Subject: removed AC_CHECK_DECLS X-Git-Tag: release-1.2.0~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7ba3cd5ae2f628827cd651be3fec13dbae934b6;p=thirdparty%2Fldns.git removed AC_CHECK_DECLS added big all-or-nothing on flags test fixed flag function to include spaces --- diff --git a/configure.ac b/configure.ac index 34dd167e..a5bbaf28 100644 --- a/configure.ac +++ b/configure.ac @@ -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 +#include +#include +#include + +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 @@ -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 -#include -#include -#include -#include -#include -#include -]) + + AC_C_INLINE AC_CHECK_TYPE(int8_t, char)