Changes to make fptools insfrastructure usable for standalone libraries

Simon Marlow simonmar at microsoft.com
Wed May 21 09:29:43 EDT 2003


Hi Alastair,

Rather than reply individually to each point in your message, I've just
hacked up what I think package.mk should look like (attached, but
completely untested).

Your confused about the STAMP_PKG_CONF stuff: I think it should just be
disabled altogether for a standalone library.  See my version of
package.mk.

Also I'm not sure what you're trying to do with $(libdir).  You should
*never* have to change libdir; if you do, then something's probably
wrong. 

> 1) mk/target.mk needs this change.

It doesn't with my changes, I think.

> 2) The code that invoked ghc-pkg < package.conf.{inplace,installed}.

This seems to be a source of confusion.  Take a look at how my version
of package.mk does it, and see if that clarifies things.

> [Hmmm, maybe I should leave this up to the person running configure?
> To make this work, I just have to take care that I install in 
> a subdirectory 
> of libdir not in libdir itself since pissing all over 
> /usr/lib probably won't 
> win many friends.]

If you just leave $(libdir) alone, you'll get one that looks like
/usr/lib/<yourlibrary>.

> My example library Makefile now contains this header.  The 
> FPTOOLS_TOP part is 
> the most interesting (and, yes, it _does_ have to come after 
> boilerplate to 
> avoid being overridden).
> 
>    TOP = .
>    include $(TOP)/mk/boilerplate.mk
>    FPTOOLS_TOP := ../..

Hmm, you should need to touch $(FPTOOLS_TOP).  

The directory structure of your library should look something like this:

fptools/      (or whatever you want to call it)
   mk/
        boilerplate.mk
        target.mk
        package.mk
        etc.
   <yourlibrary>/
        Makefile       (NOTE: with TOP=., SUBDIRS=src )
        mk/
              boilerplate.mk (eg. see libraries/mk/boilerplate.mk)
              version.mk     (eg. see ghc/mk/version.mk)
              target.mk      (eg. see libraries/mk/target.mk)
        src/
              Makefile  (NOTE: with TOP=.. )
              Foo.hs
              etc.

You can flatten this slightly, putting the contents of
fptools/<yourlibrary>/src directly into fptools/<yourlibrary> if you
want.

Cheers,
	Simon




More information about the Glasgow-haskell-bugs mailing list