@@ -250,6 +250,17 @@ CHECK_C_SOURCE_COMPILES("
HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE
FAIL_REGEX "warning")
+# glibc and kernel uapi headers can co-exist
+CHECK_C_SOURCE_COMPILES("
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <linux/in.h>
+ #include <linux/in6.h>
+ int main(int argc,const char *argv[]) { return 0; }"
+ HAVE_GLIBC_UAPI_COMPAT)
+RDMA_DoFixup("${HAVE_GLIBC_UAPI_COMPAT}" "linux/in.h")
+RDMA_DoFixup("${HAVE_GLIBC_UAPI_COMPAT}" "linux/in6.h")
+
# Provide a shim if C11 stdatomic.h is not supported.
if (NOT HAVE_SPARSE)
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC)
@@ -522,3 +533,6 @@ endif()
if (NOT HAVE_C_WREDUNDANT_DECLS)
message(STATUS " -Wredundant-decls does NOT work")
endif()
+if (NOT HAVE_GLIBC_UAPI_COMPAT)
+ message(STATUS " libc netinet/in.h and linux/in.h do NOT coexist")
+endif()
new file mode 100644
@@ -0,0 +1,2 @@
+/* if in.h can't be included just leave it empty */
+#include <netinet/in.h>
new file mode 100644
@@ -0,0 +1,2 @@
+/* if in6.h can't be included just leave it empty */
+#include <netinet/in.h>