From 2b17869bd5fb4b48ec69414e0023eae551d2f9ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Wed, 1 Feb 2012 19:53:24 +0100 Subject: [PATCH] Require a compiler compatible with C99 The LLONG_MAX constant is only declared on some systems if gcc is ran in a mode compatible with C99. This commit requires C99 (-std=gnu99 in fact) and check that LLONG_MAX is properly defined. At least, the user will be informed about the problem as soon as possible if such a problem occurs again. The bug describing this problem is here: http://sourceforge.net/tracker/index.php?func=detail&aid=3482261&group_id=68910&atid=522791 --- configure.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.in b/configure.in index cc023d5..02b13ac 100644 --- a/configure.in +++ b/configure.in @@ -23,6 +23,9 @@ dnl if test "${CC}" = "cc" ; then dnl CFLAGS="${CFLAGS} -g -O2 -Aa" dnl fi +dnl C99 support is required to define LLONG_MAX (at least on CentOS 5.7) +AC_PROG_CC_C99 + # Report more warnings to improve code quality. CFLAGS="${CFLAGS} -Wall -Wno-sign-compare" @@ -189,6 +192,12 @@ else AC_MSG_WARN([can not detect the size of your system\'s rlim_t type]) fi +dnl check for the long long int max constant +AC_CHECK_DECL(LLONG_MAX,HAVE_LLONG_MAX="yes",HAVE_LLONG_MAX="no",[[#include ]]) +if ( test "x$ac_cv_have_decl_LLONG_MAX" != "xyes" ) ; then + AC_MSG_ERROR([LLONG_MAX is not defined on your system.]) +fi + dnl Select sarg-php directory AC_ARG_ENABLE(sargphp, AS_HELP_STRING([--enable-sargphp=sargphpdir], -- 2.47.2