X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=d240b6acf8bda20b033e62ef1beda4c3cebe38d3;hp=ff8baa5e52696686461d82d5cf9728e1c5448a0b;hb=c25bc03dc60846090d230cdad21e39faccce35ff;hpb=943f415f81207ea00bf1efe8c2c1cbf13a094a56 diff --git a/configure b/configure index ff8baa5e..d240b6ac 100755 --- a/configure +++ b/configure @@ -1,17 +1,78 @@ #! /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} -# defaults +# Set the defaults for values the user can specify with command-line +# options. PREFIX=/usr/local -# option parsing +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