From patchwork Fri Dec 23 17:06:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 36312 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp423068wrn; Fri, 23 Dec 2022 09:07:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXsYt1tZsP3hIwfJ3hitb5sCostThyZ5C6Kn0wtLfXEuMVH8GcY4rm4pl1Iagq1WfiadcZ3b X-Received: by 2002:a17:906:33d7:b0:842:cd68:4956 with SMTP id w23-20020a17090633d700b00842cd684956mr6372252eja.52.1671815242371; Fri, 23 Dec 2022 09:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671815242; cv=none; d=google.com; s=arc-20160816; b=H1pHKoYuoOJZzmQKdnxISY9qm/LB+y/+X4L+OIKR32VRaslSIdV3q4qW/yHS5qrK7Q S0yXFk+p1DPWYQuktnznNPe5r3Gs2kko7DFx/2C9VwouPdA6B5GT7q0iu9Dfzc3HiCO6 /nq/eY3Snpr/rpBLQhIh/EvjJHEWApr5TDFn/JTvVnvBZUfEThWjiEIP1y4lARqMvLXX VB21MLJtPYEhAJK/pgBWt6hW2tZdZjxJdi2L7SmliPWyrvYsr/pLdwFOpgAlAIbCCFC1 tQ3NyYt94XVBFQ9ltiwB6hG/9f74zG+ab6CSj7Kj+P5Ym9qHHzufAb+vUgr2UNmkzOsS MmLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Jc/IAHWn9M46/SW5jrSlAZtbLrw0aSHnCze/BdoitDM=; b=AzKIGq6pdKG8mbqnYB729f8QwqLHECr1QOQpoDJIDvkGrCtLrZKEL8GmB6X9MTJtrk 2xoZNcWirZxYGZAg3Q/UBxMJDNu3CToxfTzKT3boDeCwpEPE29+W9kxf++71GhnJBPoB QuI8h6n3YN34k3toaUZrjf+ZFBz1WZiaiF0ey08WIAmKB/FCaL6pWzNREM5F6LmmKgKe ZAjizJGKFDwyaSz0t4ug/Y9AxTSQeR0r5l2Es/b/77FN7BHGdQZMeKAXoiVaX6V6xZhY wOjUvalxajNPocrmi35pTxwzt042PUe/zcrtEupqFLU1Dy3KAHmYNFXlq/O8Yby4azyG VfVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kWq6lWmq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ji5-20020a170907980500b007addbdb9fbbsi3222273ejc.558.2022.12.23.09.07.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Dec 2022 09:07:22 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kWq6lWmq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 32940384E795 for ; Fri, 23 Dec 2022 17:07:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32940384E795 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671815227; bh=Jc/IAHWn9M46/SW5jrSlAZtbLrw0aSHnCze/BdoitDM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=kWq6lWmqOEgEVTEfBs7gBACKej9vcsmA0aDxU5NsefSdIfqUzk7QNp2/YIF5o6BVM K1dIbjDeU+0BRefU3fUoxPThTuzEY0iAwveWkrQ+meliehR9HMxZpKVORBg/urYBZ7 HdJjoteorPrnW0f7EPi4QTFpxDQ10cBOkvVTsbrI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 858763858425; Fri, 23 Dec 2022 17:06:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 858763858425 Received: by mail-wm1-x32f.google.com with SMTP id bg10so4011100wmb.1; Fri, 23 Dec 2022 09:06:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Jc/IAHWn9M46/SW5jrSlAZtbLrw0aSHnCze/BdoitDM=; b=AAKabYQZZSdH5GYBqQU4+R3QhXGUaKEoeYenGV5FTpp+21biAKwM67zmskAp9FrCuh 1EMqD6v9JVGNWyUN6Nz1FGPD6Njx6P6HsgaonwnjKOZ6ZctG3sRzE192A634M81pKiwJ Va+xnjxF+gW8nEq/DQglxUjXqDEohqMTbdI3Nq5e9cAjmUpfsDq/Pj8ogg+rz9qRZ2vV OkFa1SrXRC++cjeyRbImTh/YJ7U2quSHmtinpVqcn0wfrwGoACLJjVI7BT8TBAzvggri uf+GnzAOGM+N4JS/0bpK1AXf8dfIdmLnIdaUUp3dZ5oHzqSIW9a/rRTlHQzf73cgjYqM J2Jw== X-Gm-Message-State: AFqh2kpIsUcJ9hsYy3TxL4Mt0GJxWBFsIOh6ay5Z0V/boH+e9Va53oiJ rMgkhnJ0hDxwREF8rwwET6kVoKEgj5g= X-Received: by 2002:a7b:cb59:0:b0:3d3:5709:68e8 with SMTP id v25-20020a7bcb59000000b003d3570968e8mr7648110wmj.36.1671815181208; Fri, 23 Dec 2022 09:06:21 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id y24-20020a05600c365800b003cf894dbc4fsm4963157wmq.25.2022.12.23.09.06.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 23 Dec 2022 09:06:20 -0800 (PST) X-Google-Original-From: Iain Sandoe To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++, configure: Fix GLIBCXX_ZONEINFO_DIR configuration macro. Date: Fri, 23 Dec 2022 17:06:19 +0000 Message-Id: <20221223170619.38428-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753025339856035401?= X-GMAIL-MSGID: =?utf-8?q?1753025339856035401?= This is a patch for comment on the approach - tested on x86_64-darwi21 thoughts? Iain --- 8< --- Testing on Darwin revealed that the GLIBCXX_ZONEINFO_DIR was not doing quite the right thing (we ended up with ${withval} in the config.h file). This patch proposes revising the behaviour of the configure flag thus: --with-libstdcxx-zoneinfo-dir= unspecified : Set _GLIBCXX_ZONEINFO_DIR to a default suitable for $host yes : Set _GLIBCXX_ZONEINFO_DIR to a default suitable for $host no : Do not set _GLIBCXX_ZONEINFO_DIR /some/path : set _GLIBCXX_ZONEINFO_DIR = "/some/path" Signed-off-by: Iain Sandoe libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_ZONEINFO_DIR): Revise configure flag handling. * configure: Regenerate. * src/c++20/tzdb.cc: Add a comment that an unset _GLIBCXX_ZONEINFO_DIR implies that the configuration specified that no directory should be used. --- libstdc++-v3/acinclude.m4 | 21 ++++++++++++++------- libstdc++-v3/configure | 28 +++++++++++++++++++--------- libstdc++-v3/src/c++20/tzdb.cc | 1 + 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index f73946a4918..3653822aed4 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -5153,18 +5153,25 @@ AC_DEFUN([GLIBCXX_ZONEINFO_DIR], [ AC_ARG_WITH([libstdcxx-zoneinfo-dir], AC_HELP_STRING([--with-libstdcxx-zoneinfo-dir], [the directory to search for tzdata files]), - [zoneinfo_dir="${withval}" - AC_DEFINE(_GLIBCXX_ZONEINFO_DIR, "${withval}", - [Define if a non-default location should be used for tzdata files.]) - ], - [ + [],[with_libstdcxx_zoneinfo_dir=yes]) + + # Pick a default when no specific path is set. + if test x${with_libstdcxx_zoneinfo_dir} = xyes; then case "$host" in # *-*-aix*) zoneinfo_dir="/usr/share/lib/zoneinfo" ;; + *-*-darwin2*) zoneinfo_dir="/usr/share/lib/zoneinfo.default" ;; *) zoneinfo_dir="/usr/share/zoneinfo" ;; esac - ]) - + elif test x${with_libstdcxx_zoneinfo_dir} = xno; then + zoneinfo_dir=none + else + zoneinfo_dir=${with_libstdcxx_zoneinfo_dir} + fi AC_MSG_NOTICE([zoneinfo data directory: ${zoneinfo_dir}]) + if test x${zoneinfo_dir} != xnone; then + AC_DEFINE_UNQUOTED(_GLIBCXX_ZONEINFO_DIR, "${zoneinfo_dir}", + [Define if a non-default location should be used for tzdata files.]) + fi ]) # Macros from the top-level gcc directory. diff --git a/libstdc++-v3/src/c++20/tzdb.cc b/libstdc++-v3/src/c++20/tzdb.cc index 5f5c4199f65..c4311d0902a 100644 --- a/libstdc++-v3/src/c++20/tzdb.cc +++ b/libstdc++-v3/src/c++20/tzdb.cc @@ -52,6 +52,7 @@ # endif #endif +// This is a bit odd; the configure-time setting was 'no zoneinfo directory' #ifndef _GLIBCXX_ZONEINFO_DIR # define _GLIBCXX_ZONEINFO_DIR "/usr/share/zoneinfo" #endif