[project @ 2001-06-29 15:30:49 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / CodeOutput.lhs
index 27ac252..df6337d 100644 (file)
@@ -75,9 +75,12 @@ codeOutput dflags mod_name tycons core_binds stg_binds
                               >> return stub_names
              HscJava        -> outputJava dflags filenm mod_name tycons core_binds
                               >> return stub_names
+            HscILX         -> 
 #ifdef ILX
-            HscILX         -> outputIlx dflags filenm mod_name tycons stg_binds
+                              outputIlx dflags filenm mod_name tycons stg_binds
                               >> return stub_names
+#else
+                               panic "ILX support not compiled into this ghc"
 #endif
        }
 
@@ -194,7 +197,12 @@ outputForeignStubs dflags c_code h_code
 
        stub_c_file_exists
            <- outputForeignStubs_help (hscStubCOutName dflags) stub_c_output_w
-               (hc_header ++ "#include \"RtsAPI.h\"\n")
+               ("#define IN_STG_CODE 0\n" ++ 
+                hc_header ++
+                "#include \"RtsAPI.h\"\n")
+          -- we're adding the default hc_header to the stub file, but this
+          -- isn't really HC code, so we need to define IN_STG_CODE==0 to
+          -- avoid the register variables etc. being enabled.
 
         return (stub_h_file_exists, stub_c_file_exists)
   where