Source

sulu-ocaml-core / base / core / extended / oasis.sh

Brandon Mitchell d140a6d 
ysulsky a6325ca 

ysulsky d48bac2 
ysulsky a6325ca 
ysulsky d48bac2 
ysulsky a6325ca 

ysulsky 43389a4 
ysulsky 8808e3a 
ysulsky a6325ca 
ysulsky e1f704c 
ysulsky a6325ca 

ysulsky e1f704c 
ysulsky a6325ca 

ysulsky 43389a4 
ysulsky a6325ca 

ysulsky e1f704c 
ysulsky a6325ca 



ysulsky acd6f9e 

ysulsky e1f704c 
ysulsky acd6f9e 


ysulsky e1f704c 
ysulsky acd6f9e 
ysulsky e1f704c 


ysulsky a6325ca 



ysulsky 43389a4 
ysulsky e1f704c 

ysulsky acd6f9e 
ysulsky a6325ca 

















































ysulsky 43389a4 
ysulsky a6325ca 





ysulsky d48bac2 

ysulsky a6325ca 




ysulsky e1f704c 












ysulsky 2c2e249 
ysulsky b8af308 





ysulsky e1f704c 









ysulsky b8af308 

ysulsky e1f704c 
















ysulsky acd6f9e 

ysulsky d48bac2 
ysulsky a6325ca 
#!/usr/bin/env bash
set -e -u -o pipefail

source ../../../build-common.sh

cat >$HERE/_oasis <<EOF
#AUTOGENERATED FILE; EDIT oasis.sh INSTEAD

OASISFormat:  0.3
OCamlVersion: >= 3.12.1
Name:         core_extended
Version:      $core_version
Synopsis:     Jane Street Capital's standard library overlay
Authors:      Jane street capital
Copyrights:   (C) 2008-2012 Jane Street Capital LLC
License:      LGPL-2.1 with OCaml linking exception
LicenseFile:  LICENSE
Plugins:      StdFiles (0.3), DevFiles (0.3), META (0.3)
BuildTools:   ocamlbuild
Description:  Jane Street Capital's standard library overlay
FindlibVersion: >= 1.2.7
XStdFilesAUTHORS: false
XStdFilesINSTALLFilename: INSTALL
XStdFilesREADME: false

Flag linux
  Description: Enable linux specific extensions
  Default\$:   false   # actually, the default is detected

Flag "posix-timers"
  Description: Enable POSIX timers
  Default\$:   false   # actually, the default is detected

PostConfCommand: lib/discover.sh lib/config.mlh lib/config.h

PreDistCleanCommand: \$rm lib/version_defaults.mlh lib/config.mlh lib/config.h

Library core_extended
  Path:               lib
  FindlibName:        core_extended
  Pack:               true
  Modules:            $(list_mods  "$HERE/lib")
  CSources:           $(list_stubs "$HERE/lib"),config.h
  CCOpt+:             -Ilib
  BuildDepends:       sexplib.syntax,
                      sexplib,
                      fieldslib.syntax,
                      fieldslib,
                      bin_prot,
                      bin_prot.syntax,
                      pa_ounit,
                      pa_pipebang,
                      core,
                      bigarray,
                      pcre,
                      res,
                      unix,
                      threads

Executable core_extended_hello
  Path:               lib_test
  MainIs:             core_extended_hello.ml
  Build\$:            flag(tests)
  Custom:             true
  CompiledObject:     best
  Install:            false
  BuildDepends:       core_extended

Executable core_hello
  Path:               lib_test
  MainIs:             core_hello.ml
  Build\$:            flag(tests)
  Custom:             true
  CompiledObject:     best
  Install:            false
  BuildDepends:       core,threads

Executable test_runner
  Path:               lib_test
  MainIs:             test_runner.ml
  Build\$:            flag(tests)
  Custom:             true
  CompiledObject:     best
  Install:            false
  BuildDepends:       core_extended,oUnit (>= 1.1.0),threads

Test test_runner
  Run\$:              flag(tests)
  Command:            \$test_runner --core-hello \$core_hello --core-extended-hello \$core_extended_hello
  WorkingDirectory:   lib_test
  TestTools:          core_hello,core_extended_hello

Document "core-extended"
  Title:                Jane street's core extended library
  Type:                 ocamlbuild (0.3)
  BuildTools+:          ocamldoc
  XOCamlbuildPath:      lib
  XOCamlbuildLibraries: core_extended

EOF

if [[ ! -e $HERE/lib/version_defaults.mlh ]]; then
    cat >$HERE/lib/version_defaults.mlh <<EOF
DEFINE DEFAULT_VERSION = "No version info."
DEFINE DEFAULT_BUILDINFO = "No build info."
EOF
fi

make_tags "$HERE/_tags" <<EOF
<lib/*.ml{,i}>          : syntax_camlp4o
"lib/command.ml"        : mlh, pkg_camlp4.macro
"lib/console.ml"        : mlh, pkg_camlp4.macro
"lib/core_command.ml"   : mlh, pkg_camlp4.macro
"lib/extended_linux.ml" : mlh, pkg_camlp4.macro
"lib/malloc.ml"         : mlh, pkg_camlp4.macro
"lib/posix_clock.ml"    : mlh, pkg_camlp4.macro
EOF

make_myocamlbuild "$HERE/myocamlbuild.ml" <<EOF
let dispatch = function
  | After_rules as e ->
    setup_standard_build_flags ();

    dep  ["ocaml"; "ocamldep"; "mlh"] (select_files "lib/" ".mlh");

    flag ["mlh"; "ocaml"; "ocamldep"] (S[A"-ppopt"; A"-Ilib/"]);
    flag ["mlh"; "ocaml"; "compile"]  (S[A"-ppopt"; A"-Ilib/"]);

    dispatch_default e
  | e -> dispatch_default e

let () = Ocamlbuild_plugin.dispatch dispatch
EOF

make_setup_ml "$HERE/setup.ml" <<EOF
let linux_possible = test "uname | grep -q -i linux"
let timers_possible =
  match getconf "_POSIX_TIMERS" with
  | None   -> false
  | Some x -> (try int_of_string x >= 200112 with _ -> false)

let map_section = function
  | Flag (cs, flag) when cs.cs_name = "linux" ->
    Flag (cs, { flag with
                flag_default = [OASISExpr.EBool true,      linux_possible;
                                OASISExpr.EBool false, not linux_possible] })
  | Flag (cs, flag) when cs.cs_name = "posix-timers" ->
    Flag (cs, { flag with
                flag_default = [OASISExpr.EBool true,      timers_possible;
                                OASISExpr.EBool false, not timers_possible] })
  | section -> section

let setup_t = { setup_t with
  BaseSetup.package = { setup_t.BaseSetup.package with
    sections = List.map map_section setup_t.BaseSetup.package.sections;
  }
}
EOF

cd $HERE
oasis setup