summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-04-20 09:02:58 +0000
committerRoy Marples <roy@marples.name>2015-04-20 09:02:58 +0000
commit2e522a24bc6c537550aa66ec83a7629c0519ccdc (patch)
tree676b4bc657c1e8bae45f21f416b9b9da863f43de /configure
parent9c69a2af6eebf16264308ef16da04ab5e4207372 (diff)
downloaddhcpcd-2e522a24bc6c537550aa66ec83a7629c0519ccdc.tar.xz
Give up on _BSD_SOURCE and use _GNU_SOURCE for Linux.
This is requires for newer Linux headers as there is no easy way to get at the in6_pktinfo structure, so we have to fallback to the glibc variant which requires _GNU_SOURCE being set. This does have the advantage of no longer sprinkling _GNU_SOURCE around and no longer having to cast ipi.ipi_ifindex but may break compile on older Linux.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure11
1 files changed, 4 insertions, 7 deletions
diff --git a/configure b/configure
index 4ba9382c..b13c2326 100755
--- a/configure
+++ b/configure
@@ -360,23 +360,21 @@ if [ -n "$FORK" -a "$FORK" != yes -a "$FORK" != true ]; then
fi
case "$OS" in
-kfreebsd*)
+freebsd*|kfreebsd*)
echo "CPPFLAGS+= -D_GNU_SOURCE" >>$CONFIG_MK
echo "DHCPCD_SRCS+= if-bsd.c" >>$CONFIG_MK
;;
linux*)
- echo "CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=700" >>$CONFIG_MK
+ echo "CPPFLAGS+= -D_GNU_SOURCE" >>$CONFIG_MK
# Large File Support, should be fine for 32-bit systems.
# But if this is the case, why is it not set by default?
echo "CPPFLAGS+= -D_FILE_OFFSET_BITS=64" >>$CONFIG_MK
echo "CPPFLAGS+= -D_LARGEFILE_SOURCE" >>$CONFIG_MK
echo "CPPFLAGS+= -D_LARGEFILE64_SOURCE" >>$CONFIG_MK
- # glibc-2.20
- echo "CPPFLAGS+= -D_DEFAULT_SOURCE" >>$CONFIG_MK
echo "DHCPCD_SRCS+= if-linux.c" >>$CONFIG_MK
# for RTM_NEWADDR and friends
- echo "#include <asm/types.h> /* fix broken headers */" >>$CONFIG_H
- echo "#include <linux/rtnetlink.h>" >>$CONFIG_H
+ echo "#include <asm/types.h> /* fix broken headers */" >>$CONFIG_H
+ echo "#include <linux/rtnetlink.h>" >>$CONFIG_H
;;
qnx*)
echo "CPPFLAGS+= -D__EXT" >>$CONFIG_MK
@@ -594,7 +592,6 @@ fi
if [ -z "$GETLINE" ]; then
printf "Testing for getline ... "
cat <<EOF >_getline.c
-#define _GNU_SOURCE
#include <stdio.h>
int main(void) {
char *buf = NULL;