diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2008, Robert Dockins.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistribution of source code must retain the above copyright notice,
+this list of conditions and the following disclamer.
+
+- Redistribution in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclamer in the documentation
+and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,3 @@
+#!/usr/bin/env runhaskell
+import Distribution.Simple
+main = defaultMain
diff --git a/Shellac-compatline.cabal b/Shellac-compatline.cabal
new file mode 100644
--- /dev/null
+++ b/Shellac-compatline.cabal
@@ -0,0 +1,43 @@
+Name:           Shellac-compatline
+Version:        0.9
+Cabal-version:  >= 1.2.2
+Build-Type:     Simple
+Author:         Robert Dockins
+License:        BSD3
+License-File:   LICENSE
+Maintainer:     robdockins AT fastmail DOT fm
+Category:       User Interfaces
+Stability:      Beta
+Homepage:       http://www.cs.princeton.edu/~rdockins/shellac/home/
+Synopsis:       "compatline" backend module for Shellac
+Description:
+   This package provides a Shellac backend which acts a thin interface
+   for the Shellac-readline or Shellac-editline packages, depending
+   on avaliability.  Note that this package may be compiled against
+   readline, which is licended under the GPL.
+
+Flag UseEditline
+  Description: Use the Shellac-editline pacakge
+  Default: True
+
+Flag UseReadline
+  Description: Use the Shellac-readline package
+  Default: False
+
+Library
+  Hs-Source-Dirs:
+    src
+  Build-Depends:
+     base, haskell98,
+     Shellac >= 0.9
+  if(flag(UseEditline))
+    Build-Depends: Shellac-editline
+    CPP-Options: -DUSE_EDITLINE
+  if(!flag(UseEditline) && flag(UseReadline))
+    Build-Depends: Shellac-readline
+    CPP-Options: -DUSE_READLINE
+  if(!flag(UseEditline) && !(flag(UseReadline)))
+    Build-Depends: DependencyResolutionFailure > 999
+  Exposed-modules:
+     System.Console.Shell.Backend.Compatline
+  Extensions: CPP
diff --git a/src/System/Console/Shell/Backend/Compatline.hs b/src/System/Console/Shell/Backend/Compatline.hs
new file mode 100644
--- /dev/null
+++ b/src/System/Console/Shell/Backend/Compatline.hs
@@ -0,0 +1,55 @@
+{-
+
+   Copyright 2008, Robert Dockins.
+
+ -}
+
+{- | This module implements a Shellac backend based either on
+     GNU readline or on libedit.  The choice between these two
+     packages is made at compile time, based on avaliability.  In the case that
+     both are avaliable, libedit is chosen.
+
+     Beware that while the code for this Shellac binding is licensed under a BSD3
+     license, GNU readline itself is licensed under the GPL.  This means that your
+     project needs to be GPL compatible to use this backend!  Otherwise you may encounter
+     licensing issues.
+
+     If your project is not GPL compatabile you should instead use the Shellac-editline
+     library, as editline is licensed under a BSD3 license.
+-}
+
+module System.Console.Shell.Backend.Compatline where
+
+import System.Console.Shell.Backend
+
+#ifdef USE_EDITLINE
+import System.Console.Shell.Backend.Editline
+#endif
+
+#ifdef USE_READLINE
+import System.Console.Shell.Backend.Readline
+#endif
+
+data CompatlineConfig
+  = UsingEditline
+  | UsingReadline
+ deriving Show
+
+-- | A \"readline-alike\" shell backend.
+compatlineBackend :: ShellBackend ()
+
+-- | A flag describing the compile-time
+--   configuration of this module.
+compatlineConfig :: CompatlineConfig
+
+
+#ifdef USE_EDITLINE
+compatlineBackend = editlineBackend
+compatlineConfig = UsingEditline
+#endif
+
+
+#ifdef USE_READLINE
+compatlineBackend = readlineBackend
+compatlineConfig = UsingReadline
+#endif
