BUILD: fix kFreeBSD build.
kFreeBSD needs to be treated as a distinct target from FreeBSD
since the underlying system libc is the GNU one. Thus, relying
only on __GLIBC__ no longer suffice.
- freebsd-glibc new target, key difference is including crypt.h
and linking to libdl like linux.
- cpu affinity available but the api is still the FreeBSD's.
- enabling auxiliary data access only for Linux.
Patch based on preliminary work done by @bigon.
closes #1555
diff --git a/Makefile b/Makefile
index 964b7fb..46da6fb 100644
--- a/Makefile
+++ b/Makefile
@@ -177,8 +177,8 @@
#### TARGET system
# Use TARGET=<target_name> to optimize for a specific target OS among the
# following list (use the default "generic" if uncertain) :
-# linux-glibc, linux-glibc-legacy, linux-musl, solaris, freebsd, dragonfly,
-# openbsd, netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic,
+# linux-glibc, linux-glibc-legacy, linux-musl, solaris, freebsd, freebsd-glibc,
+# dragonfly, openbsd, netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic,
# custom
TARGET =
@@ -412,6 +412,13 @@
USE_ACCEPT4 USE_CLOSEFROM USE_GETADDRINFO USE_PROCCTL)
endif
+# kFreeBSD glibc
+ifeq ($(TARGET),freebsd-glibc)
+ set_target_defaults = $(call default_opts, \
+ USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_CPU_AFFINITY USE_KQUEUE \
+ USE_ACCEPT4 USE_GETADDRINFO USE_CRYPT_H USE_DL)
+endif
+
# DragonFlyBSD 4.3 and above
ifeq ($(TARGET),dragonfly)
set_target_defaults = $(call default_opts, \