Bladeren bron

[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 <rea-fbsd@codelabs.ru>
tags/v0.9.6
Michael Brown 15 jaren geleden
bovenliggende
commit
d9c38d14d6
2 gewijzigde bestanden met toevoegingen van 14 en 2 verwijderingen
  1. 8
    0
      src/Makefile.housekeeping
  2. 6
    2
      src/arch/i386/Makefile

+ 8
- 0
src/Makefile.housekeeping Bestand weergeven

52
 echo :
52
 echo :
53
 	@$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
53
 	@$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
54
 
54
 
55
+###############################################################################
56
+#
57
+# Determine host OS
58
+#
59
+HOST_OS		:= $(shell uname -s)
60
+hostos :
61
+	@$(ECHO) $(HOST_OS)
62
+
55
 ###############################################################################
63
 ###############################################################################
56
 #
64
 #
57
 # Check for tools that can cause failed builds
65
 # Check for tools that can cause failed builds

+ 6
- 2
src/arch/i386/Makefile Bestand weergeven

38
 # Force 32-bit code even on an x86-64 machine
38
 # Force 32-bit code even on an x86-64 machine
39
 #
39
 #
40
 CFLAGS		+= -m32
40
 CFLAGS		+= -m32
41
-ASFLAGS         += --32
42
-LDFLAGS         += -m elf_i386
41
+ASFLAGS		+= --32
42
+ifeq ($(HOST_OS),FreeBSD)
43
+LDFLAGS		+= -m elf_i386_fbsd
44
+else
45
+LDFLAGS		+= -m elf_i386
46
+endif
43
 
47
 
44
 # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
48
 # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
45
 #
49
 #

Laden…
Annuleren
Opslaan