From: Michael Brown Date: Fri, 17 Oct 2008 17:24:04 +0000 (+0100) Subject: [build] Fix building on FreeBSD X-Git-Tag: v0.9.6~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9c38d14d678a6aba6d6d52cb4ba079c38fe3a96;p=thirdparty%2Fipxe.git [build] Fix building on FreeBSD FreeBSD requires the object format to be specified as elf_i386_fbsd, rather than elf_i386. Based on a patch from Eygene Ryabinkin --- diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 7054cdcfc..067ac8265 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -52,6 +52,14 @@ VERYCLEANUP += .echocheck echo : @$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\"" +############################################################################### +# +# Determine host OS +# +HOST_OS := $(shell uname -s) +hostos : + @$(ECHO) $(HOST_OS) + ############################################################################### # # Check for tools that can cause failed builds diff --git a/src/arch/i386/Makefile b/src/arch/i386/Makefile index dac534932..7d3e76399 100644 --- a/src/arch/i386/Makefile +++ b/src/arch/i386/Makefile @@ -38,8 +38,12 @@ CFLAGS += -freg-struct-return # Force 32-bit code even on an x86-64 machine # CFLAGS += -m32 -ASFLAGS += --32 -LDFLAGS += -m elf_i386 +ASFLAGS += --32 +ifeq ($(HOST_OS),FreeBSD) +LDFLAGS += -m elf_i386_fbsd +else +LDFLAGS += -m elf_i386 +endif # EFI requires -fshort-wchar, and nothing else currently uses wchar_t #