unbound: fix build on non-linux systems
authorFelix Fietkau <nbd@nbd.name>
Wed, 16 Jun 2021 10:58:31 +0000 (12:58 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 16 Jun 2021 10:59:00 +0000 (12:59 +0200)
Override places that call uname to detect target features

Signed-off-by: Felix Fietkau <nbd@nbd.name>
net/unbound/Makefile
net/unbound/patches/010-configure_uname.patch [new file with mode: 0644]

index dad282c534c793112a66564b1f2c7e7cf24cfe35..cb77acbc2d9faf2e99fddd6d9b6bd1d35c7ab91b 100644 (file)
@@ -158,6 +158,8 @@ define Package/libunbound/config
        endif
 endef
 
+CONFIGURE_VARS += UNAME=Linux
+
 CONFIGURE_ARGS += \
        --disable-dsa \
        --disable-gost \
diff --git a/net/unbound/patches/010-configure_uname.patch b/net/unbound/patches/010-configure_uname.patch
new file mode 100644 (file)
index 0000000..315d0f7
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -765,7 +765,7 @@ if test x_$ub_test_python != x_no; then
+    fi
+ fi
+-if test "`uname`" = "NetBSD"; then
++if test "${UNAME:-`uname`}" = "NetBSD"; then
+       NETBSD_LINTFLAGS='"-D__RENAME(x)=" -D_NETINET_IN_H_'
+       AC_SUBST(NETBSD_LINTFLAGS)
+ fi
+@@ -1210,7 +1210,7 @@ esac
+ AC_ARG_ENABLE(tfo-client, AS_HELP_STRING([--enable-tfo-client],[Enable TCP Fast Open for client mode]))
+ case "$enable_tfo_client" in
+       yes)
+-              case `uname` in
++              case ${UNAME:-`uname`} in
+                       Linux) AC_CHECK_DECL([MSG_FASTOPEN], [AC_MSG_WARN([Check the platform specific TFO kernel parameters are correctly configured to support client mode TFO])],
+                                            [AC_MSG_ERROR([TCP Fast Open is not available for client mode: please rerun without --enable-tfo-client])], 
+                                            [AC_INCLUDES_DEFAULT