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])
28 #${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
29 #$libtool_flags --disable-static --output=libtool-shared --no-verify
30 #$ac_aux_dir/ltmain.sh $lt_target \
31 #|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
32 #${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
33 #$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
34 #|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
36 AC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h sys/ioctl.h libintl.h)
38 # check posix headers..
39 AC_CHECK_HEADERS(sys/time.h sys/utsname.h regex.h)
42 [ --with-big5 Build with tr-Chinese Big5 support],
43 if test x$withval = xyes; then
46 if test "x$withval" = xno; then
55 [ --with-socks Build with socks support],
56 if test x$withval = xyes; then
59 if test "x$withval" = xno; then
68 [ --with-textui Build text frontend],
69 if test x$withval = xyes; then
72 if test "x$withval" = xno; then
81 [ --with-bot Build irssi-bot],
82 if test x$withval = xyes; then
85 if test "x$withval" = xno; then
94 [ --with-proxy Build irssi-proxy],
95 if test x$withval = xyes; then
98 if test "x$withval" = xno; then
108 [ --with-modules Specify what modules to build in binary],
109 if test x$withval != xyes -a x$withval != xno; then
110 build_modules="$withval"
113 if test "x$prefix" = "xNONE"; then
116 PERL_LIB_DIR="$prefix"
119 AC_ARG_ENABLE(perl-path,
120 [ --enable-perl-path=dir Specify where to install the Perl libraries for irssi],
121 if test x$enableval = xyes; then
124 if test "x$enableval" = xno; then
128 PERL_LIB_DIR="$enableval"
129 perl_lib_dir_given=yes
135 [ --enable-perl[=yes|no|static] Build with Perl support - also specifies
136 if it should be built into main irssi binary
137 (static) or as module (default)],
138 if test x$enableval = xyes; then
140 elif test x$enableval = xstatic; then
148 [ --with-tests Run all the tests],
149 if test x$withval != xno; then
155 AC_ARG_ENABLE(curses-windows,
156 [ --enable-curses-windows Use curses windows],
157 if test x$enableval != xno; then
158 AC_DEFINE(USE_CURSES_WINDOWS)
160 AC_DEFINE(USE_CURSES_WINDOWS))
162 AC_ARG_ENABLE(memdebug,
163 [ --enable-memdebug Enable memory debugging],
164 if test x$enableval = xyes; then
167 if test "x$enableval" = xno; then
176 [ --enable-ipv6 Enable IPv6 support],
177 if test x$enableval = xyes; then
180 if test "x$enableval" = xno; then
189 dnl ** just some generic stuff...
192 AC_CHECK_FUNCS(mkfifo fcntl)
194 AC_CHECK_LIB(socket, socket, [
195 PROG_LIBS="$PROG_LIBS -lsocket"
198 AC_CHECK_LIB(nsl, inet_addr, [
199 PROG_LIBS="$PROG_LIBS -lnsl"
202 dnl * gcc specific options
203 if test "x$ac_cv_prog_gcc" = "xyes"; then
204 CFLAGS="$CFLAGS -Wall"
207 dnl * OS specific options
210 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
216 dnl * socklen_t - AC_CHECK_TYPE() would be _really_ useful if it only would
217 dnl * accept header files where to find the typedef..
218 AC_MSG_CHECKING([for socklen_t])
219 AC_CACHE_VAL(irssi_cv_type_socklen_t,
221 #include <sys/types.h>
222 #include <sys/socket.h>],
224 irssi_cv_type_socklen_t=yes,
225 irssi_cv_type_socklen_t=no,
227 if test $irssi_cv_type_socklen_t = no; then
228 AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
230 AC_MSG_RESULT($irssi_cv_type_socklen_t)
233 dnl ** check for socks
236 if test "x$want_socks" = "xyes"; then
237 AC_CHECK_LIB(socks, connect, [
238 PROG_LIBS="$PROG_LIBS -lsocks"
239 AC_CHECK_HEADER(socks.h, [
240 AC_DEFINE(HAVE_SOCKS_H)
241 CFLAGS="$CFLAGS -DSOCKS"
242 AC_MSG_RESULT(["socks5 library found, building with it"])
244 AC_MSG_RESULT(["socks4 library found, building with it"])
245 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dgetpeername=Rgetpeername -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
251 dnl ** fe-text checks
254 AC_PATH_PROG(sedpath, sed)
256 AC_DEFUN(AC_CHECK_GLIBDIR,[
257 AC_MSG_CHECKING([whether GLib is unpacked to irssi dir])
259 GLIB_DIR=`for d in *; do test -f $d/glib.h && echo $d; done`
260 if test "x$GLIB_DIR" != "x"; then
261 dnl * glib in irssi directory, use it
262 AC_MSG_RESULT([yes, using it])
264 dnl * we have to do this at this point so we know what libs gmodule needs
265 if test ! -f $GLIB_DIR/.libs/libglib.a; then
267 echo "configuring GLib ..."
270 if test ! -f glib-config; then
278 GLIB_LDEXTRA=`$GLIB_DIR/glib-config --libs gmodule|$sedpath -e 's/-lglib//' -e 's/-lgmodule//' -e 's,-L/usr/local/lib ,,'|$sedpath 's/ \+/ /g'`
279 full_glib_dir="`pwd`/$GLIB_DIR"
280 GLIB_CFLAGS="-I$full_glib_dir -I$full_glib_dir/gmodule"
281 if test -f $full_glib_dir/.libs/libglib.a; then
282 GLIB_LIBS="$full_glib_dir/.libs/libglib.a $GLIB_LDEXTRA"
283 if test -f $full_glib_dir/gmodule/.libs/libgmodule.a; then
284 GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/.libs/libgmodule.a"
285 AC_DEFINE(HAVE_GMODULE)
288 GLIB_LIBS="$full_glib_dir/libglib.a $GLIB_LDEXTRA"
289 if test -f $full_glib_dir/gmodule/libgmodule.a; then
290 GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/libgmodule.a"
291 AC_DEFINE(HAVE_GMODULE)
294 AC_SUBST(GLIB_CFLAGS)
303 if test "x$GLIB_DIR" = "x"; then
304 AM_PATH_GLIB(1.2.0,,, gmodule)
305 if test "x$GLIB_LIBS" = "x"; then
306 echo "*** trying without -lgmodule"
310 AC_DEFINE(HAVE_GMODULE)
313 if test "x$GLIB_LIBS" = "x"; then
315 echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org"
316 echo "*** If you can't install GLIB anywhere or if you don't want to,"
317 echo "*** you can just unpack it to Irssi's source directory and"
318 echo "*** Irssi will automatically compile and use it."
321 dnl * I think it's pretty safe to assume GLib 1.2.9 since the next
322 dnl * will be 2.0 (or 1.4?) and it's not sure if irssi compiles
323 dnl * with it (yea, just a few weeks after I put this text for 1.2.8
324 dnl * the 1.2.9 came :) .. and then .10
325 glib_file=glib-1.2.10.tar.gz
328 if test "x`ncftpget 2>/dev/null|grep -i ncftp`" != "x"; then
329 dlcmd="ncftpget ftp://ftp.gtk.org/pub/gtk/v1.2/$glib_file"
331 if test "x`wget 2>/dev/null|grep -i wget`" != "x"; then
332 dlcmd="wget http://irssi.org/files/$glib_file"
334 if test "x$dlcmd" != "x"; then
335 echo "*** I can download GLib for you now. If you don't want to, press CTRL-C now."
338 if `gunzip $glib_file`; then
339 glib_file=`echo $glib_file|$sedpath s/\.gz$//`
340 if `tar xf $glib_file`; then
347 if test "x$GLIB_LIBS" = "x"; then
348 AC_ERROR([GLIB is required to build irssi.])
353 PROG_LIBS="$PROG_LIBS $GLIB_LIBS"
356 dnl ** check if we can link dynamic libraries to modules
357 dnl ** also checks if libraries are built to .libs dir
360 AC_MSG_CHECKING([if we can link dynamic libraries with modules])
363 dnl ** compile object file
364 cat > conftest.c <<EOF
366 int modfunc(void){return (int)floor(1.2);}
369 ./libtool --mode=compile $CC $CFLAGS -c conftest.c 2> /dev/null > /dev/null
370 if test ! -s conftest.lo; then
371 AC_ERROR([error compiling test module])
374 dnl ** link to library
375 ./libtool --mode=link $CC $CFLAGS $LDFLAGS -rpath /usr/lib conftest.lo -lm -o libconftest.la > /dev/null
376 if test ! -s .libs/libconftest.a; then
377 AC_ERROR([error, can't even find .a library])
380 dnl ** check if dynamic linking worked
381 libfile=`grep '^library_names' libconftest.la|$sedpath "s/library_names='\(.*\)'.*/\1/"|$sedpath 's/.* \([[^ ]]*\)$/\1/'`
382 if test ! -s .libs/$libfile; then
383 AC_MSG_RESULT([no, error linking test module])
385 cat > conftest.c <<EOF
388 GModule *m; int (*modfunc)(void);
389 m = g_module_open(".libs/$libfile", 0);
390 if (!m) g_print("error loading: %s", g_module_error());
391 else if (!g_module_symbol(m, "modfunc", (gpointer *) &modfunc))
392 g_print("modfunc() symbol not found from module");
393 else if (modfunc() == 1) g_print("ok"); else g_print("wrong result?! 1 vs %d", modfunc());
396 $CC $CFLAGS conftest.c -o conftest $GLIB_CFLAGS $GLIB_LIBS 2> /dev/null > /dev/null
397 if test ! -s conftest; then
398 AC_MSG_RESULT([no, error compiling test program])
400 status="`./conftest`"
401 if test "x$status" = "xok"; then
405 AC_MSG_RESULT([no, error running: $status])
409 rm -rf conftest conftest.* libconftest.* .libs
415 dnl Curses detection: Munged from Midnight Commander's configure.in
420 dnl - Determine which version of curses is installed on your system
421 dnl and set the -I/-L/-l compiler entries and add a few preprocessor
423 dnl - Do an AC_SUBST on the CURSES_INCLUDEDIR and CURSES_LIBS so that
424 dnl @CURSES_INCLUDEDIR@ and @CURSES_LIBS@ will be available in
426 dnl - Modify the following configure variables (these are the only
427 dnl curses.m4 variables you can access from within configure.in)
428 dnl CURSES_INCLUDEDIR - contains -I's and possibly -DRENAMED_CURSES if
429 dnl an ncurses.h that's been renamed to curses.h
431 dnl CURSES_LIBS - sets -L and -l's appropriately
432 dnl CFLAGS - if --with-sco, add -D_SVID3
433 dnl has_curses - exports result of tests to rest of configure
437 dnl 1) Add lines indicated below to acconfig.h
438 dnl 2) call AC_CHECK_CURSES after AC_PROG_CC in your configure.in
439 dnl 3) Instead of #include <curses.h> you should use the following to
440 dnl properly locate ncurses or curses header file
442 dnl #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
443 dnl #include <ncurses.h>
445 dnl #include <curses.h>
448 dnl 4) Make sure to add @CURSES_INCLUDEDIR@ to your preprocessor flags
449 dnl 5) Make sure to add @CURSES_LIBS@ to your linker flags or LIBS
451 dnl Notes with automake:
452 dnl - call AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true) from
454 dnl - your Makefile.am can look something like this
455 dnl -----------------------------------------------
456 dnl INCLUDES= blah blah blah $(CURSES_INCLUDEDIR)
458 dnl CURSES_TARGETS=name_of_curses_prog
460 dnl bin_PROGRAMS = other_programs $(CURSES_TARGETS)
461 dnl other_programs_SOURCES = blah blah blah
462 dnl name_of_curses_prog_SOURCES = blah blah blah
463 dnl other_programs_LDADD = blah
464 dnl name_of_curses_prog_LDADD = blah $(CURSES_LIBS)
465 dnl -----------------------------------------------
468 dnl The following lines should be added to acconfig.h:
469 dnl ==================================================
471 dnl /*=== Curses version detection defines ===*/
472 dnl /* Found some version of curses that we're going to use */
473 dnl #undef HAS_CURSES
475 dnl /* Use SunOS SysV curses? */
476 dnl #undef USE_SUNOS_CURSES
478 dnl /* Use old BSD curses - not used right now */
479 dnl #undef USE_BSD_CURSES
481 dnl /* Use SystemV curses? */
482 dnl #undef USE_SYSV_CURSES
484 dnl /* Use Ncurses? */
485 dnl #undef USE_NCURSES
487 dnl /* If you Curses does not have color define this one */
488 dnl #undef NO_COLOR_CURSES
490 dnl /* Define if you want to turn on SCO-specific code */
491 dnl #undef SCO_FLAVOR
493 dnl /* Set to reflect version of ncurses *
494 dnl * 0 = version 1.*
495 dnl * 1 = version 1.9.9g
496 dnl * 2 = version 4.0/4.1 */
497 dnl #undef NCURSES_970530
499 dnl /*=== End new stuff for acconfig.h ===*/
503 AC_DEFUN(AC_CHECK_CURSES,[
510 AC_SUBST(CURSES_LIBS)
511 AC_SUBST(CURSES_INCLUDEDIR)
514 [ --with-sco Use this to turn on SCO-specific code],[
515 if test x$withval = xyes; then
516 AC_DEFINE(SCO_FLAVOR)
517 CFLAGS="$CFLAGS -D_SVID3"
521 AC_ARG_WITH(sunos-curses,
522 [ --with-sunos-curses Used to force SunOS 4.x curses],[
523 if test x$withval = xyes; then
528 AC_ARG_WITH(osf1-curses,
529 [ --with-osf1-curses Used to force OSF/1 curses],[
530 if test x$withval = xyes; then
536 [ --with-vcurses[=incdir] Used to force SysV curses],
537 if test x$withval != xyes; then
538 CURSES_INCLUDEDIR="-I$withval"
544 [ --with-ncurses[=dir] Compile with ncurses/locate base dir],
545 if test x$withval = xno ; then
547 elif test x$withval != xyes ; then
548 AC_NCURSES($withval/include, ncurses.h, -L$withval/lib -lncurses, -I$withval/include, "ncurses on $withval/include")
559 AC_DEFUN(AC_USE_SUNOS_CURSES, [
561 screen_manager="SunOS 4.x /usr/5include curses"
562 AC_MSG_RESULT(Using SunOS 4.x /usr/5include curses)
563 AC_DEFINE(USE_SUNOS_CURSES)
564 AC_DEFINE(HAS_CURSES)
566 AC_DEFINE(NO_COLOR_CURSES)
567 AC_DEFINE(USE_SYSV_CURSES)
568 CURSES_INCLUDEDIR="-I/usr/5include"
569 CURSES_LIBS="/usr/5lib/libcurses.a /usr/5lib/libtermcap.a"
570 AC_MSG_RESULT(Please note that some screen refreshs may fail)
573 AC_DEFUN(AC_USE_OSF1_CURSES, [
574 AC_MSG_RESULT(Using OSF1 curses)
576 screen_manager="OSF1 curses"
577 AC_DEFINE(HAS_CURSES)
579 AC_DEFINE(NO_COLOR_CURSES)
580 AC_DEFINE(USE_SYSV_CURSES)
581 CURSES_LIBS="-lcurses"
584 AC_DEFUN(AC_USE_SYSV_CURSES, [
585 AC_MSG_RESULT(Using SysV curses)
586 AC_DEFINE(HAS_CURSES)
588 AC_DEFINE(USE_SYSV_CURSES)
590 screen_manager="SysV/curses"
591 CURSES_LIBS="-lcurses"
594 dnl AC_ARG_WITH(bsd-curses,
595 dnl [--with-bsd-curses Used to compile with bsd curses, not very fancy],
596 dnl search_ncurses=false
597 dnl screen_manager="Ultrix/cursesX"
598 dnl if test $system = ULTRIX
600 dnl THIS_CURSES=cursesX
602 dnl THIS_CURSES=curses
605 dnl CURSES_LIBS="-l$THIS_CURSES -ltermcap"
606 dnl AC_DEFINE(HAS_CURSES)
608 dnl AC_DEFINE(USE_BSD_CURSES)
609 dnl AC_MSG_RESULT(Please note that some screen refreshs may fail)
610 dnl AC_WARN(Use of the bsdcurses extension has some)
611 dnl AC_WARN(display/input problems.)
612 dnl AC_WARN(Reconsider using xcurses)
617 dnl Parameters: directory filename cureses_LIBS curses_INCLUDEDIR nicename
619 AC_DEFUN(AC_NCURSES, [
624 AC_MSG_RESULT(Found ncurses on $1/$2)
627 AC_CHECK_LIB(ncurses, initscr, [
629 CHECKLIBS=`echo "$3"|sed 's/-lncurses/-lcurses/g'`
630 AC_CHECK_LIB(curses, initscr, [
631 CURSES_LIBS="$CHECKLIBS"
634 CURSES_INCLUDEDIR="$4"
637 AC_DEFINE(HAS_CURSES)
640 AC_DEFINE(USE_NCURSES)
645 AC_DEFUN(AC_SEARCH_NCURSES, [
646 AC_CHECKING("location of ncurses.h file")
648 AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
649 AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
650 AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
651 AC_NCURSES(/usr/pkg/include, ncurses.h, -L/usr/pkg/lib -lncurses, -I/usr/pkg/include, "ncurses on /usr/pkg")
652 AC_NCURSES(/usr/contrib/include, ncurses.h, -L/usr/contrib/lib -lncurses, -I/usr/contrib/include, "ncurses on /usr/contrib")
653 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")
655 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")
657 AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
660 dnl We couldn't find ncurses, try SysV curses
664 AC_EGREP_HEADER(init_color, /usr/include/curses.h,
666 AC_EGREP_CPP(USE_NCURSES,[
673 CURSES_INCLUDEDIR="$CURSES_INCLUDEDIR -DRENAMED_NCURSES"
674 AC_DEFINE(HAS_CURSES)
677 AC_DEFINE(USE_NCURSES)
679 screen_manager="ncurses installed as curses"
684 dnl Try SunOS 4.x /usr/5{lib,include} ncurses
685 dnl The flags USE_SUNOS_CURSES, USE_BSD_CURSES and BUGGY_CURSES
686 dnl should be replaced by a more fine grained selection routine
690 if test -f /usr/5include/curses.h
696 dnl use whatever curses there happens to be
699 if test -f /usr/include/curses.h
701 CURSES_LIBS="-lcurses"
702 AC_DEFINE(HAS_CURSES)
705 screen_manager="curses"
710 if test "x$want_textui" = "xyes"; then
713 if test "x$has_ncurses" != "x"; then
714 AC_CHECK_LIB(ncurses, use_default_colors, [
715 AC_DEFINE(HAVE_NCURSES_USE_DEFAULT_COLORS)
717 AC_CHECK_LIB(ncurses, idcok, [
718 AC_DEFINE(HAVE_CURSES_IDCOK)
720 AC_CHECK_LIB(ncurses, resizeterm, [
721 AC_DEFINE(HAVE_CURSES_RESIZETERM)
723 AC_CHECK_LIB(ncurses, wresize, [
724 AC_DEFINE(HAVE_CURSES_WRESIZE)
726 elif test "x$has_curses" = "xtrue"; then
727 AC_CHECK_LIB(curses, idcok, [
728 AC_DEFINE(HAVE_CURSES_IDCOK)
730 AC_CHECK_LIB(curses, resizeterm, [
731 AC_DEFINE(HAVE_CURSES_RESIZETERM)
733 AC_CHECK_LIB(curses, wresize, [
734 AC_DEFINE(HAVE_CURSES_WRESIZE)
748 if test "$want_perl" != "no"; then
749 AC_PATH_PROG(perlpath, perl)
750 AC_MSG_CHECKING(for working Perl support)
752 if test "x$perlpath" = "x"; then
753 perl_check_error="perl binary not found"
755 PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
758 if test "x$PERL_CFLAGS" = "x"; then
759 perl_check_error="Error getting perl CFLAGS"
760 AC_MSG_RESULT([not found, building without Perl])
763 PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null`
765 dnl * Perl 5.004 and older use perl_xxx variables while
766 dnl * later use PL_perl_xxx variables ..
767 have_pl_perl=`$perlpath -e 'print $] < 5.005 ? "no" : "yes";'`
768 if test "x$have_pl_perl" = "xyes"; then
769 AC_DEFINE(HAVE_PL_PERL)
772 if test "x$DYNLIB_MODULES" = "xno" -a "$want_perl" != "static"; then
773 dnl * wanted perl as module, won't get it.
775 perl_mod_error="Dynamic library dependencies don't work with modules"
778 if test "$want_perl" != "static"; then
779 dnl * dynaloader.a -> libperl_dynaloader.la
780 DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
783 dnl * don't check libperl.a if dynaloader.a wasn't found..
784 if test "x$DYNALOADER_A" != "x"; then
785 dnl * find either libperl.a or libperl.so
786 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 } } };'`
787 if test "x$LIBPERL_A" = "x"; then
788 perl_mod_error="Didn't find location of -lperl"
790 elif test "$LIBPERL_A" = "-lperl"; then
795 dnl * remove all database stuffs
796 dnl * nsl is already in ldflags
797 dnl * libc is of course linked without needing -lc
798 dnl * -rdynamic must not be in LIBADD line
799 for word in -ldb -ldbm -lndbm -lgdbm -lc -rdynamic; do
800 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e "s/$word //" -e "s/$word$//"`
805 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lposix //' -e 's/-lposix$//'`
808 if test "x$ac_cv_prog_gcc" = "xyes"; then
809 PERL_CFLAGS=`echo $PERL_CFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
810 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
817 dnl * check that perl's ldflags actually work
818 AC_CACHE_VAL(irssi_cv_lib_perl_works, [
819 echo "main(){perl_alloc(); return 0;}" > conftest.c
820 $CC $CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> /dev/null > /dev/null
821 if test -s conftest; then
822 irssi_cv_lib_perl_works=yes
824 irssi_cv_lib_perl_works=no
828 if test "x$irssi_cv_lib_perl_works" = "xno"; then
829 perl_check_error="Error linking with perl libraries: $PERL_LDFLAGS"
830 AC_MSG_RESULT([error linking with perl libraries, building without Perl])
835 if test "x$want_perl" != "xno"; then
836 if test "x$want_perl" = "xstatic"; then
838 elif test "x$DYNALOADER_A" = "x"; then
839 AC_MSG_RESULT([error parsing ldopts, building Perl into irssi binary instead of as module])
843 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
844 if test "x$LIBPERL_A" != "x"; then
845 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lperl /libperl_orig.la /' -e 's/-lperl$/libperl_orig.la$/'`
848 AC_SUBST(DYNALOADER_A)
851 if test "x$want_perl" = "xstatic"; then
852 dnl * building with static perl support
853 dnl * all PERL_LDFLAGS linking is done in fe-text
854 PERL_LDFLAGS="../perl/libperl_static.la $PERL_LDFLAGS"
855 PERL_LINK_LIBS="$PERL_LDFLAGS"
856 PERL_FE_LINK_LIBS="../perl/libfe_perl_static.la"
858 AC_DEFINE(HAVE_STATIC_PERL)
860 dnl * build only static library of perl module
863 perl_static_lib=libperl_static.la
864 perl_static_fe_lib=libfe_perl_static.la
865 PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool'
867 dnl * build dynamic library of perl module,
868 dnl * use libtool-shared to prevent creating of
870 perl_module_lib=libperl_core.la
871 perl_module_fe_lib=libfe_perl.la
874 PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool-shared'
876 AC_SUBST(perl_module_lib)
877 AC_SUBST(perl_static_lib)
878 AC_SUBST(perl_module_fe_lib)
879 AC_SUBST(perl_static_fe_lib)
880 AC_SUBST(PERL_LIBTOOL)
882 AC_SUBST(PERL_LINK_LIBS)
883 AC_SUBST(PERL_FE_LINK_LIBS)
885 AC_SUBST(PERL_LDFLAGS)
886 AC_SUBST(PERL_CFLAGS)
887 AC_SUBST(PERL_LIB_DIR)
891 dnl ** check what we want to build
892 AM_CONDITIONAL(BUILD_TEXTUI, test "$want_textui" = "yes")
893 AM_CONDITIONAL(BUILD_IRSSIBOT, test "$want_irssibot" = "yes")
894 AM_CONDITIONAL(BUILD_IRSSIPROXY, test "$want_irssiproxy" = "yes")
895 AM_CONDITIONAL(BUILD_PLUGINS, test "$want_plugins" = "yes")
896 AM_CONDITIONAL(BUILD_SERVERTEST, test "x$TEST_DIR" != "x")
897 AM_CONDITIONAL(HAVE_PERL, test "$want_perl" != "no")
898 AM_CONDITIONAL(HAVE_STATIC_PERL, test "$want_perl" = "static")
903 dnl ** Keep all the libraries here so each frontend doesn't need to
904 dnl ** keep track of them all
906 dnl ** (these could be made configurable)
910 if test "x$build_modules" != "x"; then
911 silc_MODULES="$silc_MODULES $build_modules"
913 #PROG_LIBS="$PROG_LIBS -lsilc"
915 dnl ****************************************
917 AC_SUBST(CHAT_MODULES)
918 AC_SUBST(silc_MODULES)
920 CORE_LIBS="../core/libcore.a ../lib-config/libirssi_config.a ../lib-popt/libpopt.a"
924 for c in $CHAT_MODULES; do
929 CHAT_LIBS="$CHAT_LIBS ../$c/lib$c.a ../$c/core/lib${c}_core.a"
930 if test -f $srcdir/src/fe-common/$c/module.h; then
931 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/libfe_common_$c.a "
933 for s in `eval echo \\$${c}_MODULES`; do
934 CHAT_LIBS="$CHAT_LIBS ../$c/$s/.libs/lib${c}_$s.a"
935 module_inits="$module_inits ${c}_${s}_init();"
936 module_deinits="${c}_${s}_deinit(); $module_deinits"
937 if test -f $srcdir/src/fe-common/$c/$s/module.h; then
938 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/$s/.libs/libfe_${c}_$s.a "
939 fe_module_inits="$fe_module_inits fe_${c}_${s}_init();"
940 fe_module_deinits="fe_${c}_${s}_deinit(); $fe_module_deinits"
944 file="$srcdir/src/$c/$c.c"
945 echo "/* this file is automatically generated by configure - don't change */" > $file
946 echo "void ${c}_core_init(void); void ${c}_core_init_finish(void); void ${c}_core_deinit(void);" >> $file
947 if test "x$module_inits" != "x"; then
948 echo "$module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
949 echo "$module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
951 echo "void ${c}_init(void) { ${c}_core_init(); $module_inits }" >> $file
952 echo "void ${c}_init_finish(void) { ${c}_core_init_finish(); $module_inits }" >> $file
953 echo "void ${c}_deinit(void) { $module_deinits ${c}_core_deinit(); }" >> $file
955 if test -f $srcdir/src/fe-common/$c/module.h; then
956 file="$srcdir/src/fe-common/$c/${c}-modules.c"
957 echo "/* this file is automatically generated by configure - don't change */" > $file
958 if test "x$fe_module_inits" != "x"; then
959 echo "$fe_module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
960 echo "$fe_module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
962 echo "void fe_${c}_modules_init(void) { $fe_module_inits }" >> $file
963 echo "void fe_${c}_modules_deinit(void) { $fe_module_deinits }" >> $file
967 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/core/libfe_common_core.a"
969 dnl ** common libraries needed by frontends
970 COMMON_NOUI_LIBS="$CHAT_LIBS $CORE_LIBS $INTLLIBS"
971 COMMON_LIBS="$FE_COMMON_LIBS $COMMON_NOUI_LIBS"
972 AC_SUBST(COMMON_NOUI_LIBS)
973 AC_SUBST(COMMON_LIBS)
976 dnl ** memory debugging
979 if test "x$want_memdebug" = "xyes"; then
982 AM_CONDITIONAL(BUILD_MEMDEBUG, test "x$want_memdebug" = "xyes")
985 dnl ** tr-Chinese Big5 support
988 if test "x$want_big5" = "xyes"; then
996 if test "x$want_ipv6" = "xyes"; then
1000 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1001 AC_SUBST(INCLUDE_DEFINES_INT)
1007 src/fe-common/Makefile
1008 src/fe-common/core/Makefile
1009 src/fe-common/silc/Makefile
1010 src/fe-text/Makefile
1011 src/lib-config/Makefile
1012 src/lib-popt/Makefile
1014 src/silc/core/Makefile
1017 docs/help/in/Makefile
1023 dnl ** for building from objdir
1024 if test "x$want_perl" != "xno"; then
1025 old_dir=`pwd` && cd $srcdir && whole_dir=`pwd` && cd $old_dir
1027 if test "x$old_dir" != "x$whole_dir"; then
1028 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
1029 link=`echo $file|$sedpath "s?$whole_dir/??"`
1038 if test "x$curses_error" != "xyes"; then
1039 echo "Building text frontend ..... : $want_textui"
1041 echo "Building text frontend ..... : NO!!"
1042 echo " - Because curses was not found, specify the path to it with"
1043 echo " --with-curses=/dir and make sure you have the curses headers"
1044 echo " installed (usually in ncurses-devel package)"
1046 echo "Building irssi bot ......... : $want_irssibot"
1047 echo "Building irssi proxy ....... : $want_irssiproxy"
1048 echo "Building with IPv6 support . : $want_ipv6"
1050 if test "x$want_perl" = "xstatic"; then
1051 echo "Building with Perl support . : static (in irssi binary)"
1052 elif test "x$want_perl" = "xyes"; then
1053 echo "Building with Perl support . : module"
1055 if test "x$perl_check_error" = "x"; then
1056 echo "Building with Perl support . : no"
1058 echo "Building with Perl support . : NO!"
1059 echo " - $perl_check_error"
1063 if test "x$want_perl" != "xno" -a "x$perl_mod_error" != "x"; then
1064 echo " - NOTE: Perl support will be compiled statically to irssi, not as"
1065 echo " a module as requested. Reason:"
1066 echo " $perl_mod_error"
1069 if test "x$want_perl" = "xyes"; then
1070 if test "x$PERL_LIB_DIR" = "x"; then
1071 echo "Perl library directory ..... : (default - usually /usr/local/lib/perl_site)"
1073 echo "Perl library directory ..... : $PERL_LIB_DIR"
1074 if test "x$perl_lib_dir_given" != "xyes"; then
1075 echo " - NOTE: This was automatically set to the same directory you gave with"
1076 echo " --prefix. If you want the perl libraries to install to their 'correct'"
1077 echo " path, you'll need to give --enable-perl-path= (nothing after '=') option"
1078 echo " to configure. Anyway, installing perl to this directory should work"
1079 echo " just as well.."
1083 echo "Install prefix ............. : $prefix"