grc gtk version check
[debian/gnuradio] / config / grc_grc.m4
1 dnl Copyright 2008 Free Software Foundation, Inc.
2 dnl
3 dnl This file is part of GNU Radio
4 dnl
5 dnl GNU Radio is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 3, or (at your option)
8 dnl any later version.
9 dnl
10 dnl GNU Radio is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl GNU General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with GNU Radio; see the file COPYING.  If not, write to
17 dnl the Free Software Foundation, Inc., 51 Franklin Street,
18 dnl Boston, MA 02110-1301, USA.
19
20 AC_DEFUN([GRC_GRC],[
21     GRC_ENABLE(grc)
22
23     GRC_CHECK_DEPENDENCY(grc, gr-wxgui)
24
25     AC_CHECK_PROG(XDG_UTILS, xdg-mime, true, false)
26     AM_CONDITIONAL(XDG_UTILS, $XDG_UTILS)
27
28     dnl ########################################
29     dnl # test python version
30     dnl ########################################
31     AC_MSG_CHECKING([for Python version 2.5])
32     if test `${PYTHON} -c "import sys; print sys.version.split()[[0]] >= '2.5'"` = 'True'; then
33         AC_MSG_RESULT([yes])
34     else
35         AC_MSG_RESULT([no])
36         passed=no
37     fi
38
39     dnl ########################################
40     dnl # test python dependencies
41     dnl ########################################
42     if test $passed = yes; then
43         PYTHON_CHECK_MODULE([Cheetah],[Python Cheetah templates],[],[passed=no])
44         PYTHON_CHECK_MODULE([pygtk],[Python GTK wrappers],[],[passed=no])
45         PYTHON_CHECK_MODULE([lxml],[Python XML wrappers],[],[passed=no])
46     fi
47
48     dnl ########################################
49     dnl # test gtk version
50     dnl ########################################
51     AC_MSG_CHECKING([for GTK version >= 2.10.0])
52     if test `${PYTHON} -c "import gtk; print gtk.pygtk_version >= (2, 10, 0)"` = 'True'; then
53         AC_MSG_RESULT([yes])
54     else
55         AC_MSG_RESULT([no])
56         passed=no
57     fi
58
59     dnl ########################################
60     dnl # platform dependency pythonw
61     dnl ########################################
62     dnl FIXME: move this test to Python config m4
63     if test `${PYTHON} -c "import sys; print sys.platform"` = 'darwin'; then
64         PYTHONW=pythonw
65     else
66         PYTHONW=python
67     fi
68     AC_SUBST(PYTHONW)
69
70     AC_CONFIG_FILES([ \
71         grc/src/grc_gnuradio/Makefile \
72         grc/src/grc_gnuradio/wxgui/Makefile \
73         grc/src/grc_gnuradio/blks2/Makefile \
74         grc/src/grc_gnuradio/usrp/Makefile \
75         grc/src/Makefile \
76         grc/src/platforms/Makefile \
77         grc/src/platforms/base/Makefile \
78         grc/src/platforms/python/Makefile \
79         grc/src/platforms/python/utils/Makefile \
80         grc/src/platforms/gui/Makefile \
81         grc/src/utils/Makefile \
82         grc/src/gui/Makefile \
83         grc/examples/Makefile \
84         grc/examples/xmlrpc/Makefile \
85         grc/examples/usrp/Makefile \
86         grc/examples/audio/Makefile \
87         grc/examples/simple/Makefile \
88         grc/examples/trellis/Makefile \
89         grc/Makefile \
90         grc/data/Makefile \
91         grc/data/platforms/Makefile \
92         grc/data/platforms/base/Makefile \
93         grc/data/platforms/python/Makefile \
94         grc/data/platforms/python/blocks/Makefile \
95         grc/scripts/Makefile \
96         grc/freedesktop/Makefile \
97     ])
98
99     GRC_BUILD_CONDITIONAL(grc)
100 ])