From: Adeel Date: Fri, 8 Mar 2019 00:50:39 +0000 (-0800) Subject: Use DOTNET_${$1} environment variables X-Git-Tag: submit/tizen/20210909.063632~11030^2~2205^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=018c1dbdc3a0db165403a6dbeaf05a1fb9d5e0a2;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Use DOTNET_${$1} environment variables Commit migrated from https://github.com/dotnet/coreclr/commit/89dcb477d1fd1e772c8ce1558e103ee72af60c3b --- diff --git a/src/coreclr/src/pal/tools/gen-buildsys-gcc.sh b/src/coreclr/src/pal/tools/gen-buildsys-gcc.sh index 9cee893..7aba64c 100755 --- a/src/coreclr/src/pal/tools/gen-buildsys-gcc.sh +++ b/src/coreclr/src/pal/tools/gen-buildsys-gcc.sh @@ -9,8 +9,8 @@ then echo "gen-buildsys-gcc.sh [build flavor] [coverage] [ninja] [cmakeargs]" echo "Specify the path to the top level CMake file - /src/NDP" echo "Specify the Gcc version to use, split into major and minor version" - echo "Specify the target architecture." - echo "Optionally specify the build configuration (flavor.) Defaults to DEBUG." + echo "Specify the target architecture." + echo "Optionally specify the build configuration (flavor.) Defaults to DEBUG." echo "Optionally specify 'coverage' to enable code coverage build." echo "Target ninja instead of make. ninja must be on the PATH." echo "Pass additional arguments to CMake call." @@ -45,15 +45,21 @@ else exit 1 fi -if [ -z "$CC" ]; then +if [ -z "$DOTNET_CC" ]; then CC="$(command -v "${gcc_prefix}"gcc"$desired_gcc_version")" export CC +else + CC="$DOTNET_CC" fi -if [ -z "$CXX" ]; then + +if [ -z "$DOTNET_CXX" ]; then CXX="$(command -v "${gcc_prefix}g++$desired_gcc_version")" - export CXX +else + CXX="$DOTNET_CXX" fi +export CC CXX + build_arch="$4" buildtype=DEBUG code_coverage=OFF @@ -85,6 +91,12 @@ done OS=$(uname) locate_gcc_exec() { + ENV_KNOB="DOTNET_$(echo "$1" | tr '[:lower:]' '[:upper:]')" + if [ -n $(eval "\$$ENV_KNOB") ]; then + $(eval "\$$ENV_KNOB") + return + fi + if command -v "$gcc_prefix$1$desired_gcc_version" > /dev/null 2>&1 then command -v "$gcc_prefix$1$desired_gcc_version"