GNOME/python configure detection
svn: r2002
This commit is contained in:
71
configure.in
71
configure.in
@@ -75,6 +75,11 @@ try:
|
||||
pygtk.require('2.0')
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
def out(str):
|
||||
f = open('conftest.out', 'w')
|
||||
f.write(str)
|
||||
f.close()
|
||||
"
|
||||
|
||||
dnl Check if python bindings for gtk are installed
|
||||
@@ -84,18 +89,14 @@ cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gobject
|
||||
f = open("conftest.out", "w")
|
||||
f.write("YES")
|
||||
f.close()
|
||||
out("YES")
|
||||
except ImportError:
|
||||
f = open("conftest.out", "w")
|
||||
f.write("NO")
|
||||
f.close()
|
||||
out("No")
|
||||
EOF
|
||||
$PYTHON conftest.py
|
||||
has_pygtk=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
if test "YES" != $has_pygtk
|
||||
if test YES != "$has_pygtk"
|
||||
then
|
||||
AC_MSG_ERROR([
|
||||
|
||||
@@ -107,19 +108,19 @@ AC_MSG_CHECKING(Python bindings for GNOME)
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gnome, gnome.ui
|
||||
f = open("conftest.out", "w")
|
||||
f.write("YES")
|
||||
f.close()
|
||||
import gnome
|
||||
# Do not import gnome.ui, this can kill python if the
|
||||
# display cannot be opened. Just search it.
|
||||
import imp
|
||||
imp.find_module('gnome/ui')
|
||||
out("YES")
|
||||
except ImportError:
|
||||
f = open("conftest.out", "w")
|
||||
f.write("NO")
|
||||
f.close()
|
||||
out("NO")
|
||||
EOF
|
||||
$PYTHON conftest.py
|
||||
has_pygnome=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
if test "YES" != $has_pygnome
|
||||
if test YES != "$has_pygnome"
|
||||
then
|
||||
AC_MSG_ERROR([
|
||||
**** The python bindings for GNOME 2.0 (gnome-python2) could not be found.])
|
||||
@@ -131,18 +132,14 @@ cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gconf
|
||||
f = open("conftest.out", "w")
|
||||
f.write("YES")
|
||||
f.close()
|
||||
out("YES")
|
||||
except ImportError:
|
||||
f = open("conftest.out", "w")
|
||||
f.write("NO")
|
||||
f.close()
|
||||
out("NO")
|
||||
EOF
|
||||
$PYTHON conftest.py
|
||||
has_gconf=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
if test "YES" != $has_gconf
|
||||
if test YES != "$has_gconf"
|
||||
then
|
||||
AC_MSG_ERROR([
|
||||
**** The python bindings for gconf (gnome-python2-gconf) could not be found.])
|
||||
@@ -153,19 +150,18 @@ AC_MSG_CHECKING(Python bindings for GNOME canvas)
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gnome.canvas
|
||||
f = open("conftest.out", "w")
|
||||
f.write("YES")
|
||||
f.close()
|
||||
# Do not import gnome.canvas, this can raise a RuntimeError if the
|
||||
# display cannot be opened. Just search it.
|
||||
import imp
|
||||
imp.find_module('gnome/canvas')
|
||||
out("YES")
|
||||
except ImportError:
|
||||
f = open("conftest.out", "w")
|
||||
f.write("NO")
|
||||
f.close()
|
||||
out("NO")
|
||||
EOF
|
||||
$PYTHON conftest.py
|
||||
has_canvas=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
if test "YES" != $has_canvas
|
||||
if test YES != "$has_canvas"
|
||||
then
|
||||
AC_MSG_ERROR([
|
||||
**** The python bindings for GNOME canvas (gnome-python2-canvas) could not be found.])
|
||||
@@ -176,19 +172,18 @@ AC_MSG_CHECKING(Python bindin for glade)
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gtk.glade
|
||||
f = open("conftest.out", "w")
|
||||
f.write("YES")
|
||||
f.close()
|
||||
# Do not import gtk.glade, this can raise a RuntimeError if the
|
||||
# display cannot be opened. Just search it.
|
||||
import imp
|
||||
imp.find_module('gtk/glade')
|
||||
out("YES")
|
||||
except ImportError:
|
||||
f = open("conftest.out", "w")
|
||||
f.write("NO")
|
||||
f.close()
|
||||
out("NO")
|
||||
EOF
|
||||
$PYTHON conftest.py
|
||||
has_pygtk=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
if test "YES" != $has_pygtk
|
||||
if test YES != "$has_pygtk"
|
||||
then
|
||||
AC_MSG_ERROR([
|
||||
|
||||
|
Reference in New Issue
Block a user