]>
Commit | Line | Data |
---|---|---|
5ca6291f US |
1 | dnl Needed for AC_PATH_PROGS_FEATURE_CHECK which was added in 2.62 |
2 | AC_PREREQ([2.62]) | |
4f7b9046 | 3 | dnl Keep the version number in sync with main.h! |
192e6b02 | 4 | AC_INIT([znc], [0.206]) |
7d912d1d | 5 | AC_CONFIG_MACRO_DIR([m4]) |
9c4a5a1d | 6 | AC_CONFIG_SRCDIR([znc.cpp]) |
7 | AC_LANG([C++]) | |
3ecbf133 | 8 | AC_CONFIG_HEADERS([zncconfig.h]) |
9 | AH_TOP([#ifndef ZNCCONFIG_H | |
10 | #define ZNCCONFIG_H]) | |
11 | AH_BOTTOM([#endif /* ZNCCONFIG_H */]) | |
9c4a5a1d | 12 | |
226d8db5 | 13 | AC_DEFUN([ZNC_AUTO_FAIL], [ |
521695fb | 14 | # This looks better in the summary at the end |
15 | $1="not found" | |
16464664 | 16 | if test "x$old_$1" != "xauto" ; then |
521695fb | 17 | AC_MSG_ERROR([$2]) |
18 | else | |
19 | AC_MSG_WARN([$3]) | |
20 | fi | |
21 | ]) | |
22 | ||
9c4a5a1d | 23 | # AC_PROG_CXX sets CXXFLAGS to "-O2 -g" if it is unset which we don't want |
24 | CXXFLAGS="$CXXFLAGS " | |
d9591e95 | 25 | AC_PROG_CXX |
eb307ddc | 26 | AC_PROG_INSTALL |
797b0a7f AS |
27 | AC_PROG_GREP |
28 | AC_PROG_SED | |
d9591e95 | 29 | AC_CANONICAL_HOST |
2d0f4510 | 30 | AC_SYS_LARGEFILE |
ea589120 | 31 | gl_VISIBILITY |
b772e266 | 32 | |
d1de3746 | 33 | appendLib () { |
d9591e95 | 34 | if test "$LIBS" != ""; then |
35 | LIBS="$LIBS $*" | |
36 | else | |
37 | LIBS=$* | |
38 | fi | |
39 | } | |
40 | ||
d1de3746 | 41 | appendCXX () { |
d9591e95 | 42 | if test "$CXXFLAGS" != ""; then |
43 | CXXFLAGS="$CXXFLAGS $*" | |
44 | else | |
45 | CXXFLAGS=$* | |
46 | fi | |
47 | } | |
0a622749 | 48 | |
90cf81e6 | 49 | appendMod () { |
50 | if test "$MODFLAGS" != ""; then | |
51 | MODFLAGS="$MODFLAGS $*" | |
52 | else | |
53 | MODFLAGS=$* | |
54 | fi | |
55 | } | |
56 | ||
d1de3746 | 57 | appendLD () { |
0a622749 | 58 | if test "$LDFLAGS" != ""; then |
59 | LDFLAGS="$LDFLAGS $*" | |
60 | else | |
61 | LDFLAGS=$* | |
62 | fi | |
63 | } | |
64 | ||
34e62cd8 | 65 | appendCXX "-D_FORTIFY_SOURCE=2" |
6d957ed9 | 66 | |
b772e266 | 67 | case "${host_os}" in |
9f665430 | 68 | freebsd*) |
942eb63a | 69 | # -D__GNU_LIBRARY__ makes this work on fbsd 4.11 |
70 | appendCXX -I/usr/local/include -D__GNU_LIBRARY__ | |
9f665430 | 71 | appendLib -L/usr/local/lib -lcompat |
90cf81e6 | 72 | appendMod -L/usr/local/lib |
b772e266 | 73 | ;; |
9f665430 | 74 | solaris*) |
2c6a54b6 | 75 | appendLib -lsocket -lnsl -lresolv |
9f665430 | 76 | ISSUN=1 |
b772e266 | 77 | ;; |
9f665430 | 78 | cygwin) |
79 | ISCYGWIN=1 | |
b772e266 | 80 | ;; |
90cf81e6 | 81 | darwin*) |
82 | ISDARWIN=1 | |
83 | ;; | |
b772e266 | 84 | esac |
d9591e95 | 85 | |
fe6a930a | 86 | AC_ARG_WITH( [openssl], |
87 | AS_HELP_STRING([--with-openssl=DIR], [openssl installation prefix]), | |
88 | [OPENSSL=$withval],) | |
0b7576a4 | 89 | AC_ARG_ENABLE( [extra], |
90 | AS_HELP_STRING([--enable-extra], [enable some extra modules]), | |
91 | [EXTRA="$enableval"], | |
92 | [EXTRA="no"]) | |
759d11fc | 93 | AC_ARG_ENABLE( [debug], |
7e61148a | 94 | AS_HELP_STRING([--enable-debug], [enable debugging]), |
759d11fc | 95 | [DEBUG="$enableval"], |
96 | [DEBUG="no"]) | |
97 | AC_ARG_ENABLE( [ipv6], | |
f4e36a0b | 98 | AS_HELP_STRING([--disable-ipv6], [disable ipv6 support]), |
759d11fc | 99 | [IPV6="$enableval"], |
f4e36a0b | 100 | [IPV6="yes"]) |
759d11fc | 101 | AC_ARG_ENABLE( [openssl], |
9c4a5a1d | 102 | AS_HELP_STRING([--disable-openssl], [disable openssl]), |
f0232425 | 103 | [SSL="$enableval"], |
16464664 | 104 | [SSL="auto"]) |
759d11fc | 105 | AC_ARG_ENABLE( [perl], |
a44e6eaa | 106 | AS_HELP_STRING([--enable-perl], [enable perl]), |
16464664 | 107 | [PERL="$enableval"], |
a44e6eaa | 108 | [PERL="no"]) |
a564e25c | 109 | AC_ARG_ENABLE( [python], |
ba915eb9 AS |
110 | AS_HELP_STRING([--enable-python[[[=python3]]]], [enable python. |
111 | By default python3.pc of pkg-config is used, but you can use | |
112 | another name, for example python-3.1]), | |
a564e25c | 113 | [PYTHON="$enableval"], |
114 | [PYTHON="no"]) | |
a44e6eaa | 115 | AC_ARG_ENABLE( [swig], |
a564e25c | 116 | AS_HELP_STRING([--disable-swig], [Disable automatic generation of source files needed for modperl/modpython. |
117 | This value is ignored if perl and python are disabled. If you disable swig, | |
118 | but still want to use these modules, please download the necessary files to modules/modperl and/or to modules/modpython. | |
119 | Check http://en.znc.in/wiki/Modperl and http://en.znc.in/wiki/Modpython for details.]), | |
7d912d1d AS |
120 | [USESWIG="$enableval"], |
121 | [USESWIG="auto"]) | |
3f27be8b | 122 | AC_ARG_ENABLE( [sasl], |
9c4a5a1d | 123 | AS_HELP_STRING([--enable-sasl], [enable sasl]), |
3f27be8b | 124 | [if test "$enableval" = "yes" ; then SASL=1; fi],) |
29dab181 | 125 | AC_ARG_ENABLE( [optimization], |
9c4a5a1d | 126 | AS_HELP_STRING([--disable-optimization], [Disable some compiler optimizations to |
29dab181 | 127 | decrease memory usage while compiling]), |
128 | [OPTIMIZE="$enableval"], | |
129 | [OPTIMIZE="yes"]) | |
f77e5266 | 130 | AC_ARG_ENABLE( [c-ares], |
131 | AS_HELP_STRING([--disable-c-ares], [disable c-ares usage]), | |
132 | [ARES="$enableval"], | |
158702a9 | 133 | [ARES="auto"]) |
fe6a930a | 134 | AC_ARG_ENABLE( [run-from-source], |
135 | AS_HELP_STRING([--enable-run-from-source], [znc will be runnable without installation]), | |
0f6c1f9e | 136 | [if test "x$enableval" = "xyes" ; then |
40a1bbac | 137 | AC_DEFINE([RUN_FROM_SOURCE], [1], |
138 | [Define if ZNC should be runnable without installation]) | |
d72fc441 | 139 | fi |
140 | RUNFROMSOURCE="$enableval"], | |
141 | [RUNFROMSOURCE="no"]) | |
0f9f2468 | 142 | AC_ARG_ENABLE( [poll], |
143 | AS_HELP_STRING([--disable-poll], [use select() instead of poll()]), | |
144 | [POLL="$enableval"], | |
145 | [POLL="yes"]) | |
74213c9a | 146 | |
759d11fc | 147 | if test "$DEBUG" != "no"; then |
dd87a7e5 | 148 | appendCXX -ggdb |
40a1bbac | 149 | AC_DEFINE([_DEBUG], [1], [Define for debugging]) |
c07347b9 | 150 | # These enable some debug options in g++'s STL, e.g. invalid use of iterators |
40a1bbac | 151 | AC_DEFINE([_GLIBCXX_DEBUG], [1], [Enable extra debugging checks in libstdc++]) |
152 | AC_DEFINE([_GLIBCXX_DEBUG_PEDANTIC], [1], [Enable extra debugging checks in libstdc++]) | |
153 | AC_DEFINE([_GLIBCXX_CONCEPT_CHECKS], [1], [Enable extra debugging checks in libstdc++]) | |
759d11fc | 154 | else |
29dab181 | 155 | if test "x$OPTIMIZE" = "xyes"; then |
156 | appendCXX -O2 | |
157 | fi | |
759d11fc | 158 | fi |
159 | ||
160 | if test "$IPV6" != "no"; then | |
40a1bbac | 161 | AC_DEFINE([HAVE_IPV6], [1], [Define if IPv6 support is enabled]) |
759d11fc | 162 | fi |
d9591e95 | 163 | |
9f665430 | 164 | if test "x$GXX" = "xyes"; then |
7e34dd3b | 165 | appendCXX -Wall -W -Wno-unused-parameter -Woverloaded-virtual -Wshadow |
9f665430 | 166 | fi |
167 | ||
0f9f2468 | 168 | if test "$POLL" = "yes"; then |
72c1fa0c US |
169 | # poll() is broken on Mac OS, it fails with POLLNVAL for pipe()s. |
170 | if test -n "$ISDARWIN" | |
171 | then | |
172 | # Did they give us --enable-poll? | |
173 | if test -n "$enable_poll" | |
174 | then | |
175 | # Yes, they asked for this. | |
176 | AC_MSG_WARN([poll() is known to be broken on Mac OS X. You have been warned.]) | |
177 | else | |
178 | # No, our default value of "yes" got applied. | |
179 | AC_MSG_WARN([poll() is known to be broken on Mac OS X. Using select() instead.]) | |
180 | AC_MSG_WARN([Use --enable-poll for forcing poll() to be used.]) | |
181 | POLL=no | |
182 | fi | |
183 | fi | |
184 | if test "$POLL" = "yes"; then | |
185 | AC_DEFINE([CSOCK_USE_POLL], [1], [Use poll() instead of select()]) | |
186 | fi | |
0f9f2468 | 187 | fi |
188 | ||
7de2b935 | 189 | AC_CHECK_LIB( gnugetopt, getopt_long,) |
2c6a54b6 | 190 | AC_CHECK_FUNCS([lstat getopt_long getphassphrase]) |
68c5ee59 | 191 | PKG_PROG_PKG_CONFIG() |
6d957ed9 | 192 | |
e2c694c9 | 193 | # ----- Check for dlopen |
194 | ||
85a27066 | 195 | AC_SEARCH_LIBS([dlopen], [dl], [], |
196 | [AC_MSG_ERROR([Could not find dlopen. ZNC will not work on this box until you upgrade this ancient system or at least install the necessary system libraries.])]) | |
e2c694c9 | 197 | |
198 | # ----- Check for c-ares | |
199 | ||
158702a9 | 200 | if test "x$ARES" != "xno"; then |
201 | old_ARES=$ARES | |
76b40e35 | 202 | if test -z "$PKG_CONFIG" |
203 | then | |
158702a9 | 204 | ARES=no |
1794ecd8 | 205 | ZNC_AUTO_FAIL([ARES], |
206 | [pkg-config not found. Try --disable-c-ares. | |
207 | Disabling c-ares may result in a slight performance decrease but will not have any other side-effects], | |
208 | [pkg-config was not found and thus c-ares was disabled]) | |
158702a9 | 209 | else |
a4d46e8c | 210 | PKG_CHECK_MODULES([c_ares], [libcares >= 1.5.0],, ARES=no) |
158702a9 | 211 | |
1794ecd8 | 212 | if test "x$ARES" = "xno" ; then |
213 | ZNC_AUTO_FAIL([ARES], | |
214 | [c-ares not found. Try --disable-c-ares. | |
16464664 | 215 | Disabling c-ares may result in a slight performance decrease but will not have any other side-effects], |
1794ecd8 | 216 | [c-ares was not found and thus disabled]) |
217 | else | |
40a1bbac | 218 | AC_DEFINE([HAVE_C_ARES], [1], [Define if c-ares is enabled]) |
f4927709 | 219 | appendCXX $c_ares_CFLAGS |
1794ecd8 | 220 | appendLib $c_ares_LIBS |
221 | ARES=yes | |
222 | fi | |
76b40e35 | 223 | fi |
f77e5266 | 224 | fi |
225 | ||
e2c694c9 | 226 | # ----- Check for openssl |
227 | ||
f0232425 | 228 | if test "x$SSL" != "xno"; then |
40ba157f | 229 | if test -n "$OPENSSL"; then |
230 | appendLib -L${OPENSSL}/lib | |
4c69e66d | 231 | appendLib -L${OPENSSL}/lib64 |
9c4a5a1d | 232 | appendCXX -I${OPENSSL}/include |
4c69e66d | 233 | PKG_CONFIG_PATH="$OPENSSL/lib/pkgconfig/:$OPENSSL/lib64/pkgconfig/:$PKG_CONFIG_PATH" |
40ba157f | 234 | fi |
d9591e95 | 235 | |
521695fb | 236 | old_SSL=$SSL |
68c5ee59 | 237 | PKG_CHECK_MODULES([openssl], [openssl], [ |
238 | appendLib "$openssl_LIBS" | |
239 | appendCXX "$openssl_CFLAGS" | |
240 | ], [ | |
68c5ee59 | 241 | # Don't reorder this! |
242 | # On some arches libssl depends on libcrypto without linking to it :( | |
243 | AC_CHECK_LIB( crypto, BIO_new,, SSL=no ) | |
244 | AC_CHECK_LIB( ssl, SSL_shutdown,, SSL=no ) | |
245 | ]) | |
521695fb | 246 | |
247 | if test "x$SSL" = "xno" ; then | |
248 | ZNC_AUTO_FAIL([SSL], | |
16464664 | 249 | [OpenSSL not found. Try --disable-openssl.], |
250 | [OpenSSL was not found and thus disabled]) | |
521695fb | 251 | NOSSL=1 |
252 | else | |
40a1bbac | 253 | AC_DEFINE([HAVE_LIBSSL], [1], [Define if openssl is enabled]) |
16464664 | 254 | SSL=yes |
521695fb | 255 | fi |
f0232425 | 256 | else |
257 | NOSSL=1 | |
d9591e95 | 258 | fi |
259 | ||
759d11fc | 260 | AC_ARG_WITH( [module-prefix], |
65394f61 | 261 | AS_HELP_STRING([--with-module-prefix], [module object code [LIBDIR/znc]]), |
759d11fc | 262 | [MODDIR=$withval], |
608fbdbd | 263 | [MODDIR="${libdir}/znc"] ) |
264 | ||
265 | AC_ARG_WITH( [module-data-prefix], | |
9c4a5a1d | 266 | AS_HELP_STRING([--with-module-data-prefix=DIR], |
65394f61 | 267 | [static module data (webadmin skins) [DATADIR/znc]]), |
608fbdbd | 268 | [DATADIR=$withval], |
269 | [DATADIR="${datadir}/znc"] ) | |
270 | ||
57cfa950 | 271 | appendMod "$CXXFLAGS" |
ea589120 | 272 | appendMod "$CFLAG_VISIBILITY" |
6d957ed9 | 273 | |
37b70a29 | 274 | if test -z "$ISSUN" -a -z "$ISDARWIN" -a -z "$ISCYGWIN"; then |
57cfa950 | 275 | # This is an unknown compiler flag on some OS |
276 | appendLD -Wl,--export-dynamic | |
277 | fi | |
90cf81e6 | 278 | |
57cfa950 | 279 | if test -z "$ISCYGWIN" ; then |
280 | # cygwin doesn't need -fPIC, everything else does (for modules) | |
281 | # warning: -fPIC ignored for target (all code is position independent) | |
282 | appendMod -fPIC | |
283 | else | |
284 | # But cygwin does want most of znc in a shared lib | |
285 | LIBZNC="libznc.dll" | |
37b70a29 | 286 | LIBZNCDIR="$bindir" |
57cfa950 | 287 | fi |
2814df8f | 288 | |
57cfa950 | 289 | if test -z "$ISDARWIN"; then |
290 | MODLINK="-shared" | |
291 | else | |
292 | # Mac OS X differentiates between shared libs (-dynamiclib) | |
293 | # and loadable modules (-bundle). | |
294 | MODLINK="-bundle -flat_namespace -undefined suppress" | |
295 | # TODO test if -twolevel_namespace and/or | |
296 | # -undefined dynamic_lookup work | |
297 | # (dynamic_lookup might only work on 10.4 and later) | |
298 | fi | |
34337d7b | 299 | |
a564e25c | 300 | if test "x$PERL" != xno -o "x$PYTHON" != xno; then |
7d912d1d AS |
301 | old_USESWIG="$USESWIG" |
302 | if test "x$USESWIG" != "xno"; then | |
303 | AC_PROG_SWIG([1.3.40]) | |
304 | test -z "$SWIG" && USESWIG=no | |
a564e25c | 305 | fi |
7d912d1d AS |
306 | if test "x$USESWIG" = xno; then |
307 | SWIG="" | |
308 | AC_MSG_WARN([$SWIG_ERROR]) | |
309 | if test "x$old_USESWIG" = xno; then | |
310 | USESWIG="no, need manual download for perl/python bindings" | |
a564e25c | 311 | AC_MSG_WARN([swig was disabled, so you should put needed sources to modules/ |
312 | Please check http://en.znc.in/wiki/Modperl or http://en.znc.in/wiki/Modpython for details.]) | |
313 | else | |
314 | AC_MSG_ERROR([swig was not found. Try --disable-perl --disable-python, or download the necessary sources and use --disable-swig. | |
315 | Please check http://en.znc.in/wiki/Modperl or http://en.znc.in/wiki/Modpython for details.]) | |
316 | fi | |
317 | else | |
7d912d1d | 318 | USESWIG=yes |
a564e25c | 319 | fi |
320 | else | |
7d912d1d | 321 | if test "x$USESWIG" = "xyes"; then |
a564e25c | 322 | AC_MSG_WARN([swig is needed only for perl and python, but both are disabled. Disabling swig.]) |
323 | fi | |
7d912d1d | 324 | USESWIG=no |
a564e25c | 325 | fi |
326 | ||
57cfa950 | 327 | if test "x$PERL" != "xno"; then |
328 | old_PERL="$PERL" | |
329 | AC_PATH_PROG([PERL_BINARY], [perl], []) | |
0bc606a9 | 330 | if test -n "$PERL_BINARY" && eval "$PERL_BINARY -e'use 5.010'"; then |
57cfa950 | 331 | my_saved_LDFLAGS="$LDFLAGS" |
332 | appendLD `$PERL_BINARY -MExtUtils::Embed -e ccopts -e ldopts` | |
5f1a1d01 | 333 | AC_CHECK_LIB(perl, perl_alloc, |
334 | [: No, we do not want autoconf to do sth automatically], | |
335 | PERL="no") | |
57cfa950 | 336 | LDFLAGS="$my_saved_LDFLAGS" |
90cf81e6 | 337 | else |
57cfa950 | 338 | PERL="no" |
6d957ed9 | 339 | fi |
57cfa950 | 340 | if test "x$PERL" = "xno"; then |
341 | ZNC_AUTO_FAIL([PERL], | |
342 | [perl not found. Try --disable-perl.], | |
343 | [perl was not found and thus disabled]) | |
39a215f3 | 344 | PERL_BINARY="" |
57cfa950 | 345 | else |
a564e25c | 346 | PERL="yes" |
347 | fi | |
348 | fi | |
349 | ||
350 | if test "x$PYTHON" != "xno"; then | |
351 | # Default value for just --enable-python | |
352 | if test "x$PYTHON" = "xyes"; then | |
ba915eb9 | 353 | PYTHON="python3" |
a564e25c | 354 | fi |
355 | old_PYTHON="$PYTHON" | |
ba915eb9 AS |
356 | if test -z "$PKG_CONFIG"; then |
357 | AC_MSG_ERROR([pkg-config is required for modpython.]) | |
358 | fi | |
359 | PKG_CHECK_MODULES([python], [$PYTHON >= 3.0],, AC_MSG_ERROR([$PYTHON.pc not found or is wrong. Try --disable-python or install python3.])) | |
7d912d1d AS |
360 | if test "x$USESWIG" = xyes; then : |
361 | PKG_CHECK_MODULES([python32], [$PYTHON >= 3.2], [PYTHON_32=yes], [PYTHON_32=no]) | |
362 | if test "x$PYTHON_32" = xyes; then | |
363 | AC_MSG_NOTICE([python 3.2+ found, requiring newer swig.]) | |
364 | AC_PROG_SWIG([2.0.4]) | |
365 | if test -z "$SWIG"; then | |
366 | AC_MSG_ERROR([$SWIG_ERROR]) | |
367 | fi | |
368 | fi | |
369 | fi | |
ba915eb9 | 370 | my_saved_LIBS="$LIBS" |
63250c2b | 371 | my_saved_CXXFLAGS="$CXXFLAGS" |
ba915eb9 AS |
372 | appendLib $python_LIBS |
373 | appendCXX $python_CFLAGS | |
374 | AC_CHECK_FUNC([Py_Initialize], [], [PYTHON="no"]) | |
375 | if test "x$PYTHON" != "xno"; then | |
376 | # Yes, modpython depends on perl. | |
377 | AC_PATH_PROG([PERL_BINARY], [perl]) | |
378 | if test -z "$PERL_BINARY"; then | |
379 | AC_MSG_ERROR([To compile modpython you need to be able to execute perl scripts. Try --disable-python or install perl.]) | |
a44e6eaa | 380 | fi |
e17348ca | 381 | LIBS="$my_saved_LIBS" |
ba915eb9 | 382 | CXXFLAGS="$my_saved_CXXFLAGS" |
a564e25c | 383 | else |
384 | PYTHON="no" | |
385 | fi | |
386 | if test "x$PYTHON" = "xno"; then | |
387 | ZNC_AUTO_FAIL([PYTHON], | |
388 | [python not found. Try --disable-python.], | |
389 | [python was not found and thus disabled]) | |
390 | PYTHONCFG_BINARY="" | |
391 | else | |
392 | PYTHON="yes" | |
6d957ed9 | 393 | fi |
57cfa950 | 394 | fi |
b0f94ba4 | 395 | |
57cfa950 | 396 | if test -n "$SASL"; then |
397 | AC_CHECK_LIB( sasl2, sasl_server_init, | |
398 | [: Dont let autoconf add -lsasl2, Makefile handles that], | |
399 | AC_MSG_ERROR([could not find libsasl2. Try --disable-sasl.])) | |
400 | fi | |
61449c6f | 401 | |
57cfa950 | 402 | # Check if we want modtcl |
403 | AC_ARG_ENABLE( [tcl], | |
404 | AS_HELP_STRING([--enable-tcl], [enable modtcl]), | |
405 | [TCL="$enableval"], | |
406 | [TCL="no"]) | |
407 | ||
408 | AC_ARG_WITH( [tcl-flags], | |
409 | AS_HELP_STRING([--with-tcl-flags=FLAGS], | |
410 | [The flags needed for compiling and linking modtcl]), | |
411 | [TCL_FLAGS="$withval"],) | |
412 | ||
413 | if test x"$TCL" = "xyes" | |
414 | then | |
415 | AC_ARG_WITH( [tcl], | |
416 | AS_HELP_STRING([--with-tcl=DIR], | |
417 | [directory containing tclConfig.sh]), | |
418 | TCL_DIR="${withval}") | |
419 | ||
420 | # This will need to be extended in the future, but I don't think | |
421 | # it's a good idea to stuff a shitload of random stuff in here right now | |
422 | for path in $TCL_DIR /usr/lib /usr/lib/tcl8.4 /usr/lib/tcl8.5 | |
423 | do | |
424 | file="${path}/tclConfig.sh" | |
d9b4ba18 | 425 | AC_MSG_CHECKING([for ${file}]) |
426 | if test -r ${file} | |
427 | then | |
428 | TCL_CONF=${file} | |
429 | AC_MSG_RESULT([yes]) | |
430 | break | |
431 | fi | |
432 | AC_MSG_RESULT([no]) | |
57cfa950 | 433 | done |
434 | ||
435 | if test x"${TCL_CONF}" = x | |
61449c6f | 436 | then |
57cfa950 | 437 | # They --enable-tcl'd, so give them some sane default |
438 | TCL_FLAGS="-I/usr/include/tcl -ltcl" | |
439 | AC_MSG_WARN([Could not find tclConfig.sh, using some sane defaults.]) | |
440 | else | |
441 | AC_MSG_CHECKING([modtcl flags]) | |
442 | . ${TCL_CONF} | |
443 | # eval because those vars depend on other vars in there | |
444 | eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" | |
445 | eval "TCL_INCLUDE_SPEC=\"${TCL_INCLUDE_SPEC}\"" | |
446 | TCL_FLAGS="$TCL_INCLUDE_SPEC $TCL_LIB_SPEC" | |
447 | AC_MSG_RESULT([$TCL_FLAGS]) | |
61449c6f | 448 | fi |
e17348ca | 449 | my_saved_LIBS="$LIBS" |
450 | appendLib "$TCL_FLAGS" | |
89bd5275 | 451 | AC_CHECK_FUNC([Tcl_CreateInterp], [TCL_TEST=yes], [TCL_TEST=no]) |
452 | if test x"$TCL_TEST" = "xno"; then | |
7b9d7094 | 453 | AC_MSG_ERROR([tcl not found, try --disable-tcl, or install tcl properly. If tcl is installed to a non-standard path, use --enable-tcl --with-tcl=/path]) |
89bd5275 | 454 | fi |
e17348ca | 455 | LIBS="$my_saved_LIBS" |
d9591e95 | 456 | fi |
457 | ||
dee94a0b | 458 | if test x"$EXTRA" = "xyes" |
459 | then | |
460 | AC_CHECK_FUNC( iconv, CHARSET=1 ) | |
461 | AC_CHECK_LIB( iconv, iconv_open, LIBICONV=-liconv ; CHARSET=1 ) | |
462 | if test "x$CHARSET" = "x1" | |
463 | then | |
464 | AC_MSG_CHECKING([whether iconv expects a const second argument]) | |
465 | AC_COMPILE_IFELSE([ | |
466 | AC_LANG_PROGRAM([[ | |
467 | #include <iconv.h> | |
468 | ]], [[ | |
469 | const char input[] = "X"; const char *inptr = input; size_t inbytes = 1; | |
470 | char buf[1]; char *outptr = buf; size_t outbytes = 1; | |
471 | iconv_t ic = iconv_open("ISO8859-1", "UTF8"); | |
472 | iconv(ic, (char**)&inptr, &inbytes, &outptr, &outbytes); | |
473 | ]])], [ | |
474 | AC_MSG_RESULT([no]) | |
475 | appendMod -DICONV_CONST= | |
476 | ], [ | |
477 | AC_MSG_RESULT([yes]) | |
478 | appendMod -DICONV_CONST=const | |
479 | ]) | |
480 | else | |
481 | AC_MSG_WARN([libiconv was not found, disabling the charset module]) | |
482 | fi | |
483 | fi | |
484 | ||
797b0a7f AS |
485 | AC_CACHE_CHECK([for GNU make], [ac_cv_path_GNUMAKE], [ |
486 | AC_PATH_PROGS_FEATURE_CHECK([GNUMAKE], [make gmake], [[ | |
487 | if $ac_path_GNUMAKE --version | $GREP GNU > /dev/null; then | |
488 | ac_cv_path_GNUMAKE=$ac_path_GNUMAKE | |
489 | ac_path_GNUMAKE_found=: | |
490 | fi | |
491 | ]], [AC_MSG_ERROR([could not find GNU make])] | |
492 | ) | |
493 | ]) | |
494 | GNUMAKE_DIRNAME=`AS_DIRNAME(["$ac_cv_path_GNUMAKE"])` | |
495 | GNUMAKE=`echo $ac_cv_path_GNUMAKE | $SED "s%$GNUMAKE_DIRNAME/%%"` | |
496 | ||
d9591e95 | 497 | AC_SUBST([CXXFLAGS]) |
9c4a5a1d | 498 | AC_SUBST([CPPFLAGS]) |
49fb58f7 | 499 | AC_SUBST([MODFLAGS]) |
0a622749 | 500 | AC_SUBST([LDFLAGS]) |
d9591e95 | 501 | AC_SUBST([LIBS]) |
432a04e5 | 502 | AC_SUBST([LIBZNC]) |
503 | AC_SUBST([LIBZNCDIR]) | |
90cf81e6 | 504 | AC_SUBST([MODLINK]) |
3e868c5c | 505 | AC_SUBST([NOSSL]) |
0b7576a4 | 506 | AC_SUBST([EXTRA]) |
61449c6f | 507 | AC_SUBST([TCL_FLAGS]) |
3f27be8b | 508 | AC_SUBST([SASL]) |
dee94a0b | 509 | AC_SUBST([CHARSET]) |
510 | AC_SUBST([LIBICONV]) | |
44c5f493 | 511 | AC_SUBST([MODDIR]) |
608fbdbd | 512 | AC_SUBST([DATADIR]) |
c7c0d171 | 513 | AC_SUBST([PERL]) |
ba915eb9 | 514 | AC_SUBST([PYTHON]) |
7d912d1d | 515 | AC_SUBST([SWIG]) |
ba915eb9 AS |
516 | AC_SUBST([python_CFLAGS]) |
517 | AC_SUBST([python_LIBS]) | |
d9591e95 | 518 | AC_CONFIG_FILES([Makefile]) |
c207ea50 | 519 | AC_CONFIG_FILES([znc-config]) |
97a85e39 | 520 | AC_CONFIG_FILES([znc-buildmod]) |
f59b7122 | 521 | AC_CONFIG_FILES([man/Makefile]) |
bbb62bed | 522 | AC_CONFIG_FILES([znc.pc]) |
523 | AC_CONFIG_FILES([znc-uninstalled.pc]) | |
f72e2f8a | 524 | AC_CONFIG_FILES([modules/Makefile]) |
70c77458 | 525 | AC_CONFIG_FILES([test/Makefile]) |
d9591e95 | 526 | AC_OUTPUT |
c3872985 | 527 | |
528 | echo | |
9c4a5a1d | 529 | echo znc AC_PACKAGE_VERSION configured |
c3872985 | 530 | echo |
6d33c570 | 531 | echo "prefix: $prefix" |
d72fc441 | 532 | echo "debug: $DEBUG" |
533 | echo "ipv6: $IPV6" | |
534 | echo "openssl: $SSL" | |
535 | echo "c-ares: $ARES" | |
536 | echo "perl: $PERL" | |
a564e25c | 537 | echo "python: $PYTHON" |
7d912d1d | 538 | echo "swig: $USESWIG" |
3f27be8b | 539 | if test x"$SASL" = "x" ; then |
d72fc441 | 540 | echo "sasl: no" |
3f27be8b | 541 | else |
d72fc441 | 542 | echo "sasl: yes" |
3f27be8b | 543 | fi |
d72fc441 | 544 | echo "extra: $EXTRA" |
61449c6f | 545 | if test x"$TCL_FLAGS" = "x" ; then |
d72fc441 | 546 | echo "tcl: no" |
547 | else | |
548 | echo "tcl: yes" | |
549 | fi | |
550 | if test x"$CHARSET" = "x" ; then | |
551 | echo "charset: no" | |
61449c6f | 552 | else |
d72fc441 | 553 | echo "charset: yes" |
61449c6f | 554 | fi |
d72fc441 | 555 | echo "run from src: $RUNFROMSOURCE" |
797b0a7f AS |
556 | echo |
557 | echo "Now you can run \"$GNUMAKE\" to compile ZNC" | |
d72fc441 | 558 |