[PATCH nft] configure: misc updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch removes the following macros:

* AC_PREREQ checks for 2.61, which is not supported any contemporary
  distribution.

* AC_COPYRIGHT, autoconf documentation states "in addition to the Free
  Software Foundation's copyright on the Autoconf macros, parts of your
  configure are covered by the copyright-notice.".

  This only refers to the autoconf infrastructure: we are doing simple
  and standard usage of autoconf infrastructure, we also don't use this
  macro in other existing userspace software available at netfilter.org.
  The comment above at the beginning of this file shows text that is
  available in many configure.ac templates on the Internet.

* AC_CANONICAL_HOST, we don't need the canonical host-system type to
  build this software.

* AC_CONFIG_SRCDIR is not used in other userspace software in the tree.

* AC_DEFINE _GNU_SOURCE, define this where it's needed instead.

* AC_DEFINE _STDC_FORMAT_MACROS is not used in this codebase.

* AC_HEADER_STDC checks for ANSI C89 headers, however, we need more than
  just this C standard, so this doesn't guarantee anything at all.

* Remove "Checks for libraries" comment, it's obvious.

* AC_HEADER_ASSERT allows us to disable assertions, this is bad because
  this is helping us to diagnose bugs and incomplete features.

* AC_CHECK_HEADERS is checking for an arbitrary list of headers,
  this still doesn't even guarantee that we can actually do a successful
  compilation in a broken system.

Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 configure.ac | 21 ---------------------
 src/erec.c   |  1 +
 2 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/configure.ac b/configure.ac
index 408a6bc37f7b..061708a2b755 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,14 +1,7 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.61)
-
-AC_COPYRIGHT([Copyright (c) 2008 Patrick McHardy <kaber@xxxxxxxxx>, (c) 2013-2016 Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>])
 AC_INIT([nftables], [0.8.2], [netfilter-devel@xxxxxxxxxxxxxxx])
 AC_DEFINE([RELEASE_NAME], ["Joe Btfsplk"], [Release name])
 
 AC_CONFIG_AUX_DIR([build-aux])
-AC_CANONICAL_HOST
 AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([-Wall foreign subdir-objects
         tar-pax no-dist-gzip dist-bzip2 1.6])
@@ -16,12 +9,8 @@ AM_INIT_AUTOMAKE([-Wall foreign subdir-objects
 dnl kernel style compile messages
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
-AC_CONFIG_SRCDIR([src/rule.c])
 AC_CONFIG_HEADER([config.h])
 
-AC_DEFINE([_GNU_SOURCE], [], [Enable various GNU extensions])
-AC_DEFINE([_STDC_FORMAT_MACROS], [], [printf-style format macros])
-
 AC_ARG_ENABLE([debug],
 	      AS_HELP_STRING([--disable-debug], [Disable debugging symbols]),
 	      AS_IF([test "x$enable_debug" = "xno"], [with_debug=no], [with_debug=yes]),
@@ -86,7 +75,6 @@ AM_COND_IF([BUILD_PDF], [
 	      [AC_MSG_ERROR([dblatex not found])])
 ])
 
-# Checks for libraries.
 PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
 PKG_CHECK_MODULES([LIBNFTNL], [libnftnl >= 1.0.9])
 
@@ -119,15 +107,6 @@ AC_DEFINE([HAVE_LIBXTABLES], [1], [0])
 AC_SUBST(with_libxtables)
 AM_CONDITIONAL([BUILD_XTABLES], [test "x$with_libxtables" == xyes])
 
-# Checks for header files.
-AC_HEADER_STDC
-AC_HEADER_ASSERT
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h malloc.h \
-		  netdb.h netinet/in.h netinet/ip.h netinet/ip6.h \
-		  netinet/tcp.h netinet/udp.h netinet/ip_icmp.h \
-		  stddef.h stdint.h stdlib.h string.h unistd.h], ,
-		 AC_MSG_ERROR([Header file not found]))
-
 AC_CONFIG_FILES([					\
 		Makefile				\
 		src/Makefile				\
diff --git a/src/erec.c b/src/erec.c
index 8de249de8b78..3e1b7fd108a7 100644
--- a/src/erec.c
+++ b/src/erec.c
@@ -8,6 +8,7 @@
  * Development of this code funded by Astaro AG (http://www.astaro.com/)
  */
 
+#define _GNU_SOURCE
 #include <config.h>
 #include <stdio.h>
 #include <string.h>
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux