~ubuntu-branches/ubuntu/trusty/gnome-python/trusty

1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
1
-*- mode: autoconf -*-
2
AC_PREREQ(2.52)
3
4
dnl the gnome-python version number
5
m4_define(gnome_python_major_version, 2)
1.1.28 by Sebastien Bacher
Import upstream version 2.28.0
6
m4_define(gnome_python_minor_version, 28)
1.1.29 by Josselin Mouette
Import upstream version 2.28.1
7
m4_define(gnome_python_micro_version, 1)
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
8
m4_define(gnome_python_version, dnl
9
  gnome_python_major_version.gnome_python_minor_version.gnome_python_micro_version)
10
11
dnl required versions of other packages
12
m4_define(pygtk_required_major_version, 2)
13
m4_define(pygtk_required_minor_version, 10)
14
m4_define(pygtk_required_micro_version, 3)
15
m4_define(pygtk_required_version, pygtk_required_major_version.pygtk_required_minor_version.pygtk_required_micro_version)
16
m4_define(pyorbit_required_version,           2.0.1)
17
m4_define(glib_required_version,              2.6.0)
18
m4_define(gtk_required_version,               2.6.0)
19
m4_define(libgnome_required_version,          2.8.0)
20
m4_define(libgnomeui_required_version,        2.8.0)
21
m4_define(libgnomecanvas_required_version,    2.8.0)
1.1.13 by Sebastien Bacher
Import upstream version 2.18.0
22
m4_define(libgnomevfs_required_version,       2.14.0)
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
23
m4_define(gconf_required_version,             2.11.1)
24
m4_define(bonobo_activation_required_version, 2.8.0)
25
m4_define(libbonobo_required_version,         2.8.0)
26
m4_define(libbonoboui_required_version,       2.8.0)
1.1.27 by Sebastien Bacher
Import upstream version 2.27.1
27
m4_define(pygobject_required_version,         2.17.0)
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
28
29
AC_INIT(gnome-python, gnome_python_version,
30
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-python])
31
dnl AC_CONFIG_SRCDIR([gnome/uimodule.c])
32
AM_CONFIG_HEADER(config.h)
33
34
AM_INIT_AUTOMAKE
35
36
AC_DEFINE(GNOME_PYTHON_MAJOR_VERSION, gnome_python_major_version, [Gnome-Python major version])
37
AC_DEFINE(GNOME_PYTHON_MINOR_VERSION, gnome_python_minor_version, [Gnome-Python minor version])
38
AC_DEFINE(GNOME_PYTHON_MICRO_VERSION, gnome_python_micro_version, [Gnome-Python macro version])
39
40
dnl Define pygtk required version, for runtime check
41
AC_DEFINE(PYGTK_REQUIRED_MAJOR_VERSION, pygtk_required_major_version, [PyGTK required major version])
42
AC_DEFINE(PYGTK_REQUIRED_MINOR_VERSION, pygtk_required_minor_version, [PyGTK required minor version])
43
AC_DEFINE(PYGTK_REQUIRED_MICRO_VERSION, pygtk_required_micro_version, [PyGTK required micro version])
44
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
45
dnl AC_ARG_BINDING(NAME, DEFAULT [, MODULENAME])
46
AC_DEFUN([AC_ARG_BINDING],
47
[AC_ARG_ENABLE([$1],
48
             AC_HELP_STRING([--ifelse([$2], [YES], dis, en)able-[$1]],
49
                            [build ifelse([$3], , [$1], [$3]) module (default is [$2])]),
50
             [if test "$enable_[$1]" = "yes"; then 
51
	     		build_[$1]=true
52
			  else
53
				build_[$1]=false
54
			 fi])
55
])
56
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
57
GNOME_COMMON_INIT
58
59
dnl put the ACLOCAL flags in the makefile
60
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
61
62
AC_DISABLE_STATIC
63
AC_PROG_LIBTOOL
1.1.24 by Didier Roche
Import upstream version 2.25.90
64
dnl when using libtool 2.x create libtool early, because it's used in configure
65
m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
66
67
dnl check for python
68
AM_PATH_PYTHON(2.2)
69
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers or library)])
70
dnl make the python compiler used globally
71
CC="$PYTHON_CC"
72
1.1.27 by Sebastien Bacher
Import upstream version 2.27.1
73
dnl check for pygobject
74
PKG_CHECK_MODULES(PYGOBJECT, pygobject-2.0 >= pygobject_required_version)
75
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
76
dnl check for pygtk
77
PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= pygtk_required_version)
78
AC_SUBST(PYGTK_CFLAGS)
1.1.22 by Sebastien Bacher
Import upstream version 2.22.2
79
80
dnl check for codegen script
1.1.23 by Sebastien Bacher
Import upstream version 2.22.3
81
AC_PATH_PROG(PYGOBJECT_CODEGEN, pygobject-codegen-2.0, no)
82
if test "x$PYGOBJECT_CODEGEN" = xno; then
1.1.22 by Sebastien Bacher
Import upstream version 2.22.2
83
  dnl This is for compat with older releases when codegen was shipped
