Skip to content

Commit

Permalink
Merge pull request #91 from klemensn/cmake-openbsd
Browse files Browse the repository at this point in the history
CMake: BSD: More feature detection fixes
  • Loading branch information
ofalk authored May 15, 2023
2 parents 0a76170 + 7c0ce0f commit 9f14011
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ if(UNIX)
foreach (header strings.h
unistd.h sys/bufmod.h sys/dlpi.h sys/dlpihdr.h sys/dlpi_ext.h
sys/ioctl.h sys/mib.h sys/ndd_var.h sys/socket.h sys/sockio.h
sys/sysctl.h sys/time.h sys/stat.h net/if.h net/if_var.h
net/if_arp.h net/if_dl.h net/pfilt.h
net/pfvar.h net/radix.h net/raw.h net/route.h netinet/in_var.h
net/if_tun.h linux/if_tun.h netinet/ip_fw.h linux/ip_fw.h
sys/time.h sys/stat.h net/if.h net/if_var.h
net/if_dl.h net/pfilt.h
net/radix.h net/raw.h net/route.h netinet/in_var.h
linux/if_tun.h netinet/ip_fw.h linux/ip_fw.h
linux/ip_fwchains.h linux/netfilter_ipv4/ipchains_core.h
ip_fil_compat.h netinet/ip_fil_compat.h ip_compat.h
netinet/ip_compat.h ip_fil.h netinet/ip_fil.h
Expand All @@ -54,6 +54,10 @@ if(UNIX)
endforeach ()

check_include_files("sys/types.h;net/bpf.h" HAVE_NET_BPF_H)
check_include_files("sys/types.h;net/if_arp.h" HAVE_NET_IF_ARP_H)
check_include_files("sys/types.h;net/if_tun.h" HAVE_NET_IF_TUN_H)
check_include_files("sys/types.h;net/if.h;net/pfvar.h" HAVE_NET_PFVAR_H)
check_include_files("sys/types.h;sys/sysctl.h" HAVE_SYS_SYSCTL_H)
endif()

set(CMAKE_REQUIRED_LIBRARIES )
Expand All @@ -69,7 +73,7 @@ if (UNIX)

CHECK_STRUCT_HAS_MEMBER("struct arpreq" arp_dev net/if_arp.h HAVE_ARPREQ_ARP_DEV LANGUAGE C)
CHECK_STRUCT_HAS_MEMBER("struct sockaddr" sa_len sys/socket.h HAVE_SOCKADDR_SA_LEN LANGUAGE C)
check_symbol_exists(rt_msghdr net/route.h HAVE_ROUTE_RT_MSGHDR)
CHECK_STRUCT_HAS_MEMBER("struct rt_msghdr" rtm_msglen "sys/socket.h;net/if.h;net/route.h" HAVE_ROUTE_RT_MSGHDR LANGUAGE C)

set(CMAKE_EXTRA_INCLUDE_FILES "netinet/in.h")
check_type_size("struct sockaddr_in6" HAVE_SOCKADDR_IN6 LANGUAGE C)
Expand Down
3 changes: 0 additions & 3 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
/* Define if arpreq struct has arp_dev. */
#cmakedefine HAVE_ARPREQ_ARP_DEV

/* Define if you have the Berkeley Packet Filter. */
#cmakedefine HAVE_BSD_BPF

/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H

Expand Down

0 comments on commit 9f14011

Please sign in to comment.