delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/07/28/04:54:09

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75768385C6ED
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1690534446;
bh=H34PtmzR4U/EcS/gsPGEMStlA+iqa2b3dLD0ej/Jxag=;
h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=Qc8VPHPbOesO9HQj0qguh5Thusa/1wlSSPBSITEiARva+tUKoBqU58oscu4zYR+TP
MvQMUSAtYuQcAmykb+f70DqktRW1HVZcJnZ36fnomnoEKYd8Oj1Ow4J0n87i+cuddh
7zBXhGztFofESYhqyHe4174i99ywYkv4iTgcvoc8=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEC333858D33
Date: Fri, 28 Jul 2023 10:53:47 +0200
To: Bruno Haible <bruno AT clisp DOT org>
Subject: Re: fnmatch improvements
Message-ID: <ZMOCGyArlcmVAxI5@calimero.vinschen.de>
Mail-Followup-To: Bruno Haible <bruno AT clisp DOT org>, cygwin AT cygwin DOT com
References: <3884636 DOT 3uDm00564X AT nimes> <ZMK2UVB71pEeoFDK AT calimero DOT vinschen DOT de>
<ZMLADRFGUuvEnCT+@calimero.vinschen.de> <12689051 DOT 0j3nEXixpK AT nimes>
MIME-Version: 1.0
In-Reply-To: <12689051.0j3nEXixpK@nimes>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>, cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 36S8s9aE012628

On Jul 27 23:40, Bruno Haible via Cygwin wrote:
> Corinna Vinschen wrote:
> > > >   4. cd testdir-fnmatch-posix
> > > >      ./configure 2>&1 | tee log1
> > > >      make
> > > >      make check
> > 
> > I fixed the above problem and the POSIX check now works fine:
> 
> Glad that the test suite was helpful (and that you fixed it before 3.5.0 —
> so, no additional configure tests needed on the gnulib side).
> 
> > > >      grep fnmatch log1
> > 
> >     checking for fnmatch.h... yes
> >     checking for fnmatch... yes
> >     checking for working POSIX fnmatch... yes
> >
> > I also extraced the fnmatch configure testcase and ran it manually.
> > It returns 0 now.  But:
> > 
> > > >      grep REPLACE_FNMATCH config.status
> > 
> >     S["REPLACE_FNMATCH"]="1"
> >
> > Looks like the reason is that we don't have a uchar.h file?  Seems 
> > like this is of interest for AIX, but why should this be of
> > interest for fnmatch on other systems?
> 
> Ah, that's because I made the assumption that if wchar_t is only 16-bits
> wide, fnmatch() can't be correct. Which is true for AIX (and on this
> platform, I prefer not to test the available locales). But not true
> with your implementation any more.
> 
> What are the test suite results if you do
> 
>   - Replace S["REPLACE_FNMATCH"]="1" with S["REPLACE_FNMATCH"]="0"
>     in config.status,
>   - make clean
>   - ./config.status
>   - make

The build fails here.  The reason is that the GNU extension FNM_EXTMATCH
is not supported by the FreeBSD code base of fnmatch, so it's not
defined in our fnmatch.h system header.  Gnulib still tries to build
fnmatch_loop.c which uses FNM_EXTMATCH, but apparently it now relies on
using the system header?

>   - make check
> 
> Then the tests will be run against Cygwin's fnmatch() function.
> If all tests pass, I will add the following patch to gnulib.

After the above fail, I tried from scratch with your below patch,
and I still get

  $ grep REPLACE_FNMATCH ./config.status
  S["REPLACE_FNMATCH"]="1"

Even though

  $ grep fnmatch log1
  checking for fnmatch.h... yes
  checking for fnmatch... yes
  checking for working POSIX fnmatch... yes

I'm quite puzzled.


Corinna


> 
> diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4
> index 2e1442eff7..e99737a476 100644
> --- a/m4/fnmatch.m4
> +++ b/m4/fnmatch.m4
> @@ -1,4 +1,4 @@
> -# Check for fnmatch - serial 18  -*- coding: utf-8 -*-
> +# Check for fnmatch - serial 19  -*- coding: utf-8 -*-
>  
>  # Copyright (C) 2000-2007, 2009-2023 Free Software Foundation, Inc.
>  # This file is free software; the Free Software Foundation
> @@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX]
>    m4_divert_text([DEFAULTS], [gl_fnmatch_required=POSIX])
>  
>    AC_REQUIRE([gl_FNMATCH_H])
> -  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
> +  AC_REQUIRE([AC_CANONICAL_HOST])
>    gl_fnmatch_required_lowercase=`
>      echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]'
>    `
> @@ -164,7 +164,17 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX]
>      dnl This is due to wchar_t being only 16 bits wide.
>      AC_REQUIRE([gl_UCHAR_H])
>      if test $SMALL_WCHAR_T = 1; then
> -      REPLACE_FNMATCH=1
> +      case "$host_os" in
> +        cygwin*)
> +          dnl On Cygwin < 3.5.0, the above $gl_fnmatch_result came out as 'no',
> +          dnl On Cygwin >= 3.5.0, fnmatch supports all Unicode characters,
> +          dnl despite wchar_t being only 16 bits wide (because internally it
> +          dnl works on wint_t values).
> +          ;;
> +        *)
> +          REPLACE_FNMATCH=1
> +          ;;
> +      esac
>      fi
>    fi
>    if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
> 
> 
> 
> 
> -- 
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019