84
  dnl in pygtk. It should be removed in future releases.
1.1.23 by Sebastien Bacher
Import upstream version 2.22.3
85
  AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
86
  if test "x$PYGTK_CODEGEN" = xno; then
1.1.22 by Sebastien Bacher
Import upstream version 2.22.2
87
    AC_MSG_ERROR(could not find pygobject-codegen-2.0 script)
1.1.23 by Sebastien Bacher
Import upstream version 2.22.3
88
  else
89
    AC_SUBST(PYGNOME_CODEGEN, $PYGTK_CODEGEN)
1.1.22 by Sebastien Bacher
Import upstream version 2.22.2
90
  fi
1.1.23 by Sebastien Bacher
Import upstream version 2.22.3
91
else
92
  AC_SUBST(PYGNOME_CODEGEN, $PYGOBJECT_CODEGEN)
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
93
fi
94
95
AC_MSG_CHECKING([for conflicting pygtk versions])
96
pygtk_version=`$PKG_CONFIG --modversion pygtk-2.0`
97
case $pygtk_version in
98
     2.9.0|2.9.1)
99
        AC_MSG_RESULT([found $pygtk_version])
100
        AC_MSG_ERROR([invalid pygtk version found; please upgrade])
101
        ;;
102
     *)
103
        AC_MSG_RESULT([none])
104
        ;;
105
esac
106
107
AC_MSG_CHECKING(for pygtk defs)
108
PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
109
AC_SUBST(PYGTK_DEFSDIR)
110
AC_MSG_RESULT($PYGTK_DEFSDIR)
111
112
dnl required version substitutions for use in the spec file
113
PYGTK_VERSION=pygtk_required_version
114
LIBGNOMECANVAS_VERSION=libgnomecanvas_required_version
115
LIBGNOME_VERSION=libgnome_required_version
116
LIBGNOMEVFS_VERSION=libgnomevfs_required_version
117
GTK_VERSION=gtk_required_version
118
PYORBIT_VERSION=pyorbit_required_version
119
BONOBO_ACTIVATION_VERSION=bonobo_activation_required_version
120
LIBBONOBO_VERSION=libbonobo_required_version
121
LIBBONOBOUI_VERSION=libbonoboui_required_version
122
GCONF_VERSION=gconf_required_version
123
AC_SUBST(PYGTK_VERSION)
124
AC_SUBST(LIBGNOMECANVAS_VERSION)
125
AC_SUBST(LIBGNOME_VERSION)
126
AC_SUBST(LIBGNOMEVFS_VERSION)
127
AC_SUBST(GLIB_VERSION)
128
AC_SUBST(GTK_VERSION)
129
AC_SUBST(PYORBIT_VERSION)
130
AC_SUBST(BONOBO_ACTIVATION_VERSION)
131
AC_SUBST(LIBBONOBO_VERSION)
132
AC_SUBST(LIBBONOBOUI_VERSION)
133
AC_SUBST(GCONF_VERSION)
134
135
dnl get rid of the -export-dynamic stuff from the configure flags ...
136
export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
137
138
dnl check for glib
139
AM_PATH_GLIB_2_0(glib_required_version,,[AC_MSG_ERROR(maybe you want the gtk-gnome-1-2 branch?)],$extra_mods)
140
if test -n "$export_dynamic"; then
141
  GLIB_LIBS=`echo $GLIB_LIBS | sed -e "s/$export_dynamic//"`
142
fi
143
144
dnl check to make sure we can find gtk
145
AM_PATH_GTK_2_0(gtk_required_version,,[AC_MSG_ERROR(maybe you want the gtk-gnome-1-2 branch?)],$extra_mods)
146
if test -n "$export_dynamic"; then
147
  GTK_LIBS=`echo $GTK_LIBS | sed -e "s/$export_dynamic//"`
