X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/3956385cc6e2101f354c1378ae3bc654eaecec0a..939dea68806ab22c29755091b16236b48876442f:/configure.ac diff --git a/configure.ac b/configure.ac index 02a39243..86d95f42 100644 --- a/configure.ac +++ b/configure.ac @@ -27,13 +27,10 @@ dnl Do you want client-side support for using SASL for authentication? dnl Note that this code will be enabled for both POP and SMTP AC_ARG_WITH([cyrus-sasl], AS_HELP_STRING([--with-cyrus-sasl], [Enable SASL support via the Cyrus SASL library])) -AS_IF([test x"$with_cyrus_sasl" != x -a x"$with_cyrus_sasl" != x"no"],[ - AC_DEFINE([CYRUS_SASL], [1], - [Define to use the Cyrus SASL library for authentication of POP and SMTP.])dnl - AS_IF([test x"$with_cyrus_sasl" != xyes],[ - AC_MSG_WARN([Arguments to --with-cyrus-sasl now ignored]) - AC_MSG_WARN([Please pass the appropriate arguments to CPPFLAGS/LDFLAGS])]) - sasl_support=yes], [sasl_support=no]) +AS_IF([test x"$with_cyrus_sasl" != x -a x"$with_cyrus_sasl" != xyes -a \ + x"$with_cyrus_sasl" != xno],[ + AC_MSG_WARN([Arguments to --with-cyrus-sasl now ignored]) + AC_MSG_WARN([Please pass the appropriate arguments to CPPFLAGS/LDFLAGS])]) dnl Do you want client-side support for encryption with TLS? AC_ARG_WITH([tls], AS_HELP_STRING([--with-tls], [Enable TLS support])) @@ -165,8 +162,10 @@ if test "$GCC" = yes; then dnl If the user configures with a CFLAGS that contains a -O flag dnl but then removes it a make time, they'll also have to remove dnl -D_FORTIFY_SOURCE from AM_CPPFLAGS because it requires optimization. + dnl Use "\ " instead of ' ' or " " for compatiblity with posh. AS_CASE([$CFLAGS], - [-O*|*' -O'*],[AM_CPPFLAGS="${AM_CPPFLAGS:+$AM_CPPFLAGS }-D_FORTIFY_SOURCE=2"]) + [-O|*\ -O|-O[[!0]]*|*\ -O[[!0]]*], + [AM_CPPFLAGS="${AM_CPPFLAGS:+$AM_CPPFLAGS }-D_FORTIFY_SOURCE=2"]) fi dnl FreeBSD needs a bit of magic to bring getline() into scope. @@ -455,12 +454,31 @@ dnl -------------------- dnl CHECK FOR CYRUS-SASL dnl -------------------- -AS_IF([test x"$sasl_support" = x"yes"],[ - AC_CHECK_HEADER([sasl/sasl.h], , [AC_MSG_ERROR([sasl.h not found])]) - AC_CHECK_LIB([sasl2], [sasl_client_new], [SASLLIB="-lsasl2"], - [AC_MSG_ERROR([Cyrus SASL library not found])])],[SASLLIB=""]) +AS_IF([test x"$with_cyrus_sasl" != x"no"],[ + AC_CHECK_HEADER([sasl/sasl.h], HAVE_SASL_H=1) + AC_CHECK_LIB([sasl2], [sasl_client_new], [SASLLIB="-lsasl2"])]) AC_SUBST([SASLLIB]) +dnl ----------------- +dnl Enable SASL? +dnl ----------------- +dnl By default (with_cyrus_sasl=''), enable SASL if header and lib are found. +dnl If SASL requested (--with-sasl with_cyrus_sasl=yes), error if header or lib not found. +dnl If SASL disabled (--without-sasl with_cyrus_sasl=no), don't enable it. +sasl_support=no +CYRUS_SASL=0 +AC_SUBST([CYRUS_SASL]) +AS_IF([test "x$with_cyrus_sasl" = xyes && test "x$HAVE_SASL_H" = x], + [AC_MSG_ERROR([SASL requested but sasl.h not found])], + [test "x$with_cyrus_sasl" = xyes && test "x$SASLLIB" = x], + [AC_MSG_ERROR([SASL requested but Cyrus SASL library not found])], + [test "x$with_cyrus_sasl" != xno && test "x$HAVE_SASL_H" = x1 && + test "x$SASLLIB" != x], + [AC_DEFINE([CYRUS_SASL], [1], + [Define to use the Cyrus SASL library for authentication of POP and SMTP.]) + CYRUS_SASL=1 + sasl_support=yes]) + dnl ----------------- dnl CHECK FOR OPENSSL dnl -----------------