]> jfr.im git - irc/weechat/weechat.git/blame - configure.ac
relay: fix crash when decoding a malformed websocket frame (CVE-2021-40516)
[irc/weechat/weechat.git] / configure.ac
CommitLineData
f966b6a8 1#
ed4837b2 2# Copyright (C) 2003-2018 Sébastien Helleu <flashcode@flashtux.org>
6562d676
SH
3# Copyright (C) 2005 Benoit Papillault <benoit.papillault@free.fr>
4# Copyright (C) 2005-2006 Julien Louis <ptitlouis@sysif.net>
5# Copyright (C) 2005-2009 Emmanuel Bouthenot <kolter@openics.org>
6#
7# This file is part of WeeChat, the extensible chat client.
8#
9# WeeChat is free software; you can redistribute it and/or modify
f966b6a8 10# it under the terms of the GNU General Public License as published by
f1a39ce7 11# the Free Software Foundation; either version 3 of the License, or
f966b6a8
SH
12# (at your option) any later version.
13#
6562d676 14# WeeChat is distributed in the hope that it will be useful,
f966b6a8
SH
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
6562d676 20# along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
f966b6a8
SH
21#
22
23# -*- Autoconf -*-
24# Process this file with autoconf to produce a configure script.
25
26AC_PREREQ(2.56)
cfc1f397 27AC_INIT(WeeChat, m4_esyscmd([./version.sh devel-full | tr -d '\n']), flashcode@flashtux.org)
1dfc98c8 28AC_CONFIG_SRCDIR([configure.ac])
6d6eafa8 29AM_CONFIG_HEADER(config.h)
1d928b50 30AM_INIT_AUTOMAKE([foreign])
c33f0e60 31LICENSE="GPL3"
f966b6a8 32
cdc33d08 33# Checks for programs
f966b6a8 34AC_PROG_CC
63add00d 35AC_PROG_CXX
f966b6a8 36AC_PROG_MAKE_SET
33ff4380 37AC_GNU_SOURCE
996da2f6 38AC_PROG_LN_S
cdc33d08 39AM_PROG_LIBTOOL
f966b6a8 40
fabc49a0
EB
41# Files to generate
42AC_CONFIG_FILES([weechat.pc])
1466a565 43AC_CONFIG_FILES([weechat-${VERSION}-1.cygport:weechat.cygport.in])
fabc49a0 44
dec92aeb
EB
45# Add some flags for some OS
46case "$host_os" in
47freebsd* | openbsd*)
ed8906f2
SH
48 CFLAGS="$CFLAGS -I/usr/local/include"
49 LDFLAGS="$LDFLAGS -L/usr/local/lib"
dec92aeb 50 ;;
8497d25d 51netbsd*)
ed8906f2
SH
52 CFLAGS="$CFLAGS -I/usr/pkg/include"
53 LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
8497d25d 54 ;;
b81fa36a 55solaris*)
ed8906f2 56 LDFLAGS="$LDFLAGS -lsocket -lxnet"
dec92aeb 57 ;;
228040dc
SH
58darwin*)
59 LDFLAGS="$LDFLAGS -lresolv"
60 ;;
dec92aeb
EB
61esac
62
dc836881 63# Gettext
8c78abe2 64ALL_LINGUAS="cs de es fr hu it ja pl pt pt_BR ru tr"
430d1643 65AM_GNU_GETTEXT
a3cc9bbe 66AM_GNU_GETTEXT_VERSION([0.18])
dc836881 67
cdc33d08 68# Checks for libraries
0e531f5e
SH
69AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
70AC_CHECK_LIB(ncursesw, initscr, LIBNCURSESW_FOUND=1, LIBNCURSESW_FOUND=0)
f966b6a8 71
cdc33d08 72# Checks for header files
f966b6a8 73AC_HEADER_STDC
1edabb98 74AC_CHECK_HEADERS([libintl.h sys/resource.h])
545fa4c3 75
cdc33d08 76# Checks for typedefs, structures, and compiler characteristics
f966b6a8
SH
77AC_HEADER_TIME
78AC_STRUCT_TM
79
8a3d30b0
SH
80AC_MSG_CHECKING([for socklen_t])
81AC_CACHE_VAL(ac_cv_type_socklen_t,
ed8906f2
SH
82[AC_LINK_IFELSE([AC_LANG_PROGRAM(
83[[ #include <sys/types.h>
84#include <sys/socket.h> ]],
85[[ socklen_t t; ]])],
86[ ac_cv_type_socklen_t=yes ],
87[ ac_cv_type_socklen_t=no ],
8a3d30b0
SH
88)])
89if test $ac_cv_type_socklen_t = no; then
90AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
91fi
92AC_MSG_RESULT($ac_cv_type_socklen_t)
93
f966b6a8 94# Checks for library functions.
f966b6a8
SH
95AC_FUNC_SELECT_ARGTYPES
96AC_TYPE_SIGNAL
1edabb98 97AC_CHECK_FUNCS([mallinfo])
f966b6a8 98
cdc33d08
SH
99# Variables in config.h
100
be9269df
SH
101AH_VERBATIM([PREFIX], [#undef PREFIX])
102AH_VERBATIM([WEECHAT_LIBDIR], [#undef WEECHAT_LIBDIR])
103AH_VERBATIM([WEECHAT_SHAREDIR], [#undef WEECHAT_SHAREDIR])
104AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
105AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
41261875 106AH_VERBATIM([HAVE_EAT_NEWLINE_GLITCH], [#undef HAVE_EAT_NEWLINE_GLITCH])
be9269df 107AH_VERBATIM([HAVE_ASPELL_VERSION_STRING], [#undef HAVE_ASPELL_VERSION_STRING])
6860aa49 108AH_VERBATIM([HAVE_ENCHANT_GET_VERSION], [#undef HAVE_ENCHANT_GET_VERSION])
6a2bef6f 109AH_VERBATIM([HAVE_GUILE_GMP_MEMORY_FUNCTIONS], [#undef HAVE_GUILE_GMP_MEMORY_FUNCTIONS])
be9269df
SH
110AH_VERBATIM([PLUGIN_ALIAS], [#undef PLUGIN_ALIAS])
111AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
edfeb60e 112AH_VERBATIM([PLUGIN_BUFLIST], [#undef PLUGIN_BUFLIST])
be9269df 113AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET])
97254780 114AH_VERBATIM([PLUGIN_EXEC], [#undef PLUGIN_EXEC])
be9269df 115AH_VERBATIM([PLUGIN_FIFO], [#undef PLUGIN_FIFO])
2a5eb156 116AH_VERBATIM([PLUGIN_FSET], [#undef PLUGIN_FSET])
be9269df
SH
117AH_VERBATIM([PLUGIN_IRC], [#undef PLUGIN_IRC])
118AH_VERBATIM([PLUGIN_LOGGER], [#undef PLUGIN_LOGGER])
119AH_VERBATIM([PLUGIN_RELAY], [#undef PLUGIN_RELAY])
be9269df
SH
120AH_VERBATIM([PLUGIN_SCRIPT], [#undef PLUGIN_SCRIPT])
121AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
122AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
123AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
124AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
d032ee21 125AH_VERBATIM([PLUGIN_PHP], [#undef PLUGIN_PHP])
be9269df
SH
126AH_VERBATIM([PLUGIN_TCL], [#undef PLUGIN_TCL])
127AH_VERBATIM([PLUGIN_GUILE], [#undef PLUGIN_GUILE])
148a571d 128AH_VERBATIM([PLUGIN_JAVASCRIPT], [#undef PLUGIN_JAVASCRIPT])
30942f7f 129AH_VERBATIM([PLUGIN_TRIGGER], [#undef PLUGIN_TRIGGER])
be9269df 130AH_VERBATIM([PLUGIN_XFER], [#undef PLUGIN_XFER])
63add00d 131AH_VERBATIM([TESTS], [#undef TESTS])
be9269df
SH
132AH_VERBATIM([MAN], [#undef MAN])
133AH_VERBATIM([DOC], [#undef DOC])
134AH_VERBATIM([WEECHAT_HOME], [#define WEECHAT_HOME "~/.weechat"])
135AH_VERBATIM([CA_FILE], [#define CA_FILE "/etc/ssl/certs/ca-certificates.crt"])
fd9512bb 136
cdc33d08
SH
137# Arguments for ./configure
138
dec0e7dc 139AC_ARG_ENABLE(ncurses, [ --disable-ncurses turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes)
805717e9 140AC_ARG_ENABLE(headless, [ --disable-headless turn off headless binary (default=compiled), this is required for tests],enable_headless=$enableval,enable_headless=yes)
dec0e7dc 141AC_ARG_ENABLE(gnutls, [ --disable-gnutls turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
479ce5d3 142AC_ARG_ENABLE(largefile, [ --disable-largefile turn off Large File Support (default=on)],enable_largefile=$enableval,enable_largefile=yes)
dec0e7dc 143AC_ARG_ENABLE(alias, [ --disable-alias turn off Alias plugin (default=compiled)],enable_alias=$enableval,enable_alias=yes)
ac107802 144AC_ARG_ENABLE(aspell, [ --disable-aspell turn off Aspell plugin (default=compiled)],enable_aspell=$enableval,enable_aspell=yes)
fb7edb35 145AC_ARG_ENABLE(enchant, [ --enable-enchant turn on Enchant lib for Aspell plugin (default=off)],enable_enchant=$enableval,enable_enchant=no)
33ccc29a
SH
146AC_ARG_ENABLE(buflist, [ --disable-buflist turn off Buflist plugin (default=compiled)],enable_buflist=$enableval,enable_buflist=yes)
147AC_ARG_ENABLE(charset, [ --disable-charset turn off Charset plugin (default=compiled)],enable_charset=$enableval,enable_charset=yes)
97254780 148AC_ARG_ENABLE(exec, [ --disable-exec turn off Exec plugin (default=compiled)],enable_exec=$enableval,enable_exec=yes)
dec0e7dc 149AC_ARG_ENABLE(fifo, [ --disable-fifo turn off Fifo plugin (default=compiled)],enable_fifo=$enableval,enable_fifo=yes)
2a5eb156 150AC_ARG_ENABLE(fset, [ --disable-fset turn off Fast Set plugin (default=compiled)],enable_fset=$enableval,enable_fset=yes)
dec0e7dc
SH
151AC_ARG_ENABLE(irc, [ --disable-irc turn off IRC plugin (default=compiled)],enable_irc=$enableval,enable_irc=yes)
152AC_ARG_ENABLE(logger, [ --disable-logger turn off Logger plugin (default=compiled)],enable_logger=$enableval,enable_logger=yes)
921e40f6 153AC_ARG_ENABLE(relay, [ --disable-relay turn off Relay plugin (default=compiled)],enable_relay=$enableval,enable_relay=yes)
a99d1360
SH
154AC_ARG_ENABLE(script, [ --disable-script turn off Script plugin (default=compiled)],enable_script=$enableval,enable_script=yes)
155AC_ARG_ENABLE(scripts, [ --disable-scripts turn off script plugins (perl, python, ...) (default=compiled if found)],enable_scripts=$enableval,enable_scripts=yes)
dec0e7dc
SH
156AC_ARG_ENABLE(perl, [ --disable-perl turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes)
157AC_ARG_ENABLE(python, [ --disable-python turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes)
35712daa 158AC_ARG_ENABLE(python3, [ --enable-python3 use Python 3.x if found (NOT recommended because many "official" scripts won't work) (default=off)],enable_python3=$enableval,enable_python3=no)
dec0e7dc
SH
159AC_ARG_ENABLE(ruby, [ --disable-ruby turn off Ruby script plugin (default=compiled if found)],enable_ruby=$enableval,enable_ruby=yes)
160AC_ARG_ENABLE(lua, [ --disable-lua turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes)
44944ef0 161AC_ARG_ENABLE(tcl, [ --disable-tcl turn off Tcl script plugin (default=compiled if found)],enable_tcl=$enableval,enable_tcl=yes)
9b42328d 162AC_ARG_ENABLE(guile, [ --disable-guile turn off Guile (scheme) script plugin (default=compiled if found)],enable_guile=$enableval,enable_guile=yes)
92b9533e 163AC_ARG_ENABLE(javascript, [ --disable-javascript turn off JavaScript script plugin (default=compiled if found)],enable_javascript=$enableval,enable_javascript=yes)
d032ee21 164AC_ARG_ENABLE(php, [ --disable-php turn off PHP script plugin (default=compiled if found)],enable_php=$enableval,enable_php=yes)
30942f7f 165AC_ARG_ENABLE(trigger, [ --disable-trigger turn off Trigger plugin (default=compiled)],enable_trigger=$enableval,enable_trigger=yes)
33ccc29a 166AC_ARG_ENABLE(xfer, [ --disable-xfer turn off Xfer (file transfer) plugin (default=compiled)],enable_xfer=$enableval,enable_xfer=yes)
a41b2e0a 167AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR directory containing tcl configuration (tclConfig.sh)],tclconfig=$withval,tclconfig='')
63add00d
SH
168AC_ARG_WITH(debug, [ --with-debug debugging: 0=no debug, 1=debug compilation (default=1)],debug=$withval,debug=1)
169AC_ARG_ENABLE(tests, [ --enable-tests turn on build of tests (default=not built)],enable_tests=$enableval,enable_tests=no)
3aed4ac1 170AC_ARG_ENABLE(man, [ --enable-man turn on build of man page (default=not built)],enable_man=$enableval,enable_man=no)
f19c2cfd 171AC_ARG_ENABLE(doc, [ --enable-doc turn on build of documentation (default=not built)],enable_doc=$enableval,enable_doc=no)
ed8906f2 172
34e0226e 173AC_ARG_VAR(WEECHAT_HOME, [WeeChat home directory for config, logs, scripts.. (default is "~/.weechat")])
87e342dd 174AC_ARG_VAR(CA_FILE, [File containing the certificate authorities (default is "/etc/ssl/certs/ca-certificates.crt"). This is the default value of option "weechat.network.gnutls_ca_file".])
34e0226e
SH
175
176if test "x$WEECHAT_HOME" = "x" ; then
177 WEECHAT_HOME="~/.weechat"
178fi
179AC_DEFINE_UNQUOTED(WEECHAT_HOME, "$WEECHAT_HOME")
180
87e342dd
SH
181if test "x$CA_FILE" = "x" ; then
182 CA_FILE="/etc/ssl/certs/ca-certificates.crt"
183fi
184AC_DEFINE_UNQUOTED(CA_FILE, "$CA_FILE")
185
ed8906f2 186not_asked=""
e7fd1a0c 187not_found=""
f966b6a8 188
805717e9
SH
189if test "x$enable_headless" != "xyes" && test "x$enable_tests" = "xyes"; then
190 AC_MSG_ERROR([*** Headless mode is required for tests.])
191fi
192
8fb67c24
SH
193# ------------------------------------------------------------------------------
194# pkg-config
195# ------------------------------------------------------------------------------
196
197PKGCONFIG=""
198AC_CHECK_PROGS(PKGCONFIG, pkg-config)
199if test "x$PKGCONFIG" = "x"; then
200 AC_MSG_ERROR([
201*** "pkg-config" couldn't be found on your system.
202*** Try to install it with your software package manager.])
203fi
204
cdc33d08 205# ------------------------------------------------------------------------------
ed8906f2
SH
206# dynamic loader
207# ------------------------------------------------------------------------------
208
209PLUGINS_LFLAGS=
210
211AC_CHECK_FUNCS(dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
212if test "$LIBDL_FOUND" != "yes"; then
213 AC_CHECK_LIB(dl, dlopen, [LIBDL_FOUND=yes; PLUGINS_LFLAGS=-ldl], LIBDL_FOUND=no)
214fi
215if test "$LIBDL_FOUND" != "yes"; then
216 AC_MSG_ERROR([
8359a097 217*** "dl" library (dynamic library loader) couldn't be found on your system.
ed8906f2
SH
218*** Try to install it with your software package manager.])
219fi
220AC_SUBST(PLUGINS_LFLAGS)
221
222# ------------------------------------------------------------------------------
223# gui
cdc33d08
SH
224# ------------------------------------------------------------------------------
225
7dbaec1a 226if test "x$enable_ncurses" = "xyes" ; then
0e531f5e
SH
227 if test "$LIBNCURSESW_FOUND" = "0" ; then
228 if test "$LIBNCURSES_FOUND" = "0" ; then
e7fd1a0c 229 AC_MSG_WARN([
0e531f5e 230*** ncurses library not found!
e7fd1a0c
SH
231*** WeeChat will be built without ncurses support.])
232 enable_ncurses="no"
233 not_found="$not_found ncurses"
234 else
235 AC_MSG_WARN([
0e531f5e 236*** ncursesw library not found! Falling back to "ncurses"
0f055b08 237*** Be careful, UTF-8 display may not work properly if your locale is UTF-8.])
ed8906f2 238 NCURSES_LFLAGS="-lncurses"
e7fd1a0c 239 fi
0e531f5e 240 else
ed8906f2 241 NCURSES_LFLAGS="-lncursesw"
dc836881 242 fi
34ee7e40 243 AC_CHECK_HEADERS([ncurses.h ncursesw/curses.h])
ed8906f2
SH
244 AC_SUBST(NCURSES_LFLAGS)
245else
246 not_asked="$not_asked ncurses"
cafd93dc 247fi
f966b6a8 248
805717e9
SH
249# ------------------------------------------------------------------------------
250# headless
251# ------------------------------------------------------------------------------
252
253if test "x$enable_headless" != "xyes" ; then
254 not_asked="$not_asked headless"
255fi
256
6ed8f34f 257# ------------------------------------------------------------------------------
ed8906f2 258# iconv
a38b9ecf
EB
259# ------------------------------------------------------------------------------
260
c20ce83d 261ICONV_LFLAGS=""
a38b9ecf 262
ed8906f2 263iconv_found="no"
a38b9ecf
EB
264AC_CHECK_HEADER(iconv.h,ac_found_iconv_header="yes",ac_found_iconv_header="no")
265if test "x$ac_found_iconv_header" = "xyes" ; then
266 AC_CHECK_LIB(iconv,iconv_open,ac_found_iconv_lib="yes",ac_found_iconv_lib="no")
481e6f8e
SH
267 if test "x$ac_found_iconv_lib" = "xno" ; then
268 AC_CHECK_LIB(iconv,libiconv_open,ac_found_iconv_lib="yes",ac_found_iconv_lib="no")
269 fi
a38b9ecf 270 if test "x$ac_found_iconv_lib" = "xyes" ; then
c20ce83d
SH
271 ICONV_LFLAGS="-liconv"
272 LIBS="$LIBS $ICONV_LFLAGS"
a38b9ecf 273 fi
2801b843 274 AC_MSG_CHECKING(for iconv usability in programs)
a38b9ecf 275 AC_TRY_RUN([
eb56a98f
SH
276 #include <iconv.h>
277 int main(int argc, char **argv) {
278 iconv_t conv = iconv_open("ISO8859-1", "UTF-8");
a38b9ecf 279 if (conv != (iconv_t) -1) {
eb56a98f 280 return 0;
a38b9ecf 281 }
eb56a98f 282 return 1;
2ea9f673 283 }],iconv_found="yes", iconv_found="no", iconv_found="assume-yes")
a38b9ecf
EB
284 if test "x$iconv_found" = "xno" ; then
285 AC_MSG_RESULT(no)
286 else
287 AC_MSG_RESULT(yes)
288 fi
289fi
290
291if test "x$iconv_found" = "xno" ; then
292 AC_MSG_ERROR([
8359a097 293*** Iconv headers and/or libraries couldn't be found on your system.
a38b9ecf
EB
294*** Try to install them with your software package manager.
295*** WeeChat can't be built without Iconv support.])
296fi
297
cdc33d08
SH
298# ------------------------------------------------------------------------------
299# plugins
300# ------------------------------------------------------------------------------
301
ed8906f2 302if test "x$enable_scripts" = "xno" ; then
8d4497a7
SH
303 enable_perl="no"
304 enable_python="no"
305 enable_ruby="no"
306 enable_lua="no"
44944ef0 307 enable_tcl="no"
9b42328d 308 enable_guile="no"
148a571d 309 enable_javascript="no"
d032ee21 310 enable_php="no"
ed8906f2
SH
311fi
312
2888d414
SH
313# ---------------------------------- alias -------------------------------------
314
315if test "x$enable_alias" = "xyes" ; then
316 ALIAS_CFLAGS=""
317 ALIAS_LFLAGS=""
318 AC_SUBST(ALIAS_CFLAGS)
319 AC_SUBST(ALIAS_LFLAGS)
320 AC_DEFINE(PLUGIN_ALIAS)
321else
322 not_asked="$not_asked alias"
323fi
324
cdc08d6f
SH
325# ---------------------------------- aspell ------------------------------------
326
327if test "x$enable_aspell" = "xyes" ; then
fb7edb35
SH
328 ac_found_enchant_lib="no"
329 if test "x$enable_enchant" = "xyes" ; then
fb7edb35
SH
330 PKG_CHECK_MODULES(ENCHANT, [enchant], ac_found_enchant_lib="yes", ac_found_enchant_lib="no")
331 fi
332 if test "x$ac_found_enchant_lib" = "xyes" ; then
333 CFLAGS="$CFLAGS -DUSE_ENCHANT"
334 ASPELL_LIB_USED="enchant"
6860aa49
SH
335
336 # check if function enchant_get_version() exists
337 ac_save_CFLAGS="$CFLAGS"
338 ac_save_LDFLAGS="$LDFLAGS"
339 CFLAGS="$CFLAGS $ENCHANT_CFLAGS"
340 LDFLAGS="$LDFLAGS $ENCHANT_LIBS"
341 AC_CACHE_CHECK([for enchant_get_version() support], ac_cv_have_enchant_get_version, [
342 AC_LINK_IFELSE([AC_LANG_PROGRAM(
343 [[ #include <enchant.h>]],
344 [[ const char *version = enchant_get_version(); ]])],
345 [ ac_have_enchant_get_version="yes" ],
346 [ ac_have_enchant_get_version="no" ])])
347 CFLAGS="$ac_save_CFLAGS"
348 LDFLAGS="$ac_save_LDFLAGS"
349 if test "x$ac_have_enchant_get_version" = "xyes"; then
350 AC_DEFINE(HAVE_ENCHANT_GET_VERSION)
351 fi
fb7edb35
SH
352 else
353 ASPELL_CFLAGS=""
354 ASPELL_LFLAGS=""
cdc08d6f 355
fb7edb35
SH
356 AC_CHECK_HEADER(aspell.h,ac_found_aspell_header="yes",ac_found_aspell_header="no")
357 AC_CHECK_LIB(aspell,new_aspell_speller,ac_found_aspell_lib="yes",ac_found_aspell_lib="no")
cdc08d6f 358
d4618e45 359 AC_MSG_CHECKING(for aspell headers and libraries)
fb7edb35
SH
360 if test "x$ac_found_aspell_header" = "xno" -o "x$ac_found_aspell_lib" = "xno" ; then
361 AC_MSG_RESULT(no)
362 AC_MSG_WARN([
8359a097 363*** Aspell headers and/or libraries couldn't be found on your system.
cdc08d6f
SH
364*** Try to install them with your software package manager.
365*** WeeChat will be built without Aspell support.])
fb7edb35
SH
366 enable_aspell="no"
367 not_found="$not_found aspell"
368 else
369 AC_MSG_RESULT(yes)
370 ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
371 ASPELL_LIB_USED="aspell"
6860aa49
SH
372
373 # check if function aspell_version_string() exists
be9269df
SH
374 ac_save_LDFLAGS="$LDFLAGS"
375 LDFLAGS="$LDFLAGS $ASPELL_LFLAGS"
376 AC_CACHE_CHECK([for aspell_version_string() support], ac_cv_have_aspell_version_string, [
377 AC_LINK_IFELSE([AC_LANG_PROGRAM(
378 [[ #include <aspell.h>]],
379 [[ const char *version = aspell_version_string(); ]])],
380 [ ac_have_aspell_version_string="yes" ],
381 [ ac_have_aspell_version_string="no" ])])
382 LDFLAGS="$ac_save_LDFLAGS"
383 if test "x$ac_have_aspell_version_string" = "xyes"; then
384 AC_DEFINE(HAVE_ASPELL_VERSION_STRING)
385 fi
fb7edb35 386 fi
cdc08d6f
SH
387 fi
388else
389 not_asked="$not_asked aspell"
390fi
391
392if test "x$enable_aspell" = "xyes" ; then
393 AC_SUBST(ASPELL_CFLAGS)
394 AC_SUBST(ASPELL_LFLAGS)
395 AC_DEFINE(PLUGIN_ASPELL)
396fi
397
edfeb60e
SH
398# --------------------------------- buflist ------------------------------------
399
400if test "x$enable_buflist" = "xyes" ; then
401 AC_DEFINE(PLUGIN_BUFLIST)
402else
403 not_asked="$not_asked buflist"
404fi
405
cdc08d6f
SH
406# --------------------------------- charset ------------------------------------
407
408if test "x$enable_charset" = "xyes" ; then
409 CHARSET_CFLAGS=""
410 CHARSET_LFLAGS="$ICONV_LFLAGS"
411 AC_SUBST(CHARSET_CFLAGS)
412 AC_SUBST(CHARSET_LFLAGS)
413 AC_DEFINE(PLUGIN_CHARSET)
414else
415 not_asked="$not_asked charset"
416fi
417
97254780
SH
418# ---------------------------------- exec --------------------------------------
419
420if test "x$enable_exec" = "xyes" ; then
421 EXEC_CFLAGS=""
422 EXEC_LFLAGS=""
423 AC_SUBST(EXEC_CFLAGS)
424 AC_SUBST(EXEC_LFLAGS)
425 AC_DEFINE(PLUGIN_EXEC)
426else
427 not_asked="$not_asked exec"
428fi
429
cdc08d6f
SH
430# ---------------------------------- fifo --------------------------------------
431
432if test "x$enable_fifo" = "xyes" ; then
433 FIFO_CFLAGS=""
434 FIFO_LFLAGS=""
435 AC_SUBST(FIFO_CFLAGS)
436 AC_SUBST(FIFO_LFLAGS)
437 AC_DEFINE(PLUGIN_FIFO)
438else
439 not_asked="$not_asked fifo"
440fi
441
2a5eb156
SH
442# --------------------------------- fset ---------------------------------------
443
444if test "x$enable_fset" = "xyes" ; then
445 AC_DEFINE(PLUGIN_FSET)
446else
447 not_asked="$not_asked fset"
448fi
449
dec0e7dc
SH
450# ----------------------------------- irc --------------------------------------
451
452if test "x$enable_irc" = "xyes" ; then
453 AC_DEFINE(PLUGIN_IRC)
454else
455 not_asked="$not_asked irc"
456fi
457
cdc08d6f
SH
458# --------------------------------- logger -------------------------------------
459
460if test "x$enable_logger" = "xyes" ; then
461 LOGGER_CFLAGS=""
462 LOGGER_LFLAGS=""
463 AC_SUBST(LOGGER_CFLAGS)
464 AC_SUBST(LOGGER_LFLAGS)
465 AC_DEFINE(PLUGIN_LOGGER)
466else
467 not_asked="$not_asked logger"
468fi
469
20a1360b
SH
470# --------------------------------- relay --------------------------------------
471
472if test "x$enable_relay" = "xyes" ; then
473 RELAY_CFLAGS=""
474 RELAY_LFLAGS=""
475 AC_SUBST(RELAY_CFLAGS)
476 AC_SUBST(RELAY_LFLAGS)
477 AC_DEFINE(PLUGIN_RELAY)
478else
479 not_asked="$not_asked relay"
480fi
481
a99d1360
SH
482# --------------------------------- script -------------------------------------
483
484if test "x$enable_script" = "xyes" ; then
485 AC_DEFINE(PLUGIN_SCRIPT)
486else
487 not_asked="$not_asked script"
488fi
489
94a5c725 490# ---------------------------------- perl --------------------------------------
ed8906f2 491
71d5c65e 492PERL_VERSION=
94a5c725 493
fd9512bb 494if test "x$enable_perl" = "xyes" ; then
c08c40a1 495 AC_PATH_PROGS(PERL, perl perl5)
b935a02c 496 if test -z $PERL ; then
e7fd1a0c
SH
497 AC_MSG_WARN([
498*** Perl must be installed on your system but perl interpreter couldn't be found in path.
499*** Please check that perl is in path, or install it with your software package manager.
500*** WeeChat will be built without Perl support.])
501 enable_perl="no"
502 not_found="$not_found perl"
37d74c49 503 else
eb56a98f 504 PERL_VERSION=`perl -V:version | sed "s/version='\(.*\)';/\1/"`
e7fd1a0c 505 AC_MSG_CHECKING(for Perl headers files)
dfdf42e2 506
bf723ba7 507 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 -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
dfdf42e2 508
e7fd1a0c
SH
509 if test "x$PERL_HEADER_TEST" = "x0" ; then
510 PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
511 AC_MSG_RESULT(found)
512 AC_MSG_CHECKING(for Perl library)
513 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`
eb56a98f 514 if test "x$PERL_LIB_TEST" = "x0" ; then
e7fd1a0c
SH
515 PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
516 AC_MSG_RESULT(found)
517 else
518 AC_MSG_WARN([
8359a097 519*** Perl library couldn't be found on your system.
e7fd1a0c
SH
520*** Try to install it with your software package manager.
521*** WeeChat will be built without Perl support.])
522 enable_perl="no"
523 not_found="$not_found perl"
524 fi
525 else
526 AC_MSG_WARN([
8359a097 527*** Perl headers couldn't be found on your system.
e7fd1a0c
SH
528*** Try to install it with your software package manager.
529*** WeeChat will be built without Perl support.])
530 enable_perl="no"
531 not_found="$not_found perl"
532 fi
37d74c49 533 fi
ed8906f2
SH
534else
535 not_asked="$not_asked perl"
e7fd1a0c 536fi
37d74c49 537
e7fd1a0c 538if test "x$enable_perl" = "xyes" ; then
fd9512bb 539 AC_SUBST(PERL_CFLAGS)
cdc33d08 540 AC_SUBST(PERL_LFLAGS)
d4ec2e46 541 AC_DEFINE(PLUGIN_PERL)
fd9512bb
SH
542fi
543
94a5c725 544# --------------------------------- python -------------------------------------
ed8906f2 545
71d5c65e 546PYTHON_VERSION=
94a5c725 547
eda55fbd 548if test "x$enable_python" = "xyes" ; then
323801f8 549 if test "x$enable_python3" = "xyes" ; then
7554febf 550 AC_PATH_PROGS(PYTHON, python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python2 python)
323801f8
SH
551 else
552 AC_PATH_PROGS(PYTHON, python2.7 python2.6 python2.5 python2 python)
553 fi
b935a02c 554 if test -z $PYTHON ; then
e7fd1a0c
SH
555 AC_MSG_WARN([
556*** Python must be installed on your system but python interpreter couldn't be found in path.
557*** Please check that python is in path, or install it with your software package manager.
558*** WeeChat will be built without Python support.])
559 enable_python="no"
560 not_found="$not_found python"
b935a02c 561 else
cc5118b3
SH
562 PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; sys.stdout.write("%s" % sys.prefix)'`
563 PYTHON_VERSION=`$PYTHON -c 'import sys; sys.stdout.write(sys.version[[:3]])'`
5d2382ca 564 PYTHON_INCLUDE=`$PYTHON -c "import sys, distutils.sysconfig, string; sys.stdout.write(distutils.sysconfig.get_config_var('INCLUDEPY'))"`
cc5118b3
SH
565 PYTHON_OLD_VERSION=`$PYTHON -c "import sys; sys.stdout.write(str(sys.version_info < (2,5)))"`
566 if test "x$PYTHON_OLD_VERSION" = "xTrue" ; then
567 AC_MSG_WARN([
568*** Python >= 2.5 is needed to build Python plugin, version found: $PYTHON_VERSION.
569*** WeeChat will be built without Python support.])
570 enable_python="no"
571 not_found="$not_found python"
572 else
573 AC_MSG_CHECKING(for Python header files)
574 if test -r "$PYTHON_INCLUDE/Python.h"; then
575 PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
576 AC_MSG_RESULT(found)
323801f8
SH
577 PYTHON_LIB=`$PYTHON -c "import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_config_var('LIBPL'))"`
578 PYTHON_LFLAGS="-lpython$PYTHON_VERSION "`$PYTHON -c "import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_config_var('LIBS')+' '+distutils.sysconfig.get_config_var('SYSLIBS')+' '+distutils.sysconfig.get_config_var('LINKFORSHARED'))"`
cc5118b3
SH
579 AC_MSG_CHECKING(for Python library)
580 if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so"; then
581 PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
582 AC_MSG_RESULT(found)
583 elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
584 PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
585 AC_MSG_RESULT(found)
0cef9a22
SH
586 elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.dll.a"; then
587 PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
588 AC_MSG_RESULT(found)
cc5118b3
SH
589 elif test -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
590 PYTHON_LFLAGS="-L$PYTHON_SYSPREFIX/lib/ $PYTHON_LFLAGS"
591 AC_MSG_RESULT(found)
592 else
593 AC_MSG_WARN([
2801b843 594*** Python library couldn't be found on your system.
e7fd1a0c
SH
595*** Try to install it with your software package manager.
596*** WeeChat will be built without Python support.])
cc5118b3
SH
597 enable_python="no"
598 not_found="$not_found python"
599 fi
600 else
601 AC_MSG_WARN([
8359a097 602*** Python header files couldn't be found on your system.
e7fd1a0c
SH
603*** Try to install them with your software package manager.
604*** WeeChat will be built without Python support.])
cc5118b3
SH
605 enable_python="no"
606 not_found="$not_found python"
607 fi
e7fd1a0c 608 fi
b935a02c 609 fi
ed8906f2
SH
610else
611 not_asked="$not_asked python"
e7fd1a0c
SH
612fi
613
614if test "x$enable_python" = "xyes" ; then
eda55fbd 615 AC_SUBST(PYTHON_CFLAGS)
cdc33d08 616 AC_SUBST(PYTHON_LFLAGS)
eda55fbd
SH
617 AC_DEFINE(PLUGIN_PYTHON)
618fi
619
94a5c725 620# ---------------------------------- ruby --------------------------------------
ed8906f2 621
71d5c65e 622RUBY_VERSION=
94a5c725 623
11321acb 624if test "x$enable_ruby" = "xyes" ; then
d8b9e0a6
SH
625 RUBY_CFLAGS=""
626 RUBY_LFLAGS=""
4a442444 627 for v in "2.5" "2.4" "2.3" "2.2" "2.1" "2.0" "1.9" "1.8" ; do
d8b9e0a6
SH
628 pkgconfig_ruby_found=`$PKGCONFIG --exists ruby-$v 2>/dev/null`
629 if test "x$?" = "x0" ; then
630 RUBY_VERSION=`$PKGCONFIG --modversion ruby-$v`
631 RUBY_CFLAGS=`$PKGCONFIG --cflags ruby-$v`
632 RUBY_LFLAGS=`$PKGCONFIG --libs ruby-$v`
633 break
634 fi
635 done
636
4a442444 637 # detect old Ruby versions
d8b9e0a6
SH
638 if test "x$RUBY_CFLAGS" = "x" -o "x$RUBY_LFLAGS" = "x" ; then
639 AC_PATH_PROGS(RUBY, ruby1.9.3 ruby1.9.2 ruby1.9.1 ruby1.9 ruby1.8 ruby)
640 if test -z $RUBY ; then
641 AC_MSG_WARN([
e7fd1a0c
SH
642*** Ruby must be installed on your system but ruby interpreter couldn't be found in path.
643*** Please check that ruby is in path, or install it with your software package manager.
e7fd1a0c
SH
644*** WeeChat will be built without Ruby support.])
645 enable_ruby="no"
646 not_found="$not_found ruby"
b279a995 647 else
d8b9e0a6 648 RUBY_VERSION=`$RUBY -rrbconfig -e "puts RbConfig::CONFIG[['MAJOR']] + '.' + RbConfig::CONFIG[['MINOR']] + '.' + RbConfig::CONFIG[['TEENY']]"`
3ec98187
SH
649 RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts RbConfig::CONFIG[['rubyhdrdir']] || RbConfig::CONFIG[['archdir']]"`
650 RUBY_ARCH=`$RUBY -rrbconfig -e 'print RbConfig::CONFIG[["arch"]]'`
b279a995
SH
651 AC_MSG_CHECKING(for Ruby header files)
652 if test -d "$RUBY_INCLUDE/"; then
d8b9e0a6 653 RUBY_CFLAGS="-I$RUBY_INCLUDE/ -I$RUBY_INCLUDE/$RUBY_ARCH"
b279a995
SH
654 else
655 AC_MSG_WARN([
656*** Ruby header files couldn't be found on your system.
657*** Try to install them with your software package manager.
658*** WeeChat will be built without Ruby support.])
659 enable_ruby="no"
660 not_found="$not_found ruby"
661 fi
662 AC_MSG_RESULT(found)
3ec98187 663 RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts RbConfig::CONFIG[['LIBRUBYARG_SHARED']]"`
e7fd1a0c 664 fi
578a5781 665 fi
ed8906f2
SH
666else
667 not_asked="$not_asked ruby"
e7fd1a0c 668fi
578a5781 669
e7fd1a0c 670if test "x$enable_ruby" = "xyes" ; then
11321acb 671 AC_SUBST(RUBY_CFLAGS)
cdc33d08 672 AC_SUBST(RUBY_LFLAGS)
11321acb
SH
673 AC_DEFINE(PLUGIN_RUBY)
674fi
675
94a5c725 676# ---------------------------------- lua --------------------------------------
ed8906f2 677
71d5c65e 678LUA_VERSION=
94a5c725 679
abeb5a2f 680if test "x$enable_lua" = "xyes" ; then
abeb5a2f
EB
681 ac_save_CPPFLAGS="$CPPFLAGS"
682 ac_save_CFLAGS="$CFLAGS"
94a5c725 683 ac_save_LDFLAGS="$LDFLAGS"
abeb5a2f
EB
684
685 LUA_CFLAGS=""
686 LUA_LFLAGS=""
687
688 if test -n "$lua_inc"; then
689 CFLAGS="$CFLAGS -I$lua_inc"
690 CPPFLAGS="$CPPFLAGS -I$lua_inc"
691 fi
692 if test -n "$lua_lib"; then
94a5c725 693 LDFLAGS="$LDFLAGS -L$lua_lib"
abeb5a2f 694 fi
dfdf42e2 695
abeb5a2f 696 if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
d4618e45 697 AC_MSG_CHECKING(for Lua headers and libraries with pkg-config)
15394897 698 echo
7a3f1468 699 for l in "$lua_suffix" "" "52" "5.2" "51" "5.1" "50" "5.0" ; do
15394897
SH
700 pkgconfig_lua_found=`$PKGCONFIG --exists lua$l 2>/dev/null`
701 if test "x$?" = "x0" ; then
702 LUA_VERSION=`$PKGCONFIG --modversion lua$l`
703 LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lua$l`
704 LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lua$l`
705
706 pkgconfig_lualib_found=`$PKGCONFIG --exists lualib$l 2>/dev/null`
707 if test "x$?" = "x0"; then
708 LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
709 LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lualib$l`
e7fd1a0c 710 fi
15394897
SH
711 break
712 fi
713 done
2801b843 714 fi
e7fd1a0c
SH
715
716 if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
717 LUACONFIG=""
7a3f1468 718 AC_CHECK_PROGS(LUACONFIG, lua-config lua-config52 lua-config5.2 lua-config51 lua-config5.1 lua-config50 lua-config5.0)
e7fd1a0c 719 if test "x$LUACONFIG" != "x" ; then
d4618e45 720 AC_MSG_CHECKING(for Lua headers and libraries with lua-config)
eb56a98f 721 echo
e7fd1a0c
SH
722 LUA_CFLAGS=`$LUACONFIG --include`
723 LUA_LFLAGS=`$LUACONFIG --libs`
eb56a98f 724 LUA_VERSION="5.0.x"
abeb5a2f 725 fi
e7fd1a0c
SH
726 fi
727
2801b843 728 if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
d4618e45 729 AC_MSG_CHECKING(for Lua headers and libraries)
eb56a98f 730 echo
e7fd1a0c
SH
731 AC_CHECK_HEADER(lua.h,ac_found_lua_header="yes",ac_found_lua_header="no")
732 AC_CHECK_HEADER(lualib.h,ac_found_liblua_header="yes",ac_found_liblua_header="no")
733 if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then
734 LUA_CFLAGS="$CFLAGS"
735 fi
7a3f1468 736 for l in "$lua_suffix" "" "52" "5.2" "51" "5.1" "50" "5.0" ; do
94a5c725 737 AC_CHECK_LIB(lua$l,lua_call,ac_found_lua_lib="yes",ac_found_lua_lib="no")
e7fd1a0c 738 if test "x$ac_found_lua_lib" = "xyes" ; then
eb56a98f 739 LUA_VERSION=">=5.1.0"
dfdf42e2 740
eb56a98f 741 LUA_LFLAGS="$LDFLAGS -llua$l -lm"
dfdf42e2 742
eb56a98f
SH
743 ac2_save_LDFLAGS="$LDFLAGS"
744 LDFLAGS="$LDFLAGS -llua$l -lm"
745
746 if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
747 LDFLAGS="$LDFLAGS -ldl"
748 fi
749
750 AC_CHECK_LIB(lualib$l,luaL_openlib,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
751 if test "x$ac_found_liblua_lib" = "xyes" ; then
752 LUA_VERSION="5.0.x"
dfdf42e2 753
eb56a98f 754 LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
dfdf42e2 755
eb56a98f
SH
756 if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
757 LUA_LFLAGS="$LUA_LFLAGS -ldl"
758 fi
759 fi
760
761 LDFLAGS="$ac2_save_LDFLAGS"
762 break
763 fi
94a5c725 764 done
abeb5a2f 765 fi
c12b2338 766
94a5c725
EB
767 AC_MSG_CHECKING(for Lua compiling and linking)
768 LUA_TEST=`LT=luatest.c ; echo "#include <lua.h>" > $LT; echo "#include <lualib.h>" >> $LT; echo "int main() { luaopen_base((lua_State *)lua_open()); return 0; }" >> $LT ; $CC -Wall $LT -o $LT.out $LUA_CFLAGS $LUA_LFLAGS $CFLAGS $LDFLAGS 1>/dev/null 2>&1 ; echo $?; rm -f $LT $LT.out 1>/dev/null 2>&1`
769 if test "x$LUA_TEST" != "x0" ; then
52f2d5bf
AP
770 LUA52_TEST=`LT=luatest.c ; echo "#include <lua.h>" > $LT; echo "#include <lualib.h>" >> $LT; echo "int main() { luaopen_base((lua_State *)luaL_newstate()); return 0; }" >> $LT ; $CC -Wall $LT -o $LT.out $LUA_CFLAGS $LUA_LFLAGS $CFLAGS $LDFLAGS 1>/dev/null 2>&1 ; echo $?; rm -f $LT $LT.out 1>/dev/null 2>&1`
771 if test "x$LUA52_TEST" != "x0" ; then
772 AC_MSG_RESULT(no)
773 AC_MSG_WARN([
d4618e45 774*** Lua (>=5.0) headers and/or libraries couldn't be found on your system.
e7fd1a0c
SH
775*** Try to install liblua, liblualib and liblua-dev with your software package manager.
776*** WeeChat will be built without Lua support.])
52f2d5bf
AP
777 enable_lua="no"
778 not_found="$not_found lua"
779 else
780 AC_MSG_RESULT(yes)
781 fi
e7fd1a0c 782 else
94a5c725 783 AC_MSG_RESULT(yes)
e7fd1a0c 784 fi
94a5c725
EB
785
786 CFLAGS="$ac_save_CFLAGS"
787 CPPFLAGS="$ac_save_CPPFLAGS"
788 LDFLAGS="$ac_save_LDFLAGS"
ed8906f2
SH
789else
790 not_asked="$not_asked lua"
e7fd1a0c 791fi
abeb5a2f 792
e7fd1a0c 793if test "x$enable_lua" = "xyes" ; then
abeb5a2f
EB
794 AC_SUBST(LUA_CFLAGS)
795 AC_SUBST(LUA_LFLAGS)
796 AC_DEFINE(PLUGIN_LUA)
797fi
798
44944ef0 799# --------------------------------- tcl -------------------------------------
8359a097 800
44944ef0
SH
801TCL_VERSION=
802
803if test "x$enable_tcl" = "xyes" ; then
804 enable_plugins="yes"
dfdf42e2 805
8359a097
SH
806 AC_MSG_CHECKING(for tclConfig.sh)
807 tcl_found="no"
e8e36ad3 808 tcl_dirs="/usr/lib/tcl8.6 /usr/lib64/tcl8.6 /usr/lib/tcl8.5 /usr/lib64/tcl8.5 /lib /lib64 /usr/lib /usr/lib64 /usr/tcl/lib /usr/tcl/lib64 /usr/local/tcl-8.6/lib /usr/local/tcl-8.6/lib64 /usr/local/tcl-8.5/lib /usr/local/tcl-8.5/lib64 /usr/local/lib /usr/local/lib64 /usr/local/tcl/lib /usr/local/tcl/lib64 /opt/lib /opt/lib64"
a41b2e0a
SH
809 if test "x$tclconfig" != "x" ; then
810 tcl_dirs="${tclconfig} ${tcl_dirs}"
811 fi
8359a097
SH
812 for tcl_dir in $tcl_dirs ; do
813 if test -f ${tcl_dir}/tclConfig.sh ; then
814 . ${tcl_dir}/tclConfig.sh
815 TCL_CFLAGS="-I${TCL_PREFIX}/include $TCL_INCLUDE_SPEC"
816 TCL_LFLAGS="$TCL_LIB_SPEC $TCL_LIBS"
817 tcl_found="yes"
818 AC_MSG_RESULT(${tcl_dir}/tclConfig.sh)
819 break
820 fi
821 done
822 if test "x$tcl_found" = "xno" ; then
44944ef0 823 AC_MSG_WARN([
8359a097 824*** Script tclConfig.sh couldn't be found on your system.
44944ef0
SH
825*** WeeChat will be built without Tcl support.])
826 enable_tcl="no"
827 not_found="$not_found tcl"
44944ef0 828 fi
2120405a
SH
829else
830 not_asked="$not_asked tcl"
44944ef0
SH
831fi
832
833if test "x$enable_tcl" = "xyes" ; then
834 AC_SUBST(TCL_CFLAGS)
835 AC_SUBST(TCL_LFLAGS)
836 AC_DEFINE(PLUGIN_TCL)
837fi
838
9b42328d
SH
839# --------------------------------- guile -------------------------------------
840
841GUILE_VERSION=
842
843if test "x$enable_guile" = "xyes" ; then
844 enable_plugins="yes"
dfdf42e2 845
9b42328d 846 guile_found="no"
d4618e45 847 AC_MSG_CHECKING(for Guile headers and libraries)
15394897
SH
848 echo
849 for v in "2.0" ; do
850 pkgconfig_guile_found=`$PKGCONFIG --exists guile-$v 2>/dev/null`
851 if test "x$?" = "x0" ; then
852 GUILE_VERSION=`$PKGCONFIG --modversion guile-$v`
853 GUILE_CFLAGS=`$PKGCONFIG --cflags guile-$v`
854 GUILE_LFLAGS=`$PKGCONFIG --libs guile-$v`
855 guile_found="yes"
856 break
857 fi
858 done
dfdf42e2 859
6a2bef6f
SH
860 if test "x$guile_found" = "xyes" ; then
861 # check if variable "scm_install_gmp_memory_functions" exists
862 ac_save_CFLAGS="$CFLAGS"
863 ac_save_LDFLAGS="$LDFLAGS"
864 CFLAGS="$CFLAGS $GUILE_CFLAGS"
865 LDFLAGS="$LDFLAGS $GUILE_LFLAGS"
866 AC_CACHE_CHECK([for variable scm_install_gmp_memory_functions], ac_cv_have_guile_gmp_memory_functions, [
867 AC_LINK_IFELSE([AC_LANG_PROGRAM(
868 [[ #include <libguile.h>]],
869 [[ scm_install_gmp_memory_functions = 0; ]])],
870 [ ac_have_guile_gmp_memory_functions="yes" ],
871 [ ac_have_guile_gmp_memory_functions="no" ])])
872 CFLAGS="$ac_save_CFLAGS"
873 LDFLAGS="$ac_save_LDFLAGS"
874 if test "x$ac_have_guile_gmp_memory_functions" = "xyes"; then
875 AC_DEFINE(HAVE_GUILE_GMP_MEMORY_FUNCTIONS)
876 fi
877 else
9b42328d 878 AC_MSG_WARN([
9857b44e 879*** Guile >= 2.0 couldn't be found on your system.
9b42328d
SH
880*** WeeChat will be built without Guile (scheme) support.])
881 enable_guile="no"
882 not_found="$not_found guile"
883 fi
2120405a
SH
884else
885 not_asked="$not_asked guile"
9b42328d
SH
886fi
887
888if test "x$enable_guile" = "xyes" ; then
889 AC_SUBST(GUILE_CFLAGS)
890 AC_SUBST(GUILE_LFLAGS)
891 AC_DEFINE(PLUGIN_GUILE)
892fi
893
148a571d
SH
894# ------------------------------ javascript -----------------------------------
895
896AC_LANG_PUSH([C++])
897
898if test "x$enable_javascript" = "xyes" ; then
899 enable_plugins="yes"
900
901 v8_found="no"
902 AC_CHECK_HEADER(v8.h,ac_found_v8_header="yes",ac_found_v8_header="no")
903 if test "x$ac_found_v8_header" = "xyes" ; then
904 #AC_CHECK_LIB(v8,v8,ac_found_v8_lib="yes",ac_found_v8_lib="no")
8a322495 905 ac_save_LIBS="$LIBS"
664d5e6c 906 LIBS="$LIBS -lv8 -lpthread"
148a571d
SH
907 AC_MSG_CHECKING(for v8 usability in programs)
908 AC_TRY_RUN([
909 #include <v8.h>
910 using namespace v8;
911 int main(int argc, char **argv) {
912 const char *version = V8::GetVersion();
913 return 0;
914 }],ac_found_v8_lib="yes", ac_found_v8_lib="no", ac_found_v8_lib="assume-yes")
8a322495 915 LIBS="$ac_save_LIBS"
148a571d
SH
916 if test "x$ac_found_v8_lib" = "xyes" ; then
917 AC_MSG_RESULT(yes)
918 v8_found="yes"
919 V8_CFLAGS=""
664d5e6c 920 V8_LFLAGS="-lv8 -lpthread"
148a571d
SH
921 else
922 AC_MSG_RESULT(no)
923 AC_MSG_WARN([
924*** V8 library couldn't be found on your system.
92b9533e 925*** WeeChat will be built without JavaScript support.])
148a571d
SH
926 enable_javascript="no"
927 not_found="$not_found javascript/v8"
928 fi
929 else
930 AC_MSG_WARN([
931*** V8 header files couldn't be found on your system.
92b9533e 932*** WeeChat will be built without JavaScript support.])
148a571d
SH
933 enable_javascript="no"
934 not_found="$not_found javascript/v8"
935 fi
936else
937 not_asked="$not_asked javascript"
938fi
939
940if test "x$enable_javascript" = "xyes" ; then
941 AC_SUBST(V8_CFLAGS)
942 AC_SUBST(V8_LFLAGS)
943 AC_DEFINE(PLUGIN_JAVASCRIPT)
944fi
945
946AC_LANG_POP
947
d032ee21
AS
948# ---------------------------------- php --------------------------------------
949
950PHP_VERSION=
951
952if test "x$enable_php" = "xyes" ; then
953 ac_save_CPPFLAGS="$CPPFLAGS"
954 ac_save_CFLAGS="$CFLAGS"
955 ac_save_LDFLAGS="$LDFLAGS"
956
957 PHP_CFLAGS=""
958 PHP_LFLAGS=""
959
960 if test -n "$php_inc"; then
961 CFLAGS="$CFLAGS -I$php_inc"
962 CPPFLAGS="$CPPFLAGS -I$php_inc"
963 fi
964 if test -n "$php_lib"; then
965 LDFLAGS="$LDFLAGS -L$php_lib"
966 fi
967
968 if test "x$PHP_CFLAGS" = "x" -o "x$PHP_LFLAGS" = "x" ; then
969 AC_MSG_CHECKING(for PHP headers and libraries with pkg-config)
970 echo
e7cb025e 971 for l in "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do
d032ee21
AS
972 pkgconfig_php_found=`$PKGCONFIG --exists php$l 2>/dev/null`
973 if test "x$?" = "x0" ; then
280822b0
AS
974 pkgconfig_php_found=`$PKGCONFIG --atleast-version=7 php$l 2>/dev/null`
975 if test "x$?" = "x0" ; then
976 PHP_VERSION=`$PKGCONFIG --modversion php$l`
977 PHP_CFLAGS="$PHP_CFLAGS "`$PKGCONFIG --cflags php$l`
978 PHP_LFLAGS="$PHP_LFLAGS "`$PKGCONFIG --libs php$l`
979 break
980 fi
d032ee21
AS
981 fi
982 done
983 fi
984
985 if test "x$PHP_CFLAGS" = "x" -o "x$PHP_LFLAGS" = "x" ; then
986 PHPCONFIG=""
987 AC_MSG_CHECKING(for PHP headers and libraries with php-config)
e7cb025e 988 for l in "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do
d032ee21
AS
989 AC_CHECK_PROG(PHPCONFIG, "php-config$l", "php-config$l")
990 if test "x$PHPCONFIG" != "x" ; then
280822b0
AS
991 php_config_version=`$PHPCONFIG --version`
992 if test "x${php_config_version#7}" != "x${php_config_version}" ; then
993 PHP_VERSION=$php_config_version
994 PHP_CFLAGS=`$PHPCONFIG --includes`
19c36cdd 995 PHP_LFLAGS="-L$($PHPCONFIG --prefix)/lib/ $($PHPCONFIG --libs) -lphp$l"
280822b0
AS
996 break
997 fi
d032ee21
AS
998 fi
999 done
1000 fi
1001
1002 if test "x$PHP_CFLAGS" = "x" -o "x$PHP_LFLAGS" = "x" ; then
1003 AC_MSG_CHECKING(for PHP headers and libraries)
1004 echo
1005 AC_CHECK_HEADER(php.h,ac_found_php_header="yes",ac_found_php_header="no")
1006 if test "x$ac_found_php_header" = "xyes" ; then
1007 PHP_CFLAGS="$CFLAGS"
1008 fi
e7cb025e 1009 for l in "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do
d032ee21
AS
1010 AC_CHECK_LIB(php$l,php_execute_script,ac_found_php_lib="yes",ac_found_php_lib="no")
1011 if test "x$ac_found_php_lib" = "xyes" ; then
1012 PHP_VERSION=">=7.0.0"
1013
1014 PHP_LFLAGS="$LDFLAGS -lphp7 -lm"
1015
1016 ac2_save_LDFLAGS="$LDFLAGS"
1017 LDFLAGS="$LDFLAGS -lphp7 -lm"
1018
1019 if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
1020 LDFLAGS="$LDFLAGS -ldl"
1021 fi
1022
1023 LDFLAGS="$ac2_save_LDFLAGS"
1024 break
1025 fi
1026 done
1027 fi
1028
1029 AC_MSG_CHECKING(for PHP compiling and linking)
1030 PHP_TEST=`LT=phptest.c ; echo "#include <sapi/embed/php_embed.h>" > $LT; echo "int main() { php_embed_init(0, NULL); php_embed_shutdown(); return 0; }" >> $LT ; $CC -Wall $LT -o $LT.out $PHP_CFLAGS $PHP_LFLAGS $CFLAGS $LDFLAGS 1>/dev/null 2>&1 ; echo $?; rm -f $LT $LT.out 1>/dev/null 2>&1`
1031 if test "x$PHP_TEST" != "x0" ; then
1032 AC_MSG_RESULT(no)
1033 AC_MSG_WARN([
1034*** PHP (>=7.0) headers and/or libraries couldn't be found on your system.
1035*** Try to install libphp-embed with your software package manager.
1036*** WeeChat will be built without PHP support.])
1037 enable_php="no"
1038 not_found="$not_found php"
1039 else
1040 AC_MSG_RESULT(yes)
1041 fi
1042
1043 CFLAGS="$ac_save_CFLAGS"
1044 CPPFLAGS="$ac_save_CPPFLAGS"
1045 LDFLAGS="$ac_save_LDFLAGS"
1046else
1047 not_asked="$not_asked php"
1048fi
1049
1050if test "x$enable_php" = "xyes" ; then
1051 AC_SUBST(PHP_CFLAGS)
1052 AC_SUBST(PHP_LFLAGS)
1053 AC_DEFINE(PLUGIN_PHP)
1054fi
1055
30942f7f
SH
1056# --------------------------------- trigger ------------------------------------
1057
1058if test "x$enable_trigger" = "xyes" ; then
1059 TRIGGER_CFLAGS=""
1060 TRIGGER_LFLAGS=""
1061 AC_SUBST(TRIGGER_CFLAGS)
1062 AC_SUBST(TRIGGER_LFLAGS)
1063 AC_DEFINE(PLUGIN_TRIGGER)
1064else
1065 not_asked="$not_asked trigger"
1066fi
1067
e7a16efa
SH
1068# ---------------------------------- xfer --------------------------------------
1069
1070if test "x$enable_xfer" = "xyes" ; then
1071 XFER_CFLAGS=""
1072 XFER_LFLAGS=""
1073 AC_SUBST(XFER_CFLAGS)
1074 AC_SUBST(XFER_LFLAGS)
1075 AC_DEFINE(PLUGIN_XFER)
1076else
1077 not_asked="$not_asked xfer"
1078fi
1079
d2ec8d13
SH
1080# ------------------------------------------------------------------------------
1081# gcrypt
1082# ------------------------------------------------------------------------------
1083
a99d1360
SH
1084AC_CHECK_HEADER(gcrypt.h,ac_found_gcrypt_header="yes",ac_found_gcrypt_header="no")
1085AC_CHECK_LIB(gcrypt,gcry_check_version,ac_found_gcrypt_lib="yes",ac_found_gcrypt_lib="no")
dfdf42e2 1086
d4618e45 1087AC_MSG_CHECKING(for gcrypt headers and libraries)
a99d1360
SH
1088if test "x$ac_found_gcrypt_header" = "xno" -o "x$ac_found_gcrypt_lib" = "xno" ; then
1089 AC_MSG_RESULT(no)
1090 AC_MSG_ERROR([
d2ec8d13 1091*** libgcrypt was not found. You may want to get it from ftp://ftp.gnupg.org/gcrypt/libgcrypt/
a99d1360 1092*** or try to install libgcrypt-dev with your software package manager.])
d2ec8d13 1093else
a99d1360
SH
1094 AC_MSG_RESULT(yes)
1095 GCRYPT_CFLAGS=`libgcrypt-config --cflags`
1096 GCRYPT_LFLAGS=`libgcrypt-config --libs`
1097 AC_SUBST(GCRYPT_CFLAGS)
1098 AC_SUBST(GCRYPT_LFLAGS)
d2ec8d13
SH
1099fi
1100
cdc33d08
SH
1101# ------------------------------------------------------------------------------
1102# gnutls
1103# ------------------------------------------------------------------------------
1104
5e8b47f1 1105if test "x$enable_gnutls" = "xyes" ; then
d2ec8d13
SH
1106 AC_CHECK_HEADER(gnutls/gnutls.h,ac_found_gnutls_header="yes",ac_found_gnutls_header="no")
1107 AC_CHECK_LIB(gnutls,gnutls_global_init,ac_found_gnutls_lib="yes",ac_found_gnutls_lib="no")
dfdf42e2 1108
d4618e45 1109 AC_MSG_CHECKING(for gnutls headers and libraries)
d2ec8d13
SH
1110 if test "x$ac_found_gnutls_header" = "xno" -o "x$ac_found_gnutls_lib" = "xno" ; then
1111 AC_MSG_RESULT(no)
1112 AC_MSG_WARN([
e7fd1a0c 1113*** libgnutls was not found. You may want to get it from ftp://ftp.gnutls.org/pub/gnutls/
452a1d6b 1114*** WeeChat will be built without GnuTLS support.])
d2ec8d13
SH
1115 enable_gnutls="no"
1116 not_found="$not_found gnutls"
452a1d6b 1117 else
eb56a98f 1118 AC_MSG_RESULT(yes)
452a1d6b
EB
1119 GNUTLS_CFLAGS=`pkg-config gnutls --cflags`
1120 GNUTLS_LFLAGS=`pkg-config gnutls --libs`
15f75d15
SH
1121 AC_SUBST(GNUTLS_CFLAGS)
1122 AC_SUBST(GNUTLS_LFLAGS)
1123 AC_DEFINE(HAVE_GNUTLS)
d9a4bdf6 1124 CFLAGS="$CFLAGS -DHAVE_GNUTLS"
7c31dd91 1125 fi
ed8906f2
SH
1126else
1127 not_asked="$not_asked gnutls"
5e8b47f1 1128fi
cdc33d08 1129
f6bb78a3
EB
1130# ------------------------------------------------------------------------------
1131# flock
1132# ------------------------------------------------------------------------------
1133
1134enable_flock="no"
6ff197fe 1135AC_CACHE_CHECK([for flock() support], ac_cv_have_flock, [
ed8906f2
SH
1136AC_LINK_IFELSE([AC_LANG_PROGRAM(
1137[[ #include <sys/file.h>]],
1138[[ flock(0, LOCK_SH); ]])],
66f545f8 1139[ ac_cv_have_flock="yes" ],
1140[ ac_cv_have_flock="no" ])])
f6bb78a3 1141
66f545f8 1142if test "x$ac_cv_have_flock" = "xyes"; then
ed8906f2
SH
1143 enable_flock="yes"
1144 AC_DEFINE(HAVE_FLOCK)
1145else
1146 not_found="$not_found flock"
f6bb78a3
EB
1147fi
1148
479ce5d3
EB
1149# ------------------------------------------------------------------------------
1150# large file support
1151# ------------------------------------------------------------------------------
63add00d 1152
479ce5d3 1153if test "x$enable_largefile" = "xyes" ; then
0f7720d5 1154 CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES"
479ce5d3
EB
1155else
1156 not_asked="$not_asked largefile"
1157fi
1158
15f75d15
SH
1159# ------------------------------------------------------------------------------
1160# backtrace
1161# ------------------------------------------------------------------------------
1162
1163enable_backtrace="no"
1164if test "x$debug" != "x0" ; then
6ff197fe 1165 AC_CACHE_CHECK([for execinfo.h and backtrace], ac_cv_have_backtrace, [
ed8906f2
SH
1166 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1167 [[ #include <execinfo.h> ]],
1168 [[ void *trace[128]; int n = backtrace(trace, 128); ]])],
66f545f8 1169 [ ac_cv_have_backtrace="yes" ],
1170 [ ac_cv_have_backtrace="no" ])])
1171 if test "x$ac_cv_have_backtrace" = "xyes"; then
15f75d15
SH
1172 enable_backtrace="yes"
1173 AC_DEFINE(HAVE_BACKTRACE,1,[glibc backtrace function])
ed8906f2
SH
1174 else
1175 not_found="$not_found backtrace"
15f75d15
SH
1176 fi
1177fi
1178
41261875
SH
1179# ------------------------------------------------------------------------------
1180# eat_newline_glitch
1181# ------------------------------------------------------------------------------
1182
1183enable_eatnewlineglitch="no"
6ff197fe 1184AC_CACHE_CHECK([for eat_newline_glitch support], ac_cv_have_eatnewlineglitch, [
41261875
SH
1185AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1186[[ #include <term.h> ]],
1187[[ eat_newline_glitch = 0; ]])],
66f545f8 1188[ ac_cv_have_eatnewlineglitch="yes" ],
1189[ ac_cv_have_eatnewlineglitch="no" ])])
41261875 1190
66f545f8 1191if test "x$ac_cv_have_eatnewlineglitch" = "xyes"; then
41261875
SH
1192 enable_eatnewlineglitch="yes"
1193 AC_DEFINE(HAVE_EAT_NEWLINE_GLITCH)
1194else
1195 not_found="$not_found eat_newline_glitch"
1196fi
1197
013f8cc7
SH
1198# ------------------------------------------------------------------------------
1199# zlib
1200# ------------------------------------------------------------------------------
1201
a99d1360
SH
1202AC_CHECK_HEADER(zlib.h,ac_found_zlib_header="yes",ac_found_zlib_header="no")
1203AC_CHECK_LIB(z,compress2,ac_found_zlib_lib="yes",ac_found_zlib_lib="no")
013f8cc7 1204
d4618e45 1205AC_MSG_CHECKING(for zlib headers and libraries)
a99d1360
SH
1206if test "x$ac_found_zlib_header" = "xno" -o "x$ac_found_zlib_lib" = "xno" ; then
1207 AC_MSG_RESULT(no)
1208 AC_MSG_ERROR([
013f8cc7 1209*** zlib was not found. You may want to get it from http://zlib.net/
4e0d68de 1210*** or try to install zlib1g-dev with your software package manager.])
013f8cc7 1211else
a99d1360
SH
1212 AC_MSG_RESULT(yes)
1213 ZLIB_CFLAGS=`pkg-config zlib --cflags`
1214 ZLIB_LFLAGS=`pkg-config zlib --libs`
1215 AC_SUBST(ZLIB_CFLAGS)
1216 AC_SUBST(ZLIB_LFLAGS)
013f8cc7
SH
1217fi
1218
b91c2310
SH
1219# ------------------------------------------------------------------------------
1220# curl
1221# ------------------------------------------------------------------------------
1222
1223AC_PATH_PROG(CURL_CONFIG, curl-config)
1224if test "x$CURL_CONFIG" = "x" ; then
1225 AC_MSG_ERROR([
1226*** "curl-config" couldn't be found on your system.
1227*** Try to install libcurl-dev with your software package manager.])
1228fi
1229CURL_CFLAGS=`$CURL_CONFIG --cflags`
1230CURL_LFLAGS=`$CURL_CONFIG --libs`
1231AC_SUBST(CURL_CFLAGS)
1232AC_SUBST(CURL_LFLAGS)
1233
63add00d
SH
1234# ------------------------------------------------------------------------------
1235# tests
1236# ------------------------------------------------------------------------------
1237
1238if test "x$enable_tests" = "xyes" ; then
1239 cpputest_found="no"
d4618e45 1240 AC_MSG_CHECKING(for CppUTest headers and libraries)
63add00d
SH
1241 echo
1242 pkgconfig_cpputest_found=`$PKGCONFIG --exists cpputest 2>/dev/null`
1243 if test "x$?" = "x0" ; then
1244 CPPUTEST_VERSION=`$PKGCONFIG --modversion cpputest`
1245 CPPUTEST_CFLAGS=`$PKGCONFIG --cflags cpputest`
1246 CPPUTEST_LFLAGS=`$PKGCONFIG --libs cpputest`
1247 else
1248 AC_MSG_WARN([
1249*** CppUTest couldn't be found on your system.
1250*** WeeChat will be built without tests.])
1251 enable_tests="no"
1252 not_found="$not_found tests"
1253 fi
1254else
1255 not_asked="$not_asked tests"
1256fi
1257
1258if test "x$enable_tests" = "xyes" ; then
1259 AC_SUBST(CPPUTEST_CFLAGS)
1260 AC_SUBST(CPPUTEST_LFLAGS)
1261 AC_DEFINE(TESTS)
1262fi
1263
7f68da2c 1264# ------------------------------------------------------------------------------
261efe62 1265# man page / documentation
7f68da2c
SH
1266# ------------------------------------------------------------------------------
1267
261efe62 1268msg_man=""
015a9d0a
SH
1269msg_doc=""
1270
261efe62
SH
1271if test "x$enable_man" = "xno"; then
1272 not_asked="$not_asked man"
1273fi
1274if test "x$enable_doc" = "xno"; then
1275 not_asked="$not_asked doc"
1276fi
1277
1278if test "x$enable_man" = "xyes" -o "x$enable_doc" = "xyes"; then
220bd837
SH
1279 AC_CHECK_PROGS(ASCIIDOCTOR, [asciidoctor])
1280 if test -n "$ASCIIDOCTOR"; then
1281 AC_MSG_CHECKING([for asciidoctor version])
1282 asciidoctor_version=`$ASCIIDOCTOR --version 2>/dev/null | head -n 1 | cut -d" " -f2`
1283 case "${asciidoctor_version}" in
c5f6aad6 1284 Asciidoctor' '0.*|Asciidoctor' '1.5.[0-3]*)
220bd837
SH
1285 AC_MSG_RESULT([${asciidoctor_version} (too old)])
1286 not_found="$not_found asciidoctor"
1287 enable_man="no"
1288 enable_doc="no"
1289 ;;
1290 *)
1291 AC_MSG_RESULT([${asciidoctor_version}])
261efe62 1292 if test "x$enable_man" = "xyes"; then
220bd837
SH
1293 msg_man="asciidoctor(${asciidoctor_version}) $msg_man"
1294 AC_DEFINE(MAN)
261efe62
SH
1295 fi
1296 if test "x$enable_doc" = "xyes"; then
220bd837
SH
1297 msg_doc="asciidoctor(${asciidoctor_version}) $msg_doc"
1298 AC_DEFINE(DOC)
261efe62 1299 fi
041b7549 1300 ;;
041b7549 1301 esac
0e040e83 1302 else
220bd837 1303 not_found="$not_found asciidoctor"
261efe62
SH
1304 enable_man="no"
1305 enable_doc="no"
041b7549 1306 fi
220bd837 1307 AC_SUBST(ASCIIDOCTOR)
7f68da2c
SH
1308fi
1309
cdc33d08
SH
1310# ------------------------------------------------------------------------------
1311# general vars
1312# ------------------------------------------------------------------------------
1313
1314if test "x$prefix" = "xNONE" ; then
ed8906f2 1315 prefix="$ac_default_prefix"
cdc33d08
SH
1316fi
1317
1318if test "x$exec_prefix" = "xNONE" ; then
ed8906f2 1319 exec_prefix="$prefix"
cdc33d08
SH
1320fi
1321
1322AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
1323
f4698435 1324WEECHAT_LIBDIR=`eval eval echo ${libdir}/weechat`
cdc33d08
SH
1325AC_DEFINE_UNQUOTED(WEECHAT_LIBDIR, "$WEECHAT_LIBDIR")
1326
f4698435 1327WEECHAT_SHAREDIR=`eval eval echo ${datadir}/weechat`
cdc33d08
SH
1328AC_DEFINE_UNQUOTED(WEECHAT_SHAREDIR, "$WEECHAT_SHAREDIR")
1329
1330weechat_libdir=${libdir}/weechat
1331AC_SUBST(weechat_libdir)
34ee7e40 1332
04cb8dd4 1333COMMON_CFLAGS="-Wall -Wextra -Werror-implicit-function-declaration"
34ee7e40
SH
1334AC_MSG_CHECKING([whether we have GNU assembler])
1335GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
1336if test "$GAS"; then
1337 COMMON_CFLAGS="${COMMON_CFLAGS} -pipe"
1338 AC_MSG_RESULT(yes)
1339else
1340 AC_MSG_RESULT(no)
1341fi
6ed8f34f 1342
d1492b93 1343CFLAGS=`echo $CFLAGS | sed 's/ -g / /g'`
47c9c68b
SH
1344CFLAGS=`echo $CFLAGS | sed 's/^-g //g'`
1345CFLAGS=`echo $CFLAGS | sed 's/ -g$//g'`
1346CFLAGS=`echo $CFLAGS | sed 's/^-g$//g'`
dec0e7dc 1347if test "x$debug" = "x0" ; then
34ee7e40 1348 CFLAGS="$COMMON_CFLAGS $CFLAGS"
dec0e7dc
SH
1349else
1350 CFLAGS="$COMMON_CFLAGS $CFLAGS -g -O0"
b9a40bbe
SH
1351fi
1352
3369a009
SH
1353LIBS="$LIBS $INTLLIBS"
1354
dec92aeb 1355case "$host_os" in
545fa4c3 1356freebsd*)
3369a009 1357 if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then
ed8906f2 1358 CFLAGS="$CFLAGS -pthread"
3369a009
SH
1359 fi
1360 CFLAGS="$CFLAGS $CPPFLAGS"
dec92aeb 1361 ;;
5f101c38 1362openbsd*)
3369a009 1363 if test "x$enable_python" = "xyes" ; then
ed8906f2 1364 CFLAGS="$CFLAGS -pthread"
3369a009
SH
1365 fi
1366 ;;
545fa4c3
EB
1367netbsd*)
1368 if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then
ed8906f2 1369 CFLAGS="$CFLAGS -pthread"
545fa4c3
EB
1370 fi
1371 CFLAGS="$CFLAGS $CPPFLAGS"
ed8906f2 1372 ;;
eb56a98f 1373gnu*)
ed8906f2
SH
1374 LDFLAGS="$LDFLAGS -lpthread"
1375 ;;
dec92aeb
EB
1376*)
1377 ;;
1378esac
0b781f96 1379
c33f0e60 1380CFLAGS="$CFLAGS -DWEECHAT_VERSION=\\\"$VERSION\\\" -DWEECHAT_LICENSE=\\\"$LICENSE\\\""
148a571d 1381CPPFLAGS="$CPPFLAGS -DWEECHAT_VERSION=\\\"$VERSION\\\" -DWEECHAT_LICENSE=\\\"$LICENSE\\\""
d9a4bdf6 1382
cdc33d08
SH
1383# ------------------------------------------------------------------------------
1384# output Makefiles
1385# ------------------------------------------------------------------------------
1386
091ef992
SH
1387AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
1388AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes")
1389AM_CONDITIONAL(HAVE_EAT_NEWLINE_GLITCH, test "$enable_eatnewlineglitch" = "yes")
1390AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
805717e9 1391AM_CONDITIONAL(HEADLESS, test "$enable_headless" = "yes")
091ef992
SH
1392AM_CONDITIONAL(PLUGIN_ALIAS, test "$enable_alias" = "yes")
1393AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes")
edfeb60e 1394AM_CONDITIONAL(PLUGIN_BUFLIST, test "$enable_buflist" = "yes")
091ef992
SH
1395AM_CONDITIONAL(PLUGIN_CHARSET, test "$enable_charset" = "yes")
1396AM_CONDITIONAL(PLUGIN_EXEC, test "$enable_exec" = "yes")
1397AM_CONDITIONAL(PLUGIN_FIFO, test "$enable_fifo" = "yes")
2a5eb156 1398AM_CONDITIONAL(PLUGIN_FSET, test "$enable_fset" = "yes")
091ef992
SH
1399AM_CONDITIONAL(PLUGIN_IRC, test "$enable_irc" = "yes")
1400AM_CONDITIONAL(PLUGIN_LOGGER, test "$enable_logger" = "yes")
1401AM_CONDITIONAL(PLUGIN_RELAY, test "$enable_relay" = "yes")
1402AM_CONDITIONAL(PLUGIN_SCRIPT, test "$enable_script" = "yes")
1403AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
1404AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
1405AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
1406AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
1407AM_CONDITIONAL(PLUGIN_TCL, test "$enable_tcl" = "yes")
1408AM_CONDITIONAL(PLUGIN_GUILE, test "$enable_guile" = "yes")
1409AM_CONDITIONAL(PLUGIN_JAVASCRIPT, test "$enable_javascript" = "yes")
d032ee21 1410AM_CONDITIONAL(PLUGIN_PHP, test "$enable_php" = "yes")
091ef992
SH
1411AM_CONDITIONAL(PLUGIN_TRIGGER, test "$enable_trigger" = "yes")
1412AM_CONDITIONAL(PLUGIN_XFER, test "$enable_xfer" = "yes")
1413AM_CONDITIONAL(TESTS, test "$enable_tests" = "yes")
1414AM_CONDITIONAL(MAN, test "$enable_man" = "yes")
1415AM_CONDITIONAL(DOC, test "$enable_doc" = "yes")
e7fd1a0c 1416
f966b6a8 1417AC_OUTPUT([Makefile
23696b44 1418 doc/Makefile
b10b53c6 1419 doc/en/Makefile
b314ee0f 1420 doc/fr/Makefile
9a821b9d 1421 doc/it/Makefile
ae047756 1422 doc/de/Makefile
9a821b9d
L
1423 doc/pl/Makefile
1424 doc/es/Makefile
a5a60665 1425 doc/ru/Makefile
a5c4d140 1426 doc/ja/Makefile
152b5ec2 1427 doc/cs/Makefile
f966b6a8 1428 src/Makefile
ed8906f2 1429 src/core/Makefile
fd9512bb 1430 src/plugins/Makefile
2888d414 1431 src/plugins/alias/Makefile
cdc08d6f 1432 src/plugins/aspell/Makefile
edfeb60e 1433 src/plugins/buflist/Makefile
cdc08d6f 1434 src/plugins/charset/Makefile
97254780 1435 src/plugins/exec/Makefile
cdc08d6f 1436 src/plugins/fifo/Makefile
2a5eb156 1437 src/plugins/fset/Makefile
dec0e7dc 1438 src/plugins/irc/Makefile
cdc08d6f 1439 src/plugins/logger/Makefile
20a1360b 1440 src/plugins/relay/Makefile
a99d1360 1441 src/plugins/script/Makefile
57eb5135
SH
1442 src/plugins/perl/Makefile
1443 src/plugins/python/Makefile
1444 src/plugins/ruby/Makefile
1445 src/plugins/lua/Makefile
1446 src/plugins/tcl/Makefile
1447 src/plugins/guile/Makefile
148a571d 1448 src/plugins/javascript/Makefile
d032ee21 1449 src/plugins/php/Makefile
30942f7f 1450 src/plugins/trigger/Makefile
e7a16efa 1451 src/plugins/xfer/Makefile
f966b6a8
SH
1452 src/gui/Makefile
1453 src/gui/curses/Makefile
805717e9
SH
1454 src/gui/curses/normal/Makefile
1455 src/gui/curses/headless/Makefile
63add00d 1456 tests/Makefile
dc836881
SH
1457 intl/Makefile
1458 po/Makefile.in])
f966b6a8 1459
cdc33d08
SH
1460# ------------------------------------------------------------------------------
1461# end message
1462# ------------------------------------------------------------------------------
f966b6a8 1463
e7fd1a0c 1464listgui=""
7dbaec1a 1465if test "x$enable_ncurses" = "xyes" ; then
9d0b6fad 1466 listgui="$listgui ncurses"
f966b6a8 1467fi
805717e9
SH
1468if test "x$enable_headless" = "xyes" ; then
1469 listgui="$listgui headless"
1470fi
f966b6a8 1471
1ba27c76 1472if test "x$listgui" = "x" ; then
b935a02c
SH
1473 AC_MSG_ERROR([
1474*** No interface specified...
805717e9 1475*** Please enable at least ncurses or headless.])
e7fd1a0c
SH
1476fi
1477
ed8906f2 1478listplugins=""
2888d414
SH
1479if test "x$enable_alias" = "xyes"; then
1480 listplugins="$listplugins alias"
1481fi
ed8906f2 1482if test "x$enable_aspell" = "xyes"; then
fb7edb35 1483 listplugins="$listplugins aspell($ASPELL_LIB_USED)"
71d5c65e 1484fi
edfeb60e
SH
1485if test "x$enable_buflist" = "xyes"; then
1486 listplugins="$listplugins buflist"
1487fi
ed8906f2
SH
1488if test "x$enable_charset" = "xyes"; then
1489 listplugins="$listplugins charset"
71d5c65e 1490fi
97254780
SH
1491if test "x$enable_exec" = "xyes"; then
1492 listplugins="$listplugins exec"
1493fi
ed8906f2
SH
1494if test "x$enable_fifo" = "xyes"; then
1495 listplugins="$listplugins fifo"
1496fi
2a5eb156
SH
1497if test "x$enable_fset" = "xyes"; then
1498 listplugins="$listplugins fset"
1499fi
dec0e7dc
SH
1500if test "x$enable_irc" = "xyes" ; then
1501 listplugins="$listplugins irc"
1502fi
cdc08d6f
SH
1503if test "x$enable_logger" = "xyes"; then
1504 listplugins="$listplugins logger"
1505fi
20a1360b
SH
1506if test "x$enable_relay" = "xyes"; then
1507 listplugins="$listplugins relay"
1508fi
a99d1360
SH
1509if test "x$enable_script" = "xyes"; then
1510 listplugins="$listplugins script"
1511fi
cdc08d6f
SH
1512if test "x$enable_perl" = "xyes"; then
1513 listplugins="$listplugins perl($PERL_VERSION)"
1514fi
1515if test "x$enable_python" = "xyes"; then
1516 listplugins="$listplugins python($PYTHON_VERSION)"
1517fi
1518if test "x$enable_ruby" = "xyes"; then
1519 listplugins="$listplugins ruby($RUBY_VERSION)"
1520fi
1521if test "x$enable_lua" = "xyes"; then
1522 listplugins="$listplugins lua($LUA_VERSION)"
1523fi
44944ef0 1524if test "x$enable_tcl" = "xyes"; then
8359a097 1525 listplugins="$listplugins tcl($TCL_VERSION)"
44944ef0 1526fi
9b42328d
SH
1527if test "x$enable_guile" = "xyes"; then
1528 listplugins="$listplugins guile($GUILE_VERSION)"
1529fi
148a571d
SH
1530if test "x$enable_javascript" = "xyes"; then
1531 listplugins="$listplugins javascript/v8"
1532fi
d032ee21
AS
1533if test "x$enable_php" = "xyes"; then
1534 listplugins="$listplugins php($PHP_VERSION)"
1535fi
30942f7f
SH
1536if test "x$enable_trigger" = "xyes"; then
1537 listplugins="$listplugins trigger"
1538fi
e7a16efa
SH
1539if test "x$enable_xfer" = "xyes"; then
1540 listplugins="$listplugins xfer"
1541fi
71d5c65e 1542
ed8906f2
SH
1543listoptional=""
1544if test "x$enable_gnutls" = "xyes"; then
1545 listoptional="$listoptional gnutls"
1546fi
1547if test "x$enable_flock" = "xyes"; then
1548 listoptional="$listoptional flock"
1549fi
479ce5d3
EB
1550if test "x$enable_largefile" = "xyes"; then
1551 listoptional="$listoptional largefile"
1552fi
ed8906f2
SH
1553if test "x$enable_backtrace" = "xyes"; then
1554 listoptional="$listoptional backtrace"
71d5c65e
EB
1555fi
1556
ed8906f2 1557msg_debug="no"
dec0e7dc 1558if test "x$debug" != "x0"; then
ed8906f2
SH
1559 msg_debug="yes"
1560fi
71d5c65e 1561
63add00d
SH
1562msg_tests="no"
1563if test "x$enable_tests" = "xyes"; then
1564 msg_tests="yes"
1565fi
1566
261efe62
SH
1567if test "x$msg_man" = "x"; then
1568 msg_man="no"
1569else
1570 msg_man="yes: $msg_man"
1571fi
c3aa3efa
SH
1572if test "x$msg_doc" = "x"; then
1573 msg_doc="no"
1574else
1575 msg_doc="yes: $msg_doc"
1576fi
1577
cdc33d08 1578echo ""
ed8906f2 1579echo "Enabled features:"
87e342dd
SH
1580echo " Interfaces............. :$listgui"
1581echo " Plugins................ :$listplugins"
1582echo " Optional features...... :$listoptional"
1583echo " Compile with debug..... : $msg_debug"
63add00d 1584echo " Compile tests.......... : $msg_tests"
261efe62 1585echo " Man page............... : $msg_man"
87e342dd
SH
1586echo " Documentation.......... : $msg_doc"
1587echo " Certificate authorities : ${CA_FILE}"
ed8906f2
SH
1588
1589if test "x$not_asked" != "x" || test "x$not_found" != "x"; then
1590 echo ""
1591 echo "Disabled features:"
1592 if test "x$not_asked" != "x"; then
1593 echo " - not asked:$not_asked"
1594 fi
1595 if test "x$not_found" != "x"; then
1596 echo " - not found:$not_found"
1597 fi
1598fi
1599
cdc33d08 1600echo ""
34e0226e
SH
1601echo "WeeChat home directory is ${WEECHAT_HOME}"
1602echo ""
1603eval echo "WeeChat will be installed in $bindir"
cdc33d08
SH
1604echo ""
1605echo "configure complete, now type 'make' to build WeeChat $VERSION"
1606echo ""