X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdriver%2Fghc.lprl;fp=ghc%2Fdriver%2Fghc.lprl;h=7ec0015a094946df0b467aedac861b8d03324a55;hb=820d32a2bf999b3391a2c1c13363db5cc3bac307;hp=6bd471bbc0d3059cc7dcf5235687ce986590be3c;hpb=d5ed8c9054711714b7cd88ce485af6bf572dc6b1;p=ghc-hetmet.git diff --git a/ghc/driver/ghc.lprl b/ghc/driver/ghc.lprl index 6bd471b..7ec0015 100644 --- a/ghc/driver/ghc.lprl +++ b/ghc/driver/ghc.lprl @@ -1502,13 +1502,15 @@ Now the Haskell compiler, C compiler, and assembler &run_something("cp $hsc_out_h_stub $ofile_h_stub_target", 'Copy foreign export header file'); } - # - # Bring the C stub protos into scope when compiling the .hc file. - # - push (@CcInjects, "#include \"${hsc_out_h_stub}\"\n"); - # Hack - ensure that the stub .h file is included in the OPTIONS section - # if the .hc file is saved. - push (@File_options, "-#include \"${ofile_h_stub_target}\"\n"); + if (-f $hsc_out_c_stub) { + # + # Bring the C stub protos into scope when compiling the .hc file. + # + push (@CcInjects, "#include \"${hsc_out_h_stub}\"\n"); + # Hack - ensure that the stub .h file is included in the OPTIONS section + # if the .hc file is saved. + push (@File_options, "-#include \"${ofile_h_stub_target}\"\n"); + } if ($do_cc) { &runGcc ($is_hc_file, $hsc_out, $cc_as_o);