delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/11/30/23:58:05

X-Spam-Check-By: sourceware.org
Date: Thu, 30 Nov 2006 23:57:41 -0500 (EST)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Eric Blake <ebb9 AT byu DOT net>
cc: autoconf AT gnu DOT org, cygwin AT cygwin DOT com, bob_rossi AT cox DOT net
Subject: Re: cygwin -mno-cygwin AC_CHECK_SIZEOF
In-Reply-To: <456FA8DD.3030409@byu.net>
Message-ID: <Pine.GSO.4.63.0611302348180.17676@access1.cims.nyu.edu>
References: <20061201023212 DOT GH19404 AT cox DOT net> <456FA8DD DOT 3030409 AT byu DOT net>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Thu, 30 Nov 2006, Eric Blake wrote:

> According to Bob Rossi on 11/30/2006 7:32 PM:
>
> > AC_CHECK_SIZEOF does these two things on cygwin with autoconf 2.60.
> >   fprintf(f, "%d\n", sizeof($1));
> > which prints "4\r\n" if the size is 4 and then
> >   AC_CV_NAME=`cat conftestval`, ...
> > now cygwin's cat doesn't understand \r\n, so
>
> Or better worded, on a binary mount, cygwin's cat treats \r literally,
> like any other unix implementation of cat would do.

Well, actually, Cygwin's cat *always* treats \r literally, since it always
opens the file in binary mode.

> >   ac_cv_sizeof_int=`cat conftestval`
> > results in "4\r", which breaks the configure.in scripts that check with
> > if statements for "$ac_cv_sizeof_int" = "4".
> >
> > What is the best way to resolve something like this?
>
> Perhaps experiment with a cygwin text mount, so that cygwin cat will
> ignore the \r.

So the above solution will not help in this case...

> Or experiment with the recent add-on to cygwin's bash, where exporting
> SHELLOPTS with the cygwin-specific shell option igncr set will tell
> subsequent /bin/sh invocations to strip \r from command substitution.

Although this might work.

> And the fact that you are now telling configure the truth that you are
> cross-compiling, even though the cross binaries are executable, may be
> enough for autoconf to try harder for discovering how AC_CHECK_SIZEOF
> should behave without tripping up on line endings (and if that is not
> the case, maybe we should consider patching autoconf to make it happen
> that way).

Or have autoconf use some other tool that does not do binary processing
(e.g., awk or tr) instead of cat, which would enable the text mount
solution.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Freedom is just another word for "nothing left to lose"...  -- Janis Joplin

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

- Raw text -


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