X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=configure.ac;h=30eafedcf398a5fa817ac5854c8ea85bfac315d2;hb=f9a88a1a61c5fbd9f644b34583afe432519963f5;hp=31bda448269b33c831f2dd94b4f0cdf7f564e810;hpb=2a1da98f56ee2593c2e61be6e391feaae69d1537;p=catta diff --git a/configure.ac b/configure.ac index 31bda44..30eafed 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,10 @@ AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_GCC_TRADITIONAL +if test x"$ac_cv_prog_cc_c99" = x"no"; then + AC_MSG_ERROR([C99 support is required]) +fi + # -fstack-protector AC_ARG_ENABLE([stack-protector], [AS_HELP_STRING([--disable-stack-protector], @@ -143,6 +147,15 @@ AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink]) AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ]) +if test "x$HAVE_NETLINK" = "xyes" ; then + # Test whether rtnetlink.h can be included when compiled with -std=c99 + # some distributions (e.g. archlinux) have broken headers that dont + # define __u64 with -std=c99 + AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99]) + AC_TRY_COMPILE([#include ], [], + [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no])]) +fi + # # Check for net/route.h # @@ -238,28 +251,6 @@ if test "x$GCC" = "xyes" ; then DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -fdiagnostics-show-option -Wno-cast-qual -fno-strict-aliasing" - if test "x$HAVE_NETLINK" = "xyes" ; then - # Test whether rtnetlink.h can be included when compiled with -std=c99 - # some distributions (e.g. archlinux) have broken headers that dont - # define __u64 with -std=c99 - AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99]) - OLDCFLAGS="$CFLAGS" - CFLAGS="-std=c99" - AC_TRY_COMPILE([#include ], [], - use_stdc99=yes, use_stdc99=no) - - if test x"$use_stdc99" = xyes; then - DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - - CFLAGS="$OLDCFLAGS" - else - DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS" - fi - for flag in $DESIRED_FLAGS ; do AC_MSG_CHECKING([whether $CC accepts $flag]) if test_gcc_flag $flag ; then