2011-02-24 04:14:30 +01:00
dnl Process this file with autoconf to produce a configure script.
2016-05-01 20:34:46 +02:00
AC_INIT([HexChat],[2.12.1])
2011-02-24 04:14:30 +01:00
2015-04-22 04:51:09 +02:00
AC_PREREQ([2.64])
2011-02-24 04:14:30 +01:00
AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
AC_CONFIG_HEADERS([config.h])
2012-10-13 22:26:35 +02:00
AC_CONFIG_SRCDIR([configure.ac])
2011-02-24 04:14:30 +01:00
2013-07-12 14:10:51 +02:00
AC_CONFIG_MACRO_DIR([m4])
2016-03-31 14:01:06 +02:00
AC_CONFIG_AUX_DIR([build-aux])
2012-11-09 21:56:37 +01:00
2015-10-17 09:43:49 +02:00
AM_INIT_AUTOMAKE([1.11.1 dist-xz no-dist-gzip subdir-objects no-define foreign])
2012-11-09 21:56:37 +01:00
AM_SILENT_RULES([yes])
2011-02-24 04:14:30 +01:00
2016-03-07 00:54:07 +01:00
AC_DEFUN([HEX_CHECK_MACRO], [m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined. Is ]$2[ installed?])])])
2016-03-07 01:02:48 +01:00
HEX_CHECK_MACRO([AX_APPEND_COMPILE_FLAGS], [autoconf-archive])
2016-03-07 00:54:07 +01:00
HEX_CHECK_MACRO([PKG_PROG_PKG_CONFIG], [pkg-config])
2015-04-22 01:14:23 +02:00
AX_IS_RELEASE([minor-version])
AX_CHECK_ENABLE_DEBUG([yes])
2012-07-14 20:54:00 +02:00
AC_USE_SYSTEM_EXTENSIONS
2015-04-22 00:56:53 +02:00
AM_MAINTAINER_MODE([enable])
2011-02-24 04:14:30 +01:00
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP
2015-02-05 03:49:58 +01:00
AC_PROG_OBJC
2011-02-24 04:14:30 +01:00
AM_PROG_AS
2014-06-22 05:13:05 +02:00
AM_PROG_AR
2015-04-22 04:51:09 +02:00
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
2013-08-28 00:39:15 +02:00
AC_PATH_PROG(MDTOOL, mdtool, no)
2015-04-23 04:11:31 +02:00
PKG_PROG_PKG_CONFIG
2011-02-24 04:14:30 +01:00
dnl -----------------------------------------------------------
dnl Language Support
dnl -----------------------------------------------------------
2012-07-13 18:04:00 +02:00
GETTEXT_PACKAGE=hexchat
2011-02-24 04:14:30 +01:00
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
2014-01-13 03:31:28 +01:00
IT_PROG_INTLTOOL([0.40.0])
AM_GLIB_GNU_GETTEXT
2011-02-24 04:14:30 +01:00
dnl displaced from acconfig.h
AH_VERBATIM([OLD_PERL],[#undef OLD_PERL])
AH_VERBATIM([PREFIX],[#undef PREFIX])
2012-07-13 18:04:00 +02:00
AH_VERBATIM([HEXCHATLIBDIR],[#undef HEXCHATLIBDIR])
AH_VERBATIM([HEXCHATSHAREDIR],[#undef HEXCHATSHAREDIR])
2011-04-16 19:18:20 +02:00
AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY])
2015-02-14 19:35:02 +01:00
AH_VERBATIM([HAVE_LIBPCI],[#undef HAVE_LIBPCI])
2011-12-11 19:27:37 +01:00
AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
2014-01-12 23:00:26 +01:00
AH_VERBATIM([HAVE_GTK_MAC],[#undef HAVE_GTK_MAC])
2011-04-16 19:18:20 +02:00
AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
2013-04-28 00:05:05 +02:00
AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA])
2011-02-24 04:14:30 +01:00
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
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)
2015-04-23 04:10:52 +02:00
AS_IF([test "_$sedpath" = _], [
2012-10-26 14:36:45 +02:00
AC_MSG_ERROR(Cannot find sed: I need it!)
2015-04-23 04:10:52 +02:00
])
2011-02-24 04:14:30 +01:00
AC_PATH_PROG(unamepath, uname)
2015-04-23 04:10:52 +02:00
AS_IF([test "_$unamepath" = _], [
2011-02-24 04:14:30 +01:00
system="unknown"
2015-04-23 04:10:52 +02:00
], [
2011-02-24 04:14:30 +01:00
AC_MSG_CHECKING(system type)
system=`$unamepath -s`
AC_MSG_RESULT($system)
2015-04-23 04:10:52 +02:00
AS_IF([test "$system" = "Linux"], [
2011-02-24 04:14:30 +01:00
AC_DEFINE(USING_LINUX)
2015-04-23 04:10:52 +02:00
], [test "$system" = "FreeBSD"], [
2011-02-24 04:14:30 +01:00
AC_DEFINE(USING_FREEBSD)
2015-04-23 04:10:52 +02:00
])
])
2011-02-24 04:14:30 +01:00
2014-09-06 14:04:52 +02:00
platform_win32=no
2015-02-14 19:35:02 +01:00
platform_osx=no
2015-04-23 04:10:52 +02:00
AS_CASE([$host_os],
[*mingw*|*cygwin*|*msys*], [
platform_win32=yes
],
[darwin*], [
platform_osx=yes
]
)
2014-09-06 14:04:52 +02:00
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** configure switches ***********************************************
dnl *********************************************************************
AC_ARG_ENABLE(openssl,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--enable-openssl[=PATH]],[enable use of openSSL])],
2011-02-24 04:14:30 +01:00
openssl=$enableval, openssl=yes)
AC_ARG_ENABLE(gtkfe,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-gtkfe],[disable building gtk frontend])],
2011-02-24 04:14:30 +01:00
gtkfe=$enableval, gtkfe=yes)
AC_ARG_ENABLE(textfe,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--enable-textfe],[build the text frontend (default: no)])],
2011-02-24 04:14:30 +01:00
textfe=$enableval, textfe=no)
AC_ARG_ENABLE(python,
2013-08-27 10:59:03 +02:00
[AS_HELP_STRING([--enable-python=pythonversion],[build the python plugin; possible values: "python2", "python3" or specific such as "python3.3" (default on, python2)])],
2013-03-31 16:57:26 +02:00
python=$enableval, python=python2)
2013-08-26 23:00:47 +02:00
AS_IF([test "x$python" = "xyes"], [python=python2])
2011-02-24 04:14:30 +01:00
AC_ARG_ENABLE(perl,
2013-04-28 01:38:39 +02:00
[AS_HELP_STRING([--disable-perl],[don\'t build the perl plugin])],
2011-02-24 04:14:30 +01:00
perl=$enableval, perl=yes)
2016-04-03 16:28:11 +02:00
AC_ARG_ENABLE(lua,
[AS_HELP_STRING([--disable-lua],[don\'t build the lua plugin])],
lua=$enableval, lua=yes)
2011-02-24 04:14:30 +01:00
AC_ARG_ENABLE(perl_old,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-perl_old],[no backwards compatibility for perl plugin])],
2011-02-24 04:14:30 +01:00
perl_old=$enableval, perl_old=yes)
2012-07-18 14:50:58 +02:00
AC_ARG_ENABLE(plugin,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-plugin],[disable plugin support])],
2012-07-18 14:50:58 +02:00
plugin=$enableval, plugin=yes)
AC_ARG_ENABLE(checksum,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-checksum],[disable the Checksum plugin])],
2012-07-18 14:50:58 +02:00
checksum=$enableval, checksum=yes)
2012-07-17 19:19:48 +02:00
2012-07-17 19:47:19 +02:00
AC_ARG_ENABLE(doat,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-doat],[disable the Do At plugin])],
2012-07-17 19:47:19 +02:00
doat=$enableval, doat=yes)
2012-07-18 10:51:22 +02:00
AC_ARG_ENABLE(fishlim,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-fishlim],[disable the FiSHLiM plugin])],
2012-07-18 10:51:22 +02:00
fishlim=$enableval, fishlim=yes)
2012-10-21 08:06:09 +02:00
AC_ARG_ENABLE(sysinfo,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-sysinfo],[disable the SysInfo plugin])],
2012-10-21 08:06:09 +02:00
sysinfo=$enableval, sysinfo=yes)
2011-02-24 04:14:30 +01:00
AC_ARG_ENABLE(dbus,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-dbus],[disable DBUS support])],
2011-02-24 04:14:30 +01:00
dbus=$enableval, dbus=yes)
2011-04-16 19:18:20 +02:00
AC_ARG_ENABLE(libnotify,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-libnotify],[disable libnotify support])],
2011-04-16 19:18:20 +02:00
libnotify=$enableval, libnotify=yes)
2013-04-28 00:05:05 +02:00
AC_ARG_ENABLE(libcanberra,
[AS_HELP_STRING([--disable-libcanberra],[disable libcanberra support])],
libcanberra=$enableval, libcanberra=yes)
2012-09-24 01:35:50 +02:00
AC_ARG_ENABLE(libproxy,
2012-11-09 20:09:10 +01:00
[AS_HELP_STRING([--disable-libproxy],[disable libproxy support (default: auto)])],
2012-09-24 01:35:50 +02:00
libproxy=$enableval, libproxy=auto)
2013-10-02 09:47:07 +02:00
AC_ARG_ENABLE(isocodes,
[AS_HELP_STRING([--disable-isocodes],[disable iso-codes with spell-check])],
isocodes=$enableval, isocodes=yes)
2014-12-02 07:06:25 +01:00
AC_ARG_ENABLE(static-analysis,
[AS_HELP_STRING([--enable-static-analysis],[if using clang run static analysis during build (default: no)])],
analyze=$enableval, analyze=no)
2013-08-28 00:39:15 +02:00
AC_ARG_WITH(theme-manager,
[AS_HELP_STRING([--with-theme-manager],[compile theme manager (needs monodevelop, default: off)])],
theme_manager=$withval, theme_manager=no)
dnl *********************************************************************
dnl ** THEME-MANAGER ****************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "x$theme_manager" != "xno"], [
AS_IF([test "x$MDTOOL" = "xno"], [
2013-08-28 00:39:15 +02:00
AC_MSG_ERROR([No "mdtool" found, you need to install monodevelop!])
2015-04-23 04:10:52 +02:00
])
])
2013-07-11 12:36:14 +02:00
2012-09-24 01:35:50 +02:00
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** GLIB *************************************************************
dnl *********************************************************************
2016-04-05 18:18:27 +02:00
AM_PATH_GLIB_2_0([2.34.0], [], [AC_MSG_ERROR([Glib not found!])], [gmodule gobject gio])
2014-09-06 14:04:52 +02:00
COMMON_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
COMMON_LIBS="$GLIB_LIBS"
2016-04-05 18:18:27 +02:00
AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_34], [Dont warn using older APIs])
AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_34], [Prevents using newer APIs])
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** GTK **************************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "$gtkfe" = yes], [
2015-03-01 14:42:26 +01:00
PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.24.0], [
GUI_LIBS="$GUI_LIBS $GTK_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED"
], [
2013-03-31 16:35:02 +02:00
gtkfe=no
2015-03-01 14:42:26 +01:00
])
2015-04-23 04:10:52 +02:00
])
2011-02-24 04:14:30 +01:00
2014-01-12 23:00:26 +01:00
dnl *********************************************************************
dnl ** MAC_INTEGRATION **************************************************
dnl *********************************************************************
_gdk_tgt=`$PKG_CONFIG --variable=target gdk-2.0`
2015-04-23 04:10:52 +02:00
AS_IF([test "x$_gdk_tgt" = xquartz], [
PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration-gtk2, [
GUI_LIBS="$GUI_LIBS $GTK_MAC_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTK_MAC_CFLAGS"
AC_DEFINE(HAVE_GTK_MAC)
])
])
2014-01-12 23:00:26 +01:00
2016-04-03 16:28:11 +02:00
dnl *********************************************************************
dnl ** Lua **************************************************************
dnl *********************************************************************
AS_IF([test "$lua" = yes], [
AC_MSG_CHECKING(for plugin interface used by lua)
AS_IF([test "$plugin" = yes], [
AC_MSG_RESULT([yes])
m4_define_default([_LUA_LIST], [luajit lua lua5.3 lua53 lua5.2 lua52 lua5.1 lua51])
AC_ARG_VAR([LUA], [The Lua pkgconfig name, e.g. luajit or lua5.2])
AS_IF([test "x$LUA" = 'x'], [
for lua_var in _LUA_LIST; do
$PKG_CONFIG --exists $lua_var || continue
LUA=$lua_var
break
done
AS_IF([test "x$LUA" = 'x'], [
AC_MSG_ERROR([Failed to find lua])
])
])
PKG_CHECK_MODULES([LUA], $LUA, [
AC_SUBST([LUA_CFLAGS])
AC_SUBST([LUA_LIBS])
])
], [
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for lua])
lua=no
])
])
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** PERL *************************************************************
dnl *********************************************************************
2015-04-23 04:41:02 +02:00
AS_IF([test "$perl" = yes], [
2014-01-16 06:12:06 +01:00
AC_MSG_CHECKING(for plugin interface used by Perl)
2015-04-23 04:41:02 +02:00
AS_IF([test "$plugin" = yes], [
2014-01-16 06:20:44 +01:00
AC_MSG_RESULT([yes])
2015-04-23 04:41:02 +02:00
AX_PERL_EXT_FLAGS([PERL_CFLAGS], [PERL_LDFLAGS])
original_cflags="$CFLAGS"
original_ldflags="$LDFLAGS"
CFLAGS="$PERL_CFLAGS"
LDFLAGS="$PERL_LDFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#define PERL_NO_INLINE_FUNCTIONS
#include <EXTERN.h>
#include <perl.h>
]], [[]])],[perl_is_usable=yes],[perl_is_usable=no])
CFLAGS="$original_cflags"
LDFLAGS="$original_ldflags"
AS_IF([test "$perl_is_usable" = "no"], [
AC_MSG_WARN([perl test failed to compile, disabling])
2014-01-16 06:12:06 +01:00
perl=no
2015-04-23 04:41:02 +02:00
], [
AC_MSG_CHECKING([if perl plugin will be backward compatible])
AS_IF([test "$perl_old" = "yes"], [
AC_MSG_RESULT([yes])
AC_DEFINE(OLD_PERL)
], [
AC_MSG_RESULT([no])
])
])
], [
2014-01-16 06:12:06 +01:00
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Perl])
perl=no
2015-04-23 04:41:02 +02:00
])
])
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** PYTHON ***********************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "x$python" != xno], [
2014-01-16 06:12:06 +01:00
AC_MSG_CHECKING(for plugin interface used by Python)
2015-04-23 04:10:52 +02:00
AS_IF([test "$plugin" = yes], [
2014-01-16 06:20:44 +01:00
AC_MSG_RESULT([yes])
2015-04-23 04:10:52 +02:00
AS_CASE([$python],
2014-01-16 06:12:06 +01:00
dnl set python2 default here
2015-04-23 04:10:52 +02:00
[python2], [
2015-09-30 09:55:42 +02:00
PYTHON_VERSION=2
AX_PYTHON_DEVEL([>= '2.7'])
2015-04-23 04:10:52 +02:00
],
2014-01-16 06:12:06 +01:00
dnl set python3 default here
2015-04-23 04:10:52 +02:00
[python3], [
2015-09-30 09:55:42 +02:00
PYTHON_VERSION=3
AX_PYTHON_DEVEL([>= '3.3'])
],
2014-01-16 06:12:06 +01:00
dnl add broken versions here
2015-04-23 04:10:52 +02:00
[python2.5|python2.6|python3.1|python3.2], [
AC_MSG_WARN(Unsupported Python version ${python}!)
],
2015-09-30 09:55:42 +02:00
dnl user supplied version
2015-04-23 04:10:52 +02:00
[python*], [
2015-09-30 09:55:42 +02:00
PYTHON_VERSION="${python#python}"
AX_PYTHON_DEVEL()
2015-04-23 04:10:52 +02:00
],[
2014-01-28 20:45:45 +01:00
AC_MSG_WARN(Unsupported Python ${python}!)
2015-04-23 04:10:52 +02:00
]
)
2014-01-16 06:12:06 +01:00
AC_MSG_CHECKING(Python version)
2014-01-28 20:45:45 +01:00
2015-09-30 09:55:42 +02:00
AS_IF([test "$ac_python_version" != ""], [
AC_MSG_RESULT($ac_python_version)
python="python-${ac_python_version}"
2015-04-23 04:10:52 +02:00
], [
2014-01-28 20:45:45 +01:00
AC_MSG_RESULT(Not found)
python=no
2015-04-23 04:10:52 +02:00
])
], [
2014-01-16 06:12:06 +01:00
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Python])
python=no
2015-04-23 04:10:52 +02:00
])
])
2011-02-24 04:14:30 +01: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)
2014-12-28 19:38:47 +01:00
AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes)
AC_MSG_CHECKING(whether IPv6 is supported)
2015-04-23 04:10:52 +02:00
AS_IF([test "$have_getaddrinfo" = yes], [
2014-12-28 19:38:47 +01:00
AC_MSG_RESULT(yes)
2015-04-23 04:10:52 +02:00
], [
2014-12-28 19:38:47 +01:00
AC_MSG_RESULT(no)
AC_MSG_ERROR(ipv6 support not found!)
2015-04-23 04:10:52 +02:00
])
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** OPENSSL **********************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "$openssl" != no], [
2014-09-06 14:04:52 +02:00
PKG_CHECK_MODULES(OPENSSL, [openssl], [
2011-02-24 04:14:30 +01:00
AC_DEFINE(USE_OPENSSL)
openssl=yes
2014-09-06 14:04:52 +02:00
COMMON_LIBS="$COMMON_LIBS $OPENSSL_LIBS"
COMMON_CFLAGS="$COMMON_CFLAGS $OPENSSL_CFLAGS"
], [
2015-04-23 04:10:52 +02:00
unset openssl_path ac_cv_lib_ssl_SSL_new ac_cv_header_openssl_ssl_h
AS_IF([test "$openssl" != yes], [
openssl_path=$openssl
2014-09-06 14:04:52 +02:00
])
2015-04-23 04:10:52 +02:00
openssl=no
OPENSSL_LIBS="-lcrypto"
AS_IF([test -n "$openssl_path"], [
OPENSSL_LIBS="-L$openssl_path/lib $OPENSSL_LIBS"
])
SAVED_LIBS=$LIBS
LIBS="$LIBS $OPENSSL_LIBS"
AC_CHECK_LIB(ssl, SSL_new, [
AS_IF([test -n "$openssl_path"], [
OPENSSL_CFLAGS="-I$openssl_path/include"
])
SAVED_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
AC_CHECK_HEADERS(openssl/ssl.h, [
openssl=yes
AC_DEFINE(USE_OPENSSL)
OPENSSL_LIBS="$OPENSSL_LIBS -lssl"
COMMON_LIBS="$COMMON_LIBS $OPENSSL_LIBS"
COMMON_CFLAGS="$COMMON_CFLAGS $OPENSSL_CFLAGS"
])
CFLAGS=$SAVED_CFLAGS
])
LIBS=$SAVED_LIBS
2014-09-06 14:04:52 +02:00
])
2015-04-23 04:10:52 +02:00
])
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** LIBPROXY *********************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "x$libproxy" = "xyes" -o "x$libproxy" = "xauto"], [
2012-09-24 01:35:50 +02:00
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
], [
2015-04-23 04:10:52 +02:00
AS_IF([test "x$libproxy" = "xyes"], [
2012-10-26 14:36:45 +02:00
AC_MSG_ERROR(Cannot find libproxy!)
2015-04-23 04:10:52 +02:00
])
2012-09-24 01:35:50 +02:00
libproxy=no
])
2015-04-23 04:10:52 +02:00
], [
2011-04-16 19:18:20 +02:00
libproxy=no
2015-04-23 04:10:52 +02:00
])
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** PLUGIN ***********************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "$plugin" = yes], [
2014-06-01 21:47:09 +02:00
AC_DEFINE(USE_PLUGIN)
2014-09-06 14:04:52 +02:00
PLUGIN_LDFLAGS="-avoid-version"
2015-04-23 04:10:52 +02:00
AS_IF([test "$platform_win32" = yes], [
2014-09-06 14:04:52 +02:00
PLUGIN_LDFLAGS="$PLUGIN_LDFLAGS -no-undefined"
2015-04-23 04:10:52 +02:00
])
])
2011-02-24 04:14:30 +01:00
2012-07-18 10:51:22 +02:00
dnl *********************************************************************
2012-07-18 14:50:58 +02:00
dnl ** Checksum *********************************************************
2012-07-18 10:51:22 +02:00
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "$checksum" != "no"], [
2012-07-18 14:50:58 +02:00
checksum=no
AC_MSG_CHECKING(for plugin interface used by Checksum)
2015-04-23 04:10:52 +02:00
AS_IF([test "$plugin" = yes], [
2014-12-15 00:09:33 +01:00
checksum=yes
2012-07-18 10:51:22 +02:00
AC_MSG_RESULT([yes])
2015-04-23 04:10:52 +02:00
], [
2012-07-18 14:50:58 +02:00
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
2015-04-23 04:10:52 +02:00
])
])
2012-07-18 10:51:22 +02:00
dnl *********************************************************************
dnl ** DO AT ************************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "$doat" != "no"], [
2012-07-18 10:51:22 +02:00
AC_MSG_CHECKING(for plugin interface used by Do At)
doat=no
2015-04-23 04:10:52 +02:00
AS_IF([test "$plugin" = yes], [
2012-07-18 10:51:22 +02:00
doat=yes
AC_MSG_RESULT([yes])
2015-04-23 04:10:52 +02:00
], [
2012-07-18 10:51:22 +02:00
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Do At])
2015-04-23 04:10:52 +02:00
])
])
2012-07-18 10:51:22 +02:00
dnl *********************************************************************
dnl ** FiSHLiM **********************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "$fishlim" != "no"], [
2012-07-18 10:51:22 +02:00
fishlim=no
AC_MSG_CHECKING(for plugin interface used by FiSHLiM)
2015-04-23 04:10:52 +02:00
AS_IF([test "$plugin" = yes], [
2012-07-18 10:51:22 +02:00
AC_MSG_RESULT([yes])
2012-07-18 14:03:15 +02:00
AC_MSG_CHECKING(for OpenSSL used by FiSHLiM)
2015-04-23 04:10:52 +02:00
AS_IF([test "$openssl" = yes], [
2012-07-18 14:03:15 +02:00
fishlim=yes
AC_MSG_RESULT([yes])
2015-04-23 04:10:52 +02:00
], [
2012-07-18 14:03:15 +02:00
AC_MSG_RESULT([OpenSSL cannot be found, use the --enable-openssl option])
2015-04-23 04:10:52 +02:00
])
], [
2012-07-18 10:51:22 +02:00
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
2015-04-23 04:10:52 +02:00
])
])
2012-07-18 10:51:22 +02:00
2012-10-21 08:06:09 +02:00
dnl *********************************************************************
dnl ** SYSINFO **********************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "$sysinfo" != "no"], [
2012-10-21 08:06:09 +02:00
AC_MSG_CHECKING(for plugin interface used by SysInfo)
2015-04-23 04:10:52 +02:00
AS_IF([test "$plugin" = yes], [
2012-10-21 08:06:09 +02:00
AC_MSG_RESULT([yes])
2015-04-23 04:10:52 +02:00
AS_IF([test "$platform_osx" = yes], [
2015-02-14 19:35:02 +01:00
sysinfo=yes
2015-04-23 04:10:52 +02:00
], [
2015-02-14 19:35:02 +01:00
PKG_CHECK_MODULES(LIBPCI, libpci >= 3.0.0, [
sysinfo=yes
AC_DEFINE(HAVE_LIBPCI)
], [sysinfo=no])
2015-04-23 04:10:52 +02:00
])
], [
2012-10-21 08:06:09 +02:00
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for SysInfo])
2012-10-26 14:36:45 +02:00
sysinfo=no
2015-04-23 04:10:52 +02:00
])
])
2012-10-21 08:06:09 +02:00
2011-02-24 04:14:30 +01:00
dnl #######################################################################
dnl # Check for DBUS libraries
dnl #######################################################################
2015-04-23 04:10:52 +02:00
AS_IF([test "x$dbus" = "xyes"], [
2011-02-24 04:14:30 +01:00
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)
2015-04-23 04:10:52 +02:00
AS_IF([test "x$DBUS_BINDING_TOOL" = "xno" || test "x$dbus" = "xno"], [
2011-02-24 04:14:30 +01:00
dbus="no"
2015-04-23 04:10:52 +02:00
], [
2012-07-18 21:19:11 +02:00
COMMON_LIBS="$COMMON_LIBS $DBUS_LIBS"
2011-02-24 04:14:30 +01:00
COMMON_CFLAGS="$COMMON_CFLAGS $DBUS_CFLAGS"
AC_DEFINE(USE_DBUS)
2012-09-20 16:04:14 +02:00
AS_AC_EXPAND(DBUS_SERVICES_DIR, "$datadir/dbus-1/services")
2011-02-24 04:14:30 +01:00
AC_SUBST(DBUS_SERVICES_DIR)
AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
2015-04-23 04:10:52 +02:00
])
])
2011-02-24 04:14:30 +01:00
2011-04-16 19:18:20 +02:00
dnl *********************************************************************
dnl ** LIBNOTIFY ********************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "x$libnotify" = "xyes"], [
2011-04-16 19:18:20 +02:00
PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= 0.4, [], [
libnotify=no
])
2015-04-23 04:10:52 +02:00
AS_IF([test "$libnotify" != "no"], [
2011-04-16 19:18:20 +02:00
GUI_LIBS="$GUI_LIBS $LIBNOTIFY_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $LIBNOTIFY_CFLAGS"
AC_DEFINE(USE_LIBNOTIFY)
2015-04-23 04:10:52 +02:00
])
])
2011-04-16 19:18:20 +02:00
2013-04-28 00:05:05 +02:00
dnl *********************************************************************
dnl ** LIBCANBERRA ******************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "x$libcanberra" = "xyes"], [
2013-04-28 02:28:39 +02:00
PKG_CHECK_MODULES(LIBCANBERRA, libcanberra >= 0.22, [], [
2013-04-28 00:05:05 +02:00
libcanberra=no
])
2015-04-23 04:10:52 +02:00
AS_IF([test "$libcanberra" != "no"], [
2013-04-28 02:28:39 +02:00
COMMON_LIBS="$COMMON_LIBS $LIBCANBERRA_LIBS"
COMMON_CFLAGS="$COMMON_CFLAGS $LIBCANBERRA_CFLAGS"
2013-04-28 00:05:05 +02:00
AC_DEFINE(USE_LIBCANBERRA)
2015-04-23 04:10:52 +02:00
])
])
2013-04-28 00:05:05 +02:00
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** SPELL ************************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "x$isocodes" = "xyes"], [
2013-10-02 09:47:07 +02:00
PKG_CHECK_MODULES(ISOCODES, "iso-codes", [
iso_codes_prefix=`$PKG_CONFIG --variable=prefix iso-codes 2>/dev/null || echo /usr`
AC_MSG_NOTICE([iso-codes prefix: $iso_codes_prefix])
AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX], ["$iso_codes_prefix"], [ISO codes prefix])
AC_DEFINE_UNQUOTED([ISO_CODES_LOCALEDIR], ["$iso_codes_prefix/share/locale"], [ISO codes locale dir])
AC_DEFINE([HAVE_ISO_CODES], [1], [iso-codes available])
], [
isocodes=no
AC_MSG_WARN(iso-codes not found!)
])
2015-04-23 04:10:52 +02:00
])
2011-02-24 04:14:30 +01:00
2014-12-02 07:06:25 +01:00
dnl *********************************************************************
dnl ** Static Analysis **************************************************
dnl *********************************************************************
2015-04-23 04:10:52 +02:00
AS_IF([test "x$analyze" = "xyes"], [
AS_IF([test "$CC" != "clang"], [
2014-12-02 07:06:25 +01:00
AC_MSG_WARN(CC is not clang for static analysis)
analyze=no
2015-04-23 04:10:52 +02:00
])
])
2014-12-02 07:06:25 +01:00
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** CONDITIONALS *****************************************************
dnl *********************************************************************
AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
2011-04-16 19:18:20 +02:00
AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
2013-04-28 00:05:05 +02:00
AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes")
2011-02-24 04:14:30 +01: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")
2016-04-03 16:28:11 +02:00
AM_CONDITIONAL(DO_LUA, test "x$lua" = "xyes")
2013-03-31 16:57:26 +02:00
AM_CONDITIONAL(DO_PYTHON, test "x$python" != "xno")
2012-07-18 14:50:58 +02:00
AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
AM_CONDITIONAL(DO_CHECKSUM, test "x$checksum" = "xyes")
2012-07-17 19:47:19 +02:00
AM_CONDITIONAL(DO_DOAT, test "x$doat" = "xyes")
2012-07-18 10:51:22 +02:00
AM_CONDITIONAL(DO_FISHLIM, test "x$fishlim" = "xyes")
2012-10-21 08:06:09 +02:00
AM_CONDITIONAL(DO_SYSINFO, test "x$sysinfo" = "xyes")
2014-12-02 07:06:25 +01:00
AM_CONDITIONAL(DO_STATIC_ANALYSIS, test "x$analyze" = "xyes")
2011-02-24 04:14:30 +01:00
AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
2013-10-02 09:47:07 +02:00
AM_CONDITIONAL(HAVE_ISO_CODES, test "x$isocodes" = "xyes")
2015-02-05 03:38:45 +01:00
AM_CONDITIONAL(HAVE_GTK_MAC, test "x$_gdk_tgt" = xquartz)
2013-08-28 00:39:15 +02:00
AM_CONDITIONAL(WITH_TM, test "x$theme_manager" != "xno")
2015-02-14 19:35:02 +01:00
AM_CONDITIONAL(PLATFORM_OSX, test "x$platform_osx" == "xyes")
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
2015-03-19 21:03:13 +01:00
dnl ** CFLAGS ***********************************************************
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
2016-03-07 00:54:07 +01:00
AX_APPEND_COMPILE_FLAGS([\
2015-03-19 21:03:13 +01:00
-pipe \
-funsigned-char \
2016-02-27 18:36:25 +01:00
-fstack-protector-strong \
-fPIE \
-fPIC \
2015-03-19 21:03:13 +01:00
-Wall \
-Wextra \
2016-02-18 14:54:19 +01:00
-Wstrict-prototypes \
2015-03-19 21:03:13 +01:00
-Wno-unused-parameter \
-Wno-sign-compare \
-Wno-pointer-sign \
-Wno-missing-field-initializers \
-Wno-unused-result \
-Werror=format-security \
2016-02-18 14:54:19 +01:00
-Werror=init-self \
2015-03-19 21:03:13 +01:00
-Werror=declaration-after-statement \
2016-02-18 14:54:19 +01:00
-Werror=missing-include-dirs \
-Werror=date-time \
-Werror=implicit-function-declaration \
-Werror=pointer-arith \
2011-02-24 04:14:30 +01:00
])
2013-04-22 20:22:04 +02:00
2016-02-27 18:36:25 +01:00
AX_APPEND_LINK_FLAGS([ \
-pie \
-Wl,-z,relro \
-Wl,-z,now \
])
2011-02-24 04:14:30 +01:00
dnl *********************************************************************
dnl ** FUNCTIONS/LIBS/CFLAGS ********************************************
dnl *********************************************************************
AC_MSG_CHECKING(for modern sigaction)
2013-04-28 01:38:39 +02:00
dnl libc5 on linux and FreeBSD 3.x doesn\'t have siginfo_t
2011-02-24 04:14:30 +01:00
dnl and the sa_sigation field.
2015-04-22 00:56:53 +02:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[struct sigaction act;
2011-02-24 04:14:30 +01:00
siginfo_t *si;
2015-04-22 00:56:53 +02:00
act.sa_sigaction = 0;]])],[
2011-02-24 04:14:30 +01:00
AC_MSG_RESULT(yes)
AC_DEFINE(USE_SIGACTION)
2015-04-22 00:56:53 +02:00
],[AC_MSG_RESULT(no)])
2011-02-24 04:14:30 +01:00
2014-12-18 00:49:59 +01:00
AC_CHECK_FUNCS(memrchr)
2011-02-24 04:14:30 +01:00
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)
])
2015-04-23 04:10:52 +02:00
AS_IF([test $ac_cv_type_socklen_t = no], [
2011-02-24 04:14:30 +01:00
AC_DEFINE(socklen_t, int)
2015-04-23 04:10:52 +02:00
])
2011-02-24 04:14:30 +01:00
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"
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)
2015-09-30 09:55:42 +02:00
AC_SUBST(PYTHON_CPPFLAGS)
AC_SUBST(PYTHON_LIBS)
2011-02-24 04:14:30 +01:00
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
2014-09-06 14:04:52 +02:00
AC_SUBST(OPENSSL_LIBS)
AC_SUBST(OPENSSL_CFLAGS)
AC_SUBST(PLUGIN_LDFLAGS)
2011-02-24 04:14:30 +01:00
2013-04-16 12:58:33 +02:00
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig))
2011-02-24 04:14:30 +01:00
dnl for plugin.c and pixmaps.c
2015-04-23 04:10:52 +02:00
AS_IF([test "x$prefix" = xNONE], [
prefix="$ac_default_prefix"
])
AS_IF([test "x$exec_prefix" = xNONE], [
exec_prefix="$prefix"
])
2011-02-24 04:14:30 +01:00
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
2013-04-15 15:48:19 +02:00
AS_AC_EXPAND(HEXCHATLIBDIR, "${libdir}/hexchat/plugins")
2012-07-13 18:04:00 +02:00
AC_DEFINE_UNQUOTED(HEXCHATLIBDIR, "$HEXCHATLIBDIR")
2011-02-24 04:14:30 +01:00
2012-09-20 16:04:14 +02:00
AS_AC_EXPAND(HEXCHATSHAREDIR, "$datadir")
2012-07-13 18:04:00 +02:00
AC_DEFINE_UNQUOTED(HEXCHATSHAREDIR, "$HEXCHATSHAREDIR")
2011-02-24 04:14:30 +01:00
dnl for plugins/xxx/Makefile.am
2013-04-15 15:48:19 +02:00
hexchatlibdir=${libdir}/hexchat/plugins
2012-07-13 18:04:00 +02:00
AC_SUBST(hexchatlibdir)
2011-02-24 04:14:30 +01:00
2013-03-03 21:28:26 +01:00
AC_CONFIG_FILES([
2011-02-24 04:14:30 +01:00
Makefile
2013-09-28 03:56:13 +02:00
data/Makefile
data/icons/Makefile
data/misc/Makefile
data/man/Makefile
2014-06-01 17:29:20 +02:00
data/man/hexchat.1
2013-09-28 03:56:13 +02:00
data/pkgconfig/Makefile
data/pkgconfig/hexchat-plugin.pc
2011-02-24 04:14:30 +01:00
src/Makefile
src/common/Makefile
src/common/dbus/Makefile
src/fe-text/Makefile
src/fe-gtk/Makefile
2013-08-28 00:39:15 +02:00
src/htm/Makefile
2013-08-28 02:55:08 +02:00
src/htm/thememan
2014-01-30 08:13:42 +01:00
osx/Info.plist
2011-02-24 04:14:30 +01:00
plugins/Makefile
2016-04-03 16:28:11 +02:00
plugins/lua/Makefile
2011-02-24 04:14:30 +01:00
plugins/python/Makefile
plugins/perl/Makefile
2012-07-18 14:50:58 +02:00
plugins/checksum/Makefile
2012-07-17 19:47:19 +02:00
plugins/doat/Makefile
2012-07-18 10:51:22 +02:00
plugins/fishlim/Makefile
2012-10-21 08:06:09 +02:00
plugins/sysinfo/Makefile
2011-02-24 04:14:30 +01:00
po/Makefile.in
])
2013-03-03 21:28:26 +01:00
AC_OUTPUT
2011-02-24 04:14:30 +01:00
echo
2012-07-17 19:19:48 +02:00
echo HexChat $VERSION
2011-02-24 04:14:30 +01:00
echo
2012-07-18 15:41:01 +02:00
echo GTK+ interface ........ : $gtkfe
echo Text interface ........ : $textfe
2013-08-28 00:39:15 +02:00
echo Theme manager ......... : $theme_manager
2011-02-24 04:14:30 +01:00
echo
2012-07-18 15:41:01 +02:00
echo OpenSSL support ....... : $openssl
echo D-Bus support ......... : $dbus
echo libnotify support ..... : $libnotify
2013-04-28 00:05:05 +02:00
echo libcanberra support ... : $libcanberra
2012-07-18 15:41:01 +02:00
echo Plugin interface ...... : $plugin
2012-09-24 01:35:50 +02:00
echo libproxy support ...... : $libproxy
2012-07-18 14:50:58 +02:00
echo
2016-04-03 16:28:11 +02:00
echo Lua ................... : $lua \($LUA\)
2012-07-18 15:41:01 +02:00
echo Perl .................. : $perl
2013-10-10 06:39:36 +02:00
echo Python ................ : $python
2011-02-24 04:14:30 +01:00
echo
2012-07-18 15:41:01 +02:00
echo Checksum .............. : $checksum
echo Do At ................. : $doat
echo FiSHLiM ............... : $fishlim
2012-10-21 08:06:09 +02:00
echo SysInfo ............... : $sysinfo
2012-07-17 19:19:48 +02:00
echo
2015-04-22 01:14:23 +02:00
echo Debug mode ............ : $enable_debug
echo
2011-02-24 04:14:30 +01: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
echo configure complete, now type \'make\' and pray.
echo