From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: jordan.l.justen@intel.com) Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Wed, 10 Apr 2019 02:35:29 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2019 02:35:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,332,1549958400"; d="scan'208";a="222175347" Received: from askirtik-mobl1.amr.corp.intel.com (HELO jljusten-skl.amr.corp.intel.com) ([10.254.188.249]) by orsmga001.jf.intel.com with ESMTP; 10 Apr 2019 02:35:29 -0700 From: "Jordan Justen" To: devel@edk2.groups.io Cc: Laszlo Ersek , Ard Biesheuvel , Jordan Justen Subject: [PATCH 3/5] OvmfPkg/build.sh: Move automatic TARGET_TOOLS detection later Date: Wed, 10 Apr 2019 02:34:22 -0700 Message-Id: <20190410093424.20365-3-jordan.l.justen@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190410093424.20365-1-jordan.l.justen@intel.com> References: <20190410093424.20365-1-jordan.l.justen@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If we are building for a non-native ARM, then we may need to select a cross-compiler based on the -a paramter. Signed-off-by: Jordan Justen --- OvmfPkg/build.sh | 99 +++++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh index 217abae683..812441b9b1 100755 --- a/OvmfPkg/build.sh +++ b/OvmfPkg/build.sh @@ -40,58 +40,11 @@ ARCH_X64=no BUILDTARGET=DEBUG BUILD_OPTIONS= PLATFORMFILE= +TARGET_TOOLS= THREADNUMBER=1 LAST_ARG= RUN_QEMU=no -# -# Pick a default tool type for a given OS -# -TARGET_TOOLS=MYTOOLS -case `uname` in - CYGWIN*) - echo Cygwin not fully supported yet. - ;; - Darwin*) - Major=$(uname -r | cut -f 1 -d '.') - # Major is Darwin version, not OS X version. - # OS X Yosemite 10.10.2 returns 14. - case $Major in - [156789]) - echo OvmfPkg requires OS X Snow Leopard 10.6 or newer OS - exit 1 - ;; - 10) - TARGET_TOOLS=XCODE32 - ;; - 1[12]) - TARGET_TOOLS=XCLANG - ;; - *) - # Mavericks and future assume XCODE5 (clang + lldb) - TARGET_TOOLS=XCODE5 - ;; - esac - ;; - Linux*) - gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}') - case $gcc_version in - [1-3].*|4.[0-7].*) - echo OvmfPkg requires GCC4.8 or later - exit 1 - ;; - 4.8.*) - TARGET_TOOLS=GCC48 - ;; - 4.9.*|6.[0-2].*) - TARGET_TOOLS=GCC49 - ;; - *) - TARGET_TOOLS=GCC5 - ;; - esac -esac - # # Scan command line to override defaults # @@ -166,6 +119,56 @@ else BUILD_ROOT_ARCH=X64 fi +# +# Pick a default tool type for a given OS +# +if [ -z "$TARGET_TOOLS" ]; then + TARGET_TOOLS=MYTOOLS + case `uname` in + CYGWIN*) + echo Cygwin not fully supported yet. + ;; + Darwin*) + Major=$(uname -r | cut -f 1 -d '.') + # Major is Darwin version, not OS X version. + # OS X Yosemite 10.10.2 returns 14. + case $Major in + [156789]) + echo OvmfPkg requires OS X Snow Leopard 10.6 or newer OS + exit 1 + ;; + 10) + TARGET_TOOLS=XCODE32 + ;; + 1[12]) + TARGET_TOOLS=XCLANG + ;; + *) + # Mavericks and future assume XCODE5 (clang + lldb) + TARGET_TOOLS=XCODE5 + ;; + esac + ;; + Linux*) + gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}') + case $gcc_version in + [1-3].*|4.[0-7].*) + echo OvmfPkg requires GCC4.8 or later + exit 1 + ;; + 4.8.*) + TARGET_TOOLS=GCC48 + ;; + 4.9.*|6.[0-2].*) + TARGET_TOOLS=GCC49 + ;; + *) + TARGET_TOOLS=GCC5 + ;; + esac + esac +fi + case $PROCESSOR in IA32) if [ -n "$QEMU_COMMAND" ]; then -- 2.20.1