bossa: fix build on macos
authorSergey V. Lobanov <sergey@lobanov.in>
Sat, 8 Jan 2022 11:46:15 +0000 (14:46 +0300)
committerNick Hainke <vincent@systemli.org>
Sun, 9 Jan 2022 13:17:13 +0000 (14:17 +0100)
override OS=Linux Makefile variable to support building on macos

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
utils/bossa/Makefile
utils/bossa/patches/102_allow_override_os.patch [new file with mode: 0644]

index 5760fcfaf1e920df94097a5f5b7002fbc09b7c3e..8ec04d4754d4b30373b71cae3f3c64df205c34d2 100644 (file)
@@ -33,6 +33,7 @@ endef
 
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) bin/bossac \
+    OS="Linux" \
     CC="$(TARGET_CC_NOCACHE)" \
     CXX="$(TARGET_CXX_NOCACHE)" \
     CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
diff --git a/utils/bossa/patches/102_allow_override_os.patch b/utils/bossa/patches/102_allow_override_os.patch
new file mode 100644 (file)
index 0000000..34202d1
--- /dev/null
@@ -0,0 +1,18 @@
+commit 7b1ee33f339bd0d69a7295facda7b3d2b4b55d1a
+Author: Sergey V. Lobanov <sergey@lobanov.in>
+Date:   Sat Jan 8 14:22:21 2022 +0300
+
+    allow override OS to support cross-compile compilation if build OS
+    host OS are different (e.g. build on MacOS for Linux)
+
+--- a/Makefile
++++ b/Makefile
+@@ -28,7 +28,7 @@ INSTALLDIR=install
+ #
+ # Determine OS
+ #
+-OS:=$(shell uname -s | cut -c -7)
++OS?=$(shell uname -s | cut -c -7)
+ #
+ # Windows rules