File: configure.ac

package info (click to toggle)
gnome-python-extras 2.14.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,756 kB
  • ctags: 731
  • sloc: sh: 8,856; ansic: 5,011; xml: 1,319; python: 725; makefile: 415
file content (304 lines) | stat: -rw-r--r-- 10,500 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
-*- mode: autoconf -*-
AC_PREREQ(2.52)

dnl the gnome-python version number
m4_define(gnome_python_extras_major_version, 2)
m4_define(gnome_python_extras_minor_version, 14)
m4_define(gnome_python_extras_micro_version, 3)
m4_define(gnome_python_extras_version, gnome_python_extras_major_version.gnome_python_extras_minor_version.gnome_python_extras_micro_version)

dnl required versions of other packages
m4_define(pygtk_required_major_version, 2)
m4_define(pygtk_required_minor_version, 4)
m4_define(pygtk_required_micro_version, 0)
m4_define(pygtk_required_version, pygtk_required_major_version.pygtk_required_minor_version.pygtk_required_micro_version)
m4_define(glib_required_version,              2.6.0)
m4_define(gtk_required_version,               2.4.0)
m4_define(gnome_python_required_version,      2.10.0)
m4_define(gtkhtml2_required_version,          2.3.1)
m4_define(mozilla_required_version,           1.2b)
m4_define(firefox_required_version,           1.0)
m4_define(xulrunner_required_version,         1.8)
m4_define(libgda_required_version,            1.2.0)
m4_define(gksu_required_version,              1.2.5)
m4_define(gksuui_required_version,            1.0.3)

AC_INIT(gnome-python-extras, gnome_python_extras_version,
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-python])
dnl AC_CONFIG_SRCDIR([gnome/uimodule.c])
AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE

AC_DEFINE(GNOME_PYTHON_EXTRAS_MAJOR_VERSION, gnome_python_extras_major_version,
                                            [Gnome-Python-Extras major version])
AC_DEFINE(GNOME_PYTHON_EXTRAS_MINOR_VERSION, gnome_python_extras_minor_version,
                                            [Gnome-Python-Extras minor version])
AC_DEFINE(GNOME_PYTHON_EXTRAS_MICRO_VERSION, gnome_python_extras_micro_version,
                                            [Gnome-Python-Extras macro version])

GNOME_COMMON_INIT

AC_DISABLE_STATIC
AC_PROG_LIBTOOL

dnl check for python
AM_PATH_PYTHON(2.3)
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])

dnl check for pygtk
PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= pygtk_required_version)
AC_SUBST(PYGTK_CFLAGS)
AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
if test "x$PYGTK_CODEGEN" = xno; then
  AC_MSG_ERROR(could not find pygtk-codegen-2.0 script)
fi

AC_MSG_CHECKING([for conflicting pygtk versions])
pygtk_version=`$PKG_CONFIG --modversion pygtk-2.0`
case $pygtk_version in
     2.9.0|2.9.1)
        AC_MSG_RESULT([found $pygtk_version])
        AC_MSG_ERROR([invalid pygtk version found; please upgrade])
        ;;
     *)
        AC_MSG_RESULT([none])
        ;;
esac

AC_MSG_CHECKING(for pygtk defs)
PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
AC_SUBST(PYGTK_DEFSDIR)
AC_MSG_RESULT($PYGTK_DEFSDIR)

AC_MSG_CHECKING(for gnome-python defs)
GNOME_PYTHON_DEFSDIR=`$PKG_CONFIG --variable=defsdir gnome-python-2.0`
AC_SUBST(GNOME_PYTHON_DEFSDIR)
AC_MSG_RESULT($GNOME_PYTHON_DEFSDIR)

AC_MSG_CHECKING(for gnome-python argtypes dir)
GNOME_PYTHON_ARGTYPES_DIR=`$PKG_CONFIG --variable=argtypesdir gnome-python-2.0`
AC_SUBST(GNOME_PYTHON_ARGTYPES_DIR)
AC_MSG_RESULT($GNOME_PYTHON_ARGTYPES_DIR)

