summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2007-07-22 17:00:42 +0000
committerIan Lynagh <igloo@earth.li>2007-07-22 17:00:42 +0000
commitda6ac258d7d8a8b0e03423833cdc78c57d3d39f4 (patch)
treec2fc6ae1cd1cd509b0d6954e234c7bc047f8f73e /rts
parent31cf07bc6d4aa5babc48498c6c4198b642f50390 (diff)
downloadhaskell-da6ac258d7d8a8b0e03423833cdc78c57d3d39f4.tar.gz
Add a +RTS --info flag print various info; partially fixes trac #1517
Diffstat (limited to 'rts')
-rw-r--r--rts/Makefile5
-rw-r--r--rts/RtsFlags.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/rts/Makefile b/rts/Makefile
index 2c5dcc4f4b..9ab9652b71 100644
--- a/rts/Makefile
+++ b/rts/Makefile
@@ -127,6 +127,11 @@ endif
# SRC_HC_OPTS += -fPIC
RtsMessages_CC_OPTS += -DProjectVersion=\"$(ProjectVersion)\"
+RtsFlags_CC_OPTS += -DProjectVersion=\"$(ProjectVersion)\"
+RtsFlags_CC_OPTS += -DRtsWay=\"rts$(_way)\"
+RtsFlags_CC_OPTS += -DHostPlatform=\"$(HOSTPLATFORM)\"
+RtsFlags_CC_OPTS += -DBuildPlatform=\"$(BUILDPLATFORM)\"
+RtsFlags_CC_OPTS += -DTargetPlatform=\"$(TARGETPLATFORM)\"
ifeq "$(way)" "mp"
SRC_HC_OPTS += -I$$PVM_ROOT/include
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 639a915bcf..1e8654ddd8 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -682,6 +682,16 @@ error = rtsTrue;
&rts_argv[arg][2])) {
RtsFlags.MiscFlags.install_signal_handlers = rtsFalse;
}
+ else if (strequal("info",
+ &rts_argv[arg][2])) {
+ printf("RTS info:\n");
+ printf("RTS from GHC " ProjectVersion "\n");
+ printf("RTS way " RtsWay "\n");
+ printf("Host platform " HostPlatform "\n");
+ printf("Build platform " BuildPlatform "\n");
+ printf("Target platform " TargetPlatform "\n");
+ exit(0);
+ }
else {
errorBelch("unknown RTS option: %s",rts_argv[arg]);
error = rtsTrue;