From patchwork Sun Oct 21 15:39:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/2] u-boot-omap: compilable on osx From: Yann Diorcet X-Patchwork-Id: 193040 Message-Id: <1350833951-9560-1-git-send-email-diorcet.yann@gmail.com> To: dev@oe-lite.org Cc: Yann Diorcet Date: Sun, 21 Oct 2012 17:39:10 +0200 From: Yann Diorcet --- recipes/u-boot/u-boot-omap.inc | 1 + recipes/u-boot/u-boot-omap/osx.patch | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 recipes/u-boot/u-boot-omap/osx.patch diff --git a/recipes/u-boot/u-boot-omap.inc b/recipes/u-boot/u-boot-omap.inc index 5041ebf..7ccda86 100644 --- a/recipes/u-boot/u-boot-omap.inc +++ b/recipes/u-boot/u-boot-omap.inc @@ -5,6 +5,7 @@ COMPATIBLE_MACHINES = "pandaboard beagleboard" inherit u-boot SRC_URI = "git://git.denx.de/u-boot.git;tag=v${PV}" +SRC_URI += "file://osx.patch" S = "${SRCDIR}/u-boot" SRC_URI += "file://${BOOT_SCRIPT}" diff --git a/recipes/u-boot/u-boot-omap/osx.patch b/recipes/u-boot/u-boot-omap/osx.patch new file mode 100644 index 0000000..70389ee --- /dev/null +++ b/recipes/u-boot/u-boot-omap/osx.patch @@ -0,0 +1,46 @@ +diff -urN u-boot-2011.09/tools/env/fw_env.c u-boot-2011.09.2/tools/env/fw_env.c +--- u-boot-2011.09/tools/env/fw_env.c 2011-09-29 21:11:15.000000000 +0200 ++++ u-boot-2011.09.2/tools/env/fw_env.c 2012-10-04 15:10:59.000000000 +0200 +@@ -38,6 +38,11 @@ + #ifdef MTD_OLD + # include + # include ++#elif __APPLE__ ++# include ++#define ulong unsigned long ++#include ++typedef long long loff_t; + #else + # define __user /* nothing */ + # include +diff -urN u-boot-2011.09/tools/getline.h u-boot-2011.09.2/tools/getline.h +--- u-boot-2011.09/tools/getline.h 2011-09-29 21:11:15.000000000 +0200 ++++ u-boot-2011.09.2/tools/getline.h 2012-10-04 15:08:24.000000000 +0200 +@@ -1 +1,4 @@ ++#ifdef __APPLE__ ++#undef getline ++#endif + int getline(char **lineptr, size_t *n, FILE *stream); +diff -urN u-boot-2011.09/tools/os_support.c u-boot-2011.09.2/tools/os_support.c +--- u-boot-2011.09/tools/os_support.c 2011-09-29 21:11:15.000000000 +0200 ++++ u-boot-2011.09.2/tools/os_support.c 2012-10-04 15:10:59.000000000 +0200 +@@ -23,6 +23,6 @@ + #ifdef __MINGW32__ + #include "mingw_support.c" + #endif +-#ifdef __APPLE__ ++#if defined(__APPLE__) && __DARWIN_C_LEVEL < 200809L + #include "getline.c" + #endif +diff -urN u-boot-2011.09/tools/os_support.h u-boot-2011.09.2/tools/os_support.h +--- u-boot-2011.09/tools/os_support.h 2011-09-29 21:11:15.000000000 +0200 ++++ u-boot-2011.09.2/tools/os_support.h 2012-10-04 15:10:59.000000000 +0200 +@@ -28,7 +28,7 @@ + #include "mingw_support.h" + #endif + +-#ifdef __APPLE__ ++#if defined(__APPLE__) && __DARWIN_C_LEVEL < 200809L + #include "getline.h" + #endif +