From e843d29eec50dfcad948859b545eaf529731d28e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 20 Oct 2017 14:24:33 +0200 Subject: build: check for fopencookie() in configure fopencookie(3) is a non-standard GNU extension and some libc implementations might not provide it (e.g. musl). Check for fopencookie in the configure script and disable building curvetun in case the function is not available, as curvetun is the only tool using fopencookie. Fixes #174 Signed-off-by: Tobias Klauser --- configure | 51 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/configure b/configure index e2b62fe..d5fe7e6 100755 --- a/configure +++ b/configure @@ -388,6 +388,31 @@ EOF fi } +check_fopencookie() +{ + echo -n "[*] Checking fopencookie ... " + + cat > $TMPDIR/fopencookietest.c << EOF +#define _GNU_SOURCE +#include + +static cookie_io_functions_t cookie_fns; + +int main(void) +{ + FILE *f = fopencookie(NULL, "w", cookie_fns); +} +EOF + + $CC -o $TMPDIR/fopencookietest $TMPDIR/fopencookietest.c >> config.log 2>&1 + if [ ! -x $TMPDIR/fopencookietest ] ; then + echo "[NO]" + MISSING_DEFS=1 + tools_remove "curvetun" + else + echo "[YES]" + fi +} check_ncurses() { @@ -766,22 +791,30 @@ if [ "$MISSING_TOOLCHAIN" == "1" ] ; then exit 1 fi +# external tools check_flex check_bison -check_nacl -check_libnl -check_libnl_route + +# kernel features check_tpacket_v2 check_tpacket_v3 -check_libnf_ct -check_ncurses -check_libgeoip -check_zlib -check_urcu -check_libpcap check_hwtstamp + +# libc features +check_fopencookie + +# libraries check_libcli +check_libgeoip check_libnet +check_libnf_ct +check_libnl +check_libnl_route +check_libpcap +check_nacl +check_ncurses +check_urcu +check_zlib gen_config_hdr gen_version_appendix -- cgit v1.2.3-54-g00ecf