Unconditionally define _GNU_SOURCE

Get rid of the fragile glibc auto-detection mechanism and define
_GNU_SOURCE unconditionally in order to fix the build on recent GNU libc
systems such as Debian and Ubuntu.  On non-GNU libc implementations,
_GNU_SOURCE should not have any effect.

Issue:          #2
Reported by:    Vincent Bernat
pull/13/head
Daniel Roethlisberger 12 years ago
parent 3742404fe9
commit e270fb127b

@ -63,11 +63,6 @@ ifneq ($(wildcard /usr/include/linux/netfilter.h),)
FEATURES+= -DHAVE_NETFILTER
endif
# Autodetect glibc
ifneq ($(wildcard /usr/include/gnu/libc-version.h),)
CPPFLAGS+= -D_GNU_SOURCE
endif
### Variables you might need to override
@ -129,9 +124,10 @@ BUILD_DATE:= $(shell date +%Y-%m-%d)
CFLAGS+= $(PKG_CFLAGS) -pthread \
-std=c99 -Wall -Wextra -pedantic -D_FORTIFY_SOURCE=2
CPPFLAGS+= $(PKG_CPPFLAGS) $(FEATURES) -D"BNAME=\"$(TARGET)\"" \
-D"PNAME=\"$(PNAME)\"" -D"VERSION=\"$(VERSION)\"" \
-D"FEATURES=\"$(FEATURES)\"" -D"BUILD_DATE=\"$(BUILD_DATE)\""
CPPFLAGS+= -D_GNU_SOURCE $(PKG_CPPFLAGS) $(FEATURES) \
-D"BNAME=\"$(TARGET)\"" -D"PNAME=\"$(PNAME)\"" \
-D"VERSION=\"$(VERSION)\"" -D"BUILD_DATE=\"$(BUILD_DATE)\"" \
-D"FEATURES=\"$(FEATURES)\""
LDFLAGS+= $(PKG_LDFLAGS) -pthread
LIBS+= $(PKG_LIBS)

Loading…
Cancel
Save