From: "Jordan Justen" <jordan.l.justen@intel.com>
To: devel@edk2.groups.io
Cc: Laszlo Ersek <lersek@redhat.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Jordan Justen <jordan.l.justen@intel.com>
Subject: [PATCH 3/5] OvmfPkg/build.sh: Move automatic TARGET_TOOLS detection later
Date: Wed, 10 Apr 2019 02:34:22 -0700 [thread overview]
Message-ID: <20190410093424.20365-3-jordan.l.justen@intel.com> (raw)
In-Reply-To: <20190410093424.20365-1-jordan.l.justen@intel.com>
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 <jordan.l.justen@intel.com>
---
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
next prev parent reply other threads:[~2019-04-10 9:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-10 9:34 [PATCH 1/5] OvmfPkg/build.sh: Require QEMU 1.6 or newer and always enable flash Jordan Justen
2019-04-10 9:34 ` [PATCH 2/5] OvmfPkg/build.sh: Don't automatically -hda qemu parameter Jordan Justen
2019-04-10 9:34 ` Jordan Justen [this message]
2019-04-10 15:37 ` [edk2-devel] [PATCH 3/5] OvmfPkg/build.sh: Move automatic TARGET_TOOLS detection later Philippe Mathieu-Daudé
2019-04-10 19:56 ` Jordan Justen
2019-04-10 9:34 ` [PATCH 4/5] OvmfPkg/build.sh: Add AARCH64/ARM build and qemu support Jordan Justen
2019-04-10 9:34 ` [PATCH 5/5] OvmfPkg/build.sh: Add a cross compiler prefix for AARCH64/ARM Jordan Justen
2019-04-10 14:16 ` [edk2-devel] [PATCH 1/5] OvmfPkg/build.sh: Require QEMU 1.6 or newer and always enable flash Laszlo Ersek
2019-04-10 20:18 ` Jordan Justen
2019-04-11 7:48 ` Laszlo Ersek
2019-04-10 14:45 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190410093424.20365-3-jordan.l.justen@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox