OASISFormat:  0.3
OCamlVersion: >= 3.12.1
Name:         ocaml-lua
Version:      1.0
Synopsis:     Lua bindings
Authors:      Paolo Donadeo,
              Sylvain Le Gall
License:      MIT
LicenseFile:  COPYING.txt
BuildTools:   ocamlbuild
Plugins:      META (0.3),
              DevFiles (0.3)
Homepage:     http://ocaml-lua.forge.ocamlcore.org

Description:
  Lua is a powerful, light-weight programming language designed for extending
  applications. It provides a good general purpose programming language to
  replace DSL that don't really need to be specific.
  .
  This library provides bindings to Lua API which allows the application to
  exchange data with Lua programs and also to extend Lua with OCaml functions.
  .
  [Lua homepage](http://www.lua.org)

Flag lua51
  Description: The pkg-config name of lua can be lua5.1 or lua. If you are in
               the first case, disable this flag.
  Default: true

# Libraries
Library lua
  Path:         src
  Modules:      Lua_api, Lua_api_lib, Lua_aux_lib
  CSources:     stub.c, stub.h, aux_stub.c
  BuildDepends: unix
  CCopt:        -O3 -Wall -ggdb -Isrc/
  if flag(lua51)
    CCopt+: -I/usr/include/lua5.1
    CClib:  -llua5.1
  else
    CClib:  -llua -lm
  XMETADescription: OCaml binding to Lua API library


# Documentation
Document "api-lua"
  Title:                Reference for Lua API library
  Type:                 ocamlbuild (0.3)
  InstallDir:           $htmldir/html
  Install:              true
  DataFiles:            docs/style.css
  XOCamlbuildPath:      src/
  XOCamlbuildLibraries: lua
  BuildTools:           ocamldoc

#
# Memory test executables
#

Flag all
  Description:  Build all
  Default:      false

Flag memory_test
  Description:  Create and run programs to reveal memory leaks
  Default$:     flag(all)

Executable atpanic
  Path:           tests
  Build$:         flag(memory_test) || flag(all)
  Install:        false
  MainIs:         atpanic.ml
  Custom:         true
  BuildDepends:   lua
  CompiledObject: native

Executable cpcall
  Path:           tests
  Build$:         flag(memory_test) || flag(all)
  Install:        false
  MainIs:         cpcall.ml
  Custom:         true
  BuildDepends:   lua
  CompiledObject: native

# VCS
SourceRepository head
  Type:     git
  Location: http://forge.ocamlcore.org/anonscm/git/ocaml-lua/ocaml-lua.git
  Browser:  http://forge.ocamlcore.org/scm/browser.php?group_id=167
  Branch:   master

#
# Examples
#

Flag examples
  Description: Compile examples
  Default: false

Executable ci
  Path:             examples/ci
  Build$:           flag(examples) || flag(all)
  Install:          false
  MainIs:           ci.ml
  Custom:           true
  BuildDepends:     lua
  CompiledObject:   native

Executable dir
  Path:             examples/lua_book
  Build$:           flag(examples) || flag(all)
  Install:          false
  MainIs:           dir.ml
  Custom:           true
  BuildDepends:     lua
  CompiledObject:   native

Test ci
  Run$:     flag(examples) || flag(all)
  Command:  $ci examples/ci/script.lua

