From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5DC773858C52 for ; Tue, 17 Jan 2023 14:19:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DC773858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673965172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jAQhplBcATnQAwSVNk7fH7zzcxmLG2TMTGXXL+xsgr8=; b=Lnud0lIvrNej0K3RxJoZDlCnpUTzCxwsoxggzrOGEsphp4agXRdXxrXJ4igdNjy99cIlzF 4EGKr2Xb1hxDXF2la1smfzzjIt4TsZ61s6lIehsxdSEPPw3v0ToYllknCzcCq/f/5Tp2PN xOtpztO+gzlZIQy9hz69V5hKjOwx6sc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-92-zFXkWeFFPhOMBb4RWnL6rw-1; Tue, 17 Jan 2023 09:18:50 -0500 X-MC-Unique: zFXkWeFFPhOMBb4RWnL6rw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D01887A9E9; Tue, 17 Jan 2023 14:18:41 +0000 (UTC) Received: from localhost (unknown [10.33.36.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 555F740C2007; Tue, 17 Jan 2023 14:18:41 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix configuration of default zoneinfo dir on linux Date: Tue, 17 Jan 2023 14:18:40 +0000 Message-Id: <20230117141840.172815-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: Tested x86_64-linux. Pushed to trunk. -- >8 -- 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. --- 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 -- 2.39.0