summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-test
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-08-24 01:53:02 -0700
committerKhem Raj <raj.khem@gmail.com>2023-08-26 17:32:45 -0700
commit8b40d7c92fec6a618577f2da24dbca55c63d831f (patch)
tree5f9422ffce8a887d3d523cad5f9bfb2f3959e78e /meta-oe/recipes-test
parent50b820e18e24a964853747ab65608a7a2d96717d (diff)
downloadmeta-openembedded-8b40d7c92fec6a618577f2da24dbca55c63d831f.tar.gz
libfaketime: Fix build with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-test')
-rw-r--r--meta-oe/recipes-test/libfaketime/libfaketime/0001-Makefile-Detect-compiler-in-makefile.patch45
-rw-r--r--meta-oe/recipes-test/libfaketime/libfaketime_0.9.10.bb7
2 files changed, 49 insertions, 3 deletions
diff --git a/meta-oe/recipes-test/libfaketime/libfaketime/0001-Makefile-Detect-compiler-in-makefile.patch b/meta-oe/recipes-test/libfaketime/libfaketime/0001-Makefile-Detect-compiler-in-makefile.patch
new file mode 100644
index 000000000..ff0483765
--- /dev/null
+++ b/meta-oe/recipes-test/libfaketime/libfaketime/0001-Makefile-Detect-compiler-in-makefile.patch
@@ -0,0 +1,45 @@
1From 735bb5d053efad274aa4ea5a6682e656ff792909 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 24 Aug 2023 01:49:48 -0700
4Subject: [PATCH] Makefile: Detect compiler in makefile
5
6Add compiler specific options based on detected compiler gcc/clang
7
8Upstream-Status: Pending
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/Makefile | 18 +++++++++++++++++-
12 1 file changed, 17 insertions(+), 1 deletion(-)
13
14diff --git a/src/Makefile b/src/Makefile
15index 62e924c..c15eb33 100644
16--- a/src/Makefile
17+++ b/src/Makefile
18@@ -110,7 +110,23 @@ PREFIX ?= /usr/local
19 LIBDIRNAME ?= /lib/faketime
20 PLATFORM ?=$(shell uname)
21
22-CFLAGS += -std=gnu99 -Wall -Wextra -Werror -Wno-nonnull-compare -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS)
23+ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
24+COMPILER := clang
25+else
26+COMPILER := gcc
27+endif
28+export COMPILER
29+
30+CFLAGS += -std=gnu99 -Wall -Wextra -Werror -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS)
31+
32+ifeq ($(COMPILER),clang)
33+CFLAGS += -Wno-tautological-pointer-compare
34+endif
35+
36+ifeq ($(COMPILER),gcc)
37+CFLAGS += -Wno-nonnull-compare
38+endif
39+
40 ifeq ($(PLATFORM),SunOS)
41 CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
42 endif
43--
442.42.0
45
diff --git a/meta-oe/recipes-test/libfaketime/libfaketime_0.9.10.bb b/meta-oe/recipes-test/libfaketime/libfaketime_0.9.10.bb
index 7500e5765..49f68bf62 100644
--- a/meta-oe/recipes-test/libfaketime/libfaketime_0.9.10.bb
+++ b/meta-oe/recipes-test/libfaketime/libfaketime_0.9.10.bb
@@ -4,9 +4,10 @@ LICENSE = "GPL-2.0-only"
4LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" 4LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
5 5
6SRCREV = "d475b925943ad404c6c728ac868dc73949e7281c" 6SRCREV = "d475b925943ad404c6c728ac868dc73949e7281c"
7SRC_URI = "\ 7
8 git://git@github.com/wolfcw/libfaketime.git;branch=master;protocol=https \ 8SRC_URI = "git://github.com/wolfcw/libfaketime.git;branch=master;protocol=https \
9 " 9 file://0001-Makefile-Detect-compiler-in-makefile.patch \
10 "
10 11
11S = "${WORKDIR}/git" 12S = "${WORKDIR}/git"
12 13