Permalink
Browse files

[enhance] config: added an install_dir variable

  • Loading branch information...
1 parent 9eb2383 commit 6ba0a55434d041701fea12fc89aa09febac48c9f @Aqua-Ye Aqua-Ye committed with BourgerieQuentin Jun 19, 2012
Showing with 14 additions and 2 deletions.
  1. +4 −1 config.mli
  2. +8 −0 configure
  3. +2 −1 install_release.sh
View
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of OPA.
@@ -22,6 +22,9 @@
(** the installation prefix (also known as MLSTATELIBS from many places *)
val prefix : string
+(** the installation directory (also known as MLSTATELIBS from many places *)
+val install_dir : string
+
(** the base directory of external ocaml libraries *)
val ocamllib : string
View
@@ -35,6 +35,11 @@ while [ $# -gt 0 ]; do
shift
PREFIX=$1
;;
+ -install-dir)
+ if [ $# -lt 2 ]; then echo "Error: option $1 requires an argument" >&2; exit 1; fi
+ shift
+ INSTALL_DIR=$1
+ ;;
-release)
IS_RELEASE=1
;;
@@ -86,6 +91,7 @@ done
: ${PREFIX:=${MLSTATELIBS:-}}
: ${PREFIX:=/usr/local}
: ${IS_RELEASE:=}
+: ${INSTALL_DIR:=$PREFIX}
CONFIG_LOG=$PWD/config.log
@@ -704,6 +710,7 @@ done
# See config.mli for the documentation and spec of these variables
cat >config.ml <<EOF
let prefix = "$PREFIX"
+let install_dir = "$INSTALL_DIR"
let ocamllib = "$OCAMLLIB"
let ocamlopt = "$OCAMLOPT"
let ocamlbuild = "$OCAMLBUILD"
@@ -752,6 +759,7 @@ EOF
cat >config.sh <<EOF
PREFIX="$PREFIX"
+INSTALL_DIR="$INSTALL_DIR"
OCAMLLIB="$OCAMLLIB"
OCAMLOPT="$OCAMLOPT"
OCAMLBUILD="$OCAMLBUILD"
View
@@ -206,7 +206,8 @@ cd $OPAGENERAL
SRCDIR=$OPAGENERAL
OPABOOK=$OPAGENERAL/doc/book # the tutorial and book
-./configure -prefix $INSTALLDIR -ocamlopt $OCAMLOPT -release -no-dbm
+# This is absolutely correct that the 2 variables are inversed, we should fix the value inside
+./configure -prefix $INSTALLDIR -install-dir $PREFIX -ocamlopt $OCAMLOPT -release -no-dbm
TARGETS="distrib"

0 comments on commit 6ba0a55

Please sign in to comment.