[PATCH v2 3/9] Makefile.local: define _GNU_SOURCE
Mike Kelly
pioto at pioto.org
Wed May 30 00:01:58 PDT 2012
Several places currently define _GNU_SOURCE above the #includes to make
sure that things like 'getline(3)' are available, but defining these in
one place also helps to improve portability to other platforms where
these may not be available otherwise.
---
Makefile.local | 4 ++--
compat/have_getline.c | 1 -
compat/have_strcasestr.c | 1 -
lib/notmuch-private.h | 3 ---
notmuch-client.h | 3 ---
5 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/Makefile.local b/Makefile.local
index 53b4a0d..48826b6 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -39,8 +39,8 @@ GPG_FILE=$(SHA1_FILE).asc
PV_FILE=bindings/python/notmuch/version.py
# Smash together user's values with our extra values
-FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
-FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
+FINAL_CFLAGS = -D_GNU_SOURCE -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
+FINAL_CXXFLAGS = -D_GNU_SOURCE $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS)
FINAL_NOTMUCH_LINKER = CC
ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
diff --git a/compat/have_getline.c b/compat/have_getline.c
index a8bcd17..30f0e8f 100644
--- a/compat/have_getline.c
+++ b/compat/have_getline.c
@@ -1,4 +1,3 @@
-#define _GNU_SOURCE
#include <stdio.h>
#include <sys/types.h>
diff --git a/compat/have_strcasestr.c b/compat/have_strcasestr.c
index c0fb762..e637b46 100644
--- a/compat/have_strcasestr.c
+++ b/compat/have_strcasestr.c
@@ -1,4 +1,3 @@
-#define _GNU_SOURCE
#include <strings.h>
int main()
diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h
index bfb4111..95afc3f 100644
--- a/lib/notmuch-private.h
+++ b/lib/notmuch-private.h
@@ -21,9 +21,6 @@
#ifndef NOTMUCH_PRIVATE_H
#define NOTMUCH_PRIVATE_H
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE /* For getline and asprintf */
-#endif
#include <stdio.h>
#include "compat.h"
diff --git a/notmuch-client.h b/notmuch-client.h
index 19b7f01..3964229 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -21,9 +21,6 @@
#ifndef NOTMUCH_CLIENT_H
#define NOTMUCH_CLIENT_H
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE /* for getline */
-#endif
#include <stdio.h>
#include "compat.h"
--
1.7.10.2
More information about the notmuch
mailing list