]> git.notmuchmail.org Git - notmuch/blobdiff - configure
Fix configure script to properly detect gmime-2.6 if available.
[notmuch] / configure
index 3999ce8f3a80509dda16572a3a92bcbf4035a103..dedb7d87ccb1530026fe960e6e6a1dddfa33bf38 100755 (executable)
--- a/configure
+++ b/configure
@@ -97,6 +97,7 @@ Fine tuning of some installation directories is available:
        --mandir=DIR            Install man pages to DIR [PREFIX/share/man]
        --sysconfdir=DIR        Read-only single-machine data [PREFIX/etc]
        --emacslispdir=DIR      Emacs code [PREFIX/share/emacs/site-lisp]
+       --emacsetcdir=DIR       Emacs miscellaneous files [PREFIX/share/emacs/site-lisp]
        --bashcompletiondir=DIR Bash completions files [SYSCONFDIR/bash_completion.d]
        --zshcompletiondir=DIR  Zsh completions files [PREFIX/share/zsh/functions/Completion/Unix]
 
@@ -139,6 +140,8 @@ for option; do
        SYSCONFDIR="${option#*=}"
     elif [ "${option%%=*}" = '--emacslispdir' ] ; then
        EMACSLISPDIR="${option#*=}"
+    elif [ "${option%%=*}" = '--emacsetcdir' ] ; then
+       EMACSETCDIR="${option#*=}"
     elif [ "${option%%=*}" = '--bashcompletiondir' ] ; then
        BASHCOMPLETIONDIR="${option#*=}"
     elif [ "${option%%=*}" = '--zshcompletiondir' ] ; then
@@ -278,6 +281,7 @@ for gmimepc in gmime-2.6 gmime-2.4; do
        have_gmime=1
        gmime_cflags=$(pkg-config --cflags $gmimepc)
        gmime_ldflags=$(pkg-config --libs $gmimepc)
+       break
     fi
 done
 if [ "$have_gmime" = "0" ]; then
@@ -286,10 +290,10 @@ if [ "$have_gmime" = "0" ]; then
 fi
 
 # GMime already depends on Glib >= 2.12, but we use at least one Glib
-# function that only exists as of 2.14, (g_hash_table_get_keys)
-printf "Checking for Glib development files (>= 2.14)... "
+# function that only exists as of 2.22, (g_array_unref)
+printf "Checking for Glib development files (>= 2.22)... "
 have_glib=0
-if pkg-config --exists 'glib-2.0 >= 2.14'; then
+if pkg-config --exists 'glib-2.0 >= 2.22'; then
     printf "Yes.\n"
     have_glib=1
     glib_cflags=$(pkg-config --cflags glib-2.0)
@@ -330,6 +334,14 @@ if [ -z "${EMACSLISPDIR}" ]; then
     fi
 fi
 
+if [ -z "${EMACSETCDIR}" ]; then
+    if pkg-config --exists emacs; then
+       EMACSETCDIR=$(pkg-config emacs --variable sitepkglispdir)
+    else
+       EMACSETCDIR='$(prefix)/share/emacs/site-lisp'
+    fi
+fi
+
 printf "Checking if emacs is available... "
 if emacs --quick --batch > /dev/null 2>&1; then
     printf "Yes.\n"
@@ -405,7 +417,7 @@ EOF
        echo "  http://spruce.sourceforge.net/gmime/"
     fi
     if [ $have_glib -eq 0 ]; then
-       echo "  Glib library >= 2.14 (including development files such as headers)"
+       echo "  Glib library >= 2.22 (including development files such as headers)"
        echo "  http://ftp.gnome.org/pub/gnome/sources/glib/"
     fi
     if [ $have_talloc -eq 0 ]; then
@@ -614,6 +626,10 @@ sysconfdir = ${SYSCONFDIR:=\$(prefix)/etc}
 # The directory to which emacs lisp files should be installed
 emacslispdir=${EMACSLISPDIR}
 
+# The directory to which emacs miscellaneous (machine-independent) files should
+# be installed
+emacsetcdir=${EMACSETCDIR}
+
 # Whether there's an emacs binary available for byte-compiling
 HAVE_EMACS = ${have_emacs}