X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsFlags.c;h=93482f50b43cd2dcc8e9d4aca91e4e85c01fd133;hb=a7005b6766b41360c7571c101901f56dc8d12df7;hp=b99995b16d2abb93f5e2925193b3bf9f4f68f040;hpb=cd6bd66faa4cb5ac5ae907bf7e1deab0dda4c5c4;p=ghc-hetmet.git diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index b99995b..93482f5 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -10,6 +10,7 @@ #include "PosixSource.h" #include "Rts.h" +#include "RtsOpts.h" #include "RtsUtils.h" #include "Profiling.h" @@ -413,7 +414,13 @@ setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]) char *ghc_rts = getenv("GHCRTS"); if (ghc_rts != NULL) { - splitRtsFlags(ghc_rts, rts_argc, rts_argv); + if (rtsOptsEnabled) { + splitRtsFlags(ghc_rts, rts_argc, rts_argv); + } + else { + errorBelch("Warning: Ignoring GHCRTS variable as RTS options are disabled.\n Link with -rtsopts to enable them."); + // We don't actually exit, just warn + } } } @@ -432,7 +439,13 @@ setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]) break; } else if (strequal("+RTS", argv[arg])) { - mode = RTS; + if (rtsOptsEnabled) { + mode = RTS; + } + else { + errorBelch("RTS options are disabled. Link with -rtsopts to enable them."); + stg_exit(EXIT_FAILURE); + } } else if (strequal("-RTS", argv[arg])) { mode = PGM;