From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x32f.google.com with SMTP id bg10so4011100wmb.1; Fri, 23 Dec 2022 09:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Jc/IAHWn9M46/SW5jrSlAZtbLrw0aSHnCze/BdoitDM=; b=VLCBCh9j+yrsHDqZXU4SRdRV+/4OH+Gqmmuh25UxNsZTIzHEsGT9AQTS5irn5EhEoT x628SP2vFdwEAXNzS9DtBSEPD1etIyl0fd0VZwD8q7hSQkfDHR/1c/XCT27UxrpDnj02 +7Ex/XNBPG1YolnjGcxT+PnUh4RhfM3bDt3O9FD0XYIVDKixwVTiFM5/eNC7yiyr7lH+ 7xhXXqudkv4bCOGM14e2mRitnI/gZw5Mfla3cf8hMa/UeSqoSvMUbrB89JyIMs1C/4nC QiwEhSjCYeYWYZvQcRhUufOGjpss8ZPFrMiDHjWgyK3qKYmBnPLQozOKRmJ1v+I2mv5w 0oJw== 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-Google-Smtp-Source: AMrXdXv3UNk7oC/TK9yj3gyGCw0BvABmg3MEaxya7wx4rvuNpRHm4w9xoq/eUo8Pz2v5OUVveRPp3A== 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) From: Iain Sandoe 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) Reply-To: iain@sandoe.co.uk MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 List-Id: 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 -- 2.37.1 (Apple Git-137.1)