dnl Configuration for GNU Mailutils -- a suite of utilities for electronic mail
dnl
dnl Copyright (C) 1999-2012, 2014-2018 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.5], [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, 5)
AC_SUBST(VI_REVISION, 5)
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_IMAP)
AC_SUBST(MU_LIB_MAILDIR)
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_MH)
AC_SUBST(MU_LIB_NNTP)
AC_SUBST(MU_LIB_POP)
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)
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_AUTHLIBS_DEPENDENCY)
AC_SUBST(MU_AUTHINCS)
MU_AUTHLIBS=
MU_AUTHLIBS_DEPENDENCY=../libmu_auth/libmu_auth.la
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,
[status_tcpwrap=yes],
[status_tcpwrap=no])
;;
no) ;;
esac
LIBS=$saved_LIBS
if test "$status_tcpwrap" = "yes"; then
TCPWRAP_LIBRARIES="$TCPWRAP_LIBRARIES -lwrap"
AC_DEFINE_UNQUOTED(WITH_LIBWRAP, 1,
[Define to 1 to use tcp wrappers.])
else
# Provide placeholder functions only
TCPWRAP_LIBRARIES=
fi
AC_SUBST([MU_TCPWRAP_LIBRARIES], "\${top_builddir}/lib/libmutcpwrap.a $TCPWRAP_LIBRARIES")
AC_ARG_ENABLE([pthread],
AC_HELP_STRING([--disable-pthread],
[disable pthread]),
[
case "${enableval}" in
yes) usepthread=yes ;;
no) usepthread=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-pthread) ;;
esac],[usepthread=yes])
AC_ARG_WITH([readline],
AC_HELP_STRING([--without-readline],
[do not use readline]),
[
case "${withval}" in
yes) status_readline=yes ;;
no) status_readline=no ;;
*) AC_MSG_ERROR(bad value ${withval} for --without-readline) ;;
esac],[status_readline=probe])
AC_SUBST(SERV_AUTHLIBS)
AC_SUBST(SERV_AUTHINCS)
AC_ARG_WITH([gssapi],
AC_HELP_STRING([--with-gssapi@<:@=PATH@:>@],
[use GSSAPI authentication]),
[status_gssapi=$withval],
[status_gssapi=no])
if test "x$status_gssapi" != "xno"; then
MU_CHECK_GSSAPI($status_gssapi)
if test "$GSSAPI_IMPL" = "none"; then
AC_CACHE_SAVE
AC_MSG_RESULT([GSSAPI libraries not found])
else
# Output produced by `krb5-config --libs' may contain `-Wl,-rpath -Wl,DIR'
# options. Once they are added to SERV_AUTHLIBS, libtool, when creating
# relink command line in wrapper files for executables, places them at the
# beginnig of the option list and adds its o
|