148
fi
149
150
dnl ****************************************************************************
151
dnl * Check for prctl() or setproctitle()
152
dnl ****************************************************************************
153
AC_CHECK_FUNCS(prctl setproctitle)
154
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
155
AC_ARG_ENABLE([gtk-doc],
156
             AC_HELP_STRING([--disable-gtk-doc],
157
                            [Disables gtk-doc documentation generation]),,
158
		[enable_gtk_doc="yes"])
159
AM_CONDITIONAL(BUILD_DOCS, [test "$enable_gtk_doc" = "yes"])
160
161
dnl default bindings to build:
162
default_bindings_on="gnome gnomeui gnomecanvas gnomevfs gnomevfsbonobo pyvfsmodule gconf bonobo_activation bonobo bonoboui"
163
default_bindings_off=""
164
default_bindings_all="$default_bindings_on $default_bindings_off"
165
166
AC_ARG_ENABLE([allbindings],
167
             AC_HELP_STRING([--disable-allbindings],
168
                            [Changes all the bindings default values to be either enabled or disabled, overridden by any explicit bindings on the commandline.]),
169
             [if test "$enable_allbindings" = "no"; then
170
			   default_bindings_off="$default_bindings_all"
171
			   default_bindings_on=""
172
		  	 else
173
			   default_bindings_off=""
174
			   default_bindings_on="$default_bindings_all"
175
		     fi])
176
for binding in $default_bindings_on; do
177
	eval build_$binding=true
178
done
179
for binding in $default_bindings_off; do
180
	eval build_$binding=false
181
done
182
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
183
184
have_pyorbit=false
185
PKG_CHECK_MODULES(PYORBIT,
186
  pyorbit-2 >= pyorbit_required_version,
187
  have_pyorbit=true, have_pyorbit=false)
188
AC_SUBST(PYORBIT_CFLAGS)
189
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
190
AC_ARG_BINDING([gnome], [ON])
191
if $build_gnome; then
192
  PKG_CHECK_MODULES(GNOME, libgnome-2.0 >= libgnome_required_version,,
193
    [AC_MSG_ERROR(libgnome-2.0 is required.)])
194
  AC_SUBST(GNOME_CFLAGS)
195
  AC_SUBST(GNOME_LIBS)
196
  if test -n "$export_dynamic"; then
197
    GNOME_LIBS=`echo $GNOME_LIBS | sed -e "s/$export_dynamic//"`
198
  fi
199
fi
200
AM_CONDITIONAL(BUILD_GNOME, $build_gnome)
201
202
AC_ARG_BINDING([gnomeui], [ON], [gnome.ui])
203
if $build_gnomeui; then
204
  PKG_CHECK_MODULES(GNOMEUI, libgnomeui-2.0 >= libgnomeui_required_version,
205
    build_gnomeui=true,
206
    build_gnomeui=false)
207
  AC_SUBST(GNOMEUI_CFLAGS)
208
  AC_SUBST(GNOMEUI_LIBS)
209
fi
210
AM_CONDITIONAL(BUILD_GNOMEUI, $build_gnome && $have_pyorbit && $build_gnomeui)
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
211
if test -n "$export_dynamic"; then
212
  GNOMEUI_LIBS=`echo $GNOMEUI_LIBS | sed -e "s/$export_dynamic//"`
213
fi
214
215
dnl should we build the gnome.canvas module?
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
216
AC_ARG_BINDING([gnomecanvas], [ON])
217
if $build_gnomecanvas; then
218
  PKG_CHECK_MODULES(GNOMECANVAS, libgnomecanvas-2.0 >= libgnomecanvas_required_version,
219
    build_gnomecanvas=true,
220
    build_gnomecanvas=false)
221
  AC_SUBST(GNOMECANVAS_CFLAGS)
222
  AC_SUBST(GNOMECANVAS_LIBS)
223
fi
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
224
AM_CONDITIONAL(BUILD_GNOMECANVAS, $build_gnomecanvas)
225
if test -n "$export_dynamic"; then
226
  GNOMECANVAS_LIBS=`echo $GNOMECANVAS_LIBS | sed -e "s/$export_dynamic//"`
227
fi
228
229
dnl should we build the gnomevfs module?
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
230
AC_ARG_BINDING([gnomevfs], [ON])
231
if $build_gnomevfs; then
232
  PKG_CHECK_MODULES(GNOMEVFS, [gnome-vfs-2.0 >= libgnomevfs_required_version],
233
    build_gnomevfs=true,
234
    build_gnomevfs=false)
235
  AC_SUBST(GNOMEVFS_CFLAGS)
236
  AC_SUBST(GNOMEVFS_LIBS)
