@@ -10,7 +10,6 @@ Makefile
Makefile.in
/include/xtables-version.h
-/include/iptables/internal.h
/aclocal.m4
/autom4te.cache/
@@ -30,4 +30,4 @@ tarball:
rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};
config.status: extensions/GNUmakefile.in \
- include/xtables-version.h.in include/iptables/internal.h.in
+ include/xtables-version.h.in
@@ -245,7 +245,7 @@ AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile
libiptc/Makefile libiptc/libiptc.pc
libiptc/libip4tc.pc libiptc/libip6tc.pc
libxtables/Makefile utils/Makefile
- include/xtables-version.h include/iptables/internal.h
+ include/xtables-version.h
iptables/xtables-monitor.8
utils/nfnl_osf.8
utils/nfbpf_compile.8])
similarity index 81%
rename from include/iptables/internal.h.in
rename to include/iptables/internal.h
@@ -1,8 +1,6 @@
#ifndef IPTABLES_INTERNAL_H
#define IPTABLES_INTERNAL_H 1
-#define IPTABLES_VERSION "@PACKAGE_VERSION@"
-
/**
* Program's own name and version.
*/
@@ -24,7 +24,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
+#include "config.h"
#include <getopt.h>
#include <string.h>
#include <netdb.h>
@@ -121,7 +121,7 @@ static struct option original_opts[] = {
void ip6tables_exit_error(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
struct xtables_globals ip6tables_globals = {
.option_offset = 0,
- .program_version = IPTABLES_VERSION,
+ .program_version = PACKAGE_VERSION,
.orig_opts = original_opts,
.exit_err = ip6tables_exit_error,
.compat_rev = xtables_compatible_revision,
@@ -4,7 +4,7 @@
*
* This code is distributed under the terms of GNU GPL v2
*/
-
+#include "config.h"
#include <getopt.h>
#include <errno.h>
#include <stdbool.h>
@@ -125,7 +125,7 @@ ip46tables_restore_main(struct iptables_restore_cb *cb, int argc, char *argv[])
break;
case 'h':
print_usage(xt_params->program_name,
- IPTABLES_VERSION);
+ PACKAGE_VERSION);
exit(0);
case 'n':
noflush = 1;
@@ -5,6 +5,7 @@
* This code is distributed under the terms of GNU GPL v2
*
*/
+#include "config.h"
#include <getopt.h>
#include <errno.h>
#include <stdio.h>
@@ -90,7 +91,7 @@ static int do_output(struct iptables_save_cb *cb, const char *tablename)
time_t now = time(NULL);
printf("# Generated by %s v%s on %s",
- xt_params->program_name, IPTABLES_VERSION, ctime(&now));
+ xt_params->program_name, PACKAGE_VERSION, ctime(&now));
printf("*%s\n", tablename);
/* Dump out chain names first,
@@ -5,7 +5,7 @@
*
* This code is distributed under the terms of GNU GPL v2
*/
-
+#include "config.h"
#include <getopt.h>
#include <errno.h>
#include <string.h>
@@ -20,7 +20,7 @@
struct xtables_globals iptables_xml_globals = {
.option_offset = 0,
- .program_version = IPTABLES_VERSION,
+ .program_version = PACKAGE_VERSION,
.program_name = "iptables-xml",
};
#define prog_name iptables_xml_globals.program_name
@@ -557,7 +557,7 @@ iptables_xml_main(int argc, char *argv[])
verbose = 1;
break;
case 'h':
- print_usage("iptables-xml", IPTABLES_VERSION);
+ print_usage("iptables-xml", PACKAGE_VERSION);
break;
}
}
@@ -24,7 +24,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
+#include "config.h"
#include <getopt.h>
#include <string.h>
#include <netdb.h>
@@ -120,7 +120,7 @@ void iptables_exit_error(enum xtables_exittype status, const char *msg, ...) __a
struct xtables_globals iptables_globals = {
.option_offset = 0,
- .program_version = IPTABLES_VERSION,
+ .program_version = PACKAGE_VERSION,
.orig_opts = original_opts,
.exit_err = iptables_exit_error,
.compat_rev = xtables_compatible_revision,
@@ -27,7 +27,7 @@
This tool is not luser-proof: you can specify an Ethernet source address
and set hardware length to something different than 6, f.e.
*/
-
+#include "config.h"
#include <getopt.h>
#include <string.h>
#include <netdb.h>
@@ -155,7 +155,7 @@ int RUNTIME_NF_ARP_NUMHOOKS = 3;
extern void xtables_exit_error(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
struct xtables_globals arptables_globals = {
.option_offset = 0,
- .program_version = IPTABLES_VERSION,
+ .program_version = PACKAGE_VERSION,
.orig_opts = original_opts,
.exit_err = xtables_exit_error,
.compat_rev = nft_compatible_revision,
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
+#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
@@ -273,7 +273,7 @@ struct option ebt_original_options[] =
extern void xtables_exit_error(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
struct xtables_globals ebtables_globals = {
.option_offset = 0,
- .program_version = IPTABLES_VERSION,
+ .program_version = PACKAGE_VERSION,
.orig_opts = ebt_original_options,
.exit_err = xtables_exit_error,
.compat_rev = nft_compatible_revision,
@@ -10,6 +10,7 @@
*/
#define _GNU_SOURCE
+#include "config.h"
#include <stdlib.h>
#include <time.h>
#include <string.h>
@@ -631,10 +632,10 @@ int xtables_monitor_main(int argc, char *argv[])
cb_arg.nfproto = NFPROTO_IPV6;
break;
case 'V':
- printf("xtables-monitor %s\n", IPTABLES_VERSION);
+ printf("xtables-monitor %s\n", PACKAGE_VERSION);
exit(0);
default:
- fprintf(stderr, "xtables-monitor %s: Bad argument.\n", IPTABLES_VERSION);
+ fprintf(stderr, "xtables-monitor %s: Bad argument.\n", PACKAGE_VERSION);
fprintf(stderr, "Try `xtables-monitor -h' for more information.\n");
exit(PARAMETER_PROBLEM);
}
@@ -4,7 +4,7 @@
*
* This code is distributed under the terms of GNU GPL v2
*/
-
+#include "config.h"
#include <getopt.h>
#include <errno.h>
#include <stdbool.h>
@@ -362,7 +362,7 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[])
break;
case 'h':
print_usage("xtables-restore",
- IPTABLES_VERSION);
+ PACKAGE_VERSION);
exit(0);
case 'n':
h.noflush = 1;
@@ -6,6 +6,7 @@
* This code is distributed under the terms of GNU GPL v2
*
*/
+#include "config.h"
#include <getopt.h>
#include <errno.h>
#include <stdio.h>
@@ -80,7 +81,7 @@ __do_output(struct nft_handle *h, const char *tablename, bool counters)
time_t now = time(NULL);
printf("# Generated by xtables-save v%s on %s",
- IPTABLES_VERSION, ctime(&now));
+ PACKAGE_VERSION, ctime(&now));
printf("*%s\n", tablename);
/* Dump out chain names first,
@@ -266,7 +267,7 @@ static int __ebt_save(struct nft_handle *h, const char *tablename, bool counters
if (first) {
now = time(NULL);
printf("# Generated by ebtables-save v%s on %s",
- IPTABLES_VERSION, ctime(&now));
+ PACKAGE_VERSION, ctime(&now));
first = false;
}
printf("*%s\n", tablename);
@@ -6,7 +6,7 @@
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
-
+#include "config.h"
#include <time.h>
#include "xtables-multi.h"
#include "nft.h"
@@ -510,20 +510,20 @@ static int xtables_restore_xlate_main(int family, const char *progname,
while ((c = getopt_long(argc, argv, "hf:V", options, NULL)) != -1) {
switch (c) {
case 'h':
- print_usage(argv[0], IPTABLES_VERSION);
+ print_usage(argv[0], PACKAGE_VERSION);
exit(0);
case 'f':
file = optarg;
break;
case 'V':
- printf("%s v%s\n", argv[0], IPTABLES_VERSION);
+ printf("%s v%s\n", argv[0], PACKAGE_VERSION);
exit(0);
}
}
if (file == NULL) {
fprintf(stderr, "ERROR: missing file name\n");
- print_usage(argv[0], IPTABLES_VERSION);
+ print_usage(argv[0], PACKAGE_VERSION);
exit(0);
}
@@ -534,7 +534,7 @@ static int xtables_restore_xlate_main(int family, const char *progname,
}
printf("# Translated by %s v%s on %s",
- argv[0], IPTABLES_VERSION, ctime(&now));
+ argv[0], PACKAGE_VERSION, ctime(&now));
xtables_restore_parse(&h, &p, &cb_xlate, argc, argv);
printf("# Completed on %s", ctime(&now));
@@ -24,7 +24,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
+#include "config.h"
#include <getopt.h>
#include <string.h>
#include <netdb.h>
@@ -104,7 +104,7 @@ void xtables_exit_error(enum xtables_exittype status, const char *msg, ...) __at
struct xtables_globals xtables_globals = {
.option_offset = 0,
- .program_version = IPTABLES_VERSION,
+ .program_version = PACKAGE_VERSION,
.orig_opts = original_opts,
.exit_err = xtables_exit_error,
.compat_rev = nft_compatible_revision,
The IPTABLES_VERSION C macro replicates the PACKAGE_VERSION C macro (both have the same definition, "@PACKAGE_VERSION@"). Since IPTABLES_VERSION, being located in internal.h, is not exposed to downstream users in any way, it can just be replaced by PACKAGE_VERSION, which saves a configure-time file substitution. This goes towards eliminating unnecessary rebuilds after rerunning ./configure. Signed-off-by: Jan Engelhardt <jengelh@inai.de> --- .gitignore | 1 - Makefile.am | 2 +- configure.ac | 2 +- include/iptables/{internal.h.in => internal.h} | 2 -- iptables/ip6tables.c | 4 ++-- iptables/iptables-restore.c | 4 ++-- iptables/iptables-save.c | 3 ++- iptables/iptables-xml.c | 6 +++--- iptables/iptables.c | 4 ++-- iptables/xtables-arp.c | 4 ++-- iptables/xtables-eb.c | 4 ++-- iptables/xtables-monitor.c | 5 +++-- iptables/xtables-restore.c | 4 ++-- iptables/xtables-save.c | 5 +++-- iptables/xtables-translate.c | 10 +++++----- iptables/xtables.c | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) rename include/iptables/{internal.h.in => internal.h} (81%)