diff --git a/CMakeLists.txt b/CMakeLists.txt index 628812d5..4c50cc56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -269,6 +269,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "GNU") src/unix/hurd.c) endif() +if(CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD") + list(APPEND uv_defines _GNU_SOURCE) + list(APPEND uv_libraries dl freebsd-glue) +endif() + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") list(APPEND uv_defines _GNU_SOURCE _POSIX_C_SOURCE=200112) list(APPEND uv_libraries dl rt) diff --git a/Makefile.am b/Makefile.am index 895dba51..32fccede 100644 --- a/Makefile.am +++ b/Makefile.am @@ -464,6 +464,10 @@ libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \ src/unix/hurd.c endif +if KFREEBSD +libuv_la_CFLAGS += -D_GNU_SOURCE +endif + if LINUX uvinclude_HEADERS += include/uv/linux.h libuv_la_CFLAGS += -D_GNU_SOURCE diff --git a/configure.ac b/configure.ac index 1c2a026a..a9012d40 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,7 @@ AM_CONDITIONAL([CYGWIN], [AS_CASE([$host_os],[cygwin*], [true], [false]) AM_CONDITIONAL([DARWIN], [AS_CASE([$host_os],[darwin*], [true], [false])]) AM_CONDITIONAL([DRAGONFLY],[AS_CASE([$host_os],[dragonfly*], [true], [false])]) AM_CONDITIONAL([FREEBSD], [AS_CASE([$host_os],[*freebsd*], [true], [false])]) +AM_CONDITIONAL([KFREEBSD], [AS_CASE([$host_os],[kfreebsd*], [true], [false])]) AM_CONDITIONAL([HAIKU], [AS_CASE([$host_os],[haiku], [true], [false])]) AM_CONDITIONAL([HURD], [AS_CASE([$host_os],[gnu*], [true], [false])]) AM_CONDITIONAL([LINUX], [AS_CASE([$host_os],[linux*], [true], [false])])