From: ken Date: Mon, 23 Jul 2001 22:33:53 +0000 (+0000) Subject: [project @ 2001-07-23 22:33:52 by ken] X-Git-Tag: Approximately_9120_patches~1468 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=27d13cb655147c28eeed0f06cac6fc40c5d778aa [project @ 2001-07-23 22:33:52 by ken] Added "--enable-hc-boot-unregisterised" option to configure, for bootstrapping from unregisterised HC files. --- diff --git a/configure.in b/configure.in index 43cffa8..a35ad4a 100644 --- a/configure.in +++ b/configure.in @@ -404,6 +404,25 @@ AC_ARG_ENABLE(hc-boot, ) AC_SUBST(BootingFromHc) +dnl ** Booting from unregisterised .hc files? +dnl -------------------------------------------------------------- +AC_ARG_ENABLE(hc-boot-unregisterised, +[ --enable-hc-boot-unregisterised + With --enable-hc-boot, treat the intermediate .hc files as + unregisterised rather than registerised code. + (This option is mostly of interest to porters.) +], +[BootingFromUnregisterisedHc=YES], +[BootingFromUnregisterisedHc=NO] +) +AC_SUBST(BootingFromUnregisterisedHc) + +if test "$BootingFromHc" = "NO"; then +if test "$BootingFromUnregisterisedHc" = "YES"; then +AC_MSG_ERROR([--enable-hc-boot-unregisterised requires --enable-hc-boot.]) +fi; +fi; + dnl ** Enable the construction of Win32 DLLs? dnl -------------------------------------------------------------- diff --git a/distrib/hc-build b/distrib/hc-build index 3381af2..21d9db6 100644 --- a/distrib/hc-build +++ b/distrib/hc-build @@ -8,7 +8,7 @@ # unpacked). All options are passed through to ./configure (especially # useful with --prefix). -configopts="$*" +configopts="$*" # e.g., --enable-hc-boot-unregisterised # check for GNU make # diff --git a/mk/bootstrap.mk b/mk/bootstrap.mk index e712ed5..9b8a79a 100644 --- a/mk/bootstrap.mk +++ b/mk/bootstrap.mk @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: bootstrap.mk,v 1.11 2001/05/25 10:53:59 simonmar Exp $ +# $Id: bootstrap.mk,v 1.12 2001/07/23 22:33:53 ken Exp $ # # Makefile rules for booting from .hc files without a driver. # @@ -118,6 +118,17 @@ endif # ----------------------------------------------------------------------------- # suffix rules for building a .o from a .hc file. +ifeq "$(BootingFromUnregisterisedHc)" "YES" + +# without mangling + +%.o : %.hc + $(CC) -x c $< -o $@ -c -O $(HC_BOOT_CC_OPTS) -I. `echo $(patsubst -monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'` + +else + +# with mangling + %.raw_s : %.hc $(CC) -x c $< -o $@ -S -O $(HC_BOOT_CC_OPTS) -I. `echo $(patsubst -monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'` @@ -126,3 +137,5 @@ endif %.o : %.s $(CC) -c -o $@ $< + +endif diff --git a/mk/config.mk.in b/mk/config.mk.in index 1f5576f..a070225 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -100,6 +100,10 @@ exeext=@exeext@ # BootingFromHc - build GHC and the libraries from .hc files? BootingFromHc = @BootingFromHc@ +# BootingFromUnregisterisedHc - treat .hc files as containing unregisterised +# rather than registerised code, i.e., disable the mangler? +BootingFromUnregisterisedHc = @BootingFromUnregisterisedHc@ + # build the libs first if we're bootstrapping from .hc files ifeq "$(BootingFromHc)" "YES" AllProjects = glafp-utils hslibs ghc green-card happy hdirect hood nofib