From 2120b830dc5df74e3bdc6f53ce97a8be4cb634dc Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 28 Jan 2008 12:03:03 +0000 Subject: [PATCH] Corrected the use of the -fno-warn-tabs flag in the alex files so that it works under GHC 6.6.x --- Makefile.am | 22 ++++++++++++++++++++-- frontends/LexOccam.x | 2 +- frontends/LexRain.x | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 39ed543..0ca90ab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -43,12 +43,30 @@ CompilerCommands.hs: Makefile echo -e 'cxxCommand :: String -> String -> String\n' >> CompilerCommands.hs echo -e 'cxxCommand inp out = "$(CXX) $(TOCK_CXXFLAGS) -x c++ -o " ++ out ++ " " ++ inp ++ " $(TOCK_CXXLDFLAGS)"\n' >> CompilerCommands.hs +# Both these results are near-identical. The -g flag to alex tells it to generate +# a lexer optimised for GHC. The other part of the rule inserts the +# -fno-warn-tabs flag under GHC >= 6.8, but doesn't add anything under previous +# versions of GHC frontends/LexOccam.hs: frontends/LexOccam.x - alex frontends/LexOccam.x + alex -g frontends/LexOccam.x -o frontends/LexOccam.temphs +if GHC68 + echo "{- OPTIONS_GHC -fno-warn-tabs -}\n" > frontends/LexOccam.hs + cat frontends/LexOccam.temphs >> frontends/LexOccam.hs + rm frontends/LexOccam.temphs +else + mv frontends/LexOccam.temphs frontends/LexOccam.hs +endif frontends/LexRain.hs: frontends/LexRain.x - alex frontends/LexRain.x + alex -g frontends/LexRain.x -o frontends/LexRain.temphs +if GHC68 + echo "{- OPTIONS_GHC -fno-warn-tabs -}\n" > frontends/LexRain.hs + cat frontends/LexRain.temphs >> frontends/LexRain.hs + rm frontends/LexRain.temphs +else + mv frontends/LexRain.temphs frontends/LexRain.hs +endif common/TagAST.hs: GenTagAST$(EXEEXT) ./GenTagAST$(EXEEXT) > common/TagAST.hs diff --git a/frontends/LexOccam.x b/frontends/LexOccam.x index 4354ffb..4986663 100644 --- a/frontends/LexOccam.x +++ b/frontends/LexOccam.x @@ -1,4 +1,4 @@ -{ {-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-tabs #-} +{ {-# OPTIONS_GHC -fno-warn-unused-imports #-} {- Tock: a compiler for parallel languages Copyright (C) 2007 University of Kent diff --git a/frontends/LexRain.x b/frontends/LexRain.x index 44c341c..9d3b652 100644 --- a/frontends/LexRain.x +++ b/frontends/LexRain.x @@ -1,4 +1,4 @@ -{ {-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-tabs #-} +{ {-# OPTIONS_GHC -fno-warn-unused-imports #-} {- Tock: a compiler for parallel languages Copyright (C) 2007 University of Kent