A Cygwin port of hmake?
Hi, Has anyone attempted / considered porting hmake to Cygwin? I'd like to try HaXmL under ghc on Windows, but it seems to require hmake to build. I made a naieve attempt to configure and build hmake under Cygwin myself, but the resulting Makefile tried to pass Cygwin-style /cygdrive/c/... paths to ghc, which promptly choked. I made some abortive attempts to hand-edit the Makefile.inc, but it then attempted to create some directories above my current working directory, and I eventually got lost trying to trace down the nested Makefile inclusions. Before I invest more time in either porting hmake or writing a portable Makefile for HaXmL, I thought I'd post here to see if anyone else had already been down this road. If you have, please get in touch. Thanks, -antony -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony
Has anyone attempted / considered porting hmake to Cygwin?
I'd like to try HaXmL under ghc on Windows, but it seems to require hmake to build.
Just curious: is that the HaXmL in hslibs.Text that comes with ghc? Aren't hslibs thingies supposed to be portable (and ported/updated, if they come with a Haskell implementation)?
I made a naieve attempt to configure and build hmake under Cygwin myself, but the resulting Makefile tried to pass Cygwin-style /cygdrive/c/... paths to ghc, which promptly choked.
I'm no expert on configure, but who exactly is putting the /cygdrive/c/.. stuff in there? Cygwin should use its pretended filesystem, or indeed local paths, so perhaps someone is explicitly setting an absolute path or path-prefix. Can you configure with c:/ instead (I understand that ghc only chokes on cygwin specials, not on Windows-infelicities or local paths, and some cygwin tools are tolerant towards c:/.. style), perhaps by setting appropriate prefixes? I seem to remember that compiling HOpenGL with non-cygwin GHC under cygwin/Win2k, using configure and co, worked without such problems. Claus
Claus Reinke wrote:
Has anyone attempted / considered porting hmake to Cygwin?
I'd like to try HaXmL under ghc on Windows, but it seems to require hmake to build.
Just curious: is that the HaXmL in hslibs.Text that comes with ghc? Aren't hslibs thingies supposed to be portable (and ported/updated, if they come with a Haskell implementation)?
Indeed it is. I was pleasantly surprised to learn that '-package text' was all I needed to use HaXmL.
I made a naieve attempt to configure and build hmake under Cygwin myself, but the resulting Makefile tried to pass Cygwin-style /cygdrive/c/... paths to ghc, which promptly choked.
I'm no expert on configure, but who exactly is putting the /cygdrive/c/.. stuff in there? Cygwin should use its pretended filesystem, or indeed local paths, so perhaps someone is explicitly setting an absolute path or path-prefix. Can you configure with c:/ instead (I understand that ghc only chokes on cygwin specials, not on Windows-infelicities or local paths, and some cygwin tools are tolerant towards c:/.. style), perhaps by setting appropriate prefixes? I seem to remember that compiling HOpenGL with non-cygwin GHC under cygwin/Win2k, using configure and co, worked without such problems.
Unfortunately, that isn't the problem. I set prefix=c:/... when invoking configure, and configure used that path in its output. But unfortunately the Makefile.inc used to build hmake does some tricky $(PWD) shenanigans that have nothing to do with configure, and then passes the resulting path to ghc. Unfortunately, $(PWD) returns Cygwin-style paths, and I failed to find a good workaround for this in the few minutes I spent looking at it. Anyway, I'm relieved that HaXmL is in hslibs. -antony -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony
Antony,
But unfortunately the Makefile.inc used to build hmake does some tricky $(PWD) shenanigans that have nothing to do with configure, and then passes the resulting path to ghc. Unfortunately, $(PWD) returns Cygwin-style paths, and I failed to find a good workaround for this in the few minutes I spent looking at it.
David Duke recently reported that the hmake distributed with nhc98-1.10 builds correctly with ghc-5.02.2 under Cygwin, but the separate distribution of hmake-3.01 does not. This was very puzzling, but your mention of $(PWD) rings a bell as to what the difference between them might be. The working distribution uses $(shell pwd) in its Makefiles instead of $(PWD). I recently changed all instances of the former to the latter because I couldn't see any reason why we should fork off lots of shell processes just to find the current directory, when that information is instantly available in a variable. It seems that the slight performance hit entailed by the shell calls is a necessary evil in order to cope with Cygwin, so I'll change them back again. Apologies for the inconvenience I have caused you by introducing this simple "improvement". It looked benign at the time! Regards, Malcolm
participants (3)
-
Antony Courtney -
Claus Reinke -
Malcolm Wallace