浏览代码

[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 <oremanj@rwcr.net>
tags/v0.9.8
Michael Brown 15 年前
父节点
当前提交
3dd7ce1c26
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 2
    0
      src/Makefile
  2. 6
    4
      src/Makefile.housekeeping

+ 2
- 0
src/Makefile 查看文件

@@ -42,6 +42,8 @@ ELF2EFI64	:= ./util/elf2efi64
42 42
 EFIROM		:= ./util/efirom
43 43
 ICCFIX		:= ./util/iccfix
44 44
 DOXYGEN		:= doxygen
45
+BINUTILS_DIR	:= /usr
46
+BFD_DIR		:= $(BINUTILS_DIR)
45 47
 
46 48
 ###############################################################################
47 49
 #

+ 6
- 4
src/Makefile.housekeeping 查看文件

@@ -793,16 +793,18 @@ CLEANUP += $(ZBIN)
793 793
 #
794 794
 # The EFI image converter
795 795
 #
796
+ELF2EFI_CFLAGS	:= -I$(BINUTILS_DIR)/include -I$(BFD_DIR)/include \
797
+		   -idirafter include -L$(BINUTILS_DIR)/lib -L$(BFD_DIR)/lib \
798
+		   -lbfd -liberty -lz
799
+
796 800
 $(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
797 801
 	$(QM)$(ECHO) "  [HOSTCC] $@"
798
-	$(Q)$(HOST_CC) -DMDE_CPU_IA32 -idirafter include -O2 \
799
-		-o $@ $< -lbfd -liberty
802
+	$(Q)$(HOST_CC) $(ELF2EFI_CFLAGS) -DMDE_CPU_IA32 -O2 -o $@ $<
800 803
 CLEANUP += $(ELF2EFI32)
801 804
 
802 805
 $(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS)
803 806
 	$(QM)$(ECHO) "  [HOSTCC] $@"
804
-	$(Q)$(HOST_CC) -DMDE_CPU_X64 -idirafter include -O2 \
805
-		-o $@ $< -lbfd -liberty
807
+	$(Q)$(HOST_CC) $(ELF2EFI_CFLAGS) -DMDE_CPU_X64 -O2 -o $@ $<
806 808
 CLEANUP += $(ELF2EFI64)
807 809
 
808 810
 $(EFIROM) : util/efirom.c $(MAKEDEPS)

正在加载...
取消
保存