From d36bae62c0892340fc8636158df066039f257a8f Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Tue, 14 Nov 2006 12:20:31 +0100 Subject: [PATCH] more autoconf simplifications. Signed-off-by: Pierre Habouzit --- configure.ac | 41 +++++++++---------------- doconfig.sh | 2 +- m4/Makefile.am | 39 +++++++++++++++++++----- m4/Makefile.am.in | 2 +- m4/README | 8 ----- m4/gssapi.m4 | 77 ----------------------------------------------- 6 files changed, 48 insertions(+), 121 deletions(-) delete mode 100644 m4/README delete mode 100644 m4/gssapi.m4 diff --git a/configure.ac b/configure.ac index 9867df4..9431e6b 100644 --- a/configure.ac +++ b/configure.ac @@ -339,8 +339,6 @@ AC_ARG_ENABLE(nntp, AC_HELP_STRING([--enable-nntp],[Enable NNTP support]),[ ]) AM_CONDITIONAL(BUILD_NNTP, test x$need_nntp = xyes) -dnl -- end socket dependencies -- - AC_MSG_CHECKING([for socklen_t]) AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) @@ -351,30 +349,21 @@ AC_CHECK_FUNCS(getaddrinfo) dnl -- imap dependencies -- -AC_ARG_WITH(gss, AC_HELP_STRING([--with-gss[=PFX]], [Compile in GSSAPI authentication for IMAP]), - gss_prefix="$withval", gss_prefix="no") -if test "$gss_prefix" != "no" -then - MUTT_AM_PATH_GSSAPI(gss_prefix) - AC_MSG_CHECKING(GSSAPI implementation) - AC_MSG_RESULT($GSSAPI_IMPL) - if test "$GSSAPI_IMPL" = "none" - then - AC_CACHE_SAVE - AC_MSG_RESULT([GSSAPI libraries not found]) - fi - if test "$GSSAPI_IMPL" = "Heimdal" - then - AC_DEFINE(HAVE_HEIMDAL,1,[ Define if your GSSAPI implementation is Heimdal ]) +AC_ARG_WITH(gss, AC_HELP_STRING([--with-gss], [Compile in GSSAPI authentication for IMAP]),[ + if test x$with_gss != xno; then + PKG_CHECK_MODULES(GSSAPI,libgssapi,[ + CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS" + MUTTLIBS="$MUTTLIBS $GSSAPI_LIBS" + AC_DEFINE(USE_GSS,1,[ Define if you have GSSAPI libraries available ]) + AM_CONDITIONAL(USE_GSS, true) + ],[ + AC_MSG_RESULT([could not find libgssapi]) + AM_CONDITIONAL(USE_GSS, false) + ]) + else + AM_CONDITIONAL(USE_GSS, false) fi - CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS" - MUTTLIBS="$MUTTLIBS $GSSAPI_LIBS" - AC_DEFINE(USE_GSS,1,[ Define if you have GSSAPI libraries available ]) - need_gss="yes" -fi -AM_CONDITIONAL(USE_GSS, test x$need_gss = xyes) - -dnl -- end imap dependencies -- +]) AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl[=PFX]], [Compile in SSL support for POP/IMAP]), [ if test "$with_ssl" != "no"; then @@ -435,7 +424,7 @@ AC_ARG_WITH(sasl2, AC_HELP_STRING([--with-sasl2[=PFX]], ]) AM_CONDITIONAL(USE_SASL, test x$need_sasl = xyes) -AC_ARG_WITH(idn, AC_HELP_STRING([--with-idn=[PFX]], [Use GNU libidn for domain names]),[ +AC_ARG_WITH(idn, AC_HELP_STRING([--with-idn], [Use GNU libidn for domain names]),[ if test x$with_idn != xno ; then PKG_CHECK_MODULES(IDN,libidn,[ if $PKG_CONFIG --atleast-version=0.6; then diff --git a/doconfig.sh b/doconfig.sh index fd1203a..a8645ee 100755 --- a/doconfig.sh +++ b/doconfig.sh @@ -2,5 +2,5 @@ ./configure -C --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \ --with-sharedir=/usr/share/mutt-ng --with-docdir=/usr/share/doc/mutt-ng \ --with-mailpath=/var/mail --enable-fcntl --with-mixmaster --with-sasl2 \ - --with-idn --with-curses --enable-nntp --enable-debug --with-gnutls \ + --with-idn --with-curses --enable-nntp --with-gss --with-gnutls \ --enable-gpgme --enable-hcache diff --git a/m4/Makefile.am b/m4/Makefile.am index ba7143f..ef5d521 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,19 +1,42 @@ ## Process this file with automake to produce Makefile.in -*-Makefile-*- ##m4-files-begin -EXTRA_DIST = README Makefile.am.in \ - intmax.m4 inttypes_h.m4 inttypes-h.m4 inttypes-pri.m4 lib-ld.m4 \ - lib-link.m4 lib-prefix.m4 lock.m4 longdouble.m4 longlong.m4 \ - nls.m4 po.m4 printf-posix.m4 signed.m4 size_max.m4 stdint_h.m4 \ - uintmax_t.m4 ulonglong.m4 visibility.m4 wchar_t.m4 wint_t.m4 \ - xsize.m4 codeset.m4 curslib.m4 funcdecl.m4 gettext.m4 gssapi.m4 \ - iconv.m4 lcmessage.m4 libesmtp.m4 progtest.m4 types.m4 +EXTRA_DIST = Makefile.am.in \ +codeset.m4 \ +curslib.m4 \ +funcdecl.m4 \ +gettext.m4 \ +gperf.m4 \ +iconv.m4 \ +intmax.m4 \ +inttypes_h.m4 \ +inttypes-h.m4 \ +inttypes-pri.m4 \ +lcmessage.m4 \ +libesmtp.m4 \ +lib-ld.m4 \ +lib-link.m4 \ +lib-prefix.m4 \ +lock.m4 \ +longdouble.m4 \ +longlong.m4 \ +nls.m4 \ +po.m4 \ +progtest.m4 \ +size_max.m4 \ +stdint_h.m4 \ +uintmax_t.m4 \ +ulonglong.m4 \ +visibility.m4 \ +wchar_t.m4 \ +wint_t.m4 \ +xsize.m4 ##m4-files-end Makefile.am: Makefile.am.in rm -f $@ $@t sed -n '1,/^##m4-files-begin/p' Makefile.am.in > $@t - ( (echo EXTRA_DIST = README Makefile.am.in | tr '\012' @); \ + ( (echo EXTRA_DIST = Makefile.am.in | tr '\012' @); \ (echo *.m4|tr ' ' @) ) \ |sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \ >> $@t diff --git a/m4/Makefile.am.in b/m4/Makefile.am.in index d4802c3..790b158 100644 --- a/m4/Makefile.am.in +++ b/m4/Makefile.am.in @@ -6,7 +6,7 @@ Makefile.am: Makefile.am.in rm -f $@ $@t sed -n '1,/^##m4-files-begin/p' Makefile.am.in > $@t - ( (echo EXTRA_DIST = README Makefile.am.in | tr '\012' @); \ + ( (echo EXTRA_DIST = Makefile.am.in | tr '\012' @); \ (echo *.m4|tr ' ' @) ) \ |sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \ >> $@t diff --git a/m4/README b/m4/README deleted file mode 100644 index 5e9b3a8..0000000 --- a/m4/README +++ /dev/null @@ -1,8 +0,0 @@ -These files are used by a program called aclocal (part of the GNU automake -package). aclocal uses these files to create aclocal.m4 which is in turn -used by autoconf to create the configure script at the the top level in -this distribution. - -The Makefile.am file in this directory is automatically generated -from the template file, Makefile.am.in. - diff --git a/m4/gssapi.m4 b/m4/gssapi.m4 deleted file mode 100644 index e8451ea..0000000 --- a/m4/gssapi.m4 +++ /dev/null @@ -1,77 +0,0 @@ -# gssapi.m4: Find GSSAPI libraries in either Heimdal or MIT implementations -# Brendan Cully 20010529 - -dnl MUTT_AM_PATH_GSSAPI(PREFIX) -dnl Search for a GSSAPI implementation in the standard locations plus PREFIX, -dnl if it is set and not "yes". -dnl Defines GSSAPI_CFLAGS and GSSAPI_LIBS if found. -dnl Defines GSSAPI_IMPL to "Heimdal", "MIT", or "OldMIT", or "none" if not found -AC_DEFUN([MUTT_AM_PATH_GSSAPI], -[ - GSSAPI_PREFIX=[$]$1 - GSSAPI_IMPL="none" - saved_CPPFLAGS="$CPPFLAGS" - saved_LDFLAGS="$LDFLAGS" - saved_LIBS="$LIBS" - dnl First try krb5-config - if test "$GSSAPI_PREFIX" != "yes" - then - krb5_path="$GSSAPI_PREFIX/bin" - else - krb5_path="$PATH" - fi - AC_PATH_PROG(KRB5CFGPATH, krb5-config, none, $krb5_path) - if test "$KRB5CFGPATH" != "none" - then - GSSAPI_CFLAGS="$CPPFLAGS `$KRB5CFGPATH --cflags gssapi`" - GSSAPI_LIBS="$MUTTLIBS `$KRB5CFGPATH --libs gssapi`" - case "`$KRB5CFGPATH --version`" in - "Kerberos 5 "*) GSSAPI_IMPL="MIT";; - ?eimdal*) GSSAPI_IMPL="Heimdal";; - *) GSSAPI_IMPL="Unknown";; - esac - else - dnl No krb5-config, run the old code - if test "$GSSAPI_PREFIX" != "yes" - then - GSSAPI_CFLAGS="-I$GSSAPI_PREFIX/include" - GSSAPI_LDFLAGS="-L$GSSAPI_PREFIX/lib" - CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS" - LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS" - fi - - dnl New MIT kerberos V support - AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context, [ - GSSAPI_IMPL="MIT", - GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" - ],, -lkrb5 -lk5crypto -lcom_err) - - dnl Heimdal kerberos V support - if test "$GSSAPI_IMPL" = "none" - then - AC_CHECK_LIB(gssapi, gss_init_sec_context, [ - GSSAPI_IMPL="Heimdal" - GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi -lkrb5 -ldes -lasn1 -lroken" - GSSAPI_LIBS="$GSSAPI_LIBS -lcrypt -lcom_err" - ],, -lkrb5 -ldes -lasn1 -lroken -lcrypt -lcom_err) - fi - - dnl Old MIT Kerberos V - dnl Note: older krb5 distributions use -lcrypto instead of - dnl -lk5crypto, which collides with OpenSSL. One way of dealing - dnl with that is to extract all objects from krb5's libcrypto - dnl and from openssl's libcrypto into the same directory, then - dnl to create a new libcrypto from these. - if test "$GSSAPI_IMPL" = "none" - then - AC_CHECK_LIB(gssapi_krb5, g_order_init, [ - GSSAPI_IMPL="OldMIT", - GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err" - ],, -lkrb5 -lcrypto -lcom_err) - fi - fi - - CPPFLAGS="$saved_CPPFLAGS" - LDFLAGS="$saved_LDFLAGS" - LIBS="$saved_LIBS" -]) -- 2.20.1