1 AC_INIT([XChat-GNOME IRC Chat],[0.26.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=xchat-gnome],[xchat-gnome])
5 AC_CONFIG_MACRO_DIR([m4])
6 AC_CONFIG_HEADERS([config.h])
7 AC_CONFIG_SRCDIR([configure.ac])
9 AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip subdir-objects])
11 if test "$enable_maintainer_mode" = "yes"; then
12 AC_DEFINE([MAINTAINER_MODE],[1],[Define to enable 'maintainer-only' behaviour])
16 if test -z "$enable_maintainer_mode"; then
17 enable_maintainer_mode=yes
19 AM_MAINTAINER_MODE([enable])
21 IT_PROG_INTLTOOL([0.35.0])
25 LIBGLADE_REQUIRED=2.3.2
26 LIBGNOME_REQUIRED=2.16.0
27 LIBGNOMEUI_REQUIRED=2.16.0
30 DBUS_GLIB_REQUIRED=0.60
31 LIBSEXY_REQUIRED=0.1.11
32 LIBNOTIFY_REQUIRED=0.3.2
33 LIBCANBERRAGTK_REQUIRED=0.3
41 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
48 AC_CHECK_FUNCS(snprintf vsnprintf)
49 AC_CHECK_FUNCS(memrchr strtoull atoll)
52 GNOME_MAINTAINER_MODE_DEFINES
54 GNOME_COMPILE_WARNINGS([maximum])
58 # Set up gnome-doc-utils
62 PKG_CHECK_MODULES([DEPENDENCIES], [\
63 glib-2.0 >= $GLIB_REQUIRED \
64 gio-2.0 >= $GLIB_REQUIRED \
65 gtk+-2.0 >= $GTK_REQUIRED \
66 libglade-2.0 >= $LIBGLADE_REQUIRED \
67 libgnome-2.0 >= $LIBGNOME_REQUIRED \
68 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \
69 gconf-2.0 >= $GCONF_REQUIRED \
70 libsexy >= $LIBSEXY_REQUIRED \
74 AC_MSG_CHECKING([whether D-Bus support is requested])
76 AS_HELP_STRING([--disable-dbus],[Disable D-Bus support]),
77 [enable_dbus=$enableval dbus=$enableval],
78 [enable_dbus=autodetect dbus=yes])
79 AC_MSG_RESULT([$enable_dbus])
81 if test "x$enable_dbus" != "xno"; then
82 # D-BUS soft dependency
83 PKG_CHECK_MODULES([DBUS], [\
84 dbus-1 >= $DBUS_REQUIRED \
85 dbus-glib-1 >= $DBUS_GLIB_REQUIRED \
88 if test "x$dbus" = "xno"; then
89 AC_MSG_WARN([Library requirements (dbus-1 >= $DBUS_REQUIRED dbus-glib-1 >= $DBUS_GLIB_REQUIRED gthread-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])
91 AC_SUBST([DBUS_CFLAGS])
93 AC_PATH_PROG([DBUS_BINDING_TOOL],[dbus-binding-tool],[no])
94 if test "x$DBUS_BINDING_TOOL" = "xno"; then
99 if test "x$dbus" != "xyes"; then
100 if test "x$enable_dbus" = "xyes"; then
101 AC_MSG_ERROR([D-Bus not found])
102 elif test "x$enable_dbus" = "xautodetect"; then
103 AC_MSG_WARN([D-Bus not found, disabling dbus support])
106 AC_DEFINE(USE_DBUS,[1],[Whether to use D-Bus])
107 AS_AC_EXPAND(DATADIR, $datadir)
109 DBUS_SERVICES_DIR="$DATADIR/dbus-1/services"
110 AC_SUBST(DBUS_SERVICES_DIR)
111 AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
114 AM_CONDITIONAL([ENABLE_DBUS],[test "x$dbus" = "xyes"])
117 AC_MSG_CHECKING([whether to notification sounds using libnotify])
118 AC_ARG_ENABLE([notification],
119 [AS_HELP_STRING([--disable-notification],[whether to disable libnotify support])],
120 [],[enable_notification=yes])
121 AC_MSG_RESULT([$enable_notification])
123 if test "$enable_notification" = "yes"; then
124 PKG_CHECK_MODULES([LIBNOTIFY],[libnotify >= $LIBNOTIFY_REQUIRED])
125 AC_SUBST([LIBNOTIFY_CFLAGS])
126 AC_SUBST([LIBNOTIFY_LIBS])
129 AM_CONDITIONAL([ENABLE_LIBNOTIFY],[test "x$enable_notification" = "xyes"])
132 AC_MSG_CHECKING([whether to enable notification sounds using libcanberra])
133 AC_ARG_ENABLE([canberra],
134 [AS_HELP_STRING([--disable-canberra],[whether to disable libcanberra support])],
135 [],[enable_canberra=yes])
136 AC_MSG_RESULT([$enable_canberra])
138 if test "$enable_canberra" = "yes"; then
139 PKG_CHECK_MODULES([LIBCANBERRAGTK],[libcanberra-gtk >= $LIBCANBERRAGTK_REQUIRED])
140 AC_SUBST([LIBCANBERRAGTK_CFLAGS])
141 AC_SUBST([LIBCANBERRAGTK_LIBS])
144 AM_CONDITIONAL([ENABLE_LIBCANBERRA],[test "x$enable_canberra" = "xyes"])
148 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
151 AC_CHECK_LIB(socks5, SOCKSconnect, have_socks=yes, have_socks=no)
152 AC_CHECK_HEADERS(socks.h, , have_socks=no)
153 if test "x$have_socks" = xyes; then
154 AC_DEFINE(SOCKS, [], [Whether to include SOCKS5 proxy support])
155 DEPENDENCIES_LIBS="$DEPENDENCIES_LIBS -lsocks5"
159 AC_MSG_CHECKING([whether Perl support is requested])
160 AC_ARG_ENABLE([perl],
161 AS_HELP_STRING([--disable-perl],[Disable perl support]),
162 [enable_perl=$enableval have_perl=$enableval],
163 [enable_perl=autodetect have_perl=yes])
164 AC_MSG_RESULT([$enable_perl])
166 if test "x$have_perl" != "xno"; then
167 AC_PATH_PROG(PERL, perl perl5)
168 if test -z $PERL ; then
169 AC_MSG_WARN([Perl interpreter not found, disabling perl support])
174 if test "x$have_perl" != "xno"; then
175 AC_MSG_CHECKING(for Perl header files)
176 PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
178 if test "x$PERL_HEADER_TEST" = "x0" ; then
179 PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
182 AC_MSG_WARN([Perl headers not found, disabling perl support])
187 if test "x$have_perl" != "xno"; then
188 AC_MSG_CHECKING(for Perl library)
189 PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
191 if test "x$PERL_LIB_TEST" = "x0" ; then
192 PERL_LDFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
194 AC_SUBST(PERL_CFLAGS)
195 AC_SUBST(PERL_LDFLAGS)
196 AC_DEFINE([ENABLE_PERL],[1],[Define to compile with perl support])
199 AC_MSG_RESULT([not found])
200 AC_MSG_WARN([Perl library not found, disabling perl support])
206 AC_MSG_CHECKING([whether Python support is requested])
207 AC_ARG_ENABLE([python],
208 AS_HELP_STRING([--disable-python],[Disable python support]),
209 [enable_python=$enableval have_python=$enableval],
210 [enable_python=autodetect have_python=yes])
211 AC_MSG_RESULT([$enable_python])
213 if test "x$have_python" != "xno"; then
214 AM_PATH_PYTHON([2.3],[],[no])
216 if test "x$PYTHON" = "x:"; then
221 if test "x$have_python" != "xno"; then
222 AM_CHECK_PYTHON_HEADERS([],[have_python=no])
225 if test "x$have_python" != "xno"; then
226 PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
227 PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
228 PYTHON_LIBS="-lpython$PYTHON_VERSION"
229 PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
230 PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
231 PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
232 PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
233 PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
234 PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
235 PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
236 AC_SUBST([PYTHON_LIBS])
237 AC_SUBST([PYTHON_LIB_LOC])
238 AC_SUBST([PYTHON_CFLAGS])
239 AC_SUBST([PYTHON_EXTRA_LIBS])
242 if test "x$have_python" != "xyes"; then
243 if test "x$enable_python" = "xyes"; then
244 AC_MSG_ERROR([Python not found])
245 elif test "x$enable_python" = "xautodetect"; then
247 AC_MSG_WARN([Python not found, disabling python support])
249 elif test "x$enable_python" != "xno"; then
251 AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
255 AC_MSG_CHECKING([whether TCL support is requested])
257 AS_HELP_STRING([--disable-tcl],[Disable tcl support]),
258 [enable_tcl=$enableval have_tcl=$enableval],
259 [enable_tcl=autodetect have_tcl=yes])
260 AC_MSG_RESULT([$enable_tcl])
262 if test "x$have_tcl" != "xno"; then
264 AC_MSG_CHECKING([for tclConfig.sh])
265 for dir in $tcl /lib /usr/lib /usr/lib/tcl8.4 /usr/tcl/lib /usr/local/lib /usr/local/tcl-8.4/lib /usr/local/tcl/lib /opt/lib; do
266 if test -f $dir/tclConfig.sh; then
268 TCL_LIBS="$TCL_LIB_SPEC $TCL_LIBS"
269 TCL_CFLAGS="-I${TCL_PREFIX}/include $TCL_INCLUDE_SPEC"
271 AC_SUBST([TCL_CFLAGS])
274 AC_MSG_RESULT($dir/tclConfig.sh)
278 if test "$enable_tcl" = "autodetect" -a "$have_tcl" = "no"; then
279 AC_MSG_RESULT([not found])
280 AC_MSG_WARN([tclConfig.sh not found, disabling tcl support. Try --enable-tcl=/path/to/])
281 elif test "$have_tcl" == "no"; then
282 AC_MSG_RESULT([not found])
283 AC_MSG_ERROR([tclConfig.sh not found. Try --enable-tcl=/path/to/])
288 PKG_CHECK_MODULES([OPENSSL], [openssl], openssl=yes, openssl=no)
289 if test "x$openssl" = xyes; then
290 AC_SUBST([OPENSSL_CFLAGS])
291 AC_SUBST([OPENSSL_LIBS])
292 AC_DEFINE(USE_OPENSSL, [], [Whether to use OpenSSL])
294 AC_MSG_WARN([Library requirements (openssl) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])
296 AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
299 GETTEXT_PACKAGE=xchat-gnome
300 AC_SUBST([GETTEXT_PACKAGE])
301 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
305 AC_CHECK_LIB(socket, select)
307 AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes)
308 AC_MSG_CHECKING(whether to enable IPv6 support)
309 if test "x$have_getaddrinfo" = xyes; then
311 AC_DEFINE(USE_IPV6, [], [Whether to use ipv6])
316 # Xlib & Xshm (for xtext tinting)
317 AC_CHECK_LIB(X11, XOpenDisplay, xlib=yes, xlib=no)
318 if test "x$xlib" = xyes; then
319 AC_DEFINE(USE_XLIB, [1], [Use Xlib])
322 # Disable SHM because of bug #565958
324 # AC_CHECK_LIB(Xext, XShmAttach, shm=yes, shm=no)
325 # AC_CHECK_HEADERS(sys/ipc.h, , shm=no)
326 # AC_CHECK_HEADERS(sys/shm.h, , shm=no)
327 # if test "x$shm" = xyes; then
328 # DEPENDENCIES_LIBS="$DEPENDENCIES_LIBS -lX11 -lXext"
329 # AC_DEFINE(USE_SHM, [1], [Whether to use Xshm tinting])
332 # MMX (for xtext tinting)
334 [ --disable-mmx disable MMX assembly routines],
335 mmx=$enableval, mmx=yes)
336 if test "$mmx" = "yes"; then
338 i386|i486|i586|i686|i786|k6|k7)
344 if test "$system" = "OpenBSD"; then
345 dnl openbsd fails because mmx_cmod doesn't prefix its symbols with underscore.
346 dnl xtext.o: Undefined symbol `_shade_ximage_15_mmx' referenced from text segment
349 if test "$mmx" = "yes"; then
350 AC_DEFINE(USE_MMX, 1, [Use MMX assembly routines])
354 AM_CONDITIONAL(USE_MMX, test "x$mmx" = "xyes")
357 ALL_PLUGINS="autoaway notification url_scraper"
358 CANBERRA_PLUGINS="sound-notification"
359 DBUS_PLUGINS="net-monitor"
360 LIBNOTIFY_PLUGINS="notify-osd"
361 PYTHON_PLUGINS="python"
365 DIST_PLUGINS="$ALL_PLUGINS $CANBERRA_PLUGINS $DBUS_PLUGINS $LIBNOTIFY_PLUGINS $PYTHON_PLUGINS $PERL_PLUGINS $TCL_PLUGINS"
367 # canberra specific plugins
368 if test "x$enable_canberra" = "xyes"; then
369 ALL_PLUGINS="$ALL_PLUGINS $CANBERRA_PLUGINS"
371 AC_MSG_WARN([xchat-gnome compiled without libcanberra support, plugins $CANBERRA_PLUGINS will not be available])
374 # dbus-specific plugins
375 if test "x$dbus" = "xyes"; then
376 ALL_PLUGINS="$ALL_PLUGINS $DBUS_PLUGINS"
378 AC_MSG_WARN([xchat-gnome compiled without dbus support, plugins $DBUS_PLUGINS will not be available])
381 # libnotify-specific plugins
382 if test "x$enable_notification" = "xyes"; then
383 ALL_PLUGINS="$ALL_PLUGINS $LIBNOTIFY_PLUGINS"
385 AC_MSG_WARN([xchat-gnome compiled without libnotify support, plugins $LIBNOTIFY_PLUGINS will not be available])
388 # perl-specific plugins
389 if test "$enable_perl" = "yes" -a "$have_perl" = "yes"; then
390 ALL_PLUGINS="$ALL_PLUGINS $PERL_PLUGINS"
392 AC_MSG_WARN([xchat-gnome compiled without perl support, plugins $PERL_PLUGINS will not be available])
395 # python-specific plugins
396 if test "$enable_python" = "yes" -a "$have_python" = "yes"; then
397 ALL_PLUGINS="$ALL_PLUGINS $PYTHON_PLUGINS"
399 AC_MSG_WARN([xchat-gnome compiled without python support, plugins $PYTHON_PLUGINS will not be available])
402 # tcl-specific plugins
403 if test "$enable_tcl" = "yes" -a "$have_tcl" = "yes"; then
404 ALL_PLUGINS="$ALL_PLUGINS $TCL_PLUGINS"
406 AC_MSG_WARN([xchat-gnome compiled without tcl support, plugins $TCL_PLUGINS will not be available])
409 AC_MSG_CHECKING([which plugins to build])
410 AC_ARG_WITH([plugins],
411 [ --with-plugins=plugin1,plugin2,...
412 build the specified plugins. Available:
413 autoaway, dbus, net-monitor, notification,
414 notify-osd, perl, python, tcl, url_scraper,
416 [plugins=$with_plugins],
418 if test "x$with_plugins" = xyes; then
423 IFS="${IFS= }"; plugin_save_ifs="$IFS"; IFS=","
424 for plugin in $plugins; do
425 if echo "$ALL_PLUGINS" | egrep "(^| )$plugin(\$| )" > /dev/null; then
426 PLUGINS="$PLUGINS $plugin"
427 elif test "x$plugin" = "xdefault"; then
428 PLUGINS="$PLUGINS $ALL_PLUGINS"
431 IFS="$plugin_save_ifs"
433 AC_SUBST([DIST_PLUGINS])
434 AC_SUBST([BUILD_PLUGINS],[`echo $PLUGINS | tr ' ' '\n' | sort | uniq | tr '\n' ' '`])
435 AC_MSG_RESULT([$PLUGINS])
436 AC_DEFINE(USE_PLUGIN, [], [Use plugins])
437 AC_DEFINE(USE_GMODULE, [], [Use gmodule for loading plugins])
440 AM_CPPFLAGS="$AM_CPPFLAGS $DISABLE_DEPRECATED"
441 AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS -fgnu89-inline"
443 AC_SUBST([AM_CPPFLAGS])
444 AC_SUBST([AM_CFLAGS])
445 AC_SUBST([AM_LDFLAGS])
447 # various and sundry defines and flags
448 AC_DEFINE(_GNU_SOURCE, [], [Use GNU source])
449 AC_SUBST([DEPENDENCIES_CFLAGS])
450 AC_SUBST([DEPENDENCIES_LIBS])
453 data/icons/hicolor/128x128/apps/Makefile
454 data/icons/hicolor/128x128/Makefile
455 data/icons/hicolor/16x16/apps/Makefile
456 data/icons/hicolor/16x16/Makefile
457 data/icons/hicolor/22x22/apps/Makefile
458 data/icons/hicolor/22x22/Makefile
459 data/icons/hicolor/48x48/apps/Makefile
460 data/icons/hicolor/48x48/Makefile
461 data/icons/hicolor/Makefile
462 data/icons/hicolor/scalable/apps/Makefile
463 data/icons/hicolor/scalable/Makefile
466 data/xchat-gnome.desktop.in
469 plugins/autoaway/Makefile
471 plugins/net-monitor/Makefile
472 plugins/notification/Makefile
473 plugins/notify-osd/Makefile
474 plugins/perl/Makefile
475 plugins/python/Makefile
476 plugins/sound-notification/Makefile
478 plugins/url_scraper/Makefile
480 src/common/dbus/Makefile
482 src/fe-gnome/Makefile
483 src/libcontrast/Makefile
490 echo $PACKAGE $VERSION
493 echo prefix............... : $prefix