From 5fdc1882a63dd1e34ad852f9bfc1964c511e5bfb Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Wed, 21 Dec 2022 12:31:08 +0200 Subject: [PATCH] Remove bash dependency from init-compiler.sh (#77304) --- eng/common/native/init-compiler.sh | 81 +++++++++---------- eng/native/gen-buildsys.sh | 2 +- eng/testing/tests.singlefile.targets | 24 +++++- .../Microsoft.NETCore.Native.Unix.targets | 6 +- .../tools/aot/crossgen2/crossgen2.csproj | 17 +++- .../NativeExports/NativeExports.csproj | 4 +- src/mono/mono.proj | 2 +- .../local_build.sh | 27 ++++--- 8 files changed, 98 insertions(+), 65 deletions(-) diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 292ebb6535868..c670cb7968921 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -1,30 +1,25 @@ -#!/usr/bin/env bash +#!/bin/sh # # This file detects the C/C++ compiler and exports it to the CC/CXX environment variables # # NOTE: some scripts source this file and rely on stdout being empty, make sure to not output anything here! -if [[ "$#" -lt 3 ]]; then +if [ -z "$build_arch" ] || [ -z "$compiler" ]; then echo "Usage..." - echo "init-compiler.sh