Source

ocaml-core / base / async / scheduler / oasis.sh

The branch 'bash' does not exist.
Full commit
Brandon Mitchell 969b207 
ysulsky a6325ca 

ysulsky acd6f9e 
















ysulsky a6325ca 




























































ysulsky acd6f9e 





ysulsky a6325ca 























ysulsky acd6f9e 






ysulsky a6325ca 



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

enable_linux=false
enable_linux_default="--disable-linux"
case $(ocamlc -config | awk '$1 == "system:" {print $2}') in
    linux|linux_elf)
        enable_linux=true
        enable_linux_default="--enable-linux"
    ;;
esac

opts=( "$@" )
for ((i=0; i<$#; i++)); do
    case ${opts[$i]} in
        --enable-linux)  enable_linux=true;  enable_linux_default= ;;
        --disable-linux) enable_linux=false; enable_linux_default= ;;
    esac
done

here="$(dirname "${BASH_SOURCE[0]}")"

my_join () {
    local FIRST="true"
    while read line; do
        if [[ "$FIRST" != "true" ]]; then
            echo -n ","
        else
            FIRST="false"
        fi
        echo -n "$line"
    done
    echo
}

list_mods () {
    echo Std
    for i in $here/$1/*.ml; do
        bname="$(basename $i)"
        j=${bname%%.ml*};
        case $j in
            inline_tests_runner) continue;;
            *);;
        esac
        echo -n "${j:0:1}" | tr "[:lower:]" "[:upper:]"; echo ${j:1};
    done
}

list_stubs () {
    for i in "$here"/lib/*.{c,h} "$here"/lib/*.{c,h}; do
        bname="$(basename $i)"
        j=${bname%%.?};
        case $j in
            *);;
        esac
        echo "$bname"
    done
}

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

OASISFormat:  0.2
OCamlVersion: >= 3.12
Name:         async_scheduler
Version:      107.01
Synopsis:     Jane Street Capital's asynchronous execution library (scheduler)
Authors:      Jane street capital
Copyrights:   (C) 2008-2011 Jane Street Capital LLC
License:      LGPL-2.1 with OCaml linking exception
LicenseFile:  LICENSE
Plugins:      StdFiles (0.2),
              DevFiles (0.2),
              META (0.2)
BuildTools:   ocamlbuild
Description:  Jane Street Capital's asynchronous execution library
FindlibVersion: >= 1.2.7
XStdFilesAUTHORS: false
XStdFilesINSTALLFilename: INSTALL
XStdFilesREADME: false

Flag linux
  Description: Enable linux specific extensions
  Default$:    $enable_linux

PreBuildCommand: mkdir -p _build; cp lib/*mlh _build/
PreDistCleanCommand: \$rm lib/version_defaults.mlh lib/config.mlh

Library async_scheduler
  Path:               lib
  FindlibName:        async_scheduler
  Pack:               true
  Modules:$(list_mods lib | sort -u | my_join)
  BuildDepends:       sexplib.syntax,
                      sexplib,
                      fieldslib.syntax,
                      fieldslib,
                      bin_prot,
                      bin_prot.syntax,
                      pa_ounit,
                      pa_pipebang,
                      core,
                      async_core,
                      threads

EOF

cat >$here/_tags <<EOF
# OASIS_START
# OASIS_STOP
<lib/*.ml{,i}>: syntax_camlp4o
"lib/async_unix.ml": pkg_camlp4.macro
"lib/raw_scheduler.ml": pkg_camlp4.macro
<lib/writer.ml{,i}>: pkg_camlp4.macro
EOF

cat >$here/lib/config.mlh <<EOF
$(if [[ "$enable_linux" == "true" ]]; then echo "DEFINE LINUX_EXT"; fi)
EOF

cd $here
oasis setup
./configure "$enable_linux_default" "$@"