]> jfr.im git - irc/irssi/irssi.git/blob - configure.ac
.travis.yml: Coverity stuff.
[irc/irssi/irssi.git] / configure.ac
1 AC_INIT(irssi, 1.1-head)
2 AC_CONFIG_SRCDIR([src])
3 AC_CONFIG_AUX_DIR(build-aux)
4 AC_PREREQ(2.50)
5
6 AC_CONFIG_HEADERS([irssi-config.h])
7 AC_CONFIG_MACRO_DIR([m4])
8 AM_INIT_AUTOMAKE([1.9 no-define foreign])
9
10 AM_SILENT_RULES([yes])
11
12 AM_MAINTAINER_MODE
13
14 AC_PROG_CC
15 AC_PROG_CPP
16 AM_PROG_LIBTOOL
17
18 AC_PATH_PROG(sedpath, sed)
19 AC_PATH_PROG(perlpath, perl)
20
21 AC_CHECK_HEADERS(unistd.h dirent.h sys/ioctl.h sys/resource.h)
22
23 # check posix headers..
24 AC_CHECK_HEADERS(sys/socket.h sys/time.h sys/utsname.h)
25
26 AC_SYS_LARGEFILE
27
28 AC_ARG_WITH(socks,
29 [ --with-socks Build with socks support],
30 if test x$withval = xno; then
31 want_socks=no
32 else
33 want_socks=yes
34 fi,
35 want_socks=no)
36
37 AC_ARG_WITH(textui,
38 [ --without-textui Build without text frontend],
39 if test x$withval = xno; then
40 want_textui=no
41 else
42 want_textui=yes
43 fi,
44 want_textui=yes)
45
46 AC_ARG_WITH(bot,
47 [ --with-bot Build irssi-bot],
48 if test x$withval = xno; then
49 want_irssibot=no
50 else
51 want_irssibot=yes
52 fi,
53 want_irssibot=no)
54
55 AC_ARG_WITH(fuzzer,
56 [ --with-fuzzer Build irssi-fuzzer],
57 if test x$withval = xno; then
58 want_irssifuzzer=no
59 else
60 want_irssifuzzer=yes
61 fi,
62 want_irssifuzzer=no)
63
64 AC_ARG_WITH(fuzzer-lib,
65 [ --with-fuzzer-lib Specify path to fuzzer library],
66 fuzzerlibpath="$withval")
67
68 AC_ARG_WITH(proxy,
69 [ --with-proxy Build irssi-proxy],
70 if test x$withval = xno; then
71 want_irssiproxy=no
72 else
73 want_irssiproxy=yes
74 fi,
75 want_irssiproxy=no)
76
77 AC_ARG_WITH(modules,
78 [ --with-modules Specify what modules to build in binary],
79 if test x$withval != xyes -a x$withval != xno; then
80 build_modules="$withval"
81 fi)
82
83 if test "x$prefix" != "xNONE"; then
84 prefix=`eval echo $prefix`
85 PERL_MM_PARAMS="INSTALLDIRS=perl INSTALL_BASE=$prefix"
86 perl_set_use_lib=yes
87
88 perl_prefix_note=yes
89 fi
90
91 AC_ARG_WITH(perl-staticlib,
92 [ --with-perl-staticlib Specify that we want to link perl libraries
93 statically in irssi, default is no],
94 if test x$withval = xno; then
95 want_staticperllib=no
96 else
97 want_staticperllib=yes
98 fi,
99 want_staticperllib=no)
100
101
102 AC_ARG_WITH(perl-lib,
103 [ --with-perl-lib=[perl|site|vendor|DIR] Specify where to install the
104 Perl libraries for irssi, default is site],
105 if test "x$withval" = xyes; then
106 want_perl=yes
107 elif test "x$withval" = xno; then
108 want_perl=no
109 elif test "x$withval" = xperl; then
110 want_perl=yes
111 perl_prefix_note=no
112 PERL_MM_PARAMS="INSTALLDIRS=perl"
113 perl_set_use_lib=no
114 elif test "x$withval" = xsite; then
115 want_perl=yes
116 perl_prefix_note=no
117 PERL_MM_PARAMS=""
118 perl_set_use_lib=no
119 elif test "x$withval" = xvendor; then
120 want_perl=yes
121 perl_prefix_note=no
122 if test -z "`$perlpath -v|grep '5\.0'`"; then
123 PERL_MM_PARAMS="INSTALLDIRS=vendor"
124 else
125 PERL_MM_PARAMS="INSTALLDIRS=perl PREFIX=`$perlpath -e 'use Config; print $Config{prefix}'`"
126 fi
127 perl_set_use_lib=no
128 else
129 want_perl=yes
130 perl_prefix_note=no
131 PERL_MM_PARAMS="INSTALLDIRS=perl LIB=$withval"
132 perl_set_use_lib=yes
133 fi,
134 want_perl=yes)
135
136 AC_ARG_WITH(perl,
137 [ --with-perl[=yes|no|module] Build with Perl support - also specifies
138 if it should be built into main irssi binary
139 (static, default) or as module],
140 if test x$withval = xyes; then
141 want_perl=static
142 elif test x$withval = xstatic; then
143 want_perl=static
144 elif test x$withval = xmodule; then
145 want_perl=module
146 else
147 want_perl=no
148 fi,
149 want_perl=static)
150
151 AC_ARG_ENABLE(true-color,
152 [ --enable-true-color Build with true color support in terminal],
153 if test x$enableval = xno ; then
154 want_truecolor=no
155 else
156 want_truecolor=yes
157 fi,
158 want_truecolor=no)
159
160 AC_ARG_ENABLE(gregex,
161 [ --disable-gregex Build without GRegex (fall back to regex.h)],
162 if test x$enableval = xno ; then
163 want_gregex=no
164 else
165 want_gregex=yes
166 fi,
167 want_gregex=yes)
168
169 dnl **
170 dnl ** just some generic stuff...
171 dnl **
172
173 dnl * OS specific options
174 case "$host_os" in
175 hpux*)
176 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
177 ;;
178 *)
179 ;;
180 esac
181
182
183 AC_SEARCH_LIBS([socket], [network socket])
184
185 AC_SEARCH_LIBS([inet_addr], [nsl])
186
187 dnl * gcc specific options
188 if test "x$ac_cv_prog_gcc" = "xyes"; then
189 CFLAGS="$CFLAGS -Wall"
190 fi
191
192 AC_CHECK_TYPE(socklen_t, ,
193 [AC_DEFINE([socklen_t], [int], [Define to 'int' if <sys/socket.h> doesn't define.])], [
194 AC_INCLUDES_DEFAULT
195 #ifdef HAVE_SYS_SOCKET_H
196 # include <sys/socket.h>
197 #endif
198 ])
199
200 AC_CHECK_SIZEOF(int)
201 AC_CHECK_SIZEOF(long)
202 AC_CHECK_SIZEOF(long long)
203 AC_CHECK_SIZEOF(off_t)
204
205 if test $ac_cv_sizeof_off_t = 8; then
206 offt_64bit=yes
207 else
208 offt_64bit=no
209 fi
210
211 if test x$ac_cv_sizeof_off_t = x$ac_cv_sizeof_long; then
212 # try to use unsigned long always first
213 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "lu")
214 AC_DEFINE(UOFF_T_LONG)
215 elif test x$ac_cv_sizeof_off_t = x$ac_cv_sizeof_int; then
216 # next try int
217 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "u")
218 AC_DEFINE(UOFF_T_INT)
219 elif test x$ac_cv_sizeof_off_t = x$ac_cv_sizeof_long_long; then
220 # and finally long long
221 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "llu")
222 AC_DEFINE(UOFF_T_LONG_LONG)
223 else
224 AC_ERROR([Couldn't find integer type for off_t])
225 fi
226
227 dnl **
228 dnl ** check for socks
229 dnl **
230
231 if test "x$want_socks" = "xyes"; then
232 AC_CHECK_LIB(socks, connect, [
233 AC_DEFINE(HAVE_SOCKS,, Build with socks support)
234 LIBS="$LIBS -lsocks"
235 AC_CHECK_HEADER(socks.h, [
236 AC_DEFINE(HAVE_SOCKS_H)
237 CFLAGS="$CFLAGS -DSOCKS"
238 AC_MSG_RESULT(["socks5 library found, building with it"])
239 ], [
240 AC_MSG_RESULT(["socks4 library found, building with it"])
241 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dgetpeername=Rgetpeername -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
242 ])
243 ])
244 fi
245
246 dnl **
247 dnl ** fe-text checks
248 dnl **
249
250 for try in 1 2; do
251 if test $try = 1; then
252 glib_modules=gmodule
253 else
254 echo "*** trying without -lgmodule"
255 glib_modules=
256 fi
257 AM_PATH_GLIB_2_0(2.28.0,,, $glib_modules)
258 if test "$GLIB_LIBS"; then
259 if test $glib_modules = gmodule; then
260 AC_DEFINE(HAVE_GMODULE)
261 have_gmodule=yes
262 fi
263 break
264 fi
265 done
266
267 if test -z "$GLIB_LIBS"; then
268 echo
269 echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org/pub/glib/"
270 echo "*** We recommend you get the latest stable GLIB 2 version."
271 echo "*** Compile and install it, and make sure pkg-config finds it,"
272 echo "*** by adding the path where the .pc file is located to PKG_CONFIG_PATH"
273 echo -n "*** Or alternatively install your distribution's package"
274 if test -f /etc/debian_version; then
275 echo :
276 echo "*** sudo apt-get install libglib2.0-dev"
277 elif test -f /etc/redhat-release; then
278 echo " (glib2-devel)"
279 else
280 echo .
281 fi
282 echo
283
284 AC_ERROR([GLIB is required to build irssi.])
285 fi
286
287 LIBS="$LIBS $GLIB_LIBS"
288
289 dnl **
290 dnl ** OpenSSL checks
291 dnl **
292 PKG_CHECK_MODULES([OPENSSL], [openssl], [
293 CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
294 LIBS="$LIBS $OPENSSL_LIBS"
295 ], [
296 AC_CHECK_LIB([ssl], [SSL_library_init], [
297 LIBS="$LIBS -lssl -lcrypto"
298 ], [
299 AC_MSG_ERROR([The OpenSSL library was not found])
300 ])
301 ])
302
303 dnl **
304 dnl ** curses checks
305 dnl **
306
307 if test "x$want_textui" != "xno"; then
308
309 TEXTUI_NO_LIBS="$LIBS"
310 LIBS=
311 AC_SEARCH_LIBS([setupterm], [tinfo ncursesw ncurses terminfo], [want_textui=yes], [
312 AC_ERROR(Terminfo not found - install libncurses-dev or ncurses-devel package)
313 want_textui="no, Terminfo not found"
314 ])
315
316 TEXTUI_LIBS="$LIBS"
317 AC_SUBST(TEXTUI_LIBS)
318 LIBS="$TEXTUI_NO_LIBS"
319
320 fi
321
322 dnl **
323 dnl ** irssifuzzer checks
324 dnl **
325
326 if test "$want_irssifuzzer" != "no"; then
327 dnl * we need to build with -fsanitize-coverage=trace-pc-guard
328 dnl * otherwise fuzzer won't be very successful at finding bugs :)
329 if test -z "$SANFLAGS"; then
330 SANFLAGS="-g -fsanitize=address -fsanitize-coverage=trace-pc-guard"
331 fi
332 CFLAGS="$CFLAGS $SANFLAGS"
333 CXXFLAGS="$CXXFLAGS $SANFLAGS"
334
335 AC_MSG_CHECKING(for fuzzer library)
336
337 if test -z "$fuzzerlibpath"; then
338 AC_MSG_RESULT([not found, building without fuzzer front end])
339 want_irssifuzzer=no
340 else
341 FUZZER_LIBS="$fuzzerlibpath"
342 AC_SUBST(FUZZER_LIBS)
343 fi
344 fi
345
346 dnl **
347 dnl ** perl checks
348 dnl **
349
350 if test "$want_perl" != "no"; then
351 AC_MSG_CHECKING(for working Perl support)
352
353 if test -z "$perlpath"; then
354 perl_check_error="perl binary not found"
355 else
356 PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
357 fi
358
359 if test "x$ac_cv_prog_gcc" = "xyes" -a -z "`echo $host_os|grep 'bsd\|linux'`"; then
360 dnl * several systems have Perl compiled with native compiler
361 dnl * but irssi is being compiled with GCC. Here we try to
362 dnl * fix those command line options a bit so GCC won't
363 dnl * complain about them. Normally there's only few options
364 dnl * that we want to keep:
365 dnl * -Ddefine -Uundef -I/path -fopt -mopt
366 PERL_CFLAGS=`echo $PERL_CFLAGS | $perlpath -pe 's/^(.* )?-@<:@^DUIfm@:>@@<:@^ @:>@+/\1/g; s/^(.* )?\+@<:@^ @:>@+/\1/g'`
367
368 PERL_EXTRA_OPTS="CCCDLFLAGS=\"-fPIC\""
369 AC_SUBST(PERL_EXTRA_OPTS)
370 fi
371
372 if test -z "$PERL_CFLAGS"; then
373 if test -n "$perl_check_error"; then
374 perl_check_error="Error getting perl CFLAGS"
375 fi
376 AC_MSG_RESULT([not found, building without Perl])
377 want_perl=no
378 else
379 PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null`
380
381 dnl * remove all database stuffs
382 dnl * nsl is already in ldflags
383 dnl * libc is of course linked without needing -lc
384 dnl * -rdynamic must not be in LIBADD line
385 for word in -ldb -ldbm -lndbm -lgdbm -lc -rdynamic; do
386 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e "s/$word //" -e "s/$word$//"`
387 done
388
389 case "$host_os" in
390 linux*)
391 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lposix //' -e 's/-lposix$//'`
392 ;;
393 hpux*)
394 if test "x$ac_cv_prog_gcc" = "xyes"; then
395 PERL_CFLAGS=`echo $PERL_CFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
396 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
397 fi
398 ;;
399 *)
400 ;;
401 esac
402
403 dnl * check that perl's ldflags actually work
404 echo "#include <EXTERN.h>" > conftest.c
405 echo "#include <perl.h>" >> conftest.c
406 echo "int main(){perl_alloc(); return 0;}" >> conftest.c
407 $CC $CFLAGS $PERL_CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> perl.error.tmp > /dev/null
408 if test ! -s conftest -a "x$ignore_perl_errors" = "x"; then
409 perl_check_error="Error linking with perl libraries: $PERL_LDFLAGS: `cat perl.error.tmp`"
410 AC_MSG_RESULT([error linking with perl libraries, building without Perl])
411 want_perl=no
412 fi
413
414 rm -f perl.error.tmp
415 fi
416
417 if test "x$want_perl" != "xno"; then
418 AC_MSG_RESULT(ok)
419
420 if test "x$want_perl" = "xstatic"; then
421 dnl * building with static perl support
422 dnl * all PERL_LDFLAGS linking is done in fe-text
423 PERL_LINK_FLAGS="$PERL_LDFLAGS"
424 PERL_LINK_LIBS="../perl/libperl_core_static.la"
425 PERL_FE_LINK_LIBS="../perl/libfe_perl_static.la"
426 PERL_LDFLAGS=
427 AC_DEFINE(HAVE_STATIC_PERL)
428
429 dnl * build only static library of perl module
430 perl_module_lib=
431 perl_module_fe_lib=
432 perl_static_lib=libperl_core_static.la
433 perl_static_fe_lib=libfe_perl_static.la
434 else
435 dnl * build dynamic library of perl module
436 perl_module_lib=libperl_core.la
437 perl_module_fe_lib=libfe_perl.la
438 perl_static_lib=
439 perl_static_fe_lib=
440 fi
441
442 if test "x$want_staticperllib" = "xyes"; then
443 PERL_MM_PARAMS="$PERL_MM_PARAMS LINKTYPE=static"
444 PERL_LINK_LIBS="$PERL_LINK_LIBS ../perl/common/blib/arch/auto/Irssi/Irssi.a ../perl/irc/blib/arch/auto/Irssi/Irc/Irc.a ../perl/ui/blib/arch/auto/Irssi/UI/UI.a ../perl/textui/blib/arch/auto/Irssi/TextUI/TextUI.a"
445 PERL_STATIC_LIBS=1
446 else
447 PERL_STATIC_LIBS=0
448 fi
449
450 # remove any prefix from PERL_MM_OPT
451 PERL_MM_OPT=`perl -MText::ParseWords -e 'sub qu{$_=shift;s{^(.*?)=(.*)$}{($a,$b)=($1,$2);$b=~s/"/\\\\"/g;qq{$a="$b"}}ge if /@<:@\s"@:>@/;$_} local $,=" "; print map qu($_), grep !/^(INSTALL_BASE|PREFIX)=/, shellwords(@ARGV)' "$PERL_MM_OPT"`
452 # figure out the correct @INC path - we'll need to do this
453 # through MakeMaker since it's difficult to get it right
454 # otherwise.
455 $perlpath -MExtUtils::MakeMaker -e 'WriteMakefile(NAME => "test", MAKEFILE => "Makefile.test", FIRST_MAKEFILE => "/dev/null", NO_META => 1, NO_MYMETA => 1);' $PERL_MM_PARAMS >/dev/null
456 echo 'show-INSTALLDIRS:' >> Makefile.test
457 echo ' @echo $(INSTALLDIRS)' >> Makefile.test
458 perl_INSTALLDIRS=`$am_make -s -f Makefile.test show-INSTALLDIRS`
459 if test "x$perl_INSTALLDIRS" = "xsite"; then
460 perl_library_dir="site default"
461 perl_INSTALL_VAR=INSTALLSITEARCH
462 elif test "x$perl_INSTALLDIRS" = "xvendor"; then
463 perl_library_dir="vendor default"
464 perl_INSTALL_VAR=INSTALLVENDORARCH
465 else
466 perl_library_dir="module default"
467 perl_INSTALL_VAR=INSTALLARCHLIB
468 fi
469 echo 'show-ARCHLIB:' >> Makefile.test
470 echo ' @echo $('"$perl_INSTALL_VAR"')' >> Makefile.test
471 perl_use_lib=`$am_make -s -f Makefile.test show-ARCHLIB`
472 rm -f Makefile.test
473 if test "x$perl_set_use_lib" = "xyes"; then
474 if $perlpath -e 'exit ! grep $_ eq $ARGV@<:@0@:>@, grep /^\//, @INC' "$perl_use_lib"; then
475 perl_library_dir="other path in @INC"
476 perl_set_use_lib=no
477 else
478 perl_library_dir="prepends to @INC with /set perl_use_lib"
479 PERL_USE_LIB="$perl_use_lib"
480 fi
481 fi
482
483 AC_SUBST(perl_module_lib)
484 AC_SUBST(perl_static_lib)
485 AC_SUBST(perl_module_fe_lib)
486 AC_SUBST(perl_static_fe_lib)
487
488 AC_SUBST(PERL_LINK_FLAGS)
489 AC_SUBST(PERL_LINK_LIBS)
490 AC_SUBST(PERL_FE_LINK_LIBS)
491
492 AC_SUBST(PERL_LDFLAGS)
493 AC_SUBST(PERL_CFLAGS)
494
495 AC_SUBST(PERL_USE_LIB)
496 AC_SUBST(PERL_MM_OPT)
497 AC_SUBST(PERL_MM_PARAMS)
498 AC_SUBST(PERL_STATIC_LIBS)
499 fi
500 fi
501
502 dnl ** check what we want to build
503 AM_CONDITIONAL(BUILD_TEXTUI, test "$want_textui" = "yes")
504 AM_CONDITIONAL(BUILD_IRSSIBOT, test "$want_irssibot" = "yes")
505 AM_CONDITIONAL(BUILD_IRSSIFUZZER, test "$want_irssifuzzer" = "yes")
506 AM_CONDITIONAL(BUILD_IRSSIPROXY, test "$want_irssiproxy" = "yes")
507 AM_CONDITIONAL(HAVE_PERL, test "$want_perl" != "no")
508
509 # move LIBS to PROG_LIBS so they're not tried to be used when linking eg. perl libraries
510 PROG_LIBS=$LIBS
511 LIBS=
512 AC_SUBST(PROG_LIBS)
513
514 dnl **
515 dnl ** Keep all the libraries here so each frontend doesn't need to
516 dnl ** keep track of them all
517 dnl **
518 dnl ** (these could be made configurable)
519
520 CHAT_MODULES="irc"
521 irc_MODULES="dcc flood notifylist"
522 if test -n "$build_modules"; then
523 irc_MODULES="$irc_MODULES $build_modules"
524 fi
525
526 dnl ****************************************
527
528 AC_SUBST(CHAT_MODULES)
529 AC_SUBST(irc_MODULES)
530
531 CORE_LIBS="../core/libcore.a ../lib-config/libirssi_config.a"
532 FE_COMMON_LIBS=""
533
534 CHAT_LIBS=""
535 for c in $CHAT_MODULES; do
536 module_inits=""
537 module_deinits=""
538 fe_module_inits=""
539 fe_module_deinits=""
540 CHAT_LIBS="$CHAT_LIBS ../$c/lib$c.a ../$c/core/lib${c}_core.a"
541 if test -f $srcdir/src/fe-common/$c/module.h; then
542 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/libfe_common_$c.a "
543 fi
544 for s in `eval echo \\$${c}_MODULES`; do
545 CHAT_LIBS="$CHAT_LIBS ../$c/$s/lib${c}_$s.a"
546 module_inits="$module_inits ${c}_${s}_init();"
547 module_deinits="${c}_${s}_deinit(); $module_deinits"
548 if test -f $srcdir/src/fe-common/$c/$s/module.h; then
549 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/$s/libfe_${c}_$s.a "
550 fe_module_inits="$fe_module_inits fe_${c}_${s}_init();"
551 fe_module_deinits="fe_${c}_${s}_deinit(); $fe_module_deinits"
552 fi
553 done
554
555 mkdir -p src/$c
556 file="src/$c/$c.c"
557 echo "/* this file is automatically generated by configure - don't change */" > $file
558 echo "void ${c}_core_init(void); void ${c}_core_deinit(void);" >> $file
559 if test -n "$module_inits"; then
560 echo "$module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
561 echo "$module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
562 fi
563 echo "void ${c}_init(void) { ${c}_core_init(); $module_inits }" >> $file
564 echo "void ${c}_deinit(void) { $module_deinits ${c}_core_deinit(); }" >> $file
565
566 if test -f $srcdir/src/fe-common/$c/module.h; then
567 mkdir -p src/fe-common/$c
568 file="src/fe-common/$c/${c}-modules.c"
569 echo "/* this file is automatically generated by configure - don't change */" > $file
570 if test -n "$fe_module_inits"; then
571 echo "$fe_module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
572 echo "$fe_module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
573 fi
574 echo "void fe_${c}_modules_init(void) { $fe_module_inits }" >> $file
575 echo "void fe_${c}_modules_deinit(void) { $fe_module_deinits }" >> $file
576 fi
577 done
578
579 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/core/libfe_common_core.a"
580
581 dnl ** common libraries needed by frontends
582 COMMON_NOUI_LIBS="$CHAT_LIBS $CORE_LIBS"
583 COMMON_LIBS="$FE_COMMON_LIBS $COMMON_NOUI_LIBS"
584 AC_SUBST(COMMON_NOUI_LIBS)
585 AC_SUBST(COMMON_LIBS)
586
587 if test "x$want_truecolor" = "xyes"; then
588 AC_DEFINE([TERM_TRUECOLOR], [], [true color support in terminal])
589 else
590 want_truecolor=no
591 fi
592
593 if test "x$want_gregex" = "xyes"; then
594 AC_DEFINE([USE_GREGEX], [], [use GRegex for regular expressions])
595 else
596 want_gregex=no
597 fi
598
599 AH_TEMPLATE(HAVE_GMODULE)
600 AH_TEMPLATE(HAVE_SOCKS_H, [misc..])
601 AH_TEMPLATE(HAVE_STATIC_PERL)
602 AH_TEMPLATE(PRIuUOFF_T, [printf()-format for uoff_t, eg. "u" or "lu" or "llu"])
603 AH_TEMPLATE(UOFF_T_INT, [What type should be used for uoff_t])
604 AH_TEMPLATE(UOFF_T_LONG)
605 AH_TEMPLATE(UOFF_T_LONG_LONG)
606
607 AC_CONFIG_FILES([
608 Makefile
609 src/Makefile
610 src/core/Makefile
611 src/irc/Makefile
612 src/irc/core/Makefile
613 src/irc/dcc/Makefile
614 src/irc/notifylist/Makefile
615 src/irc/proxy/Makefile
616 src/irc/flood/Makefile
617 src/fe-common/Makefile
618 src/fe-common/core/Makefile
619 src/fe-common/irc/Makefile
620 src/fe-common/irc/dcc/Makefile
621 src/fe-common/irc/notifylist/Makefile
622 src/fe-fuzz/Makefile
623 src/fe-none/Makefile
624 src/fe-text/Makefile
625 src/lib-config/Makefile
626 src/perl/Makefile
627 src/perl/common/Makefile.PL
628 src/perl/irc/Makefile.PL
629 src/perl/ui/Makefile.PL
630 src/perl/textui/Makefile.PL
631 scripts/Makefile
632 scripts/examples/Makefile
633 docs/Makefile
634 docs/help/Makefile
635 docs/help/in/Makefile
636 irssi-config
637 ])
638
639 AC_OUTPUT
640
641 dnl ** for building from objdir
642 old_dir=`pwd` && cd $srcdir && whole_dir=`pwd` && cd $old_dir
643 if test "x$old_dir" != "x$whole_dir"; then
644 $LN_S $srcdir/irssi-version.h irssi-version.h
645 if test "x$want_perl" != "xno"; then
646 subdirfiles=""
647 for i in $whole_dir/src/perl/common $whole_dir/src/perl/irc $whole_dir/src/perl/ui $whole_dir/src/perl/textui; do
648 subdirfiles=`echo $subdirfiles $i/typemap $i/module.h $i/*.pm $i/*.xs`
649 done
650 for file in $whole_dir/src/perl/module.h $subdirfiles; do
651 link=`echo $file|$sedpath "s?$whole_dir/??"`
652 rm -f $link
653 $LN_S $file $link
654 done
655 fi
656 fi
657
658 echo
659
660 echo "Building text frontend ........... : $want_textui"
661 echo "Building irssi bot ............... : $want_irssibot"
662 echo "Building irssi proxy ............. : $want_irssiproxy"
663 if test "x$have_gmodule" = "xyes"; then
664 echo "Building with module support ..... : yes"
665 else
666 echo "Building with module support : NO!! /LOAD will not work!"
667 echo " - You're missing gmodule (comes with glib) for some reason,"
668 echo " or it doesn't work in your system."
669 fi
670
671 if test "x$want_perl" = "xstatic"; then
672 echo "Building with Perl support ....... : static (in irssi binary)"
673 elif test "x$want_perl" = "xmodule"; then
674 echo "Building with Perl support ....... : module"
675 else
676 if test -z "$perl_check_error"; then
677 echo "Building with Perl support ....... : no"
678 else
679 echo "Building with Perl support ....... : NO!"
680 echo " - $perl_check_error"
681 if test -f /etc/debian_version; then
682 echo " - Try: sudo apt-get install libperl-dev"
683 elif test -f /etc/redhat-release; then
684 echo " - Try installing perl-devel"
685 fi
686 fi
687 fi
688
689 if test "x$want_perl" != "xno" -a "x$perl_mod_error" != "x"; then
690 echo " - NOTE: Perl support will be compiled statically to irssi, not as"
691 echo " a module as requested. Reason:"
692 echo " $perl_mod_error"
693
694 if test -f /etc/debian_version; then
695 echo " - Try: sudo apt-get install libperl-dev"
696 fi
697 fi
698
699 if test "x$want_perl" != "xno"; then
700 echo "Perl library directory ........... : ($perl_library_dir - $perl_use_lib)"
701 if test "x$perl_prefix_note" = "xyes"; then
702 echo " - NOTE: This was automatically set to the same directory you gave with"
703 echo " --prefix. If you want the perl libraries to install to their 'correct'"
704 echo " path, you'll need to give --with-perl-lib=site option to configure."
705 echo " Anyway, installing perl to this directory should work just as well."
706 fi
707 fi
708 echo "Install prefix ................... : $prefix"
709
710 echo
711
712 echo "Building with 64bit DCC support .. : $offt_64bit"
713 echo "Building with true color support.. : $want_truecolor"
714 echo "Building with GRegex ............. : $want_gregex"
715
716 echo
717 echo "If there are any problems, read the INSTALL file."