
On 04 December 2004 01:49, Ben Kavanagh wrote:
I'm going to create a standard dist for cygwin.
In order to do so, according to the porting guide I need to build a set of .hc files with mingw32(same hardware) and then use hc-build with those. To create the hc files from mingw32 for use with cygwin I should just have to define toplevel build.mk as follows is that correct?
GhcLibHcOpts += -keep-hc-files GhcStage1HcOpts += -keep-hc-files GhcStage2HcOpts += -keep-hc-files
Yes, I think so.
and then use 'find' to pull out all of the .hc files.
The target "hc-file-bundle" in the top-level Makefile should do the right thing.
After that It should be fairly simple to get a Cygwin build going right? -Ben
I doubt it'll be trivial - probably lots of #ifdef mingw32_TARGET_OS will need to change to #if defined(mingw32_TARGET_OS) || defined(cygwin_TARGET_OS) but there shouldn't be any major new code to write. I'd proceed by grepping for mingw32_TARGET_OS and checking each one to see whether it should change, otherwise you could end up with hard-to-find bugs that show up months later. Cheers, Simon

Simon Marlow wrote:
[...] I doubt it'll be trivial - probably lots of
#ifdef mingw32_TARGET_OS
will need to change to
#if defined(mingw32_TARGET_OS) || defined(cygwin_TARGET_OS) [...]
Hmmm, having some fragile OS-dependent #ifdefs is not the way to go. While you are there, every #ifdef mingw32_TARGET_OS which needs to be changed should be replaced by something feature-specific like #if HAVE_FOO_BAR_FUNCTION and the autoconf stuff be extended accordingly. If you don't have M4 as your hobby, keeping #ifdef mingw32_TARGET_OS #define HAVE_FOO_BAR_FUNCTION #undef HAVE_BLAH ... #endif in a single prominent place is much better than spreading this all over the code Cheers, S.
participants (2)
-
Simon Marlow
-
Sven Panne