3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(Irssi-SILC, 0.7.98.3)
15 dnl * ahem.. :) we don't want static libraries for modules
16 if test "x$lt_target" = "x"; then
17 if test "$target" = "NONE"; then
23 dnl * --disable-static isn't a good idea, complain if it's used
24 if test "x$enable_static" = "xno"; then
25 AC_ERROR([Don't give --disable-static option to configure])
30 AC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h sys/ioctl.h libintl.h)
32 # check posix headers..
33 AC_CHECK_HEADERS(sys/time.h sys/utsname.h regex.h)
36 [ --with-big5 Build with tr-Chinese Big5 support],
37 if test x$withval = xyes; then
40 if test "x$withval" = xno; then
49 [ --with-socks Build with socks support],
50 if test x$withval = xyes; then
53 if test "x$withval" = xno; then
62 [ --with-textui Build text frontend],
63 if test x$withval = xyes; then
66 if test "x$withval" = xno; then
75 [ --with-bot Build irssi-bot],
76 if test x$withval = xyes; then
79 if test "x$withval" = xno; then
88 [ --with-proxy Build irssi-proxy],
89 if test x$withval = xyes; then
92 if test "x$withval" = xno; then
102 [ --with-modules Specify what modules to build in binary],
103 if test x$withval != xyes -a x$withval != xno; then
104 build_modules="$withval"
107 if test "x$prefix" = "xNONE"; then
110 PERL_LIB_DIR="$prefix"
113 AC_ARG_ENABLE(perl-path,
114 [ --enable-perl-path=dir Specify where to install the Perl libraries for irssi],
115 if test x$enableval = xyes; then
118 if test "x$enableval" = xno; then
122 PERL_LIB_DIR="$enableval"
123 perl_lib_dir_given=yes
129 [ --enable-perl[=yes|no|static] Build with Perl support - also specifies
130 if it should be built into main irssi binary
131 (static) or as module (default)],
132 if test x$enableval = xyes; then
134 elif test x$enableval = xstatic; then
142 [ --with-tests Run all the tests],
143 if test x$withval != xno; then
149 AC_ARG_ENABLE(curses-windows,
150 [ --enable-curses-windows Use curses windows],
151 if test x$enableval != xno; then
152 AC_DEFINE(USE_CURSES_WINDOWS)
154 AC_DEFINE(USE_CURSES_WINDOWS))
156 AC_ARG_ENABLE(memdebug,
157 [ --enable-memdebug Enable memory debugging],
158 if test x$enableval = xyes; then
161 if test "x$enableval" = xno; then
170 [ --enable-ipv6 Enable IPv6 support],
171 if test x$enableval = xyes; then
174 if test "x$enableval" = xno; then
183 dnl ** just some generic stuff...
186 AC_CHECK_FUNCS(mkfifo fcntl)
188 AC_CHECK_LIB(socket, socket, [
189 PROG_LIBS="$PROG_LIBS -lsocket"
192 AC_CHECK_LIB(nsl, inet_addr, [
193 PROG_LIBS="$PROG_LIBS -lnsl"
196 dnl * gcc specific options
197 if test "x$ac_cv_prog_gcc" = "xyes"; then
198 CFLAGS="$CFLAGS -Wall"
201 dnl * OS specific options
204 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
210 dnl * socklen_t - AC_CHECK_TYPE() would be _really_ useful if it only would
211 dnl * accept header files where to find the typedef..
212 AC_MSG_CHECKING([for socklen_t])
213 AC_CACHE_VAL(irssi_cv_type_socklen_t,
215 #include <sys/types.h>
216 #include <sys/socket.h>],
218 irssi_cv_type_socklen_t=yes,
219 irssi_cv_type_socklen_t=no,
221 if test $irssi_cv_type_socklen_t = no; then
222 AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
224 AC_MSG_RESULT($irssi_cv_type_socklen_t)
227 dnl ** check for socks
230 if test "x$want_socks" = "xyes"; then
231 AC_CHECK_LIB(socks, connect, [
232 PROG_LIBS="$PROG_LIBS -lsocks"
233 AC_CHECK_HEADER(socks.h, [
234 AC_DEFINE(HAVE_SOCKS_H)
235 CFLAGS="$CFLAGS -DSOCKS"
236 AC_MSG_RESULT(["socks5 library found, building with it"])
238 AC_MSG_RESULT(["socks4 library found, building with it"])
239 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dgetpeername=Rgetpeername -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
245 dnl ** fe-text checks
248 AC_PATH_PROG(sedpath, sed)
250 AC_DEFUN(AC_CHECK_GLIBDIR,[
251 AC_MSG_CHECKING([whether GLib is unpacked to irssi dir])
253 GLIB_DIR=`for d in *; do test -f $d/glib.h && echo $d; done`
254 if test "x$GLIB_DIR" != "x"; then
255 dnl * glib in irssi directory, use it
256 AC_MSG_RESULT([yes, using it])
258 dnl * we have to do this at this point so we know what libs gmodule needs
259 if test ! -f $GLIB_DIR/.libs/libglib.a; then
261 echo "configuring GLib ..."
264 if test ! -f glib-config; then
272 GLIB_LDEXTRA=`$GLIB_DIR/glib-config --libs gmodule|$sedpath -e 's/-lglib//' -e 's/-lgmodule//' -e 's,-L/usr/local/lib ,,'|$sedpath 's/ \+/ /g'`
273 full_glib_dir="`pwd`/$GLIB_DIR"
274 GLIB_CFLAGS="-I$full_glib_dir -I$full_glib_dir/gmodule"
275 if test -f $full_glib_dir/.libs/libglib.a; then
276 GLIB_LIBS="$full_glib_dir/.libs/libglib.a $GLIB_LDEXTRA"
277 if test -f $full_glib_dir/gmodule/.libs/libgmodule.a; then
278 GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/.libs/libgmodule.a"
279 AC_DEFINE(HAVE_GMODULE)
282 GLIB_LIBS="$full_glib_dir/libglib.a $GLIB_LDEXTRA"
283 if test -f $full_glib_dir/gmodule/libgmodule.a; then
284 GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/libgmodule.a"
285 AC_DEFINE(HAVE_GMODULE)
288 AC_SUBST(GLIB_CFLAGS)
297 if test "x$GLIB_DIR" = "x"; then
298 AM_PATH_GLIB(1.2.0,,, gmodule)
299 if test "x$GLIB_LIBS" = "x"; then
300 echo "*** trying without -lgmodule"
304 AC_DEFINE(HAVE_GMODULE)
307 if test "x$GLIB_LIBS" = "x"; then
309 echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org"
310 echo "*** If you can't install GLIB anywhere or if you don't want to,"
311 echo "*** you can just unpack it to Irssi's source directory and"
312 echo "*** Irssi will automatically compile and use it."
315 dnl * I think it's pretty safe to assume GLib 1.2.9 since the next
316 dnl * will be 2.0 (or 1.4?) and it's not sure if irssi compiles
317 dnl * with it (yea, just a few weeks after I put this text for 1.2.8
318 dnl * the 1.2.9 came :) .. and then .10
319 glib_file=glib-1.2.10.tar.gz
322 if test "x`ncftpget 2>/dev/null|grep -i ncftp`" != "x"; then
323 dlcmd="ncftpget ftp://ftp.gtk.org/pub/gtk/v1.2/$glib_file"
325 if test "x`wget 2>/dev/null|grep -i wget`" != "x"; then
326 dlcmd="wget http://irssi.org/files/$glib_file"
328 if test "x$dlcmd" != "x"; then
329 echo "*** I can download GLib for you now. If you don't want to, press CTRL-C now."
332 if `gunzip $glib_file`; then
333 glib_file=`echo $glib_file|$sedpath s/\.gz$//`
334 if `tar xf $glib_file`; then
341 if test "x$GLIB_LIBS" = "x"; then
342 AC_ERROR([GLIB is required to build irssi.])
347 PROG_LIBS="$PROG_LIBS $GLIB_LIBS"
353 dnl Curses detection: Munged from Midnight Commander's configure.in
358 dnl - Determine which version of curses is installed on your system
359 dnl and set the -I/-L/-l compiler entries and add a few preprocessor
361 dnl - Do an AC_SUBST on the CURSES_INCLUDEDIR and CURSES_LIBS so that
362 dnl @CURSES_INCLUDEDIR@ and @CURSES_LIBS@ will be available in
364 dnl - Modify the following configure variables (these are the only
365 dnl curses.m4 variables you can access from within configure.in)
366 dnl CURSES_INCLUDEDIR - contains -I's and possibly -DRENAMED_CURSES if
367 dnl an ncurses.h that's been renamed to curses.h
369 dnl CURSES_LIBS - sets -L and -l's appropriately
370 dnl CFLAGS - if --with-sco, add -D_SVID3
371 dnl has_curses - exports result of tests to rest of configure
375 dnl 1) Add lines indicated below to acconfig.h
376 dnl 2) call AC_CHECK_CURSES after AC_PROG_CC in your configure.in
377 dnl 3) Instead of #include <curses.h> you should use the following to
378 dnl properly locate ncurses or curses header file
380 dnl #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
381 dnl #include <ncurses.h>
383 dnl #include <curses.h>
386 dnl 4) Make sure to add @CURSES_INCLUDEDIR@ to your preprocessor flags
387 dnl 5) Make sure to add @CURSES_LIBS@ to your linker flags or LIBS
389 dnl Notes with automake:
390 dnl - call AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true) from
392 dnl - your Makefile.am can look something like this
393 dnl -----------------------------------------------
394 dnl INCLUDES= blah blah blah $(CURSES_INCLUDEDIR)
396 dnl CURSES_TARGETS=name_of_curses_prog
398 dnl bin_PROGRAMS = other_programs $(CURSES_TARGETS)
399 dnl other_programs_SOURCES = blah blah blah
400 dnl name_of_curses_prog_SOURCES = blah blah blah
401 dnl other_programs_LDADD = blah
402 dnl name_of_curses_prog_LDADD = blah $(CURSES_LIBS)
403 dnl -----------------------------------------------
406 dnl The following lines should be added to acconfig.h:
407 dnl ==================================================
409 dnl /*=== Curses version detection defines ===*/
410 dnl /* Found some version of curses that we're going to use */
411 dnl #undef HAS_CURSES
413 dnl /* Use SunOS SysV curses? */
414 dnl #undef USE_SUNOS_CURSES
416 dnl /* Use old BSD curses - not used right now */
417 dnl #undef USE_BSD_CURSES
419 dnl /* Use SystemV curses? */
420 dnl #undef USE_SYSV_CURSES
422 dnl /* Use Ncurses? */
423 dnl #undef USE_NCURSES
425 dnl /* If you Curses does not have color define this one */
426 dnl #undef NO_COLOR_CURSES
428 dnl /* Define if you want to turn on SCO-specific code */
429 dnl #undef SCO_FLAVOR
431 dnl /* Set to reflect version of ncurses *
432 dnl * 0 = version 1.*
433 dnl * 1 = version 1.9.9g
434 dnl * 2 = version 4.0/4.1 */
435 dnl #undef NCURSES_970530
437 dnl /*=== End new stuff for acconfig.h ===*/
441 AC_DEFUN(AC_CHECK_CURSES,[
448 AC_SUBST(CURSES_LIBS)
449 AC_SUBST(CURSES_INCLUDEDIR)
452 [ --with-sco Use this to turn on SCO-specific code],[
453 if test x$withval = xyes; then
454 AC_DEFINE(SCO_FLAVOR)
455 CFLAGS="$CFLAGS -D_SVID3"
459 AC_ARG_WITH(sunos-curses,
460 [ --with-sunos-curses Used to force SunOS 4.x curses],[
461 if test x$withval = xyes; then
466 AC_ARG_WITH(osf1-curses,
467 [ --with-osf1-curses Used to force OSF/1 curses],[
468 if test x$withval = xyes; then
474 [ --with-vcurses[=incdir] Used to force SysV curses],
475 if test x$withval != xyes; then
476 CURSES_INCLUDEDIR="-I$withval"
482 [ --with-ncurses[=dir] Compile with ncurses/locate base dir],
483 if test x$withval = xno ; then
485 elif test x$withval != xyes ; then
486 AC_NCURSES($withval/include, ncurses.h, -L$withval/lib -lncurses, -I$withval/include, "ncurses on $withval/include")
497 AC_DEFUN(AC_USE_SUNOS_CURSES, [
499 screen_manager="SunOS 4.x /usr/5include curses"
500 AC_MSG_RESULT(Using SunOS 4.x /usr/5include curses)
501 AC_DEFINE(USE_SUNOS_CURSES)
502 AC_DEFINE(HAS_CURSES)
504 AC_DEFINE(NO_COLOR_CURSES)
505 AC_DEFINE(USE_SYSV_CURSES)
506 CURSES_INCLUDEDIR="-I/usr/5include"
507 CURSES_LIBS="/usr/5lib/libcurses.a /usr/5lib/libtermcap.a"
508 AC_MSG_RESULT(Please note that some screen refreshs may fail)
511 AC_DEFUN(AC_USE_OSF1_CURSES, [
512 AC_MSG_RESULT(Using OSF1 curses)
514 screen_manager="OSF1 curses"
515 AC_DEFINE(HAS_CURSES)
517 AC_DEFINE(NO_COLOR_CURSES)
518 AC_DEFINE(USE_SYSV_CURSES)
519 CURSES_LIBS="-lcurses"
522 AC_DEFUN(AC_USE_SYSV_CURSES, [
523 AC_MSG_RESULT(Using SysV curses)
524 AC_DEFINE(HAS_CURSES)
526 AC_DEFINE(USE_SYSV_CURSES)
528 screen_manager="SysV/curses"
529 CURSES_LIBS="-lcurses"
532 dnl AC_ARG_WITH(bsd-curses,
533 dnl [--with-bsd-curses Used to compile with bsd curses, not very fancy],
534 dnl search_ncurses=false
535 dnl screen_manager="Ultrix/cursesX"
536 dnl if test $system = ULTRIX
538 dnl THIS_CURSES=cursesX
540 dnl THIS_CURSES=curses
543 dnl CURSES_LIBS="-l$THIS_CURSES -ltermcap"
544 dnl AC_DEFINE(HAS_CURSES)
546 dnl AC_DEFINE(USE_BSD_CURSES)
547 dnl AC_MSG_RESULT(Please note that some screen refreshs may fail)
548 dnl AC_WARN(Use of the bsdcurses extension has some)
549 dnl AC_WARN(display/input problems.)
550 dnl AC_WARN(Reconsider using xcurses)
555 dnl Parameters: directory filename cureses_LIBS curses_INCLUDEDIR nicename
557 AC_DEFUN(AC_NCURSES, [
562 AC_MSG_RESULT(Found ncurses on $1/$2)
565 AC_CHECK_LIB(ncurses, initscr, , [
566 CHECKLIBS=`echo "$3"|sed 's/-lncurses/-lcurses/g'`
567 AC_CHECK_LIB(curses, initscr, [
568 CURSES_LIBS="$CHECKLIBS"
571 CURSES_INCLUDEDIR="$4"
574 AC_DEFINE(HAS_CURSES)
577 AC_DEFINE(USE_NCURSES)
582 AC_DEFUN(AC_SEARCH_NCURSES, [
583 AC_CHECKING("location of ncurses.h file")
585 AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
586 AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
587 AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
588 AC_NCURSES(/usr/pkg/include, ncurses.h, -L/usr/pkg/lib -lncurses, -I/usr/pkg/include, "ncurses on /usr/pkg")
589 AC_NCURSES(/usr/contrib/include, ncurses.h, -L/usr/contrib/lib -lncurses, -I/usr/contrib/include, "ncurses on /usr/contrib")
590 AC_NCURSES(/usr/local/include/ncurses, ncurses.h, -L/usr/local/lib -L/usr/local/lib/ncurses -lncurses, -I/usr/local/include/ncurses, "ncurses on /usr/local/include/ncurses")
592 AC_NCURSES(/usr/local/include/ncurses, curses.h, -L/usr/local/lib -lncurses, -I/usr/local/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/local/.../ncurses")
594 AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
597 dnl We couldn't find ncurses, try SysV curses
601 AC_EGREP_HEADER(init_color, /usr/include/curses.h,
603 AC_EGREP_CPP(USE_NCURSES,[
610 CURSES_INCLUDEDIR="$CURSES_INCLUDEDIR -DRENAMED_NCURSES"
611 AC_DEFINE(HAS_CURSES)
614 AC_DEFINE(USE_NCURSES)
616 screen_manager="ncurses installed as curses"
621 dnl Try SunOS 4.x /usr/5{lib,include} ncurses
622 dnl The flags USE_SUNOS_CURSES, USE_BSD_CURSES and BUGGY_CURSES
623 dnl should be replaced by a more fine grained selection routine
627 if test -f /usr/5include/curses.h
633 dnl use whatever curses there happens to be
636 if test -f /usr/include/curses.h
638 CURSES_LIBS="-lcurses"
639 AC_DEFINE(HAS_CURSES)
642 screen_manager="curses"
647 if test "x$want_textui" = "xyes"; then
650 if test "x$has_ncurses" != "x"; then
651 AC_CHECK_LIB(ncurses, use_default_colors, [
652 AC_DEFINE(HAVE_NCURSES_USE_DEFAULT_COLORS)
654 AC_CHECK_LIB(ncurses, idcok, [
655 AC_DEFINE(HAVE_CURSES_IDCOK)
657 AC_CHECK_LIB(ncurses, resizeterm, [
658 AC_DEFINE(HAVE_CURSES_RESIZETERM)
660 AC_CHECK_LIB(ncurses, wresize, [
661 AC_DEFINE(HAVE_CURSES_WRESIZE)
663 elif test "x$has_curses" = "xtrue"; then
664 AC_CHECK_LIB(curses, idcok, [
665 AC_DEFINE(HAVE_CURSES_IDCOK)
667 AC_CHECK_LIB(curses, resizeterm, [
668 AC_DEFINE(HAVE_CURSES_RESIZETERM)
670 AC_CHECK_LIB(curses, wresize, [
671 AC_DEFINE(HAVE_CURSES_WRESIZE)
685 if test "$want_perl" != "no"; then
686 AC_PATH_PROG(perlpath, perl)
687 AC_MSG_CHECKING(for working Perl support)
689 if test "x$perlpath" = "x"; then
690 perl_check_error="perl binary not found"
692 PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
695 if test "x$PERL_CFLAGS" = "x"; then
696 perl_check_error="Error getting perl CFLAGS"
697 AC_MSG_RESULT([not found, building without Perl])
700 PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null`
702 dnl * Perl 5.004 and older use perl_xxx variables while
703 dnl * later use PL_perl_xxx variables ..
704 have_pl_perl=`$perlpath -e 'print $] < 5.005 ? "no" : "yes";'`
705 if test "x$have_pl_perl" = "xyes"; then
706 AC_DEFINE(HAVE_PL_PERL)
709 if test "x$DYNLIB_MODULES" = "xno" -a "$want_perl" != "static"; then
710 dnl * wanted perl as module, won't get it.
712 perl_mod_error="Dynamic library dependencies don't work with modules"
715 if test "$want_perl" != "static"; then
716 dnl * dynaloader.a -> libperl_dynaloader.la
717 DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
720 dnl * don't check libperl.a if dynaloader.a wasn't found..
721 if test "x$DYNALOADER_A" != "x"; then
722 dnl * find either libperl.a or libperl.so
723 LIBPERL_A=`echo "$PERL_LDFLAGS -L/usr/lib"|$perlpath -e 'foreach (split(/ /, <STDIN>)) { if (/^-L(.*)/) { my $dir=$1; if (\`ls $dir/libperl.so* 2>/dev/null\`) { print "-lperl"; last; }; if (-e "$dir/libperl.a") { print "$dir/libperl.a"; last } } };'`
724 if test "x$LIBPERL_A" = "x"; then
725 perl_mod_error="Didn't find location of -lperl"
727 elif test "$LIBPERL_A" = "-lperl"; then
732 dnl * remove all database stuffs
733 dnl * nsl is already in ldflags
734 dnl * libc is of course linked without needing -lc
735 dnl * -rdynamic must not be in LIBADD line
736 for word in -ldb -ldbm -lndbm -lgdbm -lc -rdynamic; do
737 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e "s/$word //" -e "s/$word$//"`
742 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lposix //' -e 's/-lposix$//'`
745 if test "x$ac_cv_prog_gcc" = "xyes"; then
746 PERL_CFLAGS=`echo $PERL_CFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
747 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
754 dnl * check that perl's ldflags actually work
755 AC_CACHE_VAL(irssi_cv_lib_perl_works, [
756 echo "main(){perl_alloc(); return 0;}" > conftest.c
757 $CC $CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> /dev/null > /dev/null
758 if test -s conftest; then
759 irssi_cv_lib_perl_works=yes
761 irssi_cv_lib_perl_works=no
765 if test "x$irssi_cv_lib_perl_works" = "xno"; then
766 perl_check_error="Error linking with perl libraries: $PERL_LDFLAGS"
767 AC_MSG_RESULT([error linking with perl libraries, building without Perl])
772 if test "x$want_perl" != "xno"; then
773 if test "x$want_perl" = "xstatic"; then
775 elif test "x$DYNALOADER_A" = "x"; then
776 AC_MSG_RESULT([error parsing ldopts, building Perl into irssi binary instead of as module])
780 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
781 if test "x$LIBPERL_A" != "x"; then
782 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lperl /libperl_orig.la /' -e 's/-lperl$/libperl_orig.la$/'`
785 AC_SUBST(DYNALOADER_A)
788 if test "x$want_perl" = "xstatic"; then
789 dnl * building with static perl support
790 dnl * all PERL_LDFLAGS linking is done in fe-text
791 PERL_LDFLAGS="../perl/libperl_static.la $PERL_LDFLAGS"
792 PERL_LINK_LIBS="$PERL_LDFLAGS"
793 PERL_FE_LINK_LIBS="../perl/libfe_perl_static.la"
795 AC_DEFINE(HAVE_STATIC_PERL)
797 dnl * build only static library of perl module
800 perl_static_lib=libperl_static.la
801 perl_static_fe_lib=libfe_perl_static.la
802 PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool'
804 dnl * build dynamic library of perl module,
805 dnl * use libtool-shared to prevent creating of
807 perl_module_lib=libperl_core.la
808 perl_module_fe_lib=libfe_perl.la
811 PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool-shared'
813 AC_SUBST(perl_module_lib)
814 AC_SUBST(perl_static_lib)
815 AC_SUBST(perl_module_fe_lib)
816 AC_SUBST(perl_static_fe_lib)
817 AC_SUBST(PERL_LIBTOOL)
819 AC_SUBST(PERL_LINK_LIBS)
820 AC_SUBST(PERL_FE_LINK_LIBS)
822 AC_SUBST(PERL_LDFLAGS)
823 AC_SUBST(PERL_CFLAGS)
824 AC_SUBST(PERL_LIB_DIR)
828 dnl ** check what we want to build
829 AM_CONDITIONAL(BUILD_TEXTUI, test "$want_textui" = "yes")
830 AM_CONDITIONAL(BUILD_IRSSIBOT, test "$want_irssibot" = "yes")
831 AM_CONDITIONAL(BUILD_IRSSIPROXY, test "$want_irssiproxy" = "yes")
832 AM_CONDITIONAL(BUILD_PLUGINS, test "$want_plugins" = "yes")
833 AM_CONDITIONAL(BUILD_SERVERTEST, test "x$TEST_DIR" != "x")
834 AM_CONDITIONAL(HAVE_PERL, test "$want_perl" != "no")
835 AM_CONDITIONAL(HAVE_STATIC_PERL, test "$want_perl" = "static")
840 dnl ** Keep all the libraries here so each frontend doesn't need to
841 dnl ** keep track of them all
843 dnl ** (these could be made configurable)
847 if test "x$build_modules" != "x"; then
848 silc_MODULES="$silc_MODULES $build_modules"
850 #PROG_LIBS="$PROG_LIBS -lsilc"
852 dnl ****************************************
854 AC_SUBST(CHAT_MODULES)
855 AC_SUBST(silc_MODULES)
857 CORE_LIBS="../core/libcore.a ../lib-config/libirssi_config.a ../lib-popt/libpopt.a"
861 for c in $CHAT_MODULES; do
866 CHAT_LIBS="$CHAT_LIBS ../$c/lib$c.a ../$c/core/lib${c}_core.a"
867 if test -f $srcdir/src/fe-common/$c/module.h; then
868 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/libfe_common_$c.a "
870 for s in `eval echo \\$${c}_MODULES`; do
871 CHAT_LIBS="$CHAT_LIBS ../$c/$s/.libs/lib${c}_$s.a"
872 module_inits="$module_inits ${c}_${s}_init();"
873 module_deinits="${c}_${s}_deinit(); $module_deinits"
874 if test -f $srcdir/src/fe-common/$c/$s/module.h; then
875 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/$s/.libs/libfe_${c}_$s.a "
876 fe_module_inits="$fe_module_inits fe_${c}_${s}_init();"
877 fe_module_deinits="fe_${c}_${s}_deinit(); $fe_module_deinits"
881 file="$srcdir/src/$c/$c.c"
882 echo "/* this file is automatically generated by configure - don't change */" > $file
883 echo "void ${c}_core_init(void); void ${c}_core_init_finish(void); void ${c}_core_deinit(void);" >> $file
884 if test "x$module_inits" != "x"; then
885 echo "$module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
886 echo "$module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
888 echo "void ${c}_init(void) { ${c}_core_init(); $module_inits }" >> $file
889 echo "void ${c}_init_finish(void) { ${c}_core_init_finish(); $module_inits }" >> $file
890 echo "void ${c}_deinit(void) { $module_deinits ${c}_core_deinit(); }" >> $file
892 if test -f $srcdir/src/fe-common/$c/module.h; then
893 file="$srcdir/src/fe-common/$c/${c}-modules.c"
894 echo "/* this file is automatically generated by configure - don't change */" > $file
895 if test "x$fe_module_inits" != "x"; then
896 echo "$fe_module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
897 echo "$fe_module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
899 echo "void fe_${c}_modules_init(void) { $fe_module_inits }" >> $file
900 echo "void fe_${c}_modules_deinit(void) { $fe_module_deinits }" >> $file
904 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/core/libfe_common_core.a"
906 dnl ** common libraries needed by frontends
907 COMMON_NOUI_LIBS="$CHAT_LIBS $CORE_LIBS $INTLLIBS"
908 COMMON_LIBS="$FE_COMMON_LIBS $COMMON_NOUI_LIBS"
909 AC_SUBST(COMMON_NOUI_LIBS)
910 AC_SUBST(COMMON_LIBS)
913 dnl ** memory debugging
916 if test "x$want_memdebug" = "xyes"; then
919 AM_CONDITIONAL(BUILD_MEMDEBUG, test "x$want_memdebug" = "xyes")
922 dnl ** tr-Chinese Big5 support
925 if test "x$want_big5" = "xyes"; then
933 if test "x$want_ipv6" = "xyes"; then
937 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
938 AC_SUBST(INCLUDE_DEFINES_INT)
944 src/fe-common/Makefile
945 src/fe-common/core/Makefile
946 src/fe-common/silc/Makefile
948 src/lib-config/Makefile
949 src/lib-popt/Makefile
951 src/silc/core/Makefile
954 docs/help/in/Makefile
960 dnl ** for building from objdir
961 if test "x$want_perl" != "xno"; then
962 old_dir=`pwd` && cd $srcdir && whole_dir=`pwd` && cd $old_dir
964 if test "x$old_dir" != "x$whole_dir"; then
965 for file in $whole_dir/src/perl/*.[[ch]] $whole_dir/src/perl/libperl_orig.la $whole_dir/src/perl/libperl_dynaloader.la $whole_dir/src/perl/common/typemap $whole_dir/src/perl/common/module.h $whole_dir/src/perl/common/*.xs $whole_dir/src/perl/irc/typemap $whole_dir/src/perl/irc/module.h $whole_dir/src/perl/irc/*.xs; do
966 link=`echo $file|$sedpath "s?$whole_dir/??"`
975 if test "x$curses_error" != "xyes"; then
976 echo "Building text frontend ..... : $want_textui"
978 echo "Building text frontend ..... : NO!!"
979 echo " - Because curses was not found, specify the path to it with"
980 echo " --with-curses=/dir and make sure you have the curses headers"
981 echo " installed (usually in ncurses-devel package)"
983 echo "Building irssi bot ......... : $want_irssibot"
984 echo "Building irssi proxy ....... : $want_irssiproxy"
985 echo "Building with IPv6 support . : $want_ipv6"
987 if test "x$want_perl" = "xstatic"; then
988 echo "Building with Perl support . : static (in irssi binary)"
989 elif test "x$want_perl" = "xyes"; then
990 echo "Building with Perl support . : module"
992 if test "x$perl_check_error" = "x"; then
993 echo "Building with Perl support . : no"
995 echo "Building with Perl support . : NO!"
996 echo " - $perl_check_error"
1000 if test "x$want_perl" != "xno" -a "x$perl_mod_error" != "x"; then
1001 echo " - NOTE: Perl support will be compiled statically to irssi, not as"
1002 echo " a module as requested. Reason:"
1003 echo " $perl_mod_error"
1006 if test "x$want_perl" = "xyes"; then
1007 if test "x$PERL_LIB_DIR" = "x"; then
1008 echo "Perl library directory ..... : (default - usually /usr/local/lib/perl_site)"
1010 echo "Perl library directory ..... : $PERL_LIB_DIR"
1011 if test "x$perl_lib_dir_given" != "xyes"; then
1012 echo " - NOTE: This was automatically set to the same directory you gave with"
1013 echo " --prefix. If you want the perl libraries to install to their 'correct'"
1014 echo " path, you'll need to give --enable-perl-path= (nothing after '=') option"
1015 echo " to configure. Anyway, installing perl to this directory should work"
1016 echo " just as well.."
1020 echo "Install prefix ............. : $prefix"