• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2
3# Verify that gnu-efi is installed in the object directory for our
4# firmware. If it isn't, build it.
5
6if [ $# -lt 2 ]; then
7cat <<EOF
8Usage: $0: <arch> <objdir>
9
10Check for gnu-efi libraries and header files in <objdir> and, if none
11exist, build and install them.
12
13  <arch>   - A gnu-efi \$ARCH argument, i.e. ia32, x86_64
14  <objdir> - The Syslinux object directory
15
16EOF
17    exit 1
18fi
19
20ARCH=$1
21objdir=$2
22
23if [ ! \( -f "$objdir/include/efi/$ARCH/efibind.h" -a -f "$objdir/lib/libefi.a" -a -f "$objdir/lib/libgnuefi.a" \) ]; then
24    # Build the external project with a clean make environment, as
25    # Syslinux disables built-in implicit rules.
26    export MAKEFLAGS=
27
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"
33
34	exit 1
35    fi
36else
37    printf "skip gnu-efi build/install\n"
38fi
39