237
fi
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
238
AM_CONDITIONAL(BUILD_GNOMEVFS, $build_gnomevfs)
239
if test -n "$export_dynamic"; then
240
  GNOMEVFS_LIBS=`echo $GNOMEVFS_LIBS | sed -e "s/$export_dynamic//"`
241
fi
242
243
dnl should we build bonobo support into the gnomevfs module?
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
244
AC_ARG_BINDING([gnomevfsbonobo], [ON], [gnomevfs.bonobo])
245
if $build_gnomevfsbonobo; then
246
  PKG_CHECK_MODULES(GNOMEVFSBONOBO, [gnome-vfs-2.0 >= libgnomevfs_required_version dnl
247
				     bonobo-activation-2.0 >= bonobo_activation_required_version
248
				     pyorbit-2 >= pyorbit_required_version],
249
    build_gnomevfsbonobo=true,
250
    build_gnomevfsbonobo=false)
251
  AC_SUBST(GNOMEVFSBONOBO_CFLAGS)
252
  AC_SUBST(GNOMEVFSBONOBO_LIBS)
253
fi
254
AM_CONDITIONAL(BUILD_GNOMEVFSBONOBO, $build_gnomevfs && $build_gnomevfsbonobo)
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
255
if test -n "$export_dynamic"; then
256
  GNOMEVFSBONOBO_LIBS=`echo $GNOMEVFSBONOBO_LIBS | sed -e "s/$export_dynamic//"`
257
fi
258
259
260
dnl should we build the gnomevfs python module bridge?
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
261
AC_ARG_BINDING([pyvfsmodule], [ON], [bridge])
262
if $build_pyvfsmodule; then
263
  PKG_CHECK_MODULES(GNOME_VFS_MODULE, [gnome-vfs-module-2.0 >= libgnomevfs_required_version dnl
264
				       bonobo-activation-2.0 >= bonobo_activation_required_version],
265
    build_pyvfsmodule=true,
266
    build_pyvfsmodule=false)
267
fi
268
AM_CONDITIONAL(BUILD_PYVFSMODULE, $build_gnomevfs && $build_pyvfsmodule)
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
269
if test -n "$export_dynamic"; then
270
  GNOME_VFS_MODULE_LIBS=`echo $GNOME_VFS_MODULE_LIBS | sed -e "s/$export_dynamic//"`
271
fi
272
273
dnl should we build the gconf module?
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
274
AC_ARG_BINDING([gconf], [ON])
275
if $build_gconf; then
276
  PKG_CHECK_MODULES(GCONF, gconf-2.0 >= gconf_required_version,
277
    build_gconf=true,
278
    build_gconf=false)
279
  GCONF_INCLUDEDIR="`pkg-config gconf-2.0 --variable includedir`/gconf/2/gconf"
280
  AC_SUBST(GCONF_INCLUDEDIR)
281
  AC_SUBST(GCONF_CFLAGS)
282
  AC_SUBST(GCONF_LIBS)
283
fi
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
284
AM_CONDITIONAL(BUILD_GCONF, $build_gconf)
285
if test -n "$export_dynamic"; then
286
  GCONF_LIBS=`echo $GCONF_LIBS | sed -e "s/$export_dynamic//"`
287
fi
288
289
dnl should we build the bonobo.activation module?
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
290
AC_ARG_BINDING([bonobo_activation], [ON], [bonobo.activation])
291
if $build_bonobo_activation; then
292
  PKG_CHECK_MODULES(BONOBO_ACTIVATION, bonobo-activation-2.0 >= bonobo_activation_required_version,
293
    build_bonobo_activation=true, build_bonobo_activation=false)
294
  AC_SUBST(BONOBO_ACTIVATION_CFLAGS)
295
  AC_SUBST(BONOBO_ACTIVATION_LIBS)
296
fi
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
297
AM_CONDITIONAL(BUILD_BONOBO_ACTIVATION, $have_pyorbit && $build_bonobo_activation)
298
if test -n "$export_dynamic"; then
299
  BONOBO_ACTIVATION_LIBS=`echo $BONOBO_ACTIVATION_LIBS | sed -e "s/$export_dynamic//"`
300
fi
301
302
dnl should we build the bonobo._bonobo module?
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
303
AC_ARG_BINDING([bonobo], [ON], [bonobo._bonobo])
304
if $build_bonobo; then
305
  PKG_CHECK_MODULES(BONOBO, libbonobo-2.0 >= libbonobo_required_version,
306
    build_bonobo=true, build_bonobo=false)
