From bea88d19749c0fb8f87c9c9f4f0175179a0e7056 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 12 May 2016 09:45:39 -0400 Subject: [PATCH] make version correct --- .gitignore | 13 +++++++++++++ bin/ocaml | 3 +++ bin/ocamlc | 3 +++ bin/ocamlc.opt | 3 +++ bin/ocamldep | 3 +++ bin/ocamldep.opt | 3 +++ bin/ocamllex | 3 +++ bin/ocamllex.opt | 3 +++ bin/ocamlobjinfo | 3 +++ bin/ocamlopt | 3 +++ bin/ocamlopt.opt | 3 +++ bin/ocamlrun | 3 +++ bin/ocamlyacc | 3 +++ jscomp/js_main.ml | 33 ++++++++++++++++++++++++++++++--- package.json | 10 +++++++++- 15 files changed, 88 insertions(+), 4 deletions(-) create mode 100755 bin/ocaml create mode 100755 bin/ocamlc create mode 100755 bin/ocamlc.opt create mode 100755 bin/ocamldep create mode 100755 bin/ocamldep.opt create mode 100755 bin/ocamllex create mode 100755 bin/ocamllex.opt create mode 100755 bin/ocamlobjinfo create mode 100755 bin/ocamlopt create mode 100755 bin/ocamlopt.opt create mode 100755 bin/ocamlrun create mode 100755 bin/ocamlyacc diff --git a/.gitignore b/.gitignore index 2efca75909..194cd684c7 100644 --- a/.gitignore +++ b/.gitignore @@ -54,4 +54,17 @@ bin/* # for npm publish !bin/bsc +!bin/ocaml +!bin/ocamldep +!bin/ocamldep.opt +!bin/ocamlyacc +!bin/ocamllex.opt +!bin/ocamllex +!bin/ocamlobjinfo +!bin/ocamlopt +!bin/ocamlopt.opt +!bin/ocamlrun +!bin/ocamlc +!bin/ocamlc.opt + !ocaml.tar.gz \ No newline at end of file diff --git a/bin/ocaml b/bin/ocaml new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocaml @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamlc b/bin/ocamlc new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamlc @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamlc.opt b/bin/ocamlc.opt new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamlc.opt @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamldep b/bin/ocamldep new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamldep @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamldep.opt b/bin/ocamldep.opt new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamldep.opt @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamllex b/bin/ocamllex new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamllex @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamllex.opt b/bin/ocamllex.opt new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamllex.opt @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamlobjinfo b/bin/ocamlobjinfo new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamlobjinfo @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamlopt b/bin/ocamlopt new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamlopt @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamlopt.opt b/bin/ocamlopt.opt new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamlopt.opt @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamlrun b/bin/ocamlrun new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamlrun @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/bin/ocamlyacc b/bin/ocamlyacc new file mode 100755 index 0000000000..9547512496 --- /dev/null +++ b/bin/ocamlyacc @@ -0,0 +1,3 @@ +#!/bin/sh +echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY" +exit 2 diff --git a/jscomp/js_main.ml b/jscomp/js_main.ml index e44c564942..b409f16b73 100644 --- a/jscomp/js_main.ml +++ b/jscomp/js_main.ml @@ -12,7 +12,31 @@ open Config open Clflags -open Compenv +(* open Compenv *) + +let output_prefix = Compenv.output_prefix +let readenv = Compenv.readenv +let first_ccopts = Compenv.first_ccopts +let first_ppx = Compenv.first_ppx + +let bs_version_string = + "BuckleScript " ^ Js_config.version ^ + " (Using OCaml" ^ Config.version ^ " )" + +let print_version_and_library compiler = + Printf.printf "The OCaml %s, version " compiler; + print_string bs_version_string; print_newline(); + print_string "Standard library directory: "; + print_string Config.standard_library; print_newline(); + exit 0 + +let print_standard_library = Compenv.print_standard_library + +let print_version_string () = + print_string bs_version_string; + print_newline (); + exit 0 + let process_interface_file ppf name = @@ -131,11 +155,14 @@ end) let add_include_path s = let (//) = Filename.concat in - (*TODO: check its existence *) let path = Ext_filename.resolve (Lazy.force Ext_filename.cwd) s // "lib"// "ocaml" in - Clflags.include_dirs := path :: ! Clflags.include_dirs + if Ext_sys.is_directory_no_exn path then + Clflags.include_dirs := path :: ! Clflags.include_dirs + else + Ext_pervasives.failwithf "%s is not a directory" s + let buckle_script_flags = ("-js-npm-output-path", Arg.String Js_config.set_npm_package_path, diff --git a/package.json b/package.json index 53bd7b0cb4..4b55c0a7af 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,15 @@ "url": "git+https://github.com/bloomberg/bucklescript.git" }, "bin" : { - "bsc" : "./bin/bsc" + "bsc" : "./bin/bsc", + "ocaml": "./bin/ocaml", + "ocamlc":"./bin/ocamlc.opt", + "ocamldep" : "./bin/ocamldep.opt", + "ocamllex" : "./bin/ocamllex.opt", + "ocamlobjinfo" : "./bin/ocamlobjinfo", + "ocamlopt.opt" : "./bin/ocamlopt", + "ocamlrun": "./bin/ocamlrun", + "ocamlyacc" : "./bin/ocamlyacc" } , "keywords": [ "ocaml",