Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unbound: does not compile on macOS 11.1-x86_64 host #413

Closed
EricLuehrsen opened this issue Jan 30, 2021 · 2 comments
Closed

unbound: does not compile on macOS 11.1-x86_64 host #413

EricLuehrsen opened this issue Jan 30, 2021 · 2 comments
Assignees

Comments

@EricLuehrsen
Copy link

EricLuehrsen commented Jan 30, 2021

Copy from OpenWrt issues, openwrt/packages#14573 as reported by @k-ronny

Description: cross compiling of unbound on a macOS 11.1-x86_64 host is failing in the configure phase:

checking whether CONNECT_RESUME_ON_READ_WRITE is declared... no
configure: error: TCP Fast Open is not available for client mode: please rerun without --enable-tfo-client

with this patch it compiles on macOS and Debian Buster:

--- a/configure.ac	2020-12-03 09:31:18.000000000 +0100
+++ b/configure.ac	2021-01-26 01:16:58.000000000 +0100
@@ -120,6 +120,9 @@
 AC_SUBST(LIBUNBOUND_REVISION)
 AC_SUBST(LIBUNBOUND_AGE)
 
+# AC_CANONICAL_HOST is needed to access the 'host_os' variable
+AC_CANONICAL_HOST
+
 
 cmdln="`echo $@ | sed -e 's/\\\\/\\\\\\\\/g' | sed -e 's/"/\\\\"/'g`"
 AC_DEFINE_UNQUOTED(CONFCMDLINE, ["$cmdln"], [Command line arguments used with configure])
@@ -1226,15 +1229,15 @@
 AC_ARG_ENABLE(tfo-client, AC_HELP_STRING([--enable-tfo-client], [Enable TCP Fast Open for client mode]))
 case "$enable_tfo_client" in
 	yes)
-		case `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])],
+		case "${host_os}" 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 
 #include <netinet/tcp.h>
 ])
 					AC_DEFINE_UNQUOTED([USE_MSG_FASTOPEN], [1], [Define this to enable client TCP Fast Open.])
 			  ;;
-			Darwin) AC_CHECK_DECL([CONNECT_RESUME_ON_READ_WRITE], [AC_MSG_WARN([Check the platform specific TFO kernel parameters are correctly configured to support client mode TFO])], 
+			darwin*) AC_CHECK_DECL([CONNECT_RESUME_ON_READ_WRITE], [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
 #include <sys/socket.h>
@EricLuehrsen
Copy link
Author

@wcawijngaards could you comment on this as a potential build env fix?

@gthess gthess self-assigned this Jun 9, 2021
@gthess gthess closed this as completed in ad939e5 Jun 9, 2021
@gthess
Copy link
Member

gthess commented Jun 9, 2021

Thanks for this @EricLuehrsen and @k-ronny!
Didn't include AC_CANONICAL_HOST as this is already used by the acx_nlnetlabs.m4 file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants