From a9bc5804d009638e40dbb9c08134c8030e4e63ca Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 12 Dec 2006 16:50:41 +0000 Subject: [PATCH] Update configure script for BBv2 [SVN r36350] --- configure | 82 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 15 deletions(-) diff --git a/configure b/configure index df0f91b770..359fb4566c 100755 --- a/configure +++ b/configure @@ -66,6 +66,10 @@ do ICU_ROOT=`expr "x$option" : "x-*with-icu=\(.*\)"` ;; + -without-icu | --without-icu ) + flag_icu=no + ;; + -with-libraries=* | --with-libraries=* ) library_list=`expr "x$option" : "x-*with-libraries=\(.*\)"` if test "$library_list" != "all"; then @@ -150,9 +154,12 @@ Configuration: library names or "all" [all] --without-libraries=list build all libraries except the ones listed [] - --with-icu enable Unicode/ICU support in Regex [disabled] + --with-icu enable Unicode/ICU support in Regex + [automatically detected] + --without-icu disable Unicode/ICU support in Regex --with-icu=DIR specify the root of the ICU library installation - and enable Unicode/ICU support in Regex [disabled] + and enable Unicode/ICU support in Regex + [automatically detected] --with-python=PYTHON specify the Python executable [python] --with-python-root=DIR specify the root of the Python installation [automatically detected] @@ -228,6 +235,13 @@ if test "x$INCLUDEDIR" = x; then fi # Find Python +if test "x$flag_no_python" = x; then + result=`$PYTHON -c "exit" > /dev/null 2>&1` + if [ "$?" -ne "0" ]; then + flag_no_python=yes + fi +fi + if test "x$flag_no_python" = x; then if test "x$PYTHON_VERSION" = x; then echo -n "Detecting Python version... " @@ -240,31 +254,69 @@ if test "x$flag_no_python" = x; then PYTHON_ROOT=`$PYTHON -c "import sys; print sys.prefix"` echo $PYTHON_ROOT fi - - BJAM_CONFIG="$BJAM_CONFIG -sPYTHON_ROOT=$PYTHON_ROOT -sPYTHON_VERSION=$PYTHON_VERSION" fi # Configure ICU echo -n "Unicode/ICU support for Boost.Regex?... " -if test "x$flag_icu" = xyes; then +if test "x$flag_icu" != xno; then if test "x$ICU_ROOT" = x; then - BJAM_CONFIG="$BJAM_CONFIG -sHAVE_ICU=1" - echo "yes." + COMMON_ICU_PATHS="/usr /usr/local /sw" + for p in $COMMON_ICU_PATHS; do + if test -r $p/include/unicode/utypes.h; then + ICU_ROOT=$p + fi + done + + if test "x$ICU_ROOT" = x; then + echo "not found." + else + BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT" + echo "$ICU_ROOT" + fi else BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT" echo "$ICU_ROOT" fi else - echo "no." + echo "disabled." fi +# Backup the user's existing user-config.jam +JAM_CONFIG_OUT="$HOME/user-config.jam" +if test -r "$HOME/user-config.jam"; then + counter=1 + + while test -r "$HOME/user-config.jam.$counter"; do + counter=`expr $counter + 1` + done + echo "Backing up existing Boost.Build configuration in $HOME/user-config.jam.$counter" + mv "$HOME/user-config.jam" "$HOME/user-config.jam.$counter" +fi + +# Generate user-config.jam +echo "Generating Boost.Build configuration in $HOME/user-config.jam..." +cat > $HOME/user-config.jam <> $HOME/user-config.jam < Makefile <