Merged silc_1_0_branch to trunk.
[silc.git] / apps / irssi / configure.in
index dfa63c847734d9d8880b89d98417c3937375c0b2..d925185d1ff6c02766b96e20367b44b610852035 100644 (file)
@@ -7,7 +7,7 @@ if test -n "`grep '^#undef VERSION' config.h.in`"; then
 fi
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(Irssi-SILC, 0.7.99)
+AM_INIT_AUTOMAKE(SILC-Client, 0.8.6+)
 
 AM_MAINTAINER_MODE
 
@@ -15,6 +15,7 @@ AC_ISC_POSIX
 AC_PROG_CC
 AC_PROG_CPP
 AC_STDC_HEADERS
+AC_ARG_PROGRAM
 AM_PROG_LIBTOOL
 
 AC_PATH_PROG(sedpath, sed)
@@ -30,19 +31,6 @@ AC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h sys/ioctl.h sys/resource.h)
 # check posix headers..
 AC_CHECK_HEADERS(sys/time.h sys/utsname.h regex.h)
 
-AC_ARG_WITH(big5,
-[  --with-big5             Build with tr-Chinese Big5 support],
-       if test x$withval = xyes; then
-               want_big5=yes
-       else
-               if test "x$withval" = xno; then
-                       want_big5=no
-               else
-                       want_big5=yes
-               fi
-       fi,
-       want_big5=no)
-
 AC_ARG_WITH(socks,
 [  --with-socks            Build with socks support],
        if test x$withval = xyes; then
@@ -123,6 +111,19 @@ if test "x$prefix" != "xNONE"; then
        perl_prefix_note=yes
 fi
 
+AC_ARG_WITH(with-glib2,
+[  --with-glib2           Use GLIB 2.0 instead of 1.2],
+       if test x$withval = xyes; then
+               want_glib2=yes
+       else
+               if test "x$withval" = xno; then
+                       want_glib2=no
+               else
+                       want_glib2=yes
+               fi
+       fi,
+       want_glib2=yes)
+
 AC_ARG_WITH(perl-staticlib,
 [  --with-perl-staticlib   Specify that we want to link perl libraries
                         statically in irssi, default is no],
@@ -182,13 +183,11 @@ AC_ARG_WITH(perl,
        fi,
        want_perl=static)
 
-AC_ARG_WITH(tests,
-[  --with-tests           Run all the tests],
-       if test x$withval != xno; then
-               TEST_DIR=test
-       fi,
-       TEST_DIR=)
-AC_SUBST(TEST_DIR)
+AC_ARG_WITH(file-offset-size,
+[  --with-file-offset-size=BITS  Set size of file offsets. Usually 32 or 64.
+                          (default: 64 if available)],
+        preferred_off_t_bits=$withval,
+        preferred_off_t_bits=64)
 
 AC_ARG_ENABLE(ipv6,
 [  --enable-ipv6           Enable IPv6 support],
@@ -217,7 +216,7 @@ case "$host_os" in
 esac
 
 
-AC_CHECK_FUNCS(mkfifo fcntl)
+AC_CHECK_FUNCS(mkfifo fcntl nl_langinfo)
 
 AC_CHECK_FUNC(socket, [], [
        AC_CHECK_LIB(socket, socket, [
@@ -228,7 +227,7 @@ AC_CHECK_FUNC(socket, [], [
 AC_CHECK_FUNC(inet_addr, [], [
        AC_CHECK_LIB(nsl, inet_addr, [
                LIBS="$LIBS -lnsl"
-       ], -lsocket)
+       ])
 ])
 
 dnl * gcc specific options
@@ -304,12 +303,14 @@ AC_DEFUN(AC_CHECK_GLIBDIR,[
       if test -f $full_glib_dir/gmodule/.libs/libgmodule.a; then
        GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/.libs/libgmodule.a"
         AC_DEFINE(HAVE_GMODULE)
+       have_gmodule=yes
       fi
     else
       GLIB_LIBS="$full_glib_dir/libglib.a $GLIB_LDEXTRA"
       if test -f $full_glib_dir/gmodule/libgmodule.a; then
        GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/libgmodule.a"
         AC_DEFINE(HAVE_GMODULE)
+       have_gmodule=yes
       fi
     fi
     AC_SUBST(GLIB_CFLAGS)
@@ -322,15 +323,37 @@ AC_DEFUN(AC_CHECK_GLIBDIR,[
 AC_CHECK_GLIBDIR
 
 if test -z "$GLIB_DIR"; then
-  AM_PATH_GLIB(1.2.0,,, gmodule)
-  if test -z "$GLIB_LIBS"; then
-    echo "*** trying without -lgmodule"
-    glib_config_args=
-    AM_PATH_GLIB(1.2.0)
+  if test "x$with_glib2" = "xyes"; then
+    dnl * check only for glib2
+    checks="3 4"
   else
-    AC_DEFINE(HAVE_GMODULE)
+    dnl * check glib1 then glib2
+    checks="1 2 3 4"
   fi
 
+  for try in $checks; do
+    glib_config_args=
+    if test $try = 1 -o $try = 3; then
+      glib_modules=gmodule
+    else
+      echo "*** trying without -lgmodule"
+      glib_modules=
+    fi
+    if test $try = 1 -o $try = 2; then
+      glib_version=1.2.0
+    else
+      glib_version=2.0.0
+    fi
+    AM_PATH_GLIB($glib_version,[],[], [$glib_modules])
+    if test "$GLIB_LIBS"; then
+      if test $glib_modules = gmodule; then
+        AC_DEFINE(HAVE_GMODULE)
+        have_gmodule=yes
+      fi
+      break
+    fi
+  done
+
   if test -z "$GLIB_LIBS"; then
     echo
     echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org"
@@ -438,33 +461,31 @@ dnl **
 if test "x$want_textui" = "xyes"; then
        AC_CHECK_CURSES
 
-       LIBS="$LIBS $CURSES_LIBS"
+       TEXTUI_LIBS="$LIBS $CURSES_LIBS"
        if test "x$has_curses" = "xtrue"; then
                        AC_CHECK_FUNC(use_default_colors, AC_DEFINE(HAVE_NCURSES_USE_DEFAULT_COLORS))
                        AC_CHECK_FUNC(idcok, AC_DEFINE(HAVE_CURSES_IDCOK))
                        AC_CHECK_FUNC(resizeterm, AC_DEFINE(HAVE_CURSES_RESIZETERM))
                        AC_CHECK_FUNC(wresize, AC_DEFINE(HAVE_CURSES_WRESIZE))
-               if test "x$want_terminfo" = "xyes"; then
-                       AC_CHECK_LIB(curses, setupterm,, [
-                               want_termcap=yes
-                       ])
-               fi
+               AC_CHECK_FUNC(setupterm,, [
+                       want_termcap=yes
+               ])
        else
                AC_CHECK_LIB(tinfo, setupterm, [
-                 LIBS="$LIBS -ltinfo"
+                 TEXTUI_LIBS="$LIBS -ltinfo"
                  want_terminfo=yes
                ], AC_CHECK_LIB(termlib, tgetent, [
-                 LIBS="$LIBS -ltermlib"
+                 TEXTUI_LIBS="$LIBS -ltermlib"
                  want_termcap=yes
                ], AC_CHECK_LIB(termcap, tgetent, [
-                 LIBS="$LIBS -ltermcap"
+                 TEXTUI_LIBS="$LIBS -ltermcap"
                  want_termcap=yes
                ], [
-                 AC_MSG_WARN(Terminfo/termcap not found)
+                 AC_ERROR(Terminfo/termcap not found - install ncurses-devel package)
                  want_textui=no
-                 curses_error=yes
                ])))
         fi
+       AC_SUBST(TEXTUI_LIBS)
                if test "x$want_termcap" = "xyes"; then
                        AC_CHECK_FUNC(tparm,, need_tparm=yes)
        else
@@ -547,21 +568,14 @@ if test "$want_perl" != "no"; then
                esac
 
                dnl * check that perl's ldflags actually work
-               AC_CACHE_VAL(irssi_cv_lib_perl_works, [
-                       echo "main(){perl_alloc(); return 0;}" > conftest.c
-                       $CC $CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> perl.error.tmp > /dev/null
-                       if test -s conftest; then
-                               irssi_cv_lib_perl_works=yes
-                       else
-                               irssi_cv_lib_perl_works=no
-                       fi
-               ])
-
-               if test "x$irssi_cv_lib_perl_works" = "xno"; then
+               echo "main(){perl_alloc(); return 0;}" > conftest.c
+               $CC $CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> perl.error.tmp > /dev/null
+               if test ! -s conftest; then
                        perl_check_error="Error linking with perl libraries: $PERL_LDFLAGS: `cat perl.error.tmp`"
                        AC_MSG_RESULT([error linking with perl libraries, building without Perl])
                        want_perl=no
                fi
+
                rm -f perl.error.tmp
        fi
 
@@ -646,11 +660,11 @@ AM_CONDITIONAL(BUILD_TEXTUI, test "$want_textui" = "yes")
 AM_CONDITIONAL(BUILD_IRSSIBOT, test "$want_irssibot" = "yes")
 AM_CONDITIONAL(BUILD_IRSSIPROXY, test "$want_irssiproxy" = "yes")
 AM_CONDITIONAL(BUILD_PLUGINS, test "$want_plugins" = "yes")
-AM_CONDITIONAL(BUILD_SERVERTEST, test -n "$TEST_DIR")
 AM_CONDITIONAL(HAVE_PERL, test "$want_perl" != "no")
 AM_CONDITIONAL(HAVE_STATIC_PERL, test "$want_perl" = "static")
 AM_CONDITIONAL(NEED_TPARM, test "$need_tparm" = "yes")
 AM_CONDITIONAL(USE_CURSES, test "$want_terminfo" != "yes" -a "$want_termcap" != "yes")
+AM_CONDITIONAL(BUILD_SERVERTEST, false)
 
 # move LIBS to PROG_LIBS so they're not tried to be used when linking eg. perl libraries
 PROG_LIBS=$LIBS
@@ -723,19 +737,11 @@ done
 FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/core/libfe_common_core.a"
 
 dnl ** common libraries needed by frontends
-COMMON_NOUI_LIBS="$CHAT_LIBS $CORE_LIBS $INTLLIBS"
+COMMON_NOUI_LIBS="$CHAT_LIBS $CORE_LIBS"
 COMMON_LIBS="$FE_COMMON_LIBS $COMMON_NOUI_LIBS"
 AC_SUBST(COMMON_NOUI_LIBS)
 AC_SUBST(COMMON_LIBS)
 
-dnl **
-dnl ** tr-Chinese Big5 support
-dnl **
-
-if test "x$want_big5" = "xyes"; then
-       AC_DEFINE(WANT_BIG5)
-fi
-
 dnl **
 dnl ** IPv6 support
 dnl **
@@ -789,6 +795,7 @@ src/perl/Makefile
 src/perl/common/Makefile.PL
 src/perl/ui/Makefile.PL
 src/perl/textui/Makefile.PL
+src/perl/silc/Makefile.PL
 scripts/Makefile
 docs/Makefile
 docs/help/Makefile
@@ -818,26 +825,26 @@ fi
 
 echo
 
-if test "x$curses_error" != "xyes"; then
-       if test "x$want_textui" = "xno"; then
-               text=no
-       elif test "x$want_termcap" = "xyes"; then
-               text="yes, using termcap"
-       elif test "x$want_terminfo" = "xyes"; then
-               text="yes, using terminfo"
-       else
-               text="yes, using curses"
-       fi
-       echo "Building text frontend ..... : $text"
+if test "x$want_textui" = "xno"; then
+       text=no
+elif test "x$want_termcap" = "xyes"; then
+       text="yes, using termcap"
+elif test "x$want_terminfo" = "xyes"; then
+       text="yes, using terminfo"
 else
-       echo "Building text frontend ..... : NO!!"
-       echo " - Because curses was not found, specify the path to it with"
-       echo "   --with-curses=/dir and make sure you have the curses headers"
-       echo "   installed (usually in ncurses-devel package)"
+       text="yes, using curses"
 fi
+echo "Building text frontend ..... : $text"
 echo "Building irssi bot ......... : $want_irssibot"
 echo "Building irssi proxy ....... : $want_irssiproxy"
 echo "Building with IPv6 support . : $want_ipv6"
+if test "x$have_gmodule" = "xyes"; then
+       echo "Building with module support : yes"
+else
+       echo "Building with module support : NO!! /LOAD will not work!"
+       echo " - You're missing gmodule (comes with glib) for some reason,"
+       echo "   or it doesn't work in your system."
+fi
 
 if test "x$want_perl" = "xstatic"; then
        echo "Building with Perl support . : static (in irssi binary)"
@@ -856,6 +863,10 @@ if test "x$want_perl" != "xno" -a "x$perl_mod_error" != "x"; then
        echo " - NOTE: Perl support will be compiled statically to irssi, not as"
        echo "   a module as requested. Reason:"
        echo "   $perl_mod_error"
+
+       if test -f /etc/debian_version; then
+               echo " - Try: apt-get install libperl-dev"
+       fi
 fi
 
 if test "x$want_perl" != "xno"; then
@@ -873,5 +884,8 @@ if test "x$want_perl" != "xno"; then
                echo "  Anyway, installing perl to this directory should work just as well."
        fi
 fi
+
 echo "Install prefix ............. : $prefix"
 
+echo
+echo "If there was any problems, read the INSTALL file."