summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-08-04 20:42:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-08-04 20:42:45 -0700
commit75c6845ef1fc840afe995a84f3cd1c94f5257d7d (patch)
tree031fe9d75394737620dc678cd7ba0878ccee2fb2 /configure
parent70a9ef01f022982241f80fe1eac19930aa597507 (diff)
downloadtxr-75c6845ef1fc840afe995a84f3cd1c94f5257d7d.tar.gz
txr-75c6845ef1fc840afe995a84f3cd1c94f5257d7d.tar.bz2
txr-75c6845ef1fc840afe995a84f3cd1c94f5257d7d.zip
musl: fix missing <sys/time.h>.
Issue peported by Ethan Hawk. Our socket.c module is using struct timeval without including <sys/time.h>, which breaks on musl. * configure: in the select test, let's include <sys/time.h>, and if the test passes, let's set have_sys_time, so that HAVE_SELECT implies HAVE_SYS_TIME. This way code wrapped with HAVE_SELECT doesn't separately have to test for HAVE_SYS_TIME. * socket.c: If HAVE_SYS_TIME is true, then we include <sys/time.h>, independently of HAVE_SELECT. (sock_timeout, sock_load_init): Like the select-based code, code using SO_SNDTIMEO or SO_RCVTIMO also uses timeval, so needs to be wrapped with HAVE_SYS_TIME.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure2
1 files changed, 2 insertions, 0 deletions
diff --git a/configure b/configure
index ead8bccc..63f1ec5c 100755
--- a/configure
+++ b/configure
@@ -3480,6 +3480,7 @@ if [ $have_sockets ] ; then
cat > conftest.c <<!
#include <sys/select.h>
+#include <sys/time.h>
int main(int argc, char **argv)
{
@@ -3494,6 +3495,7 @@ int main(int argc, char **argv)
if conftest; then
printf "yes\n"
printf "#define HAVE_SELECT 1\n" >> config.h
+ have_sys_time=y
else
printf "no\n"
fi