Adding upstream version 6.03~pre1+dfsg.
[syslinux-debian/hramrach.git] / efi / check-gnu-efi.sh
blobfcf5fd495a527fc2f457b97e4c9d7dc778f21f09
1 #!/bin/sh
3 # Verify that gnu-efi is installed in the object directory for our
4 # firmware. If it isn't, build it.
6 if [ $# -lt 3 ]; then
7 cat <<EOF
8 Usage: $0: <arch> <srcdir> <objdir>
10 Check for gnu-efi libraries and header files in <objdir> and, if none
11 exist, build and install them.
13 <arch> - A gnu-efi \$ARCH argument, i.e. ia32, x86_64
14 <srcdir> - The top-level directory of the Syslinux source
15 <objdir> - The Syslinux object directory
17 EOF
18 exit 1
21 ARCH=$1
22 srcdir=`realpath $2`
23 objdir=`realpath $3`
25 if [ ! -f $objdir/include/efi/$ARCH/efibind.h ]; then
26 # Build the external project with a clean make environment, as
27 # Syslinux disables built-in implicit rules.
28 export MAKEFLAGS=
30 build=$srcdir/efi/build-gnu-efi.sh
31 $build $ARCH $srcdir $objdir &> /dev/null
32 if [ $? -ne 0 ]; then
33 printf "Failed to build gnu-efi. "
34 printf "Execute the following command for full details: \n\n"
35 printf "$build $ARCH $srcdir $objdir\n\n"
37 exit 1