X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=mk%2Fbootstrap.mk;h=d0713311b91cafbbfbf0b5054dc7977866eb8ce0;hp=d9a5cbfdd95e6f3a717e14e99532520847179e33;hb=a27271f99ff254f995a9403fe36e41b9588d1b32;hpb=dae341f50ad832bbc6b0edb1fc460248380ed68e diff --git a/mk/bootstrap.mk b/mk/bootstrap.mk index d9a5cbf..d071331 100644 --- a/mk/bootstrap.mk +++ b/mk/bootstrap.mk @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: bootstrap.mk,v 1.32 2005/01/27 11:55:37 simonmar Exp $ +# $Id: bootstrap.mk,v 1.34 2005/05/10 10:29:49 simonmar Exp $ # # Makefile rules for booting from .hc files without a driver. # @@ -8,17 +8,6 @@ # compile the .hc files, so we have to duplicate that functionality here. # The result is unfortunately ugly, but we don't have another choice. -TOP_SAVED := $(TOP) -TOP:=$(TOP)/ghc - -include $(TOP)/mk/version.mk -include $(TOP)/mk/paths.mk - -# Reset TOP -TOP:=$(TOP_SAVED) - -include $(TOP)/mk/suffix.mk - # ----------------------------------------------------------------------------- # Set the platform-specific options to send to the C compiler. These should # match the list in machdepCCOpts in ghc/compiler/DriverFlags.hs. @@ -29,11 +18,15 @@ PLATFORM_HC_BOOT_CC_OPTS = ifeq "$(i386_TARGET_ARCH)" "1" PLATFORM_CC_OPTS += -DDONT_WANT_WIN32_DLL_SUPPORT -PLATFORM_HC_BOOT_CC_OPTS += -fno-defer-pop -fomit-frame-pointer +PLATFORM_HC_BOOT_CC_OPTS += -fno-defer-pop -fomit-frame-pointer -fno-builtin +endif + +ifeq "$(x86_64_TARGET_ARCH)" "1" +PLATFORM_HC_BOOT_CC_OPTS += -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-unit-at-a-time -fno-builtin endif ifeq "$(hppa_TARGET_ARCH)" "1" -PLATFORM_CC_OPTS += -static -D_HPUX_SOURCE +PLATFORM_CC_OPTS += -D_HPUX_SOURCE endif ifeq "$(powerpc_TARGET_ARCH)" "1" @@ -61,16 +54,19 @@ endif ifeq "$(BootingFromUnregisterisedHc)" "YES" PLATFORM_HC_BOOT_CC_OPTS += -DNO_REGS -DUSE_MINIINTERPRETER -SRC_CC_OPTS += -DNO_REGS -DUSE_MINIINTERPRETER -# Add these flags to SRC_CC_OPTS too, because they need to be passed to the plain .c -# files in ghc/rts. endif PLATFORM_CC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt) HC_BOOT_CC_OPTS = $(PLATFORM_HC_BOOT_CC_OPTS) $(PLATFORM_CC_OPTS) $(CC_OPTS) -SRC_CC_OPTS += -I$(FPTOOLS_TOP_ABS)/ghc/includes -I$(FPTOOLS_TOP_ABS)/libraries/base/include -I$(FPTOOLS_TOP_ABS)/libraries/unix/include -I$(FPTOOLS_TOP_ABS)/libraries/parsec/include +SRC_CC_OPTS += -I$(FPTOOLS_TOP_ABS)/$(GHC_INCLUDE_DIR_REL) -I$(FPTOOLS_TOP_ABS)/libraries/base/include -I$(FPTOOLS_TOP_ABS)/libraries/unix/include -I$(FPTOOLS_TOP_ABS)/libraries/parsec/include + +# C code compiled with UseGhcForCc=YES assumes the existence of certain CPP +# symbols defined by GHC (eg. __GLASGOW_HASKELL__), so we better make sure +# they're defined. We can't test $(UseGhcForCc) here though - it isn't defined +# yet, so we use lazy expansion. +SRC_CC_OPTS += $(if $(findstring YES,$(UseGhcForCc)), $(PLATFORM_HC_BOOT_CC_OPTS) $(PLATFORM_CC_OPTS)) ifeq "$(GhcWithInterpreter)" "YES" SRC_CC_OPTS += -I$(FPTOOLS_TOP_ABS)/libraries/readline/include @@ -86,22 +82,22 @@ UNDERSCORE= endif ifeq "$(HaveLibGmp)" "NO" -DASH_L_GHC_RTS_GMP_DIR=-L$(FPTOOLS_TOP_ABS)/ghc/rts/gmp +DASH_L_GHC_RTS_GMP_DIR=-L$(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL)/gmp endif HC_BOOT_LD_OPTS = \ - -L$(FPTOOLS_TOP_ABS)/ghc/rts \ + -L$(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL) \ $(DASH_L_GHC_RTS_GMP_DIR) \ -L$(FPTOOLS_TOP_ABS)/libraries/base \ -L$(FPTOOLS_TOP_ABS)/libraries/base/cbits \ - -L$(FPTOOLS_TOP_ABS)/libraries/haskell98 + -L$(FPTOOLS_TOP_ABS)/libraries/haskell98 \ + -L$(FPTOOLS_TOP_ABS)/libraries/parsec \ + -L$(FPTOOLS_TOP_ABS)/libraries/Cabal ifeq "$(GhcWithInterpreter)" "YES" HC_BOOT_LD_OPTS += \ -L$(FPTOOLS_TOP_ABS)/libraries/template-haskell \ -L$(FPTOOLS_TOP_ABS)/libraries/readline \ - -L$(FPTOOLS_TOP_ABS)/libraries/parsec \ - -L$(FPTOOLS_TOP_ABS)/libraries/Cabal \ -L$(FPTOOLS_TOP_ABS)/libraries/unix \ -L$(FPTOOLS_TOP_ABS)/libraries/unix/cbits endif