# +-------------------------------------------------------------------+
# | Package parameters                                                |
# +-------------------------------------------------------------------+

OASISFormat: 0.3
OCamlVersion: >= 3.12
Name: lwt
Version: 2.4.3
LicenseFile: COPYING
License: LGPL-2.1 with OCaml linking exception
Authors:
  Jérôme Vouillon,
  Vincent Balat,
  Nataliya Guts,
  Pierre Clairambault,
  Stéphane Glondu,
  Jérémie Dimino,
  Warren Harris,
  Pierre Chambart,
  Mauricio Fernandez
Homepage: http://ocsigen.org/lwt/
BuildTools: ocamlbuild
Plugins: DevFiles (0.3), META (0.3)
XDevFilesEnableMakefile: false
PostConfCommand: ocaml discover.ml -ocamlc $ocamlc -ext-obj $ext_obj -exec-name $default_executable_name -use-libev $libev -os-type $os_type -use-glib $glib -ccomp-type $ccomp_type -use-pthread $pthread -use-unix $unix
PostDistCleanCommand: $rm src/unix/lwt_config.h src/unix/lwt_config.ml src/unix/lwt_unix_jobs_generated.ml src/unix/jobs-unix/*

Synopsis: Lightweight thread library for Objective Caml
Description:
  Lwt is a library of cooperative threads implemented in monadic
  style. With respect to preemptive threads, cooperative threads are
  not using a scheduler to distribute processor time between
  threads. Instead of this, each thread must tell the others that he
  wants to let them work.

# +-------------------------------------------------------------------+
# | Flags                                                             |
# +-------------------------------------------------------------------+

Flag all
  Description: build and install everything
  Default: false

Flag syntax
  Description: Build the syntax extension
  Default: true

Flag unix
  Description: Unix support
  Default: true

Flag react
  Description: React helpers
  Default$: flag(all)

Flag glib
  Description: Glib integration
  Default$: flag(all)

Flag ssl
  Description: SSL support
  Default$: flag(all)

Flag text
  Description: Text mode utilities (deprecated)
  Default$: flag(all)

Flag preemptive
  Description: Preemptive threads support
  Default$: flag(unix)

Flag extra
  Description: Asynchronous unix functions
  Default$: flag(preemptive)

Flag toplevel
  Description: Enhanced toplevel
  Default$: flag(all)

Flag libev
  Description: Compile with libev support
  Default$: !os_type(Win32)

Flag pthread
  Description: Use pthread
  Default$: !os_type(Win32)

# +-------------------------------------------------------------------+
# | Libraries                                                         |
# +-------------------------------------------------------------------+

Library "optcomp"
  Install: false
  Build$: flag(syntax) || flag(all)
  Path: syntax
  Modules: Pa_optcomp
  BuildDepends: camlp4, camlp4.quotations.o

Library "lwt"
  Path: src/core
  Modules:
    Lwt_condition,
    Lwt_list,
    Lwt,
    Lwt_mutex,
    Lwt_mvar,
    Lwt_pool,
    Lwt_sequence,
    Lwt_stream,
    Lwt_switch,
    Lwt_util,
    Lwt_pqueue
  XMETADescription: Lightweight thread library for OCaml (core library)

Library "lwt-unix"
  Build$: flag(unix) || flag(all)
  Install$: flag(unix) || flag(all)
  FindlibName: unix
  FindlibParent: lwt
  Path: src/unix
  Modules:
    Lwt_chan,
    Lwt_daemon,
    Lwt_gc,
    Lwt_io,
    Lwt_log,
    Lwt_main,
    Lwt_process,
    Lwt_throttle,
    Lwt_timeout,
    Lwt_unix,
    Lwt_sys,
    Lwt_engine,
    Lwt_bytes
  InternalModules:
    Lwt_log_rules,
    Lwt_unix_jobs_generated
  BuildDepends: lwt, unix, bigarray
  XMETADescription: Unix support for lwt
  CSources:
    lwt_config.h,
    lwt_unix.h,
    lwt_unix_stubs.c,
    lwt_libev_stubs.c,
    lwt_process_stubs.c,
    jobs-unix/lwt_unix_job_access.c,
    jobs-unix/lwt_unix_job_chdir.c,
    jobs-unix/lwt_unix_job_chmod.c,
    jobs-unix/lwt_unix_job_chown.c,
    jobs-unix/lwt_unix_job_chroot.c,
    jobs-unix/lwt_unix_job_close.c,
    jobs-unix/lwt_unix_job_fchmod.c,
    jobs-unix/lwt_unix_job_fchown.c,
    jobs-unix/lwt_unix_job_fdatasync.c,
    jobs-unix/lwt_unix_job_fsync.c,
    jobs-unix/lwt_unix_job_ftruncate.c,
    jobs-unix/lwt_unix_job_link.c,
    jobs-unix/lwt_unix_job_lseek.c,
    jobs-unix/lwt_unix_job_mkdir.c,
    jobs-unix/lwt_unix_job_mkfifo.c,
    jobs-unix/lwt_unix_job_rename.c,
    jobs-unix/lwt_unix_job_rmdir.c,
    jobs-unix/lwt_unix_job_symlink.c,
    jobs-unix/lwt_unix_job_tcdrain.c,
    jobs-unix/lwt_unix_job_tcflow.c,
    jobs-unix/lwt_unix_job_tcflush.c,
    jobs-unix/lwt_unix_job_tcsendbreak.c,
    jobs-unix/lwt_unix_job_truncate.c,
    jobs-unix/lwt_unix_job_unlink.c
  if os_type(Win32) && ccomp_type(msvc)
    CCLib+: ws2_32.lib
  else if os_type(Win32)
    CCLib+: -lws2_32

Library "lwt-simple-top"
  Build$: flag(unix) || flag(all)
  Install$: flag(unix) || flag(all)
  FindlibName: simple-top
  FindlibParent: lwt
  Path: src/simple_top
  InternalModules: Lwt_simple_top
  BuildDepends: lwt, lwt.unix
  XMETADescription: Unix support for lwt

Library "lwt-react"
  Build$: flag(react) || flag(all)
  Install$: flag(react) || flag(all)
  FindlibName: react
  FindlibParent: lwt
  Path: src/react
  Modules: Lwt_event, Lwt_signal, Lwt_react
  BuildDepends: lwt, react
  XMETADescription: Reactive programming helpers

Library "lwt-preemptive"
  Build$: flag(preemptive) || flag(all)
  Install$: flag(preemptive) || flag(all)
  FindlibName: preemptive
  FindlibParent: lwt
  Path: src/preemptive
  Modules: Lwt_preemptive
  BuildDepends: lwt, lwt.unix, threads
  XMETADescription: Preemptive threads support for Lwt

Library "lwt-extra"
  Build$: flag(extra) || flag(all)
  Install$: flag(extra) || flag(all)
  FindlibName: extra
  FindlibParent: lwt
  Path: src/extra
  Modules: Lwt_lib
  BuildDepends: lwt, lwt.preemptive
  XMETADescription: Unix functions for Lwt using Lwt_preemptive

Library "lwt-glib"
  Build$: flag(glib) || flag(all)
  Install$: flag(glib) || flag(all)
  FindlibName: glib
  FindlibParent: lwt
  Path: src/glib
  Modules: Lwt_glib
  CSources: lwt_glib_stubs.c
  BuildDepends: lwt, lwt.unix
  XMETADescription: Glib integration

Library "lwt-ssl"
  Build$: flag(ssl) || flag(all)
  Install$: flag(ssl) || flag(all)
  FindlibName: ssl
  FindlibParent: lwt
  Path: src/ssl
  Modules: Lwt_ssl
  BuildDepends: ssl, lwt.unix
  XMETADescription: SSL support for Lwt

Library "lwt-text"
  Build$: flag(text) || flag(all)
  Install$: flag(text) || flag(all)
  FindlibName: text
  FindlibParent: lwt
  Path: src/text
  Modules: Lwt_text, Lwt_term, Lwt_read_line
  BuildDepends: lwt, lwt.unix, lwt.react, text, text.bigarray
  XMETADescription: Text mode utilities (deprecated)
  CSources: lwt_text_stubs.c

Library "lwt-top"
  Build$: flag(text) || flag(all)
  Install$: flag(text) || flag(all)
  FindlibName: top
  FindlibParent: lwt
  Path: src/top
  Modules: Lwt_top
  InternalModules: Lwt_ocaml_completion
  BuildDepends: lwt, lwt.text, findlib
  XMETADescription: Line-editing in the toplevel (deprecated)

Library "lwt-syntax"
  Build$: flag(syntax) || flag(all)
  Install$: flag(syntax) || flag(all)
  FindlibName: syntax
  FindlibParent: lwt
  Path: syntax
  Modules: Pa_lwt
  BuildDepends: camlp4, camlp4.quotations.o, camlp4.extend
  XMETAType: syntax
  XMETADescription: Syntactic sugars for Lwt
  XMETARequires: camlp4, lwt.syntax.options

Library "lwt-syntax-options"
  Build$: flag(syntax) || flag(all)
  Install$: flag(syntax) || flag(all)
  FindlibName: options
  FindlibParent: lwt-syntax
  Path: syntax
  InternalModules: Pa_lwt_options
  BuildDepends: camlp4
  XMETAType: syntax
  XMETADescription: Options for syntax extensions
  XMETARequires: camlp4

Library "lwt-syntax-log"
  Build$: flag(syntax) || flag(all)
  Install$: flag(syntax) || flag(all)
  FindlibName: log
  FindlibParent: lwt-syntax
  Path: syntax
  Modules: Pa_lwt_log
  BuildDepends: camlp4, camlp4.quotations.o
  XMETAType: syntax
  XMETADescription: Syntactic sugars for logging
  XMETARequires: camlp4, lwt.syntax.options

# +-------------------------------------------------------------------+
# | Toplevel                                                          |
# +-------------------------------------------------------------------+

Executable "lwt-toplevel"
  Build$: flag(toplevel) || flag(all)
  Install$: flag(toplevel) || flag(all)
  Path: src/top
  CompiledObject: byte
  MainIs: lwt_toplevel.ml
  BuildDepends: lwt, lwt.top, lwt.text, lwt.react, text, findlib, unix

# +-------------------------------------------------------------------+
# | Doc                                                               |
# +-------------------------------------------------------------------+

Document "lwt-manual"
  Title: Lwt user manual
  Type: custom (0.3)
  Install: true
  XCustom: make -C manual manual.pdf
  DataFiles: manual/manual.pdf
  InstallDir: $pdfdir

Document "lwt-api"
  Title: API reference for Lwt
  Type: ocamlbuild (0.3)
  Install: true
  InstallDir: $htmldir/api
  DataFiles: utils/style.css
  BuildTools: ocamldoc
  XOCamlbuildPath: ./
  XOCamlbuildLibraries:
    lwt,
    lwt.extra,
    lwt.glib,
    lwt.preemptive,
    lwt.react,
    lwt.ssl,
    lwt.text,
    lwt.top,
    lwt.unix,
    lwt.syntax,
    lwt.syntax.log

# +-------------------------------------------------------------------+
# | Examples                                                          |
# +-------------------------------------------------------------------+

Executable logging
  Path: examples/unix
  Build$: flag(unix)
  Install: false
  MainIs: logging.ml
  BuildDepends: lwt.unix, lwt.syntax
  CompiledObject: best

Executable relay
  Path: examples/unix
  Build$: flag(unix)
  Install: false
  MainIs: relay.ml
  BuildDepends: lwt.unix, lwt.syntax
  CompiledObject: best

Executable parallelize
  Path: examples/unix
  Build$: flag(unix)
  Install: false
  MainIs: parallelize.ml
  BuildDepends: lwt.unix, lwt.syntax
  CompiledObject: best

# +-------------------------------------------------------------------+
# | Tests                                                             |
# +-------------------------------------------------------------------+

Library test
  Path: tests
  Modules: Test
  Install: false
  Build$: flag(tests) && (flag(unix) || flag(all))
  BuildDepends: lwt, unix, lwt.unix

Executable test_core
  Path: tests/core
  Build$: flag(tests) && (flag(unix) || flag(all))
  Install: false
  CompiledObject: best
  MainIs: main.ml
  BuildDepends: test, lwt, unix, lwt.unix

Executable test_unix
  Path: tests/unix
  Build$: flag(tests) && (flag(unix) || flag(all))
  Install: false
  CompiledObject: best
  MainIs: main.ml
  BuildDepends: test, lwt, unix, lwt.unix

Executable test_react
  Path: tests/react
  Build$: flag(tests) && ((flag(unix) && flag(react)) || flag(all))
  Install: false
  CompiledObject: best
  MainIs: main.ml
  BuildDepends: test, lwt, unix, lwt.unix, react, lwt.react

Executable test_preemptive
  Path: tests/preemptive
  Build$: flag(tests) && ((flag(preemptive) && flag(unix)) || flag(all))
  Install: false
  CompiledObject: best
  MainIs: main.ml
  BuildDepends: test, lwt, unix, lwt.unix, lwt.preemptive, threads

Test core
  Command: $test_core
  TestTools: test_core
  Run$: flag(tests) && (flag(unix) || flag(all))

Test unix
  Command: $test_unix
  TestTools: test_unix
  Run$: flag(tests) && (flag(unix) || flag(all))

Test react
  Command: $test_react
  TestTools: test_react
  Run$: flag(tests) && ((flag(unix) && flag(react)) || flag(all))

Test preemptive
  Command: $test_preemptive
  TestTools: test_preemptive
  Run$: flag(tests) && ((flag(preemptive) && flag(unix)) || flag(all))

# +-------------------------------------------------------------------+
# | Misc                                                              |
# +-------------------------------------------------------------------+

SourceRepository head
  Type: darcs
  Location: http://ocsigen.org/darcs/lwt
  Browser: http://ocsigen.org/darcsweb/?r=lwt;a=summary
