diff options
author | Sebastien Estienne <sebastien.estienne@gmail.com> | 2005-10-23 21:25:24 +0000 |
---|---|---|
committer | Sebastien Estienne <sebastien.estienne@gmail.com> | 2005-10-23 21:25:24 +0000 |
commit | 649f3b3f9e585041945034ee3613ec30c1cc0a19 (patch) | |
tree | fcf017857a6803decb078de2a20973b39f8002ef /configure.ac | |
parent | 5e805e797578e096657a544f313d28977e9f35d4 (diff) |
* always add -std=c99 when netlink.h is not present
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@847 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index ecc1120..f4080f7 100644 --- a/configure.ac +++ b/configure.ac @@ -157,24 +157,28 @@ 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 -Wlarger-than-4000 -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter" - # 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 <linux/rtnetlink.h>], [], - use_stdc99=yes, use_stdc99=no) - - if test x"$use_stdc99" = xyes; then - DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS" - AC_MSG_RESULT([yes]) + 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 <linux/rtnetlink.h>], [], + 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 - AC_MSG_RESULT([no]) + DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS" fi - CFLAGS="$OLDCFLAGS" - for flag in $DESIRED_FLAGS ; do AC_MSG_CHECKING([whether $CC accepts $flag]) if test_gcc_flag $flag ; then |