diff --git a/Pugs.cabal b/Pugs.cabal
--- a/Pugs.cabal
+++ b/Pugs.cabal
@@ -1,22 +1,11 @@
 Name            : Pugs
-Version         : 6.2.13.2
+Version         : 6.2.13.3
 license         : BSD3
 license-file    : LICENSE
+cabal-version   : >= 1.2
 copyright       : 2005-2008, The Pugs Contributors
 maintainer      : Audrey Tang <audreyt@audreyt.org>
 category        : Language, Pugs
-build-depends   : base, haskell98, filepath, mtl, stm, parsec, network,
-                  pretty, time, random, process, containers, bytestring,
-                  array, directory, readline, utf8-string,
-
-                  MetaObject       >= 0.0.4,
-                  HsParrot         >= 0.0.2,
-                  pugs-compat      >= 0.0.3,
-                  pugs-DrIFT       >= 2.2.3.0,
-                  stringtable-atom >= 0.0.4,
-                  HsSyck           >= 0.44
-
-                  -- HsPerl5
 stability       : experimental
 build-type      : Simple
 homepage        : http://pugscode.org/
@@ -123,6 +112,35 @@
     src/Pugs/Val/Code.hs
     src/Pugs/Version.hs
 
-executable:         pugs
-main-is:            Main.hs
-hs-source-dirs:     src
+flag EnableReadLine
+    description: Indicates System.Console.Readline is available
+    default:     True
+
+flag Optimize
+    description: Enable optimizations
+    default:     False
+
+executable pugs
+    main-is:            Main.hs
+    hs-source-dirs:     src
+
+    build-depends:
+        base, haskell98, filepath, mtl, stm, parsec, network,
+        pretty, time, random, process, containers, bytestring,
+        array, directory, utf8-string,
+
+        MetaObject       >= 0.0.4,
+        HsParrot         >= 0.0.2,
+        pugs-compat      >= 0.0.4,
+        pugs-DrIFT       >= 2.2.3.0,
+        stringtable-atom >= 0.0.4,
+        HsSyck           >= 0.44
+        -- HsPerl5
+
+    if flag(EnableReadLine)
+        build-depends: readline
+        cpp-options: -DPUGS_HAVE_READLINE=1
+
+    if flag(Optimize)
+        ghc-options: -O2
+
diff --git a/src/Pugs/Shell.hs b/src/Pugs/Shell.hs
--- a/src/Pugs/Shell.hs
+++ b/src/Pugs/Shell.hs
@@ -20,7 +20,6 @@
 import Pugs.Internals
 import Data.Char (isSpace)
 
-#define PUGS_HAVE_READLINE
 #ifdef PUGS_HAVE_READLINE
 {-# INCLUDE "readline/readline.h" #-}
 import qualified System.Console.Readline as Readline
diff --git a/src/Pugs/Version.hs b/src/Pugs/Version.hs
--- a/src/Pugs/Version.hs
+++ b/src/Pugs/Version.hs
@@ -14,7 +14,7 @@
 -- #include "pugs_version.h"
 
 #ifndef PUGS_VERSION
-#define PUGS_VERSION "6.2.13.1"
+#define PUGS_VERSION "6.2.13.3"
 #endif
 #ifndef PUGS_DATE
 #define PUGS_DATE "June 22, 2008"
