From 3dd7ce1c26cac856039e1151720481c6ab1b43d1 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 31 Mar 2009 09:36:08 +0100 Subject: [PATCH] [efi] Allow building with non-system libbfd On Mac OS X, it is necessary to build binutils manually; the system does not provide bfd.h or the libbfd or libiberty libraries. Originally-fixed-by: Joshua Oreman --- src/Makefile | 2 ++ src/Makefile.housekeeping | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 1693b4ac..099762ce 100644 --- a/src/Makefile +++ b/src/Makefile @@ -42,6 +42,8 @@ ELF2EFI64 := ./util/elf2efi64 EFIROM := ./util/efirom ICCFIX := ./util/iccfix DOXYGEN := doxygen +BINUTILS_DIR := /usr +BFD_DIR := $(BINUTILS_DIR) ############################################################################### # diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index be36b36b..4f0a8bb3 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -793,16 +793,18 @@ CLEANUP += $(ZBIN) # # The EFI image converter # +ELF2EFI_CFLAGS := -I$(BINUTILS_DIR)/include -I$(BFD_DIR)/include \ + -idirafter include -L$(BINUTILS_DIR)/lib -L$(BFD_DIR)/lib \ + -lbfd -liberty -lz + $(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS) $(QM)$(ECHO) " [HOSTCC] $@" - $(Q)$(HOST_CC) -DMDE_CPU_IA32 -idirafter include -O2 \ - -o $@ $< -lbfd -liberty + $(Q)$(HOST_CC) $(ELF2EFI_CFLAGS) -DMDE_CPU_IA32 -O2 -o $@ $< CLEANUP += $(ELF2EFI32) $(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS) $(QM)$(ECHO) " [HOSTCC] $@" - $(Q)$(HOST_CC) -DMDE_CPU_X64 -idirafter include -O2 \ - -o $@ $< -lbfd -liberty + $(Q)$(HOST_CC) $(ELF2EFI_CFLAGS) -DMDE_CPU_X64 -O2 -o $@ $< CLEANUP += $(ELF2EFI64) $(EFIROM) : util/efirom.c $(MAKEDEPS)