X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.3 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4EA04671.6030705@gmail.com>
Date: Thu, 20 Oct 2011 18:04:01 +0200
From: Marco Atzeri <marco.atzeri@gmail.com>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: building a cygwin aware GHC
References: <CALEg2updBG-XW2TK6sBg8cSyYR1kcgxKUUn72-O84HY04J=-oQ@mail.gmail.com>
In-Reply-To: <CALEg2updBG-XW2TK6sBg8cSyYR1kcgxKUUn72-O84HY04J=-oQ@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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

On 10/20/2011 1:01 AM, Nathan Thern wrote:
> I am attempting (for probably the tenth time) to compile the GHC
> haskell compiler.
>
> The problem with GHC is that the windows version is compiled with
> MinGW, and cygwin is considered to be nothing other than a MinGW
> alternative. IOW, the source code is riddled with assumptions that if
> you are building GHC with cygwin then what you want in the end is a
> cygwin-unaware windows-compliant executable.
>
> I have attempted in the past to modify configure(.ac) to trick the
> build system into thinking that the target OS is an unknown unix
> platform, but IIRC that failed during the compilation of some code
> inside a #ifdef WIN32 block.
>
> This time I'm thinking I will go through the source and expunge all
> code that's conditional for MinGW, CYGWIN32, WIN32_*, etc. After an
> autoreconf the autobuild system's innate awareness of cygwin should
> allow me to build as if the target is some generic unix-like system.
>
> Before I get started, I'm wondering if anyone has tried anything like
> this before and has any tips. Are there any win32 related CFLAGS that
> I want to leave alone or can I expunge them all?
>
> regards,
> NT
>

no experience on GHC and looking at the source, I am sure you need
to cut through the source tree.
Look also the aclocal.m4 ont only configure.ac

I noticed also wrong/obsolete assumption around the code

libraries/base/GHC/ConsoleHandler.hs:--  * Cygwin shells with @CYGWIN=tty@

that you need to evaluate also.

Good Luck
Marco


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

