From 961f5e32855d9d8f0d48e5c6278e44d9b9ccdfcb Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 8 May 2018 02:37:36 -0700 Subject: [PATCH] makefile: query C compiler for its default include paths. --- makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index af6860a4..d6a841d4 100644 --- a/makefile +++ b/makefile @@ -232,7 +232,10 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) OS_LDFLAGS = -lm else # Non-Android Builds ifeq (,$(INCLUDES)$(LIBRARIES)) - INCPATH:=/usr/include + INCPATH:=$(shell LANG=C; $(GCC) -x c -v -E /dev/null 2>&1 | grep -A 10 '> search starts here' | grep '^ ' | tr -d '\n') + ifeq (,$(INCPATH)) + INCPATH:=/usr/include + endif LIBPATH:=/usr/lib else $(info *** Warning ***)