summaryrefslogtreecommitdiffstats
path: root/common/recipes-bsp/gummiboot/files/0002-configure.ac-Use-AC_CHECK_HEADER-to-detect-the-efi-i.patch
blob: 478eab822efc6a35a304c788d4022e1d8dbcc6cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From b4ad8b65a79e2cf8857439271c88bd44f5e9cd05 Mon Sep 17 00:00:00 2001
Message-Id: <b4ad8b65a79e2cf8857439271c88bd44f5e9cd05.1367382591.git.dvhart@linux.intel.com>
In-Reply-To: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com>
References: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com>
From: Darren Hart <dvhart@linux.intel.com>
Date: Tue, 30 Apr 2013 21:13:39 -0700
Subject: [PATCH 2/4] configure.ac: Use AC_CHECK_HEADER to detect the efi
 includes

While cross-compiling, AC_CHECK_FILE will abort the configure.

The gnu-efi sources don't use relative paths and require the user to
explicitly include -I/usr/include/efi/${ARCH}. I haven't found a way to
do this with AC_CHECK_HEADER. However, since the existing test was not
testing for usability (conftest.c compilation), we don't lose much by
just not looking for efi.h and assume it exists if we can find and use
efibind.h.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 configure.ac |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 524060c..f7c62ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,11 +75,12 @@ fi
 AM_CONDITIONAL(ENABLE_BIOSTEST, [test "x$enable_biostest" = "xyes"])
 
 # ------------------------------------------------------------------------------
-dnl Compile EFI stuff is so tricky that it's probably better to check for the
-dnl include files that try to use AC_CHECK_HEADERS to compile any conftest.c
-AC_CHECK_FILES([/usr/include/efi/efi.h
-                /usr/include/efi/${ARCH}/efibind.h], [],
-        [AC_MSG_ERROR([*** GNU Efi headers not found])])
+dnl GNU EFI doesn't use relative paths: efi.h includes efibind.h which is in
+dnl ${ARCH} relative to efi.h. I can't find a way to get AC_CHECK_HEADERS to
+dnl add -I/usr/include/efi/${ARCH} to the conftest.c build. So, just test for
+dnl efibind.h as the chances of efi.h not existing if it does are very low.
+AC_CHECK_HEADER(efi/${ARCH}/efibind.h, [],
+        [AC_MSG_ERROR([*** GNU EFI header efibind.h not found])])
 
 efiroot=$(echo $(cd /usr/lib/$(gcc -print-multi-os-directory); pwd))
 GNUEFI_LIBS="-L $efiroot"
-- 
1.7.5.4