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.
This commit is contained in:
Carl Worth 2009-12-01 15:23:25 -08:00
parent 7fd7611b23
commit 880b21a097
7 changed files with 22 additions and 7 deletions

View file

@ -32,9 +32,11 @@ override LDFLAGS += \
$(shell pkg-config --libs glib-2.0 gmime-2.4 talloc) \ $(shell pkg-config --libs glib-2.0 gmime-2.4 talloc) \
$(shell xapian-config --libs) $(shell xapian-config --libs)
# Include our local Makefile.local first so that its first target is default all: notmuch notmuch.1.gz
include Makefile.local
include lib/Makefile.local include lib/Makefile.local
include compat/Makefile.local
include Makefile.local
# And get user settings from the output of configure # And get user settings from the output of configure
Makefile.config: configure Makefile.config: configure

View file

@ -1,8 +1,7 @@
all: notmuch notmuch.1.gz
emacs: notmuch.elc emacs: notmuch.elc
notmuch_client_srcs = \ notmuch_client_srcs = \
$(notmuch_compat_srcs) \
debugger.c \ debugger.c \
gmime-filter-reply.c \ gmime-filter-reply.c \
notmuch.c \ notmuch.c \

2
TODO
View file

@ -41,8 +41,6 @@ Portability
----------- -----------
Fix configure script to test each compiler warning we want to use. Fix configure script to test each compiler warning we want to use.
Implement getline locally, (look at gnulib).
Completion Completion
---------- ----------
Fix bash completion to complete multiple search options (both --first Fix bash completion to complete multiple search options (both --first

5
compat/Makefile Normal file
View file

@ -0,0 +1,5 @@
all:
$(MAKE) -C .. all
clean:
$(MAKE) -C .. clean

8
compat/Makefile.local Normal file
View file

@ -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

View file

@ -26,6 +26,8 @@
#endif #endif
#include <stdio.h> #include <stdio.h>
#include "compat.h"
#include "notmuch.h" #include "notmuch.h"
NOTMUCH_BEGIN_DECLS NOTMUCH_BEGIN_DECLS

View file

@ -21,12 +21,13 @@
#ifndef NOTMUCH_CLIENT_H #ifndef NOTMUCH_CLIENT_H
#define NOTMUCH_CLIENT_H #define NOTMUCH_CLIENT_H
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
#define _GNU_SOURCE /* for getline */ #define _GNU_SOURCE /* for getline */
#endif #endif
#include <stdio.h> #include <stdio.h>
#include "compat.h"
#include <gmime/gmime.h> #include <gmime/gmime.h>
#include "notmuch.h" #include "notmuch.h"