board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / libcodec2 / 0002-Add-option-to-disable-unit-tests.patch
blob78227020925c788548d827f05ab9668aacae7513
1 From 19db6244200b870317382294f14b7d561d55a64e Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sat, 29 Aug 2015 12:05:53 +0200
4 Subject: [PATCH] Add option to disable unit tests
6 The unittests require C++, while the rest of the library does not, so
7 this commit implements a --{enable,disable}-unittests option to
8 selectively enable the build of the unit tests. When not provided, the
9 option defaults to yes so that the existing behavior is preserved.
11 Based on initial work by Bernd Kuhls.
13 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
14 ---
15 Makefile.am | 6 +++++-
16 configure.ac | 5 +++++
17 2 files changed, 10 insertions(+), 1 deletion(-)
19 diff --git a/Makefile.am b/Makefile.am
20 index bd3ce01..1da250b 100644
21 --- a/Makefile.am
22 +++ b/Makefile.am
23 @@ -95,4 +95,8 @@ src/codebook/lsp8.txt \
24 src/codebook/lsp9.txt \
25 src/codebook/lsp10.txt
27 -SUBDIRS = src unittest
28 +SUBDIRS = src
30 +if UNITTESTS
31 +SUBDIRS += unittest
32 +endif
33 diff --git a/configure.ac b/configure.ac
34 index 7520af6..55b7215 100644
35 --- a/configure.ac
36 +++ b/configure.ac
37 @@ -24,5 +24,10 @@ AC_CHECK_HEADERS([stdlib.h string.h])
38 AC_FUNC_MALLOC
39 AC_CHECK_FUNCS([floor pow sqrt])
41 +AC_ARG_ENABLE([unittests],
42 + AS_HELP_STRING([--disable-unittests], [Disable unittests]),
43 + [], [enable_unittests=yes])
44 +AM_CONDITIONAL([UNITTESTS], [test "${enable_unittests}" = "yes"])
46 AC_CONFIG_FILES([Makefile src/Makefile unittest/Makefile codec2.pc])
47 AC_OUTPUT
48 --
49 2.5.0