2011-02-23 22:14:30 -05:00
dnl Process this file with autoconf to produce a configure script.
2012-11-10 13:46:36 -05:00
AC_INIT([HexChat],[2.9.4])
2011-02-23 22:14:30 -05:00
2012-07-14 14:54:00 -04:00
AC_PREREQ([2.60])
2011-02-23 22:14:30 -05:00
AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
AC_CONFIG_HEADERS([config.h])
2012-10-13 16:26:35 -04:00
AC_CONFIG_SRCDIR([configure.ac])
2012-07-30 10:05:34 -04:00
AC_CONFIG_MACRO_DIR([m4])
2011-02-23 22:14:30 -05:00
2012-11-09 15:56:37 -05:00
AM_INIT_AUTOMAKE([1.11 dist-bzip2 subdir-objects no-define foreign])
AM_SILENT_RULES([yes])
2011-02-23 22:14:30 -05:00
2012-07-14 14:54:00 -04:00
AC_USE_SYSTEM_EXTENSIONS
2011-02-23 22:14:30 -05:00
AM_MAINTAINER_MODE
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP
AM_PROG_AS
AM_DISABLE_STATIC
AC_PROG_LIBTOOL
dnl -----------------------------------------------------------
dnl Language Support
dnl -----------------------------------------------------------
2012-07-13 12:04:00 -04:00
GETTEXT_PACKAGE=hexchat
2011-02-23 22:14:30 -05:00
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
2012-11-03 15:57:21 -04:00
ALL_LINGUAS="af am ast az be bg ca cs da de el en_GB es et eu fi fr gl gu hi hu id it ja kn ko lt lv mk ml ms nb nl no pa pl pt pt_BR ru rw sk sl sq sr sv th uk vi wa zh_CN zh_TW"
2011-02-23 22:14:30 -05:00
AM_GNU_GETTEXT
dnl displaced from acconfig.h
AH_VERBATIM([OLD_PERL],[#undef OLD_PERL])
AH_VERBATIM([PREFIX],[#undef PREFIX])
2012-07-13 12:04:00 -04:00
AH_VERBATIM([HEXCHATLIBDIR],[#undef HEXCHATLIBDIR])
AH_VERBATIM([HEXCHATSHAREDIR],[#undef HEXCHATSHAREDIR])
2011-02-23 22:14:30 -05:00
AH_VERBATIM([SOCKS],[#undef SOCKS])
AH_VERBATIM([USE_MSPROXY],[#undef USE_MSPROXY])
2011-04-16 13:18:20 -04:00
AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY])
2011-02-23 22:14:30 -05:00
dnl AH_VERBATIM([USE_GNOME],[#undef USE_GNOME])
AH_VERBATIM([USE_SHM],[#undef USE_SHM])
AH_VERBATIM([USE_GTKSPELL],[#undef USE_GTKSPELL])
AH_VERBATIM([USE_LIBSEXY],[#undef USE_LIBSEXY])
2011-12-11 13:27:37 -05:00
AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
2011-04-16 13:18:20 -04:00
AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
2011-02-23 22:14:30 -05:00
AH_VERBATIM([USE_IPV6],[#undef USE_IPV6])
AH_VERBATIM([USE_MMX],[#undef USE_MMX])
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
AH_VERBATIM([USE_XFT],[#undef USE_XFT])
AH_VERBATIM([USE_XLIB],[#undef USE_XLIB])
AH_VERBATIM([USE_SIGACTION],[#undef USE_SIGACTION])
AH_VERBATIM([USING_FREEBSD],[#undef USING_FREEBSD])
AH_VERBATIM([USING_LINUX],[#undef USING_LINUX])
AH_VERBATIM([socklen_t],[#undef socklen_t])
AH_VERBATIM([USE_DBUS],[#undef USE_DBUS])
AC_PATH_PROG(sedpath, sed)
if test "_$sedpath" = _; then
2012-10-26 08:36:45 -04:00
AC_MSG_ERROR(Cannot find sed: I need it!)
2011-02-23 22:14:30 -05:00
fi
AC_PATH_PROG(unamepath, uname)
if test "_$unamepath" = _; then
system="unknown"
else
AC_MSG_CHECKING(system type)
system=`$unamepath -s`
AC_MSG_RESULT($system)
if test "$system" = "Linux"; then
AC_DEFINE(USING_LINUX)
fi
if test "$system" = "FreeBSD"; then
AC_DEFINE(USING_FREEBSD)
fi
fi
dnl *********************************************************************
dnl ** configure switches ***********************************************
dnl *********************************************************************
AC_ARG_ENABLE(socks,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--enable-socks],[link with SOCKS5 library (default: no)])],
2011-02-23 22:14:30 -05:00
socks=$enableval, socks=no)
AC_ARG_ENABLE(ipv6,
2012-12-05 01:06:05 -05:00
[AS_HELP_STRING([--disable-ipv6],[disable IPv6])],
2012-12-05 01:04:57 -05:00
ipv6=$enableval, ipv6=yes)
2011-02-23 22:14:30 -05:00
AC_ARG_ENABLE(xft,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--enable-xft],[enable use of Xft directly (default: no)])],
2011-02-23 22:14:30 -05:00
xft=$enableval, xft=no)
AC_ARG_ENABLE(openssl,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--enable-openssl[=PATH]],[enable use of openSSL])],
2011-02-23 22:14:30 -05:00
openssl=$enableval, openssl=yes)
AC_ARG_ENABLE(gtkfe,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-gtkfe],[disable building gtk frontend])],
2011-02-23 22:14:30 -05:00
gtkfe=$enableval, gtkfe=yes)
AC_ARG_ENABLE(textfe,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--enable-textfe],[build the text frontend (default: no)])],
2011-02-23 22:14:30 -05:00
textfe=$enableval, textfe=no)
dnl AC_ARG_ENABLE(gnome,
2012-11-09 14:09:10 -05:00
dnl [AS_HELP_STRING([--disable-gnome],[disable use of gnome])],
2011-02-23 22:14:30 -05:00
dnl gnome=$enableval, gnome=yes)
AC_ARG_ENABLE(xlib,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-xlib],[disable use of xlib (for non X11 systems)])],
2011-02-23 22:14:30 -05:00
xlib=$enableval, xlib=yes)
AC_ARG_ENABLE(python,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-python],[don't build the python plugin])],
2011-02-23 22:14:30 -05:00
python=$enableval, python=yes)
AC_ARG_ENABLE(perl,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-perl],[don't build the perl plugin])],
2011-02-23 22:14:30 -05:00
perl=$enableval, perl=yes)
AC_ARG_ENABLE(perl_old,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-perl_old],[no backwards compatibility for perl plugin])],
2011-02-23 22:14:30 -05:00
perl_old=$enableval, perl_old=yes)
2012-11-12 13:03:19 -05:00
dnl AC_ARG_ENABLE(tcl,
dnl [AS_HELP_STRING([--enable-tcl[=PATH]],[directory with Tcl config file: tclConfig.sh])],
dnl tcl=$enableval, tcl=yes)
2011-02-23 22:14:30 -05:00
2012-07-18 08:50:58 -04:00
AC_ARG_ENABLE(plugin,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-plugin],[disable plugin support])],
2012-07-18 08:50:58 -04:00
plugin=$enableval, plugin=yes)
AC_ARG_ENABLE(checksum,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-checksum],[disable the Checksum plugin])],
2012-07-18 08:50:58 -04:00
checksum=$enableval, checksum=yes)
2012-07-17 13:19:48 -04:00
2012-07-17 13:47:19 -04:00
AC_ARG_ENABLE(doat,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-doat],[disable the Do At plugin])],
2012-07-17 13:47:19 -04:00
doat=$enableval, doat=yes)
2012-07-18 04:51:22 -04:00
AC_ARG_ENABLE(fishlim,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-fishlim],[disable the FiSHLiM plugin])],
2012-07-18 04:51:22 -04:00
fishlim=$enableval, fishlim=yes)
2012-10-25 10:40:26 -04:00
dnl AC_ARG_ENABLE(sasl,
2012-11-09 14:09:10 -05:00
dnl [AS_HELP_STRING([--disable-sasl],[disable the SASL plugin])],
2012-10-25 10:40:26 -04:00
dnl sasl=$enableval, sasl=yes)
2011-02-23 22:14:30 -05:00
2012-10-21 02:06:09 -04:00
AC_ARG_ENABLE(sysinfo,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-sysinfo],[disable the SysInfo plugin])],
2012-10-21 02:06:09 -04:00
sysinfo=$enableval, sysinfo=yes)
2011-02-23 22:14:30 -05:00
AC_ARG_ENABLE(dbus,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-dbus],[disable DBUS support])],
2011-02-23 22:14:30 -05:00
dbus=$enableval, dbus=yes)
2011-04-16 13:18:20 -04:00
AC_ARG_ENABLE(libnotify,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-libnotify],[disable libnotify support])],
2011-04-16 13:18:20 -04:00
libnotify=$enableval, libnotify=yes)
2011-02-23 22:14:30 -05:00
AC_ARG_ENABLE(mmx,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-mmx],[disable MMX assembly routines])],
2011-02-23 22:14:30 -05:00
mmx=$enableval, mmx=yes)
AC_ARG_ENABLE(shm,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--enable-shm],[enable use of XShm for fast tinting (default: no)])],
2011-02-23 22:14:30 -05:00
shm=$enableval, shm=no)
AC_ARG_ENABLE(spell,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--enable-spell=type],[enable spelling type: none static libsexy gtkspell])],
2012-07-13 15:28:23 -04:00
spell=$enableval, spell=static)
2011-02-23 22:14:30 -05:00
AC_ARG_ENABLE(ntlm,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--enable-ntlm],[enable Microsoft's NTLM auth (libntlm) library support (default: no)])],
2011-02-23 22:14:30 -05:00
ntlm=$enableval, ntlm=no)
2012-09-23 19:35:50 -04:00
AC_ARG_ENABLE(libproxy,
2012-11-09 14:09:10 -05:00
[AS_HELP_STRING([--disable-libproxy],[disable libproxy support (default: auto)])],
2012-09-23 19:35:50 -04:00
libproxy=$enableval, libproxy=auto)
2011-02-23 22:14:30 -05:00
dnl *********************************************************************
dnl ** GLIB *************************************************************
dnl *********************************************************************
2012-07-14 14:54:00 -04:00
AM_PATH_GLIB_2_0(2.12.0, glib=yes, glib=no)
2011-02-23 22:14:30 -05:00
if test "$glib" = no; then
2012-10-26 08:36:45 -04:00
AC_MSG_ERROR(Cannot find GLib!)
2011-02-23 22:14:30 -05:00
fi
COMMON_CFLAGS="$GLIB_CFLAGS"
COMMON_LIBS="$GLIB_LIBS"
2012-08-23 10:27:34 -04:00
COMMON_LIBS="$COMMON_LIBS -lgmodule-2.0"
2011-02-23 22:14:30 -05:00
dnl *********************************************************************
dnl ** GTK **************************************************************
dnl *********************************************************************
AM_PATH_GTK_2_0(2.10.0, havegtk=yes, havegtk=no)
if test "$havegtk" = no; then
gtkfe=no
echo
echo Cannot find GTK\! Not building GTK FrontEnd.
echo
fi
if test "$gtkfe" != yes; then
gnome=no
COMMON_LIBS="$GLIB_LIBS"
COMMON_CFLAGS="$GLIB_CFLAGS"
fi
dnl *********************************************************************
dnl ** GNOME ************************************************************
dnl *********************************************************************
GUI_LIBS="$GUI_LIBS $GTK_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS"
gnome=no
#if test "$gnome" = yes; then
# AC_PATH_PROG(pkgconfigpath, pkg-config)
# AC_MSG_CHECKING(Gnome2 compile flags)
# GNOME_CFLAGS="`$pkgconfigpath libgnome-2.0 --cflags 2>/dev/null`"
# if test "_$GNOME_CFLAGS" = _ ; then
# gnome=no
# AC_MSG_RESULT([Gnome not found, building without it.])
# else
# GNOME_VER="`$pkgconfigpath libgnome-2.0 --modversion`"
# GUI_LIBS="$GUI_LIBS `$pkgconfigpath libgnome-2.0 --libs`"
# GUI_CFLAGS="$GUI_CFLAGS $GNOME_CFLAGS"
# AC_DEFINE(USE_GNOME)
# AC_MSG_RESULT(ok)
# fi
#fi
# GConf
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
dnl *********************************************************************
dnl ** XFT **************************************************************
dnl *********************************************************************
if test "$xft" = yes; then
AC_PATH_PROG(pkgconfigpath, pkg-config)
if $pkgconfigpath xft --exists; then
GUI_CFLAGS="$GUI_CFLAGS `$pkgconfigpath xft --cflags`"
GUI_LIBS="$GUI_LIBS `$pkgconfigpath xft --libs`"
else
xft=no
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
AC_CHECK_HEADERS(X11/Xft/Xft.h, xft=yes)
CPPFLAGS=$oldCPPFLAGS
fi
if test "$xft" = yes; then
AC_DEFINE(USE_XFT)
fi
fi
dnl *********************************************************************
dnl ** XLIB *************************************************************
dnl *********************************************************************
if test "$xlib" = yes; then
AC_DEFINE(USE_XLIB)
if test "$system" = "SunOS"; then
LIBS="$LIBS -L/usr/openwin/lib -lX11"
else
AC_CHECK_LIB(X11, XSetWMHints)
fi
else
shm=no
fi
dnl *********************************************************************
dnl ** PERL *************************************************************
dnl *********************************************************************
if test "$perl" = yes; then
AC_PATH_PROG(perlpath, perl)
AC_MSG_CHECKING(for Perl compile flags)
PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
if test "_$PERL_CFLAGS" = _ ; then
AC_MSG_RESULT([not found, building without perl.])
perl=no
else
PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts |$sedpath 's/-lgdbm //'`
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-ldb //'`
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lndbm //'`
if test "$system" = "Linux"; then
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lnsl //'`
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lposix //'`
fi
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lc //'`
AC_MSG_RESULT(ok)
# oldLIBS=$LIBS
# LIBS="$LIBS $PERL_LDFLAGS"
# AC_CHECK_FUNC(eval_pv)
# AC_CHECK_FUNC(call_pv)
# LIBS=$oldLIBS
AC_MSG_CHECKING(for perl >= 5.8.0)
PERL_VER=`$perlpath -e 'print $]>= 5.008?"yes":"no"'`
if test "$PERL_VER" = "yes"; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(if perl plugin will be backward compatible)
if test "$perl_old" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(OLD_PERL)
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no)
echo "perl version too old, building without perl."
perl=no
fi
fi
fi
dnl *********************************************************************
dnl ** PYTHON ***********************************************************
dnl *********************************************************************
if test "$python" = yes; then
AC_PATH_PROG(pythonpath, python2)
if test "_$pythonpath" = _ ; then
AC_PATH_PROG(pythonpath, python)
fi
if test "_$pythonpath" = _ ; then
python=no
else
AC_MSG_CHECKING(Python version)
changequote(<<, >>)dnl
PY_VER=`$pythonpath -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_vars("VERSION")[0];'`
PY_LIB=`$pythonpath -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1);'`
PY_INC=`$pythonpath -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_vars("INCLUDEPY")[0];'`
$pythonpath -c "import sys; map(int,sys.version[:3].split('.')) >= [2,2] or sys.exit(1)"
changequote([, ])dnl
AC_MSG_RESULT($PY_VER)
if test "$?" != "1"; then
AC_MSG_CHECKING(Python compile flags)
PY_PREFIX=`$pythonpath -c 'import sys; print sys.prefix'`
PY_EXEC_PREFIX=`$pythonpath -c 'import sys; print sys.exec_prefix'`
if test -f $PY_INC/Python.h; then
PY_LIBS="-L$PY_LIB/config -lpython$PY_VER -lpthread -lutil"
PY_CFLAGS="-I$PY_INC"
AC_MSG_RESULT(ok)
else
python=no
AC_MSG_RESULT([Can't find Python.h])
fi
else
echo "Python too old. Only 2.2 or above is supported."
python=no
fi
fi
fi
dnl *********************************************************************
dnl ** TCL **************************************************************
dnl *********************************************************************
2012-11-12 13:03:19 -05:00
dnl AC_MSG_CHECKING(for location of tclConfig.sh)
dnl dirs="$tcl /lib /usr/lib /usr/tcl/lib /usr/lib/tcl8.4 /usr/local/lib /usr/local/tcl-8.4/lib /usr/local/tcl/lib /opt/lib /usr/lib/tcl8.3"
dnl found=0
dnl if test "$tcl" != "no"; then
dnl tcl=no
dnl for try in $dirs; do
dnl if test -f $try/tclConfig.sh; then
dnl found=1
dnl . $try/tclConfig.sh
dnl TCL_LIBS="$TCL_LIB_SPEC $TCL_LIBS"
dnl TCL_CFLAGS="-I${TCL_PREFIX}/include $TCL_INCLUDE_SPEC"
dnl tcl=yes
dnl AC_MSG_RESULT($try/tclConfig.sh)
dnl break
dnl fi
dnl done
dnl if test "$found" -eq 0 ; then
dnl AC_MSG_RESULT([tclConfig.sh not found - use the --enable-tcl option])
dnl fi
dnl fi
2011-02-23 22:14:30 -05:00
dnl *********************************************************************
dnl ** IPv6 *************************************************************
dnl *********************************************************************
dnl purely for Solaris
AC_CHECK_FUNC(select, ,
AC_CHECK_LIB(socket, select, ,
AC_CHECK_LIB(nsl, select, ,
AC_CHECK_LIB(inet, select, ,
AC_CHECK_LIB(cposix, select, ,
AC_CHECK_LIB(net, select, ,
AC_MSG_WARN(i can not find select. you might need to help me)))))))
AC_CHECK_LIB(socket, select)
if test "$ipv6" = yes; then
AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes)
AC_MSG_CHECKING(whether to enable IPv6 support)
if test "$have_getaddrinfo" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(USE_IPV6)
else
ipv6=no
AC_MSG_RESULT(no)
fi
fi
dnl *********************************************************************
dnl ** OPENSSL **********************************************************
dnl *********************************************************************
retry=no
if test "$openssl" != no; then
AC_PATH_PROG(pkgconfigpath, pkg-config)
AC_MSG_CHECKING(for openssl through pkg-config)
if $pkgconfigpath openssl --exists; then
CPPFLAGS="$CPPFLAGS `$pkgconfigpath openssl --cflags`"
LIBS="$LIBS `$pkgconfigpath openssl --libs`"
AC_DEFINE(USE_OPENSSL)
AC_MSG_RESULT(yes)
openssl=yes
else
AC_MSG_RESULT(no)
retry=yes
fi
fi
if test "$retry" = "yes"; then
unset openssl_path ac_cv_lib_ssl_SSL_new ac_cv_header_openssl_ssl_h
if test "$openssl" != yes; then
openssl_path=$openssl
fi
openssl=no
SAVED_LIBS=$LIBS
LIBS="$LIBS -lcrypto"
if test -n "$openssl_path"; then
LIBS="-L$openssl_path/lib $LIBS"
fi
AC_CHECK_LIB(ssl, SSL_new, have_openssl=yes)
LIBS=$SAVED_LIBS
if test "$have_openssl" = yes; then
SAVED_CPPFLAGS=$CPPFLAGS
if test -n "$openssl_path"; then
CPPFLAGS="-I$openssl_path/include $CPPFLAGS"
fi
AC_CHECK_HEADERS(openssl/ssl.h, have_openssl_h=yes)
if test "$have_openssl_h" = yes; then
openssl=yes
AC_DEFINE(USE_OPENSSL)
LIBS="$LIBS -lssl -lcrypto"
if test -n "$openssl_path"; then
LIBS="-L$openssl_path/lib $LIBS"
fi
else
CPPFLAGS=$SAVED_CPPFLAGS
fi
fi
fi
dnl *********************************************************************
dnl ** LIBPROXY *********************************************************
dnl *********************************************************************
2012-09-23 19:35:50 -04:00
if test "x$libproxy" = "xyes" -o "x$libproxy" = "xauto" ; then
PKG_CHECK_MODULES([LIBPROXY], [libproxy-1.0], [
COMMON_LIBS="$COMMON_LIBS $LIBPROXY_LIBS"
COMMON_CFLAGS="$COMMON_CFLAGS $LIBPROXY_CFLAGS"
AC_DEFINE(USE_LIBPROXY)
libproxy=yes
], [
if test "x$libproxy" = "xyes" ; then
2012-10-26 08:36:45 -04:00
AC_MSG_ERROR(Cannot find libproxy!)
2012-09-23 19:35:50 -04:00
fi
libproxy=no
])
else
2011-04-16 13:18:20 -04:00
libproxy=no
fi
2011-02-23 22:14:30 -05:00
dnl *********************************************************************
dnl ** PLUGIN ***********************************************************
dnl *********************************************************************
if test "$plugin" = yes; then
AC_CHECK_FUNCS(dlopen, have_dl=yes)
if test "$have_dl" != yes; then
AC_CHECK_LIB(dl, dlopen, have_dl=yes)
if test "$have_dl" = yes; then
LIBS="$LIBS -ldl"
fi
fi
if test "$have_dl" = yes; then
AC_DEFINE(USE_PLUGIN)
AC_PATH_PROG(pkgconfigpath, pkg-config)
dnl we just need the -Wl,--export-dynamic, but not -lgmodule-2.0
RDYNAMIC_FLAGS="`$pkgconfigpath gmodule-2.0 --libs | $sedpath 's/ -lgmodule-2.0//'`"
LIBS="$LIBS $RDYNAMIC_FLAGS"
if test "$LD" = ""; then
VS="`ld --help | grep version-script 2> /dev/null`"
else
VS="`$LD --help | grep version-script 2> /dev/null`"
fi
if test "$VS" != ""; then
GUI_LIBS="$GUI_LIBS -Wl,--version-script,\$(srcdir)/../version-script"
fi
else
plugin=no
fi
fi
2012-07-18 04:51:22 -04:00
dnl *********************************************************************
2012-07-18 08:50:58 -04:00
dnl ** Checksum *********************************************************
2012-07-18 04:51:22 -04:00
dnl *********************************************************************
2012-07-18 08:50:58 -04:00
if test "$checksum" != "no"; then
checksum=no
AC_MSG_CHECKING(for plugin interface used by Checksum)
2012-07-18 04:51:22 -04:00
if test "$plugin" = yes; then
AC_MSG_RESULT([yes])
2012-07-18 08:50:58 -04:00
AC_MSG_CHECKING(for OpenSSL used by Checksum)
if test "$openssl" = yes; then
checksum=yes
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([OpenSSL cannot be found, use the --enable-openssl option])
fi
2012-07-18 04:51:22 -04:00
else
2012-07-18 08:50:58 -04:00
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
2012-07-18 04:51:22 -04:00
fi
fi
dnl *********************************************************************
dnl ** DO AT ************************************************************
dnl *********************************************************************
if test "$doat" != "no"; then
AC_MSG_CHECKING(for plugin interface used by Do At)
doat=no
if test "$plugin" = yes; then
doat=yes
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Do At])
fi
fi
dnl *********************************************************************
dnl ** FiSHLiM **********************************************************
dnl *********************************************************************
if test "$fishlim" != "no"; then
fishlim=no
AC_MSG_CHECKING(for plugin interface used by FiSHLiM)
if test "$plugin" = yes; then
AC_MSG_RESULT([yes])
2012-07-18 08:03:15 -04:00
AC_MSG_CHECKING(for OpenSSL used by FiSHLiM)
if test "$openssl" = yes; then
fishlim=yes
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([OpenSSL cannot be found, use the --enable-openssl option])
fi
2012-07-18 04:51:22 -04:00
else
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
fi
fi
2012-07-18 08:50:58 -04:00
dnl *********************************************************************
dnl ** SASL *************************************************************
dnl *********************************************************************
2012-10-25 10:40:26 -04:00
dnl if test "$sasl" != "no"; then
dnl AC_MSG_CHECKING(for plugin interface used by SASL)
dnl sasl=no
dnl if test "$plugin" = yes; then
dnl sasl=yes
dnl AC_MSG_RESULT([yes])
dnl else
dnl AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for SASL])
dnl fi
dnl fi
2012-07-18 08:50:58 -04:00
2012-10-21 02:06:09 -04:00
dnl *********************************************************************
dnl ** SYSINFO **********************************************************
dnl *********************************************************************
if test "$sysinfo" != "no"; then
AC_MSG_CHECKING(for plugin interface used by SysInfo)
if test "$plugin" = yes; then
AC_MSG_RESULT([yes])
2012-10-26 08:36:45 -04:00
PKG_CHECK_MODULES(LIBPCI, libpci >= 3.0.0, [sysinfo=yes], [sysinfo=no])
2012-10-21 02:06:09 -04:00
else
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for SysInfo])
2012-10-26 08:36:45 -04:00
sysinfo=no
2012-10-21 02:06:09 -04:00
fi
fi
2011-02-23 22:14:30 -05:00
dnl #######################################################################
dnl # Check for DBUS libraries
dnl #######################################################################
if test "x$dbus" = "xyes" ; then
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60 gthread-2.0], dbus=yes, [
dbus=no
])
AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool, no)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no)
if test "x$DBUS_BINDING_TOOL" = "xno" || test "x$GLIB_GENMARSHAL" = "xno" || test "x$dbus" = "xno" ; then
dbus="no"
else
2012-07-18 15:19:11 -04:00
COMMON_LIBS="$COMMON_LIBS $DBUS_LIBS"
2011-02-23 22:14:30 -05:00
COMMON_CFLAGS="$COMMON_CFLAGS $DBUS_CFLAGS"
AC_DEFINE(USE_DBUS)
2012-09-20 10:04:14 -04:00
AS_AC_EXPAND(DBUS_SERVICES_DIR, "$datadir/dbus-1/services")
2011-02-23 22:14:30 -05:00
AC_SUBST(DBUS_SERVICES_DIR)
AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
fi
fi
2011-04-16 13:18:20 -04:00
dnl *********************************************************************
dnl ** LIBNOTIFY ********************************************************
dnl *********************************************************************
if test "x$libnotify" = "xyes" ; then
PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= 0.4, [], [
libnotify=no
])
if test "$libnotify" != "no" ; then
GUI_LIBS="$GUI_LIBS $LIBNOTIFY_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $LIBNOTIFY_CFLAGS"
AC_DEFINE(USE_LIBNOTIFY)
fi
fi
2011-02-23 22:14:30 -05:00
dnl *********************************************************************
dnl ** SPELL ************************************************************
dnl *********************************************************************
if test "$spell" = "gtkspell" ; then
PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, [], [
spell=no
])
if test "$spell" != "no" ; then
GUI_LIBS="$GUI_LIBS $GTKSPELL_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTKSPELL_CFLAGS"
AC_DEFINE(USE_GTKSPELL)
fi
fi
if test "$spell" = "libsexy" ; then
2012-09-22 11:36:38 -04:00
PKG_CHECK_MODULES([LIBSEXY], [libsexy >= 0.1.8], [
libsexy=yes
2011-02-23 22:14:30 -05:00
GUI_LIBS="$GUI_LIBS $LIBSEXY_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $LIBSEXY_CFLAGS"
AC_DEFINE(USE_LIBSEXY)
2012-09-22 11:36:38 -04:00
], [
2011-02-23 22:14:30 -05:00
dnl use builtin static one
spell="static"
2012-09-22 11:36:38 -04:00
])
2011-02-23 22:14:30 -05:00
fi
if test "$spell" = "static" ; then
2011-12-11 13:27:37 -05:00
PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.0.0, [
AC_DEFINE(HAVE_ISO_CODES)
2011-02-23 22:14:30 -05:00
AC_DEFINE(USE_LIBSEXY)
2011-12-11 13:27:37 -05:00
GUI_CFLAGS="$GUI_CFLAGS -I/usr/include/libxml2"
LIBS="$LIBS -lxml2"
], [
2012-10-26 08:36:45 -04:00
AC_MSG_ERROR(Cannot find libxml2!)
2011-12-11 13:27:37 -05:00
])
2011-02-23 22:14:30 -05:00
fi
dnl *********************************************************************
dnl ** CONDITIONALS *****************************************************
dnl *********************************************************************
AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
AM_CONDITIONAL(USE_LIBSEXY, test "x$spell" = "xstatic")
2011-04-16 13:18:20 -04:00
AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
2011-02-23 22:14:30 -05:00
AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
AM_CONDITIONAL(DO_PYTHON, test "x$python" = "xyes")
2012-11-12 13:03:19 -05:00
dnl AM_CONDITIONAL(DO_TCL, test "x$tcl" = "xyes")
2012-07-18 08:50:58 -04:00
AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
AM_CONDITIONAL(DO_CHECKSUM, test "x$checksum" = "xyes")
2012-07-17 13:47:19 -04:00
AM_CONDITIONAL(DO_DOAT, test "x$doat" = "xyes")
2012-07-18 04:51:22 -04:00
AM_CONDITIONAL(DO_FISHLIM, test "x$fishlim" = "xyes")
2012-10-25 10:40:26 -04:00
dnl AM_CONDITIONAL(DO_SASL, test "x$sasl" = "xyes")
2012-10-21 02:06:09 -04:00
AM_CONDITIONAL(DO_SYSINFO, test "x$sysinfo" = "xyes")
2011-02-23 22:14:30 -05:00
AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
AM_CONDITIONAL(DO_GCONF, test "x$GCONFTOOL" != "xno")
dnl *********************************************************************
dnl ** SOCKS5 ***********************************************************
dnl *********************************************************************
if test "$socks" = yes; then
socks=no
AC_CHECK_LIB(socks5, SOCKSconnect, have_socks=yes)
if test "$have_socks" = yes; then
AC_CHECK_HEADERS(socks.h, have_socks_h=yes)
if test "$have_socks_h" = yes; then
socks=yes
AC_DEFINE(SOCKS)
LIBS="$LIBS -lsocks5"
fi
fi
fi
dnl *********************************************************************
dnl ** MS PROXY *********************************************************
dnl *********************************************************************
have_ntlm="no"
if test "x$ntlm" = "xyes" ; then
have_ntlm="no"
AC_CHECK_LIB(ntlm, ntlm_smb_encrypt, have_ntlm=yes)
if test "$have_ntlm" = yes; then
LIBS="$LIBS -lntlm"
AC_DEFINE(USE_MSPROXY)
fi
fi
dnl *********************************************************************
dnl ** XShm *************************************************************
dnl *********************************************************************
if test "$shm" = yes; then
oldl=$LIBS
oldc=$CPPFLAGS
LIBS="$LIBS `$pkgconfigpath --libs-only-L xft`"
CPPFLAGS="$CPPFLAGS `$pkgconfigpath --cflags-only-I xft`"
shm=no
AC_CHECK_LIB(Xext, XShmAttach, shm=yes)
if test "$shm" = yes; then
shm=no
AC_CHECK_HEADERS(sys/ipc.h, shm=yes)
if test "$shm" = yes; then
shm=no
AC_CHECK_HEADERS(sys/shm.h, shm=yes)
fi
fi
LIBS=$oldl
if test "$shm" = yes; then
GUI_LIBS="$GUI_LIBS `$pkgconfigpath --libs-only-L xft` -lX11 -lXext"
AC_DEFINE(USE_SHM)
else
CPPFLAGS=$oldc
fi
fi
dnl *********************************************************************
dnl ** MMX **************************************************************
dnl *********************************************************************
dnl we don't need mmx on *this* machine, just i386, because
dnl it's checked at runtime.
if test "$mmx" = "yes"; then
case $host_cpu in
i386|i486|i586|i686|i786|k6|k7)
mmx=yes
;;
*)
mmx=no
esac
if test "$system" = "OpenBSD"; then
dnl openbsd fails because mmx_cmod doesn't prefix its symbols with underscore.
dnl xtext.o: Undefined symbol `_shade_ximage_15_mmx' referenced from text segment
mmx=no
fi
if test "$mmx" = "yes"; then
AC_DEFINE(USE_MMX)
fi
fi
AM_CONDITIONAL(USE_MMX, test "$mmx" = "yes")
dnl *********************************************************************
dnl ** GCC FLAGS ********************************************************
dnl *********************************************************************
dnl Only use -Wall and -pipe if we have gcc
if test "x$GCC" = "xyes"; then
if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
CFLAGS="$CFLAGS -Wall"
fi
if test "$system" = "Linux" -o "$system" = "FreeBSD"; then
if test -z "`echo "$CFLAGS" | grep "\-pipe" 2> /dev/null`" ; then
CFLAGS="$CFLAGS -pipe"
fi
fi
if test -z "`echo "$CFLAGS" | grep "\-g " 2> /dev/null`" ; then
CFLAGS="$CFLAGS -g"
fi
fi
dnl does this compiler support -Wno-pointer-sign ?
AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign ])
safe_CFLAGS=$CFLAGS
CFLAGS="-Wno-pointer-sign"
AC_TRY_COMPILE(, [
int main () { return 0 ; }
],
[
no_pointer_sign=yes
AC_MSG_RESULT([yes])
], [
no_pointer_sign=no
AC_MSG_RESULT([no])
])
CFLAGS=$safe_CFLAGS
if test x$no_pointer_sign = xyes; then
CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
dnl does this compiler support -funsigned-char ?
AC_MSG_CHECKING([if gcc accepts -funsigned-char ])
safe_CFLAGS=$CFLAGS
CFLAGS="-funsigned-char"
AC_TRY_COMPILE(, [
int main () { return 0 ; }
],
[
unsigned_char=yes
AC_MSG_RESULT([yes])
], [
unsigned_char=no
AC_MSG_RESULT([no])
])
CFLAGS=$safe_CFLAGS
if test x$unsigned_char = xyes; then
CFLAGS="$CFLAGS -funsigned-char"
fi
dnl *********************************************************************
dnl ** FUNCTIONS/LIBS/CFLAGS ********************************************
dnl *********************************************************************
AC_MSG_CHECKING(for modern sigaction)
dnl libc5 on linux and FreeBSD 3.x doesn't have siginfo_t
dnl and the sa_sigation field.
AC_TRY_COMPILE(
[#include <signal.h>],
[struct sigaction act;
siginfo_t *si;
act.sa_sigaction = 0;],
[
AC_MSG_RESULT(yes)
AC_DEFINE(USE_SIGACTION)
],
AC_MSG_RESULT(no))
AC_PATH_PROG(gdkpixbufcsourcepath, gdk-pixbuf-csource)
AC_SUBST(gdkpixbufcsourcepath)
if test "$gtkfe" != no -a "_$gdkpixbufcsourcepath" = _; then
2012-10-26 08:36:45 -04:00
AC_MSG_ERROR(Cannot find gdk-pixbuf-csource: Install GTK+ 2.0!)
2011-02-23 22:14:30 -05:00
fi
dnl if we don't have this, use g_snprintf instead
AC_CHECK_FUNCS(snprintf vsnprintf memrchr strtoull)
AC_CHECK_FUNC(gethostbyname, ,
AC_CHECK_LIB(resolv, gethostbyname, ,
AC_CHECK_LIB(nsl, gethostbyname)))
AC_CHECK_FUNC(gethostname, , AC_CHECK_LIB(nsl, gethostname))
dnl necessary for IRIX
AC_CHECK_HEADERS(strings.h)
dnl Check for type in sys/socket.h - from Squid source (GPL)
AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
#include <sys/socket.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no)
])
if test $ac_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int)
fi
dnl Mac OS X and Darwin use lookupd, which caches DNS queries by default
AC_EGREP_CPP(lookupd, dnl
[#if (defined(__APPLE__) && defined(__MACH__))
lookupd
#endif], AC_DEFINE([LOOKUPD],1,[Define to 1 if the system uses lookupd]))
dnl freebsd needs this
LIBS="$LIBS $INTLLIBS"
CFLAGS="$CFLAGS $CPPFLAGS"
GUI_LIBS="$GUI_LIBS $COMMON_LIBS"
dnl make these visible to all Makefiles
AC_SUBST(GUI_LIBS)
AC_SUBST(GUI_CFLAGS)
AC_SUBST(COMMON_LIBS)
AC_SUBST(COMMON_CFLAGS)
AC_SUBST(PERL_CFLAGS)
AC_SUBST(PERL_LDFLAGS)
AC_SUBST(PY_CFLAGS)
AC_SUBST(PY_LIBS)
2012-11-12 13:03:19 -05:00
dnl AC_SUBST(TCL_LIBS)
dnl AC_SUBST(TCL_CFLAGS)
2011-02-23 22:14:30 -05:00
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
PLUGIN_INCLUDES='-I$(top_srcdir)/plugins'
AC_SUBST(PLUGIN_INCLUDES)
dnl for plugin.c and pixmaps.c
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
test "x$exec_prefix" = xNONE && exec_prefix="$prefix"
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
2012-09-20 10:04:14 -04:00
AS_AC_EXPAND(HEXCHATLIBDIR, "${libdir}/hexchat")
2012-07-13 12:04:00 -04:00
AC_DEFINE_UNQUOTED(HEXCHATLIBDIR, "$HEXCHATLIBDIR")
2011-02-23 22:14:30 -05:00
2012-09-20 10:04:14 -04:00
AS_AC_EXPAND(HEXCHATSHAREDIR, "$datadir")
2012-07-13 12:04:00 -04:00
AC_DEFINE_UNQUOTED(HEXCHATSHAREDIR, "$HEXCHATSHAREDIR")
2011-02-23 22:14:30 -05:00
dnl for plugins/xxx/Makefile.am
2012-07-13 12:04:00 -04:00
hexchatlibdir=${libdir}/hexchat
AC_SUBST(hexchatlibdir)
2011-02-23 22:14:30 -05:00
AC_OUTPUT([
Makefile
2012-12-16 20:29:08 -05:00
share/Makefile
share/icons/Makefile
share/misc/Makefile
2011-02-23 22:14:30 -05:00
src/Makefile
src/common/Makefile
src/common/dbus/Makefile
src/fe-text/Makefile
src/fe-gtk/Makefile
src/pixmaps/Makefile
plugins/Makefile
plugins/python/Makefile
plugins/perl/Makefile
2012-07-18 08:50:58 -04:00
plugins/checksum/Makefile
2012-07-17 13:47:19 -04:00
plugins/doat/Makefile
2012-07-18 04:51:22 -04:00
plugins/fishlim/Makefile
2012-10-21 02:06:09 -04:00
plugins/sysinfo/Makefile
2011-02-23 22:14:30 -05:00
intl/Makefile
po/Makefile.in
2012-10-27 13:07:59 -04:00
man/Makefile
2011-02-23 22:14:30 -05:00
])
2012-11-12 13:03:19 -05:00
dnl plugins/tcl/Makefile
2012-10-25 10:46:11 -04:00
dnl plugins/sasl/Makefile
2011-02-23 22:14:30 -05:00
echo
2012-07-17 13:19:48 -04:00
echo HexChat $VERSION
2011-02-23 22:14:30 -05:00
echo
2012-07-18 09:41:01 -04:00
echo GTK+ interface ........ : $gtkfe
echo Text interface ........ : $textfe
2011-02-23 22:14:30 -05:00
echo
2012-07-18 09:41:01 -04:00
echo MMX tinting ........... : $mmx
echo XShm tinting .......... : $shm
2011-02-23 22:14:30 -05:00
if test "$xft" = no; then
2012-07-18 09:41:01 -04:00
echo Text backend .......... : Pango
2011-02-23 22:14:30 -05:00
else
2012-07-18 09:41:01 -04:00
echo Text backend .......... : Xft
fi
echo OpenSSL support ....... : $openssl
echo D-Bus support ......... : $dbus
echo libnotify support ..... : $libnotify
echo Spelling .............. : $spell
echo Plugin interface ...... : $plugin
echo NLS/gettext ........... : $USE_NLS
echo IPv6 support .......... : $ipv6
echo MS Proxy NTLM \(ISA\) ... : $have_ntlm
2012-09-23 19:35:50 -04:00
echo libproxy support ...... : $libproxy
2012-07-18 08:50:58 -04:00
echo
2012-07-18 09:41:01 -04:00
echo Perl .................. : $perl
echo Python ................ : $python
2012-11-12 13:03:19 -05:00
dnl echo Tcl ................... : $tcl
2011-02-23 22:14:30 -05:00
echo
2012-07-18 09:41:01 -04:00
echo Checksum .............. : $checksum
echo Do At ................. : $doat
echo FiSHLiM ............... : $fishlim
2012-10-25 10:40:26 -04:00
dnl echo SASL .................. : $sasl
2012-10-21 02:06:09 -04:00
echo SysInfo ............... : $sysinfo
2012-07-17 13:19:48 -04:00
echo
2011-02-23 22:14:30 -05:00
echo The binary will be installed in $prefix/bin
echo
if test "$gtkfe" = no; then
echo Warning: The GTK \(GUI\) frontend will not be built.
echo
fi
if test "$spell" = "gtkspell"; then
echo Warning: GTK SPELL is not the recommended spelling library.
echo
fi
echo configure complete, now type \'make\' and pray.
echo