From 617c99177b762d2ec2ab311e54aba34f1664bbff Mon Sep 17 00:00:00 2001 From: Driss Lahlou Date: Wed, 25 Jan 2017 17:15:43 +0100 Subject: [PATCH] add the pkg-config includes for python to PYTHON_INC --- makefiles/Makefile.unix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/makefiles/Makefile.unix b/makefiles/Makefile.unix index 717e2831f10..003352cc1ae 100755 --- a/makefiles/Makefile.unix +++ b/makefiles/Makefile.unix @@ -41,10 +41,16 @@ FZ_EXE = fzn-or-tools$E # This is needed to find python.h PYTHON_VERSION = $(UNIX_PYTHON_VER) -PATH_TO_PYTHON_INCLUDE = $(shell python$(UNIX_PYTHON_VER) -c 'import sysconfig; print (sysconfig.get_paths()["platinclude"])') + PATH_TO_PYTHON_LIB = $(shell python$(UNIX_PYTHON_VER) -c 'import sysconfig; print (sysconfig.get_paths()["stdlib"])') +PATH_TO_PYTHON_INCLUDE = $(shell python$(UNIX_PYTHON_VER) -c 'import sysconfig; print (sysconfig.get_paths()["platinclude"])') + PYTHON_INC = -I$(PATH_TO_PYTHON_INCLUDE) -I$(PATH_TO_PYTHON_LIB) $(ADD_PYTHON_INC) +ifeq ($(PLATFORM),LINUX) +MAJOR_PYTHON_VERSION = $(shell python$(UNIX_PYTHON_VER) -c "from sys import version_info as v; print (str(v[0]))") +PYTHON_INC += $(shell pkg-config --cflags --libs python$(MAJOR_PYTHON_VERSION) 2> /dev/null) +endif # This is needed to find gflags/gflags.h GFLAGS_INC = -I$(UNIX_GFLAGS_DIR)/include