Bug 524030 – provide option to hide statusbar
[xchat-gnome.git] / configure.ac
blobf8e8843569405bfbd7f5a69ff9a180503b918ae4
1 AC_INIT([XChat-GNOME IRC Chat],[0.26.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=xchat-gnome],[xchat-gnome])
3 AC_PREREQ([2.60])
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])
13         enable_debug=yes
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])
23 GLIB_REQUIRED=2.18.0
24 GTK_REQUIRED=2.14.0
25 LIBGLADE_REQUIRED=2.3.2
26 LIBGNOME_REQUIRED=2.16.0
27 LIBGNOMEUI_REQUIRED=2.16.0
28 GCONF_REQUIRED=2.8.0
29 DBUS_REQUIRED=0.60
30 DBUS_GLIB_REQUIRED=0.60
31 LIBSEXY_REQUIRED=0.1.11
32 LIBNOTIFY_REQUIRED=0.3.2
33 LIBCANBERRAGTK_REQUIRED=0.3
35 AC_PROG_CC
36 AM_PROG_CC_C_O
37 AC_PROG_CC_C99
38 AC_PROG_CPP
39 AM_PROG_AS
40 AC_PROG_LIBTOOL
41 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
43 AC_C_CONST
44 AC_TYPE_SIZE_T
45 AC_EXEEXT
46 AC_HEADER_STDC
48 AC_CHECK_FUNCS(snprintf vsnprintf)
49 AC_CHECK_FUNCS(memrchr strtoull atoll)
51 GNOME_COMMON_INIT
52 GNOME_MAINTAINER_MODE_DEFINES
53 GNOME_DEBUG_CHECK
54 GNOME_COMPILE_WARNINGS([maximum])
56 PKG_PROG_PKG_CONFIG
58 # Set up gnome-doc-utils
59 GNOME_DOC_INIT
61 # Hard dependencies
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 \
71                   ])
73 #D-Bus
74 AC_MSG_CHECKING([whether D-Bus support is requested])
75 AC_ARG_ENABLE([dbus],
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 \
86                           gthread-2.0 \
87                           ], dbus=yes, dbus=no)
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.])
90         fi
91         AC_SUBST([DBUS_CFLAGS])
92         AC_SUBST([DBUS_LIBS])
93         AC_PATH_PROG([DBUS_BINDING_TOOL],[dbus-binding-tool],[no])
94         if test "x$DBUS_BINDING_TOOL" = "xno"; then
95                 dbus="no"
96         fi
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])
104         fi
105 else
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"])
116 # libnotify
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"])
131 # libcanberra-gtk
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"])
146 # GConf
147 AM_GCONF_SOURCE_2
148 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
150 # SOCKS5
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"
158 # Perl
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])
170                 have_perl=no
171         fi
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`
180                 AC_MSG_RESULT(found)
181         else
182                 AC_MSG_WARN([Perl headers not found, disabling perl support])
183                 have_perl=no
184         fi
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`
193                 AC_MSG_RESULT(found)
194                 AC_SUBST(PERL_CFLAGS)
195                 AC_SUBST(PERL_LDFLAGS)
196                 AC_DEFINE([ENABLE_PERL],[1],[Define to compile with perl support])
197                 enable_perl=yes
198         else
199                 AC_MSG_RESULT([not found])
200                 AC_MSG_WARN([Perl library not found, disabling perl support])
201         fi
205 # Python
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
217                 have_python=no
218         fi
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
246                 enable_python=no
247                 AC_MSG_WARN([Python not found, disabling python support])
248         fi
249 elif test "x$enable_python" != "xno"; then
250         enable_python=yes
251         AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
254 # TCL
255 AC_MSG_CHECKING([whether TCL support is requested])
256 AC_ARG_ENABLE([tcl],
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
263         have_tcl=no
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
267                         . $dir/tclConfig.sh
268                         TCL_LIBS="$TCL_LIB_SPEC $TCL_LIBS"
269                         TCL_CFLAGS="-I${TCL_PREFIX}/include $TCL_INCLUDE_SPEC"
270                         AC_SUBST([TCL_LIBS])
271                         AC_SUBST([TCL_CFLAGS])
272                         have_tcl=yes
273                         enable_tcl=yes
274                         AC_MSG_RESULT($dir/tclConfig.sh)
275                         break
276                 fi
277         done
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/])
284         fi
287 # openssl
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])
293 else
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")
298 # i18n
299 GETTEXT_PACKAGE=xchat-gnome
300 AC_SUBST([GETTEXT_PACKAGE])
301 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
302 AM_GLIB_GNU_GETTEXT
304 # ipv6
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
310         AC_MSG_RESULT(yes)
311         AC_DEFINE(USE_IPV6, [], [Whether to use ipv6])
312 else
313         AC_MSG_RESULT(no)
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])
330 # fi
332 # MMX (for xtext tinting)
333 AC_ARG_ENABLE(mmx,
334 [  --disable-mmx           disable MMX assembly routines],
335         mmx=$enableval, mmx=yes)
336 if test "$mmx" = "yes"; then
337         case $host_cpu in
338                 i386|i486|i586|i686|i786|k6|k7)
339                         mmx=yes
340                         ;;
341                 *)
342                 mmx=no
343         esac
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
347                 mmx=no
348         fi
349         if test "$mmx" = "yes"; then
350                 AC_DEFINE(USE_MMX, 1, [Use MMX assembly routines])
351         fi
354 AM_CONDITIONAL(USE_MMX, test "x$mmx" = "xyes")
356 # plugins
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"
362 PERL_PLUGINS="perl"
363 TCL_PLUGINS="tcl"
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"
370 else
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"
377 else
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"
384 else
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"
391 else
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"
398 else
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"
405 else
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,
415                           sound-notification],
416             [plugins=$with_plugins],
417             [plugins="default"])
418 if test "x$with_plugins" = xyes; then
419         plugins="default"
422 PLUGINS=
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"
429         fi
430 done
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])
439 # warning flags
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])
452 AC_CONFIG_FILES([
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
464 data/icons/Makefile
465 data/Makefile
466 data/xchat-gnome.desktop.in
467 help/Makefile
468 Makefile
469 plugins/autoaway/Makefile
470 plugins/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
477 plugins/tcl/Makefile
478 plugins/url_scraper/Makefile
479 po/Makefile.in
480 src/common/dbus/Makefile
481 src/common/Makefile
482 src/fe-gnome/Makefile
483 src/libcontrast/Makefile
484 src/Makefile
487 AC_OUTPUT
489 echo
490 echo $PACKAGE $VERSION
491 echo
493 echo prefix............... : $prefix