X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=648d8771b9198ca02f2fb995c66a461ba336aeff;hp=cd4a30e22dd11a8252e1565402d8706a4dc031d6;hb=e2dd4ac00b9979de34bd517fa57de56260d38755;hpb=ea2d9a2cbfe6af2a1f7b664e998d09ac5d68d5e0 diff --git a/configure b/configure index cd4a30e2..648d8771 100755 --- a/configure +++ b/configure @@ -1,7 +1,94 @@ #! /bin/sh +# Set several defaults (optionally specified by the user in +# environemnt variables) CC=${CC:-gcc} CXX=${CXX:-g++} +CFLAGS=${CFLAGS:--O2} +CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)} +XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config-1.1 xapian-config} + +# We don't allow the EMACS or GZIP Makefile variables inherit values +# from the environment as we do with CC and CXX above. The reason is +# that these names as environment variables have existing uses other +# than the program name that we want. (EMACS is set to 't' when a +# shell is running within emacs and GZIP specifies arguments to pass +# on the gzip command line). + +# Set the defaults for values the user can specify with command-line +# options. +PREFIX=/usr/local +LIBDIR= + +usage () +{ + cat < /dev/null 2>&1; then - printf "Yes.\n" - have_xapian=1 - xapian_cxxflags=$(xapian-config --cxxflags) - xapian_ldflags=$(xapian-config --libs) -else +have_xapian=0 +for xapian_config in ${XAPIAN_CONFIG}; do + if ${xapian_config} --version > /dev/null 2>&1; then + printf "Yes.\n" + have_xapian=1 + xapian_cxxflags=$(${xapian_config} --cxxflags) + xapian_ldflags=$(${xapian_config} --libs) + break + fi +done +if [ ${have_xapian} = "0" ]; then printf "No.\n" - have_xapian=0 errors=$((errors + 1)) fi @@ -84,6 +175,15 @@ else emacs_lispdir='$(prefix)/share/emacs/site-lisp' fi +printf "Checking if emacs is available... " +if emacs --quick --batch > /dev/null 2>&1; then + printf "Yes.\n" + have_emacs=1 +else + printf "No (so will not byte-compile emacs code)\n" + have_emacs=0 +fi + if [ $errors -gt 0 ]; then cat < /dev/null 2>&1 +if ${CC} -o compat/have_getline compat/have_getline.c > /dev/null 2>&1 then printf "Yes.\n" have_getline=1 @@ -150,7 +258,7 @@ else printf "No (will use our own instead).\n" have_getline=0 fi -rm -f config/have_getline +rm -f compat/have_getline cat <