X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=c6e0c09a8f8014c9458c9461ae59094c49e56e05;hp=92b6710fdef8ff020954e9e01709fca1efb23ee0;hb=4989ef3d871f2510dcf9cf65e7fddd81deeff82e;hpb=a4d3f07e5162db4f9345f32f623ce94f5015c873 diff --git a/configure b/configure index 92b6710f..c6e0c09a 100755 --- a/configure +++ b/configure @@ -1,5 +1,67 @@ #! /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)} + +# 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)" + xapian_cxxflags=$(xapian-config --cxxflags) + xapian_ldflags=$(xapian-config --libs) else printf "No.\n" have_xapian=0 @@ -44,8 +106,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 +118,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 +131,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 +165,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,8 +238,20 @@ cat > Makefile.config <