1
dnl cf/gcw.ac for PLplot -*- autoconf -*-
3
dnl ------------------------------------------------------------------------
4
dnl Gnome/GTK configuration tests
6
dnl ------------------------------------------------------------------------
8
dnl Copyright (C) 2005 Thomas J. Duck
10
dnl This file is part of PLplot.
12
dnl PLplot is free software; you can redistribute it and/or modify
13
dnl it under the terms of the GNU Library General Public License as published
14
dnl by the Free Software Foundation; version 2 of the License.
16
dnl PLplot is distributed in the hope that it will be useful,
17
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
18
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
dnl GNU Library General Public License for more details.
21
dnl You should have received a copy of the GNU Library General Public License
22
dnl along with the file PLplot; if not, write to the Free Software
23
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
dnl ------------------------------------------------------------------------
27
dnl Configuring the gcw driver and the plplotcanvas support needs the
28
dnl pkg-config program
30
dnl Test for pkg-config
32
AC_CHECK_PROG(PKG_CONFIG_CHECK, pkg-config, yes, no)
34
if test "$PKG_CONFIG_CHECK" = "no"; then
36
AC_MSG_WARN([pkg-config not found])
37
AC_MSG_WARN([Setting enable_gcw and enable_pygcw to no])
44
dnl Note that Gnome2 uses pkg-config as a key part of the
45
dnl configure process; there is no way of getting around it
48
dnl Flag whether or not to include the python binding
49
if test "$enable_python" = "yes" -a "$enable_gcw" = "yes"; then
56
dnl Test for libraries, header files, etc etc etc
57
if test "$enable_gcw" = "yes"; then
59
dnl Test for libgnomeui required by gcw/plplotcanvas
60
PKG_CHECK_MODULES(GCW,libgnomeui-2.0,, enable_gcw=no )
62
dnl Test for libgnomeprintui required by gcw/plplotcanvas
63
PKG_CHECK_MODULES(GCW,libgnomeprintui-2.2,, enable_gcw=no )
66
dnl Continue if the required libraries exist
67
if test "$enable_gcw" = "no"; then
69
AC_MSG_WARN([required libraries not found via pkg-config;])
70
AC_MSG_WARN([ gcw/plplotcanvas driver disabled])
74
dnl Test for gthread-2.0 required by plplotcanvas_animation.c example
75
PKG_CHECK_MODULES(GCWTHREAD,gthread-2.0,, enable_gcwthread=no )
77
dnl Test for the header files required by gcw/plplotcanvas
79
CPPFLAGS="$CPPFLAGS $GCW_CFLAGS"
81
AC_CHECK_HEADERS([math.h],, headers=no )
82
AC_CHECK_HEADERS([glib.h],, headers=no )
83
AC_CHECK_HEADERS([gtk/gtk.h],, headers=no )
84
AC_CHECK_HEADERS([libgnomecanvas/libgnomecanvas.h],, headers=no )
85
AC_CHECK_HEADERS([libart_lgpl/libart.h],, headers=no )
86
AC_CHECK_HEADERS([libgnomeprint/gnome-print.h],, headers=no )
88
if test "$headers" = "no"; then
89
AC_MSG_WARN([required headers not found; gcw/plplotcanvas])
90
AC_MSG_WARN([ driver disabled])
97
dnl Test for python binding requirements
98
if test "$enable_gcw" = "yes" -a "$enable_pygcw" = "yes"; then
100
dnl Test for the required libraries
102
dnl Test for pygtk required by gcw/plplotcanvas
103
PKG_CHECK_MODULES(PYGCW,pygtk-2.0,, enable_pygcw=no )
105
dnl Test for gnome-python required by gcw/plplotcanvas
106
PKG_CHECK_MODULES(GNOME_PYTHON, gnome-python-2.0, [], enable_pygcw=no)
108
if test "$enable_pygcw" = "no"; then
110
AC_MSG_WARN([required libraries not found via pkg-config;])
111
AC_MSG_WARN([ python binding for gcw/plplotcanvas will not])
112
AC_MSG_WARN([ be generated])
116
dnl Test for the required headers
117
CPPFLAGS="$CPPFLAGS $PYGCW_CFLAGS"
118
AC_CHECK_HEADERS([glib-object.h],, headers=no )
120
if test "$headers" = "no"; then
121
AC_MSG_WARN([required headers not found; python binding for])
122
AC_MSG_WARN([ gcw/plplotcanvas will not be generated])
126
dnl Test for pygtk/codegen, defs, dsextras
127
AC_MSG_CHECKING(for pygtk/codegen and friends)
128
if test -z `pkg-config --variable=codegendir pygtk-2.0`; then
129
AC_MSG_RESULT(not found)
130
AC_MSG_WARN([pygtk/codegen not found; python binding for])
131
AC_MSG_WARN([ gcw/plplotcanvas will not be generated])
144
# GCW_LIBS all libs needed by the gcw driver.
147
fi # if test "$with_pkg_config""
149
if test "$enable_gcw" = yes ; then
160
dnl The choice of the names GCW_FLAGS and GCW_LIBS is made by
161
dnl the PKG_CHECK_MODULES macro.
166
AC_SUBST(PYGCW_CFLAGS)
168
AC_SUBST(GCWTHREAD_CFLAGS)
169
AC_SUBST(GCWTHREAD_LIBS)
171
AM_CONDITIONAL(enable_gcw, [test "$enable_gcw" = yes])
172
AM_CONDITIONAL(enable_pygcw, [test "$enable_pygcw" = yes])
174
bindings/gnome2/Makefile
175
bindings/gnome2/lib/Makefile
176
bindings/gnome2/python/Makefile