-# Option to only build the consumer daemon and its libraries
-AC_ARG_WITH([consumerd-only],
- AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
- [consumerd_only=$withval],
- [consumerd_only=no])
-AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
+AC_ARG_ENABLE([git-version],
+ [AC_HELP_STRING([--disable-git-version],
+ [Do not use the git version for the build])],
+ [disable_git_version=yes], [disable_git_version=no]
+)
+if test "x${disable_git_version:-no}" = xno; then
+ AC_DEFINE_UNQUOTED([GIT_SOURCE], 1, [Disable git version.])
+fi
+
+# For Python
+# SWIG version needed or newer:
+swig_version=2.0.0
+
+AC_ARG_ENABLE([python-bindings],
+ [AC_HELP_STRING([--enable-python-bindings],
+ [compile Python bindings])],
+ [enable_python=yes], [enable_python=no])
+
+AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes])
+
+if test "x${enable_python:-yes}" = xyes; then
+ AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
+ AM_PATH_PYTHON
+
+ AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
+ AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
+ AS_IF([test -z "$PYTHON_INCLUDE"], [
+ AS_IF([test -z "$PYTHON_CONFIG"], [
+ AC_PATH_PROGS([PYTHON_CONFIG],
+ [python$PYTHON_VERSION-config python-config],
+ [no],
+ [`dirname $PYTHON`])
+ AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
+ ])
+ AC_MSG_CHECKING([python include flags])
+ PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
+ AC_MSG_RESULT([$PYTHON_INCLUDE])
+ ])
+
+else
+ AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl
+[if you want Python bindings.])
+
+fi