summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/mk/host-support.mk2
-rw-r--r--src/embtk/include/elf.h18
-rw-r--r--src/embtk/include/malloc.h10
3 files changed, 29 insertions, 1 deletions
diff --git a/core/mk/host-support.mk b/core/mk/host-support.mk
index 33f6b39..6ee5ac5 100644
--- a/core/mk/host-support.mk
+++ b/core/mk/host-support.mk
@@ -82,7 +82,7 @@ HOSTCXXFLAGS = -Wall -O2 -I$(embtk_htools)/usr/include
HOSTLDFLAGS =
ifeq ($(embtk_buildhost_os),macos)
-HOSTCFLAGS += -I/opt/local/include
+HOSTCFLAGS += -I/opt/local/include -I$(embtk_includedir)
HOSTLDFLAGS += -L/opt/local/lib -lintl
endif
HOSTCXXFLAGS = $(HOSTCFLAGS)
diff --git a/src/embtk/include/elf.h b/src/embtk/include/elf.h
new file mode 100644
index 0000000..5827227
--- /dev/null
+++ b/src/embtk/include/elf.h
@@ -0,0 +1,18 @@
+#ifndef __elf_compat_h
+#define __elf_compat_h
+
+#if defined(__APPLE__)
+#include <libelf.h>
+#define R_386_32 1
+#define R_386_PC32 2
+#define R_ARM_PC24 1
+#define R_ARM_ABS32 2
+#define R_MIPS_32 2
+#define R_MIPS_26 4
+#define R_MIPS_HI16 5
+#define R_MIPS_LO16 6
+#else
+#include_next <elf.h>
+#endif
+
+#endif
diff --git a/src/embtk/include/malloc.h b/src/embtk/include/malloc.h
new file mode 100644
index 0000000..81d3bef
--- /dev/null
+++ b/src/embtk/include/malloc.h
@@ -0,0 +1,10 @@
+#ifndef __malloc_compat_h
+#define __malloc_compat_h
+
+#if defined(__APPLE__)
+#include <stdlib.h>
+#else
+#include_next <malloc.h>
+#endif
+
+#endif \ No newline at end of file