~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to cf/gcw.ac

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl cf/gcw.ac for PLplot  -*- autoconf -*-
 
2
dnl
 
3
dnl ------------------------------------------------------------------------
 
4
dnl Gnome/GTK configuration tests
 
5
dnl Added by Tom Duck
 
6
dnl ------------------------------------------------------------------------
 
7
dnl
 
8
dnl Copyright (C) 2005  Thomas J. Duck
 
9
dnl
 
10
dnl This file is part of PLplot.
 
11
dnl
 
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.
 
15
dnl
 
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.
 
20
dnl
 
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
 
24
dnl
 
25
dnl ------------------------------------------------------------------------
 
26
 
 
27
dnl Configuring the gcw driver and the plplotcanvas support needs the
 
28
dnl pkg-config program
 
29
 
 
30
dnl Test for pkg-config
 
31
 
 
32
AC_CHECK_PROG(PKG_CONFIG_CHECK, pkg-config, yes, no)
 
33
 
 
34
if test "$PKG_CONFIG_CHECK" = "no"; then
 
35
 
 
36
  AC_MSG_WARN([pkg-config not found])
 
37
  AC_MSG_WARN([Setting enable_gcw and enable_pygcw to no])
 
38
  
 
39
  enable_gcw=no
 
40
  enable_pygcw=no
 
41
 
 
42
else
 
43
 
 
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
 
46
 
 
47
 
 
48
dnl Flag whether or not to include the python binding
 
49
if test "$enable_python" = "yes" -a "$enable_gcw" = "yes"; then
 
50
  enable_pygcw=yes
 
51
else
 
52
  enable_pygcw=no
 
53
fi
 
54
 
 
55
 
 
56
dnl Test for libraries, header files, etc etc etc
 
57
if test "$enable_gcw" = "yes"; then
 
58
 
 
59
  dnl Test for libgnomeui required by gcw/plplotcanvas
 
60
  PKG_CHECK_MODULES(GCW,libgnomeui-2.0,, enable_gcw=no )
 
61
 
 
62
  dnl Test for libgnomeprintui required by gcw/plplotcanvas
 
63
  PKG_CHECK_MODULES(GCW,libgnomeprintui-2.2,, enable_gcw=no )
 
64
 
 
65
 
 
66
  dnl Continue if the required libraries exist
 
67
  if test "$enable_gcw" = "no"; then
 
68
 
 
69
      AC_MSG_WARN([required libraries not found via pkg-config;]) 
 
70
      AC_MSG_WARN([  gcw/plplotcanvas driver disabled])
 
71
 
 
72
  else
 
73
 
 
74
    dnl Test for gthread-2.0 required by plplotcanvas_animation.c example
 
75
    PKG_CHECK_MODULES(GCWTHREAD,gthread-2.0,, enable_gcwthread=no )
 
76
 
 
77
    dnl Test for the header files required by gcw/plplotcanvas
 
78
    headers=yes
 
79
    CPPFLAGS="$CPPFLAGS $GCW_CFLAGS"
 
80
 
 
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 )
 
87
 
 
88
    if test "$headers" = "no"; then
 
89
      AC_MSG_WARN([required headers not found; gcw/plplotcanvas])
 
90
      AC_MSG_WARN([  driver disabled])
 
91
      enable_gcw=no
 
92
    fi
 
93
 
 
94
  fi
 
95
 
 
96
 
 
97
  dnl Test for python binding requirements
 
98
  if test "$enable_gcw" = "yes" -a "$enable_pygcw" = "yes"; then
 
99
 
 
100
    dnl Test for the required libraries
 
101
 
 
102
    dnl Test for pygtk required by gcw/plplotcanvas
 
103
    PKG_CHECK_MODULES(PYGCW,pygtk-2.0,, enable_pygcw=no )
 
104
 
 
105
    dnl Test for gnome-python required by gcw/plplotcanvas
 
106
    PKG_CHECK_MODULES(GNOME_PYTHON, gnome-python-2.0, [], enable_pygcw=no)
 
107
 
 
108
    if test "$enable_pygcw" = "no"; then
 
109
 
 
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])
 
113
 
 
114
    else
 
115
 
 
116
      dnl Test for the required headers
 
117
      CPPFLAGS="$CPPFLAGS $PYGCW_CFLAGS"
 
118
      AC_CHECK_HEADERS([glib-object.h],, headers=no )
 
119
 
 
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])
 
123
        enable_pygcw=no
 
124
      else
 
125
 
 
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])
 
132
          enable_pygcw=no
 
133
        else
 
134
          AC_MSG_RESULT(yes)
 
135
        fi
 
136
      fi
 
137
    fi
 
138
  else
 
139
    enable_pygcw=no
 
140
  fi
 
141
fi
 
142
 
 
143
#
 
144
# GCW_LIBS all libs needed by the gcw driver.
 
145
 
 
146
 
 
147
fi # if test "$with_pkg_config""
 
148
 
 
149
if test "$enable_gcw" = yes ; then
 
150
  gcw_true=""
 
151
  gcw_false="# "
 
152
else
 
153
  gcw_true="# "
 
154
  gcw_false=""
 
155
fi
 
156
 
 
157
AC_SUBST(gcw_true)
 
158
AC_SUBST(gcw_false)
 
159
 
 
160
dnl The choice of the names GCW_FLAGS and GCW_LIBS is made by
 
161
dnl the PKG_CHECK_MODULES macro.
 
162
 
 
163
AC_SUBST(enable_gcw)
 
164
AC_SUBST(GCW_CFLAGS)
 
165
AC_SUBST(GCW_LIBS)
 
166
AC_SUBST(PYGCW_CFLAGS)
 
167
AC_SUBST(PYGCW_LIBS)
 
168
AC_SUBST(GCWTHREAD_CFLAGS)
 
169
AC_SUBST(GCWTHREAD_LIBS)
 
170
 
 
171
AM_CONDITIONAL(enable_gcw, [test "$enable_gcw" = yes])
 
172
AM_CONDITIONAL(enable_pygcw, [test "$enable_pygcw" = yes])
 
173
AC_CONFIG_FILES([
 
174
    bindings/gnome2/Makefile
 
175
    bindings/gnome2/lib/Makefile
 
176
    bindings/gnome2/python/Makefile
 
177
])