[Haskell-cafe] Using m4 as a preprocessor

Claude Heiland-Allen claude at mathr.co.uk
Fri Jan 30 20:49:07 UTC 2015


Hi Francesco,

On 30/01/15 20:26, Francesco Ariis wrote:
> Hello,
>      today I tried to compile a Haskell program using m4 as preprocessor,
> with the
>
>      {-# OPTIONS_GHC -F -pgmF m4 #-}
>
> pragma on top of a .hs file. I didn't add anything else, there are no
> ''' or '`' in the source.  Upon compiling, ghc (7.8.3) complains:
>
>      m4: cannot open `/tmp/ghc10655_0/ghc10655_1.hspp': No such file or directory
>
> I searched the net for a solution, but no dice (apparently there are no
> Haskell programs using -F -pgmF m4?), so I am writing here.
> Any ideas on what is wrong?

Probably the missing file is where the preprocessor should store the 
output.  Probably you need to write a wrapper script.  See:

https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/options-phases.html#pre-processor


Claude
-- 
http://mathr.co.uk



More information about the Haskell-Cafe mailing list