Tue, 11 Dec 2012 11:29:58 +0100
8003945: build-infra: problems finding compiler when using --with-dev-kit
Summary: Search all compiler names in dev-kit dir first.
Reviewed-by: tbell
common/autoconf/generated-configure.sh | file | annotate | diff | comparison | revisions | |
common/autoconf/toolchain.m4 | file | annotate | diff | comparison | revisions |
1.1 --- a/common/autoconf/generated-configure.sh Fri Dec 07 17:23:42 2012 +0100 1.2 +++ b/common/autoconf/generated-configure.sh Tue Dec 11 11:29:58 2012 +0100 1.3 @@ -708,6 +708,7 @@ 1.4 ac_ct_PROPER_COMPILER_CXX 1.5 PROPER_COMPILER_CXX 1.6 POTENTIAL_CXX 1.7 +TOOLS_DIR_CXX 1.8 OBJEXT 1.9 EXEEXT 1.10 ac_ct_CC 1.11 @@ -718,6 +719,7 @@ 1.12 ac_ct_PROPER_COMPILER_CC 1.13 PROPER_COMPILER_CC 1.14 POTENTIAL_CC 1.15 +TOOLS_DIR_CC 1.16 BUILD_LD 1.17 BUILD_CXX 1.18 BUILD_CC 1.19 @@ -3672,7 +3674,7 @@ 1.20 #CUSTOM_AUTOCONF_INCLUDE 1.21 1.22 # Do not change or remove the following line, it is needed for consistency checks: 1.23 -DATE_WHEN_GENERATED=1354721616 1.24 +DATE_WHEN_GENERATED=1355221697 1.25 1.26 ############################################################################### 1.27 # 1.28 @@ -17786,10 +17788,65 @@ 1.29 1.30 COMPILER_NAME=C 1.31 1.32 - # Do a first initial attempt at searching the list of compiler names. 1.33 + CC= 1.34 + # If TOOLS_DIR is set, check for all compiler names in there first 1.35 + # before checking the rest of the PATH. 1.36 + if test -n "$TOOLS_DIR"; then 1.37 + PATH_save="$PATH" 1.38 + PATH="$TOOLS_DIR" 1.39 + for ac_prog in $COMPILER_CHECK_LIST 1.40 +do 1.41 + # Extract the first word of "$ac_prog", so it can be a program name with args. 1.42 +set dummy $ac_prog; ac_word=$2 1.43 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 1.44 +$as_echo_n "checking for $ac_word... " >&6; } 1.45 +if test "${ac_cv_path_TOOLS_DIR_CC+set}" = set; then : 1.46 + $as_echo_n "(cached) " >&6 1.47 +else 1.48 + case $TOOLS_DIR_CC in 1.49 + [\\/]* | ?:[\\/]*) 1.50 + ac_cv_path_TOOLS_DIR_CC="$TOOLS_DIR_CC" # Let the user override the test with a path. 1.51 + ;; 1.52 + *) 1.53 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1.54 +for as_dir in $PATH 1.55 +do 1.56 + IFS=$as_save_IFS 1.57 + test -z "$as_dir" && as_dir=. 1.58 + for ac_exec_ext in '' $ac_executable_extensions; do 1.59 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then 1.60 + ac_cv_path_TOOLS_DIR_CC="$as_dir/$ac_word$ac_exec_ext" 1.61 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 1.62 + break 2 1.63 + fi 1.64 +done 1.65 + done 1.66 +IFS=$as_save_IFS 1.67 + 1.68 + ;; 1.69 +esac 1.70 +fi 1.71 +TOOLS_DIR_CC=$ac_cv_path_TOOLS_DIR_CC 1.72 +if test -n "$TOOLS_DIR_CC"; then 1.73 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLS_DIR_CC" >&5 1.74 +$as_echo "$TOOLS_DIR_CC" >&6; } 1.75 +else 1.76 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 1.77 +$as_echo "no" >&6; } 1.78 +fi 1.79 + 1.80 + 1.81 + test -n "$TOOLS_DIR_CC" && break 1.82 +done 1.83 + 1.84 + CC=$TOOLS_DIR_CC 1.85 + PATH="$PATH_save" 1.86 + fi 1.87 + 1.88 # AC_PATH_PROGS can't be run multiple times with the same variable, 1.89 # so create a new name for this run. 1.90 - for ac_prog in $COMPILER_CHECK_LIST 1.91 + if test "x$CC" = x; then 1.92 + for ac_prog in $COMPILER_CHECK_LIST 1.93 do 1.94 # Extract the first word of "$ac_prog", so it can be a program name with args. 1.95 set dummy $ac_prog; ac_word=$2 1.96 @@ -17834,9 +17891,10 @@ 1.97 test -n "$POTENTIAL_CC" && break 1.98 done 1.99 1.100 - CC=$POTENTIAL_CC 1.101 - 1.102 - if test "x$$CC" = x; then 1.103 + CC=$POTENTIAL_CC 1.104 + fi 1.105 + 1.106 + if test "x$CC" = x; then 1.107 1.108 # Print a helpful message on how to acquire the necessary build dependency. 1.109 # devkit is the help tag: freetyp2, cups, pulse, alsa etc 1.110 @@ -19277,10 +19335,65 @@ 1.111 1.112 COMPILER_NAME=C++ 1.113 1.114 - # Do a first initial attempt at searching the list of compiler names. 1.115 + CXX= 1.116 + # If TOOLS_DIR is set, check for all compiler names in there first 1.117 + # before checking the rest of the PATH. 1.118 + if test -n "$TOOLS_DIR"; then 1.119 + PATH_save="$PATH" 1.120 + PATH="$TOOLS_DIR" 1.121 + for ac_prog in $COMPILER_CHECK_LIST 1.122 +do 1.123 + # Extract the first word of "$ac_prog", so it can be a program name with args. 1.124 +set dummy $ac_prog; ac_word=$2 1.125 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 1.126 +$as_echo_n "checking for $ac_word... " >&6; } 1.127 +if test "${ac_cv_path_TOOLS_DIR_CXX+set}" = set; then : 1.128 + $as_echo_n "(cached) " >&6 1.129 +else 1.130 + case $TOOLS_DIR_CXX in 1.131 + [\\/]* | ?:[\\/]*) 1.132 + ac_cv_path_TOOLS_DIR_CXX="$TOOLS_DIR_CXX" # Let the user override the test with a path. 1.133 + ;; 1.134 + *) 1.135 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1.136 +for as_dir in $PATH 1.137 +do 1.138 + IFS=$as_save_IFS 1.139 + test -z "$as_dir" && as_dir=. 1.140 + for ac_exec_ext in '' $ac_executable_extensions; do 1.141 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then 1.142 + ac_cv_path_TOOLS_DIR_CXX="$as_dir/$ac_word$ac_exec_ext" 1.143 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 1.144 + break 2 1.145 + fi 1.146 +done 1.147 + done 1.148 +IFS=$as_save_IFS 1.149 + 1.150 + ;; 1.151 +esac 1.152 +fi 1.153 +TOOLS_DIR_CXX=$ac_cv_path_TOOLS_DIR_CXX 1.154 +if test -n "$TOOLS_DIR_CXX"; then 1.155 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLS_DIR_CXX" >&5 1.156 +$as_echo "$TOOLS_DIR_CXX" >&6; } 1.157 +else 1.158 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 1.159 +$as_echo "no" >&6; } 1.160 +fi 1.161 + 1.162 + 1.163 + test -n "$TOOLS_DIR_CXX" && break 1.164 +done 1.165 + 1.166 + CXX=$TOOLS_DIR_CXX 1.167 + PATH="$PATH_save" 1.168 + fi 1.169 + 1.170 # AC_PATH_PROGS can't be run multiple times with the same variable, 1.171 # so create a new name for this run. 1.172 - for ac_prog in $COMPILER_CHECK_LIST 1.173 + if test "x$CXX" = x; then 1.174 + for ac_prog in $COMPILER_CHECK_LIST 1.175 do 1.176 # Extract the first word of "$ac_prog", so it can be a program name with args. 1.177 set dummy $ac_prog; ac_word=$2 1.178 @@ -19325,9 +19438,10 @@ 1.179 test -n "$POTENTIAL_CXX" && break 1.180 done 1.181 1.182 - CXX=$POTENTIAL_CXX 1.183 - 1.184 - if test "x$$CXX" = x; then 1.185 + CXX=$POTENTIAL_CXX 1.186 + fi 1.187 + 1.188 + if test "x$CXX" = x; then 1.189 1.190 # Print a helpful message on how to acquire the necessary build dependency. 1.191 # devkit is the help tag: freetyp2, cups, pulse, alsa etc
2.1 --- a/common/autoconf/toolchain.m4 Fri Dec 07 17:23:42 2012 +0100 2.2 +++ b/common/autoconf/toolchain.m4 Tue Dec 11 11:29:58 2012 +0100 2.3 @@ -114,13 +114,25 @@ 2.4 [ 2.5 COMPILER_NAME=$2 2.6 2.7 - # Do a first initial attempt at searching the list of compiler names. 2.8 + $1= 2.9 + # If TOOLS_DIR is set, check for all compiler names in there first 2.10 + # before checking the rest of the PATH. 2.11 + if test -n "$TOOLS_DIR"; then 2.12 + PATH_save="$PATH" 2.13 + PATH="$TOOLS_DIR" 2.14 + AC_PATH_PROGS(TOOLS_DIR_$1, $3) 2.15 + $1=$TOOLS_DIR_$1 2.16 + PATH="$PATH_save" 2.17 + fi 2.18 + 2.19 # AC_PATH_PROGS can't be run multiple times with the same variable, 2.20 # so create a new name for this run. 2.21 - AC_PATH_PROGS(POTENTIAL_$1, $3) 2.22 - $1=$POTENTIAL_$1 2.23 + if test "x[$]$1" = x; then 2.24 + AC_PATH_PROGS(POTENTIAL_$1, $3) 2.25 + $1=$POTENTIAL_$1 2.26 + fi 2.27 2.28 - if test "x$[$]$1" = x; then 2.29 + if test "x[$]$1" = x; then 2.30 HELP_MSG_MISSING_DEPENDENCY([devkit]) 2.31 AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) 2.32 fi