File 0002-Adapt-build-system-to-use-imported-xen-headers.patch of Package grub2.4793

From b2fc9acdc9674de2b930ee92229917881843ba92 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Sun, 8 Nov 2015 21:24:18 +0100
Subject: [PATCH] Adapt build-system to use imported xen headers.

---
 conf/Makefile.common        | 3 ---
 grub-core/Makefile.core.def | 9 ---------
 include/grub/xen.h          | 7 ++++++-
 3 files changed, 6 insertions(+), 13 deletions(-)

Index: grub-2.02~beta2/conf/Makefile.common
===================================================================
--- grub-2.02~beta2.orig/conf/Makefile.common
+++ grub-2.02~beta2/conf/Makefile.common
@@ -26,9 +26,6 @@ if COND_powerpc_ieee1275
   CFLAGS_PLATFORM += -mcpu=powerpc
 endif
 
-#FIXME: discover and check XEN headers
-CPPFLAGS_XEN = -I/usr/include
-
 # Other options
 
 CPPFLAGS_DEFAULT = -DGRUB_FILE=\"$(subst $(srcdir)/,,$<)\"
Index: grub-2.02~beta2/grub-core/Makefile.core.def
===================================================================
--- grub-2.02~beta2.orig/grub-core/Makefile.core.def
+++ grub-2.02~beta2/grub-core/Makefile.core.def
@@ -59,9 +59,6 @@ kernel = {
   ia64_efi_ldflags = '-Wl,-r,-d';
   ia64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
 
-  x86_64_xen_cppflags	   = '$(CPPFLAGS_XEN)';
-  i386_xen_cppflags	   = '$(CPPFLAGS_XEN)';
-
   arm_efi_ldflags          = '-Wl,-r,-d';
   arm_efi_stripflags       = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
 
@@ -632,7 +629,6 @@ module = {
 module = {
   name = lsxen;
   common = commands/xen/lsxen.c;
-  cppflags = '$(CPPFLAGS_XEN)';
 
   enable = xen;
 };
@@ -851,7 +847,6 @@ module = {
   i386_coreboot = lib/i386/halt.c;
   i386_qemu = lib/i386/halt.c;
   xen = lib/xen/halt.c;
-  xen_cppflags = '$(CPPFLAGS_XEN)';
   efi = lib/efi/halt.c;
   ieee1275 = lib/ieee1275/halt.c;
   emu = lib/emu/halt.c;
@@ -872,7 +867,6 @@ module = {
   mips_loongson = lib/mips/loongson/reboot.c;
   mips_qemu_mips = lib/mips/qemu_mips/reboot.c;
   xen = lib/xen/reboot.c;
-  xen_cppflags = '$(CPPFLAGS_XEN)';
   uboot = lib/uboot/reboot.c;
   common = commands/reboot.c;
 };
@@ -1555,7 +1549,6 @@ module = {
   i386_xen = lib/i386/xen/relocator.S;
   x86_64_xen = lib/x86_64/xen/relocator.S;
   xen = lib/i386/relocator_common_c.c;
-  xen_cppflags = '$(CPPFLAGS_XEN)';
 
   extra_dist = lib/i386/relocator_common.S;
   extra_dist = kern/powerpc/cache_flush.S;
@@ -1576,7 +1569,6 @@ module = {
   sparc64_ieee1275 = lib/ieee1275/cmos.c;
   powerpc_ieee1275 = lib/ieee1275/cmos.c;
   xen = lib/xen/datetime.c;
-  xen_cppflags = '$(CPPFLAGS_XEN)';
 
   mips_arc = lib/arc/datetime.c;
   enable = noemu;
@@ -1679,7 +1671,6 @@ module = {
   name = linux;
   x86 = loader/i386/linux.c;
   xen = loader/i386/xen.c;
-  xen_cppflags	   = '$(CPPFLAGS_XEN)';
   i386_pc = lib/i386/pc/vesa_modes_table.c;
   mips = loader/mips/linux.c;
   powerpc_ieee1275 = loader/powerpc/ieee1275/linux.c;
Index: grub-2.02~beta2/include/grub/xen.h
===================================================================
--- grub-2.02~beta2.orig/include/grub/xen.h
+++ grub-2.02~beta2/include/grub/xen.h
@@ -31,7 +31,12 @@
 #include <grub/err.h>
 
 #ifndef GRUB_SYMBOL_GENERATOR
-#include <stdint.h>
+typedef grub_int8_t int8_t;
+typedef grub_int16_t int16_t;
+typedef grub_uint8_t uint8_t;
+typedef grub_uint16_t uint16_t;
+typedef grub_uint32_t uint32_t;
+typedef grub_uint64_t uint64_t;
 #include <xen/xen.h>
 
 #include <xen/sched.h>