[vlc-devel] [PATCH] configure: detect net/if.h correctly on OS X

Sean McGovern gseanmcg at gmail.com
Wed Sep 3 02:05:05 CEST 2014


---
This is taken verbatim from https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Header-Portability.html#Header-Portability and fixes the build on OS X after 5033a46344d0b70af043189841bc4cc575903d3b
---
 configure.ac | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 2787391..c82fa86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -754,7 +754,21 @@ AC_SUBST(LIBPTHREAD)
 
 dnl Check for headers
 dnl  POSIX
-AC_CHECK_HEADERS([arpa/inet.h net/if.h pthread.h search.h syslog.h sys/shm.h])
+AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h syslog.h sys/shm.h sys/socket.h])
+AC_CHECK_HEADERS([net/if.h], [], [],
+[#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
 dnl  BSD
 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
 dnl  GNU/Linux
-- 
1.8.5.2 (Apple Git-48)




More information about the vlc-devel mailing list