Skip to content

Commit

Permalink
Add -c flag for passing configuration options to OCaml's configure sc…
Browse files Browse the repository at this point in the history
…ript
  • Loading branch information
hcarty committed Jan 8, 2012
1 parent 6757166 commit 804ab8d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ ocamlbrew can be configured with several environment variables.
`$OCAMLBREW_FLAGS` defaults to `-a`.

#### Available command line flags
-h Display this message
-b [path] Use [path] as $OCAMLBREW_BASE
-a Install everything with no prompts
-o Install OCaml only, no prompts
-f Install OCaml and findlib only, no prompts
-s [path] Install OCaml from Subversion [path]
-t Install OCaml from Subversion trunk
-n [name] Install under $OCAMLBREW_BASE/[name]
-h Display this message
-b [path] Use [path] as $OCAMLBREW_BASE
-c "[flags]" Flags to pass to OCaml's configure
-a Install everything with no prompts
-o Install OCaml only, no prompts
-f Install OCaml and findlib only, no prompts
-s [path] Install OCaml from Subversion [path]
-t Install OCaml from Subversion trunk
-n [name] Install under $OCAMLBREW_BASE/[name]

The build and installation will occur under `$OCAMLBREW_BASE`
Subversion path should be relative to `http://caml.inria.fr/svn/ocaml/`
Expand Down
27 changes: 17 additions & 10 deletions ocamlbrew
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ function help_then_exit() {
echo Usage: "$0" [flags]
echo
echo "Possible flags:"
echo "-h Display this message"
echo "-b [path] Use [path] as \$OCAMLBREW_BASE"
echo "-a Install everything with no prompts"
echo "-o Install OCaml only, no prompts"
echo "-f Install OCaml and findlib only, no prompts"
echo "-s [path] Install OCaml from Subversion [path]"
echo "-t Install OCaml from Subversion trunk"
echo "-n [name] Install under \$OCAMLBREW_BASE/[name]"
echo "-h Display this message"
echo "-b [path] Use [path] as \$OCAMLBREW_BASE"
echo "-c \"[flags]\" Flags to pass to OCaml's configure"
echo "-a Install everything with no prompts"
echo "-o Install OCaml only, no prompts"
echo "-f Install OCaml and findlib only, no prompts"
echo "-s [path] Install OCaml from Subversion [path]"
echo "-t Install OCaml from Subversion trunk"
echo "-n [name] Install under \$OCAMLBREW_BASE/[name]"
echo
echo "The build and installation will occur under \$OCAMLBREW_BASE"
echo "Subversion path should be relative to $OCAML_SVN_ROOT"
Expand Down Expand Up @@ -108,6 +109,9 @@ function init_variables() {
# Parent directory where software will be built
: ${BUILD_DIR="$OCAML_BASE"/build}

# Configuration flags for OCaml
: ${OCAML_CONFIG_FLAGS=""}

# odb paths
: ${ODB_BUILD_DIR="$BUILD_DIR"/odb}
: ${ODB_INSTALL_DIR="$OCAML_BASE"/odb}
Expand All @@ -120,13 +124,16 @@ function init_variables() {
# Handle command line arguments
#
function parse_opts() {
while getopts "hb:aofs:tn:" OPTION; do
while getopts "hb:c:aofs:tn:" OPTION; do
case $OPTION in
h)
help_then_exit ;;
b)
OCAMLBREW_BASE="$OPTARG"
;;
c)
OCAML_CONFIG_FLAGS="$OPTARG"
;;
a)
INSTALL_ALL="true"
;;
Expand Down Expand Up @@ -290,7 +297,7 @@ function brew_ocaml() {
;;
build)
say Building OCaml
./configure -prefix "$OCAML_BASE"
./configure -prefix "$OCAML_BASE" $OCAML_CONFIG_FLAGS
make world.opt
;;
install)
Expand Down

0 comments on commit 804ab8d

Please sign in to comment.