diff --git a/src/runtime/c/README.md b/src/runtime/c/README.md index 03603a503..48c4a48be 100644 --- a/src/runtime/c/README.md +++ b/src/runtime/c/README.md @@ -44,13 +44,27 @@ autoreconf -i make make install ``` -The shared libraries are installed in `/usr/local/lib`. +The shared libraries are installed in `/usr/local/lib`. You can instead use: ## Using - Compiling GF with this runtime will require flag `--extra-lib-dirs=/usr/local/lib`. - Running GF with this runtime will require environment variable `LD_LIBRARY_PATH=/usr/local/lib` +This can be avoided by configuring the C runtime with: + +``` +./configure --prefix=/usr +``` + +On Windows, the easiest way to let GHC know about the library is to use: + +``` +./configure --prefix=/mingw +``` + +after that move libpgf-0.dll from `/mingw/bin` to `/bin`. + ## Uninstalling To remove the _old_ C runtime from your system, do: diff --git a/src/runtime/haskell/README.md b/src/runtime/haskell/README.md index 1cb68df65..5a184668f 100644 --- a/src/runtime/haskell/README.md +++ b/src/runtime/haskell/README.md @@ -5,20 +5,36 @@ This is a Haskell binding to the PGF runtime written in C. The exposed modules are: - `PGF2`: a user API similar to Python and Java APIs -- `PGF2.Internal`: an internal module with FFI definitions for the relevant C functions +- `PGF2.Transactions`: an interface for modifying an existing grammar at runtime ## How to compile **Important:** You must have the C runtime already installed and available on your system. See -Once the runtine is installed, you can install the library to your global Cabal installation: +Once the runtime is installed, you can install this binding with Cabal: ``` cabal install pgf2 --extra-lib-dirs=/usr/local/lib ``` -or add it to your `stack.yaml` file: +The option extra-lib-dirs is needed if you have installed the C runtime +in the default folder /usr/local/lib on Linux. If you instead have +configured the C runtime with: + +``` +./configure --prefix=/usr +``` + +on Linux, or as: + +``` +./configure --prefix=/mingw +``` + +on Windows, then you don't need the extra-lib-dirs option here. + +You can also add the binding to your `stack.yaml` file: ```yaml extra-deps: