blob: 876e80ef76ce9201f2d6836c911b57679d86bc9c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001To enable --disable-Werror for libomxil to avoid some compilers which check code strictly.
2
3For example, at least the following errors happened to some compilers:
4
51) OMX_INDEXTYPE in include/OMX_Index.h IS NOT OMX_INDEXVENDORTYPE in src/base/omx_base_component.h
6| i586-poky-linux-libtool: compile: i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/yocto-build5/poky/build/tmp/sysroots/qemux86 -DHAVE_Climinate-unused-debug-types -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c OMXComponentRMExt.c -fPIC -DPIC -o .libs/libomxbase_la-OMXComponentRMExt.o
7| omx_base_component.c: In function 'omx_base_component_GetParameter':
8| omx_base_component.c:991:3: error: case value '2130706435' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]
9| omx_base_component.c:918:3: error: case value '2130706436' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]
10
112)
12| i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/yocto-build5/poky/build/tmp/sysroots/qemux86 -DHAVE_CONFIG_H -I. -I.. -DOMXILCOMPOminate-unused-debug-types -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c -o omxregister_bellagio-omxregister.o `test -f 'omxregister.c' || echo './'`o
13| omxregister.c: In function 'buildComponentsList':
14| omxregister.c:175:7: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
15| cc1: all warnings being treated as errors
16
17Upstream-Status: Inappropriate [configuration]
18
19Signed-off-by: Shane Wang <shane.wang@intel.com>
20
21diff -r 82d742d3ea90 configure.ac
22--- a/configure.ac Tue Dec 27 15:30:35 2011 +0800
23+++ b/configure.ac Tue Dec 27 16:26:03 2011 +0800
24@@ -5,7 +5,7 @@
25 AC_PREREQ([2.59])
26
27 AC_CONFIG_HEADERS([config.h])
28-CFLAGS="${CFLAGS} -Wall -Werror"
29+CFLAGS="${CFLAGS} -Wall"
30
31 ################################################################################
32 # Set the shared versioning info, according to section 6.3 of the libtool info #
33@@ -122,6 +122,14 @@
34 [with_android=$enableval],
35 [with_android=no])
36
37+AC_ARG_ENABLE(
38+ [Werror],
39+ [AC_HELP_STRING(
40+ [--disable-Werror],
41+ [whether to diable treating gcc warnings as errors])],
42+ [with_Werror=$enableval],
43+ [with_Werror=yes])
44+
45 ################################################################################
46 # Check for programs #
47 ################################################################################
48@@ -193,6 +201,10 @@
49 CFG_DEBUG_LEVEL=255
50 fi
51
52+if test "x$with_Werror" = "xyes"; then
53+ CFLAGS="${CFLAGS} -Werror"
54+fi
55+
56 AC_SUBST(CFG_DEBUG_LEVEL)
57 CFLAGS="${CFLAGS} -DCONFIG_DEBUG_LEVEL=$CFG_DEBUG_LEVEL"
58