Define UDP_SEGMENT if linux/udp.h has it

This commit is contained in:
Tatsuhiro Tsujikawa 2021-08-22 19:49:55 +09:00
parent 102d960106
commit a619e7a88c
1 changed files with 27 additions and 0 deletions

View File

@ -910,6 +910,31 @@ AC_CHECK_DECLS([initgroups], [], [], [[
#include <grp.h> #include <grp.h>
]]) ]])
have_netinet_udp_h_udp_segment=no
AC_CHECK_DECL([UDP_SEGMENT], [have_netinet_udp_h_udp_segment=yes],
[have_netinet_udp_h_udp_segment=no], [[
#include <netinet/udp.h>
]])
if test "x$have_netinet_udp_h_udp_segment" = "xno"; then
have_linux_udp_h_udp_segment=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#include <linux/udp.h>
]],
[[
#if UDP_SEGMENT != 103
exit(1)
#endif
]])],
[have_linux_udp_h_udp_segment=yes],
[have_linux_udp_h_udp_segment=no])
if test "x$have_linux_udp_h_udp_segment" = "xyes"; then
EXTRA_DEFS="$EXTRA_DEFS -DUDP_SEGMENT=103"
fi
fi
save_CFLAGS=$CFLAGS save_CFLAGS=$CFLAGS
save_CXXFLAGS=$CXXFLAGS save_CXXFLAGS=$CXXFLAGS
@ -1077,6 +1102,8 @@ AC_MSG_NOTICE([summary of build options:
CXX1XCXXFLAGS: ${CXX1XCXXFLAGS} CXX1XCXXFLAGS: ${CXX1XCXXFLAGS}
EXTRACFLAG: ${EXTRACFLAG} EXTRACFLAG: ${EXTRACFLAG}
LIBS: ${LIBS} LIBS: ${LIBS}
DEFS: ${DEFS}
EXTRA_DEFS: ${EXTRA_DEFS}
Library: Library:
Shared: ${enable_shared} Shared: ${enable_shared}
Static: ${enable_static} Static: ${enable_static}