From 84c4a95ec080a1c4978e929f6e554c8380cead9b Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 31 May 2012 08:14:47 +0000 Subject: [PATCH] Re: [PATCH v2 3/9] Makefile.local: define _GNU_SOURCE --- 81/ca1bb3b39a88ef940d448351ab8a63cf12a4ec | 156 ++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 81/ca1bb3b39a88ef940d448351ab8a63cf12a4ec diff --git a/81/ca1bb3b39a88ef940d448351ab8a63cf12a4ec b/81/ca1bb3b39a88ef940d448351ab8a63cf12a4ec new file mode 100644 index 000000000..f8f417e3b --- /dev/null +++ b/81/ca1bb3b39a88ef940d448351ab8a63cf12a4ec @@ -0,0 +1,156 @@ +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 428CA431FB6 + for ; Thu, 31 May 2012 01:14:56 -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 va1IDkpEH2+3 for ; + Thu, 31 May 2012 01:14:54 -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 B728A431FAF + for ; Thu, 31 May 2012 01:14:54 -0700 (PDT) +Received: by vbbfc26 with SMTP id fc26so635155vbb.26 + for ; Thu, 31 May 2012 01:14:51 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type:x-gm-message-state; + bh=fkjNi03ZQ4TOOlgaoFjZGn/mqKvExcCdJUNMfLwDpZs=; + b=A8qDuOfRWQT/DNbv2CqJQSKh8ZR1XGd8G80voddwng2bpwMiWCsHO0blhy44Vefs9D + d8t1ydpZAOVkPsjy+QAGaEkT4ThO6e2VQHSLTjzB4qgvVHX1d06dIQcn/1oxsQBd1iJu + J/H0BB+hWCUXqBcTP9TQiHsfaKhFQtOYe9h80KDiKffctaSvHVbkoc0Fa3YHTA+YYSAK + Q5e5pEAIs8dLUkg9BNWLrdR3gFBXQqd7GiGjyGV1LEvUMl1Tnt4YygW0vvNrM2MBdDaZ + UzMC7vI3zsK49mz0msVJ2w5wnqz7R4O7+24cpAuRb5J3CyV1Bn3ivQU7xhr9wDY38/TU + qqlw== +Received: by 10.52.69.200 with SMTP id g8mr5320136vdu.113.1338452091511; + Thu, 31 May 2012 01:14:51 -0700 (PDT) +Received: from localhost (nikula.org. [92.243.24.172]) + by mx.google.com with ESMTPS id bj6sm3719688vdc.12.2012.05.31.01.14.49 + (version=SSLv3 cipher=OTHER); Thu, 31 May 2012 01:14:50 -0700 (PDT) +From: Jani Nikula +To: Mike Kelly , notmuch@notmuchmail.org +Subject: Re: [PATCH v2 3/9] Makefile.local: define _GNU_SOURCE +In-Reply-To: <1338361324-57289-4-git-send-email-pioto@pioto.org> +References: <1338361324-57289-1-git-send-email-pioto@pioto.org> + <1338361324-57289-4-git-send-email-pioto@pioto.org> +User-Agent: Notmuch/0.13+9~ga1668d0 (http://notmuchmail.org) Emacs/23.1.1 + (i686-pc-linux-gnu) +Date: Thu, 31 May 2012 08:14:47 +0000 +Message-ID: <877gvs4vig.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Gm-Message-State: + ALoCoQmqEM+y4NpHBiJA44vK238CUcjLEEW0EVp33nnMB9ydK7S12yU/QQtKyy4wQdRKm4EFuZOc +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: Thu, 31 May 2012 08:14:56 -0000 + +On Wed, 30 May 2012, Mike Kelly wrote: +> 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) + +Sorry for neither being very clear the last time, nor having the time to +look into this. Shouldn't -D_GNU_SOURCE be in the configure script? We +could add it to CFLAGS there. + +BR, +Jani. + +> 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 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2