diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-08-24 01:53:02 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-08-26 17:32:45 -0700 |
commit | 8b40d7c92fec6a618577f2da24dbca55c63d831f (patch) | |
tree | 5f9422ffce8a887d3d523cad5f9bfb2f3959e78e /meta-oe/recipes-test | |
parent | 50b820e18e24a964853747ab65608a7a2d96717d (diff) | |
download | meta-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.patch | 45 | ||||
-rw-r--r-- | meta-oe/recipes-test/libfaketime/libfaketime_0.9.10.bb | 7 |
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 0000000000..ff04837652 --- /dev/null +++ b/meta-oe/recipes-test/libfaketime/libfaketime/0001-Makefile-Detect-compiler-in-makefile.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 735bb5d053efad274aa4ea5a6682e656ff792909 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 24 Aug 2023 01:49:48 -0700 | ||
4 | Subject: [PATCH] Makefile: Detect compiler in makefile | ||
5 | |||
6 | Add compiler specific options based on detected compiler gcc/clang | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | src/Makefile | 18 +++++++++++++++++- | ||
12 | 1 file changed, 17 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/src/Makefile b/src/Makefile | ||
15 | index 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 | -- | ||
44 | 2.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 7500e57658..49f68bf629 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" | |||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
5 | 5 | ||
6 | SRCREV = "d475b925943ad404c6c728ac868dc73949e7281c" | 6 | SRCREV = "d475b925943ad404c6c728ac868dc73949e7281c" |
7 | SRC_URI = "\ | 7 | |
8 | git://git@github.com/wolfcw/libfaketime.git;branch=master;protocol=https \ | 8 | SRC_URI = "git://github.com/wolfcw/libfaketime.git;branch=master;protocol=https \ |
9 | " | 9 | file://0001-Makefile-Detect-compiler-in-makefile.patch \ |
10 | " | ||
10 | 11 | ||
11 | S = "${WORKDIR}/git" | 12 | S = "${WORKDIR}/git" |
12 | 13 | ||