307
  AC_SUBST(BONOBO_CFLAGS)
308
  AC_SUBST(BONOBO_LIBS)
309
fi
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
310
AM_CONDITIONAL(BUILD_BONOBO, $have_pyorbit && $build_bonobo)
311
if test -n "$export_dynamic"; then
312
  BONOBO_LIBS=`echo $BONOBO_LIBS | sed -e "s/$export_dynamic//"`
313
fi
314
315
dnl should we build the bonobo.ui module?
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
316
AC_ARG_BINDING([bonoboui], [ON], [bonobo.ui])
317
if $build_bonoboui; then
318
  PKG_CHECK_MODULES(BONOBOUI, libbonoboui-2.0 >= libbonoboui_required_version libgnome-2.0 >= libgnome_required_version,
319
    build_bonoboui=true, build_bonoboui=false)
320
  AC_SUBST(BONOBOUI_CFLAGS)
321
  AC_SUBST(BONOBOUI_LIBS)
322
fi
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
323
AM_CONDITIONAL(BUILD_BONOBOUI, $have_pyorbit && $build_bonoboui)
324
if test -n "$export_dynamic"; then
325
  BONOBOUI_LIBS=`echo $BONOBOUI_LIBS | sed -e "s/$export_dynamic//"`
326
fi
327
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
328
AM_CONDITIONAL(BUILD_BONOBO_ANY, $build_bonobo || $build_bonoboui || $build_bonobo_activation)
329
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
330
331
dnl add required cflags ...
332
JH_ADD_CFLAG([-Wall])
333
JH_ADD_CFLAG([-std=c9x])
334
JH_ADD_CFLAG([-fno-strict-aliasing])
335
336
AC_CONFIG_FILES(
337
  Makefile
338
  docs/Makefile
339
  docs/gnomevfs/Makefile
340
  gconf/Makefile
341
  gnome/Makefile
342
  gnomevfs/Makefile
343
  gnomecanvas/Makefile
344
  bonobo/Makefile
345
  tests/Makefile
346
  gnome-python.spec
347
  gnome-python-2.0.pc
348
  PKG-INFO)
349
AC_OUTPUT
350
351
echo
352
echo "The following modules will be built:"
353
echo
354
$build_gnome             && echo     gnome
355
$build_gnomeui           && $have_pyorbit && echo     gnome.ui
356
$build_gnomecanvas       && echo     gnomecanvas
357
$build_gnomevfs          && echo     gnomevfs
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
358
$build_gnomevfsbonobo    && echo     gnomevfs.bonobo
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
359
$build_pyvfsmodule       && echo     gnome-vfs python module support
360
$build_gconf             && echo     gconf
361
$build_bonobo            && $have_pyorbit && echo     bonobo
362
$build_bonobo_activation && $have_pyorbit && echo     bonobo.activation
363
$build_bonoboui          && $have_pyorbit && echo     bonobo.ui
364
echo
365
366
echo "The following modules will NOT be built:"
367
echo
368
$build_gnome             || echo     gnome
369
$build_gnomeui           && $have_pyorbit || echo     gnome.ui
370
$build_gnomecanvas       || echo     gnomecanvas
371
$build_gnomevfs          || echo     gnomevfs
1.1.21 by Sebastien Bacher
Import upstream version 2.22.1
372
$build_gnomevfsbonobo    || echo     gnomevfs.bonobo
1.1.10 by Sebastien Bacher
Import upstream version 2.17.1
373
$build_pyvfsmodule       || echo     gnome-vfs python module support
374
$build_gconf             || echo     gconf
375
$build_bonobo            && $have_pyorbit || echo     bonobo
376
$build_bonobo_activation && $have_pyorbit || echo     bonobo.activation
377
$build_bonoboui          && $have_pyorbit || echo     bonobo.ui
378
379
if $have_pyorbit; then
380
  :
381
else
382
  echo
383
  echo "Note: PyORBit pyorbit_required_version or later is required by bonobo"
384
  echo "and gnomeui bindings."
385
  echo "Download it from: http://ftp.gnome.org/pub/GNOME/sources/pyorbit/2.0/"
386
fi
1.1.19 by Sebastien Bacher
Import upstream version 2.21.1
387
388
echo "*****************************************************************************"
389
echo "*** WARNING: You are using a deprecated build system (autotools)."
390
echo "***          You should be using WAF instead; see the file INSTALL.WAF."
391
echo "***          The autotools build system will be removed in a future version."
392
echo "*****************************************************************************"