X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=440d678c7eb3828041a24577cf7f1e37bf36c2ab;hp=56f550b055c5854d2588c8a36e84ddc2eb6e935c;hb=005c2f0df17de8afdf9f67b923d26f2358236171;hpb=2eb558fd9b369458c23b57b44281758bd17a5580 diff --git a/configure b/configure index 56f550b0..440d678c 100755 --- a/configure +++ b/configure @@ -71,16 +71,6 @@ WITH_BASH=1 WITH_RUBY=1 WITH_ZSH=1 -# Compatible GMime versions (with constraints). -# If using GMime 2.6, we need to have a version >= 2.6.5 to avoid a -# crypto bug. We need 2.6.7 for permissive "From " header handling. -GMIME_24_VERSION_CTR='' -GMIME_24_VERSION="gmime-2.4 $GMIME_24_VERSION_CTR" -GMIME_26_VERSION_CTR='>= 2.6.7' -GMIME_26_VERSION="gmime-2.6 $GMIME_26_VERSION_CTR" - -WITH_GMIME_VERSIONS="$GMIME_26_VERSION;$GMIME_24_VERSION" - usage () { cat < _libversion.c < +#include "lib/notmuch.h" +int main(void) { + printf("libnotmuch_version_major=%d\n", + LIBNOTMUCH_MAJOR_VERSION); + printf("libnotmuch_version_minor=%d\n", + LIBNOTMUCH_MINOR_VERSION); + printf("libnotmuch_version_release=%d\n", + LIBNOTMUCH_MICRO_VERSION); + return 0; +} +EOF +if ${CC} ${CFLAGS} _libversion.c -o _libversion > /dev/null 2>&1 && \ + ./_libversion > _libversion.sh && . ./_libversion.sh +then + printf "OK.\n" +else + cat < /dev/null 2>&1; then have_pkg_config=1 else @@ -360,20 +371,19 @@ if [ ${have_xapian} = "1" ]; then esac fi + +# we need to have a version >= 2.6.5 to avoid a crypto bug. We need +# 2.6.7 for permissive "From " header handling. +GMIME_MINVER=2.6.7 + printf "Checking for GMime development files... " -have_gmime=0 -IFS=';' -for gmimepc in $WITH_GMIME_VERSIONS; do - if pkg-config --exists $gmimepc; then - printf "Yes ($gmimepc).\n" - have_gmime=1 - gmime_cflags=$(pkg-config --cflags $gmimepc) - gmime_ldflags=$(pkg-config --libs $gmimepc) - break - fi -done -IFS=$DEFAULT_IFS -if [ "$have_gmime" = "0" ]; then +if pkg-config --exists "gmime-2.6 >= $GMIME_MINVER"; then + printf "Yes.\n" + have_gmime=1 + gmime_cflags=$(pkg-config --cflags gmime-2.6) + gmime_ldflags=$(pkg-config --libs gmime-2.6) +else + have_gmime=0 printf "No.\n" errors=$((errors + 1)) fi @@ -609,7 +619,7 @@ EOF echo fi if [ $have_gmime -eq 0 ]; then - echo " Either GMime 2.4 library" $GMIME_24_VERSION_CTR "or GMime 2.6 library" $GMIME_26_VERSION_CTR + echo " GMime 2.6 library >= $GMIME_MINVER" echo " (including development files such as headers)" echo " http://spruce.sourceforge.net/gmime/" echo @@ -807,7 +817,7 @@ for flag in -Wmissing-declarations; do done printf "\n\t${WARN_CFLAGS}\n" -rm -f minimal minimal.c +rm -f minimal minimal.c _libversion.c _libversion _libversion.sh # construct the Makefile.config cat > Makefile.config <