1#
2# WARNING: do not run this directly, it should be run by the master Makefile
3
4include ../../Makefile.defs
5auto_gen=
6NAME=app_python.so
7
8# If you have multiple Python versions installed make sure to modify the
9# the following to point to the correct instance. Module has been tested
10# to work with 2.6 and 2.5. Python 2.4 has been only confirmed to compile,
11# but no testing has been done with that.
12PYTHON=$(shell which python2)
13
14# workaround for some OS (like MacOS) that don't have a python2 link
15ifeq ($(PYTHON),)
16PYTHON=python
17endif
18
19PYTHON_VERSION=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('VERSION')"}
20PYTHON_LIBDIR=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LIBDIR')"}
21PYTHON_LDFLAGS=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LINKFORSHARED')"}
22PYTHON_INCDIR=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_python_inc()"}
23
24LIBS=-L${PYTHON_LIBDIR} ${PYTHON_LDFLAGS} -lpython${PYTHON_VERSION}
25
26ifeq ($(OS), freebsd)
27LIBS+=-pthread
28endif
29
30DEFS+=-I${PYTHON_INCDIR}
31
32ifeq ($(CC_NAME), gcc)
33DEFS+= -fno-strict-aliasing
34endif
35
36include ../../Makefile.modules
37
38