21
21
dnl You should have received a copy of the GNU Library General Public License
22
22
dnl along with the file PLplot; if not, write to the Free Software
23
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
25
PL_ARG_ENABLE(python, [compile Python interface code], yes)
65
PL_ARG_WITH(python-incdir, [User-specified path to the python header files], [])
65
66
if test "$enable_python" = "yes"; then
66
if test -z "$PYTHON_INC_DIR" -o ! -d "$PYTHON_INC_DIR"; then
67
if test -z "$with_python_incdir"; then
67
68
incdirs="$prefix/include/python$PYTHON_VERSION \
68
/usr/include/python$PYTHON_VERSION"
69
PL_FIND_INC(Python, PYTHON_INC_DIR, enable_python)
69
/usr/include/python$PYTHON_VERSION \
70
/Library/Frameworks/Python.framework/Versions/$PYTHON_VERSION/include/python$PYTHON_VERSION"
71
PL_FIND_INC(Python, with_python_incdir, enable_python)
71
73
if test "$enable_python" = no ; then
72
74
AC_MSG_WARN([Header file for Python version $PYTHON_VERSION has not been found.])
73
75
AC_MSG_WARN([This probably means that an appropriate Python])
74
76
AC_MSG_WARN([development package needs to be installed.])
77
with_python_incdir=default
79
# This needs to be a separate test in case PYTHON_INC_DIR is specified by the
80
AC_MSG_NOTICE("User-specified path to the python header files is $with_python_incdir")
82
if test "$with_python_incdir" = "/usr/include"; then
83
with_python_incdir=default
87
PL_ADD_TO_INCS($with_python_incdir, PYTHONINCCMD, PYTHONINCPATH)
89
# This needs to be a separate test in case with_python_incdir is specified by the
80
90
# user, to pick up a particular version. Numeric should be either in the same
81
# or a subdir of PYTHON_INC_DIR else version mismatch could occur.
91
# or a subdir of with_python_incdir else version mismatch could occur.
83
93
if test "$enable_python" = "yes"; then
86
$PYTHON_INC_DIR/Numeric"
87
PL_FIND_INC(arrayobject, PYTHON_NUM_DIR, numeric_python)
96
$with_python_incdir/Numeric"
97
PL_FIND_INC(arrayobject, numeric_incdir, numeric_python)
88
98
if test "$numeric_python" = "no"; then
89
99
AC_MSG_RESULT([plplot module needs Python numeric extension.])
90
100
AC_MSG_RESULT([Setting enable_python to no])
102
numeric_incdir=default
107
PL_ADD_TO_INCS($numeric_incdir, NUMERICINCCMD, NUMERICINCPATH)
96
AC_SUBST(PYTHON_INC_DIR)
97
AC_SUBST(PYTHON_NUM_DIR)
110
AC_SUBST(PYTHONINCCMD)
111
AC_SUBST(NUMERICINCCMD)
99
113
AM_CONDITIONAL(enable_python, [test "$enable_python" = yes])
100
114
# Needed to set up python linking hack for Mac OS X.