X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=df1636d2f576a4031f9b2e8d6cec9e2846120410;hp=cd4a30e22dd11a8252e1565402d8706a4dc031d6;hb=bb5211684654b7cf54f842990a733a64fe01d612;hpb=ea2d9a2cbfe6af2a1f7b664e998d09ac5d68d5e0 diff --git a/configure b/configure index cd4a30e2..df1636d2 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 @@ -106,14 +197,20 @@ EOF fi cat <