aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-05-01 16:23:55 +0200
committerTobias Brunner <tobias@strongswan.org>2017-05-23 18:29:12 +0200
commit05eeffb2f2f42f3f66a1b9f3c128768af756fac2 (patch)
treebac69d0e2305f2231e4d939a95a1227f1bebee55
parent4a0b6d659d2fb0473b75cf53bb1a0934983d270c (diff)
downloadstrongswan-05eeffb2f2f42f3f66a1b9f3c128768af756fac2.tar.bz2
strongswan-05eeffb2f2f42f3f66a1b9f3c128768af756fac2.tar.xz
fuzz: Change how fuzz_certs is built
We mainly do this because we have to create a self-contained executable and it isn't so easy to actually get libtool to link e.g. libgmp statically.
-rw-r--r--fuzz/Makefile.am16
1 files changed, 11 insertions, 5 deletions
diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am
index a2c225ff3..66debc226 100644
--- a/fuzz/Makefile.am
+++ b/fuzz/Makefile.am
@@ -1,12 +1,18 @@
-AM_CPPFLAGS = \
+CPPFLAGS = @CPPFLAGS@ \
-I$(top_srcdir)/src/libstrongswan \
-DPLUGINDIR=\""$(abs_top_builddir)/src/libstrongswan/plugins\"" \
-DPLUGINS="\"${fuzz_plugins}\""
-noinst_PROGRAMS = fuzz_certs
+LDFLAGS = @LDFLAGS@ ${libfuzzer} \
+ $(top_builddir)/src/libstrongswan/.libs/libstrongswan.a \
+ -Wl,-Bstatic -lgmp -Wl,-Bdynamic \
+ -stdlib=libc++ -lstdc++
-fuzz_certs_SOURCES = fuzz_certs.c
+FUZZ_TARGETS=fuzz_certs
-fuzz_certs_LDFLAGS = ${libfuzzer} -lstdc++
+all-local: $(FUZZ_TARGETS)
-fuzz_certs_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
+CLEANFILES=$(FUZZ_TARGETS)
+
+fuzz_certs: fuzz_certs.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS)