Skip to content

Commit

Permalink
add the pkg-config includes for python to PYTHON_INC
Browse files Browse the repository at this point in the history
  • Loading branch information
Driss Lahlou committed Jan 25, 2017
1 parent 8486c77 commit 617c991
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion makefiles/Makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 617c991

Please sign in to comment.