X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=a2af672d8d2552ee1050225fd137493de19ab30e;hp=cd4a30e22dd11a8252e1565402d8706a4dc031d6;hb=3ab18d1c22c4b18b9ca8d73094b3bf10b95f35fb;hpb=ea2d9a2cbfe6af2a1f7b664e998d09ac5d68d5e0 diff --git a/configure b/configure index cd4a30e2..a2af672d 100755 --- a/configure +++ b/configure @@ -1,7 +1,80 @@ #! /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} + +# Set the defaults for values the user can specify with command-line +# options. +PREFIX=/usr/local + +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 @@ -106,14 +183,20 @@ EOF fi cat <