diff options
-rw-r--r-- | config.mk | 5 | ||||
-rw-r--r-- | src/Makefile | 1 | ||||
-rw-r--r-- | src/config.mk | 3 | ||||
-rwxr-xr-x | tools/check_header.sh | 12 |
4 files changed, 16 insertions, 5 deletions
@@ -150,11 +150,6 @@ else M4FLAGS += --define=WITH_HSTS=1 endif -# If execinfo.h is not available, e.g. freebsd -ifneq (${WITHOUT_EXECINFO}, 1) -CFLAGS += -DHAS_EXECINFO -endif - CFLAGS_OPTIONS := $(CFLAGS) ifeq (${USEGTK3}, 1) diff --git a/src/Makefile b/src/Makefile index a1a3f287..3c0213c5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,6 +3,7 @@ BASEDIR=.. include $(BASEDIR)/config.mk +include config.mk DEPS=$(patsubst %.o, %.d, $(OBJ)) diff --git a/src/config.mk b/src/config.mk new file mode 100644 index 00000000..bb4706af --- /dev/null +++ b/src/config.mk @@ -0,0 +1,3 @@ +ifeq ($(shell $(BASEDIR)/$(TOOLDIR)/check_header.sh execinfo.h $(CC)), 1) +CFLAGS += -DHAS_EXECINFO +endif diff --git a/tools/check_header.sh b/tools/check_header.sh new file mode 100755 index 00000000..19d7064a --- /dev/null +++ b/tools/check_header.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +HEADER="$1" +CC="${2:-gcc}" + +echo "#include <$HEADER>" | "${CC}" -E - &>/dev/null +if [ $? -eq 0 ]; then + echo 1 +else + echo 0 +fi + |