summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-04-30 09:40:48 +0000
committerkrasimir <krasimir@chalmers.se>2009-04-30 09:40:48 +0000
commitf9a3925653deef2b73c118784ad39e5c61a005cb (patch)
tree2cf32f15a7ea82965b44b3bbe91d828bafe54930
parent2c3ffb85c8533308f5464ae1997a7f7224a526d7 (diff)
conditional support for haskeline, readline and editline
-rw-r--r--GF.cabal32
-rw-r--r--src/GF/System/Readline.hs10
2 files changed, 34 insertions, 8 deletions
diff --git a/GF.cabal b/GF.cabal
index 207c3944f..d57f7c84c 100644
--- a/GF.cabal
+++ b/GF.cabal
@@ -543,10 +543,18 @@ data-files:
lib/resource/thai/VerbTha.gf
lib/LICENSE
+flag haskeline
+ Description: Enable Haskeline in the shell
+ Default: True
+
flag readline
Description: Enable Readline in the shell
Default: True
+flag editline
+ Description: Enable Editline in the shell
+ Default: True
+
flag interrupt
Description: Enable Ctrl+Break in the shell
Default: True
@@ -700,14 +708,24 @@ executable gf
PGF.Binary
GFC
GFI
-
- if flag(readline)
- build-depends: readline
- ghc-options: -DUSE_READLINE
- other-modules: GF.System.UseReadline
+
+ if flag(haskeline)
+ build-depends: haskeline
+ cpp-options: -DUSE_HASKELINE
+ other-modules: GF.System.UseHaskeline
else
- other-modules: GF.System.NoReadline
-
+ if flag(readline)
+ build-depends: readline
+ cpp-options: -DUSE_READLINE
+ other-modules: GF.System.UseReadline
+ else
+ if flag(editline)
+ build-depends: editline
+ cpp-options: -DUSE_EDITLINE
+ other-modules: GF.System.UseEditline
+ else
+ other-modules: GF.System.NoReadline
+
if flag(interrupt)
cpp-options: -DUSE_INTERRUPT
other-modules: GF.System.UseSignal
diff --git a/src/GF/System/Readline.hs b/src/GF/System/Readline.hs
index db122c3e2..ee38cdc0b 100644
--- a/src/GF/System/Readline.hs
+++ b/src/GF/System/Readline.hs
@@ -16,10 +16,18 @@
module GF.System.Readline (fetchCommand, setCompletionFunction, filenameCompletionFunction) where
-#ifdef USE_READLINE
+#ifdef USE_HASKELINE
+
+import GF.System.UseHaskeline
+
+#elif USE_READLINE
import GF.System.UseReadline
+#elif USE_EDITLINE
+
+import GF.System.UseEditline
+
#else
import GF.System.NoReadline