From bf7b4611c4c4152e484c4ce4e909483f6950cbe5 Mon Sep 17 00:00:00 2001 From: papadave Date: Tue, 9 Jan 2018 12:02:53 +0800 Subject: [PATCH] Move '-D_GNU_SOURCE' to 'configure' --- Makefile | 2 +- configure | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fe5f8c6..87e0937 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/configure b/configure index ea7fe2c..0ec6e91 100755 --- a/configure +++ b/configure @@ -142,6 +142,9 @@ if [ -z "$CC" ] ; then CC=cc fi +check_compile "whether fine to define _GNU_SOURCE" "-D_GNU_SOURCE" \ +'#include \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 " && break done