X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=configure.in;h=9d750c0b88719214350a6e76c71b941ffb8afd9f;hb=3f05764b66c12e358878ecd7efdb393740acd9f1;hp=ce9c4ba71f548e6dbdd8ffddee5b82227e24d450;hpb=9be69008c0dd066816b4a9b04d47fade2282664a;p=mmh diff --git a/configure.in b/configure.in index ce9c4ba..9d750c0 100644 --- a/configure.in +++ b/configure.in @@ -1,15 +1,9 @@ dnl dnl configure.in -- autoconf template for nmh dnl -dnl $Id$ -dnl -dnl 2.13 definitely chokes; 2.53 is the earliest version I've tested. -dnl 2.58 needed for help string macro but that only affects help output -dnl 2.50 is the major breakpoint between the old autoconf and the new, -dnl so require that. If there are bug reports about 2.50-2.52 not working -dnl we can always move this up a little. -AC_PREREQ(2.50) +dnl Move this up a bit +AC_PREREQ(2.61) AC_INIT(nmh, m4_normalize(m4_include([VERSION]))) AC_CONFIG_SRCDIR(h/nmh.h) @@ -43,17 +37,6 @@ dnl -------------------------- dnl CHECK COMMAND LINE OPTIONS dnl -------------------------- -dnl Do you want client-side support for apop? -AC_ARG_ENABLE(apop, AS_HELP_STRING([--enable-apop], - [enable client-side support for POP3 and APOP])) -if test x"$enable_apop" = x"yes"; then - AC_DEFINE(APOP, 1, - [Define to compile client-side support for apop into inc and msgchk.])dnl - APOPLIB=md5.o - enable_pop=yes -fi -AC_SUBST(APOPLIB)dnl - dnl Do you want to debug nmh? AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[enable nmh code debugging])) @@ -70,8 +53,7 @@ AC_ARG_ENABLE(masquerade, masquerade="draft_from mmailid username_extension" else masquerade="$enable_masquerade" - fi], - masquerade="draft_from mmailid username_extension") + fi], [masquerade="draft_from mmailid username_extension"]) AC_SUBST(masquerade)dnl dnl Do you want mhe support? @@ -106,16 +88,29 @@ AC_DEFINE(LOCALE) 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=DIR], - [specify location of Cyrus SASL library])) +AC_ARG_WITH(cyrus-sasl, AS_HELP_STRING([--with-cyrus-sasl], + [Enable SASL support via the Cyrus SASL library])) if test x"$with_cyrus_sasl" != x -a x"$with_cyrus_sasl" != x"no"; then AC_DEFINE(CYRUS_SASL, 1, [Define to use the Cyrus SASL library for authentication of POP and SMTP.])dnl + if test x"$with_cyrus_sasl" != xyes; then + AC_MSG_WARN([Arguments to --with-cyrus-sasl now ignored]) + AC_MSG_WARN([Please pass the appropriate arguments to CPPFLAGS/LDFLAGS]) + fi sasl_support=yes else sasl_support=no fi +dnl Do you want client-side support for encryption with TLS? +AC_ARG_WITH(tls, AS_HELP_STRING([--with-tls], [Enable TLS support])) +if test x"$with_tls" != x -a x"$with_tls" != x"no"; then + AC_DEFINE(TLS_SUPPORT, 1, [Support TLS for session encryption.])dnl + tls_support=yes +else + tls_support=no +fi + dnl What should be the default editor? AC_ARG_WITH(editor, AS_HELP_STRING([--with-editor=EDITOR],[specify the default editor])) @@ -135,23 +130,6 @@ fi AC_DEFINE_UNQUOTED(BACKUP_PREFIX, "$backup_prefix", [The prefix that is prepended to the name of message files when they are "removed" by rmm. This should typically be `,' or `#'.])dnl -dnl Do you want support for hesiod -AC_ARG_WITH(hesiod, - AS_HELP_STRING([--with-hesiod=DIR],[specify location of Hesiod])) -if test x"$with_hesiod" != x -a x"$with_hesiod" != x"no"; then - AC_DEFINE(HESIOD,1,[Define this to compile support for using Hesiod.])dnl -fi - -dnl Do you want client-side support for kpop -AC_ARG_WITH(krb4, AS_HELP_STRING([--with-krb4=DIR], - [specify location of Kerberos V4 for KPOP support])) -if test x"$with_krb4" != x -a x"$with_krb4" != x"no"; then - enable_pop=yes - AC_DEFINE(KPOP, 1, - [Define to compile client-side support for kpop (kerberized pop) into inc and msgchk.])dnl - AC_DEFINE(KPOP_PRINCIPAL, "pop", [Define this to "pop" when using Kerberos V4])dnl -fi - dnl After we know if we're including apop and kpop support, do pop stuff if test x"$enable_pop" = x"yes"; then AC_DEFINE(POP, 1, @@ -489,11 +467,9 @@ AC_HEADER_TIME AC_HEADER_SYS_WAIT AC_HEADER_STAT AC_HEADER_TIOCGWINSZ -AC_CHECK_HEADERS(string.h memory.h stdlib.h unistd.h errno.h fcntl.h \ - limits.h crypt.h termcap.h termio.h termios.h locale.h \ +AC_CHECK_HEADERS(errno.h fcntl.h crypt.h termcap.h \ langinfo.h wchar.h wctype.h iconv.h netdb.h \ - sys/param.h sys/time.h sys/utsname.h sys/stream.h \ - arpa/inet.h arpa/ftp.h) + sys/param.h sys/time.h sys/stream.h) dnl dnl Checks for _IO_write_ptr. A Linuxism used by nmh on linux. We @@ -514,20 +490,11 @@ AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1, dnl --------------- dnl CHECK FUNCTIONS dnl --------------- -AC_FUNC_VFORK AC_CHECK_LIB(mkstemp,mkstemp) AC_CHECK_FUNCS(waitpid wait3 sigaction sigprocmask sigblock sigsetmask \ - sighold sigrelse writev lstat uname tzset killpg mkstemp \ + sighold sigrelse writev lstat uname tzset mkstemp \ getutent nl_langinfo mbtowc wcwidth) -dnl solaris has these in the nsl library -AC_SEARCH_LIBS(gethostbyname, nsl, - [AC_DEFINE(HAVE_GETHOSTBYNAME,1, - [Define to 1 if you have the `gethostbyname' function.])]) -AC_SEARCH_LIBS(sethostent, nsl, - [AC_DEFINE(HAVE_SETHOSTENT,1, - [Define to 1 if you have the `sethostent' function.])]) - dnl sigsetjmp may be a macro AC_MSG_CHECKING(for sigsetjmp) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], @@ -535,8 +502,6 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [Define to 1 if you have the `sigsetjmp'.]) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) -AC_REPLACE_FUNCS(memmove snprintf strerror strdup) - dnl Look for the initgroups() declaration. On AIX 4.[13], Solaris 4.1.3, and dnl ULTRIX 4.2A the function is defined in libc but there's no declaration in dnl any system header. @@ -689,89 +654,38 @@ else AC_SUBST(NDBM_LIBS) fi +dnl ------------------ +dnl Set RPM build root +dnl ------------------ +dnl nmhrpm is used in the final summary, see below. The default value is +dnl reported there as ./RPM, consistent with the reporting of the default +dnl source code location as ., but its absolute path is used in the Makefile. +AC_ARG_WITH(rpmdir, + AS_HELP_STRING([--with-rpmdir=RPMDIR], [RPM build directory @<:@RPM@:>@])) + AS_IF([test x"$with_rpmdir" = x], [rpmdir='$(abs_srcdir)/RPM'; nmhrpm=./RPM], + [rpmdir="$with_rpmdir"; eval "nmhrpm=${rpmdir}"]) +AC_SUBST(rpmdir) -dnl ---------------- -dnl CHECK FOR HESIOD -dnl ---------------- -if test x"$with_hesiod" != x -a x"$with_hesiod" != x"no"; then - if test x"$with_hesiod" != x"yes"; then - HESIOD_INCLUDES="-I$with_hesiod/include" - HESIOD_LIBS="-L$with_hesiod/lib" - fi - AC_CHECK_FUNC(res_send, - [AC_CHECK_LIB(hesiod, hes_resolve, - [HESIOD_LIBS="$HESIOD_LIBS -lhesiod"], - [AC_MSG_ERROR(Hesiod library not found)], - $HESIOD_LIBS)], - [AC_CHECK_LIB(hesiod, hes_resolve, - [HESIOD_LIBS="$HESIOD_LIBS -lhesiod -lresolv"], - [AC_MSG_ERROR(Hesiod library not found)], - $HESIOD_LIBS -lresolv)]) - -fi -AC_SUBST(HESIOD_INCLUDES)dnl -AC_SUBST(HESIOD_LIBS)dnl - -dnl ---------------------------------- -dnl CHECK FOR KRB4 (Kerberos4 support) -dnl ---------------------------------- -if test x"$with_krb4" != x -a x"$with_krb4" != x"no"; then - if test x"$with_krb4" != x"yes"; then - KRB4_INCLUDES="-I$with_krb4/include" - if test -d "$with_krb4/include/kerberosIV"; then - KRB4_INCLUDES="$KRB4_INCLUDES -I$with_krb4/include/kerberosIV" - fi - KRB4_LIBS="-L$with_krb4/lib" - elif test -d /usr/include/kerberosIV; then - KRB4_INCLUDES="-I/usr/include/kerberosIV" - fi -dnl First, check if we have -lk5crypto, since that means we have a recent krb5 - - AC_CHECK_LIB(k5crypto, krb5_encrypt, - [AC_CHECK_LIB(krb4, krb_rd_req, - [KRB4_LIBS="$KRB4_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"], - [AC_MSG_ERROR(Kerberos 4 compatibility libraries not found)], - $KRB4_LIBS -ldes425 -lkrb5 -lk5crypto -lcom_err)], - - [AC_CHECK_LIB(krb4, krb_rd_req, - [KRB4_LIBS="$KRB4_LIBS -lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err"], - [AC_CHECK_LIB(krb, krb_rd_req, - [KRB4_LIBS="$KRB4_LIBS -lkrb -ldes"], - [AC_MSG_ERROR(Kerberos 4 libraries not found)], - $KRB4_LIBS -ldes)], - $KRB4_LIBS -ldes425 -lkrb5 -lcrypto -lcom_err)], - $KRB4_LIBS) - -fi -AC_SUBST(KRB4_INCLUDES)dnl -AC_SUBST(KRB4_LIBS)dnl dnl -------------------- -dnl CHECK FOR CYRUS SASL +dnl CHECK FOR CYRUS-SASL dnl -------------------- -if test x"$with_cyrus_sasl" != x -a x"$with_cyrus_sasl" != x"no"; then - if test x"$with_cyrus_sasl" != x"yes"; then - SASL_INCLUDES="-I$with_cyrus_sasl/include" - SASL_LIBS="-L$with_cyrus_sasl/lib" - - dnl Do OS-specific hardcoding of SASL shared library path into executables, - dnl so user isn't forced to set environment variables like Solaris' - dnl LD_LIBRARY_PATH. - case "$target_os" in - solaris*) - SASL_LIBS="$SASL_LIBS -R$with_cyrus_sasl/lib" - ;; - esac - fi - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $SASL_LIBS" - AC_CHECK_LIB(sasl2, sasl_client_new, - [SASL_LIBS="$SASL_LIBS -lsasl2"], - [AC_MSG_ERROR(Cyrus SASL library not found)]) - LDFLAGS="$save_LDFLAGS" -fi -AC_SUBST(SASL_INCLUDES)dnl -AC_SUBST(SASL_LIBS)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], , + [AC_MSG_ERROR([Cyrus SASL library not found])])]) + +dnl ----------------- +dnl CHECK FOR OPENSSL +dnl ----------------- + +AS_IF([test x"$tls_support" = x"yes"],[ + AC_CHECK_HEADER([openssl/ssl.h], , [AC_MSG_ERROR([openssl/ssl.h not found])]) + AC_CHECK_LIB([crypto], [BIO_write], , + [AC_MSG_ERROR([OpenSSL crypto library not found])]) + AC_CHECK_LIB([ssl], [SSL_library_init], , + [AC_MSG_ERROR([OpenSSL library not found])])]) dnl --------------------- dnl CHECK TERMCAP LIBRARY @@ -782,35 +696,6 @@ dnl tests will find it when it tries to link test programs. nmh_save_LIBS="$LIBS" LIBS="$TERMLIB $LIBS" -dnl Checks for external variable ospeed in the termcap library. -AC_CACHE_CHECK(if an include file defines ospeed, -nmh_cv_decl_ospeed_include_defines, -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include -#if HAVE_TERMIOS_H -#include -#endif -#if HAVE_TERMCAP_H -#include -#endif]], [[ospeed = 0;]])], -nmh_cv_decl_ospeed_include_defines=yes,nmh_cv_decl_ospeed_include_defines=no)]) - -if test $nmh_cv_decl_ospeed_include_defines = no; then - AC_CACHE_CHECK(if you must define ospeed, - nmh_cv_decl_ospeed_must_define, - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], - [[extern short ospeed; ospeed = 0;]])], - nmh_cv_decl_ospeed_must_define=yes,nmh_cv_decl_ospeed_must_define=no)]) -fi - -AH_TEMPLATE(HAVE_OSPEED, [Define to 1 if your termcap library has the ospeed variable.]) -if test $nmh_cv_decl_ospeed_include_defines = yes; then - AC_DEFINE(HAVE_OSPEED)dnl -elif test $nmh_cv_decl_ospeed_must_define = yes; then - AC_DEFINE(HAVE_OSPEED) - AC_DEFINE(MUST_DEFINE_OSPEED, 1, - [Define to 1 if you have ospeed, but it is not defined in termcap.h.]) -fi - dnl Check if tgetent accepts NULL (and will allocate its own termcap buffer) dnl Some termcaps reportedly accept a zero buffer, but then dump core dnl in tgetstr(). @@ -1060,11 +945,18 @@ AC_CONFIG_FILES(Makefile config/Makefile h/Makefile sbr/Makefile uip/Makefile \ AC_CONFIG_COMMANDS([stamp],[test -z "$CONFIG_HEADERS" || echo > stamp-h]) AC_OUTPUT -dnl Umm, what's the point of these assignments?? -- -eval "nmhbin=${bindir}"; eval "nmhbin2=${nmhbin}" -eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf2=${nmhsysconf}" -eval "nmhlib=${libdir}"; eval "nmhlib2=${nmhlib}" -eval "nmhman=${mandir}" +dnl These odd looking assignments are done to expand out unexpanded +dnl variables in bindir et al (for instance mandir is '${datarootdir}/man', +dnl but expanding that gives '${prefix}/share/man', so we need to expand +dnl again to get the final answer. +dnl We only use the expanded versions to print the install paths in +dnl the final summary and should use them nowhere else (see the autoconf +dnl docs for the rationale for bindir etc being unexpanded). +eval "nmhbin=${bindir}"; eval "nmhbin=${nmhbin}" +eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf=${nmhsysconf}" +eval "nmhlib=${libdir}"; eval "nmhlib=${nmhlib}" +eval "nmhman=${mandir}"; eval "nmhman=${nmhman}" +eval "nmhrpm=${nmhrpm}"; pop_kinds=no if test x"$enable_pop" = x"yes"; then @@ -1074,10 +966,6 @@ if test x"$enable_pop" = x"yes"; then pop_kinds="${pop_kinds}APOP " fi - if test x"$with_krb4" != x -a x"$with_krb4" != x"no"; then - pop_kinds="${pop_kinds}KPOP " - fi - pop_kinds="${pop_kinds}POP3)" fi @@ -1091,10 +979,11 @@ compiler flags : ${CFLAGS} linker flags : ${LDFLAGS} definitions : ${OURDEFS} source code location : ${srcdir} -binary install path : ${nmhbin2} -libary install path : ${nmhlib2} -config files install path : ${nmhsysconf2} +binary install path : ${nmhbin} +library install path : ${nmhlib} +config files install path : ${nmhsysconf} man page install path : ${nmhman} +RPM build root : ${nmhrpm} backup prefix : ${backup_prefix} transport system : ${MTS} file locking type : ${LOCKTYPE} @@ -1103,5 +992,6 @@ default editor : ${editorpath} default pager : ${pagerpath} email address masquerading : ${masquerade} pop is enabled : ${pop_kinds} -SASL support : ${sasl_support}" +SASL support : ${sasl_support} +TLS support : ${tls_support}" echo ""