]> git.notmuchmail.org Git - notmuch/commitdiff
configure: Assimilate new getlinetest into recent configure conventions.
authorCarl Worth <cworth@cworth.org>
Wed, 2 Dec 2009 00:00:31 +0000 (16:00 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 2 Dec 2009 00:33:25 +0000 (16:33 -0800)
We're now using printf to print what we're checking before we check. We're
also making variables such as HAVE_GETLINE available to both make and to
the C pre-processor.

With this, the local getline implementation is now only compiled if not
available on the system.

Makefile
configure

index c0b1b3fa60057cdc50b8188cdcaad5b39c7c7368..17be8b482a03f1ade341f250ceb6fc7bdc341455 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,16 +34,17 @@ override LDFLAGS += \
 
 all: notmuch notmuch.1.gz
 
 
 all: notmuch notmuch.1.gz
 
-include lib/Makefile.local
-include compat/Makefile.local
-include Makefile.local
-
-# And get user settings from the output of configure
+# Before including any other Makefile fragments, get settings from the
+# output of configure
 Makefile.config: configure
        ./configure
 
 include Makefile.config
 
 Makefile.config: configure
        ./configure
 
 include Makefile.config
 
+include lib/Makefile.local
+include compat/Makefile.local
+include Makefile.local
+
 # The user has not set any verbosity, default to quiet mode and inform the
 # user how to enable verbose compiles.
 ifeq ($(V),)
 # The user has not set any verbosity, default to quiet mode and inform the
 # user how to enable verbose compiles.
 ifeq ($(V),)
index 1b5f7e04eee3f584ac4c8a56d1c58d03dc221d06..bb1f0dbc22b4519521ee47f7aef41dc2e6b0e532 100755 (executable)
--- a/configure
+++ b/configure
@@ -126,12 +126,14 @@ EOF
     exit 1
 fi
 
     exit 1
 fi
 
+printf "Checking for getline... "
 if ! gcc -o getlinetest getlinetest.c > /dev/null 2>&1
 then
 if ! gcc -o getlinetest getlinetest.c > /dev/null 2>&1
 then
-    echo "Checking for getline... No."
-    getline=-Dgetline=_notmuch_getline
+    printf "No.\n"
+    have_getline=0
 else
 else
-    echo "Checking for getline... Yes."
+    printf "Yes.\n"
+    have_getline=1
 fi
 rm -f getlinetest
 
 fi
 rm -f getlinetest
 
@@ -148,5 +150,6 @@ EOF
 # construct the Makefile.config
 cat > Makefile.config <<EOF
 prefix = /usr/local
 # construct the Makefile.config
 cat > Makefile.config <<EOF
 prefix = /usr/local
-override CFLAGS += -DHAVE_VALGRIND=${have_valgrind} ${valgrind_flags} ${getline}
+HAVE_GETLINE = ${have_getline}
+override CFLAGS += -DHAVE_VALGRIND=${have_valgrind} ${valgrind_flags} -DHAVE_GETLINE=\$(HAVE_GETLINE)
 EOF
 EOF