r14970: Add configure stuff for Python to tdb and ldb standalone builds.
[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_DEFINE([_GNU_SOURCE],[],[Pull in GNU extensions])
5
6 AC_HAVE_DECL(pread, [#include <unistd.h>])
7 AC_HAVE_DECL(pwrite, [#include <unistd.h>])
8
9 AC_MSG_CHECKING([for Python])
10
11 PYTHON=
12  
13 AC_ARG_WITH(python,
14 [  --with-python=PYTHONNAME  build Python libraries],
15 [ case "${withval-python}" in
16   yes)
17         PYTHON=python
18         ;;
19   no)
20         PYTHON=
21         ;;
22   *)
23         PYTHON=${withval-python}
24         ;;
25   esac ])
26
27 if test x"$PYTHON" != "x"; then
28         incdir=`python -c 'import sys; print "%s/include/python%d.%d" % (sys.prefix, sys.version_info[[0]], sys.version_info[[1]])'`
29         CPPFLAGS="$CPPFLAGS -I $incdir"
30 fi
31
32 if test x"$PYTHON" != "x"; then
33         AC_MSG_RESULT([${withval-python}])
34 else
35         AC_MSG_RESULT(no)
36 fi
37
38 AC_SUBST(PYTHON)