From: Brendan Cully Date: Mon, 28 May 2007 23:44:20 +0000 (-0700) Subject: Use autoconf instead of "which" to discover MD5 tool X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2548303f578351d9a9c8abf2c3bfbc36a92279af;p=mutt Use autoconf instead of "which" to discover MD5 tool --- diff --git a/ChangeLog b/ChangeLog index aeea96cd..9e4e5d9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -306,7 +306,7 @@ 2007-04-05 13:06 -0700 Jukka Salmi (3638701db407) - * ChangeLog, configure.ac: Check for BDB4 libs in $lib as well as + * configure.ac: Check for BDB4 libs in $lib as well as $lib/$ver (fixes pkgsrc BDB4 detection) 2007-04-05 12:55 -0700 Brendan Cully (4f435337507e) diff --git a/Makefile.am b/Makefile.am index e9707364..1f366297 100644 --- a/Makefile.am +++ b/Makefile.am @@ -78,7 +78,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \ makedoc.c makedoc-defs.h stamp-doc-rc README.SSL smime.h \ muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \ ChangeLog ChangeLog.old mkchangelog.sh cvslog2changelog.pl mutt_idna.h \ - snprintf.c regex.c crypt-gpgme.h hcachever.sh + snprintf.c regex.c crypt-gpgme.h hcachever.sh.in EXTRA_SCRIPTS = smime_keys @@ -128,7 +128,7 @@ reldate.h: $(srcdir)/ChangeLog hcversion.h: $(srcdir)/mutt.h $(srcdir)/rfc822.h ( echo '#include "config.h"'; echo '#include "mutt.h"'; ) \ - | $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - | $(srcdir)/hcachever.sh hcversion.h + | $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - | sh ./hcachever.sh hcversion.h patchlist.c: $(srcdir)/PATCHES $(srcdir)/patchlist.sh $(srcdir)/patchlist.sh < $(srcdir)/PATCHES > patchlist.c diff --git a/configure.ac b/configure.ac index dd2bc748..af87f2de 100644 --- a/configure.ac +++ b/configure.ac @@ -813,6 +813,9 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching]) need_md5="yes" + dnl hcachever.sh tool for calculating struct digest + AC_CHECK_PROGS([MD5], [md5 md5sum openssl], [none]) + use_qdbm=no AC_ARG_WITH(qdbm, AC_HELP_STRING([--without-qdbm], [Don't use qdbm even if it is available])) if test "$with_qdbm" != "no" @@ -1186,8 +1189,6 @@ then fi AC_SUBST(DSLROOT) -AC_OUTPUT(Makefile intl/Makefile m4/Makefile - po/Makefile.in doc/Makefile contrib/Makefile - muttbug.sh - imap/Makefile - doc/instdoc.sh) +AC_OUTPUT(Makefile contrib/Makefile doc/Makefile imap/Makefile + intl/Makefile m4/Makefile po/Makefile.in + hcachever.sh muttbug.sh doc/instdoc.sh) diff --git a/hcachever.sh b/hcachever.sh.in similarity index 92% rename from hcachever.sh rename to hcachever.sh.in index e350e197..41ade134 100755 --- a/hcachever.sh +++ b/hcachever.sh.in @@ -2,16 +2,12 @@ BASEVERSION=1 -if test -x "`which md5`" -then - MD5=md5 -elif test -x "`which md5sum`" -then - MD5=md5sum -elif test -x "`which openssl`" +MD5=@MD5@ +if test "$MD5" = "openssl" then MD5="openssl md5 -hex" -else +elif test "$MD5" = "none" +then echo "ERROR: no MD5 tool found" exit 1 fi