build: separate AC variable replacements from xtables.h

It was/is a bit annoying that modifying xtables.h.in causes configure
to rerun. Split the @foo@ things into a separate file to bypass this.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
diff --git a/.gitignore b/.gitignore
index b7c3dfb..fa86c48 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,7 +9,7 @@
 Makefile
 Makefile.in
 
-/include/xtables.h
+/include/xtables-version.h
 /include/iptables/internal.h
 
 /aclocal.m4
diff --git a/Makefile.am b/Makefile.am
index 4eb63eb..6400ba4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,4 +27,4 @@
 	rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};
 
 config.status: extensions/GNUmakefile.in \
-	include/xtables.h.in include/iptables/internal.h.in
+	include/xtables-version.h.in include/iptables/internal.h.in
diff --git a/configure.ac b/configure.ac
index 861f5b3..4060f90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,5 +127,5 @@
 	libiptc/Makefile libiptc/libiptc.pc
 	libiptc/libip4tc.pc libiptc/libip6tc.pc
 	libxtables/Makefile utils/Makefile
-	include/xtables.h include/iptables/internal.h])
+	include/xtables-version.h include/iptables/internal.h])
 AC_OUTPUT
diff --git a/include/Makefile.am b/include/Makefile.am
index 6f7da59..e695120 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,7 +1,7 @@
 # -*- Makefile -*-
 
 include_HEADERS =
-nobase_include_HEADERS = xtables.h
+nobase_include_HEADERS = xtables.h xtables-version.h
 
 if ENABLE_LIBIPQ
 include_HEADERS += libipq/libipq.h
diff --git a/include/xtables-version.h.in b/include/xtables-version.h.in
new file mode 100644
index 0000000..cb13827
--- /dev/null
+++ b/include/xtables-version.h.in
@@ -0,0 +1,2 @@
+#define XTABLES_VERSION "libxtables.so.@libxtables_vmajor@"
+#define XTABLES_VERSION_CODE @libxtables_vmajor@
diff --git a/include/xtables.h.in b/include/xtables.h
similarity index 98%
rename from include/xtables.h.in
rename to include/xtables.h
index db69c03..3b15e67 100644
--- a/include/xtables.h.in
+++ b/include/xtables.h
@@ -31,8 +31,7 @@
 #define IPPROTO_UDPLITE	136
 #endif
 
-#define XTABLES_VERSION "libxtables.so.@libxtables_vmajor@"
-#define XTABLES_VERSION_CODE @libxtables_vmajor@
+#include <xtables-version.h>
 
 struct in_addr;