summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac36
-rw-r--r--configure.mk8
-rw-r--r--src/python/Makefile.am24
3 files changed, 39 insertions, 29 deletions
diff --git a/configure.ac b/configure.ac
index fa7bd5b..9b3b697 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,21 +28,35 @@ AC_SUBST([VERSION_MAJOR])
AC_SUBST([VERSION_MINOR])
AC_SUBST([VERSION_MICRO])
-dnl AC_ARG_ENABLE([python],
-dnl [AS_HELP_STRING([--enable-python], [build the python bindings, requires cython])])
-enable_python=no
-AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = yes])
-cython_ver=$(which cython >/dev/null 2>/dev/null && cython -V 2>&1 | cut -d' ' -f3)
-cython_maj=$(echo "$cython_ver" | cut -d'.' -f1)
-cython_min=$(echo "$cython_ver" | cut -d'.' -f2)
+dnl ####
+dnl cython checks
+dnl ####
+AC_CHECK_PROG(have_cython, cython, "yes", "no")
+AS_IF([test "$have_cython" = yes], [
+ AS_ECHO("checking cython version... $(cython -V 2>&1 | cut -d' ' -f 3)")
+ CYTHON_VER_MAJ=$(cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 1);
+ CYTHON_VER_MIN=$(cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 2);
+],[
+ CYTHON_VER_MAJ=0
+ CYTHON_VER_MIN=0
+])
+
+dnl ####
+dnl python binding checks
+dnl ####
+AC_ARG_ENABLE([python],
+ [AS_HELP_STRING([--enable-python],
+ [build the python bindings, requires cython])])
AS_IF([test "$enable_python" = yes], [
- recent=""
- AS_IF([test -n "$cython_maj" -a -n "$cython_min" &&
- ! test "$cython_maj" -eq 0 -a "$cython_min" -lt 16], [recent=yes])
- AS_IF([test -z "$recent"], [
+ # cython version check
+ AS_IF([test "$CYTHON_VER_MAJ" -eq 0 -a "$CYTHON_VER_MIN" -lt 16], [
AC_MSG_ERROR([python bindings require cython 0.16 or higher])
])
])
+AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = yes])
+AC_DEFINE_UNQUOTED([ENABLE_PYTHON],
+ [$(test "$enable_python" == yes && echo 1 || echo 0)],
+ [Python bindings build flag.])
AC_CONFIG_FILES([Makefile src/Makefile src/python/Makefile tools/Makefile
tests/Makefile include/seccomp.h libseccomp.pc])
diff --git a/configure.mk b/configure.mk
deleted file mode 100644
index 9639c71..0000000
--- a/configure.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-# generated by configure on Thu, 17 Apr 2014 11:25:02 -0400
-# options: "--enable-python"
-
-CONF_INSTALL_PREFIX = "/usr/local"
-CONF_INSTALL_LIBDIR = "/usr/local/lib"
-CONF_SYSINC_SECCOMP = 1
-CONF_BINDINGS_PYTHON = 1
-
diff --git a/src/python/Makefile.am b/src/python/Makefile.am
index 400b354..c166506 100644
--- a/src/python/Makefile.am
+++ b/src/python/Makefile.am
@@ -1,24 +1,28 @@
# -*- Makefile -*-
PYTHON = /usr/bin/env python
-pyverbose_0 = -q
-pyverbose_ = ${pyverbose_0}
PY_DISTUTILS = \
VERSION_RELEASE="${VERSION_RELEASE}" \
CFLAGS="-I\${top_srcdir}/include ${CFLAGS} ${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}" \
${PYTHON} ./setup.py
-PY_BUILD = ${PY_DISTUTILS} build ${pyverbose_${V}}
-PY_INSTALL = ${PY_DISTUTILS} install ${pyverbose_${V}}
-all-local: python-build
+# support silent builds
+PY_BUILD_0 = @echo " PYTHON " $@; ${PY_DISTUTILS} -q build
+PY_BUILD_1 = ${PY_DISTUTILS} build
+PY_BUILD_ = ${PY_BUILD_0}
+PY_BUILD = ${PY_BUILD_@AM_V@}
-python-build: ../libseccomp.la libseccomp.pxd seccomp.pyx
- ${AM_V_GEN}${PY_DISTUTILS} build && touch $@
+PY_INSTALL = ${PY_DISTUTILS} install
-install-exec-local:
- ${PY_DISTUTILS} install --prefix=${DESTDIR}/${prefix}
+all-local: build
+
+build: ../libseccomp.la libseccomp.pxd seccomp.pyx
+ ${PY_BUILD} && touch build
+
+install-exec-local: build
+ ${PY_INSTALL} --prefix=${DESTDIR}/${prefix}
clean-local:
- rm -Rf python-build seccomp.c
+ ${RM} -rf seccomp.c build/