From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 2A9123858401; Tue, 17 Jan 2023 14:18:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A9123858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673965103; bh=lcSJG8UyPVV3lTfLTOeNpsmY8n5csns31znfEk+xwtY=; h=From:To:Subject:Date:From; b=acZjDcSXhzd3QGFEyqlkP5HuCxfNqkEHjHkvVjcFU8NxBYXySVM2r7Gd9EOIvG3UL 0pV2/5XaLYzqanl9PfnrU6dFjCuBtHjnEypCA2rATfSsh+rw7PCIJ9jiqmL14Cchm5 CePi5zyV9IYwcAPYmOixE6ZQPiqezG+OwWd18EQQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-5228] libstdc++: Fix configuration of default zoneinfo dir on linux X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 3a121c06f3cff8206883dea526bec4569876b059 X-Git-Newrev: d74d84c623ea8ae394b28c26e6a9a946ff126c31 Message-Id: <20230117141823.2A9123858401@sourceware.org> Date: Tue, 17 Jan 2023 14:18:23 +0000 (GMT) List-Id: https://gcc.gnu.org/g:d74d84c623ea8ae394b28c26e6a9a946ff126c31 commit r13-5228-gd74d84c623ea8ae394b28c26e6a9a946ff126c31 Author: Jonathan Wakely Date: Tue Jan 17 11:47:11 2023 +0000 libstdc++: Fix configuration of default zoneinfo dir on linux The config for --with-libstdcxx-zoneinfo=yes was comparing the target triplet to "gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu" which is only the last component of the triplet, so failed to match and always used the zoneinfo_dir=none default. Check $target_os instead. There was also an error in the check for native builds that tzdata.zi is actually present in the configured directory. That meant a warning was printed even when the file was present: configure: zoneinfo data directory: /usr/share/zoneinfo configure: WARNING: "/usr/share/zoneinfo does not contain tzdata.zi file" configure: static tzdata.zi file will be compiled into the library libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_ZONEINFO_DIR): Check $target_os instead of $host. Fix check for file being present during native build. * configure: Regenerate. Diff: --- libstdc++-v3/acinclude.m4 | 8 ++++---- libstdc++-v3/configure | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index b1608ae9237..982e979a840 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -5180,17 +5180,17 @@ AC_DEFUN([GLIBCXX_ZONEINFO_DIR], [ if test "x${with_libstdcxx_zoneinfo}" = xyes; then # Pick a default when no specific path is set. - case "$host" in + case "$target_os" in gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) # Not all distros ship tzdata.zi in this dir. zoneinfo_dir="/usr/share/zoneinfo" ;; - *-*-aix*) + aix*) # Binary tzfile files are in /usr/share/lib/zoneinfo # but tzdata.zi is not present there. zoneinfo_dir=none ;; - *-*-darwin2*) + darwin2*) # Binary tzfile files are in /usr/share/lib/zoneinfo.default # but tzdata.zi is not present there. zoneinfo_dir=none @@ -5230,7 +5230,7 @@ AC_DEFUN([GLIBCXX_ZONEINFO_DIR], [ if test "x${zoneinfo_dir}" != xnone; then AC_DEFINE_UNQUOTED(_GLIBCXX_ZONEINFO_DIR, "${zoneinfo_dir}", [Define if a directory should be searched for tzdata files.]) - if $GLIBCXX_IS_NATIVE -a ! test -f "$zoneinfo_dir/tzdata.zi"; then + if $GLIBCXX_IS_NATIVE && ! test -f "$zoneinfo_dir/tzdata.zi"; then AC_MSG_WARN("$zoneinfo_dir does not contain tzdata.zi file") fi fi diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 9c0f3a3e7c9..a298cbd45a0 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -71536,17 +71536,17 @@ fi if test "x${with_libstdcxx_zoneinfo}" = xyes; then # Pick a default when no specific path is set. - case "$host" in + case "$target_os" in gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) # Not all distros ship tzdata.zi in this dir. zoneinfo_dir="/usr/share/zoneinfo" ;; - *-*-aix*) + aix*) # Binary tzfile files are in /usr/share/lib/zoneinfo # but tzdata.zi is not present there. zoneinfo_dir=none ;; - *-*-darwin2*) + darwin2*) # Binary tzfile files are in /usr/share/lib/zoneinfo.default # but tzdata.zi is not present there. zoneinfo_dir=none @@ -71590,7 +71590,7 @@ cat >>confdefs.h <<_ACEOF #define _GLIBCXX_ZONEINFO_DIR "${zoneinfo_dir}" _ACEOF - if $GLIBCXX_IS_NATIVE -a ! test -f "$zoneinfo_dir/tzdata.zi"; then + if $GLIBCXX_IS_NATIVE && ! test -f "$zoneinfo_dir/tzdata.zi"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"$zoneinfo_dir does not contain tzdata.zi file\"" >&5 $as_echo "$as_me: WARNING: \"$zoneinfo_dir does not contain tzdata.zi file\"" >&2;} fi