Commit dff4b436 authored by Sebastian Ohlmann's avatar Sebastian Ohlmann

Add switch --enable-python to configure.ac

By default, python wrapper is not built, only if this switch is
specified.
parent eafc2a15
...@@ -613,6 +613,7 @@ endif ...@@ -613,6 +613,7 @@ endif
#test_c_cannon@SUFFIX@_CFLAGS = $(test_program_cflags) #test_c_cannon@SUFFIX@_CFLAGS = $(test_program_cflags)
# python wrapper # python wrapper
if WITH_PYTHON
pyelpadir = $(pythondir)/pyelpa pyelpadir = $(pythondir)/pyelpa
pyelpa_PYTHON = python/__init__.py python/distributedmatrix.py pyelpa_PYTHON = python/__init__.py python/distributedmatrix.py
pyelpa_LTLIBRARIES = wrapper.la pyelpa_LTLIBRARIES = wrapper.la
...@@ -623,6 +624,7 @@ wrapper_la_CFLAGS = -I$(PYTHON_INCLUDE) $(AM_CFLAGS) ...@@ -623,6 +624,7 @@ wrapper_la_CFLAGS = -I$(PYTHON_INCLUDE) $(AM_CFLAGS)
python/wrapper.c: python/wrapper.pyx python/wrapper.c: python/wrapper.pyx
cython $< cython $<
endif
# test scripts # test scripts
......
...@@ -1275,10 +1275,27 @@ else ...@@ -1275,10 +1275,27 @@ else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
AM_PATH_PYTHON([3.6]) AC_MSG_CHECKING(whether --enable-python is specified)
AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config]) AC_ARG_ENABLE([python],
AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) AS_HELP_STRING([--enable-python],
AS_IF([test -z "$PYTHON_INCLUDE"], [ [build and install python wrapper, default no.]),
[
if test x"$enableval" = x"yes"; then
enable_python=yes
else
enable_python=no
fi
],
[enable_python=no])
AC_MSG_RESULT([${enable_python}])
AM_CONDITIONAL([WITH_PYTHON],[test x"$enable_python" = x"yes"])
if test x"${enable_python}" = x"yes"; then
AC_DEFINE([WITH_PYTHON], [1], [build and install python wrapper])
# check for python and dependencies
AM_PATH_PYTHON([3.6])
AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
AS_IF([test -z "$PYTHON_INCLUDE"], [
AS_IF([test -z "$PYTHON_CONFIG"], [ AS_IF([test -z "$PYTHON_CONFIG"], [
AC_PATH_PROGS([PYTHON_CONFIG], AC_PATH_PROGS([PYTHON_CONFIG],
[python$PYTHON_VERSION-config python-config], [python$PYTHON_VERSION-config python-config],
...@@ -1289,7 +1306,8 @@ AS_IF([test -z "$PYTHON_INCLUDE"], [ ...@@ -1289,7 +1306,8 @@ AS_IF([test -z "$PYTHON_INCLUDE"], [
AC_MSG_CHECKING([python include flags]) AC_MSG_CHECKING([python include flags])
PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
AC_MSG_RESULT([$PYTHON_INCLUDE]) AC_MSG_RESULT([$PYTHON_INCLUDE])
]) ])
fi
AC_OUTPUT AC_OUTPUT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment