summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-connectivity
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2019-09-13 16:13:54 +0300
committerKhem Raj <raj.khem@gmail.com>2019-09-13 09:26:09 -0700
commit4a80e37005f0951bf70aee664a058f7911940cb0 (patch)
tree229f7fabf29f96fde8be3e7f8a3c2623a333ba20 /meta-oe/recipes-connectivity
parent184cf325c1c430b0e9ea23c6976ddad750fe29d3 (diff)
downloadmeta-openembedded-4a80e37005f0951bf70aee664a058f7911940cb0.tar.gz
libqmi: Replace clang patch with configure option
Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-connectivity')
-rw-r--r--meta-oe/recipes-connectivity/libqmi/libqmi/0001-Detect-clang.patch85
-rw-r--r--meta-oe/recipes-connectivity/libqmi/libqmi_1.22.2.bb2
2 files changed, 1 insertions, 86 deletions
diff --git a/meta-oe/recipes-connectivity/libqmi/libqmi/0001-Detect-clang.patch b/meta-oe/recipes-connectivity/libqmi/libqmi/0001-Detect-clang.patch
deleted file mode 100644
index 7a3429b9d..000000000
--- a/meta-oe/recipes-connectivity/libqmi/libqmi/0001-Detect-clang.patch
+++ /dev/null
@@ -1,85 +0,0 @@
1From 4cfb728804157e8f3c69e11ba4df449d8f76388f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 20 Oct 2016 04:42:26 +0000
4Subject: [PATCH] Detect clang
5
6Check for clang compiler since we need to disable
7unused-function warning for clang, at same time
8pass werror when checking for compiler options if
9werror is enabled so spurious options do not get
10enabled. Only the ones that are supported by given
11compiler are accepted.
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Upstream-Status: Pending
15
16---
17 m4/compiler-warnings.m4 | 29 +++++++++++++++++++++++++----
18 1 file changed, 25 insertions(+), 4 deletions(-)
19
20diff --git a/m4/compiler-warnings.m4 b/m4/compiler-warnings.m4
21index de4a8b0..e4ba718 100644
22--- a/m4/compiler-warnings.m4
23+++ b/m4/compiler-warnings.m4
24@@ -2,10 +2,30 @@ AC_DEFUN([LIBQMI_COMPILER_WARNINGS],
25 [AC_ARG_ENABLE(more-warnings,
26 AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]),
27 set_more_warnings="$enableval",set_more_warnings=error)
28+
29+# Clang throws a lot of warnings when it does not understand a flag. Disable
30+# this warning for now so other warnings are visible.
31+AC_MSG_CHECKING([if compiling with clang])
32+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
33+#ifndef __clang__
34+ not clang
35+#endif
36+ ]])],
37+ [CLANG=yes],
38+ [CLANG=no]
39+)
40+AC_MSG_RESULT([$CLANG])
41+AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Wno-error=unused-function])
42+CFLAGS="$CFLAGS $CLANG_FLAGS"
43+LDFLAGS="$LDFLAGS $CLANG_FLAGS"
44+
45 AC_MSG_CHECKING(for more warnings)
46 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
47 AC_MSG_RESULT(yes)
48 CFLAGS="-Wall -std=gnu89 $CFLAGS"
49+ if test "x$set_more_warnings" = xerror; then
50+ WERROR="-Werror"
51+ fi
52
53 for option in -Wmissing-declarations -Wmissing-prototypes \
54 -Wdeclaration-after-statement -Wstrict-prototypes \
55@@ -17,22 +37,23 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
56 -Wmissing-include-dirs -Waggregate-return \
57 -Wformat-security -Wtype-limits; do
58 SAVE_CFLAGS="$CFLAGS"
59- CFLAGS="$CFLAGS $option"
60+ CFLAGS="$CFLAGS $option $WERROR"
61 AC_MSG_CHECKING([whether gcc understands $option])
62 AC_TRY_COMPILE([], [],
63 has_option=yes,
64 has_option=no,)
65 if test $has_option = no; then
66 CFLAGS="$SAVE_CFLAGS"
67+ else
68+ CFLAGS="$SAVE_CFLAGS $option"
69 fi
70 AC_MSG_RESULT($has_option)
71 unset has_option
72 unset SAVE_CFLAGS
73 done
74+ CFLAGS="$CFLAGS $WERROR"
75 unset option
76- if test "x$set_more_warnings" = xerror; then
77- CFLAGS="$CFLAGS -Werror"
78- fi
79+ unset WERROR
80 else
81 AC_MSG_RESULT(no)
82 fi
83--
841.9.1
85
diff --git a/meta-oe/recipes-connectivity/libqmi/libqmi_1.22.2.bb b/meta-oe/recipes-connectivity/libqmi/libqmi_1.22.2.bb
index da13286b4..3b2fe51bb 100644
--- a/meta-oe/recipes-connectivity/libqmi/libqmi_1.22.2.bb
+++ b/meta-oe/recipes-connectivity/libqmi/libqmi_1.22.2.bb
@@ -12,7 +12,6 @@ DEPENDS = "glib-2.0 glib-2.0-native"
12inherit autotools pkgconfig bash-completion 12inherit autotools pkgconfig bash-completion
13 13
14SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz \ 14SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz \
15 file://0001-Detect-clang.patch \
16 " 15 "
17SRC_URI[md5sum] = "3fd831c1b0de4a4432be628432a960ff" 16SRC_URI[md5sum] = "3fd831c1b0de4a4432be628432a960ff"
18SRC_URI[sha256sum] = "f1f1e514a89b1dcba05cf7274895e7301a2da4c947b7c2f17acb84fc74038227" 17SRC_URI[sha256sum] = "f1f1e514a89b1dcba05cf7274895e7301a2da4c947b7c2f17acb84fc74038227"
@@ -21,3 +20,4 @@ PACKAGECONFIG ??= "udev mbim"
21PACKAGECONFIG[udev] = ",--without-udev,libgudev" 20PACKAGECONFIG[udev] = ",--without-udev,libgudev"
22PACKAGECONFIG[mbim] = "--enable-mbim-qmux,--disable-mbim-qmux,libmbim" 21PACKAGECONFIG[mbim] = "--enable-mbim-qmux,--disable-mbim-qmux,libmbim"
23 22
23EXTRA_OECONF_append_toolchain-clang = " --enable-more-warnings=no"