happy 1.14

Simon Marlow simonmar at microsoft.com
Fri Feb 20 11:10:18 EST 2004

> (this is an fptools/library infrastructure question)
> i was just trying to compile my monad library from scratch,
> and the configuration check the makefile does at the 
> beginning (i don't 
> understand how it works)
> failed complaining that happy 1.14 is needed to compile ghc 
> (and i have 
> 1.13).
> (incidently happy 1.14 is not released yet)
> now, i am not trying to compile ghc (just my library), but i 
> am not sure 
> how to
> fix the makefiles as i don't really understand the fptools 
> build system.
> do you have any pointers, tips, tricks hints etc?

The configure script will only complain about the lack of Happy if:

  - the GHC sources are in the tree (ie. fptools/ghc exists), and
  - the Happy sources are *not* in the tree (ie. fptools/happy does
    not exist)

so to avoid the error, make one of these False :-)

Happy 1.14 will be released at some point, since it's required to build
the next major version of GHC (6.4).

> ideally i would like the makefile for the library to be as simple as 
> possible,
> but i guess it would be nice if it is compatable with the rest of the 
> fptools stuff.
> for example, i noticed that the makefile makes two libraries 
> (one with profiling),
> and also uses some flags to split up the object files in 
> little bits.  there are also some
> common "targets".  so are these things described somewhere, 
> so that if i was to write
> my own makefile, i could try and make it "compatable".
> i wouldn't mind (in fact i would prefer to) reusing the "common" make 
> structure
> as long as i know exactly what files i need to distribute with the 
> library, and the make process
> does not do unneccessary things.  for example, the monad library is 
> written in haskell,
> and it only uses standard libraries.  so the only requirement 
> it has is a running version of ghc
> (and perhaps haddoc if the documentation is wanted).  there is no need
> to do the whole "configure" thing, checking the size of integers, and 
> what not :-)
> so can i achive this with the existsing make system, or 
> should i write my own makefile(s)?

It is possible to use the fptools build system for shipping a separate
library, but I won't claim that this is easy or well-tested.  The build
system has a setting called "STANDALONE_PACKAGE" for this purpose.  So


in your Makefile might help things along a bit.

There isn't an easy way to do what you want to do.  This is why the
library infrastructure project was started :-)  You can either use the
fptools build system, which requires learning how it works, or you could
write your own Makefiles from scratch, which requires re-writing a lot
of stuff that the fptools system already does.

There is some documentation for the fptools build system, but it doesn't
cover packages in much detail:



More information about the Libraries mailing list