mybw: Pass cflags/ldflags from bitbake

This helps in compiling this will e.g. clang/libc++

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2022-10-22 16:17:22 -07:00
parent 21f4c9b3e6
commit 77259eae4b
2 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
From bde677567226a8b7a6c773f863d3f820eca26000 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 22 Oct 2022 16:13:47 -0700
Subject: [PATCH] makefile: Allow CFLAGS/LDFLAGS from environment.
This helps in cross-compilation where the flags passed from environment
will matter much e.g. ABI, architecture etc.
Upstream-Status: Submitted [https://github.com/andersson/mybw/pull/1]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index dfbba09..28a96bc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
OUT := mybw
-CFLAGS := -O2 -Wall -fno-builtin
-LDFLAGS := -static -static-libgcc
+CFLAGS += -O2 -Wall -fno-builtin
+LDFLAGS += -static -static-libgcc
SRCS := mybw.c
OBJS := $(SRCS:.c=.o)
--
2.38.1

View File

@@ -4,7 +4,9 @@ LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/BSD-3-Clause-Clear;md5=7a434440b651f4a472ca93716d01033a"
SRCREV = "f4bdeee1266c273e308d0651522bb59afb5b8211"
SRC_URI = "git://github.com/andersson/mybw;protocol=https;branch=main"
SRC_URI = "git://github.com/andersson/mybw;protocol=https;branch=main \
file://0001-makefile-Allow-CFLAGS-LDFLAGS-from-environment.patch \
"
S = "${WORKDIR}/git"
@@ -19,3 +21,4 @@ do_install () {
install -m 0755 mybw ${D}${bindir}/mybw
}
LDFLAGS += "-lgcc"