diff --git a/install.sh b/install.sh
index 9791799..09acd91 100755
--- a/install.sh
+++ b/install.sh
@@ -31,9 +31,9 @@ cd ${CANONICAL_SOURCE%/*}
 # Environment variables
 #
 
-export CC_TYPE=${CC_TYPE:-gcc}
-export CC=${CC:-$CC_TYPE}
-export CXX=${CXX:-g++}
+# export CC_TYPE=${CC_TYPE:-gcc}
+# export CC=${CC:-$CC_TYPE}
+# export CXX=${CXX:-g++}
 export LIBERTY_HOME=$(pwd)
 export TARGET=${TARGET:-$LIBERTY_HOME/target}
 export TMPDIR=${TMPDIR:-$TARGET/tmp}
@@ -77,7 +77,7 @@ int main() {
    exit(0);
 }
 EOF
-    gcc -lgc $TMPDIR/check_libgc.c -o $TMPDIR/check_libgc >/dev/null 2>&1 || return 1
+    ${CC} -lgc $TMPDIR/check_libgc.c -o $TMPDIR/check_libgc >/dev/null 2>&1 || return 1
     if $TMPDIR/check_libgc; then
         return 0
     else
@@ -193,98 +193,98 @@ x_int: extract_internals
 [boost]
 c_compiler_type: $CC_TYPE
 c_compiler_path: $CC
-c_compiler_options: -pipe -O2
+c_compiler_options: -O2 ${CFLAGS}
 c_linker_path: $CC
-c_linker_options: -Xlinker -${hyphen}no-as-needed
-cpp_compiler_type: g++
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
 cpp_compiler_path: $CXX
-cpp_compiler_options: -pipe -O2
+cpp_compiler_options: -O2 ${CXXFLAGS}
 cpp_linker_path: $CC
-cpp_linker_options: -Xlinker -${hyphen}no-as-needed
+cpp_linker_options: ${LDFLAGS}
 
 [no_check]
 c_compiler_type: $CC_TYPE
 c_compiler_path: $CC
-c_compiler_options: -pipe -O1
+c_compiler_options: -O1 ${CFLAGS}
 c_linker_path: $CC
-c_linker_options: -Xlinker -${hyphen}no-as-needed
-cpp_compiler_type: g++
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
 cpp_compiler_path: $CXX
-cpp_compiler_options: -pipe -O1
+cpp_compiler_options: -O1 ${CXXFLAGS}
 cpp_linker_path: $CC
-cpp_linker_options: -Xlinker -${hyphen}no-as-needed
+cpp_linker_options: ${LDFLAGS}
 
 [require_check]
 c_compiler_type: $CC_TYPE
 c_compiler_path: $CC
-c_compiler_options: -pipe -O1
+c_compiler_options: -O1 ${CFLAGS}
 c_linker_path: $CC
-c_linker_options: -Xlinker -${hyphen}no-as-needed
-cpp_compiler_type: g++
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
 cpp_compiler_path: $CXX
-cpp_compiler_options: -pipe
+cpp_compiler_options: ${CXXFLAGS}
 cpp_linker_path: $CC
-cpp_linker_options: -Xlinker -${hyphen}no-as-needed
+cpp_linker_options: ${LDFLAGS}
 
 [ensure_check]
 c_compiler_type: $CC_TYPE
 c_compiler_path: $CC
-c_compiler_options: -pipe -O1
+c_compiler_options: -O1 ${CFLAGS}
 c_linker_path: $CC
-c_linker_options: -Xlinker -${hyphen}no-as-needed
-cpp_compiler_type: g++
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
 cpp_compiler_path: $CXX
-cpp_compiler_options: -pipe
+cpp_compiler_options: ${CXXFLAGS}
 cpp_linker_path: $CC
-cpp_linker_options: -Xlinker -${hyphen}no-as-needed
+cpp_linker_options: ${LDFLAGS}
 
 [invariant_check]
 c_compiler_type: $CC_TYPE
 c_compiler_path: $CC
-c_compiler_options: -pipe -O1
+c_compiler_options: -O1 ${CFLAGS}
 c_linker_path: $CC
-c_linker_options: -Xlinker -${hyphen}no-as-needed
-cpp_compiler_type: g++
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
 cpp_compiler_path: $CXX
-cpp_compiler_options: -pipe
+cpp_compiler_options: ${CXXFLAGS}
 cpp_linker_path: $CC
-cpp_linker_options: -Xlinker -${hyphen}no-as-needed
+cpp_linker_options: ${LDFLAGS}
 
 [loop_check]
 c_compiler_type: $CC_TYPE
 c_compiler_path: $CC
-c_compiler_options: -pipe -O1
+c_compiler_options: -O1 ${CFLAGS}
 c_linker_path: $CC
-c_linker_options: -Xlinker -${hyphen}no-as-needed
-cpp_compiler_type: g++
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
 cpp_compiler_path: $CXX
-cpp_compiler_options: -pipe
+cpp_compiler_options: ${CXXFLAGS}
 cpp_linker_path: $CC
-cpp_linker_options: -Xlinker -${hyphen}no-as-needed
+cpp_linker_options: ${LDFLAGS}
 
 [all_check]
 c_compiler_type: $CC_TYPE
 c_compiler_path: $CC
-c_compiler_options: -pipe -O1
+c_compiler_options: -O1 ${CFLAGS}
 c_linker_path: $CC
-c_linker_options: -Xlinker -${hyphen}no-as-needed
-cpp_compiler_type: g++
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
 cpp_compiler_path: $CXX
-cpp_compiler_options: -pipe
+cpp_compiler_options: ${CXXFLAGS}
 cpp_linker_path: $CC
-cpp_linker_options: -Xlinker -${hyphen}no-as-needed
+cpp_linker_options: ${LDFLAGS}
 
 [debug_check]
 c_compiler_type: $CC_TYPE
 c_compiler_path: $CC
-c_compiler_options: -pipe -g -O1
+c_compiler_options: -g -O1 ${CFLAGS}
 c_linker_path: $CC
-c_linker_options: -Xlinker -${hyphen}no-as-needed
-cpp_compiler_type: g++
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
 cpp_compiler_path: $CXX
-cpp_compiler_options: -pipe -g
+cpp_compiler_options: -g ${CXXFLAGS}
 cpp_linker_path: $CC
-cpp_linker_options: -Xlinker -${hyphen}no-as-needed
+cpp_linker_options: ${LDFLAGS}
 smarteiffel_options: -no_strip
 
 EOF
@@ -582,10 +582,10 @@ do_pkg_tools() {
 bin: /usr/lib/liberty-eiffel/bin
 sys: /usr/share/liberty-eiffel/sys
 short: /usr/share/liberty-eiffel/short
-os: UNIX
-flavor: Linux
+os: ${OS}
+flavor: ${flavor}
 tag: 3
-jobs: 2
+jobs: ${jobs}
 
 [Environment]
 hyphen: -
@@ -608,68 +608,68 @@ wrap: wrappers_generator
 x_int: extract_internals
 
 [boost]
-c_compiler_type: gcc
-c_compiler_options: -pipe -O2
-c_linker_options: -Xlinker -\${hyphen}no-as-needed
-cpp_compiler_type: g++
-cpp_compiler_options: -pipe -O2
-cpp_linker_options: -Xlinker -\${hyphen}no-as-needed
+c_compiler_type: ${CC_TYPE}
+c_compiler_options: ${CFLAGS} -O2
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
+cpp_compiler_options: ${CXXFLAGS} -O2
+cpp_linker_options: ${LDFLAGS}
 
 [no_check]
-c_compiler_type: gcc
-c_compiler_options: -pipe -O1
-c_linker_options: -Xlinker -\${hyphen}no-as-needed
-cpp_compiler_type: g++
-cpp_compiler_options: -pipe -O1
-cpp_linker_options: -Xlinker -\${hyphen}no-as-needed
+c_compiler_type: ${CC_TYPE}
+c_compiler_options: ${CFLAGS} -O1
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
+cpp_compiler_options: ${CXXFLAGS} -O1
+cpp_linker_options: ${LDFLAGS}
 
 [require_check]
-c_compiler_type: gcc
-c_compiler_options: -pipe
-c_linker_options: -Xlinker -\${hyphen}no-as-needed
-cpp_compiler_type: g++
-cpp_compiler_options: -pipe
-cpp_linker_options: -Xlinker -\${hyphen}no-as-needed
+c_compiler_type: ${CC_TYPE}
+c_compiler_options: ${CFLAGS}
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
+cpp_compiler_options: ${CXXFLAGS}
+cpp_linker_options: ${LDFLAGS}
 
 [ensure_check]
-c_compiler_type: gcc
-c_compiler_options: -pipe
-c_linker_options: -Xlinker -\${hyphen}no-as-needed
-cpp_compiler_type: g++
-cpp_compiler_options: -pipe
-cpp_linker_options: -Xlinker -\${hyphen}no-as-needed
+c_compiler_type: ${CC_TYPE}
+c_compiler_options: ${CFLAGS}
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
+cpp_compiler_options: ${CXXFLAGS}
+cpp_linker_options: ${LDFLAGS}
 
 [invariant_check]
-c_compiler_type: gcc
-c_compiler_options: -pipe
-c_linker_options: -Xlinker -\${hyphen}no-as-needed
-cpp_compiler_type: g++
-cpp_compiler_options: -pipe
-cpp_linker_options: -Xlinker -\${hyphen}no-as-needed
+c_compiler_type: ${CC_TYPE}
+c_compiler_options: ${CFLAGS}
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
+cpp_compiler_options: ${CXXFLAGS}
+cpp_linker_options: ${LDFLAGS}
 
 [loop_check]
-c_compiler_type: gcc
-c_compiler_options: -pipe
-c_linker_options: -Xlinker -\${hyphen}no-as-needed
-cpp_compiler_type: g++
-cpp_compiler_options: -pipe
-cpp_linker_options: -Xlinker -\${hyphen}no-as-needed
+c_compiler_type: ${CC_TYPE}
+c_compiler_options: ${CFLAGS}
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
+cpp_compiler_options: ${CXXFLAGS}
+cpp_linker_options: ${LDFLAGS}
 
 [all_check]
-c_compiler_type: gcc
-c_compiler_options: -pipe
-c_linker_options: -Xlinker -\${hyphen}no-as-needed
-cpp_compiler_type: g++
-cpp_compiler_options: -pipe
-cpp_linker_options: -Xlinker -\${hyphen}no-as-needed
+c_compiler_type: ${CC_TYPE}
+c_compiler_options: ${CFLAGS}
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
+cpp_compiler_options: ${CXXFLAGS}
+cpp_linker_options: ${LDFLAGS}
 
 [debug_check]
-c_compiler_type: gcc
-c_compiler_options: -pipe -g
-c_linker_options: -Xlinker -\${hyphen}no-as-needed
-cpp_compiler_type: g++
-cpp_compiler_options: -pipe -g
-cpp_linker_options: -Xlinker -\${hyphen}no-as-needed
+c_compiler_type: ${CC_TYPE}
+c_compiler_options: ${CFLAGS} -g
+c_linker_options: ${LDFLAGS}
+cpp_compiler_type: ${CXX_TYPE}
+cpp_compiler_options: ${CXXFLAGS} -g
+cpp_linker_options: ${LDFLAGS}
 smarteiffel_options: -no_strip
 
 EOF
diff --git a/work/tools.sh b/work/tools.sh
index 7ce6d58..776e4c3 100755
--- a/work/tools.sh
+++ b/work/tools.sh
@@ -8,14 +8,35 @@ case `uname -s` in
 	flavor=generic
 	OS=Cygwin
 	EXE_SUFFIX=".exe"
+	CC_TYPE=${CC_TYPE:-gcc}
+	CC=${CC:-$CC_TYPE}
+	CFLAGS="-fno-gcse -pipe"
+	CXX_TYPE=${CXX_TYPE:-g++}
+	CXX=${CXX:-${CXX_TYPE}}
+	CXXFLAGS="-fno-gcse -pipe"
+	LDFLAGS="-Xlinker --no-as-needed"
 	;;
     Linux)
 	flavor=Linux
 	jobs=$((1 + $(grep '^processor' /proc/cpuinfo|wc -l)))
+	CC_TYPE=${CC_TYPE:-gcc}
+	CC=${CC:-$CC_TYPE}
+	CFLAGS="-fno-gcse -pipe"
+	CXX_TYPE=${CXX_TYPE:-g++}
+	CXX=${CXX:-${CXX_TYPE}}
+	CXXFLAGS="-fno-gcse -pipe"
+	LDFLAGS="-Xlinker --no-as-needed"
 	;;
     Darwin)
 	flavor=Darwin
-	jobs=$((1 + $(sysctl -n machdep.cpu.core_count)))
+	jobs=$((1 + $(sysctl -n hw.physicalcpu)))
+	CC_TYPE=${CC_TYPE:-gcc}
+	CC=${CC:-$CC_TYPE}
+	CFLAGS="-pipe"
+	CXX_TYPE=${CXX_TYPE:-g++}
+	CXX=${CXX:-${CXX_TYPE}}
+	CXXFLAGS="-pipe"
+	LDFLAGS=""
 	;;
     *)
 	flavor=uknown
