summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorGravatar Bryan Forbes2010-04-01 01:09:52 -0500
committerGravatar Martin Szulecki2012-03-20 23:25:55 +0100
commitacac4f819ccafa6f6bb945626f2e21ec2b75074b (patch)
treefc6881c387ee1e4527ed2b3ca73d1059bc8fc4f2 /m4
parentaf06ff22149191c056804e7fec9c1a6880a06872 (diff)
downloadlibimobiledevice-acac4f819ccafa6f6bb945626f2e21ec2b75074b.tar.gz
libimobiledevice-acac4f819ccafa6f6bb945626f2e21ec2b75074b.tar.bz2
Cleaned up Makefile.am.
Added the cython m4 files. Cleaned up afc.pxi. Make sure the event callback and installation proxy callback aquire the GIL. Implemented some cleanup before the error handlers raise.
Diffstat (limited to 'm4')
-rw-r--r--m4/ac_pkg_cython.m456
-rw-r--r--m4/cython_python.m47
2 files changed, 63 insertions, 0 deletions
diff --git a/m4/ac_pkg_cython.m4 b/m4/ac_pkg_cython.m4
new file mode 100644
index 0000000..aeae6a0
--- /dev/null
+++ b/m4/ac_pkg_cython.m4
@@ -0,0 +1,56 @@
+
+AC_DEFUN([AC_PROG_CYTHON],[
+ AC_PATH_PROG([CYTHON],[cython])
+ if test -z "$CYTHON" ; then
+ AC_MSG_WARN([cannot find 'cython' program. You should look at http://www.cython.org] or install your distribution specific cython package.)
+ CYTHON=false
+ elif test -n "$1" ; then
+ AC_MSG_CHECKING([for Cython version])
+ [cython_version=`$CYTHON --version 2>&1 | grep 'Cython version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+ AC_MSG_RESULT([$cython_version])
+ if test -n "$cython_version" ; then
+ # Calculate the required version number components
+ [required=$1]
+ [required_major=`echo $required | sed 's/[^0-9].*//'`]
+ if test -z "$required_major" ; then
+ [required_major=0]
+ fi
+ [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+ [required_minor=`echo $required | sed 's/[^0-9].*//'`]
+ if test -z "$required_minor" ; then
+ [required_minor=0]
+ fi
+ [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+ [required_patch=`echo $required | sed 's/[^0-9].*//'`]
+ if test -z "$required_patch" ; then
+ [required_patch=0]
+ fi
+ # Calculate the available version number components
+ [available=$cython_version]
+ [available_major=`echo $available | sed 's/[^0-9].*//'`]
+ if test -z "$available_major" ; then
+ [available_major=0]
+ fi
+ [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+ [available_minor=`echo $available | sed 's/[^0-9].*//'`]
+ if test -z "$available_minor" ; then
+ [available_minor=0]
+ fi
+ [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+ [available_patch=`echo $available | sed 's/[^0-9].*//'`]
+ if test -z "$available_patch" ; then
+ [available_patch=0]
+ fi
+ if test $available_major -ne $required_major \
+ -o $available_minor -ne $required_minor \
+ -o $available_patch -lt $required_patch ; then
+ AC_MSG_WARN([Cython version >= $1 is required. You have $cython_version. You should look at http://www.cython.org])
+ CYTHON=false
+ fi
+ else
+ AC_MSG_WARN([cannot determine Cython version])
+ CYTHON=false
+ fi
+ fi
+ AC_SUBST([CYTHON_LIB])
+])
diff --git a/m4/cython_python.m4 b/m4/cython_python.m4
new file mode 100644
index 0000000..ba730d5
--- /dev/null
+++ b/m4/cython_python.m4
@@ -0,0 +1,7 @@
+AC_DEFUN([CYTHON_PYTHON],[
+ AC_REQUIRE([AC_PROG_CYTHON])
+ AC_REQUIRE([AC_PYTHON_DEVEL])
+ test "x$1" != "xno" || cython_shadow=" -noproxy"
+ AC_SUBST([CYTHON_PYTHON_OPT],[-python$cython_shadow])
+ AC_SUBST([CYTHON_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS])
+])