X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=d240b6acf8bda20b033e62ef1beda4c3cebe38d3;hp=97ee606fd3cf51c818e18d97ec1f5e4c8f01e572;hb=957ae198e708dc901e3a8c89b7364c2bc75ce371;hpb=222ee87dfefdd85ddbd7f148d5636746919d4100 diff --git a/configure b/configure index 97ee606f..d240b6ac 100755 --- a/configure +++ b/configure @@ -1,5 +1,81 @@ #! /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 - cxxflags="${cxxflags} $(xapian-config --cxxflags)" - ldflags="${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 @@ -44,8 +124,8 @@ printf "Checking for GMime 2.4 development files... " if pkg-config --modversion gmime-2.4 > /dev/null 2>&1; then printf "Yes.\n" have_gmime=1 - cflags="${cflags} $(pkg-config --cflags gmime-2.4)" - ldflags="${ldflags} $(pkg-config --libs gmime-2.4)" + gmime_cflags=$(pkg-config --cflags gmime-2.4) + gmime_ldflags=$(pkg-config --libs gmime-2.4) else printf "No.\n" have_gmime=0 @@ -56,8 +136,8 @@ printf "Checking for talloc development files... " if pkg-config --modversion talloc > /dev/null 2>&1; then printf "Yes.\n" have_talloc=1 - cflags="${cflags} $(pkg-config --cflags talloc)" - ldflags="${ldflags} $(pkg-config --libs talloc)" + talloc_cflags=$(pkg-config --cflags talloc) + talloc_ldflags=$(pkg-config --libs talloc) else printf "No.\n" have_talloc=0 @@ -69,7 +149,7 @@ printf "Checking for valgrind development files... " if pkg-config --modversion valgrind > /dev/null 2>&1; then printf "Yes.\n" have_valgrind=1 - cflags="${cflags} $(pkg-config --cflags valgrind)" + valgrind_cflags=$(pkg-config --cflags valgrind) else printf "No (but that's fine).\n" have_valgrind=0 @@ -103,29 +183,37 @@ EOF fi cat < /dev/null 2>&1 +if ${CC} -o config/have_getline config/have_getline.c > /dev/null 2>&1 then printf "Yes.\n" have_getline=1 @@ -161,10 +249,59 @@ EOF # construct the Makefile.config cat > Makefile.config <