]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Require a compiler compatible with C99
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 1 Feb 2012 18:53:24 +0000 (19:53 +0100)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 1 Feb 2012 18:53:24 +0000 (19:53 +0100)
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

index cc023d54078bc5d8344a2a6bdda70fff2576290b..02b13ac113a47eff1aebd833b8fdd644651cfca2 100644 (file)
@@ -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 <limits.h>]])
+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],