1999-09-03 10:27:29 -04:00
AC_INIT(src)
AM_CONFIG_HEADER(config.h)
2000-12-03 00:34:41 -05:00
AM_INIT_AUTOMAKE(irssi, 0.7.97)
1999-09-03 10:27:29 -04:00
AM_MAINTAINER_MODE
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
AC_STDC_HEADERS
AC_ARG_PROGRAM
AM_PROG_LIBTOOL
2000-10-03 20:22:59 -04:00
dnl * ahem.. :) we don't want static libraries for modules
2000-10-04 06:42:13 -04:00
if test "x$lt_target" = "x"; then
2001-01-04 13:35:26 -05:00
if test "$target" = "NONE"; then
2000-10-04 06:42:13 -04:00
lt_target="$host"
else
lt_target="$target"
fi
fi
2000-12-16 23:20:31 -05:00
dnl * --disable-static isn't a good idea, complain if it's used
if test "x$enable_static" = "xno"; then
AC_ERROR([Don't give --disable-static option to configure])
fi
2000-10-04 06:42:13 -04:00
2000-10-03 20:22:59 -04:00
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
2001-01-04 13:35:26 -05:00
$libtool_flags --disable-static --output=libtool-shared --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2000-10-03 20:22:59 -04:00
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2000-12-03 01:39:28 -05:00
AC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h sys/ioctl.h libintl.h)
1999-09-03 10:27:29 -04:00
2000-10-26 14:12:20 -04:00
# check posix headers..
AC_CHECK_HEADERS(sys/time.h sys/utsname.h regex.h)
2000-10-08 08:54:26 -04:00
1999-09-03 10:27:29 -04:00
AC_ARG_WITH(socks,
[ --with-socks Build with socks support],
if test x$withval = xyes; then
2000-10-03 18:57:14 -04:00
want_socks=yes
1999-09-03 10:27:29 -04:00
else
2000-10-03 18:57:14 -04:00
if test "x$withval" = xno; then
want_socks=no
else
want_socks=yes
fi
1999-09-03 10:27:29 -04:00
fi,
want_socks=no)
AC_ARG_WITH(textui,
2000-03-10 15:58:04 -05:00
[ --with-textui Build text frontend],
1999-09-03 10:27:29 -04:00
if test x$withval = xyes; then
2000-10-03 18:57:14 -04:00
want_textui=yes
1999-09-03 10:27:29 -04:00
else
if test "x$withval" = xno; then
want_textui=no
else
2000-10-03 18:57:14 -04:00
want_textui=yes
1999-09-03 10:27:29 -04:00
fi
fi,
want_textui=yes)
1999-10-02 06:29:01 -04:00
AC_ARG_WITH(bot,
[ --with-bot Build irssi-bot],
if test x$withval = xyes; then
2000-10-03 18:57:14 -04:00
want_irssibot=yes
1999-10-02 06:29:01 -04:00
else
if test "x$withval" = xno; then
want_irssibot=no
else
2000-10-03 18:57:14 -04:00
want_irssibot=yes
1999-10-02 06:29:01 -04:00
fi
fi,
2000-09-06 17:30:56 -04:00
want_irssibot=no)
1999-10-02 06:29:01 -04:00
2000-09-29 19:59:51 -04:00
AC_ARG_WITH(proxy,
[ --with-proxy Build irssi-proxy],
if test x$withval = xyes; then
2000-10-03 18:57:14 -04:00
want_irssiproxy=yes
2000-09-29 19:59:51 -04:00
else
if test "x$withval" = xno; then
want_irssiproxy=no
else
2000-10-03 18:57:14 -04:00
want_irssiproxy=yes
2000-09-29 19:59:51 -04:00
fi
fi,
want_irssiproxy=no)
2000-05-29 12:37:00 -04:00
AC_ARG_WITH(modules,
[ --with-modules Specify what modules to build in binary],
2000-10-11 18:09:53 -04:00
if test x$withval != xyes -a x$withval != xno; then
build_modules="$withval"
fi)
1999-09-03 10:27:29 -04:00
2000-07-16 16:59:55 -04:00
if test "x$prefix" = "xNONE"; then
PERL_LIB_DIR=""
2000-07-16 10:30:29 -04:00
else
2000-07-16 16:59:55 -04:00
PERL_LIB_DIR="$prefix"
2000-07-16 10:30:29 -04:00
fi
2000-10-03 18:57:14 -04:00
AC_ARG_ENABLE(perl-path,
[ --enable-perl-path=dir Specify where to install the Perl libraries for irssi],
2000-03-02 13:03:17 -05:00
if test x$enableval = xyes; then
2000-10-03 18:57:14 -04:00
want_perl=yes
2000-02-20 18:28:50 -05:00
else
2000-03-02 13:03:17 -05:00
if test "x$enableval" = xno; then
2000-02-20 18:28:50 -05:00
want_perl=no
else
2000-10-03 18:57:14 -04:00
want_perl=yes
2000-07-09 08:33:33 -04:00
PERL_LIB_DIR="$enableval"
2000-07-26 19:55:32 -04:00
perl_lib_dir_given=yes
2000-02-20 18:28:50 -05:00
fi
fi,
want_perl=yes)
2000-10-03 18:57:14 -04:00
AC_ARG_ENABLE(perl,
[ --enable-perl[=yes|no|static] Build with Perl support - also specifies
if it should be built into main irssi binary
(static) or as module (default)],
if test x$enableval = xyes; then
want_perl=yes
elif test x$enableval = xstatic; then
want_perl=static
else
want_perl=no
fi,
want_perl=yes)
1999-09-03 10:27:29 -04:00
AC_ARG_WITH(servertest,
[ --with-servertest Build servertest],
if test x$withval = xyes; then
2000-10-03 18:57:14 -04:00
want_servertest=yes
1999-09-03 10:27:29 -04:00
else
if test "x$withval" = xno; then
want_servertest=no
else
2000-10-03 18:57:14 -04:00
want_servertest=yes
1999-09-03 10:27:29 -04:00
fi
fi,
want_servertest=no)
2000-10-08 08:54:26 -04:00
AC_ARG_ENABLE(curses-windows,
[ --enable-curses-windows Use curses windows],
if test x$enableval != xno; then
AC_DEFINE(USE_CURSES_WINDOWS)
fi,
AC_DEFINE(USE_CURSES_WINDOWS))
1999-09-03 10:27:29 -04:00
AC_ARG_ENABLE(memdebug,
[ --enable-memdebug Enable memory debugging],
if test x$enableval = xyes; then
want_memdebug=yes
else
2000-10-03 18:57:14 -04:00
if test "x$enableval" = xno; then
want_memdebug=no
else
want_memdebug=yes
fi
1999-09-03 10:27:29 -04:00
fi,
want_memdebug=no)
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 Enable IPv6 support],
if test x$enableval = xyes; then
2000-10-03 18:57:14 -04:00
want_ipv6=yes
1999-09-03 10:27:29 -04:00
else
2000-10-03 18:57:14 -04:00
if test "x$enableval" = xno; then
want_ipv6=no
else
want_ipv6=yes
fi
1999-09-03 10:27:29 -04:00
fi,
2000-01-12 17:10:30 -05:00
want_ipv6=no)
1999-09-03 10:27:29 -04:00
dnl **
dnl ** just some generic stuff...
dnl **
2000-04-26 04:10:09 -04:00
AC_CHECK_FUNCS(mkfifo fcntl)
1999-09-03 10:27:29 -04:00
AC_CHECK_LIB(socket, socket, [
1999-10-05 14:53:45 -04:00
PROG_LIBS="$PROG_LIBS -lsocket"
1999-09-03 10:27:29 -04:00
])
AC_CHECK_LIB(nsl, inet_addr, [
1999-10-05 14:53:45 -04:00
PROG_LIBS="$PROG_LIBS -lnsl"
1999-09-03 10:27:29 -04:00
], -lsocket)
2000-03-26 11:46:40 -05:00
dnl * gcc specific options
1999-09-03 10:27:29 -04:00
if test "x$ac_cv_prog_gcc" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
fi
2000-03-26 11:46:40 -05:00
dnl * socklen_t - AC_CHECK_TYPE() would be _really_ useful if it only would
dnl * accept header files where to find the typedef..
AC_MSG_CHECKING([for socklen_t])
AC_CACHE_VAL(irssi_cv_type_socklen_t,
[AC_TRY_COMPILE([
2000-07-09 11:11:47 -04:00
#include <sys/types.h>
2000-03-26 11:46:40 -05:00
#include <sys/socket.h>],
[socklen_t t;],
irssi_cv_type_socklen_t=yes,
irssi_cv_type_socklen_t=no,
)])
if test $irssi_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
fi
AC_MSG_RESULT($irssi_cv_type_socklen_t)
1999-09-03 10:27:29 -04:00
dnl **
dnl ** check for socks
dnl **
if test "x$want_socks" = "xyes"; then
AC_CHECK_LIB(socks, connect, [
1999-10-05 14:53:45 -04:00
PROG_LIBS="$PROG_LIBS -lsocks"
1999-09-03 10:27:29 -04:00
AC_CHECK_HEADER(socks.h, [
AC_DEFINE(HAVE_SOCKS_H)
CFLAGS="$CFLAGS -DSOCKS"
AC_MSG_RESULT(["socks5 library found, building with it"])
], [
AC_MSG_RESULT(["socks4 library found, building with it"])
CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dgetpeername=Rgetpeername -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
])
])
fi
dnl **
2000-04-26 04:10:09 -04:00
dnl ** fe-text checks
1999-09-03 10:27:29 -04:00
dnl **
2000-11-23 17:42:37 -05:00
AC_PATH_PROG(sedpath, sed)
AC_MSG_CHECKING([whether GLib is unpacked to irssi dir])
2001-01-13 08:54:17 -05:00
GLIB_DIR=`for d in *; do test -f $d/glib.h && echo $d; done`
2000-11-23 17:42:37 -05:00
if test "x$GLIB_DIR" != "x"; then
dnl glib in irssi directory, use it
AC_MSG_RESULT([yes, using it])
2000-12-27 11:27:46 -05:00
dnl * we have to do this at this point so we know what libs gmodule needs
echo
echo "configuring GLib ..."
echo
cd $GLIB_DIR
./configure
cd ..
echo
GLIB_LDEXTRA=`$GLIB_DIR/glib-config --libs gmodule|sed -e 's/-lglib//' -e 's/-lgmodule//' -e 's,-L/usr/local/lib ,,'|sed 's/ \+/ /g'`
2000-11-23 17:42:37 -05:00
full_glib_dir="`pwd`/$GLIB_DIR"
2000-12-26 20:20:58 -05:00
GLIB_CFLAGS="-I$full_glib_dir -I$full_glib_dir/gmodule"
2001-01-15 19:14:14 -05:00
if test -f $full_glib_dir/.libs/libglib.a; then
GLIB_LIBS="$full_glib_dir/.libs/libglib.a $GLIB_LDEXTRA"
if test -f $full_glib_dir/gmodule/.libs/libgmodule.a; then
GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/.libs/libgmodule.a"
fi
elif test -f $full_glib_dir/libglib.a; then
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"
fi
else
AC_ERROR([GLIB was not compiled properly, libglib.a not found])
fi
2000-11-23 17:42:37 -05:00
AC_SUBST(GLIB_DIR)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
else
AC_MSG_RESULT([no])
AM_PATH_GLIB(1.2.0,,, gmodule)
2001-01-15 19:14:14 -05:00
if test "x$GLIB_LIBS" = "x"; then
echo "*** trying without -lgmodule"
glib_config_args=
AM_PATH_GLIB(1.2.0)
else
AC_DEFINE(HAVE_GMODULE)
fi
2000-11-23 17:42:37 -05:00
if test "x$GLIB_LIBS" = "x"; then
echo
echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org"
echo "*** If you can't install GLIB anywhere or if you don't want to,"
echo "*** you can just unpack it to Irssi's source directory and"
echo "*** Irssi will automatically compile and use it."
AC_ERROR([GLIB is required to build irssi.])
fi
2000-07-31 16:17:33 -04:00
fi
1999-09-03 10:27:29 -04:00
2000-05-09 07:42:42 -04:00
PROG_LIBS="$PROG_LIBS $GLIB_LIBS"
1999-10-30 09:21:14 -04:00
2001-01-01 05:42:15 -05:00
dnl **
dnl ** check if we can link dynamic libraries to modules
2001-01-15 19:14:14 -05:00
dnl ** also checks if libraries are built to .libs dir
2001-01-01 05:42:15 -05:00
dnl **
AC_MSG_CHECKING([if we can link dynamic libraries with modules])
DYNLIB_MODULES=no
2001-01-15 19:14:14 -05:00
dnl ** compile object file
2001-01-01 05:42:15 -05:00
cat > conftest.c <<EOF
#include <math.h>
int modfunc(void){return (int)floor(1.2);}
EOF
./libtool --mode=compile $CC $CFLAGS -c conftest.c 2> /dev/null > /dev/null
if test ! -s conftest.lo; then
2001-01-15 19:14:14 -05:00
AC_ERROR([error compiling test module])
fi
dnl ** link to library
./libtool --mode=link $CC $CFLAGS $LDFLAGS -module -rpath /usr/lib conftest.lo -lm -o libconftest.la > /dev/null
if test -s .libs/libconftest.a; then
LIBDIR=.libs/
elif test -s libconftest.a; then
LIBDIR=
2001-01-01 05:42:15 -05:00
else
2001-01-15 19:14:14 -05:00
AC_ERROR([error, can't even find .a library])
fi
dnl ** check if dynamic linking worked
if test ! -s ${LIBDIR}libconftest.so -a -s ${LIBDIR}libconftest.so.0.0; then
mv ${LIBDIR}libconftest.so.0.0 ${LIBDIR}libconftest.so
fi
if test ! -s ${LIBDIR}libconftest.so; then
AC_MSG_RESULT([no, error linking test module])
else
cat > conftest.c <<EOF
2001-01-01 05:42:15 -05:00
#include <gmodule.h>
main() {
2001-01-15 19:14:14 -05:00
GModule *m; int (*modfunc)(void);
m = g_module_open("${LIBDIR}libconftest.so", 0);
if (!m) g_print("error loading: %s", g_module_error());
else if (!g_module_symbol(m, "modfunc", (gpointer *) &modfunc))
g_print("modfunc() symbol not found from module");
else if (modfunc() == 1) g_print("ok"); else g_print("wrong result?! 1 vs %d", modfunc());
return 0; }
2001-01-01 05:42:15 -05:00
EOF
2001-01-15 19:14:14 -05:00
$CC $CFLAGS conftest.c -o conftest `$GLIB_CONFIG --cflags --libs gmodule` 2> /dev/null > /dev/null
if test ! -s conftest; then
AC_MSG_RESULT([no, error compiling test program])
else
status="`./conftest`"
if test "x$status" = "xok"; then
DYNLIB_MODULES=yes
AC_MSG_RESULT([yes])
2001-01-01 05:42:15 -05:00
else
2001-01-15 19:14:14 -05:00
AC_MSG_RESULT([no, error running: $status])
2001-01-01 05:42:15 -05:00
fi
fi
fi
2001-01-15 19:14:14 -05:00
rm -rf conftest.* libconftest.* .libs
2001-01-01 05:42:15 -05:00
1999-09-03 10:27:29 -04:00
dnl **
dnl ** curses checks
dnl **
if test "x$want_textui" = "xyes"; then
AC_CHECK_CURSES
2000-05-15 04:25:45 -04:00
if test "x$has_ncurses" != "x"; then
1999-09-03 10:27:29 -04:00
AC_CHECK_LIB(ncurses, use_default_colors, [
AC_DEFINE(HAVE_NCURSES_USE_DEFAULT_COLORS)
],, $CURSES_LIBS)
AC_CHECK_LIB(ncurses, idcok, [
AC_DEFINE(HAVE_CURSES_IDCOK)
],, $CURSES_LIBS)
2000-02-20 08:40:49 -05:00
AC_CHECK_LIB(ncurses, resizeterm, [
AC_DEFINE(HAVE_CURSES_RESIZETERM)
],, $CURSES_LIBS)
2000-08-10 16:02:59 -04:00
AC_CHECK_LIB(ncurses, wresize, [
AC_DEFINE(HAVE_CURSES_WRESIZE)
],, $CURSES_LIBS)
2000-10-04 00:01:45 -04:00
elif test "x$has_curses" = "xtrue"; then
1999-09-03 10:27:29 -04:00
AC_CHECK_LIB(curses, idcok, [
AC_DEFINE(HAVE_CURSES_IDCOK)
],, $CURSES_LIBS)
2000-02-20 08:40:49 -05:00
AC_CHECK_LIB(curses, resizeterm, [
AC_DEFINE(HAVE_CURSES_RESIZETERM)
],, $CURSES_LIBS)
2000-08-10 16:02:59 -04:00
AC_CHECK_LIB(curses, wresize, [
AC_DEFINE(HAVE_CURSES_WRESIZE)
],, $CURSES_LIBS)
2000-10-04 00:01:45 -04:00
else
2000-07-26 19:55:32 -04:00
want_textui=no
2000-07-09 10:27:59 -04:00
curses_error=yes
2000-01-12 17:10:30 -05:00
fi
1999-09-03 10:27:29 -04:00
else
has_curses=false
fi
2001-01-01 05:42:15 -05:00
dnl **
dnl ** perl checks
dnl **
2000-10-03 18:57:14 -04:00
if test "$want_perl" != "no"; then
2000-02-24 16:14:44 -05:00
AC_PATH_PROG(perlpath, perl)
AC_MSG_CHECKING(for Perl compile flags)
PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
if test "x$PERL_CFLAGS" = "x"; then
2000-09-07 17:55:58 -04:00
AC_MSG_RESULT([not found, building without Perl.])
2000-02-24 16:14:44 -05:00
want_perl=no
else
2001-01-01 05:42:15 -05:00
PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null`
2000-09-07 17:55:58 -04:00
2000-09-07 18:43:07 -04:00
dnl * Perl 5.004 and older use perl_xxx variables while
dnl * later use PL_perl_xxx variables ..
have_pl_perl=`$perlpath -e 'print $] < 5.005 ? "no" : "yes";'`
if test "x$have_pl_perl" = "xyes"; then
AC_DEFINE(HAVE_PL_PERL)
fi
2001-01-01 05:42:15 -05:00
if test "x$DYNLIB_MODULES" = "xno" -a "$want_perl" != "static"; then
dnl * wanted perl as module, won't get it.
want_perl=static
perl_mod_error="Dynamic library dependencies don't work with modules"
fi
if test "$want_perl" != "static"; then
2000-10-03 18:57:14 -04:00
dnl * dynaloader.a -> libperl_dynaloader.la
2000-12-03 02:27:39 -05:00
DYNALOADER_A=`echo $PERL_LDFLAGS | $sedpath 's/^\(.* \)*\([[^ ]]*DynaLoader\.a\).*/\2/'`
2000-10-03 18:57:14 -04:00
fi
2000-09-07 17:55:58 -04:00
2001-01-01 05:42:15 -05:00
dnl * don't check libperl.a if dynaloader.a wasn't found..
if test "x$DYNALOADER_A" != "x"; then
dnl * find either libperl.a or libperl.so
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 } } };'`
if test "x$LIBPERL_A" = "x"; then
perl_mod_error="Didn't find location of -lperl"
DYNALOADER_A=
elif test "$LIBPERL_A" = "-lperl"; then
LIBPERL_A=
fi
fi
2000-09-07 17:55:58 -04:00
dnl * remove all database stuffs
2001-01-01 05:42:15 -05:00
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-ldb\( \|$\)//'`
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-ldbm\( \|$\)//'`
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lndbm\( \|$\)//'`
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lgdbm\( \|$\)//'`
2000-09-07 17:55:58 -04:00
dnl * nsl is already in ldflags
2001-01-01 05:42:15 -05:00
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lnsl\( \|$\)//'`
2000-09-07 17:55:58 -04:00
dnl * linux specific ..
2000-12-28 08:53:19 -05:00
if echo $host_os | grep linux > /dev/null; then
2001-01-01 05:42:15 -05:00
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lposix\( \|$\)//'`
2000-02-24 16:14:44 -05:00
fi
2000-09-07 17:55:58 -04:00
dnl * libc is of course in list already
2001-01-01 05:42:15 -05:00
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-lc\( \|$\)//'`
2000-09-07 17:55:58 -04:00
dnl * must not be in LIBADD line
2001-01-01 05:42:15 -05:00
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/-rdynamic\( \|$\)//'`
2000-09-07 17:55:58 -04:00
2000-10-03 18:57:14 -04:00
if test "x$want_perl" = "xstatic"; then
AC_MSG_RESULT(ok)
2000-10-03 19:54:56 -04:00
elif test "x$DYNALOADER_A" = "x"; then
2000-10-03 18:57:14 -04:00
AC_MSG_RESULT([error parsing ldopts, building Perl into irssi binary instead of as module])
want_perl=static
2000-09-07 17:55:58 -04:00
else
AC_MSG_RESULT(ok)
2000-12-03 02:27:39 -05:00
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/^\(.* \)*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
2001-01-01 05:42:15 -05:00
if test "x$LIBPERL_A" != "x"; then
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath 's/ -lperl/ libperl_orig.la/'`
fi
2000-10-03 19:54:56 -04:00
AC_SUBST(LIBPERL_A)
AC_SUBST(DYNALOADER_A)
2000-10-03 18:57:14 -04:00
fi
2000-03-11 15:19:24 -05:00
2000-10-03 18:57:14 -04:00
if test "x$want_perl" = "xstatic"; then
2000-10-03 20:22:59 -04:00
dnl * building with static perl support
dnl * all PERL_LDFLAGS linking is done in fe-text
2000-10-03 19:54:56 -04:00
PERL_LDFLAGS="../perl/libperl_static.la $PERL_LDFLAGS"
2000-10-03 18:57:14 -04:00
PROG_LIBS="$PROG_LIBS $PERL_LDFLAGS"
PERL_LDFLAGS=
AC_DEFINE(HAVE_STATIC_PERL)
2000-10-03 20:22:59 -04:00
dnl * build only static library of perl module
2000-10-03 19:54:56 -04:00
module_lib=
static_lib=libperl_static.la
2000-10-03 20:22:59 -04:00
PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2000-10-03 19:54:56 -04:00
else
2000-10-03 20:22:59 -04:00
dnl * build dynamic library of perl module,
2001-01-04 13:35:26 -05:00
dnl * use libtool-shared to prevent creating of
2000-10-03 20:22:59 -04:00
dnl * libperl.a
2000-10-03 19:54:56 -04:00
module_lib=libperl.la
static_lib=
2001-01-04 13:35:26 -05:00
PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool-shared'
2000-09-07 17:55:58 -04:00
fi
2000-10-03 19:54:56 -04:00
AC_SUBST(module_lib)
AC_SUBST(static_lib)
2000-10-03 20:22:59 -04:00
AC_SUBST(PERL_LIBTOOL)
2000-10-03 19:54:56 -04:00
2000-10-03 18:57:14 -04:00
AC_SUBST(PERL_LDFLAGS)
AC_SUBST(PERL_CFLAGS)
AC_SUBST(PERL_LIB_DIR)
2000-03-11 15:19:24 -05:00
fi
2000-02-20 18:28:50 -05:00
fi
1999-10-30 09:21:14 -04:00
dnl ** check what we want to build
2000-01-12 17:10:30 -05:00
AM_CONDITIONAL(BUILD_TEXTUI, test "$want_textui" = "yes")
AM_CONDITIONAL(BUILD_IRSSIBOT, test "$want_irssibot" = "yes")
2000-09-29 19:59:51 -04:00
AM_CONDITIONAL(BUILD_IRSSIPROXY, test "$want_irssiproxy" = "yes")
2000-01-12 17:10:30 -05:00
AM_CONDITIONAL(BUILD_PLUGINS, test "$want_plugins" = "yes")
AM_CONDITIONAL(BUILD_SERVERTEST, test "$want_servertest" = "yes")
2000-10-03 18:57:14 -04:00
AM_CONDITIONAL(HAVE_PERL, test "$want_perl" != "no")
2000-10-03 19:54:56 -04:00
AM_CONDITIONAL(HAVE_STATIC_PERL, test "$want_perl" = "static")
2000-10-03 18:57:14 -04:00
AC_SUBST(PROG_LIBS)
1999-11-28 12:50:17 -05:00
2000-04-26 04:10:09 -04:00
dnl **
dnl ** Keep all the libraries here so each frontend doesn't need to
dnl ** keep track of them all
dnl **
2000-05-09 07:42:42 -04:00
dnl ** (these could be made configurable)
2000-07-16 16:34:49 -04:00
CHAT_MODULES="irc"
2000-05-09 07:42:42 -04:00
irc_MODULES="dcc flood notifylist"
2000-07-09 10:27:59 -04:00
if test "x$build_modules" != "x"; then
2000-05-29 12:37:00 -04:00
irc_MODULES="$irc_MODULES $build_modules"
fi
2000-04-26 04:10:09 -04:00
2000-05-09 07:42:42 -04:00
dnl ****************************************
AC_SUBST(CHAT_MODULES)
AC_SUBST(irc_MODULES)
2000-08-27 18:40:08 -04:00
CORE_LIBS="../core/libcore.a ../lib-config/libirssi_config.a ../lib-popt/libpopt.a"
2000-09-06 17:30:56 -04:00
FE_COMMON_LIBS=""
2000-05-09 07:42:42 -04:00
CHAT_LIBS=""
for c in $CHAT_MODULES; do
2000-07-16 10:30:29 -04:00
module_inits=""
module_deinits=""
fe_module_inits=""
fe_module_deinits=""
2000-08-27 18:40:08 -04:00
CHAT_LIBS="$CHAT_LIBS ../$c/lib$c.a ../$c/core/lib${c}_core.a"
2000-07-16 10:30:29 -04:00
if test -d $srcdir/src/fe-common/$c; then
2000-09-06 17:30:56 -04:00
FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/libfe_common_$c.a "
2000-07-16 10:30:29 -04:00
fi
2000-05-09 07:42:42 -04:00
for s in `eval echo \\$${c}_MODULES`; do
2001-01-15 19:14:14 -05:00
CHAT_LIBS="$CHAT_LIBS ../$c/$s/${LIBDIR}lib${c}_$s.a"
2000-05-25 07:30:47 -04:00
module_inits="$module_inits ${c}_${s}_init();"
module_deinits="${c}_${s}_deinit(); $module_deinits"
if test -d $srcdir/src/fe-common/$c/$s; then
2001-01-15 19:14:14 -05:00
FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/$s/${LIBDIR}libfe_common_${c}_$s.a "
2000-05-25 07:30:47 -04:00
fe_module_inits="$fe_module_inits fe_${c}_${s}_init();"
fe_module_deinits="fe_${c}_${s}_deinit(); $fe_module_deinits"
fi
2000-05-09 07:42:42 -04:00
done
2000-05-25 07:30:47 -04:00
file="$srcdir/src/$c/$c.c"
echo "/* this file is automatically generated by configure - don't change */" > $file
echo "void ${c}_core_init(void); void ${c}_core_deinit(void);" >> $file
2000-07-16 10:30:29 -04:00
if test "x$module_inits" != "x"; then
echo "$module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
2000-09-07 17:55:58 -04:00
echo "$module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
2000-07-16 10:30:29 -04:00
fi
2000-05-25 07:30:47 -04:00
echo "void ${c}_init(void) { ${c}_core_init(); $module_inits }" >> $file
echo "void ${c}_deinit(void) { $module_deinits ${c}_core_deinit(); }" >> $file
2000-07-16 10:30:29 -04:00
if test -d $srcdir/src/fe-common/$c; then
file="$srcdir/src/fe-common/$c/${c}-modules.c"
echo "/* this file is automatically generated by configure - don't change */" > $file
2000-08-27 18:40:08 -04:00
if test "x$fe_module_inits" != "x"; then
echo "$fe_module_inits" | $sedpath -e 's/()/(void)/g' -e 's/ /void /g' >> $file
2000-09-07 17:55:58 -04:00
echo "$fe_module_deinits" | $sedpath -e 's/ *$//' -e 's/()/(void)/g' -e 's/ /void /g' -e 's/^/void /' >> $file
2000-08-27 18:40:08 -04:00
fi
2000-07-16 10:30:29 -04:00
echo "void fe_${c}_modules_init(void) { $fe_module_inits }" >> $file
echo "void fe_${c}_modules_deinit(void) { $fe_module_deinits }" >> $file
fi
2000-05-09 07:42:42 -04:00
done
2000-04-26 04:10:09 -04:00
2000-09-06 17:30:56 -04:00
FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/core/libfe_common_core.a"
2000-07-09 11:54:35 -04:00
dnl **
dnl ** internationalization support
dnl **
2000-10-19 15:40:16 -04:00
ALL_LINGUAS="pl pt_BR fr de sv"
2000-07-09 11:54:35 -04:00
AM_GNU_GETTEXT
2000-08-12 20:27:00 -04:00
if test "x$MSGFMT" = "xno"; then
USE_NLS=no
fi
2000-04-26 04:10:09 -04:00
dnl ** common libraries needed by frontends
2000-09-29 19:59:51 -04:00
COMMON_NOUI_LIBS="$CHAT_LIBS $CORE_LIBS $INTLLIBS"
2000-05-09 07:42:42 -04:00
COMMON_LIBS="$FE_COMMON_LIBS $COMMON_NOUI_LIBS"
AC_SUBST(COMMON_NOUI_LIBS)
2000-04-26 04:10:09 -04:00
AC_SUBST(COMMON_LIBS)
1999-09-03 10:27:29 -04:00
dnl **
dnl ** memory debugging
dnl **
if test "x$want_memdebug" = "xyes"; then
AC_DEFINE(MEM_DEBUG)
fi
AM_CONDITIONAL(BUILD_MEMDEBUG, test "x$want_memdebug" = "xyes")
dnl **
dnl ** IPv6 support
dnl **
if test "x$want_ipv6" = "xyes"; then
AC_DEFINE(HAVE_IPV6)
fi
AC_OUTPUT(
Makefile
1999-10-30 09:21:14 -04:00
po/Makefile.in
intl/Makefile
1999-09-03 10:27:29 -04:00
src/Makefile
2000-04-26 04:10:09 -04:00
src/core/Makefile
src/irc/Makefile
src/irc/core/Makefile
2000-05-25 07:30:47 -04:00
src/irc/bot/Makefile
2000-04-26 04:10:09 -04:00
src/irc/dcc/Makefile
src/irc/notifylist/Makefile
2000-09-29 19:59:51 -04:00
src/irc/proxy/Makefile
2000-04-26 04:10:09 -04:00
src/irc/flood/Makefile
src/fe-common/Makefile
src/fe-common/core/Makefile
src/fe-common/irc/Makefile
src/fe-common/irc/dcc/Makefile
src/fe-common/irc/flood/Makefile
src/fe-common/irc/notifylist/Makefile
src/fe-none/Makefile
src/fe-text/Makefile
1999-09-03 10:27:29 -04:00
src/lib-config/Makefile
1999-10-06 12:47:43 -04:00
src/lib-popt/Makefile
2000-04-26 04:10:09 -04:00
src/perl/Makefile
2000-10-03 15:10:24 -04:00
src/perl/common/Makefile.PL
2000-09-29 19:59:51 -04:00
src/perl/irc/Makefile.PL
1999-09-03 10:27:29 -04:00
servertest/Makefile
2000-03-15 15:59:36 -05:00
scripts/Makefile
1999-10-30 11:56:53 -04:00
docs/Makefile
docs/help/Makefile
2000-07-26 13:52:19 -04:00
docs/help/in/Makefile
1999-09-04 07:42:33 -04:00
stamp.h
2000-05-09 07:42:42 -04:00
irssi.spec
2000-06-04 12:01:19 -04:00
irssi-version.h
2000-05-09 07:42:42 -04:00
irssi-config)
2000-01-12 17:10:30 -05:00
2000-10-03 19:54:56 -04:00
dnl ** for building from objdir
2000-10-03 18:57:14 -04:00
if test "x$want_perl" != "xno"; then
2000-03-11 15:19:24 -05:00
old_dir=`pwd` && cd $srcdir && whole_dir=`pwd` && cd $old_dir
if test "x$old_dir" != "x$whole_dir"; then
2000-12-03 02:27:39 -05:00
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
2000-10-03 20:22:59 -04:00
link=`echo $file|sed "s?$whole_dir/??"`
rm -f $link
$LN_S $file $link
2000-06-04 12:01:19 -04:00
done
2000-03-11 15:19:24 -05:00
fi
fi
2000-01-12 17:10:30 -05:00
echo
2000-07-26 19:55:32 -04:00
if test "x$curses_error" != "xyes"; then
2000-07-09 10:27:59 -04:00
echo "Building text frontend ..... : $want_textui"
else
2000-07-26 19:55:32 -04:00
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)"
2000-07-09 10:27:59 -04:00
fi
2000-09-06 17:30:56 -04:00
echo "Building irssi bot ......... : $want_irssibot"
2000-09-29 19:59:51 -04:00
echo "Building irssi proxy ....... : $want_irssiproxy"
2000-07-09 08:33:33 -04:00
echo "Building with IPv6 support . : $want_ipv6"
2000-10-03 18:57:14 -04:00
if test "x$want_perl" = "xstatic"; then
echo "Building with Perl support . : static (in irssi binary)"
elif test "x$want_perl" = "xyes"; then
echo "Building with Perl support . : module"
else
echo "Building with Perl support . : no"
fi
2001-01-01 05:42:15 -05:00
if test "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"
fi
2000-07-09 08:33:33 -04:00
if test "x$want_perl" = "xyes"; then
if test "x$PERL_LIB_DIR" = "x"; then
echo "Perl library directory ..... : (default - usually /usr/local/lib/perl_site)"
else
echo "Perl library directory ..... : $PERL_LIB_DIR"
2000-07-26 19:55:32 -04:00
if test "x$perl_lib_dir_given" != "xyes"; then
echo " - NOTE: This is automatically set to the same directory you gave with"
echo " --prefix. Irssi's perl scripts do not work unless you also add"
echo " this directory to @INC (or do some other magic)."
echo " *OR* what you might want to do instead, is to simply give --enable-perl="
echo " (nothing after '=') option to configure, and make install will install"
echo " the Perl libraries to defaut directory."
fi
2000-07-09 08:33:33 -04:00
fi
fi
echo "Install prefix ............. : $prefix"
2000-01-12 17:10:30 -05:00