From: Mike Kelly Date: Wed, 30 May 2012 07:01:58 +0000 (+2000) Subject: [PATCH v2 3/9] Makefile.local: define _GNU_SOURCE X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=bc7a8d00c70ae80336f2b963ca2ae02db481464e;p=notmuch-archives.git [PATCH v2 3/9] Makefile.local: define _GNU_SOURCE --- diff --git a/82/e339929acbccd5b7525233577baff49f75ec34 b/82/e339929acbccd5b7525233577baff49f75ec34 new file mode 100644 index 000000000..6d89cf100 --- /dev/null +++ b/82/e339929acbccd5b7525233577baff49f75ec34 @@ -0,0 +1,143 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id D2DFB431FD6 + for ; Wed, 30 May 2012 00:02:57 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id dldTmQyDVjvS for ; + Wed, 30 May 2012 00:02:55 -0700 (PDT) +Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com + [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 12A93431FC2 + for ; Wed, 30 May 2012 00:02:55 -0700 (PDT) +Received: by vbbfc26 with SMTP id fc26so4786696vbb.26 + for ; Wed, 30 May 2012 00:02:54 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references + :x-gm-message-state; + bh=3cHfl+b8d6nAtW/oyAsU4a5+QCU76Ar6Gr3zcb8lgz0=; + b=DXcQj1ERBqTHIwsmtOa6+Cf1QnrLWL4lk/Wxm42kNlM0xF6WEsEji2rQO9bHUzwkSg + 2HpIY6Lpil6CGlcQGH/kNLcIICzGJskW8vzjKUD/H9n+xa2LUuysIJuan2Gl5oVlpPSZ + HHERsiodzGi9TjxHaQ1pPFxIJOr1w4b0/XGgjBPDyTg/ZyKqtQhN561k9roQtq9HXUuA + JBzudDhw1j6JdpNwU8RCKwlvwh9IFnLXrpsEXN0yFUIAQ8wUwF0PZsupDbVnFuF0sQMj + hdx1dKAiZIhkHeHqTyamm2CUV4gy+HYAIwIO1cqU53H2bEwGjcX7so7Ih3e9mgZWRnOR + FQSQ== +Received: by 10.52.20.5 with SMTP id j5mr8921434vde.81.1338361374332; + Wed, 30 May 2012 00:02:54 -0700 (PDT) +Received: from nas.home.pioto.org (pool-71-182-155-97.pitbpa.fios.verizon.net. + [71.182.155.97]) + by mx.google.com with ESMTPS id c17sm28321629vdj.11.2012.05.30.00.02.53 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 30 May 2012 00:02:53 -0700 (PDT) +Received: by nas.home.pioto.org (Postfix, from userid 1001) + id ED4F6287E2; Wed, 30 May 2012 03:02:51 -0400 (EDT) +From: Mike Kelly +To: notmuch@notmuchmail.org +Subject: [PATCH v2 3/9] Makefile.local: define _GNU_SOURCE +Date: Wed, 30 May 2012 03:01:58 -0400 +Message-Id: <1338361324-57289-4-git-send-email-pioto@pioto.org> +X-Mailer: git-send-email 1.7.10.2 +In-Reply-To: <1338361324-57289-1-git-send-email-pioto@pioto.org> +References: <1338361324-57289-1-git-send-email-pioto@pioto.org> +X-Gm-Message-State: + ALoCoQlDGUlPRmkIDNT1oo3esvR0F+l2Tmhu63fhcy6NbXPqbZRzLO57zz9O1CxQqVD71soIS760 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 30 May 2012 07:02:58 -0000 + +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 + #include + +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 + + 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 + + #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 + + #include "compat.h" +-- +1.7.10.2 +