X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=5d254b3d97c09ab8ee047f4cd0b3719c3258909b;hp=92b6710fdef8ff020954e9e01709fca1efb23ee0;hb=bf159bd829efb6aa73c68542949eb11d9a44d93c;hpb=a4d3f07e5162db4f9345f32f623ce94f5015c873 diff --git a/configure b/configure index 92b6710f..5d254b3d 100755 --- a/configure +++ b/configure @@ -1,5 +1,88 @@ #! /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 +LIBDIR= + +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 +131,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 +143,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 +156,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 +190,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 @@ -168,19 +263,58 @@ cat > Makefile.config <