check-gnu-efi: remove bashism
[syslinux/sherbszt.git] / efi / check-gnu-efi.sh
blobe16e20a1fc3d46db9b4e9774b6fe2f2308ef25fa
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 2 ]; then
7 cat <<EOF
8 Usage: $0: <arch> <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 <objdir> - The Syslinux object directory
16 EOF
17 exit 1
20 ARCH=$1
21 objdir=$2
23 if [ ! -f $objdir/include/efi/$ARCH/efibind.h ]; then
24 # Build the external project with a clean make environment, as
25 # Syslinux disables built-in implicit rules.
26 export MAKEFLAGS=
28 ../../efi/build-gnu-efi.sh $ARCH $objdir > /dev/null 2>&1
29 if [ $? -ne 0 ]; then
30 printf "Failed to build gnu-efi. "
31 printf "Execute the following command for full details: \n\n"
32 printf "build-gnu-efi.sh $ARCH $objdir\n\n"
34 exit 1