1 AC_INIT([purple-plugin_pack], [2.6.0], [plugins-devel@lists.guifications.org])
3 AM_CONFIG_HEADER(pre_config.h)
5 AM_INIT_AUTOMAKE([foreign dist-bzip2])
9 AC_DEFINE_UNQUOTED(PP_VERSION, "AC_PACKAGE_VERSION", [Plugin Pack Version])
11 AC_PATH_PROG(sedpath, sed)
14 dnl #######################################################################
15 dnl # Initialize some variables that get passed to plugin_pack.py
16 dnl #######################################################################
19 dnl #######################################################################
21 dnl #######################################################################
22 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
23 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
24 m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:])
25 m4_defun([_LT_AC_LANG_RC_CONFIG], [:])
27 LIBTOOL="$LIBTOOL --silent"
29 dnl #######################################################################
30 dnl # I'm lazy and figured config.h is the best place for this ;)
31 dnl #######################################################################
32 AC_DEFINE_UNQUOTED(PP_WEBSITE, "http://plugins.guifications.org/trac", [Plugin Pack Website])
34 dnl #######################################################################
36 dnl #######################################################################
37 AH_TOP([ /* our header */
42 #endif /* PP_CONFIG_H */
45 dnl #######################################################################
46 dnl # Good ol' gettext
47 dnl #######################################################################
50 GETTEXT_PACKAGE=plugin_pack
51 AC_SUBST(GETTEXT_PACKAGE)
52 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used.])
53 ALL_LINGUAS="en_AU es_ES fr vi"
56 dnl #######################################################################
57 dnl # Look for the C compiler
58 dnl #######################################################################
63 AC_ARG_ENABLE(debug, [ --enable-debug compile with debugging support],,enable_debug=no)
65 if test "x$enable_debug" = "xyes" ; then
66 AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
69 if test "x$GCC" = "xyes"; then
70 CFLAGS="$CFLAGS -Wall -g3"
74 dnl #######################################################################
75 dnl # Check for purple
76 dnl #######################################################################
77 PKG_CHECK_MODULES(PURPLE, purple,
79 AC_DEFINE(HAVE_PURPLE, 1, [Define if we've found libpurple.])
83 AM_CONDITIONAL(HAVE_PURPLE, true)
84 DEPENDENCIES="$DEPENDENCIES,purple"
86 if test x"$prefix" = x"NONE" ; then
87 PURPLE_LIBDIR=`pkg-config --variable=libdir purple`
88 PURPLE_DATADIR=`pkg-config --variable=datadir purple`
90 PURPLE_LIBDIR="$libdir"
91 PURPLE_DATADIR="$datadir"
96 # this is a hack but should work fine.
97 # we use the libpurple datadir for PP_LOCALEDIR since we are not breaking up
98 # the pot's yet, and need to make sure they goto the same place
99 PP_LOCALEDIR="PURPLE_DATADIR/locale"
100 AC_DEFINE_UNQUOTED(PP_LOCALEDIR, ["$PP_LOCALEDIR"], [The localedir to use])
102 if test x"$PURPLE_LIBDIR" != x"" ; then
103 PURPLE_LIBDIR="$PURPLE_LIBDIR/purple-2"
106 if test x"$PURPLE_DATADIR" != x"" ; then
107 PURPLE_PIXMAPSDIR="$PURPLE_DATADIR/pixmaps/libpurple"
108 AC_DEFINE_UNQUOTED(PURPLE_PIXMAPSDIR, "$PURPLE_PIXMAPSDIR", [Libpurple pixmaps directory])
111 AC_SUBST(PURPLE_CFLAGS)
112 AC_SUBST(PURPLE_LIBS)
113 AC_SUBST(PURPLE_LIBDIR)
114 AC_SUBST(PURPLE_DATADIR)
115 AC_SUBST(PURPLE_PIXMAPSDIR)
118 dnl #######################################################################
119 dnl # Check for pidgin
120 dnl #######################################################################
121 PKG_CHECK_MODULES(PIDGIN, pidgin,
123 AC_DEFINE(HAVE_PIDGIN, 1, [Define if we've found pidgin.])
125 AM_CONDITIONAL(HAVE_PIDGIN, true)
126 DEPENDENCIES="$DEPENDENCIES,pidgin"
130 AM_CONDITIONAL(HAVE_PIDGIN, false)
133 if test x"$prefix" = x"NONE" ; then
134 PIDGIN_LIBDIR=`pkg-config --variable=libdir pidgin`
135 PIDGIN_DATADIR=`pkg-config --variable=datadir pidgin`
137 PIDGIN_LIBDIR="$libdir"
138 PIDGIN_DATADIR="$datadir"
143 if test x"$PIDGIN_LIBDIR" != x"" ; then
144 PIDGIN_LIBDIR="$PIDGIN_LIBDIR/pidgin"
147 if test x"$PIDGIN_DATADIR" != x"" ; then
148 PIDGIN_PIXMAPSDIR="$PIDGIN_DATADIR/pixmaps/pidgin"
149 AC_DEFINE_UNQUOTED(PIDGIN_PIXMAPSDIR, "$PIDGIN_PIXMAPSDIR", [Pidgin pixmaps directory])
152 AC_SUBST(PIDGIN_CFLAGS)
153 AC_SUBST(PIDGIN_LIBS)
154 AC_SUBST(PIDGIN_LIBDIR)
155 AC_SUBST(PIDGIN_DATADIR)
156 AC_SUBST(PIDGIN_PIXMAPSDIR)
158 dnl #######################################################################
159 dnl # Check for finch
160 dnl #######################################################################
161 PKG_CHECK_MODULES(FINCH, finch,
163 AC_DEFINE(HAVE_FINCH, 1, [Define if we've found finch.])
165 AM_CONDITIONAL(HAVE_FINCH, true)
166 DEPENDENCIES="$DEPENDENCIES,finch"
170 AM_CONDITIONAL(HAVE_FINCH, false)
173 if test x"$prefix" = x"NONE" ; then
174 FINCH_LIBDIR=`pkg-config --variable=libdir finch`
175 FINCH_DATADIR=`pkg-config --variable=datadir finch`
177 FINCH_LIBDIR="$libdir"
178 FINCH_DATADIR="$datadir"
183 if test x"$FINCH_LIBDIR" != x"" ; then
184 FINCH_LIBDIR="$FINCH_LIBDIR/finch"
187 if test x"$FINCH_DATADIR" != x"" ; then
188 FINCH_PIXMAPSDIR="$FINCH_DATADIR/pixmaps/finch"
189 AC_DEFINE_UNQUOTED(FINCH_PIXMAPSDIR, "$FINCH_PIXMAPSDIR", [Finch pixmaps directory])
192 AC_SUBST(FINCH_CFLAGS)
194 AC_SUBST(FINCH_LIBDIR)
195 AC_SUBST(FINCH_DATADIR)
196 AC_SUBST(FINCH_PIXMAPSDIR)
198 dnl #######################################################################
200 dnl #######################################################################
202 PKG_CHECK_MODULES(GLIB, [glib-2.0], HAVE_GLIB="yes", HAVE_GLIB="no")
204 if test x"$HAVE_GLIB" = x"no" ; then
205 echo "glib development headers were not found. glib development headers"
206 echo "are required to build $PACKAGE."
209 AC_SUBST(GLIB_CFLAGS)
215 PKG_CHECK_MODULES(GTK, [gtk+-2.0], HAVE_GTK="yes", HAVE_GTK="no")
219 dnl #######################################################################
221 dnl #######################################################################
225 PKG_CHECK_MODULES(GNT, [gnt], HAVE_GNT="yes", HAVE_GNT="no")
229 dnl #######################################################################
230 dnl # check for pango
231 dnl #######################################################################
235 PKG_CHECK_MODULES(PANGO, [pango], HAVE_PANGO="yes", HAVE_PANGO="no")
236 AC_SUBST(PANGO_CFLAGS)
237 AC_SUBST(PANGO_CFLAGS)
239 if test x"$HAVE_PANGO" = x"yes" ; then
240 DEPENDENCIES="$DEPENDENCIES,pango"
243 dnl #######################################################################
244 dnl # check for cairo
245 dnl #######################################################################
249 PKG_CHECK_MODULES(CAIRO, [cairo], HAVE_CAIRO="yes", HAVE_CAIRO="no")
250 AC_SUBST(CAIRO_CFLAGS)
251 AC_SUBST(CAIRO_CFLAGS)
253 if test x"$HAVE_CAIRO" = x"yes" ; then
254 DEPENDENCIES="$DEPENDENCIES,cairo"
257 dnl #######################################################################
258 dnl # Check for talkfilters
259 dnl #######################################################################
260 AC_CHECK_HEADER(talkfilters.h, HAVE_TALKFILTERS=yes, AC_MSG_WARN([
261 *** GNU Talk Filters is required to build the talkfilters plugin;
262 *** please make sure you have the GNU Talk Filters development headers installed.
263 *** The latest version of GNU Talk Filters is available at
264 *** http://www.hyperrealm.com/talkfilters/talkfilters.html.])
267 AM_CONDITIONAL(USE_TALKFILTERS, test x"$HAVE_TALKFILTERS" = x"yes")
268 if test x"$HAVE_TALKFILTERS" = x"yes"; then
269 dnl work out that the library exists
270 AC_CHECK_LIB(talkfilters, gtf_filter_count, TALKFILTERS_LIBS="-ltalkfilters")
271 AC_SUBST(TALKFILTERS_LIBS)
273 DEPENDENCIES="$DEPENDENCIES,talkfilters"
276 dnl #######################################################################
277 dnl # Check for switchspell
278 dnl #######################################################################
280 PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, [], [gtkspell=no])
281 AC_SUBST(GTKSPELL_CFLAGS)
282 AC_SUBST(GTKSPELL_LIBS)
284 DEPENDENCIES="$DEPENDENCIES,gtkspell"
286 BUILD_SWITCH_SPELL=no
294 if test x"$gtkspell" = x"yes" ; then
295 AC_MSG_CHECKING([which backend gtkspell is compiled with])
297 $PKG_CONFIG --static --libs gtkspell-2.0 | grep -q enchant
298 if test $? -eq 0 ; then
299 AC_MSG_RESULT([enchant])
301 PKG_CHECK_MODULES(ENCHANT,
303 [BUILD_SWITCH_SPELL=yes],
304 [BUILD_SWITCH_SPELL=no])
306 AC_DEFINE(HAVE_ENCHANT, 1, [define if we've found enchant])
308 DEPENDENCIES="$DEPENDENCIES,enchant"
310 AC_MSG_RESULT([aspell])
312 AC_CHECK_HEADER([aspell.h], HAVE_ASPELL_H=yes, HAVE_ASPELL_H=no)
313 if test x"$HAVE_ASPELL_H" = x"yes" ; then
314 AC_CHECK_LIB([aspell], [new_aspell_config],
315 [ASPELL_LIBS="-laspell"
316 BUILD_SWITCH_SPELL=yes],
317 [BUILD_SWITCH_SPELL=no])
319 DEPENDENCIES="$DEPENDENCIES,aspell"
321 BUILD_SWITCH_SPELL=no
326 if test x"$BUILD_SWITCH_SPELL" = x"no" ; then
333 AM_CONDITIONAL(BUILD_SWITCH_SPELL, false)
335 AM_CONDITIONAL(BUILD_SWITCH_SPELL, true)
338 AC_SUBST(ASPELL_CFLAGS)
339 AC_SUBST(ASPELL_LIBS)
341 AC_SUBST(ENCHANT_CFLAGS)
342 AC_SUBST(ENCHANT_LIBS)
344 dnl #######################################################################
346 dnl #######################################################################
351 AC_PATH_PROG(XMMS_CONFIG, xmms-config, no)
352 if test x"$XMMS_CONFIG" != x"no" ; then
353 AC_MSG_CHECKING([for xmms >= 1.0.0])
354 # check the version of xmms config we found
355 XMMS_VERSION=`$XMMS_CONFIG --version`
356 if test x"$XMMS_VERSION" != x"" ; then
357 XMMS_MAJOR=`echo $XMMS_VERSION | cut -d. -f1`
358 XMMS_MINOR=`echo $XMMS_VERSION | cut -d. -f2`
360 if test $XMMS_MAJOR -ge 1 -a $XMMS_MINOR -ge 0 ; then
361 XMMS_LIBS=`$XMMS_CONFIG --libs`
362 XMMS_CFLAGS=`$XMMS_CONFIG --cflags`
368 if test x"$HAVE_XMMS" = x"yes" ; then
371 DEPENDENCIES="$DEPENDENCIES,xmms"
376 AM_CONDITIONAL(USE_XMMS, test x"$HAVE_XMMS" = x"yes")
378 AC_SUBST(XMMS_CFLAGS)
380 dnl #######################################################################
381 dnl # Check for some basic headers
382 dnl #######################################################################
383 AC_CHECK_HEADERS(regex.h)
385 dnl #######################################################################
386 dnl # Disable installation of translation files
387 dnl #######################################################################
388 AC_ARG_ENABLE(nls, AC_HELP_STRING([--enable-nls], [enable installation of translation files]), enable_i18n="$enableval", enable_i18n=yes)
390 AM_CONDITIONAL(INSTALL_I18N, test "x$enable_i18n" = "xyes")
392 dnl #######################################################################
394 dnl #######################################################################
395 AC_CONFIG_COMMANDS_PRE([
396 if test -e VERSION; then
397 cp -p VERSION VERSION.ac-save
401 AC_CONFIG_COMMANDS_POST([
402 cmp VERSION VERSION.ac-save || touch -r VERSION.ac-save VERSION
403 rm -f VERSION.ac-save
406 dnl #######################################################################
407 dnl # plugin_pack.py has already done our heavy lifting from the boot
408 dnl # strap. So we'll include our config file it created and call it to
409 dnl # determine our build directories
410 dnl #######################################################################
411 AC_PATH_PROG([PYTHON], [python], [no])
413 dnl # include the config file we created during bootstrapping
414 m4_include([plugin_pack.m4])
416 dnl #######################################################################
418 dnl #######################################################################
427 dnl #######################################################################
429 dnl #######################################################################
431 echo $PACKAGE $VERSION Configuration complete
433 echo Debugging enabled................: $enable_debug
436 echo Build purple plugins.............: $HAVE_PURPLE
437 if test x"$HAVE_PURPLE" = x"yes" ; then
438 echo Installing purple plugins to.....: `eval eval echo $PURPLE_LIBDIR`
439 echo Installing purple plugin data to.: `eval eval echo $PURPLE_DATADIR`
440 echo Purple plugins to be built.......:
441 eval $PP_PURPLE_BUILD
445 echo Build pidgin plugins.............: $HAVE_PIDGIN
446 if test x"$HAVE_PIDGIN" = x"yes" ; then
447 echo Installing pidgin plugins to.....: `eval eval echo $PIDGIN_LIBDIR`
448 echo Installing pidgin plugin data to.: `eval eval echo $PIDGIN_DATADIR`
449 echo Pidgin plugins to be built.......:
450 eval $PP_PIDGIN_BUILD
454 echo Build finch plugins..............: $HAVE_FINCH
455 if test x"$HAVE_FINCH" = x"yes" ; then
456 echo Installing finch plugins to......: `eval eval echo $FINCH_LIBDIR`
457 echo Installing finch plugin data to..: `eval eval echo $FINCH_DATADIR`
458 echo Finch plugins to be built........: none - THIS IS NORMAL
459 # uncomment this when we have finch plugins
460 # eval $PP_FINCH_BUILD
464 echo Type make to compile