logo       

Re: Changes to make fptools insfrastructure usable for standalone librar: msg#00049

lang.haskell.glasgow.bugs

Subject: Re: Changes to make fptools insfrastructure usable for standalone libraries

Hi Simon,

I've been playing with how to add Hugs support to the fptools infrastructure.
I didn't get as far as I'd hoped but thought I'd run what I had past you for
comments.

Full diffs are attached but the basic idea is to use the --with-hc option to
set a variable 'ForSystem' to one of HUGS, GHC, NHC or UNKNOWN.

*** configure.in 27 May 2003 14:02:04 -0000 1.194
--- configure.in 27 May 2003 14:34:16 -0000
***************
*** 414,419 ****
--- 414,428 ----
)
AC_SUBST(WithHc)

+ case ${WithHc} in
+ (*ghc*) ForSystem=GHC ;;
+ (*hugs*) ForSystem=HUGS ;;
+ (*nhc*) ForSystem=NHC ;;
+ (*) ForSystem=UNKNOWN
+ echo "Unable to identify system from value of '${WithHc}'"
+ esac
+ AC_SUBST(ForSystem)
+

Then we (very liberally) sprinkle

+ ifeq "$(ForSystem)" "GHC"
+
...
+ endif # $(ForSystem) == GHC
+

around to remove GHC-specific rules. (There are a lot of GHC (or, at least,
non-Hugs) rules!)

Then we add in a few Hugs-specific rules like this greencard rule:

ifeq "${ForSystem}" "HUGS"
+
+ %.so : %.hs %_stub_ffi.c %_stub_ffi.h
+ ffihugs +G ${EXTRA_FFI_OPTS} $*.hs +L"$*_stub_ffi.c" $(addprefix +L,
$(CC_OPTS)) $(addprefix +L, $(LD_OPTS))
+
+
+ endif # $(ForSystem) == HUGS
+

There's other ways to go about this which might be better:

1) Instead of replacing existing make targets, we could add new targets with
names like:

hugs-all
ghc-all
hugs-install
ghc-install

2) We could use Ross's conversion scripts

It might be that this would make the makefile infrastructure
almost irrelevant (we'd use it for documentation targets and
the like but not for hugs builds or installs). In that case, we could
make do with a tiny hugs-specific makefile called

Makefile.hugs

which uses fptools/mk/config.mk (to get $libdir etc) and provides targets
install, uninstall, all and clean.

Any thoughts or preferences?

--
Alastair

Attachment: diffs
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise