From: Carl Worth Date: Tue, 1 Dec 2009 23:23:25 +0000 (-0800) Subject: Makefile: Incorporate getline implementation into the build. X-Git-Tag: 0.1~263 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=880b21a097104bee5f50a444c5130695d143fd8a;p=notmuch.git Makefile: Incorporate getline implementation into the build. It's unconditional for a very short time. We expect to soon be building it only if necessary. --- diff --git a/Makefile b/Makefile index e42584b2..c0b1b3fa 100644 --- 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 diff --git a/Makefile.local b/Makefile.local index aff7d2c0..4b29ad83 100644 --- a/Makefile.local +++ b/Makefile.local @@ -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 87f84a42..578d833c 100644 --- 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 index 00000000..9a29ffcf --- /dev/null +++ b/compat/Makefile @@ -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 index 00000000..ccc59aef --- /dev/null +++ b/compat/Makefile.local @@ -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 diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index d3f9a4c4..d2678f06 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -26,6 +26,8 @@ #endif #include +#include "compat.h" + #include "notmuch.h" NOTMUCH_BEGIN_DECLS diff --git a/notmuch-client.h b/notmuch-client.h index 2888a6c8..50a30fed 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -21,12 +21,13 @@ #ifndef NOTMUCH_CLIENT_H #define NOTMUCH_CLIENT_H - #ifndef _GNU_SOURCE #define _GNU_SOURCE /* for getline */ #endif #include +#include "compat.h" + #include #include "notmuch.h"