Move '-D_GNU_SOURCE' to 'configure'

pull/212/head
papadave 2018-01-09 12:02:53 +08:00
parent 881ccee066
commit bf7b4611c4
2 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,7 @@ LOBJS = src/nameinfo.o src/version.o \
GENH = src/version.h
CFLAGS += -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe
CFLAGS += -Wall -O0 -g -std=c99 -pipe
NO_AS_NEEDED = -Wl,--no-as-needed
LIBDL = -ldl
LDFLAGS = -fPIC $(NO_AS_NEEDED) $(LIBDL) -lpthread

3
configure vendored
View File

@ -142,6 +142,9 @@ if [ -z "$CC" ] ; then
CC=cc
fi
check_compile "whether fine to define _GNU_SOURCE" "-D_GNU_SOURCE" \
'#include <unistd.h>\nint main() { return 0; }'
for i in 700 600; do
check_compile "whether _XOPEN_SOURCE=$i is suitable for C99 mode" "-D_XOPEN_SOURCE=$i" "#include <unistd.h>" && break
done