From patchwork Tue Nov 7 04:53:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 835094 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-466094-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="C62Z4JiB"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yWHH22HHrz9s72 for ; Tue, 7 Nov 2017 15:57:31 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=wuRuAMFqdoPY8GYBtctn6pK2Kf8BF+7NZmKmXs5ermggk6TRePhsR lPXR2TTsTlnZU/npt8013FBvZRntEuEfnmQZuhUmBC4M6lTeRNKGO2uNrQaP4cVX JADDeH1pjp1zf0Zy5rthnnZn8A6Grl7Kr9Ykf+lHCAmA4DuBnZYY8E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=zqh3Imge9LIGdGAK+B1EWZXUfUM=; b=C62Z4JiB2iSVmB3kFw5x 0015iLvyL5G5ryI3/Mps6+tUi7FWsdE0Xb4652ftNTbtppe3piw25qS/AHaHvN5b yS68spwc2TOlkbMabDr6xVMqDuLWzvmQlTyrR6lIuPqqdj7hwj+8qR9+Gs0CH+v8 Hr51BLAgrpt2BL77Q1YV8W0= Received: (qmail 54500 invoked by alias); 7 Nov 2017 04:56:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 63173 invoked by uid 89); 7 Nov 2017 04:53:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=figured, ptc X-HELO: mail-pf0-f181.google.com Received: from mail-pf0-f181.google.com (HELO mail-pf0-f181.google.com) (209.85.192.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Nov 2017 04:53:39 +0000 Received: by mail-pf0-f181.google.com with SMTP id b85so9436266pfj.13 for ; Mon, 06 Nov 2017 20:53:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=NxWwrnPqHzujRhah5MVUPQkN35AZi1sfgv+OyptBO1s=; b=EJmmDGqOGRwgAtElStxSF5Ku27E1KAKbKxz1yYh9e1Xt5p3srk0KaCGoboRGRfeFOM gCyww5ILvyJHojSHV4sjbOqSaXcislR1UGqxabLDF41YVQsYbESKv25QDdJCC38llJpW kx3H5adu/ZmRpZ6bnUjJPRvGp6J4nPYF+vro1Li65i+spu4hjS1MiWOpwkmHzeylEQSj ohfTJ3n43wS4q/Cj7XPKWYElHvbXhD83+2sVA103LVIbwpbyY2b1arD06cRQGqkun32w bdM1Ssh7JFYJ2yjipZ/UQfIa1Spxk0dU0Qz1cee02ccsJZHhD1CgOl8Y+Rad9INqAJE/ qSEQ== X-Gm-Message-State: AMCzsaV1oTg8hFOK8DabIpOi2lha9xhCWWAdMy5CSQvPjmxg7hNwYg4B rXu/eyd0ChXz/+GFFLMlkev3yg== X-Google-Smtp-Source: ABhQp+TStUWHhRoglbD8CWCsUYQayY/vVQ3nrL1wmN3ofXvGzxMqjrz7LC9BUGRS4TU0nQLgZxv0Ig== X-Received: by 10.159.194.196 with SMTP id u4mr16989460plz.49.1510030416960; Mon, 06 Nov 2017 20:53:36 -0800 (PST) Received: from bubble.grove.modra.org (CPE-58-175-244-173.hdcz1.win.bigpond.net.au. [58.175.244.173]) by smtp.gmail.com with ESMTPSA id f85sm752175pfj.5.2017.11.06.20.53.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 20:53:35 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 5315DC2338; Tue, 7 Nov 2017 15:23:31 +1030 (ACDT) Date: Tue, 7 Nov 2017 15:23:31 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Subject: Require ngettext in test of system gettext implementation Message-ID: <20171107045330.GR10905@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes I've been looking at fixing readelf and other parts of binutils that output incorrectly pluralized messages. For example, readelf will display information about a section that "contains 1 entries" or "There are 1 section headers". Fixing this properly requires us to use ngettext, and I see that gcc currently uses ngettext in a number of places (gcc/cp/pt.c, gcc/diagnostic.c, gcc/collect2.c). "Good", says I, "We can just copy gcc", but that led to some questions, and I figured I really ought to look into what exactly was required. This patch is the result of that investigation, correcting an oversight in the gcc configure machinery. There are (or used to be) gettext implementations that lack ngettext. See config/gettext.m4. Committed as obvious after testing both --enable-nls and --disable-nls builds. * configure.ac: Invoke AM_GNU_GETTEXT with need_ngettext. * configure: Regenerate. diff --git a/intl/configure.ac b/intl/configure.ac index 698c330..36cf97f 100644 --- a/intl/configure.ac +++ b/intl/configure.ac @@ -4,7 +4,7 @@ AC_CONFIG_SRCDIR(gettext.c) AC_CONFIG_HEADER(config.h) AC_CONFIG_MACRO_DIR(../config) AM_GNU_GETTEXT_VERSION(0.12.1) -AM_GNU_GETTEXT +AM_GNU_GETTEXT([], [need-ngettext]) # This replaces the extensive use of DEFS in the original Makefile.in. AC_DEFINE(IN_LIBINTL, 1, [Define because this is libintl.])