Skip to content

Commit

Permalink
configure: net/route.h needs sys/socket.h on FreeBSD
Browse files Browse the repository at this point in the history
FreeBSD fixes
- net/route.h needs sys/socket.h (struct sockaddr)
- netinet/ip_mroute.h needs sys/types.h (u_long et consortes)

Fixes part of smcroute issue #5

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
  • Loading branch information
troglobit committed Sep 21, 2014
1 parent 6c64c7c commit d95c58b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 13 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3564,11 +3564,16 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
fi
for ac_header in arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
sys/ioctl.h sys/socket.h syslog.h unistd.h \
sys/ioctl.h sys/socket.h sys/types.h syslog.h unistd.h \
net/route.h sys/param.h ifaddrs.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
Expand Down Expand Up @@ -3639,6 +3644,12 @@ done
for ac_header in netinet/ip_mroute.h
do :
ac_fn_c_check_header_compile "$LINENO" "netinet/ip_mroute.h" "ac_cv_header_netinet_ip_mroute_h" "
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
Expand Down
15 changes: 13 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ AC_GNU_SOURCE
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
sys/ioctl.h sys/socket.h syslog.h unistd.h \
net/route.h sys/param.h ifaddrs.h])
sys/ioctl.h sys/socket.h sys/types.h syslog.h unistd.h \
net/route.h sys/param.h ifaddrs.h], [], [],
[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])

AC_CHECK_HEADERS([linux/mroute.h], [], [],
[
Expand Down Expand Up @@ -45,6 +50,12 @@ AC_CHECK_HEADERS([linux/sockios.h])

AC_CHECK_HEADERS([netinet/ip_mroute.h], [], [],
[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
Expand Down

0 comments on commit d95c58b

Please sign in to comment.