1 AC_INIT([SILC-Client], [0.8.11+], [silc-devel@lists.silcnet.org], [silc-client])
3 # we don't want VERSION in our config.h
4 if test -n "`grep '^#undef VERSION' config.h.in`"; then
5 grep -v '^#undef VERSION' config.h.in > config.h.in.temp
6 mv -f config.h.in.temp config.h.in
9 AM_CONFIG_HEADER(config.h)
21 AC_PATH_PROG(sedpath, sed)
22 AC_PATH_PROG(perlpath, perl)
24 dnl * --disable-static isn't a good idea, complain if it's used
25 if test "x$enable_static" = "xno"; then
26 AC_ERROR([Don't give --disable-static option to configure])
29 AC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h sys/ioctl.h sys/resource.h)
31 # check posix headers..
32 AC_CHECK_HEADERS(sys/time.h sys/utsname.h)
35 [ --with-socks Build with socks support],
36 if test x$withval = xyes; then
39 if test "x$withval" = xno; then
48 [ --with-textui Build text frontend],
49 if test x$withval = xyes; then
52 if test "x$withval" = xno; then
61 [ --with-bot Build irssi-bot],
62 if test x$withval = xyes; then
65 if test "x$withval" = xno; then
74 [ --with-proxy Build irssi-proxy],
75 if test x$withval = xyes; then
78 if test "x$withval" = xno; then
87 [ --with-terminfo Use terminfo directly instead of curses],
88 if test x$withval = xyes; then
91 if test "x$withval" = xno; then
100 [ --with-cuix Use curses ui extended],
101 if test x$withval = xyes; then
107 [ --with-modules Specify what modules to build in binary],
108 if test x$withval != xyes -a x$withval != xno; then
109 build_modules="$withval"
112 if test "x$prefix" != "xNONE"; then
113 prefix=`eval echo $prefix`
114 PERL_MM_PARAMS="INSTALLDIRS=perl PREFIX=$prefix"
115 perl_library_dir="PERL_USE_LIB"
122 [ --with-glib1 Use GLIB 1.2 instead of 2.0 if both exist],
123 if test x$withval = xyes; then
126 if test "x$withval" = xno; then
134 AC_ARG_WITH(perl-staticlib,
135 [ --with-perl-staticlib Specify that we want to link perl libraries
136 statically in irssi, default is no],
137 if test x$withval = xyes; then
138 want_staticperllib=yes
140 if test "x$withval" = xno; then
141 want_staticperllib=no
143 want_staticperllib=yes
146 want_staticperllib=no)
149 AC_ARG_WITH(perl-lib,
150 [ --with-perl-lib=[site|vendor|DIR] Specify where to install the
151 Perl libraries for irssi, default is site],
152 if test "x$withval" = xyes; then
154 elif test "x$withval" = xno; then
156 elif test "x$withval" = xsite; then
160 elif test "x$withval" = xvendor; then
163 if test -z "`$perlpath -v|grep '5\.0'`"; then
164 PERL_MM_PARAMS="INSTALLDIRS=vendor"
166 PERL_MM_PARAMS="INSTALLDIRS=perl PREFIX=`perl -e 'use Config; print $Config{prefix}'`"
168 perl_library_dir="(vendor default - `$perlpath -e 'use Config; print $Config{archlib}'`)"
172 PERL_MM_PARAMS="INSTALLDIRS=perl LIB=$withval"
173 perl_library_dir="PERL_USE_LIB"
179 [ --with-perl[=yes|no|module] Build with Perl support - also specifies
180 if it should be built into main irssi binary
181 (static, default) or as module],
182 if test x$withval = xyes; then
184 elif test x$withval = xstatic; then
186 elif test x$withval = xmodule; then
193 # Irssi SILC Plugin support
197 AC_MSG_CHECKING(whether to compile SILC Plugin for Irssi)
198 AC_ARG_WITH(silc-plugin,
199 [[ --with-silc-plugin[=DIR] Compile the SILC Plugin for Irssi, specify
200 Irssi location [/usr/lib/irssi]]],
210 SILC_IRSSIDIR="/usr/lib/irssi/modules"
215 SILC_IRSSIDIR="$withval/modules"
220 AM_CONDITIONAL(SILCPLUGIN, test x$silc_plugin = xtrue)
221 AC_SUBST(SILC_IRSSIDIR)
223 AC_ARG_WITH(file-offset-size,
224 [ --with-file-offset-size=BITS Set size of file offsets. Usually 32 or 64.
225 (default: 64 if available)],
226 preferred_off_t_bits=$withval,
227 preferred_off_t_bits=64)
230 [ --enable-ipv6 Enable IPv6 support],
231 if test x$enableval = xyes; then
234 if test "x$enableval" = xno; then
243 dnl ** just some generic stuff...
246 dnl * OS specific options
249 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
256 AC_CHECK_FUNCS(mkfifo fcntl nl_langinfo)
258 AC_CHECK_FUNC(socket, [], [
259 AC_CHECK_LIB(socket, socket, [
260 LIBS="$LIBS -lsocket"
264 AC_CHECK_FUNC(inet_addr, [], [
265 AC_CHECK_LIB(nsl, inet_addr, [
270 dnl * gcc specific options
271 if test "x$ac_cv_prog_gcc" = "xyes"; then
272 CFLAGS="$CFLAGS -Wall"
275 dnl * socklen_t - AC_CHECK_TYPE() would be _really_ useful if it only would
276 dnl * accept header files where to find the typedef..
277 AC_MSG_CHECKING([for socklen_t])
278 AC_CACHE_VAL(irssi_cv_type_socklen_t,
280 #include <sys/types.h>
281 #include <sys/socket.h>],
283 irssi_cv_type_socklen_t=yes,
284 irssi_cv_type_socklen_t=no,
286 if test $irssi_cv_type_socklen_t = no; then
287 AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
289 AC_MSG_RESULT($irssi_cv_type_socklen_t)
291 dnl * off_t checks, try to make it 64bit
292 AC_DEFINE_UNQUOTED(_FILE_OFFSET_BITS, $preferred_off_t_bits)
295 AC_CHECK_SIZEOF(long)
296 AC_CHECK_SIZEOF(long long)
297 AC_CHECK_SIZEOF(off_t)
299 if test $ac_cv_sizeof_off_t = 8; then
305 if test x$ac_cv_sizeof_off_t = x$ac_cv_sizeof_long; then
306 # try to use unsigned long always first
307 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "lu")
308 AC_DEFINE(UOFF_T_LONG, [], [UOFF_T_LONG])
309 elif test x$ac_cv_sizeof_off_t = x$ac_cv_sizeof_int; then
311 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "u")
312 AC_DEFINE(UOFF_T_INT, [], [UOFF_T_INT])
313 elif test x$ac_cv_sizeof_off_t = x$ac_cv_sizeof_long_long; then
314 # and finally long long
315 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "llu")
316 AC_DEFINE(UOFF_T_LONG_LONG, [], [UOFF_T_LONG_LONG])
318 AC_ERROR([Couldn't find integer type for off_t])
322 dnl ** check for socks
325 if test "x$want_socks" = "xyes"; then
326 AC_CHECK_LIB(socks, connect, [
328 AC_CHECK_HEADER(socks.h, [
329 AC_DEFINE(HAVE_SOCKS_H)
330 CFLAGS="$CFLAGS -DSOCKS"
331 AC_MSG_RESULT(["socks5 library found, building with it"])
333 AC_MSG_RESULT(["socks4 library found, building with it"])
334 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dgetpeername=Rgetpeername -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
339 if test "x$want_cuix" = "xyes"; then
340 AC_DEFINE([HAVE_CUIX], [1] ,[Enable cuix support])
344 dnl ** fe-text checks
347 AC_DEFUN(AC_CHECK_GLIBDIR,[
348 AC_MSG_CHECKING([whether GLib is unpacked to irssi dir])
350 GLIB_DIR=`for d in *; do test -f $d/glib.h && echo $d; done`
351 if test -n "$GLIB_DIR"; then
352 dnl * glib in irssi directory, use it
353 AC_MSG_RESULT([yes, using it])
355 dnl * we have to do this at this point so we know what libs gmodule needs
356 if test ! -f $GLIB_DIR/.libs/libglib.a; then
358 echo "configuring GLib ..."
361 if test ! -f glib-config; then
369 GLIB_LDEXTRA=`$GLIB_DIR/glib-config --libs gmodule|$sedpath -e 's/-lglib//' -e 's/-lgmodule//' -e 's,-L/usr/local/lib ,,'|$sedpath 's/ \+/ /g'`
370 full_glib_dir="`pwd`/$GLIB_DIR"
371 GLIB_CFLAGS="-I$full_glib_dir -I$full_glib_dir/gmodule"
372 if test -f $full_glib_dir/.libs/libglib.a; then
373 GLIB_LIBS="$full_glib_dir/.libs/libglib.a $GLIB_LDEXTRA"
374 if test -f $full_glib_dir/gmodule/.libs/libgmodule.a; then
375 GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/.libs/libgmodule.a"
376 AC_DEFINE(HAVE_GMODULE)
380 GLIB_LIBS="$full_glib_dir/libglib.a $GLIB_LDEXTRA"
381 if test -f $full_glib_dir/gmodule/libgmodule.a; then
382 GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/libgmodule.a"
383 AC_DEFINE(HAVE_GMODULE)
387 AC_SUBST(GLIB_CFLAGS)
396 if test -z "$GLIB_DIR"; then
397 if test "x$want_glib1" = "xyes"; then
398 dnl * check only for glib1
401 dnl * check glib2 then glib1
405 for try in $checks; do
407 if test $try = 1 -o $try = 3; then
410 echo "*** trying without -lgmodule"
413 if test $try = 1 -o $try = 2; then
414 AM_PATH_GLIB(1.2.0,,, $glib_modules)
416 AM_PATH_GLIB_2_0(2.0.0,,, $glib_modules)
418 if test "$GLIB_LIBS"; then
419 if test $glib_modules = gmodule; then
420 AC_DEFINE(HAVE_GMODULE)
427 if test -z "$GLIB_LIBS"; then
429 echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org"
430 echo "*** If you can't install GLIB anywhere or if you don't want to,"
431 echo "*** you can just unpack it to Irssi's source directory and"
432 echo "*** Irssi will automatically compile and use it."
435 glib_url=ftp://ftp.gtk.org/pub/gtk/v2.8/
436 glib_file=glib-2.8.3.tar.gz
439 if test -n "`wget --version 2>/dev/null|grep -i wget`"; then
440 dlcmd="wget -c $glib_url$glib_file"
441 elif test -n "`ncftpget --version 2>/dev/null|grep -i ncftp`"; then
442 dlcmd="ncftpget -z $glib_url$glib_file"
443 elif test -n "`lynx --version 2>/dev/null|grep -i lynx`"; then
444 dlcmd="lynx --source $glib_url$glib_file > $glib_file"
445 elif test -n "`curl --version 2>/dev/null|grep -i curl`"; then
446 dlcmd="curl -C - $glib_url$glib_file"
448 if test -n "$dlcmd"; then
449 echo "*** I can download GLib for you now. If you don't want to, press CTRL-C now."
451 echo "*** Press ENTER to continue"
454 if `gunzip $glib_file`; then
455 glib_file=`echo $glib_file|$sedpath s/\.gz$//`
456 if `tar xf $glib_file`; then
463 if test -z "$GLIB_LIBS"; then
464 AC_ERROR([GLIB is required to build irssi.])
469 LIBS="$LIBS $GLIB_LIBS"
474 AC_MSG_CHECKING([if we can use recode, requires GLIB2])
475 if test "$glib_config_major_version" = "2"; then
476 AC_DEFINE([HAVE_GLIB2], [], ["HAVE_GLIB2"])
479 AC_MSG_RESULT([no, using glib1])
483 dnl ** check if we can link dynamic libraries to modules
484 dnl ** also checks if libraries are built to .libs dir
487 AC_MSG_CHECKING([if we can link dynamic libraries with modules])
490 dnl ** compile object file
491 cat > conftest.c <<EOF
493 int modfunc(){return (int)floor(1.2);}
496 if ! ./libtool --tag=CC --mode=compile $CC $CFLAGS -c conftest.c >/dev/null 2>&1 || \
497 ! ./libtool --tag=CC --mode=link $CC $CFLAGS $LDFLAGS -rpath /usr/lib conftest.lo -lm -o libconftest.la >/dev/null 2>&1; then
498 AC_MSG_RESULT([no, error compiling test module])
500 cat > conftest.c <<EOF
503 GModule *m; int (*modfunc)(void);
504 m = g_module_open("libconftest.la", 0);
505 if (!m) g_print("error loading: %s", g_module_error());
506 else if (!g_module_symbol(m, "modfunc", (gpointer *) &modfunc))
507 g_print("modfunc() symbol not found from module");
508 else if (modfunc() == 1) g_print("ok"); else g_print("wrong result?! 1 vs %d", modfunc());
511 $CC $CFLAGS $LDFLAGS conftest.c -o conftest $GLIB_CFLAGS $GLIB_LIBS 2> /dev/null > /dev/null
512 if test ! -s conftest; then
513 AC_MSG_RESULT([no, error compiling test program])
515 status="`./conftest`"
516 if test "x$status" = "xok"; then
520 AC_MSG_RESULT([no, error running: $status])
524 rm -rf conftest conftest.* libconftest.* .libs
530 if test "x$want_textui" = "xyes"; then
533 TEXTUI_LIBS="$LIBS $CURSES_LIBS"
534 if test "x$has_curses" = "xtrue"; then
535 AC_CHECK_FUNC(use_default_colors, AC_DEFINE(HAVE_NCURSES_USE_DEFAULT_COLORS))
536 AC_CHECK_FUNC(idcok, AC_DEFINE(HAVE_CURSES_IDCOK))
537 AC_CHECK_FUNC(resizeterm, AC_DEFINE(HAVE_CURSES_RESIZETERM))
538 AC_CHECK_FUNC(wresize, AC_DEFINE(HAVE_CURSES_WRESIZE))
539 AC_CHECK_FUNC(setupterm,, [
543 AC_CHECK_LIB(tinfo, setupterm, [
544 TEXTUI_LIBS="$LIBS -ltinfo"
546 ], AC_CHECK_LIB(termlib, tgetent, [
547 TEXTUI_LIBS="$LIBS -ltermlib"
549 ], AC_CHECK_LIB(termcap, tgetent, [
550 TEXTUI_LIBS="$LIBS -ltermcap"
553 AC_ERROR(Terminfo/termcap not found - install ncurses-devel package)
557 AC_SUBST(TEXTUI_LIBS)
558 if test "x$want_termcap" = "xyes"; then
559 AC_CHECK_FUNC(tparm,, need_tparm=yes)
561 AC_DEFINE(HAVE_TERMINFO)
569 if test "$want_perl" != "no"; then
570 AC_MSG_CHECKING(for working Perl support)
572 if test -z "$perlpath"; then
573 perl_check_error="perl binary not found"
575 PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
578 if test "x$ac_cv_prog_gcc" = "xyes" -a -z "`echo $host_os|grep 'bsd\|linux'`"; then
579 dnl * several systems have Perl compiled with native compiler
580 dnl * but irssi is being compiled with GCC. Here we try to
581 dnl * fix those command line options a bit so GCC won't
582 dnl * complain about them. Normally there's only few options
583 dnl * that we want to keep:
584 dnl * -Ddefine -Uundef -I/path -fopt -mopt
585 PERL_CFLAGS=`echo $PERL_CFLAGS | $perlpath -pe 's/^(.* )?-[^DUIfm][^ ]+/\1/g; s/^(.* )?\+[^ ]+/\1/g'`
587 PERL_EXTRA_OPTS="CCCDLFLAGS=\"-fPIC\""
588 AC_SUBST(PERL_EXTRA_OPTS)
591 if test -z "$PERL_CFLAGS"; then
592 if test -n "$perl_check_error"; then
593 perl_check_error="Error getting perl CFLAGS"
595 AC_MSG_RESULT([not found, building without Perl])
598 PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null`
600 dnl * Perl 5.004 and older use perl_xxx variables while
601 dnl * later use PL_perl_xxx variables ..
602 have_pl_perl=`$perlpath -e 'print $] < 5.005 ? "no" : "yes";'`
603 if test "x$have_pl_perl" = "xyes"; then
604 AC_DEFINE(HAVE_PL_PERL)
607 if test "x$DYNLIB_MODULES" = "xno" -a "$want_perl" != "static"; then
608 dnl * wanted perl as module, won't get it.
610 perl_mod_error="Dynamic library dependencies don't work with modules"
613 if test "$want_perl" != "static"; then
614 dnl * dynaloader.a -> libperl_dynaloader.la
615 DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
618 dnl * don't check libperl.a if dynaloader.a wasn't found..
619 if test -n "$DYNALOADER_A"; then
620 dnl * find either libperl.a or libperl.so
621 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 } } };'`
622 if test -z "$LIBPERL_A"; then
623 perl_mod_error="Didn't find location of -lperl"
625 elif test "$LIBPERL_A" = "-lperl"; then
630 dnl * remove all database stuffs
631 dnl * nsl is already in ldflags
632 dnl * libc is of course linked without needing -lc
633 dnl * -rdynamic must not be in LIBADD line
634 for word in -ldb -ldbm -lndbm -lgdbm -lc -rdynamic; do
635 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e "s/$word //" -e "s/$word$//"`
640 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lposix //' -e 's/-lposix$//'`
643 if test "x$ac_cv_prog_gcc" = "xyes"; then
644 PERL_CFLAGS=`echo $PERL_CFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
645 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
652 dnl * check that perl's ldflags actually work
653 echo "main(){perl_alloc(); return 0;}" > conftest.c
654 $CC $CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> perl.error.tmp > /dev/null
655 if test ! -s conftest; then
656 perl_check_error="Error linking with perl libraries: $PERL_LDFLAGS: `cat perl.error.tmp`"
657 AC_MSG_RESULT([error linking with perl libraries, building without Perl])
664 if test "x$want_perl" != "xno"; then
665 if test "x$want_perl" = "xstatic"; then
667 elif test -z "$DYNALOADER_A"; then
668 AC_MSG_RESULT([error parsing ldopts, building Perl into irssi binary instead of as module])
672 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
673 if test -n "$LIBPERL_A"; then
674 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lperl /libperl_orig.la /' -e 's/-lperl$/libperl_orig.la$/'`
677 AC_SUBST(DYNALOADER_A)
680 if test "x$want_perl" = "xstatic"; then
681 dnl * building with static perl support
682 dnl * all PERL_LDFLAGS linking is done in fe-text
683 PERL_LINK_FLAGS="$PERL_LDFLAGS"
684 PERL_LINK_LIBS="../perl/libperl_core_static.la"
685 PERL_FE_LINK_LIBS="../perl/libfe_perl_static.la"
687 AC_DEFINE(HAVE_STATIC_PERL)
689 dnl * build only static library of perl module
692 perl_static_lib=libperl_core_static.la
693 perl_static_fe_lib=libfe_perl_static.la
694 PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool'
696 dnl * build dynamic library of perl module
697 perl_module_lib=libperl_core.la
698 perl_module_fe_lib=libfe_perl.la
701 PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool'
704 if test "x$want_staticperllib" = "xyes"; then
705 PERL_MM_PARAMS="$PERL_MM_PARAMS LINKTYPE=static"
706 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"
712 # figure out the correct @INC path - we'll need to do this
713 # through MakeMaker since it's difficult to get it right
715 if test "x$perl_set_use_lib" = "xyes"; then
716 perl -e 'use ExtUtils::MakeMaker; WriteMakefile("NAME" => "test", "MAKEFILE" => "Makefile.test");' $PERL_MM_PARAMS >/dev/null
717 PERL_USE_LIB=`perl -e 'open(F, "Makefile.test"); while (<F>) { chomp; if (/^(\w+) = (.*$)/) { $keys{$1} = $2; } }; $key = $keys{INSTALLARCHLIB}; while ($key =~ /\\$\((\w+)\)/) { $value = $keys{$1}; $key =~ s/\\$\($1\)/$value/; }; print $key;'`
721 AC_SUBST(perl_module_lib)
722 AC_SUBST(perl_static_lib)
723 AC_SUBST(perl_module_fe_lib)
724 AC_SUBST(perl_static_fe_lib)
725 AC_SUBST(PERL_LIBTOOL)
727 AC_SUBST(PERL_LINK_FLAGS)
728 AC_SUBST(PERL_LINK_LIBS)
729 AC_SUBST(PERL_FE_LINK_LIBS)
731 AC_SUBST(PERL_LDFLAGS)
732 AC_SUBST(PERL_CFLAGS)
734 AC_SUBST(PERL_USE_LIB)
735 AC_SUBST(PERL_MM_PARAMS)
736 AC_SUBST(PERL_STATIC_LIBS)
740 dnl ** check what we want to build
741 AM_CONDITIONAL(BUILD_TEXTUI, test "$want_textui" = "yes")
742 AM_CONDITIONAL(BUILD_IRSSIBOT, test "$want_irssibot" = "yes")
743 AM_CONDITIONAL(BUILD_IRSSIPROXY, test "$want_irssiproxy" = "yes")
744 AM_CONDITIONAL(BUILD_PLUGINS, test "$want_plugins" = "yes")
745 AM_CONDITIONAL(HAVE_PERL, test "$want_perl" != "no")
746 AM_CONDITIONAL(HAVE_STATIC_PERL, test "$want_perl" = "static")
747 AM_CONDITIONAL(NEED_TPARM, test "$need_tparm" = "yes")
748 AM_CONDITIONAL(USE_CURSES, test "$want_terminfo" != "yes" -a "$want_termcap" != "yes")
749 AM_CONDITIONAL(BUILD_SERVERTEST, false)
750 AM_CONDITIONAL(USE_CUIX, test "$want_cuix" = "yes")
752 # move LIBS to PROG_LIBS so they're not tried to be used when linking eg. perl libraries
758 dnl ** Keep all the libraries here so each frontend doesn't need to
759 dnl ** keep track of them all
761 dnl ** (these could be made configurable)
765 if test -n "$build_modules"; then
766 silc_MODULES="$silc_MODULES $build_modules"
769 dnl ****************************************
771 AC_SUBST(CHAT_MODULES)
772 AC_SUBST(silc_MODULES)
774 CORE_LIBS="../core/libcore.a ../lib-config/libirssi_config.a ../lib-popt/libpopt.a"
778 for c in $CHAT_MODULES; do
783 CHAT_LIBS="$CHAT_LIBS ../$c/lib$c.a ../$c/core/lib${c}_core.a"
784 if test -f $srcdir/src/fe-common/$c/module.h; then
785 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/libfe_common_$c.a "
787 for s in `eval echo \\$${c}_MODULES`; do
788 CHAT_LIBS="$CHAT_LIBS ../$c/$s/lib${c}_$s.a"
789 module_inits="$module_inits ${c}_${s}_init();"
790 module_deinits="${c}_${s}_deinit(); $module_deinits"
791 if test -f $srcdir/src/fe-common/$c/$s/module.h; then
792 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/$s/libfe_${c}_$s.a "
793 fe_module_inits="$fe_module_inits fe_${c}_${s}_init();"
794 fe_module_deinits="fe_${c}_${s}_deinit(); $fe_module_deinits"
798 file="$srcdir/src/$c/$c.c"
799 echo "/* this file is automatically generated by configure - don't change */" > $file
800 echo "void ${c}_core_init(void); void ${c}_core_deinit(void);" >> $file
801 if test -n "$module_inits"; then
802 echo "$module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
803 echo "$module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
805 echo "void ${c}_init(void) { ${c}_core_init(); $module_inits }" >> $file
806 echo "void ${c}_deinit(void) { $module_deinits ${c}_core_deinit(); }" >> $file
808 if test -f $srcdir/src/fe-common/$c/module.h; then
809 file="$srcdir/src/fe-common/$c/${c}-modules.c"
810 echo "/* this file is automatically generated by configure - don't change */" > $file
811 if test -n "$fe_module_inits"; then
812 echo "$fe_module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
813 echo "$fe_module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
815 echo "void fe_${c}_modules_init(void) { $fe_module_inits }" >> $file
816 echo "void fe_${c}_modules_deinit(void) { $fe_module_deinits }" >> $file
820 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/core/libfe_common_core.a"
822 dnl ** common libraries needed by frontends
823 COMMON_NOUI_LIBS="$CHAT_LIBS $CORE_LIBS"
824 COMMON_LIBS="$FE_COMMON_LIBS $COMMON_NOUI_LIBS"
825 AC_SUBST(COMMON_NOUI_LIBS)
826 AC_SUBST(COMMON_LIBS)
832 if test "x$want_ipv6" = "xyes"; then
833 AC_MSG_CHECKING([for IPv6])
834 AC_CACHE_VAL(irssi_cv_type_in6_addr,
836 #include <sys/types.h>
837 #include <sys/socket.h>
838 #include <netinet/in.h>
840 #include <arpa/inet.h>],
841 [struct in6_addr i;],
842 irssi_cv_type_in6_addr=yes,
843 irssi_cv_type_in6_addr=no,
845 if test $irssi_cv_type_in6_addr = yes; then
848 AC_MSG_RESULT($irssi_cv_type_in6_addr)
852 dnl ** IRSSI_VERSION_DATE and IRSSI_VERSION_TIME
854 #VERSION_DATE=`head -1 $srcdir/ChangeLog|sed 's/^\(....\)-\(..\)-\(..\).*/\1\2\3/'`
855 #VERSION_TIME=`head -1 $srcdir/ChangeLog|sed -e 's/^[[^ ]]* \(..\):\(..\).*/\1\2/' -e 's/^0*//'`
856 #AC_SUBST(VERSION_DATE)
857 #AC_SUBST(VERSION_TIME)
860 # Glue into SILC build system
862 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
863 AC_SUBST(INCLUDE_DEFINES_INT)
869 src/fe-common/Makefile
870 src/fe-common/core/Makefile
871 src/fe-common/silc/Makefile
873 src/lib-config/Makefile
874 src/lib-popt/Makefile
876 src/silc/core/Makefile
878 src/perl/common/Makefile.PL
879 src/perl/ui/Makefile.PL
880 src/perl/textui/Makefile.PL
881 src/perl/silc/Makefile.PL
883 scripts/examples/Makefile
886 docs/help/in/Makefile
891 dnl ** for building from objdir
892 old_dir=`pwd` && cd $srcdir && whole_dir=`pwd` && cd $old_dir
893 if test "x$old_dir" != "x$whole_dir"; then
894 $LN_S $srcdir/irssi-version.h irssi-version.h
896 if test "x$want_perl" != "xno"; then
898 for i in $whole_dir/src/perl/common $whole_dir/src/perl/irc $whole_dir/src/perl/ui $whole_dir/src/perl/textui; do
899 subdirfiles=`echo $subdirfiles $i/typemap $i/module.h $i/*.pm $i/*.xs`
901 for file in $whole_dir/src/perl/*.[[ch]] $whole_dir/src/perl/libperl_orig.la $whole_dir/src/perl/libperl_dynaloader.la $subdirfiles; do
902 link=`echo $file|$sedpath "s?$whole_dir/??"`
911 if test "x$want_textui" = "xno"; then
913 elif test "x$want_termcap" = "xyes"; then
914 text="yes, using termcap"
915 elif test "x$want_terminfo" = "xyes"; then
916 text="yes, using terminfo"
918 text="yes, using curses"
920 echo "Building text frontend ..... : $text"
921 echo "Building irssi bot ......... : $want_irssibot"
922 echo "Building irssi proxy ....... : $want_irssiproxy"
923 echo "Building with IPv6 support . : $want_ipv6"
924 if test "x$have_gmodule" = "xyes"; then
925 echo "Building with module support : yes"
927 echo "Building with module support : NO!! /LOAD will not work!"
928 echo " - You're missing gmodule (comes with glib) for some reason,"
929 echo " or it doesn't work in your system."
932 if test "x$want_perl" = "xstatic"; then
933 echo "Building with Perl support . : static (in irssi binary)"
934 elif test "x$want_perl" = "xmodule"; then
935 echo "Building with Perl support . : module"
937 if test -z "$perl_check_error"; then
938 echo "Building with Perl support . : no"
940 echo "Building with Perl support . : NO!"
941 echo " - $perl_check_error"
945 if test "x$want_perl" != "xno" -a "x$perl_mod_error" != "x"; then
946 echo " - NOTE: Perl support will be compiled statically to irssi, not as"
947 echo " a module as requested. Reason:"
948 echo " $perl_mod_error"
950 if test -f /etc/debian_version; then
951 echo " - Try: apt-get install libperl-dev"
955 if test "x$want_perl" != "xno"; then
956 if test "$perl_library_dir" = "PERL_USE_LIB"; then
957 perl_library_dir=$PERL_USE_LIB
959 if test -z "$perl_library_dir"; then
960 perl_library_dir="(site default - `$perlpath -e 'use Config; print $Config{sitearch}'`)"
962 echo "Perl library directory ..... : $perl_library_dir"
963 if test "x$perl_prefix_note" = "xyes"; then
964 echo " - NOTE: This was automatically set to the same directory you gave with"
965 echo " --prefix. If you want the perl libraries to install to their 'correct'"
966 echo " path, you'll need to give --with-perl-lib=site option to configure."
967 echo " Anyway, installing perl to this directory should work just as well."
971 echo "Install prefix ............. : $prefix"
974 echo "If there was any problems, read the INSTALL file."