common/autoconf/toolchain.m4

changeset 532
2795874efd16
parent 519
7d7dd520ebfd
child 542
6b93e7a4401d
     1.1 --- a/common/autoconf/toolchain.m4	Fri Dec 07 17:23:42 2012 +0100
     1.2 +++ b/common/autoconf/toolchain.m4	Tue Dec 11 11:29:58 2012 +0100
     1.3 @@ -114,13 +114,25 @@
     1.4  [
     1.5    COMPILER_NAME=$2
     1.6  
     1.7 -  # Do a first initial attempt at searching the list of compiler names.
     1.8 +  $1=
     1.9 +  # If TOOLS_DIR is set, check for all compiler names in there first
    1.10 +  # before checking the rest of the PATH.
    1.11 +  if test -n "$TOOLS_DIR"; then
    1.12 +    PATH_save="$PATH"
    1.13 +    PATH="$TOOLS_DIR"
    1.14 +    AC_PATH_PROGS(TOOLS_DIR_$1, $3)
    1.15 +    $1=$TOOLS_DIR_$1
    1.16 +    PATH="$PATH_save"
    1.17 +  fi
    1.18 +
    1.19    # AC_PATH_PROGS can't be run multiple times with the same variable,
    1.20    # so create a new name for this run.
    1.21 -  AC_PATH_PROGS(POTENTIAL_$1, $3)
    1.22 -  $1=$POTENTIAL_$1
    1.23 +  if test "x[$]$1" = x; then
    1.24 +    AC_PATH_PROGS(POTENTIAL_$1, $3)
    1.25 +    $1=$POTENTIAL_$1
    1.26 +  fi
    1.27  
    1.28 -  if test "x$[$]$1" = x; then
    1.29 +  if test "x[$]$1" = x; then
    1.30        HELP_MSG_MISSING_DEPENDENCY([devkit])
    1.31        AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG])
    1.32    fi

mercurial