-# Check whether to include debugging code
-DEBUG=""
-AC_MSG_CHECKING([whether to include verbose debugging code])
-AC_ARG_ENABLE([debug],
- [ --enable-debug include verbose debugging code @<:@default=no@:>@],
- if test "$enableval" = "yes"; then
- AC_MSG_RESULT([yes])
- if test "$GCC" = "yes"; then
- DEBUG="-DDEBUG -fno-inline -g"
- else
- DEBUG="-DDEBUG"
- fi
- else
- AC_MSG_RESULT([no])
- DEBUG="-DNDEBUG"
- fi,
- AC_MSG_RESULT([no])
- DEBUG="-DNDEBUG"
-)
-CXXFLAGS="$CXXFLAGS $DEBUG"
-
-# Check for Python
-AC_ARG_WITH([python],
- [ --with-python=path Set location of Python executable],
- [PYTHON="$withval"],
- [PYTHON=])
-
-# Find the python bin
-if ! test "$PYTHON"; then
- AC_CHECK_PROGS(PYTHON, $prefix/bin/python python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4)
-fi
-if ! test "$PYTHON"; then
- AC_MSG_ERROR([Openbox requires the use of Python. This is its secret special formula for extreme sexiness.
-See http://www.python.org
-])
-fi
-
-# Find our python paths
-AC_MSG_CHECKING([for Python version])
-# Need to do this hack since autoconf replaces __file__ with the name of the configure file
-filehack="file__"
-PYVERSION=`($PYTHON -c "import string,operator; print operator.getitem(string.split(string.__$filehack,'/'),-2)")`
-AC_MSG_RESULT([$PYVERSION])
-
-AC_MSG_CHECKING([for Python prefix])
-PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null`
-AC_MSG_RESULT([$PYPREFIX])
-AC_MSG_CHECKING([for Python exec-prefix])
-PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null`
-AC_MSG_RESULT([$PYEPREFIX])
-
-# Find the include directory
-AC_MSG_CHECKING([for Python header files])
-if test -r "$PYPREFIX/include/$PYVERSION/Python.h"; then
- PYTHON_CFLAGS="-I$PYPREFIX/include/$PYVERSION"
-fi
-if test -z "$PYTHON_CFLAGS"; then
- if test -r "$PYPREFIX/include/Py/Python.h"; then
- PYTHON_CFLAGS="-I$PYPREFIX/include/Py"
- fi
-fi
-if ! test "$PYTHON_CFLAGS"; then
- AC_MSG_ERROR([Not found])
-else
- AC_MSG_RESULT([$PYTHON_CFLAGS])