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 #${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
31 #$libtool_flags --disable-static --output=libtool-shared --no-verify
32 #$ac_aux_dir/ltmain.sh $lt_target \
33 #|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
34 #${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
35 #$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
36 #|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
38 AC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h sys/ioctl.h libintl.h)
40 # check posix headers..
41 AC_CHECK_HEADERS(sys/time.h sys/utsname.h regex.h)
44 [ --with-big5 Build with tr-Chinese Big5 support],
45 if test x$withval = xyes; then
48 if test "x$withval" = xno; then
57 [ --with-socks Build with socks support],
58 if test x$withval = xyes; then
61 if test "x$withval" = xno; then
70 [ --with-textui Build text frontend],
71 if test x$withval = xyes; then
74 if test "x$withval" = xno; then
83 [ --with-bot Build irssi-bot],
84 if test x$withval = xyes; then
87 if test "x$withval" = xno; then
96 [ --with-proxy Build irssi-proxy],
97 if test x$withval = xyes; then
100 if test "x$withval" = xno; then
110 [ --with-modules Specify what modules to build in binary],
111 if test x$withval != xyes -a x$withval != xno; then
112 build_modules="$withval"
115 if test "x$prefix" = "xNONE"; then
118 PERL_LIB_DIR="$prefix"
121 AC_ARG_ENABLE(perl-path,
122 [ --enable-perl-path=dir Specify where to install the Perl libraries for irssi],
123 if test x$enableval = xyes; then
126 if test "x$enableval" = xno; then
130 PERL_LIB_DIR="$enableval"
131 perl_lib_dir_given=yes
137 [ --enable-perl[=yes|no|static] Build with Perl support - also specifies
138 if it should be built into main irssi binary
139 (static) or as module (default)],
140 if test x$enableval = xyes; then
142 elif test x$enableval = xstatic; then
150 [ --with-tests Run all the tests],
151 if test x$withval != xno; then
157 AC_ARG_ENABLE(curses-windows,
158 [ --enable-curses-windows Use curses windows],
159 if test x$enableval != xno; then
160 AC_DEFINE(USE_CURSES_WINDOWS)
162 AC_DEFINE(USE_CURSES_WINDOWS))
164 AC_ARG_ENABLE(memdebug,
165 [ --enable-memdebug Enable memory debugging],
166 if test x$enableval = xyes; then
169 if test "x$enableval" = xno; then
178 [ --enable-ipv6 Enable IPv6 support],
179 if test x$enableval = xyes; then
182 if test "x$enableval" = xno; then
191 dnl ** just some generic stuff...
194 AC_CHECK_FUNCS(mkfifo fcntl)
196 AC_CHECK_LIB(socket, socket, [
197 PROG_LIBS="$PROG_LIBS -lsocket"
200 AC_CHECK_LIB(nsl, inet_addr, [
201 PROG_LIBS="$PROG_LIBS -lnsl"
204 dnl * gcc specific options
205 if test "x$ac_cv_prog_gcc" = "xyes"; then
206 CFLAGS="$CFLAGS -Wall"
209 dnl * OS specific options
212 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
218 dnl * socklen_t - AC_CHECK_TYPE() would be _really_ useful if it only would
219 dnl * accept header files where to find the typedef..
220 AC_MSG_CHECKING([for socklen_t])
221 AC_CACHE_VAL(irssi_cv_type_socklen_t,
223 #include <sys/types.h>
224 #include <sys/socket.h>],
226 irssi_cv_type_socklen_t=yes,
227 irssi_cv_type_socklen_t=no,
229 if test $irssi_cv_type_socklen_t = no; then
230 AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
232 AC_MSG_RESULT($irssi_cv_type_socklen_t)
235 dnl ** check for socks
238 if test "x$want_socks" = "xyes"; then
239 AC_CHECK_LIB(socks, connect, [
240 PROG_LIBS="$PROG_LIBS -lsocks"
241 AC_CHECK_HEADER(socks.h, [
242 AC_DEFINE(HAVE_SOCKS_H)
243 CFLAGS="$CFLAGS -DSOCKS"
244 AC_MSG_RESULT(["socks5 library found, building with it"])
246 AC_MSG_RESULT(["socks4 library found, building with it"])
247 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dgetpeername=Rgetpeername -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
253 dnl ** fe-text checks
256 AC_PATH_PROG(sedpath, sed)
258 AC_DEFUN(AC_CHECK_GLIBDIR,[
259 AC_MSG_CHECKING([whether GLib is unpacked to irssi dir])
261 GLIB_DIR=`for d in *; do test -f $d/glib.h && echo $d; done`
262 if test "x$GLIB_DIR" != "x"; then
263 dnl * glib in irssi directory, use it
264 AC_MSG_RESULT([yes, using it])
266 dnl * we have to do this at this point so we know what libs gmodule needs
267 if test ! -f $GLIB_DIR/.libs/libglib.a; then
269 echo "configuring GLib ..."
272 if test ! -f glib-config; then
280 GLIB_LDEXTRA=`$GLIB_DIR/glib-config --libs gmodule|$sedpath -e 's/-lglib//' -e 's/-lgmodule//' -e 's,-L/usr/local/lib ,,'|$sedpath 's/ \+/ /g'`
281 full_glib_dir="`pwd`/$GLIB_DIR"
282 GLIB_CFLAGS="-I$full_glib_dir -I$full_glib_dir/gmodule"
283 if test -f $full_glib_dir/.libs/libglib.a; then
284 GLIB_LIBS="$full_glib_dir/.libs/libglib.a $GLIB_LDEXTRA"
285 if test -f $full_glib_dir/gmodule/.libs/libgmodule.a; then
286 GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/.libs/libgmodule.a"
287 AC_DEFINE(HAVE_GMODULE)
290 GLIB_LIBS="$full_glib_dir/libglib.a $GLIB_LDEXTRA"
291 if test -f $full_glib_dir/gmodule/libgmodule.a; then
292 GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/libgmodule.a"
293 AC_DEFINE(HAVE_GMODULE)
296 AC_SUBST(GLIB_CFLAGS)
305 if test "x$GLIB_DIR" = "x"; then
306 AM_PATH_GLIB(1.2.0,,, gmodule)
307 if test "x$GLIB_LIBS" = "x"; then
308 echo "*** trying without -lgmodule"
312 AC_DEFINE(HAVE_GMODULE)
315 if test "x$GLIB_LIBS" = "x"; then
317 echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org"
318 echo "*** If you can't install GLIB anywhere or if you don't want to,"
319 echo "*** you can just unpack it to Irssi's source directory and"
320 echo "*** Irssi will automatically compile and use it."
323 dnl * I think it's pretty safe to assume GLib 1.2.9 since the next
324 dnl * will be 2.0 (or 1.4?) and it's not sure if irssi compiles
325 dnl * with it (yea, just a few weeks after I put this text for 1.2.8
326 dnl * the 1.2.9 came :) .. and then .10
327 glib_file=glib-1.2.10.tar.gz
330 if test "x`ncftpget 2>/dev/null|grep -i ncftp`" != "x"; then
331 dlcmd="ncftpget ftp://ftp.gtk.org/pub/gtk/v1.2/$glib_file"
333 if test "x`wget 2>/dev/null|grep -i wget`" != "x"; then
334 dlcmd="wget http://irssi.org/files/$glib_file"
336 if test "x$dlcmd" != "x"; then
337 echo "*** I can download GLib for you now. If you don't want to, press CTRL-C now."
340 if `gunzip $glib_file`; then
341 glib_file=`echo $glib_file|$sedpath s/\.gz$//`
342 if `tar xf $glib_file`; then
349 if test "x$GLIB_LIBS" = "x"; then
350 AC_ERROR([GLIB is required to build irssi.])
355 PROG_LIBS="$PROG_LIBS $GLIB_LIBS"
358 dnl ** check if we can link dynamic libraries to modules
359 dnl ** also checks if libraries are built to .libs dir
362 AC_MSG_CHECKING([if we can link dynamic libraries with modules])
365 dnl ** compile object file
366 cat > conftest.c <<EOF
368 int modfunc(void){return (int)floor(1.2);}
371 ./libtool --mode=compile $CC $CFLAGS -c conftest.c 2> /dev/null > /dev/null
372 if test ! -s conftest.lo; then
373 AC_ERROR([error compiling test module])
376 dnl ** link to library
377 ./libtool --mode=link $CC $CFLAGS $LDFLAGS -rpath /usr/lib conftest.lo -lm -o libconftest.la > /dev/null
378 if test ! -s .libs/libconftest.a; then
379 AC_ERROR([error, can't even find .a library])
382 dnl ** check if dynamic linking worked
383 libfile=`grep '^library_names' libconftest.la|$sedpath "s/library_names='\(.*\)'.*/\1/"|$sedpath 's/.* \([[^ ]]*\)$/\1/'`
384 if test ! -s .libs/$libfile; then
385 AC_MSG_RESULT([no, error linking test module])
387 cat > conftest.c <<EOF
390 GModule *m; int (*modfunc)(void);
391 m = g_module_open(".libs/$libfile", 0);
392 if (!m) g_print("error loading: %s", g_module_error());
393 else if (!g_module_symbol(m, "modfunc", (gpointer *) &modfunc))
394 g_print("modfunc() symbol not found from module");
395 else if (modfunc() == 1) g_print("ok"); else g_print("wrong result?! 1 vs %d", modfunc());
398 $CC $CFLAGS conftest.c -o conftest $GLIB_CFLAGS $GLIB_LIBS 2> /dev/null > /dev/null
399 if test ! -s conftest; then
400 AC_MSG_RESULT([no, error compiling test program])
402 status="`./conftest`"
403 if test "x$status" = "xok"; then
407 AC_MSG_RESULT([no, error running: $status])
411 rm -rf conftest conftest.* libconftest.* .libs
417 dnl Curses detection: Munged from Midnight Commander's configure.in
422 dnl - Determine which version of curses is installed on your system
423 dnl and set the -I/-L/-l compiler entries and add a few preprocessor
425 dnl - Do an AC_SUBST on the CURSES_INCLUDEDIR and CURSES_LIBS so that
426 dnl @CURSES_INCLUDEDIR@ and @CURSES_LIBS@ will be available in
428 dnl - Modify the following configure variables (these are the only
429 dnl curses.m4 variables you can access from within configure.in)
430 dnl CURSES_INCLUDEDIR - contains -I's and possibly -DRENAMED_CURSES if
431 dnl an ncurses.h that's been renamed to curses.h
433 dnl CURSES_LIBS - sets -L and -l's appropriately
434 dnl CFLAGS - if --with-sco, add -D_SVID3
435 dnl has_curses - exports result of tests to rest of configure
439 dnl 1) Add lines indicated below to acconfig.h
440 dnl 2) call AC_CHECK_CURSES after AC_PROG_CC in your configure.in
441 dnl 3) Instead of #include <curses.h> you should use the following to
442 dnl properly locate ncurses or curses header file
444 dnl #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
445 dnl #include <ncurses.h>
447 dnl #include <curses.h>
450 dnl 4) Make sure to add @CURSES_INCLUDEDIR@ to your preprocessor flags
451 dnl 5) Make sure to add @CURSES_LIBS@ to your linker flags or LIBS
453 dnl Notes with automake:
454 dnl - call AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true) from
456 dnl - your Makefile.am can look something like this
457 dnl -----------------------------------------------
458 dnl INCLUDES= blah blah blah $(CURSES_INCLUDEDIR)
460 dnl CURSES_TARGETS=name_of_curses_prog
462 dnl bin_PROGRAMS = other_programs $(CURSES_TARGETS)
463 dnl other_programs_SOURCES = blah blah blah
464 dnl name_of_curses_prog_SOURCES = blah blah blah
465 dnl other_programs_LDADD = blah
466 dnl name_of_curses_prog_LDADD = blah $(CURSES_LIBS)
467 dnl -----------------------------------------------
470 dnl The following lines should be added to acconfig.h:
471 dnl ==================================================
473 dnl /*=== Curses version detection defines ===*/
474 dnl /* Found some version of curses that we're going to use */
475 dnl #undef HAS_CURSES
477 dnl /* Use SunOS SysV curses? */
478 dnl #undef USE_SUNOS_CURSES
480 dnl /* Use old BSD curses - not used right now */
481 dnl #undef USE_BSD_CURSES
483 dnl /* Use SystemV curses? */
484 dnl #undef USE_SYSV_CURSES
486 dnl /* Use Ncurses? */
487 dnl #undef USE_NCURSES
489 dnl /* If you Curses does not have color define this one */
490 dnl #undef NO_COLOR_CURSES
492 dnl /* Define if you want to turn on SCO-specific code */
493 dnl #undef SCO_FLAVOR
495 dnl /* Set to reflect version of ncurses *
496 dnl * 0 = version 1.*
497 dnl * 1 = version 1.9.9g
498 dnl * 2 = version 4.0/4.1 */
499 dnl #undef NCURSES_970530
501 dnl /*=== End new stuff for acconfig.h ===*/
505 AC_DEFUN(AC_CHECK_CURSES,[
512 AC_SUBST(CURSES_LIBS)
513 AC_SUBST(CURSES_INCLUDEDIR)
516 [ --with-sco Use this to turn on SCO-specific code],[
517 if test x$withval = xyes; then
518 AC_DEFINE(SCO_FLAVOR)
519 CFLAGS="$CFLAGS -D_SVID3"
523 AC_ARG_WITH(sunos-curses,
524 [ --with-sunos-curses Used to force SunOS 4.x curses],[
525 if test x$withval = xyes; then
530 AC_ARG_WITH(osf1-curses,
531 [ --with-osf1-curses Used to force OSF/1 curses],[
532 if test x$withval = xyes; then
538 [ --with-vcurses[=incdir] Used to force SysV curses],
539 if test x$withval != xyes; then
540 CURSES_INCLUDEDIR="-I$withval"
546 [ --with-ncurses[=dir] Compile with ncurses/locate base dir],
547 if test x$withval = xno ; then
549 elif test x$withval != xyes ; then
550 AC_NCURSES($withval/include, ncurses.h, -L$withval/lib -lncurses, -I$withval/include, "ncurses on $withval/include")
561 AC_DEFUN(AC_USE_SUNOS_CURSES, [
563 screen_manager="SunOS 4.x /usr/5include curses"
564 AC_MSG_RESULT(Using SunOS 4.x /usr/5include curses)
565 AC_DEFINE(USE_SUNOS_CURSES)
566 AC_DEFINE(HAS_CURSES)
568 AC_DEFINE(NO_COLOR_CURSES)
569 AC_DEFINE(USE_SYSV_CURSES)
570 CURSES_INCLUDEDIR="-I/usr/5include"
571 CURSES_LIBS="/usr/5lib/libcurses.a /usr/5lib/libtermcap.a"
572 AC_MSG_RESULT(Please note that some screen refreshs may fail)
575 AC_DEFUN(AC_USE_OSF1_CURSES, [
576 AC_MSG_RESULT(Using OSF1 curses)
578 screen_manager="OSF1 curses"
579 AC_DEFINE(HAS_CURSES)
581 AC_DEFINE(NO_COLOR_CURSES)
582 AC_DEFINE(USE_SYSV_CURSES)
583 CURSES_LIBS="-lcurses"
586 AC_DEFUN(AC_USE_SYSV_CURSES, [
587 AC_MSG_RESULT(Using SysV curses)
588 AC_DEFINE(HAS_CURSES)
590 AC_DEFINE(USE_SYSV_CURSES)
592 screen_manager="SysV/curses"
593 CURSES_LIBS="-lcurses"
596 dnl AC_ARG_WITH(bsd-curses,
597 dnl [--with-bsd-curses Used to compile with bsd curses, not very fancy],
598 dnl search_ncurses=false
599 dnl screen_manager="Ultrix/cursesX"
600 dnl if test $system = ULTRIX
602 dnl THIS_CURSES=cursesX
604 dnl THIS_CURSES=curses
607 dnl CURSES_LIBS="-l$THIS_CURSES -ltermcap"
608 dnl AC_DEFINE(HAS_CURSES)
610 dnl AC_DEFINE(USE_BSD_CURSES)
611 dnl AC_MSG_RESULT(Please note that some screen refreshs may fail)
612 dnl AC_WARN(Use of the bsdcurses extension has some)
613 dnl AC_WARN(display/input problems.)
614 dnl AC_WARN(Reconsider using xcurses)
619 dnl Parameters: directory filename cureses_LIBS curses_INCLUDEDIR nicename
621 AC_DEFUN(AC_NCURSES, [
626 AC_MSG_RESULT(Found ncurses on $1/$2)
629 AC_CHECK_LIB(ncurses, initscr, [
631 CHECKLIBS=`echo "$3"|sed 's/-lncurses/-lcurses/g'`
632 AC_CHECK_LIB(curses, initscr, [
633 CURSES_LIBS="$CHECKLIBS"
636 CURSES_INCLUDEDIR="$4"
639 AC_DEFINE(HAS_CURSES)
642 AC_DEFINE(USE_NCURSES)
647 AC_DEFUN(AC_SEARCH_NCURSES, [
648 AC_CHECKING("location of ncurses.h file")
650 AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
651 AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
652 AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
653 AC_NCURSES(/usr/pkg/include, ncurses.h, -L/usr/pkg/lib -lncurses, -I/usr/pkg/include, "ncurses on /usr/pkg")
654 AC_NCURSES(/usr/contrib/include, ncurses.h, -L/usr/contrib/lib -lncurses, -I/usr/contrib/include, "ncurses on /usr/contrib")
655 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")
657 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")
659 AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
662 dnl We couldn't find ncurses, try SysV curses
666 AC_EGREP_HEADER(init_color, /usr/include/curses.h,
668 AC_EGREP_CPP(USE_NCURSES,[
675 CURSES_INCLUDEDIR="$CURSES_INCLUDEDIR -DRENAMED_NCURSES"
676 AC_DEFINE(HAS_CURSES)
679 AC_DEFINE(USE_NCURSES)
681 screen_manager="ncurses installed as curses"
686 dnl Try SunOS 4.x /usr/5{lib,include} ncurses
687 dnl The flags USE_SUNOS_CURSES, USE_BSD_CURSES and BUGGY_CURSES
688 dnl should be replaced by a more fine grained selection routine
692 if test -f /usr/5include/curses.h
698 dnl use whatever curses there happens to be
701 if test -f /usr/include/curses.h
703 CURSES_LIBS="-lcurses"
704 AC_DEFINE(HAS_CURSES)
707 screen_manager="curses"
712 if test "x$want_textui" = "xyes"; then
715 if test "x$has_ncurses" != "x"; then
716 AC_CHECK_LIB(ncurses, use_default_colors, [
717 AC_DEFINE(HAVE_NCURSES_USE_DEFAULT_COLORS)
719 AC_CHECK_LIB(ncurses, idcok, [
720 AC_DEFINE(HAVE_CURSES_IDCOK)
722 AC_CHECK_LIB(ncurses, resizeterm, [
723 AC_DEFINE(HAVE_CURSES_RESIZETERM)
725 AC_CHECK_LIB(ncurses, wresize, [
726 AC_DEFINE(HAVE_CURSES_WRESIZE)
728 elif test "x$has_curses" = "xtrue"; then
729 AC_CHECK_LIB(curses, idcok, [
730 AC_DEFINE(HAVE_CURSES_IDCOK)
732 AC_CHECK_LIB(curses, resizeterm, [
733 AC_DEFINE(HAVE_CURSES_RESIZETERM)
735 AC_CHECK_LIB(curses, wresize, [
736 AC_DEFINE(HAVE_CURSES_WRESIZE)
750 if test "$want_perl" != "no"; then
751 AC_PATH_PROG(perlpath, perl)
752 AC_MSG_CHECKING(for working Perl support)
754 if test "x$perlpath" = "x"; then
755 perl_check_error="perl binary not found"
757 PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
760 if test "x$PERL_CFLAGS" = "x"; then
761 perl_check_error="Error getting perl CFLAGS"
762 AC_MSG_RESULT([not found, building without Perl])
765 PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null`
767 dnl * Perl 5.004 and older use perl_xxx variables while
768 dnl * later use PL_perl_xxx variables ..
769 have_pl_perl=`$perlpath -e 'print $] < 5.005 ? "no" : "yes";'`
770 if test "x$have_pl_perl" = "xyes"; then
771 AC_DEFINE(HAVE_PL_PERL)
774 if test "x$DYNLIB_MODULES" = "xno" -a "$want_perl" != "static"; then
775 dnl * wanted perl as module, won't get it.
777 perl_mod_error="Dynamic library dependencies don't work with modules"
780 if test "$want_perl" != "static"; then
781 dnl * dynaloader.a -> libperl_dynaloader.la
782 DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
785 dnl * don't check libperl.a if dynaloader.a wasn't found..
786 if test "x$DYNALOADER_A" != "x"; then
787 dnl * find either libperl.a or libperl.so
788 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 } } };'`
789 if test "x$LIBPERL_A" = "x"; then
790 perl_mod_error="Didn't find location of -lperl"
792 elif test "$LIBPERL_A" = "-lperl"; then
797 dnl * remove all database stuffs
798 dnl * nsl is already in ldflags
799 dnl * libc is of course linked without needing -lc
800 dnl * -rdynamic must not be in LIBADD line
801 for word in -ldb -ldbm -lndbm -lgdbm -lc -rdynamic; do
802 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e "s/$word //" -e "s/$word$//"`
807 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lposix //' -e 's/-lposix$//'`
810 if test "x$ac_cv_prog_gcc" = "xyes"; then
811 PERL_CFLAGS=`echo $PERL_CFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
812 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
819 dnl * check that perl's ldflags actually work
820 AC_CACHE_VAL(irssi_cv_lib_perl_works, [
821 echo "main(){perl_alloc(); return 0;}" > conftest.c
822 $CC $CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> /dev/null > /dev/null
823 if test -s conftest; then
824 irssi_cv_lib_perl_works=yes
826 irssi_cv_lib_perl_works=no
830 if test "x$irssi_cv_lib_perl_works" = "xno"; then
831 perl_check_error="Error linking with perl libraries: $PERL_LDFLAGS"
832 AC_MSG_RESULT([error linking with perl libraries, building without Perl])
837 if test "x$want_perl" != "xno"; then
838 if test "x$want_perl" = "xstatic"; then
840 elif test "x$DYNALOADER_A" = "x"; then
841 AC_MSG_RESULT([error parsing ldopts, building Perl into irssi binary instead of as module])
845 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
846 if test "x$LIBPERL_A" != "x"; then
847 PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lperl /libperl_orig.la /' -e 's/-lperl$/libperl_orig.la$/'`
850 AC_SUBST(DYNALOADER_A)
853 if test "x$want_perl" = "xstatic"; then
854 dnl * building with static perl support
855 dnl * all PERL_LDFLAGS linking is done in fe-text
856 PERL_LDFLAGS="../perl/libperl_static.la $PERL_LDFLAGS"
857 PERL_LINK_LIBS="$PERL_LDFLAGS"
858 PERL_FE_LINK_LIBS="../perl/libfe_perl_static.la"
860 AC_DEFINE(HAVE_STATIC_PERL)
862 dnl * build only static library of perl module
865 perl_static_lib=libperl_static.la
866 perl_static_fe_lib=libfe_perl_static.la
867 PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool'
869 dnl * build dynamic library of perl module,
870 dnl * use libtool-shared to prevent creating of
872 perl_module_lib=libperl_core.la
873 perl_module_fe_lib=libfe_perl.la
876 PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool-shared'
878 AC_SUBST(perl_module_lib)
879 AC_SUBST(perl_static_lib)
880 AC_SUBST(perl_module_fe_lib)
881 AC_SUBST(perl_static_fe_lib)
882 AC_SUBST(PERL_LIBTOOL)
884 AC_SUBST(PERL_LINK_LIBS)
885 AC_SUBST(PERL_FE_LINK_LIBS)
887 AC_SUBST(PERL_LDFLAGS)
888 AC_SUBST(PERL_CFLAGS)
889 AC_SUBST(PERL_LIB_DIR)
893 dnl ** check what we want to build
894 AM_CONDITIONAL(BUILD_TEXTUI, test "$want_textui" = "yes")
895 AM_CONDITIONAL(BUILD_IRSSIBOT, test "$want_irssibot" = "yes")
896 AM_CONDITIONAL(BUILD_IRSSIPROXY, test "$want_irssiproxy" = "yes")
897 AM_CONDITIONAL(BUILD_PLUGINS, test "$want_plugins" = "yes")
898 AM_CONDITIONAL(BUILD_SERVERTEST, test "x$TEST_DIR" != "x")
899 AM_CONDITIONAL(HAVE_PERL, test "$want_perl" != "no")
900 AM_CONDITIONAL(HAVE_STATIC_PERL, test "$want_perl" = "static")
905 dnl ** Keep all the libraries here so each frontend doesn't need to
906 dnl ** keep track of them all
908 dnl ** (these could be made configurable)
912 if test "x$build_modules" != "x"; then
913 silc_MODULES="$silc_MODULES $build_modules"
915 #PROG_LIBS="$PROG_LIBS -lsilc"
917 dnl ****************************************
919 AC_SUBST(CHAT_MODULES)
920 AC_SUBST(silc_MODULES)
922 CORE_LIBS="../core/libcore.a ../lib-config/libirssi_config.a ../lib-popt/libpopt.a"
926 for c in $CHAT_MODULES; do
931 CHAT_LIBS="$CHAT_LIBS ../$c/lib$c.a ../$c/core/lib${c}_core.a"
932 if test -f $srcdir/src/fe-common/$c/module.h; then
933 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/libfe_common_$c.a "
935 for s in `eval echo \\$${c}_MODULES`; do
936 CHAT_LIBS="$CHAT_LIBS ../$c/$s/.libs/lib${c}_$s.a"
937 module_inits="$module_inits ${c}_${s}_init();"
938 module_deinits="${c}_${s}_deinit(); $module_deinits"
939 if test -f $srcdir/src/fe-common/$c/$s/module.h; then
940 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/$s/.libs/libfe_${c}_$s.a "
941 fe_module_inits="$fe_module_inits fe_${c}_${s}_init();"
942 fe_module_deinits="fe_${c}_${s}_deinit(); $fe_module_deinits"
946 file="$srcdir/src/$c/$c.c"
947 echo "/* this file is automatically generated by configure - don't change */" > $file
948 echo "void ${c}_core_init(void); void ${c}_core_init_finish(void); void ${c}_core_deinit(void);" >> $file
949 if test "x$module_inits" != "x"; then
950 echo "$module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
951 echo "$module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
953 echo "void ${c}_init(void) { ${c}_core_init(); $module_inits }" >> $file
954 echo "void ${c}_init_finish(void) { ${c}_core_init_finish(); $module_inits }" >> $file
955 echo "void ${c}_deinit(void) { $module_deinits ${c}_core_deinit(); }" >> $file
957 if test -f $srcdir/src/fe-common/$c/module.h; then
958 file="$srcdir/src/fe-common/$c/${c}-modules.c"
959 echo "/* this file is automatically generated by configure - don't change */" > $file
960 if test "x$fe_module_inits" != "x"; then
961 echo "$fe_module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
962 echo "$fe_module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
964 echo "void fe_${c}_modules_init(void) { $fe_module_inits }" >> $file
965 echo "void fe_${c}_modules_deinit(void) { $fe_module_deinits }" >> $file
969 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/core/libfe_common_core.a"
971 dnl ** common libraries needed by frontends
972 COMMON_NOUI_LIBS="$CHAT_LIBS $CORE_LIBS $INTLLIBS"
973 COMMON_LIBS="$FE_COMMON_LIBS $COMMON_NOUI_LIBS"
974 AC_SUBST(COMMON_NOUI_LIBS)
975 AC_SUBST(COMMON_LIBS)
978 dnl ** memory debugging
981 if test "x$want_memdebug" = "xyes"; then
984 AM_CONDITIONAL(BUILD_MEMDEBUG, test "x$want_memdebug" = "xyes")
987 dnl ** tr-Chinese Big5 support
990 if test "x$want_big5" = "xyes"; then
998 if test "x$want_ipv6" = "xyes"; then
1002 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1003 AC_SUBST(INCLUDE_DEFINES_INT)
1009 src/fe-common/Makefile
1010 src/fe-common/core/Makefile
1011 src/fe-common/silc/Makefile
1012 src/fe-text/Makefile
1013 src/lib-config/Makefile
1014 src/lib-popt/Makefile
1016 src/silc/core/Makefile
1019 docs/help/in/Makefile
1025 dnl ** for building from objdir
1026 if test "x$want_perl" != "xno"; then
1027 old_dir=`pwd` && cd $srcdir && whole_dir=`pwd` && cd $old_dir
1029 if test "x$old_dir" != "x$whole_dir"; then
1030 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
1031 link=`echo $file|$sedpath "s?$whole_dir/??"`
1040 if test "x$curses_error" != "xyes"; then
1041 echo "Building text frontend ..... : $want_textui"
1043 echo "Building text frontend ..... : NO!!"
1044 echo " - Because curses was not found, specify the path to it with"
1045 echo " --with-curses=/dir and make sure you have the curses headers"
1046 echo " installed (usually in ncurses-devel package)"
1048 echo "Building irssi bot ......... : $want_irssibot"
1049 echo "Building irssi proxy ....... : $want_irssiproxy"
1050 echo "Building with IPv6 support . : $want_ipv6"
1052 if test "x$want_perl" = "xstatic"; then
1053 echo "Building with Perl support . : static (in irssi binary)"
1054 elif test "x$want_perl" = "xyes"; then
1055 echo "Building with Perl support . : module"
1057 if test "x$perl_check_error" = "x"; then
1058 echo "Building with Perl support . : no"
1060 echo "Building with Perl support . : NO!"
1061 echo " - $perl_check_error"
1065 if test "x$want_perl" != "xno" -a "x$perl_mod_error" != "x"; then
1066 echo " - NOTE: Perl support will be compiled statically to irssi, not as"
1067 echo " a module as requested. Reason:"
1068 echo " $perl_mod_error"
1071 if test "x$want_perl" = "xyes"; then
1072 if test "x$PERL_LIB_DIR" = "x"; then
1073 echo "Perl library directory ..... : (default - usually /usr/local/lib/perl_site)"
1075 echo "Perl library directory ..... : $PERL_LIB_DIR"
1076 if test "x$perl_lib_dir_given" != "xyes"; then
1077 echo " - NOTE: This was automatically set to the same directory you gave with"
1078 echo " --prefix. If you want the perl libraries to install to their 'correct'"
1079 echo " path, you'll need to give --enable-perl-path= (nothing after '=') option"
1080 echo " to configure. Anyway, installing perl to this directory should work"
1081 echo " just as well.."
1085 echo "Install prefix ............. : $prefix"