| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
include ../../Makefile.defs |
| 5 |
auto_gen= |
| 6 |
NAME=app_python.so |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
PYTHON=$(shell which python2) |
| 13 |
|
| 14 |
|
| 15 |
ifeq ($(PYTHON),) |
| 16 |
PYTHON=$(shell which python2.7) |
| 17 |
ifeq ($(PYTHON),) |
| 18 |
PYTHON=python |
| 19 |
endif |
| 20 |
endif |
| 21 |
|
| 22 |
PYTHON_VERSION=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('VERSION')"} |
| 23 |
PYTHON_LIBDIR=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LIBDIR')"} |
| 24 |
PYTHON_LDFLAGS=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LINKFORSHARED')"} |
| 25 |
PYTHON_INCDIR=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_python_inc()"} |
| 26 |
|
| 27 |
LIBS=-L${PYTHON_LIBDIR} ${PYTHON_LDFLAGS} -lpython${PYTHON_VERSION} |
| 28 |
|
| 29 |
ifeq ($(OS), freebsd) |
| 30 |
LIBS+=-pthread |
| 31 |
endif |
| 32 |
|
| 33 |
DEFS+=-I${PYTHON_INCDIR} |
| 34 |
|
| 35 |
ifeq ($(CC_NAME), gcc) |
| 36 |
DEFS+= -fno-strict-aliasing |
| 37 |
endif |
| 38 |
|
| 39 |
include ../../Makefile.modules |
| 40 |
|