dnl Configuration for GNU Mailutils -- a suite of utilities for electronic mail
dnl
dnl Copyright (C) 1999-2019 Free Software Foundation, Inc.
dnl
dnl GNU Mailutils is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl GNU Mailutils is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.63)
AC_INIT([GNU Mailutils], [3.8.90], [bug-mailutils@gnu.org], [mailutils],
[http://mailutils.org])
AC_CONFIG_SRCDIR([libmailutils/mailbox/mailbox.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([gnits 1.11 dist-bzip2 dist-xz std-options silent-rules])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Enable silent rules by default:
AM_SILENT_RULES([yes])
dnl Autobuild stuff
AB_INIT
dnl Library versioning
AC_SUBST(VI_CURRENT, 6)
AC_SUBST(VI_REVISION, 0)
AC_SUBST(VI_AGE, 0)
dnl Library paths
AC_SUBST(MU_LIB_AUTH,'${top_builddir}/libmu_auth/libmu_auth.la')
AC_SUBST(MU_LIB_MAILUTILS,'${top_builddir}/libmailutils/libmailutils.la')
AC_SUBST(MU_LIB_SQL,'${top_builddir}/sql/libsql.la')
AC_SUBST(MU_LIB_MAILER,'${top_builddir}/libproto/mailer/libmu_mailer.la')
AC_SUBST(MU_LIB_MBOX,'${top_builddir}/libproto/mbox/libmu_mbox.la')
AC_SUBST(MU_LIB_SIEVE,'${top_builddir}/libmu_sieve/libmu_sieve.la')
AC_SUBST(MU_LIB_SCM)
AC_SUBST(MU_LIB_CPP)
AC_SUBST(MU_LIB_PY)
dnl Other variables
AC_SUBST(mu_aux_dir,'$(top_srcdir)/mu-aux')
AC_SUBST(MU_SIEVE_MODDIR,'$(libdir)/$(PACKAGE)')
AC_SUBST(MU_COMMON_LIBRARIES,'$(LTLIBINTL) $(LTLIBICONV)')
AC_SUBST(MU_APP_LIBRARIES,'${top_builddir}/lib/libmuaux.la')
# There are two sets of include directories: MU_LIB_COMMON_INCLUDES, used
# by the libraries, and MU_APP_COMMON_INCLUDES, which is used by applications.
# The principal difference between them is that the latter contains gnulib
# directory.
#
# Libraries are isolated from gnulib and are not allowed to include its
# header files. There are two exceptions, though. See NOTE before the
# AC_CONFIG_LINKS statements, below.
AC_SUBST(MU_LIB_COMMON_INCLUDES,'-I${top_builddir} -I${top_srcdir}/include -I${top_builddir}/include')
AC_SUBST(MU_APP_COMMON_INCLUDES,'-I${srcdir} -I${top_srcdir}/include -I${top_srcdir}/lib -I${top_srcdir}/lib/gnu -I${top_builddir}/lib/gnu -I${top_builddir} -I${top_builddir}/include')
# Use our replacement for the ylwrap tool
AC_SUBST([MU_YLWRAP],'$(mu_aux_dir)/gylwrap --')
dnl Check for programs
AC_PROG_CC
AM_PROG_CC_C_O
gl_EARLY
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
MU_PROG_BISON
MU_PROG_FLEX
AM_PROG_LIBTOOL
## Predefine several variables used to display configuration status
status_pam=no
status_ltdl=no
status_dbm=
status_gsasl=no
status_mysql=no
status_pgsql=no
status_ldap=no
status_tcpwrap=maybe
status_readline=probe
dnl Internationalization macros.
AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION(0.19)
AM_ICONV
AC_CHECK_HEADERS(iconv.h)
AC_CHECK_TYPE(iconv_t,:,
AC_DEFINE(iconv_t, int,
[Conversion descriptor type]),
[
#ifdef HAVE_ICONV_H
# include <iconv.h>
#endif
])
# NOTE: Generally speaking, Mailutils libraries are not allowed to include
# gnulib headers. The only exception is gettext.h, which is needed for
# proper i18n.
#
# To make it accessible for the libraries, it is linked to include/.
#
AC_CONFIG_LINKS(include/gettext.h:lib/gnu/gettext.h)
AC_CONFIG_LINKS(include/mailutils/sys/wordsplit.h:libmailutils/wordsplit/wordsplit.h)
AH_BOTTOM([
#define DEFAULT_TEXT_DOMAIN PACKAGE
])
AC_SUBST(MU_LINK_POSTFLAGS,[`for opt in $LTLIBICONV; do case $opt in -[[lL]]*) echo $opt;; esac; done|tr '\n' ' '`])
# Check for large file support
AC_SYS_LARGEFILE
gl_INIT
dnl Check for libraries
USE_LOADABLE_MODULES=no
AC_CHECK_LIB(resolv, res_query)
LTDL_LIB=
AC_SUBST(LTDL_LIB)
if test "$enable_shared" = yes; then
AC_CHECK_LIB(ltdl, lt_dlinit,[
AC_DEFINE(HAVE_LIBLTDL,
1,
[Define to 1 if you have the `ltdl' library (-lltdl).])
status_ltdl=yes
LTDL_LIB=-lltdl
_USE_LOADABLE_MODULES=yes], # FIXME: Remove leading _ when ltd support
# is added to SQL.
[LTDL_LIB=""])
fi
if test $USE_LOADABLE_MODULES = yes; then
AC_DEFINE(USE_LOADABLE_MODULES,1,
[Define if mailutils is able to use loadable modules])
fi
MU_DEBUG_MODE
# For adventurous characters: enable experimental/unfinished/buggy stuff
AC_ARG_ENABLE([experimental],
AC_HELP_STRING([--enable-experimental],
[build experimental and/or unfinished utilities]),
[mu_build_experimental="${enableval}"],
[mu_build_experimental=no])
# Initialize authlibs
AC_SUBST(MU_AUTHLIBS)
AC_SUBST(MU_AUTHINCS)
dnl Check for arguments
AC_ARG_ENABLE([pam],
AC_HELP_STRING([--disable-pam],
[disable pam]),
[
case "${enableval}" in
yes) testpam=yes ;;
no) testpam=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-pam]) ;;
esac],[testpam=yes])
AC_ARG_WITH(tcp-wrappers,
AC_HELP_STRING([--with-tcp-wrappers],
[compile with TCP wrappers (libwrap) support]),
[status_tcpwrap=${withval}],
[status_tcpwrap=maybe])
saved_LIBS=$LIBS
TCPWRAP_LIBRARIES=
case $status_tcpwrap in
yes) AC_CHECK_LIB(wrap, main,,
[AC_MSG_ERROR([Required library libwrap not found])])
AC_CHECK_LIB(nsl, main,
[TCPWRAP_LIBRARIES=-lnsl])
AC_CHECK_HEADERS(tcpd.h,,
[AC_MSG_ERROR([Required header tcpd.h not found])])
status_tcpwrap=yes
;;
maybe)
AC_CHECK_LIB(wrap, main,
[status_tcpwrap=yes],
[status_tcpwrap=no])
AC_CHECK_LIB(nsl, main, [TCPWRAP_LIBRARIES=-lnsl])
AC_CHECK_HEADERS(tcpd.h,
[statu
|