diff options
| author | hallgren <hallgren@chalmers.se> | 2011-04-13 14:45:21 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2011-04-13 14:45:21 +0000 |
| commit | 8fed629a3ef9d8078e2492f01c4296b464e125ab (patch) | |
| tree | 7b9dd836d416a36bd764dfb621ab829e886df8e4 /src/compiler/GF/Infra/BuildInfo.hs | |
| parent | d066619b8f3b75f635a39988de747fed81db549e (diff) | |
Show configuration options as part of build info
The GF shell welcome message will now include something like
This is GF version 3.2.1-darcs.
Built on darwin/i386 with ghc-7.0, flags: interrupt
where a list of enabled configuration flags are included on the last line.
This is implemented in GF.Infra.BuildInfo by consulting the CPP macros
defined by the respective option in gf.cabal. For this to work,
GF.Infra.BuildInfo obviously has to be updated when new flags are added to
gf.cabal or if the CPP macros are renamed.
(Also, I suspect that if you reconfigure with different flags and rebuild GF
without cleaning first, the BuildInfo module will not be recompiled,
resulting in a misleading welcome message...)
Diffstat (limited to 'src/compiler/GF/Infra/BuildInfo.hs')
| -rw-r--r-- | src/compiler/GF/Infra/BuildInfo.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/GF/Infra/BuildInfo.hs b/src/compiler/GF/Infra/BuildInfo.hs index 127c7f6f3..2ff770393 100644 --- a/src/compiler/GF/Infra/BuildInfo.hs +++ b/src/compiler/GF/Infra/BuildInfo.hs @@ -1,7 +1,15 @@ +{-# LANGUAGE CPP #-} module GF.Infra.BuildInfo where import System.Info import Data.Version(showVersion) buildInfo = "Built on "++os++"/"++arch - ++" with "++compilerName++"-"++showVersion compilerVersion
\ No newline at end of file + ++" with "++compilerName++"-"++showVersion compilerVersion + ++", flags:" +#ifdef USE_INTERRUPT + ++" interrupt" +#endif +#ifdef SERVER_MODE + ++" server" +#endif |
