summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-08-06 12:04:05 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-08-06 12:04:05 +0300
commitaab16a0274277360816419a91cafcc837e00dd6d (patch)
treec77ccf37ee8658a0a32a00c22e5e25cb850c2e06
parent91dc76dab02f6b88eb52dd86136bade7abc767f4 (diff)
downloadlibrpm-tizen-aab16a0274277360816419a91cafcc837e00dd6d.tar.gz
librpm-tizen-aab16a0274277360816419a91cafcc837e00dd6d.tar.bz2
librpm-tizen-aab16a0274277360816419a91cafcc837e00dd6d.zip
Allow building without python-devel.
The patch below adds a check for presence of Python.h to configure.ac and applies automake-conditionals to switch off building rpm's python bindings if Python.h can't be found. Patch from Ralf Corsepius.
-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