2001-05-13 07:26:57 +05:30
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_INIT(src/gramps.py)
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
|
|
|
|
PACKAGE=gramps
|
|
|
|
|
|
|
|
AC_PATH_PROG(PYTHON, python)
|
|
|
|
AC_PATH_PROG(ZIP, zip)
|
|
|
|
|
2001-05-23 21:11:40 +05:30
|
|
|
changequote(<<, >>)dnl
|
|
|
|
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"`
|
|
|
|
changequote([, ])dnl
|
|
|
|
|
2001-05-13 07:26:57 +05:30
|
|
|
AC_SUBST(PYTHON)
|
2001-05-23 21:11:40 +05:30
|
|
|
AC_SUBST(PYTHON_VERSION)
|
2001-05-13 07:26:57 +05:30
|
|
|
AC_SUBST(PACKAGE)
|
|
|
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
2001-05-14 01:12:15 +05:30
|
|
|
AC_PROG_CC
|
|
|
|
|
2001-05-13 07:26:57 +05:30
|
|
|
dnl Check for programs
|
|
|
|
|
|
|
|
AC_CHECK_PROG(HAVE_GNOME_CONFIG, gnome-config, "YES", "NO")
|
|
|
|
|
|
|
|
dnl Check if python bindings for gtk are installed
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(Python bindings for sax/xml)
|
|
|
|
changequote(,)
|
|
|
|
cat > conftest.py <<EOF
|
|
|
|
try:
|
2001-06-22 03:52:24 +05:30
|
|
|
from xml.sax import saxlib
|
2001-05-13 07:26:57 +05:30
|
|
|
f = open("conftest.out", "w")
|
|
|
|
f.write("YES")
|
|
|
|
f.close()
|
|
|
|
except ImportError:
|
|
|
|
f = open("conftest.out", "w")
|
|
|
|
f.write("NO")
|
|
|
|
f.close()
|
|
|
|
EOF
|
|
|
|
changequote([, ])
|
|
|
|
$PYTHON conftest.py
|
|
|
|
has_sax=`cat conftest.out`
|
|
|
|
rm -f conftest.out conftest.py
|
|
|
|
if test "YES" != $has_sax
|
|
|
|
then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
|
|
|
|
**** The python interpreter can't find the SAX/XML bindings.])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(ok)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(Python bindings for gtk+)
|
|
|
|
changequote(,)
|
|
|
|
cat > conftest.py <<EOF
|
|
|
|
try:
|
|
|
|
import gtk
|
|
|
|
f = open("conftest.out", "w")
|
|
|
|
f.write("YES")
|
|
|
|
f.close()
|
|
|
|
except ImportError:
|
|
|
|
f = open("conftest.out", "w")
|
|
|
|
f.write("NO")
|
|
|
|
f.close()
|
|
|
|
EOF
|
|
|
|
changequote([, ])
|
|
|
|
$PYTHON conftest.py
|
|
|
|
has_pygtk=`cat conftest.out`
|
|
|
|
rm -f conftest.out conftest.py
|
|
|
|
if test "YES" != $has_pygtk
|
|
|
|
then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
|
|
|
|
**** The python interpreter can't find the python bindings for gtk.])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(ok)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(Python bindings for GNOME)
|
|
|
|
changequote(,)
|
|
|
|
cat > conftest.py <<EOF
|
|
|
|
try:
|
|
|
|
import gnome, gnome.ui, gnome.xmhtml
|
|
|
|
f = open("conftest.out", "w")
|
|
|
|
f.write("YES")
|
|
|
|
f.close()
|
|
|
|
except ImportError:
|
|
|
|
f = open("conftest.out", "w")
|
|
|
|
f.write("NO")
|
|
|
|
f.close()
|
|
|
|
EOF
|
|
|
|
changequote([, ])
|
|
|
|
$PYTHON conftest.py
|
|
|
|
has_pygnome=`cat conftest.out`
|
|
|
|
rm -f conftest.out conftest.py
|
|
|
|
if test "YES" != $has_pygnome
|
|
|
|
then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
|
|
|
|
**** The python interpreter can't find the python bindings for GNOME.])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(ok)
|
|
|
|
|
|
|
|
dnl Checks for libraries.
|
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
|
2001-05-23 21:11:40 +05:30
|
|
|
AC_MSG_CHECKING(for headers required to compile python extensions)
|
|
|
|
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
|
|
|
|
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
|
|
|
|
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
|
|
|
|
if test "$py_prefix" != "$py_exec_prefix"; then
|
|
|
|
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
|
|
|
|
fi
|
|
|
|
AC_SUBST(PYTHON_INCLUDES)
|
|
|
|
dnl check if the headers exist:
|
|
|
|
if test -f "${py_exec_prefix}/include/python${PYTHON_VERSION}/Python.h"
|
|
|
|
then
|
|
|
|
AC_MSG_RESULT(ok)
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([not found])
|
|
|
|
fi
|
|
|
|
|
2001-05-13 07:26:57 +05:30
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
|
|
|
|
dnl Checks for library functions.
|
|
|
|
|
|
|
|
AC_OUTPUT(Makefile \
|
|
|
|
src/Makefile\
|
|
|
|
src/plugins/Makefile\
|
|
|
|
src/filters/Makefile\
|
|
|
|
src/data/Makefile\
|
|
|
|
gramps.sh)
|
|
|
|
|
|
|
|
|