Browse Source

[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 years ago
parent
commit
3dd7ce1c26
2 changed files with 8 additions and 4 deletions
  1. 2
    0
      src/Makefile
  2. 6
    4
      src/Makefile.housekeeping

+ 2
- 0
src/Makefile View File

42
 EFIROM		:= ./util/efirom
42
 EFIROM		:= ./util/efirom
43
 ICCFIX		:= ./util/iccfix
43
 ICCFIX		:= ./util/iccfix
44
 DOXYGEN		:= doxygen
44
 DOXYGEN		:= doxygen
45
+BINUTILS_DIR	:= /usr
46
+BFD_DIR		:= $(BINUTILS_DIR)
45
 
47
 
46
 ###############################################################################
48
 ###############################################################################
47
 #
49
 #

+ 6
- 4
src/Makefile.housekeeping View File

793
 #
793
 #
794
 # The EFI image converter
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
 $(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
800
 $(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
797
 	$(QM)$(ECHO) "  [HOSTCC] $@"
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
 CLEANUP += $(ELF2EFI32)
803
 CLEANUP += $(ELF2EFI32)
801
 
804
 
802
 $(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS)
805
 $(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS)
803
 	$(QM)$(ECHO) "  [HOSTCC] $@"
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
 CLEANUP += $(ELF2EFI64)
808
 CLEANUP += $(ELF2EFI64)
807
 
809
 
808
 $(EFIROM) : util/efirom.c $(MAKEDEPS)
810
 $(EFIROM) : util/efirom.c $(MAKEDEPS)

Loading…
Cancel
Save