Makefile: Incorporate getline implementation into the build.
authorCarl Worth <cworth@cworth.org>
Tue, 1 Dec 2009 23:23:25 +0000 (15:23 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 2 Dec 2009 00:33:17 +0000 (16:33 -0800)
It's unconditional for a very short time. We expect to soon be
building it only if necessary.

Makefile
Makefile.local
TODO
compat/Makefile [new file with mode: 0644]
compat/Makefile.local [new file with mode: 0644]
lib/notmuch-private.h
notmuch-client.h

index e42584b294bf7bce344cbaa37fd7279127b8f96c..c0b1b3fa60057cdc50b8188cdcaad5b39c7c7368 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -32,9 +32,11 @@ override LDFLAGS += \
        $(shell pkg-config --libs glib-2.0 gmime-2.4 talloc) \
        $(shell xapian-config --libs)
 
-# Include our local Makefile.local first so that its first target is default
-include Makefile.local
+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
 Makefile.config: configure
index aff7d2c0e665eb8d284ce4db4558c7294999bf24..4b29ad832324ef55dbdff1a1f3a72e8a972f3286 100644 (file)
@@ -1,8 +1,7 @@
-all: notmuch notmuch.1.gz
-
 emacs: notmuch.elc
 
 notmuch_client_srcs =          \
+       $(notmuch_compat_srcs)  \
        debugger.c              \
        gmime-filter-reply.c    \
        notmuch.c               \
diff --git a/TODO b/TODO
index 87f84a42935920d26c0503661288d6d1a2c0aa0b..578d833ccd61cf61208f1b6f975ecd515143fbb7 100644 (file)
--- a/TODO
+++ b/TODO
@@ -41,8 +41,6 @@ Portability
 -----------
 Fix configure script to test each compiler warning we want to use.
 
-Implement getline locally, (look at gnulib).
-
 Completion
 ----------
 Fix bash completion to complete multiple search options (both --first
diff --git a/compat/Makefile b/compat/Makefile
new file mode 100644 (file)
index 0000000..9a29ffc
--- /dev/null
@@ -0,0 +1,5 @@
+all:
+       $(MAKE) -C .. all
+
+clean:
+       $(MAKE) -C .. clean
diff --git a/compat/Makefile.local b/compat/Makefile.local
new file mode 100644 (file)
index 0000000..ccc59ae
--- /dev/null
@@ -0,0 +1,8 @@
+dir=compat
+extra_cflags += -I$(dir)
+
+notmuch_compat_srcs =
+
+ifneq ($(HAVE_GETLINE),1)
+notmuch_compat_srcs += $(dir)/getline.c $(dir)/getdelim.c
+endif
index d3f9a4c4ba4727c0860804ac30a0ddfd883565b6..d2678f06415d83e3cd14297c07797e72bc7f64c7 100644 (file)
@@ -26,6 +26,8 @@
 #endif
 #include <stdio.h>
 
+#include "compat.h"
+
 #include "notmuch.h"
 
 NOTMUCH_BEGIN_DECLS
index 2888a6c89679fc3574b8dac103ad8013d00b6359..50a30fed5d786fba3bbf7a6cfd26a13bb08ba5b3 100644 (file)
 #ifndef NOTMUCH_CLIENT_H
 #define NOTMUCH_CLIENT_H
 
-
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE /* for getline */
 #endif
 #include <stdio.h>
 
+#include "compat.h"
+
 #include <gmime/gmime.h>
 
 #include "notmuch.h"