dnl get rid of the -export-dynamic stuff from the configure flags ...
export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`

dnl check for glib
AM_PATH_GLIB_2_0(glib_required_version,,[AC_MSG_ERROR(maybe you want the gtk-gnome-1-2 branch?)],$extras_mods)
if test -n "$export_dynamic"; then
  GLIB_LIBS=`echo $GLIB_LIBS | sed -e "s/$export_dynamic//"`
fi

dnl check to make sure we can find gtk
AM_PATH_GTK_2_0(gtk_required_version,,[AC_MSG_ERROR(maybe you want the gtk-gnome-1-2 branch?)],$extras_mods)
if test -n "$export_dynamic"; then
  GTK_LIBS=`echo $GTK_LIBS | sed -e "s/$export_dynamic//"`
fi


dnl should we build the gtkhtml2 module?
PKG_CHECK_MODULES(GTKHTML2, libgtkhtml-2.0 >= gtkhtml2_required_version,
  build_gtkhtml2=true,
  build_gtkhtml2=false)
AC_SUBST(GTKHTML2_CFLAGS)
AC_SUBST(GTKHTML2_LIBS)
AM_CONDITIONAL(BUILD_GTKHTML2, $build_gtkhtml2)
if test -n "$export_dynamic"; then
  GTKHTML2_LIBS=`echo $GTKHTML2_LIBS | sed -e "s/$export_dynamic//"`
fi


dnl should we build the egg.trayicon module?
build_eggtray=false
PKG_CHECK_MODULES(EGGTRAY, [gtk+-2.0 >= 2.2.0],
  build_eggtray=true,
  build_eggtray=false)
AM_CONDITIONAL(BUILD_EGGTRAY, $build_eggtray)
if test -n "$export_dynamic"; then
  EGGTRAY_LIBS=`echo $EGGTRAY_LIBS | sed -e "s/$export_dynamic//"`
fi

dnl should we build the egg.recent module?
build_eggrecent=false
PKG_CHECK_MODULES(EGG_RECENT, [gtk+-2.0 >= 2.0.0 gnome-vfs-2.0
                               libbonoboui-2.0 libgnomeui-2.0
                               gnome-python-2.0 >= gnome_python_required_version],
  build_eggrecent=true,
  build_eggrecent=false)
AM_CONDITIONAL(BUILD_EGGRECENT, $build_eggrecent)
if test -n "$export_dynamic"; then
  EGGRECENT_LIBS=`echo $EGGRECENT_LIBS | sed -e "s/$export_dynamic//"`
fi


dnl should we build the gtkmozembed module?
build_gtkmozembed=false
AC_ARG_WITH(gtkmozembed, AS_HELP_STRING(
                         [--with-gtkmozembed=mozilla|firefox|xulrunner],
                         [package that provides libgtkmozembed]),
            [mozpackage=$withval], [mozpackage=any])

if test $mozpackage = any ; then

PKG_CHECK_MODULES(GTKMOZEMBED, [xulrunner-gtkmozembed >= xulrunner_required_version
                                gtk+-2.0              >= gtk_required_version],
  [build_gtkmozembed=true; mozpackage=xulrunner],
  [
PKG_CHECK_MODULES(GTKMOZEMBED, [firefox-gtkmozembed >= firefox_required_version
                                gtk+-2.0            >= gtk_required_version],
  [build_gtkmozembed=true; mozpackage=firefox],
  [
PKG_CHECK_MODULES(GTKMOZEMBED, [mozilla-gtkmozembed >= mozilla_required_version
                                gtk+-2.0            >= gtk_required_version],
  [build_gtkmozembed=true; mozpackage=mozilla],
  build_gtkmozembed=false)
  ])
  ])

else

case $mozpackage in
     xulrunner) mozpackage_required_version=xulrunner_required_version ;;
     firefox) mozpackage_required_version=firefox_required_version ;;
     mozilla) mozpackage_required_version=mozilla_required_version ;;
     *) AC_MSG_ERROR([--with-gtkmozembed argument must be either 'mozilla', 'firefox', or 'xulrunner'])
esac

PKG_CHECK_MODULES(GTKMOZEMBED, [$mozpackage-gtkmozembed >= $mozpackage_required_version,
                                gtk+-2.0                >= gtk_required_version],
  build_gtkmozembed=true,
  build_gtkmozembed=false)

fi

AM_CONDITIONAL(BUILD_GTKMOZEMBED, $build_gtkmozembed)
if test -n "$export_dynamic"; then
  GTKMOZEMBED_LIBS=`echo $GTKMOZEMBED_LIBS | sed -e "s/$export_dynamic//"`
fi
MOZILLA_HOME="`$PKG_CONFIG --variable=libdir $mozpackage-gtkmozembed`"
AC_SUBST(MOZILLA_HOME)


dnl should we build the gtkspell module?
build_gtkspell=false
PKG_CHECK_MODULES(GTKSPELL, [gtkspell-2.0 >= 2.0.0 pygtk-2.0 >= pygtk_required_version],
  build_gtkspell=true,
  build_gtkspell=false)
AM_CONDITIONAL(BUILD_GTKSPELL, $build_gtkspell)
if test -n "$export_dynamic"; then
  GTKSPELL_LIBS=`echo $GTKSPELL_LIBS | sed -e "s/$export_dynamic//"`
fi

dnl should we build the gdl module?
build_gdl=false
have_gdl07=false
PKG_CHECK_MODULES(GDL, [gdl-1.0 >= 0.7.1 gdl-gnome-1.0 >= 0.7.1 pygtk-2.0 >= pygtk_required_version], dnl
                  [build_gdl=true; have_gdl07=true], build_gdl=false)

dnl try again with no gnome and older version
if ! $build_gdl; then
  PKG_CHECK_MODULES(GDL, [gdl-1.0 >= 0.6.1 pygtk-2.0 >= pygtk_required_version], dnl
                    build_gdl=true, build_gdl=false)
fi

AM_CONDITIONAL(BUILD_GDL, $build_gdl)
if test -n "$export_dynamic"; then
  GDL_LIBS=`echo $GDL_LIBS | sed -e "s/$export_dynamic//"`
fi

if $have_gdl07; then
  AC_DEFINE([HAVE_GDL_0_7], [], [If GDL >= 0.7 was found])
fi

AC_SUBST([PYGTK_CODEGEN_DEFINES])
if $have_gdl07; then
  PYGTK_CODEGEN_DEFINES="-DHAVE_GDL_0_7 $PYGTK_CODEGEN_DEFINES";
fi


dnl should we build the gda module?
build_gda=false
PKG_CHECK_MODULES(GDA, [libgda >= libgda_required_version pygtk-2.0 >= pygtk_required_version],
  build_gda=true,
  build_gda=false)
AM_CONDITIONAL(BUILD_GDA, $build_gda)
if test -n "$export_dynamic"; then
  GDA_LIBS=`echo $GDA_LIBS | sed -e "s/$export_dynamic//"`
fi

dnl should we build the gksu module?
build_gksu=false
PKG_CHECK_MODULES(GKSU, [libgksu1.2 >= gksu_required_version
                         pygtk-2.0 >= pygtk_required_version],
  build_gksu=true,
  build_gksu=false)
AM_CONDITIONAL(BUILD_GKSU, $build_gksu)
if test -n "$export_dynamic"; then
  GKSU_LIBS=`echo $GKSU_LIBS | sed -e "s/$export_dynamic//"`
fi

dnl should we build the gksu.ui module?
build_gksuui=false
PKG_CHECK_MODULES(GKSUUI, [libgksuui1.0 >= gksuui_required_version
                           pygtk-2.0 >= pygtk_required_version],
  build_gksuui=true,
  build_gksuui=false)
AM_CONDITIONAL(BUILD_GKSUUI, $build_gksuui)
if test -n "$export_dynamic"; then
  GKSUUI_LIBS=`echo $GKSUUI_LIBS | sed -e "s/$export_dynamic//"`
fi


dnl add required cflags ...
JH_ADD_CFLAG([-Wall])
dnl commented because it causes compilation problems in egg/recent
dnl JH_ADD_CFLAG([-std=c9x])
JH_ADD_CFLAG([-fno-strict-aliasing])


AC_CONFIG_FILES(
  Makefile
  gtkhtml2/Makefile
  egg/Makefile
  egg/tray/Makefile
  egg/recent/Makefile
  gtkmozembed/Makefile
  gtkspell/Makefile
  gdl/Makefile
  gda/Makefile
  gda/pygda-1.2.pc
  gksu/Makefile
  gnome-python-extras-2.0.pc
  tests/Makefile
  docs/Makefile
  docs/gtkmozembed/Makefile
  docs/gtkspell/Makefile
)
AC_OUTPUT

echo
echo "The following modules will be built:"
echo
$build_gtkhtml2          && echo     gtkhtml2
$build_eggtray           && echo     egg.trayicon
$build_eggrecent         && echo     egg.recent
$build_gtkmozembed       && echo     gtkmozembed	"(linking to $mozpackage)"
$build_gtkspell          && echo     gtkspell
$build_gdl               && echo     gdl
$build_gda               && echo     gda
$build_gksu              && echo     gksu
$build_gksuui            && echo     gksu.ui
echo

echo "The following modules will NOT be built:"
echo
$build_gtkhtml2          || echo     gtkhtml2
$build_eggtray           || echo     egg.trayicon
$build_eggrecent         || echo     egg.recent
$build_gtkmozembed       || echo     gtkmozembed
$build_gtkspell          || echo     gtkspell
$build_gdl               || echo     gdl
$build_gda               || echo     gda
$build_gksu              || echo     gksu
$build_gksuui            || echo     gksu.ui