r15300: Only enable SWIG shared libs if python is available
[bbaumbach/samba-autobuild/.git] / source4 / lib / tdb / config.m4
1 AC_CHECK_FUNCS(mmap pread pwrite getpagesize utime)
2 AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h)
3
4 AC_HAVE_DECL(pread, [#include <unistd.h>])
5 AC_HAVE_DECL(pwrite, [#include <unistd.h>])
6
7 AC_MSG_CHECKING([for Python])
8
9 PYTHON=
10  
11 AC_ARG_WITH(python,
12 [  --with-python=PYTHONNAME  build Python libraries],
13 [ case "${withval-python}" in
14   yes)
15         PYTHON=python
16         ;;
17   no)
18         PYTHON=
19         ;;
20   *)
21         PYTHON=${withval-python}
22         ;;
23   esac ])
24
25 if test x"$PYTHON" != "x"; then
26         incdir=`python -c 'import sys; print "%s/include/python%d.%d" % (sys.prefix, sys.version_info[[0]], sys.version_info[[1]])'`
27         CPPFLAGS="$CPPFLAGS -I $incdir"
28 fi
29
30 if test x"$PYTHON" != "x"; then
31         AC_MSG_RESULT([${withval-python}])
32 else
33         SMB_ENABLE(swig_tdb, NO)
34         AC_MSG_RESULT(no)
35 fi
36
37 AC_SUBST(PYTHON)