Commits

Markus Mottl  committed 9b562f8 Merge

Merged with Jane Street

  • Participants
  • Parent commits fd02eba, 3caf1d5

Comments (0)

Files changed (7)

File base/bin-prot/oasis.sh

 XStdFilesREADME: false
 
 
-PreBuildCommand: mkdir -p _build; cp lib/*.{mlh,h} _build/
+PreBuildCommand: mkdir -p _build; cp lib/*.mlh lib/*.h _build/
 
 Library bin_prot
   Path:               lib
   XMETARequires:      type-conv,bin_prot
   XMETADescription:   Syntax extension for binary protocol generator
 
-Flag tests
-  Description:        Build and run tests
-  Default:            false
+$(declare_tests_flag)
 
 Executable test_runner
   Path:               lib_test

File base/core/extended/oasis.sh

                       unix,
                       threads
 
-Flag tests
-  Description:        Build and run tests
-  Default:            false
+$(declare_tests_flag)
 
 Executable core_extended_hello
   Path:               lib_test

File base/core/oasis.sh

                       unix,
                       threads
 
-Flag tests
-  Description:        Build and run tests
-  Default:            false
+$(declare_tests_flag)
 
 Executable test_runner
   Path:               lib_test

File base/sexplib/oasis.sh

   XMETADescription:   Toplevel printers for S-expressions
 
 # TODO: figure out how to build tests without installing sexplib
-Flag tests
-  Description:        Build and run tests
-  Default:            false
+$(declare_tests_flag)
 
 Executable sexp_test
   Path:               lib_test

File base/variantslib/lib/META

 # OASIS_START
-# DO NOT EDIT (digest: d688e46403d76f941c61cbf94f723123)
+# DO NOT EDIT (digest: a343500168996634e276f54b40ffe5f7)
 version = "107.01"
 description = "OCaml variants as first class values."
 archive(byte) = "variantslib.cma"
  version = "107.01"
  description = "Syntax extension for Variantslib"
  requires = "camlp4 type-conv variantslib"
- archive(syntax,preprocessor) = "pa_variants_conv.cma"
- archive(syntax,toploop) = "pa_variants_conv.cma"
+ archive(syntax, preprocessor) = "pa_variants_conv.cma"
+ archive(syntax, toploop) = "pa_variants_conv.cma"
  exists_if = "pa_variants_conv.cma"
 )
 # OASIS_STOP

File build-and-install

     echo "usage: ${BASH_SOURCE[0]} [-j <JOBS>] [tree]"
     echo "         -h, --help       Display this help"
     echo "         -j N             Run at most N jobs in parallel"
+    echo "         -u               Don't install, uninstall"
 }
 
 configflags="
 
 opts=
 if getopt -V | grep -q enhanced; then
-  opts=$(getopt -n ${BASH_SOURCE[0]} -o "j:h" \
+  opts=$(getopt -n ${BASH_SOURCE[0]} -o "j:uh" \
                 -l "jobs:,help,$(echo -n $configflags | tr ' ' ,)" -- "$@")
 else
-  opts=$(getopt "j:h" $*)
+  opts=$(getopt "j:uh" $*)
 fi
 
 if [[ $? != 0 ]]; then usage; exit 1; fi
 timerflag=
 makeflags=""
 configopts=( )
+uninstall=false
 while true; do
     case "$1" in
         -h|--help) usage; exit 0;;
         -j|--jobs) makeflags="$makeflags -j $2";      shift 2;;
+        -u) uninstall=true; shift;;
         --enable-linux)  linuxflag="--enable-linux";  shift  ;;
         --disable-linux) linuxflag="--disable-linux"; shift  ;;
         --enable-posix-timers)  timerflag="--enable-posix-timers";  shift ;;
           trap "rm -r '$dest'" EXIT
           ;;
   esac
-  ./oasis.sh $optflags "${configopts[@]:+${configopts[@]}}"
-  make build BUILDFLAGS="$makeflags"
-  make install || true
+  if $uninstall; then
+    make uninstall || true
+  else
+    ./oasis.sh $optflags "${configopts[@]:+${configopts[@]}}"
+    make build BUILDFLAGS="$makeflags"
+    make install || true
+  fi
   popd
+
 done

File build-common.sh

     done
 }
 
+function declare_tests_flag {
+  # prior to oasis version 0.3.0, the "tests" flag is not built in
+  # and, the "version" argument is not supported.
+  if ! oasis version 2>/dev/null >/dev/null; then
+    cat <<EOF
+Flag tests
+  Description: Build and run tests
+  Default:     false
+EOF
+  fi
+}
+
 HERE=$(dirname "$0")