diff --git a/CMakeLists.txt b/CMakeLists.txt index 800b4a14d7..31f6f1b1e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,7 +268,7 @@ endif() include(PickyWarnings) -if(CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux") +if(CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "GNU") set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "_GNU_SOURCE") # Required for accept4(), pipe2(), sendmmsg() list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") # Apply to all feature checks endif() diff --git a/configure.ac b/configure.ac index bce4bf69e7..1d4746c8c4 100644 --- a/configure.ac +++ b/configure.ac @@ -574,7 +574,7 @@ AM_CONDITIONAL(BUILD_UNITTESTS, test x$supports_unittests = xyes) # In order to detect support of sendmmsg() and accept4(), we need to escape the POSIX # jail by defining _GNU_SOURCE or will not expose it. case $host_os in - *linux*|cygwin*|msys*) + *linux*|cygwin*|msys*|gnu*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ;; esac