]> git.meshlink.io Git - catta/blobdiff - configure.ac
remove some unneeded tests
[catta] / configure.ac
index 4fcf13d9433e59dbb670f919efadbd279dfe8002..342b45f8eeacca06ff7a6d3850e6db5e2bf55696 100644 (file)
@@ -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 <linux/rtnetlink.h>], [],
+        [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 <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
-        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
@@ -272,15 +263,7 @@ if test "x$GCC" = "xyes" ; then
 fi
 
 # Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h netdb.h syslog.h])
-AC_HEADER_STDBOOL
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_SIZE_T
-AC_HEADER_TIME
-AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h sys/ioctl.h sys/socket.h sys/time.h unistd.h netdb.h syslog.h])
 
  # Solaris stuff
  AC_SEARCH_LIBS([inet_ntop],[nsl])
@@ -288,13 +271,8 @@ AC_HEADER_SYS_WAIT
  AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__", [[#include <sys/socket.h>]])
 
 # Checks for library functions.
-AC_FUNC_MEMCMP
 AC_FUNC_SELECT_ARGTYPES
-# avahi_malloc actually returns NULL for avahi_malloc(0), so it does not matter
-# whether libc's malloc does too. (Same for realloc.)
-#AC_FUNC_MALLOC
-#AC_FUNC_REALLOC
-AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid setresgid setregid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname seteuid setegid setproctitle getprogname])
+AC_CHECK_FUNCS([gethostname mkdir select socket strdup uname setresuid setreuid setresgid setregid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname seteuid setegid setproctitle getprogname])
 
 AC_FUNC_CHOWN
 AC_FUNC_STAT