aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-06-27 18:07:41 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-07-01 12:14:13 +0200
commit08ca425bc2b7180616d4806ad6710761844bcf7b (patch)
treeb47ffed41a7b351fd3bbfe9764f29c97735b9857
parent1eeb113c34608afa258c0f1a008e1874dc4426fd (diff)
configure.ac: some versions of linux/if.h require including sys/socket.h
-rw-r--r--configure.ac8
1 files changed, 6 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 5581c32..7b985b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,8 +74,12 @@ AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
-# Check for if header
-AC_CHECK_HEADERS([linux/if.h net/if.h])
+# Check for if header. Some versions of linux/if.h fail without sys/socket.h included beforehand:
+# see https://algorithmicallyrandom.blogspot.com/2012/07/error-on-including-include.html
+AC_CHECK_HEADERS([linux/if.h net/if.h], [], [], [#ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ # endif
+ ])
# Check for tun header
AC_CHECK_HEADERS([linux/if_tun.h net/if_tun.h])