X-Spam-Check-By: sourceware.org
Message-ID: <4570316E.5000109@byu.net>
Date: Fri, 01 Dec 2006 06:43:10 -0700
From: Eric Blake <ebb9@byu.net>
Reply-To: autoconf-patches@gnu.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.666
MIME-Version: 1.0
To: autoconf-patches@gnu.org, cygwin@cygwin.com
Subject: Re: cygwin -mno-cygwin AC_CHECK_SIZEOF
References: <20061201023212.GH19404@cox.net> <456FA8DD.3030409@byu.net> <Pine.GSO.4.63.0611302348180.17676@access1.cims.nyu.edu> <20061201122805.GK19404@cox.net>
In-Reply-To: <20061201122805.GK19404@cox.net>
Content-Type: multipart/mixed;  boundary="------------060701040307060008070404"
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

--------------060701040307060008070404
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bob Rossi on 12/1/2006 5:28 AM:
>>> 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.
> 
> I really think this is the current best solution, that is, to modify
> autoconf to not use cat. Either that, or simply don't put the \n in the
> AC_CHECK_SIZEOF macro. I'm not sure why that is done in the first place.

Avoiding the troublesome line ending seems best to me.

> If
>   fprintf(f, "%d\n", sizeof($1));
> was changed to
>   fprintf(f, "%d", sizeof($1));
> I think it would fix the problem.
> 
> Well, I downloaded the autoconf sources, but couldn't find the
> AC_CHECK_SIZEOF code. I did find it in /usr/share/autoconf, but when I
> modify it, the system autoconf behavior doesn't change. Any ideas?

Patch below.  Keep replies on the autoconf-patches list.

2006-12-01  Eric Blake  <ebb9@byu.net>

	* lib/autoconf/c.m4 (AC_LANG_INT_SAVE): Avoid newline, to aid in
	cross-compiling from cygwin to mingw.
	Reported by Bob Rossi.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFcDFp84KuGfSFAYARAtT8AJ0Y//kEEtgJ+IfEwPxpiffBFj4hLwCgwurT
8aHWGq0bRfQSCQDp8Yw7i2I=
=Lv51
-----END PGP SIGNATURE-----

--------------060701040307060008070404
Content-Type: text/plain;
 name="autoconf.patch27"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="autoconf.patch27"

Index: lib/autoconf/c.m4
===================================================================
RCS file: /sources/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.240
diff -u -p -r1.240 c.m4
--- lib/autoconf/c.m4	28 Nov 2006 00:26:45 -0000	1.240
+++ lib/autoconf/c.m4	1 Dec 2006 13:36:23 -0000
@@ -284,14 +284,14 @@ static unsigned long int ulongval () { r
       long int i = longval ();
       if (i != ($2))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
       if (i != ($2))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
   return ferror (f) || fclose (f) != 0;
 ])])


--------------060701040307060008070404
Content-Type: text/plain; charset=us-ascii

--
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/
--------------060701040307060008070404--
