]> jfr.im git - irc/hexchat/hexchat.git/blame - configure.ac
Bump Version to 2.9.6
[irc/hexchat/hexchat.git] / configure.ac
CommitLineData
4a6ceffb 1dnl Process this file with autoconf to produce a configure script.
2
a71849db 3AC_INIT([HexChat],[2.9.6])
4a6ceffb 4
1e1501fd 5AC_PREREQ([2.60])
4a6ceffb 6AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
7
8AC_CONFIG_HEADERS([config.h])
84c536e4 9AC_CONFIG_SRCDIR([configure.ac])
4a6ceffb 10
e63ec010 11AC_CONFIG_MACRO_DIR([m4])
1b03947c 12
e63ec010 13AM_INIT_AUTOMAKE([1.11 dist-bzip2 subdir-objects no-define foreign])
1b03947c 14AM_SILENT_RULES([yes])
4a6ceffb 15
1e1501fd 16AC_USE_SYSTEM_EXTENSIONS
4a6ceffb 17AM_MAINTAINER_MODE
18AC_PROG_CC
19AM_PROG_CC_C_O
20AC_PROG_CPP
21AM_PROG_AS
22AM_DISABLE_STATIC
23AC_PROG_LIBTOOL
ce5653d7 24AC_PATH_PROG(MDTOOL, mdtool, no)
4a6ceffb 25
26dnl -----------------------------------------------------------
27dnl Language Support
28dnl -----------------------------------------------------------
16d32fde 29GETTEXT_PACKAGE=hexchat
4a6ceffb 30AC_SUBST(GETTEXT_PACKAGE)
31AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
32
2846b662 33ALL_LINGUAS="af am ast az be bg ca cs da de el en_GB es et eu fi fr gl gu hi hu id it ja kn ko lt lv mk ml ms nb nl no pa pl pt pt_BR ru rw sk sl sq sr sv th uk vi wa zh_CN zh_TW"
4a6ceffb 34AM_GNU_GETTEXT
35
36dnl displaced from acconfig.h
37AH_VERBATIM([OLD_PERL],[#undef OLD_PERL])
38AH_VERBATIM([PREFIX],[#undef PREFIX])
16d32fde
BV
39AH_VERBATIM([HEXCHATLIBDIR],[#undef HEXCHATLIBDIR])
40AH_VERBATIM([HEXCHATSHAREDIR],[#undef HEXCHATSHAREDIR])
4a6ceffb 41AH_VERBATIM([SOCKS],[#undef SOCKS])
42AH_VERBATIM([USE_MSPROXY],[#undef USE_MSPROXY])
ca434e0e 43AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY])
4a6ceffb 44dnl AH_VERBATIM([USE_GNOME],[#undef USE_GNOME])
45AH_VERBATIM([USE_SHM],[#undef USE_SHM])
46AH_VERBATIM([USE_GTKSPELL],[#undef USE_GTKSPELL])
47AH_VERBATIM([USE_LIBSEXY],[#undef USE_LIBSEXY])
38a42ed5 48AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
ca434e0e 49AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
78e39bfb 50AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA])
4a6ceffb 51AH_VERBATIM([USE_IPV6],[#undef USE_IPV6])
52AH_VERBATIM([USE_MMX],[#undef USE_MMX])
53AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
54AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
55AH_VERBATIM([USE_XFT],[#undef USE_XFT])
56AH_VERBATIM([USE_XLIB],[#undef USE_XLIB])
57AH_VERBATIM([USE_SIGACTION],[#undef USE_SIGACTION])
58AH_VERBATIM([USING_FREEBSD],[#undef USING_FREEBSD])
59AH_VERBATIM([USING_LINUX],[#undef USING_LINUX])
60AH_VERBATIM([socklen_t],[#undef socklen_t])
61AH_VERBATIM([USE_DBUS],[#undef USE_DBUS])
62
63AC_PATH_PROG(sedpath, sed)
64if test "_$sedpath" = _; then
d012ca1e 65 AC_MSG_ERROR(Cannot find sed: I need it!)
4a6ceffb 66fi
67
68AC_PATH_PROG(unamepath, uname)
69if test "_$unamepath" = _; then
70 system="unknown"
71else
72 AC_MSG_CHECKING(system type)
73 system=`$unamepath -s`
74 AC_MSG_RESULT($system)
75 if test "$system" = "Linux"; then
76 AC_DEFINE(USING_LINUX)
77 fi
78 if test "$system" = "FreeBSD"; then
79 AC_DEFINE(USING_FREEBSD)
80 fi
81fi
82
83dnl *********************************************************************
84dnl ** configure switches ***********************************************
85dnl *********************************************************************
86
87AC_ARG_ENABLE(socks,
3fe4bf83 88 [AS_HELP_STRING([--enable-socks],[link with SOCKS5 library (default: no)])],
4a6ceffb 89 socks=$enableval, socks=no)
90
91AC_ARG_ENABLE(ipv6,
ffa299f9 92 [AS_HELP_STRING([--disable-ipv6],[disable IPv6])],
a869f5b3 93 ipv6=$enableval, ipv6=yes)
4a6ceffb 94
95AC_ARG_ENABLE(xft,
3fe4bf83 96 [AS_HELP_STRING([--enable-xft],[enable use of Xft directly (default: no)])],
4a6ceffb 97 xft=$enableval, xft=no)
98
99AC_ARG_ENABLE(openssl,
3fe4bf83 100 [AS_HELP_STRING([--enable-openssl[=PATH]],[enable use of openSSL])],
4a6ceffb 101 openssl=$enableval, openssl=yes)
102
103AC_ARG_ENABLE(gtkfe,
3fe4bf83 104 [AS_HELP_STRING([--disable-gtkfe],[disable building gtk frontend])],
4a6ceffb 105 gtkfe=$enableval, gtkfe=yes)
106
107AC_ARG_ENABLE(textfe,
3fe4bf83 108 [AS_HELP_STRING([--enable-textfe],[build the text frontend (default: no)])],
4a6ceffb 109 textfe=$enableval, textfe=no)
110
111dnl AC_ARG_ENABLE(gnome,
3fe4bf83 112dnl [AS_HELP_STRING([--disable-gnome],[disable use of gnome])],
4a6ceffb 113dnl gnome=$enableval, gnome=yes)
114
115AC_ARG_ENABLE(xlib,
3fe4bf83 116 [AS_HELP_STRING([--disable-xlib],[disable use of xlib (for non X11 systems)])],
4a6ceffb 117 xlib=$enableval, xlib=yes)
118
119AC_ARG_ENABLE(python,
d1304661 120 [AS_HELP_STRING([--enable-python=pythonversion],[build the python plugin; possible values: "python2", "python3" or specific such as "python3.3" (default on, python2)])],
ae5d7e29 121 python=$enableval, python=python2)
d6dacbe9 122AS_IF([test "x$python" = "xyes"], [python=python2])
4a6ceffb 123
124AC_ARG_ENABLE(perl,
7e3c8c46 125 [AS_HELP_STRING([--disable-perl],[don\'t build the perl plugin])],
4a6ceffb 126 perl=$enableval, perl=yes)
127
128AC_ARG_ENABLE(perl_old,
3fe4bf83 129 [AS_HELP_STRING([--disable-perl_old],[no backwards compatibility for perl plugin])],
4a6ceffb 130 perl_old=$enableval, perl_old=yes)
131
1b0c07f8 132AC_ARG_ENABLE(plugin,
3fe4bf83 133 [AS_HELP_STRING([--disable-plugin],[disable plugin support])],
1b0c07f8
BV
134 plugin=$enableval, plugin=yes)
135
136AC_ARG_ENABLE(checksum,
3fe4bf83 137 [AS_HELP_STRING([--disable-checksum],[disable the Checksum plugin])],
1b0c07f8 138 checksum=$enableval, checksum=yes)
e5f4c4d2 139
2044a956 140AC_ARG_ENABLE(doat,
3fe4bf83 141 [AS_HELP_STRING([--disable-doat],[disable the Do At plugin])],
2044a956
BV
142 doat=$enableval, doat=yes)
143
1d3c6d67 144AC_ARG_ENABLE(fishlim,
3fe4bf83 145 [AS_HELP_STRING([--disable-fishlim],[disable the FiSHLiM plugin])],
1d3c6d67
BV
146 fishlim=$enableval, fishlim=yes)
147
62c9375b 148AC_ARG_ENABLE(sysinfo,
3fe4bf83 149 [AS_HELP_STRING([--disable-sysinfo],[disable the SysInfo plugin])],
62c9375b
BV
150 sysinfo=$enableval, sysinfo=yes)
151
4a6ceffb 152AC_ARG_ENABLE(dbus,
3fe4bf83 153 [AS_HELP_STRING([--disable-dbus],[disable DBUS support])],
4a6ceffb 154 dbus=$enableval, dbus=yes)
155
ca434e0e 156AC_ARG_ENABLE(libnotify,
3fe4bf83 157 [AS_HELP_STRING([--disable-libnotify],[disable libnotify support])],
ca434e0e 158 libnotify=$enableval, libnotify=yes)
159
78e39bfb
T
160AC_ARG_ENABLE(libcanberra,
161 [AS_HELP_STRING([--disable-libcanberra],[disable libcanberra support])],
162 libcanberra=$enableval, libcanberra=yes)
163
164
4a6ceffb 165AC_ARG_ENABLE(mmx,
3fe4bf83 166 [AS_HELP_STRING([--disable-mmx],[disable MMX assembly routines])],
4a6ceffb 167 mmx=$enableval, mmx=yes)
168
169AC_ARG_ENABLE(shm,
3fe4bf83 170 [AS_HELP_STRING([--enable-shm],[enable use of XShm for fast tinting (default: no)])],
4a6ceffb 171 shm=$enableval, shm=no)
172
173AC_ARG_ENABLE(spell,
3fe4bf83 174 [AS_HELP_STRING([--enable-spell=type],[enable spelling type: none static libsexy gtkspell])],
ac06b74b 175 spell=$enableval, spell=libsexy)
4a6ceffb 176
177AC_ARG_ENABLE(ntlm,
7e3c8c46 178 [AS_HELP_STRING([--enable-ntlm],[enable Microsoft\'s NTLM auth (libntlm) library support (default: no)])],
4a6ceffb 179 ntlm=$enableval, ntlm=no)
180
3f9c918b 181AC_ARG_ENABLE(libproxy,
3fe4bf83 182 [AS_HELP_STRING([--disable-libproxy],[disable libproxy support (default: auto)])],
3f9c918b
AS
183 libproxy=$enableval, libproxy=auto)
184
19d43564 185AC_ARG_ENABLE(minimal-flags,
186 [AS_HELP_STRING([--enable-minimal-flags],[only add those CFLAGS that are really needed or not intrusive (default: no)])],
187 minimalflags=$enableval, minimalflags=no)
188
ce5653d7 189AC_ARG_WITH(theme-manager,
190 [AS_HELP_STRING([--with-theme-manager],[compile theme manager (needs monodevelop, default: off)])],
191 theme_manager=$withval, theme_manager=no)
192
193
194
195dnl *********************************************************************
196dnl ** THEME-MANAGER ****************************************************
197dnl *********************************************************************
198if test "x$theme_manager" != "xno" ; then
199 if test "x$MDTOOL" = "xno"; then
200 AC_MSG_ERROR([No "mdtool" found, you need to install monodevelop!])
201 fi
202fi
19d43564 203
3f9c918b 204
4a6ceffb 205dnl *********************************************************************
206dnl ** GLIB *************************************************************
207dnl *********************************************************************
208
9327a5c7 209AM_PATH_GLIB_2_0(2.28.0, glib=yes, glib=no)
4a6ceffb 210if test "$glib" = no; then
d012ca1e 211 AC_MSG_ERROR(Cannot find GLib!)
4a6ceffb 212fi
213
e68635b8
T
214PKG_CHECK_MODULES([GOBJECT], [gobject-2.0], [], [AC_MSG_ERROR(Cannot find gobject-2.0!)])
215
216COMMON_CFLAGS="$GLIB_CFLAGS $GOBJECT_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
3ffae231 217COMMON_LIBS="$GLIB_LIBS $GOBJECT_LIBS -lgmodule-2.0"
4a6ceffb 218
219dnl *********************************************************************
220dnl ** GTK **************************************************************
221dnl *********************************************************************
222
212adf63 223# we might get undefined macro without this test
224if test "$gtkfe" = yes ; then
712eb542 225 AM_PATH_GTK_2_0(2.24.0, havegtk=yes, havegtk=no)
212adf63 226
227 if test "$havegtk" = no; then
228 gtkfe=no
229 echo
230 echo Cannot find GTK\! Not building GTK FrontEnd.
231 echo
232 fi
d8409cae 233fi
4a6ceffb 234
235if test "$gtkfe" != yes; then
236 gnome=no
4a6ceffb 237fi
238
239dnl *********************************************************************
240dnl ** GNOME ************************************************************
241dnl *********************************************************************
242
243GUI_LIBS="$GUI_LIBS $GTK_LIBS"
faf4575e 244GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
4a6ceffb 245
4a6ceffb 246#if test "$gnome" = yes; then
4a6ceffb 247# AC_MSG_CHECKING(Gnome2 compile flags)
e6394caf 248# GNOME_CFLAGS="`$PKG_CONFIG libgnome-2.0 --cflags 2>/dev/null`"
4a6ceffb 249# if test "_$GNOME_CFLAGS" = _ ; then
250# gnome=no
251# AC_MSG_RESULT([Gnome not found, building without it.])
252# else
e6394caf 253# GNOME_VER="`$PKG_CONFIG libgnome-2.0 --modversion`"
254# GUI_LIBS="$GUI_LIBS `$PKG_CONFIG libgnome-2.0 --libs`"
4a6ceffb 255# GUI_CFLAGS="$GUI_CFLAGS $GNOME_CFLAGS"
256# AC_DEFINE(USE_GNOME)
257# AC_MSG_RESULT(ok)
258# fi
259#fi
260
261# GConf
dba9c424
T
262#if test "$gnome" != no ; then
263# AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
264#else
265# GCONFTOOL=no
266#fi
4a6ceffb 267
268dnl *********************************************************************
269dnl ** XFT **************************************************************
270dnl *********************************************************************
271
272if test "$xft" = yes; then
e6394caf 273 if $PKG_CONFIG xft --exists; then
274 GUI_CFLAGS="$GUI_CFLAGS `$PKG_CONFIG xft --cflags`"
275 GUI_LIBS="$GUI_LIBS `$PKG_CONFIG xft --libs`"
4a6ceffb 276 else
277 xft=no
278 oldCPPFLAGS=$CPPFLAGS
279 CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
280 AC_CHECK_HEADERS(X11/Xft/Xft.h, xft=yes)
281 CPPFLAGS=$oldCPPFLAGS
282 fi
283 if test "$xft" = yes; then
284 AC_DEFINE(USE_XFT)
285 fi
286fi
287
288dnl *********************************************************************
289dnl ** XLIB *************************************************************
290dnl *********************************************************************
291
292if test "$xlib" = yes; then
293 AC_DEFINE(USE_XLIB)
294 if test "$system" = "SunOS"; then
295 LIBS="$LIBS -L/usr/openwin/lib -lX11"
296 else
297 AC_CHECK_LIB(X11, XSetWMHints)
298 fi
299else
300 shm=no
301fi
302
303dnl *********************************************************************
304dnl ** PERL *************************************************************
305dnl *********************************************************************
306
307if test "$perl" = yes; then
308 AC_PATH_PROG(perlpath, perl)
309 AC_MSG_CHECKING(for Perl compile flags)
310 PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
311 if test "_$PERL_CFLAGS" = _ ; then
312 AC_MSG_RESULT([not found, building without perl.])
313 perl=no
314 else
315 PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts |$sedpath 's/-lgdbm //'`
316 PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-ldb //'`
317 PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lndbm //'`
318 if test "$system" = "Linux"; then
319 PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lnsl //'`
320 PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lposix //'`
321 fi
322 PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lc //'`
323 AC_MSG_RESULT(ok)
324
325# oldLIBS=$LIBS
326# LIBS="$LIBS $PERL_LDFLAGS"
327# AC_CHECK_FUNC(eval_pv)
328# AC_CHECK_FUNC(call_pv)
329# LIBS=$oldLIBS
330
331 AC_MSG_CHECKING(for perl >= 5.8.0)
332 PERL_VER=`$perlpath -e 'print $]>= 5.008?"yes":"no"'`
333 if test "$PERL_VER" = "yes"; then
334 AC_MSG_RESULT(yes)
335 AC_MSG_CHECKING(if perl plugin will be backward compatible)
336 if test "$perl_old" = "yes"; then
337 AC_MSG_RESULT(yes)
338 AC_DEFINE(OLD_PERL)
339 else
340 AC_MSG_RESULT(no)
341 fi
342 else
343 AC_MSG_RESULT(no)
344 echo "perl version too old, building without perl."
345 perl=no
346 fi
347 fi
348fi
349
350dnl *********************************************************************
351dnl ** PYTHON ***********************************************************
352dnl *********************************************************************
353
ae5d7e29 354if test "x$python" != xno ; then
d6dacbe9 355 case $python in
d1304661 356 dnl set python2 default here
357 python2)
d6dacbe9 358 PKG_CHECK_MODULES([PY], [python-2.7], [], [AC_MSG_ERROR(Cannot find python-2.7!)])
0c4e343b 359 PY_VER="`$PKG_CONFIG --modversion python-2.7`";;
d1304661 360 dnl set python3 default here
361 python3)
d6dacbe9 362 PKG_CHECK_MODULES([PY], [python-3.3], [], [AC_MSG_ERROR(Cannot find python-3.3!)])
0c4e343b 363 PY_VER="`$PKG_CONFIG --modversion python-3.3`";;
d1304661 364 dnl add broken versions here
365 python2.5|python2.6|python3.1|python3.2)
366 AC_MSG_ERROR(Unsupported Python version ${python}!);;
367 python*)
368 python="python-${python#python}" # stay posix compliant
369 PKG_CHECK_MODULES([PY], [${python}], [], [AC_MSG_ERROR(Cannot find "${python}.pc"!)])
370 PY_VER="`$PKG_CONFIG --modversion ${python}`";;
d6dacbe9 371 *)
d1304661 372 AC_MSG_ERROR(Unsupported Python ${python}!)
d6dacbe9 373 esac
374 AC_MSG_CHECKING(Python version)
375 AC_MSG_RESULT($PY_VER)
4a6ceffb 376fi
377
4a6ceffb 378dnl *********************************************************************
379dnl ** IPv6 *************************************************************
380dnl *********************************************************************
381
382dnl purely for Solaris
383AC_CHECK_FUNC(select, ,
384 AC_CHECK_LIB(socket, select, ,
385 AC_CHECK_LIB(nsl, select, ,
386 AC_CHECK_LIB(inet, select, ,
387 AC_CHECK_LIB(cposix, select, ,
388 AC_CHECK_LIB(net, select, ,
389 AC_MSG_WARN(i can not find select. you might need to help me)))))))
390AC_CHECK_LIB(socket, select)
391
392if test "$ipv6" = yes; then
393 AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes)
394 AC_MSG_CHECKING(whether to enable IPv6 support)
395 if test "$have_getaddrinfo" = yes; then
396 AC_MSG_RESULT(yes)
397 AC_DEFINE(USE_IPV6)
398 else
399 ipv6=no
400 AC_MSG_RESULT(no)
401 fi
402fi
403
404dnl *********************************************************************
405dnl ** OPENSSL **********************************************************
406dnl *********************************************************************
407
408retry=no
409if test "$openssl" != no; then
4a6ceffb 410 AC_MSG_CHECKING(for openssl through pkg-config)
e6394caf 411 if $PKG_CONFIG openssl --exists; then
412 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG openssl --cflags`"
413 LIBS="$LIBS `$PKG_CONFIG openssl --libs`"
4a6ceffb 414 AC_DEFINE(USE_OPENSSL)
415 AC_MSG_RESULT(yes)
416 openssl=yes
417 else
418 AC_MSG_RESULT(no)
419 retry=yes
420 fi
421fi
422
423if test "$retry" = "yes"; then
424 unset openssl_path ac_cv_lib_ssl_SSL_new ac_cv_header_openssl_ssl_h
425 if test "$openssl" != yes; then
426 openssl_path=$openssl
427 fi
428 openssl=no
429 SAVED_LIBS=$LIBS
430 LIBS="$LIBS -lcrypto"
431 if test -n "$openssl_path"; then
432 LIBS="-L$openssl_path/lib $LIBS"
433 fi
434 AC_CHECK_LIB(ssl, SSL_new, have_openssl=yes)
435 LIBS=$SAVED_LIBS
436 if test "$have_openssl" = yes; then
437 SAVED_CPPFLAGS=$CPPFLAGS
438 if test -n "$openssl_path"; then
439 CPPFLAGS="-I$openssl_path/include $CPPFLAGS"
440 fi
441 AC_CHECK_HEADERS(openssl/ssl.h, have_openssl_h=yes)
442 if test "$have_openssl_h" = yes; then
443 openssl=yes
444 AC_DEFINE(USE_OPENSSL)
445 LIBS="$LIBS -lssl -lcrypto"
446 if test -n "$openssl_path"; then
447 LIBS="-L$openssl_path/lib $LIBS"
448 fi
449 else
450 CPPFLAGS=$SAVED_CPPFLAGS
451 fi
452 fi
453fi
454
455dnl *********************************************************************
456dnl ** LIBPROXY *********************************************************
457dnl *********************************************************************
458
3f9c918b
AS
459if test "x$libproxy" = "xyes" -o "x$libproxy" = "xauto" ; then
460 PKG_CHECK_MODULES([LIBPROXY], [libproxy-1.0], [
461 COMMON_LIBS="$COMMON_LIBS $LIBPROXY_LIBS"
462 COMMON_CFLAGS="$COMMON_CFLAGS $LIBPROXY_CFLAGS"
463 AC_DEFINE(USE_LIBPROXY)
464 libproxy=yes
465 ], [
466 if test "x$libproxy" = "xyes" ; then
d012ca1e 467 AC_MSG_ERROR(Cannot find libproxy!)
3f9c918b
AS
468 fi
469 libproxy=no
470 ])
471else
ca434e0e 472 libproxy=no
ca434e0e 473fi
4a6ceffb 474
475dnl *********************************************************************
476dnl ** PLUGIN ***********************************************************
477dnl *********************************************************************
478
479if test "$plugin" = yes; then
480 AC_CHECK_FUNCS(dlopen, have_dl=yes)
481 if test "$have_dl" != yes; then
482 AC_CHECK_LIB(dl, dlopen, have_dl=yes)
483 if test "$have_dl" = yes; then
484 LIBS="$LIBS -ldl"
485 fi
486 fi
487 if test "$have_dl" = yes; then
488 AC_DEFINE(USE_PLUGIN)
4a6ceffb 489 dnl we just need the -Wl,--export-dynamic, but not -lgmodule-2.0
e6394caf 490 RDYNAMIC_FLAGS="`$PKG_CONFIG gmodule-2.0 --libs | $sedpath 's/ -lgmodule-2.0//'`"
4a6ceffb 491 LIBS="$LIBS $RDYNAMIC_FLAGS"
492 if test "$LD" = ""; then
493 VS="`ld --help | grep version-script 2> /dev/null`"
494 else
495 VS="`$LD --help | grep version-script 2> /dev/null`"
496 fi
497 if test "$VS" != ""; then
498 GUI_LIBS="$GUI_LIBS -Wl,--version-script,\$(srcdir)/../version-script"
499 fi
500 else
501 plugin=no
502 fi
503fi
504
1d3c6d67 505dnl *********************************************************************
1b0c07f8 506dnl ** Checksum *********************************************************
1d3c6d67
BV
507dnl *********************************************************************
508
1b0c07f8
BV
509if test "$checksum" != "no"; then
510 checksum=no
511 AC_MSG_CHECKING(for plugin interface used by Checksum)
1d3c6d67 512 if test "$plugin" = yes; then
1d3c6d67 513 AC_MSG_RESULT([yes])
1b0c07f8
BV
514 AC_MSG_CHECKING(for OpenSSL used by Checksum)
515 if test "$openssl" = yes; then
516 checksum=yes
517 AC_MSG_RESULT([yes])
518 else
519 AC_MSG_RESULT([OpenSSL cannot be found, use the --enable-openssl option])
520 fi
1d3c6d67 521 else
1b0c07f8 522 AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
1d3c6d67
BV
523 fi
524fi
525
526dnl *********************************************************************
527dnl ** DO AT ************************************************************
528dnl *********************************************************************
529
530if test "$doat" != "no"; then
531 AC_MSG_CHECKING(for plugin interface used by Do At)
532 doat=no
533 if test "$plugin" = yes; then
534 doat=yes
535 AC_MSG_RESULT([yes])
536 else
537 AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Do At])
538 fi
539fi
540
541dnl *********************************************************************
542dnl ** FiSHLiM **********************************************************
543dnl *********************************************************************
544
545if test "$fishlim" != "no"; then
546 fishlim=no
547 AC_MSG_CHECKING(for plugin interface used by FiSHLiM)
548 if test "$plugin" = yes; then
549 AC_MSG_RESULT([yes])
d3effc80
BV
550 AC_MSG_CHECKING(for OpenSSL used by FiSHLiM)
551 if test "$openssl" = yes; then
552 fishlim=yes
553 AC_MSG_RESULT([yes])
554 else
555 AC_MSG_RESULT([OpenSSL cannot be found, use the --enable-openssl option])
556 fi
1d3c6d67
BV
557 else
558 AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
559 fi
1d3c6d67
BV
560fi
561
62c9375b
BV
562dnl *********************************************************************
563dnl ** SYSINFO **********************************************************
564dnl *********************************************************************
565
566if test "$sysinfo" != "no"; then
567 AC_MSG_CHECKING(for plugin interface used by SysInfo)
62c9375b
BV
568 if test "$plugin" = yes; then
569 AC_MSG_RESULT([yes])
d012ca1e 570 PKG_CHECK_MODULES(LIBPCI, libpci >= 3.0.0, [sysinfo=yes], [sysinfo=no])
62c9375b
BV
571 else
572 AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for SysInfo])
d012ca1e 573 sysinfo=no
62c9375b
BV
574 fi
575fi
576
4a6ceffb 577dnl #######################################################################
578dnl # Check for DBUS libraries
579dnl #######################################################################
580
581if test "x$dbus" = "xyes" ; then
582 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60 gthread-2.0], dbus=yes, [
4a6ceffb 583 dbus=no
584 ])
585 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool, no)
586 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no)
587 if test "x$DBUS_BINDING_TOOL" = "xno" || test "x$GLIB_GENMARSHAL" = "xno" || test "x$dbus" = "xno" ; then
588 dbus="no"
589 else
a251934b 590 COMMON_LIBS="$COMMON_LIBS $DBUS_LIBS"
4a6ceffb 591 COMMON_CFLAGS="$COMMON_CFLAGS $DBUS_CFLAGS"
592 AC_DEFINE(USE_DBUS)
4a6ceffb 593
e6a0532f 594 AS_AC_EXPAND(DBUS_SERVICES_DIR, "$datadir/dbus-1/services")
4a6ceffb 595 AC_SUBST(DBUS_SERVICES_DIR)
596 AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
597 fi
598fi
599
ca434e0e 600dnl *********************************************************************
601dnl ** LIBNOTIFY ********************************************************
602dnl *********************************************************************
603
604if test "x$libnotify" = "xyes" ; then
605 PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= 0.4, [], [
ca434e0e 606 libnotify=no
607 ])
608 if test "$libnotify" != "no" ; then
609 GUI_LIBS="$GUI_LIBS $LIBNOTIFY_LIBS"
610 GUI_CFLAGS="$GUI_CFLAGS $LIBNOTIFY_CFLAGS"
611 AC_DEFINE(USE_LIBNOTIFY)
612 fi
613fi
614
78e39bfb
T
615dnl *********************************************************************
616dnl ** LIBCANBERRA ******************************************************
617dnl *********************************************************************
618
619if test "x$libcanberra" = "xyes" ; then
bb878848 620 PKG_CHECK_MODULES(LIBCANBERRA, libcanberra >= 0.22, [], [
78e39bfb
T
621 libcanberra=no
622 ])
623 if test "$libcanberra" != "no" ; then
bb878848
T
624 COMMON_LIBS="$COMMON_LIBS $LIBCANBERRA_LIBS"
625 COMMON_CFLAGS="$COMMON_CFLAGS $LIBCANBERRA_CFLAGS"
78e39bfb
T
626 AC_DEFINE(USE_LIBCANBERRA)
627 fi
628fi
629
4a6ceffb 630dnl *********************************************************************
631dnl ** SPELL ************************************************************
632dnl *********************************************************************
633
634if test "$spell" = "gtkspell" ; then
635 PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, [], [
4a6ceffb 636 spell=no
637 ])
638 if test "$spell" != "no" ; then
639 GUI_LIBS="$GUI_LIBS $GTKSPELL_LIBS"
640 GUI_CFLAGS="$GUI_CFLAGS $GTKSPELL_CFLAGS"
641 AC_DEFINE(USE_GTKSPELL)
642 fi
643fi
644
645if test "$spell" = "libsexy" ; then
4d471208
BV
646 PKG_CHECK_MODULES([LIBSEXY], [libsexy >= 0.1.8], [
647 libsexy=yes
4a6ceffb 648 GUI_LIBS="$GUI_LIBS $LIBSEXY_LIBS"
649 GUI_CFLAGS="$GUI_CFLAGS $LIBSEXY_CFLAGS"
650 AC_DEFINE(USE_LIBSEXY)
4d471208 651 ], [
4a6ceffb 652 dnl use builtin static one
653 spell="static"
4d471208 654 ])
4a6ceffb 655fi
656
657if test "$spell" = "static" ; then
38a42ed5
BV
658 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.0.0, [
659 AC_DEFINE(HAVE_ISO_CODES)
4a6ceffb 660 AC_DEFINE(USE_LIBSEXY)
e1ce1c90 661 GUI_CFLAGS="$GUI_CFLAGS $LIBXML2_CFLAGS"
38a42ed5
BV
662 LIBS="$LIBS -lxml2"
663 ], [
d012ca1e 664 AC_MSG_ERROR(Cannot find libxml2!)
38a42ed5 665 ])
4a6ceffb 666fi
667
668dnl *********************************************************************
669dnl ** CONDITIONALS *****************************************************
670dnl *********************************************************************
671
672AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
673AM_CONDITIONAL(USE_LIBSEXY, test "x$spell" = "xstatic")
ca434e0e 674AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
78e39bfb 675AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes")
4a6ceffb 676AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
677AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
678AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
ae5d7e29 679AM_CONDITIONAL(DO_PYTHON, test "x$python" != "xno")
1b0c07f8
BV
680AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
681AM_CONDITIONAL(DO_CHECKSUM, test "x$checksum" = "xyes")
2044a956 682AM_CONDITIONAL(DO_DOAT, test "x$doat" = "xyes")
1d3c6d67 683AM_CONDITIONAL(DO_FISHLIM, test "x$fishlim" = "xyes")
62c9375b 684AM_CONDITIONAL(DO_SYSINFO, test "x$sysinfo" = "xyes")
4a6ceffb 685AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
dba9c424 686#AM_CONDITIONAL(DO_GCONF, test "x$GCONFTOOL" != "xno")
ce5653d7 687AM_CONDITIONAL(WITH_TM, test "x$theme_manager" != "xno")
4a6ceffb 688
689dnl *********************************************************************
690dnl ** SOCKS5 ***********************************************************
691dnl *********************************************************************
692
693if test "$socks" = yes; then
694 socks=no
695 AC_CHECK_LIB(socks5, SOCKSconnect, have_socks=yes)
696 if test "$have_socks" = yes; then
697 AC_CHECK_HEADERS(socks.h, have_socks_h=yes)
698 if test "$have_socks_h" = yes; then
699 socks=yes
700 AC_DEFINE(SOCKS)
701 LIBS="$LIBS -lsocks5"
702 fi
703 fi
704fi
705
706dnl *********************************************************************
707dnl ** MS PROXY *********************************************************
708dnl *********************************************************************
709
710have_ntlm="no"
711if test "x$ntlm" = "xyes" ; then
712 have_ntlm="no"
713 AC_CHECK_LIB(ntlm, ntlm_smb_encrypt, have_ntlm=yes)
714 if test "$have_ntlm" = yes; then
715 LIBS="$LIBS -lntlm"
716 AC_DEFINE(USE_MSPROXY)
717 fi
718fi
719
720dnl *********************************************************************
721dnl ** XShm *************************************************************
722dnl *********************************************************************
723
724if test "$shm" = yes; then
725 oldl=$LIBS
726 oldc=$CPPFLAGS
e6394caf 727 LIBS="$LIBS `$PKG_CONFIG --libs-only-L xft`"
728 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags-only-I xft`"
4a6ceffb 729 shm=no
730 AC_CHECK_LIB(Xext, XShmAttach, shm=yes)
731 if test "$shm" = yes; then
732 shm=no
733 AC_CHECK_HEADERS(sys/ipc.h, shm=yes)
734 if test "$shm" = yes; then
735 shm=no
736 AC_CHECK_HEADERS(sys/shm.h, shm=yes)
737 fi
738 fi
739
740 LIBS=$oldl
741 if test "$shm" = yes; then
e6394caf 742 GUI_LIBS="$GUI_LIBS `$PKG_CONFIG --libs-only-L xft` -lX11 -lXext"
4a6ceffb 743 AC_DEFINE(USE_SHM)
744 else
745 CPPFLAGS=$oldc
746 fi
747fi
748
749dnl *********************************************************************
750dnl ** MMX **************************************************************
751dnl *********************************************************************
752
753dnl we don't need mmx on *this* machine, just i386, because
754dnl it's checked at runtime.
755if test "$mmx" = "yes"; then
756 case $host_cpu in
757 i386|i486|i586|i686|i786|k6|k7)
758 mmx=yes
759 ;;
760 *)
761 mmx=no
762 esac
763 if test "$system" = "OpenBSD"; then
764 dnl openbsd fails because mmx_cmod doesn't prefix its symbols with underscore.
765 dnl xtext.o: Undefined symbol `_shade_ximage_15_mmx' referenced from text segment
766 mmx=no
767 fi
768 if test "$mmx" = "yes"; then
769 AC_DEFINE(USE_MMX)
770 fi
771fi
772
773AM_CONDITIONAL(USE_MMX, test "$mmx" = "yes")
774
775dnl *********************************************************************
776dnl ** GCC FLAGS ********************************************************
777dnl *********************************************************************
778
779dnl Only use -Wall and -pipe if we have gcc
780if test "x$GCC" = "xyes"; then
781 if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
782 CFLAGS="$CFLAGS -Wall"
783 fi
19d43564 784 dnl these flags might be unwanted
785 if test x$minimalflags != xyes; then
786 if test "$system" = "Linux" -o "$system" = "FreeBSD"; then
787 if test -z "`echo "$CFLAGS" | grep "\-pipe" 2> /dev/null`" ; then
788 CFLAGS="$CFLAGS -pipe"
789 fi
790 fi
791 if test -z "`echo "$CFLAGS" | grep "\-g " 2> /dev/null`" ; then
792 CFLAGS="$CFLAGS -g"
4a6ceffb 793 fi
4a6ceffb 794 fi
795fi
796
797dnl does this compiler support -Wno-pointer-sign ?
798AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign ])
799
800safe_CFLAGS=$CFLAGS
801CFLAGS="-Wno-pointer-sign"
802
803AC_TRY_COMPILE(, [
804int main () { return 0 ; }
805],
806[
807no_pointer_sign=yes
808AC_MSG_RESULT([yes])
809], [
810no_pointer_sign=no
811AC_MSG_RESULT([no])
812])
813CFLAGS=$safe_CFLAGS
814
815if test x$no_pointer_sign = xyes; then
816 CFLAGS="$CFLAGS -Wno-pointer-sign"
817fi
818
819dnl does this compiler support -funsigned-char ?
820AC_MSG_CHECKING([if gcc accepts -funsigned-char ])
821
822safe_CFLAGS=$CFLAGS
823CFLAGS="-funsigned-char"
824
825AC_TRY_COMPILE(, [
826int main () { return 0 ; }
827],
828[
829unsigned_char=yes
830AC_MSG_RESULT([yes])
831], [
832unsigned_char=no
833AC_MSG_RESULT([no])
834])
835CFLAGS=$safe_CFLAGS
836
837if test x$unsigned_char = xyes; then
838 CFLAGS="$CFLAGS -funsigned-char"
839fi
840
ba1dfabf
R
841dnl does this compiler support -Wno-unused-result ?
842AC_MSG_CHECKING([if gcc accepts -Wno-unused-result ])
843
844safe_CFLAGS=$CFLAGS
845CFLAGS="-Wno-unused-result"
846
847AC_TRY_COMPILE(, [
848int main () { return 0 ; }
849],
850[
851no_unused_result=yes
852AC_MSG_RESULT([yes])
853], [
854no_unused_result=no
855AC_MSG_RESULT([no])
856])
857CFLAGS=$safe_CFLAGS
858
859if test x$no_unused_result = xyes; then
860 CFLAGS="$CFLAGS -Wno-unused-result"
861fi
862
4a6ceffb 863dnl *********************************************************************
864dnl ** FUNCTIONS/LIBS/CFLAGS ********************************************
865dnl *********************************************************************
866
867AC_MSG_CHECKING(for modern sigaction)
7e3c8c46 868dnl libc5 on linux and FreeBSD 3.x doesn\'t have siginfo_t
4a6ceffb 869dnl and the sa_sigation field.
870AC_TRY_COMPILE(
871 [#include <signal.h>],
872 [struct sigaction act;
873 siginfo_t *si;
874 act.sa_sigaction = 0;],
875 [
876 AC_MSG_RESULT(yes)
877 AC_DEFINE(USE_SIGACTION)
878 ],
879 AC_MSG_RESULT(no))
880
881AC_PATH_PROG(gdkpixbufcsourcepath, gdk-pixbuf-csource)
882AC_SUBST(gdkpixbufcsourcepath)
883if test "$gtkfe" != no -a "_$gdkpixbufcsourcepath" = _; then
d012ca1e 884 AC_MSG_ERROR(Cannot find gdk-pixbuf-csource: Install GTK+ 2.0!)
4a6ceffb 885fi
886
7e3c8c46 887dnl if we don\'t have this, use g_snprintf instead
4a6ceffb 888AC_CHECK_FUNCS(snprintf vsnprintf memrchr strtoull)
889
890AC_CHECK_FUNC(gethostbyname, ,
891 AC_CHECK_LIB(resolv, gethostbyname, ,
892 AC_CHECK_LIB(nsl, gethostbyname)))
893
894AC_CHECK_FUNC(gethostname, , AC_CHECK_LIB(nsl, gethostname))
895
896dnl necessary for IRIX
897AC_CHECK_HEADERS(strings.h)
898
899dnl Check for type in sys/socket.h - from Squid source (GPL)
900AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
901AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
902#include <sys/socket.h>
903#if STDC_HEADERS
904#include <stdlib.h>
905#include <stddef.h>
906#endif],
907ac_cv_type_socklen_t=yes,
908ac_cv_type_socklen_t=no)
909])
910if test $ac_cv_type_socklen_t = no; then
911 AC_DEFINE(socklen_t, int)
912fi
913
914dnl Mac OS X and Darwin use lookupd, which caches DNS queries by default
915AC_EGREP_CPP(lookupd, dnl
916[#if (defined(__APPLE__) && defined(__MACH__))
917 lookupd
918#endif], AC_DEFINE([LOOKUPD],1,[Define to 1 if the system uses lookupd]))
919
920dnl freebsd needs this
921LIBS="$LIBS $INTLLIBS"
922CFLAGS="$CFLAGS $CPPFLAGS"
923
924GUI_LIBS="$GUI_LIBS $COMMON_LIBS"
925
926dnl make these visible to all Makefiles
927AC_SUBST(GUI_LIBS)
928AC_SUBST(GUI_CFLAGS)
929AC_SUBST(COMMON_LIBS)
930AC_SUBST(COMMON_CFLAGS)
931AC_SUBST(PERL_CFLAGS)
932AC_SUBST(PERL_LDFLAGS)
933AC_SUBST(PY_CFLAGS)
934AC_SUBST(PY_LIBS)
4a6ceffb 935AC_SUBST(DBUS_CFLAGS)
936AC_SUBST(DBUS_LIBS)
937
5b856791 938m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig))
4a6ceffb 939
940PLUGIN_INCLUDES='-I$(top_srcdir)/plugins'
941AC_SUBST(PLUGIN_INCLUDES)
942
943dnl for plugin.c and pixmaps.c
944test "x$prefix" = xNONE && prefix="$ac_default_prefix"
945test "x$exec_prefix" = xNONE && exec_prefix="$prefix"
946
947AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
948
77cad8e7 949AS_AC_EXPAND(HEXCHATLIBDIR, "${libdir}/hexchat/plugins")
16d32fde 950AC_DEFINE_UNQUOTED(HEXCHATLIBDIR, "$HEXCHATLIBDIR")
4a6ceffb 951
e6a0532f 952AS_AC_EXPAND(HEXCHATSHAREDIR, "$datadir")
16d32fde 953AC_DEFINE_UNQUOTED(HEXCHATSHAREDIR, "$HEXCHATSHAREDIR")
4a6ceffb 954
955dnl for plugins/xxx/Makefile.am
77cad8e7 956hexchatlibdir=${libdir}/hexchat/plugins
16d32fde 957AC_SUBST(hexchatlibdir)
4a6ceffb 958
8faa0e65 959AC_CONFIG_FILES([
4a6ceffb 960Makefile
925b45e8
R
961share/Makefile
962share/icons/Makefile
963share/misc/Makefile
5b856791
CT
964share/pkgconfig/Makefile
965share/pkgconfig/hexchat-plugin.pc
4a6ceffb 966src/Makefile
967src/common/Makefile
968src/common/dbus/Makefile
969src/fe-text/Makefile
970src/fe-gtk/Makefile
ce5653d7 971src/htm/Makefile
08fd4f2d 972src/htm/thememan
4a6ceffb 973src/pixmaps/Makefile
974plugins/Makefile
975plugins/python/Makefile
976plugins/perl/Makefile
1b0c07f8 977plugins/checksum/Makefile
2044a956 978plugins/doat/Makefile
1d3c6d67 979plugins/fishlim/Makefile
62c9375b 980plugins/sysinfo/Makefile
4a6ceffb 981intl/Makefile
982po/Makefile.in
29c5385d 983man/Makefile
4a6ceffb 984])
985
8faa0e65
T
986AC_OUTPUT
987
4a6ceffb 988echo
e5f4c4d2 989echo HexChat $VERSION
4a6ceffb 990echo
e0c9af93
BV
991echo GTK+ interface ........ : $gtkfe
992echo Text interface ........ : $textfe
ce5653d7 993echo Theme manager ......... : $theme_manager
4a6ceffb 994echo
e0c9af93
BV
995echo MMX tinting ........... : $mmx
996echo XShm tinting .......... : $shm
4a6ceffb 997if test "$xft" = no; then
e0c9af93 998 echo Text backend .......... : Pango
4a6ceffb 999else
e0c9af93
BV
1000 echo Text backend .......... : Xft
1001fi
1002echo OpenSSL support ....... : $openssl
1003echo D-Bus support ......... : $dbus
1004echo libnotify support ..... : $libnotify
78e39bfb 1005echo libcanberra support ... : $libcanberra
e0c9af93
BV
1006echo Spelling .............. : $spell
1007echo Plugin interface ...... : $plugin
1008echo NLS/gettext ........... : $USE_NLS
1009echo IPv6 support .......... : $ipv6
1010echo MS Proxy NTLM \(ISA\) ... : $have_ntlm
3f9c918b 1011echo libproxy support ...... : $libproxy
1b0c07f8 1012echo
e0c9af93 1013echo Perl .................. : $perl
d6dacbe9 1014echo Python ................ : python-$PY_VER
4a6ceffb 1015echo
e0c9af93
BV
1016echo Checksum .............. : $checksum
1017echo Do At ................. : $doat
1018echo FiSHLiM ............... : $fishlim
62c9375b 1019echo SysInfo ............... : $sysinfo
e5f4c4d2 1020echo
4a6ceffb 1021echo The binary will be installed in $prefix/bin
1022echo
1023
1024if test "$gtkfe" = no; then
1025 echo Warning: The GTK \(GUI\) frontend will not be built.
1026 echo
1027fi
1028
1029if test "$spell" = "gtkspell"; then
1030 echo Warning: GTK SPELL is not the recommended spelling library.
1031 echo
1032fi
1033
1034echo configure complete, now type \'make\' and pray.
1035echo