ac61d1b767
svn: r634
274 lines
5.8 KiB
Plaintext
274 lines
5.8 KiB
Plaintext
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)
|
|
|
|
changequote(<<, >>)dnl
|
|
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"`
|
|
changequote([, ])dnl
|
|
|
|
if test "$PYTHON_VERSION" != "1.5"
|
|
then
|
|
AC_PATH_PROG(PYTHON15, python1.5)
|
|
else
|
|
PYTHON15=$PYTHON
|
|
fi
|
|
|
|
if test "$PYTHON_VERSION" != "2.0"
|
|
then
|
|
AC_PATH_PROG(PYTHON20, python2.0)
|
|
else
|
|
PYTHON20=$PYTHON
|
|
fi
|
|
|
|
if test "$PYTHON_VERSION" != "2.1"
|
|
then
|
|
AC_PATH_PROG(PYTHON21, python2.1)
|
|
else
|
|
PYTHON21=$PYTHON
|
|
fi
|
|
|
|
if test "$PYTHON_VERSION" != "2.2"
|
|
then
|
|
AC_PATH_PROG(PYTHON22, python2.2)
|
|
else
|
|
PYTHON22=$PYTHON
|
|
fi
|
|
|
|
AC_PATH_PROG(ZIP, zip)
|
|
|
|
AC_SUBST(PYTHON)
|
|
AC_SUBST(PYTHON_VERSION)
|
|
AC_SUBST(PACKAGE)
|
|
AC_SUBST(GNOMEHELP)
|
|
AC_SUBST(LIBS)
|
|
|
|
AC_PROG_INSTALL
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_CHECK_HEADER(libintl.h)
|
|
|
|
AC_CHECK_LIB(c,textdomain,LIBS="",
|
|
[ AC_CHECK_LIB(intl,textdomain,
|
|
LIBS="-lintl",
|
|
AC_MSG_ERROR("Could not find internationalization libraries"))
|
|
])
|
|
|
|
dnl Check for programs
|
|
|
|
AC_CHECK_PROG(HAVE_GNOME_CONFIG, gnome-config, "YES", "NO")
|
|
GNOMEHELP=`gnome-config --prefix`
|
|
|
|
dnl Check if python bindings for gtk are installed
|
|
|
|
AC_MSG_CHECKING(Python bindings for sax/xml)
|
|
changequote(,)
|
|
cat > conftest.py <<EOF
|
|
try:
|
|
from xml.sax import make_parser, handler
|
|
f = open("conftest.out", "w")
|
|
f.write("YES")
|
|
f.close()
|
|
except ImportError:
|
|
|
|
try:
|
|
from _xmlplus.sax import make_parser, handler
|
|
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
|
|
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)
|
|
|
|
AC_MSG_CHECKING(Python/libglade bindings)
|
|
changequote(,)
|
|
cat > conftest.py <<EOF
|
|
try:
|
|
import libglade
|
|
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 libglade.])
|
|
fi
|
|
AC_MSG_RESULT(ok)
|
|
|
|
AC_MSG_CHECKING(Python/GNOME bindings for libglade)
|
|
changequote(,)
|
|
cat > conftest.py <<EOF
|
|
try:
|
|
import _gladegnome
|
|
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 GNOME bindings for libglade.])
|
|
fi
|
|
AC_MSG_RESULT(ok)
|
|
|
|
dnl Checks for libraries.
|
|
|
|
dnl Checks for header files.
|
|
|
|
AC_MSG_CHECKING(for headers required to compile python extensions)
|
|
|
|
if test "$PYTHON15" != ""; then
|
|
py_prefix=`$PYTHON15 -c "import sys; print sys.prefix"`
|
|
py_exec_prefix=`$PYTHON15 -c "import sys; print sys.exec_prefix"`
|
|
P15_INCLUDES="-I${py_prefix}/include/python1.5"
|
|
if test -f "${py_exec_prefix}/include/python1.5/Python.h"
|
|
then
|
|
INTLLIBS="intl15.so "
|
|
fi
|
|
fi
|
|
AC_SUBST(P15_INCLUDES)
|
|
|
|
if test "$PYTHON20" != ""; then
|
|
py_prefix=`$PYTHON20 -c "import sys; print sys.prefix"`
|
|
py_exec_prefix=`$PYTHON20 -c "import sys; print sys.exec_prefix"`
|
|
P20_INCLUDES="-I${py_prefix}/include/python2.0"
|
|
if test -f "${py_exec_prefix}/include/python2.0/Python.h"
|
|
then
|
|
INTLLIBS="${INTLLIBS}intl20.so "
|
|
fi
|
|
fi
|
|
AC_SUBST(P20_INCLUDES)
|
|
|
|
if test "$PYTHON21" != ""; then
|
|
py_prefix=`$PYTHON21 -c "import sys; print sys.prefix"`
|
|
py_exec_prefix=`$PYTHON21 -c "import sys; print sys.exec_prefix"`
|
|
P21_INCLUDES="-I${py_prefix}/include/python2.1"
|
|
if test "$py_prefix" != "$py_exec_prefix"; then
|
|
P21_INCLUDES="$P21_INCLUDES -I${py_exec_prefix}/include/python2.1"
|
|
fi
|
|
if test -f "${py_exec_prefix}/include/python2.1/Python.h"
|
|
then
|
|
INTLLIBS="${INTLLIBS}intl21.so "
|
|
fi
|
|
fi
|
|
AC_SUBST(P21_INCLUDES)
|
|
|
|
if test "$PYTHON22" != ""; then
|
|
py_prefix=`$PYTHON22 -c "import sys; print sys.prefix"`
|
|
py_exec_prefix=`$PYTHON22 -c "import sys; print sys.exec_prefix"`
|
|
P22_INCLUDES="-I${py_prefix}/include/python2.2"
|
|
if test "$py_prefix" != "$py_exec_prefix"; then
|
|
P22_INCLUDES="$P22_INCLUDES -I${py_exec_prefix}/include/python2.2"
|
|
fi
|
|
if test -f "${py_exec_prefix}/include/python2.2/Python.h"
|
|
then
|
|
INTLLIBS="${INTLLIBS}intl22.so "
|
|
fi
|
|
fi
|
|
|
|
AC_SUBST(P22_INCLUDES)
|
|
AC_SUBST(INTLLIBS)
|
|
|
|
AC_MSG_RESULT(ok)
|
|
|
|
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)
|
|
|
|
|