[Haskell-cafe] Using m4 as a preprocessor

Brandon Allbery allbery.b at gmail.com
Fri Jan 30 20:48:41 UTC 2015


On Fri, Jan 30, 2015 at 3:26 PM, Francesco Ariis <fa-ml at ariis.it> wrote:

> 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?
>

"Use -pgmF *cmd* to select the program to use as the preprocessor. When
invoked, the *cmd* pre-processor is given at least three arguments on its
command-line: the first argument is the name of the original source file,
the second is the name of the file holding the input, and the third is the
name of the file where *cmd*should write its output to."

m4 won't process those parameters the way ghc expects; you'll need a
wrapper script.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20150130/a97f6004/attachment.html>


More information about the Haskell-Cafe mailing list