aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-09-26 12:23:36 +0200
committerTobias Brunner <tobias@strongswan.org>2017-10-02 17:21:42 +0200
commit0ae19f0ced8d64bb6996a8ae01406cebacff04a1 (patch)
treec49a71a1b8cc792445798f774d6f4322aaf4ffd0 /src
parent7dd29ab4ed5f1a233b3c63f1f3504434aef4997f (diff)
downloadstrongswan-0ae19f0ced8d64bb6996a8ae01406cebacff04a1.tar.bz2
strongswan-0ae19f0ced8d64bb6996a8ae01406cebacff04a1.tar.xz
configure: Fix gperf length parameter determination
gperf is not actually a build dependency as the generated files are shipped in the tarball. So the type depends on the gperf version on the host that ran gperf and created the tarball, which might not be the same as that on the actual build host, and gperf might not even be installed there, leaving the type undetermined. Fixes: e0e43229736a ("configure: Detect type of length parameter for gperf generated function")
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/.gitignore2
-rw-r--r--src/libstrongswan/Makefile.am9
-rw-r--r--src/libstrongswan/crypto/proposal/proposal_keywords_static.h.in (renamed from src/libstrongswan/crypto/proposal/proposal_keywords_static.h)2
-rw-r--r--src/starter/.gitignore1
-rw-r--r--src/starter/Makefile.am12
-rw-r--r--src/starter/confread.c5
-rw-r--r--src/starter/keywords.h.in (renamed from src/starter/keywords.h)4
-rw-r--r--src/starter/keywords.txt1
-rw-r--r--src/stroke/.gitignore1
-rw-r--r--src/stroke/Makefile.am12
-rw-r--r--src/stroke/stroke_keywords.h.in (renamed from src/stroke/stroke_keywords.h)3
11 files changed, 38 insertions, 14 deletions
diff --git a/src/libstrongswan/.gitignore b/src/libstrongswan/.gitignore
index 46b69ab15..1f2695f77 100644
--- a/src/libstrongswan/.gitignore
+++ b/src/libstrongswan/.gitignore
@@ -1,2 +1,2 @@
oid.[ch]
-proposal_keywords_static.c
+proposal_keywords_static.[ch]
diff --git a/src/libstrongswan/Makefile.am b/src/libstrongswan/Makefile.am
index b4d8452f1..75b1d14ac 100644
--- a/src/libstrongswan/Makefile.am
+++ b/src/libstrongswan/Makefile.am
@@ -195,16 +195,19 @@ endif
EXTRA_DIST = \
asn1/oid.txt asn1/oid.pl \
crypto/proposal/proposal_keywords_static.txt \
+crypto/proposal/proposal_keywords_static.h.in \
plugins/plugin_constructors.py \
Android.mk
BUILT_SOURCES = \
$(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
+$(srcdir)/crypto/proposal/proposal_keywords_static.h \
$(srcdir)/crypto/proposal/proposal_keywords_static.c \
settings/settings_parser.h
MAINTAINERCLEANFILES = \
$(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
+$(srcdir)/crypto/proposal/proposal_keywords_static.h \
$(srcdir)/crypto/proposal/proposal_keywords_static.c
$(srcdir)/asn1/oid.c : $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
@@ -215,6 +218,12 @@ $(srcdir)/asn1/oid.h : $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
$(AM_V_GEN) \
(cd $(srcdir)/asn1/ && $(PERL) oid.pl)
+$(srcdir)/crypto/proposal/proposal_keywords_static.h: $(srcdir)/crypto/proposal/proposal_keywords_static.h.in
+ $(AM_V_GEN) \
+ sed \
+ -e "s:\@GPERF_LEN_TYPE\@:$(GPERF_LEN_TYPE):" \
+ $< > $@
+
$(srcdir)/crypto/proposal/proposal_keywords_static.c: $(srcdir)/crypto/proposal/proposal_keywords_static.txt \
$(srcdir)/crypto/proposal/proposal_keywords_static.h
$(AM_V_GEN) \
diff --git a/src/libstrongswan/crypto/proposal/proposal_keywords_static.h b/src/libstrongswan/crypto/proposal/proposal_keywords_static.h.in
index c046fab92..ee9f7b9da 100644
--- a/src/libstrongswan/crypto/proposal/proposal_keywords_static.h
+++ b/src/libstrongswan/crypto/proposal/proposal_keywords_static.h.in
@@ -19,7 +19,7 @@
#include "proposal_keywords.h"
const proposal_token_t* proposal_get_token_static(register const char *str,
- register GPERF_LEN_TYPE len);
+ register @GPERF_LEN_TYPE@ len);
#endif /* PROPOSAL_KEYWORDS_STATIC_H_ */
diff --git a/src/starter/.gitignore b/src/starter/.gitignore
index a370ee554..23142d9e8 100644
--- a/src/starter/.gitignore
+++ b/src/starter/.gitignore
@@ -1,4 +1,5 @@
starter
+keywords.[ch]
parser/lexer.c
parser/parser.[ch]
parser/parser.output \ No newline at end of file
diff --git a/src/starter/Makefile.am b/src/starter/Makefile.am
index a3c58126e..c806e37e1 100644
--- a/src/starter/Makefile.am
+++ b/src/starter/Makefile.am
@@ -39,14 +39,20 @@ starter_LDADD = \
libstarter.la \
$(SOCKLIB) $(PTHREADLIB) $(ATOMICLIB)
-EXTRA_DIST = keywords.txt ipsec.conf ipsec.secrets Android.mk
-MAINTAINERCLEANFILES = keywords.c
-BUILT_SOURCES = keywords.c parser/parser.h
+EXTRA_DIST = keywords.h keywords.txt ipsec.conf ipsec.secrets Android.mk
+MAINTAINERCLEANFILES = keywords.h keywords.c
+BUILT_SOURCES = keywords.h keywords.c parser/parser.h
if USE_LOAD_WARNING
AM_CPPFLAGS += -DLOAD_WARNING
endif
+keywords.h: $(srcdir)/keywords.h.in
+ $(AM_V_GEN) \
+ sed \
+ -e "s:\@GPERF_LEN_TYPE\@:$(GPERF_LEN_TYPE):" \
+ $< > $@
+
keywords.c: $(srcdir)/keywords.txt $(srcdir)/keywords.h
$(AM_V_GEN) \
$(GPERF) -m 10 -C -G -D -t < $(srcdir)/keywords.txt > $@
diff --git a/src/starter/confread.c b/src/starter/confread.c
index e78f2a70b..b3e942fac 100644
--- a/src/starter/confread.c
+++ b/src/starter/confread.c
@@ -46,11 +46,6 @@ static const char esp_defaults[] = "aes128-sha256";
static const char firewall_defaults[] = IPSEC_SCRIPT " _updown iptables";
/**
- * Provided by GPERF
- */
-extern const kw_entry_t *in_word_set(register const char*, register GPERF_LEN_TYPE);
-
-/**
* Process deprecated keywords
*/
static bool is_deprecated(kw_token_t token, char *name, char *conn)
diff --git a/src/starter/keywords.h b/src/starter/keywords.h.in
index 0cb46a740..d2b08f2cf 100644
--- a/src/starter/keywords.h
+++ b/src/starter/keywords.h.in
@@ -196,4 +196,8 @@ struct kw_entry_t {
kw_token_t token;
};
+#ifndef IN_GPERF_GENERATED_FILE
+const kw_entry_t *in_word_set(register const char*, register @GPERF_LEN_TYPE@);
+#endif
+
#endif /* _KEYWORDS_H_ */
diff --git a/src/starter/keywords.txt b/src/starter/keywords.txt
index 3f92dc83f..dd673bc7a 100644
--- a/src/starter/keywords.txt
+++ b/src/starter/keywords.txt
@@ -16,6 +16,7 @@
#include <string.h>
+#define IN_GPERF_GENERATED_FILE
#include "keywords.h"
%}
diff --git a/src/stroke/.gitignore b/src/stroke/.gitignore
index 26c37a4a8..b6bf920c3 100644
--- a/src/stroke/.gitignore
+++ b/src/stroke/.gitignore
@@ -1 +1,2 @@
stroke
+stroke_keywords.[ch]
diff --git a/src/stroke/Makefile.am b/src/stroke/Makefile.am
index ed170bd08..e55e2030f 100644
--- a/src/stroke/Makefile.am
+++ b/src/stroke/Makefile.am
@@ -4,13 +4,19 @@ stroke_SOURCES = \
stroke.c stroke_msg.h stroke_keywords.c stroke_keywords.h
stroke_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la $(SOCKLIB)
-EXTRA_DIST = stroke_keywords.txt Android.mk
-BUILT_SOURCES = stroke_keywords.c
-MAINTAINERCLEANFILES = stroke_keywords.c
+EXTRA_DIST = stroke_keywords.h.in stroke_keywords.txt Android.mk
+BUILT_SOURCES = stroke_keywords.h stroke_keywords.c
+MAINTAINERCLEANFILES = stroke_keywords.h stroke_keywords.c
AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
-DIPSEC_PIDDIR=\"${piddir}\"
+stroke_keywords.h: $(srcdir)/stroke_keywords.h.in
+ $(AM_V_GEN) \
+ sed \
+ -e "s:\@GPERF_LEN_TYPE\@:$(GPERF_LEN_TYPE):" \
+ $< > $@
+
stroke_keywords.c: $(srcdir)/stroke_keywords.txt $(srcdir)/stroke_keywords.h
$(AM_V_GEN) \
$(GPERF) -m 10 -D -C -G -t < $(srcdir)/stroke_keywords.txt > $@
diff --git a/src/stroke/stroke_keywords.h b/src/stroke/stroke_keywords.h.in
index 51caba68b..2b5780adc 100644
--- a/src/stroke/stroke_keywords.h
+++ b/src/stroke/stroke_keywords.h.in
@@ -73,6 +73,7 @@ typedef enum {
typedef struct stroke_token stroke_token_t;
-extern const stroke_token_t* in_word_set(register const char *str, register GPERF_LEN_TYPE len);
+extern const stroke_token_t* in_word_set(register const char *str,
+ register @GPERF_LEN_TYPE@ len);
#endif /* _STROKE_KEYWORDS_H_ */