summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/genapply/Main.hs5
-rw-r--r--utils/genapply/ghc.mk7
-rw-r--r--utils/hp2ps/Main.h1
-rw-r--r--utils/hp2ps/ghc.mk4
-rw-r--r--utils/runghc/Main.hs2
5 files changed, 14 insertions, 5 deletions
diff --git a/utils/genapply/Main.hs b/utils/genapply/Main.hs
index 4d25054a1c..8c194f1ca0 100644
--- a/utils/genapply/Main.hs
+++ b/utils/genapply/Main.hs
@@ -12,10 +12,13 @@
-- for details
module Main(main) where
+-- Note [Genapply target as host for RTS macros]
+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- We improperly include *HOST* macros for our target...
#include "../../includes/ghcconfig.h"
--- .. so that this header defines the right stuff.
+-- ...so that this header defines the right stuff. It is the RTS's host, but
+-- our target, as we are generating code that uses that RTS.
#include "../../includes/stg/MachRegsForHost.h"
#include "../../includes/rts/Constants.h"
diff --git a/utils/genapply/ghc.mk b/utils/genapply/ghc.mk
index 88b3444275..8da1f7aaf6 100644
--- a/utils/genapply/ghc.mk
+++ b/utils/genapply/ghc.mk
@@ -16,8 +16,15 @@ utils/genapply_dist_PROGNAME = genapply
utils/genapply_dist_INSTALL = NO
utils/genapply_dist_INSTALL_INPLACE = YES
+utils/dist/package-data.mk : $(includes_1_H_PLATFORM)
+utils/dist/package-data.mk : $(includes_1_H_CONFIG)
+
ifeq "$(GhcUnregisterised)" "YES"
utils/genapply_CONFIGURE_OPTS = --flag unregisterised
endif
$(eval $(call build-prog,utils/genapply,dist,0))
+
+# Purposely do the wrong stage for HOST := TARGET hack.
+# See Note [Genapply target as host for RTS macros].
+utils/genapply_dist_CC_OPTS += -I,$(BUILD_1_INCLUDE_DIR)
diff --git a/utils/hp2ps/Main.h b/utils/hp2ps/Main.h
index 1eea93f0a2..9849e49327 100644
--- a/utils/hp2ps/Main.h
+++ b/utils/hp2ps/Main.h
@@ -1,6 +1,5 @@
#pragma once
-#include "ghcconfig.h"
#include <stdio.h>
#if defined(__STDC__)
diff --git a/utils/hp2ps/ghc.mk b/utils/hp2ps/ghc.mk
index bd62fbedef..75baa9ac4d 100644
--- a/utils/hp2ps/ghc.mk
+++ b/utils/hp2ps/ghc.mk
@@ -10,6 +10,8 @@
#
# -----------------------------------------------------------------------------
+utils/hp2ps_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
+
# stage0
utils/hp2ps_dist_C_SRCS = AreaBelow.c Curves.c Error.c Main.c \
Reorder.c TopTwenty.c AuxFile.c Deviation.c \
@@ -22,8 +24,6 @@ utils/hp2ps_dist_INSTALL_INPLACE = YES
utils/hp2ps_dist_SHELL_WRAPPER = YES
utils/hp2ps_dist_INSTALL_SHELL_WRAPPER_NAME = hp2ps
-utils/hp2ps_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
-
# stage 1
utils/hp2ps_dist-install_C_SRCS = $(utils/hp2ps_dist_C_SRCS)
utils/hp2ps_dist-install_EXTRA_LIBRARIES = $(utils/hp2ps_dist_EXTRA_LIBRARIES)
diff --git a/utils/runghc/Main.hs b/utils/runghc/Main.hs
index fd59475916..9ed650410d 100644
--- a/utils/runghc/Main.hs
+++ b/utils/runghc/Main.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE CPP #-}
-#include "ghcconfig.h"
+#include <ghcplatform.h>
-----------------------------------------------------------------------------
--
-- (c) The University of Glasgow, 2004