summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac9
-rw-r--r--python/Makefile.am5
2 files changed, 11 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 5cef3735a..005f8f5db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -863,13 +863,20 @@ else
WITH_PYTHON_LIB=`${__PYTHON} -c 'from distutils.sysconfig import *; print get_python_lib(1)'`
WITH_PYTHON_SUBDIR=python
WITH_PYTHON_SUBPACKAGE=1
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE"
+ AC_CHECK_HEADER([Python.h],
+ [WITH_PYTHON_SUBPACKAGE=1],
+ [WITH_PYTHON_SUBPACKAGE=0])
+ CPPFLAGS="$save_CPPFLAGS"
fi
AC_SUBST(WITH_PYTHON_SUBDIR)
-AC_SUBST(WITH_PYTHON_SUBPACKAGE)
AC_SUBST(WITH_PYTHON_INCLUDE)
AC_SUBST(WITH_PYTHON_LIB)
+AM_CONDITIONAL(PYTHON,[test "$WITH_PYTHON_SUBPACKAGE" = "1"])
+
AC_PATH_PROG(__DOXYGEN, doxygen, no, $PATH)
dnl
dnl Auto-detect whether doxygen generated API docs should be included.
diff --git a/python/Makefile.am b/python/Makefile.am
index a143b2b82..b6b647bd2 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -2,11 +2,10 @@
LINT = splint
+if PYTHON
pylibdir = @WITH_PYTHON_LIB@
pyincdir = @WITH_PYTHON_INCLUDE@
-SUBDIRS =
-
EXTRA_DIST = system.h rpmdebug-py.c rpm/__init__.py
AM_CPPFLAGS = -I. \
@@ -61,3 +60,5 @@ splint_srcs = \
.PHONY: lint
lint:
$(LINT) $(DEFS) $(AM_CPPFLAGS) $(splint_srcs)
+
+endif