The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / libnfc / 0001-build-systems-make-example-build-optional.patch
1 From 40a4871b171293d98acb40cf54be9ee9b78a3244 Mon Sep 17 00:00:00 2001
2 From: Samuel Martin <s.martin49@gmail.com>
3 Date: Wed, 6 Jun 2012 00:49:25 +0200
4 Subject: [PATCH 1/1] build systems: make example build optional
5
6 This patch makes example build optional for both cmake and autotools build
7 systems.
8
9 In order to keep the former behavior, example build is enabled by default.
10
11 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
12
13 diff -Nurp a/CMakeLists.txt b/CMakeLists.txt
14 --- a/CMakeLists.txt    2013-12-08 18:51:01.000000000 +0000
15 +++ b/CMakeLists.txt    2014-01-08 12:51:42.435096403 +0000
16 @@ -39,6 +39,7 @@ IF(LIBNFC_ENVVARS)
17    ADD_DEFINITIONS(-DENVVARS)
18  ENDIF(LIBNFC_ENVVARS)
19  
20 +SET(BUILD_EXAMPLES ON CACHE BOOL "Build examples")
21  SET(LIBNFC_DEBUG_MODE OFF CACHE BOOL "Debug mode")
22  IF(LIBNFC_DEBUG_MODE)
23    ADD_DEFINITIONS(-DDEBUG)
24 @@ -155,7 +156,10 @@ ENDIF(WIN32)
25  ADD_SUBDIRECTORY(libnfc)
26  ADD_SUBDIRECTORY(include)
27  ADD_SUBDIRECTORY(utils)
28 -ADD_SUBDIRECTORY(examples)
29 +
30 +IF(BUILD_EXAMPLES)
31 +  ADD_SUBDIRECTORY(examples)
32 +ENDIF(BUILD_EXAMPLES)
33  
34  # Binary Package
35  IF(WIN32)
36 diff -Nurp a/Makefile.am b/Makefile.am
37 --- a/Makefile.am       2013-12-08 18:51:01.000000000 +0000
38 +++ b/Makefile.am       2014-01-08 12:52:12.807018593 +0000
39 @@ -2,7 +2,13 @@ ACLOCAL_AMFLAGS = -I m4
40  
41  AM_CFLAGS = $(LIBNFC_CFLAGS)
42  
43 -SUBDIRS = libnfc utils examples include contrib cmake test
44 +SUBDIRS = libnfc utils
45 +
46 +if EXAMPLE_ENABLED
47 +SUBDIRS += examples
48 +endif
49 +
50 +SUBDIRS += include contrib cmake test
51  
52  pkgconfigdir = $(libdir)/pkgconfig
53  pkgconfig_DATA = libnfc.pc
54 diff -Nurp a/configure.ac b/configure.ac
55 --- a/configure.ac      2013-12-08 18:51:01.000000000 +0000
56 +++ b/configure.ac      2014-01-08 12:53:02.054872564 +0000
57 @@ -142,6 +142,14 @@ then
58  fi
59  AM_CONDITIONAL(DOC_ENABLED, [test x"$enable_doc" = xyes])
60  
61 +# Example build (default: yes)
62 +AC_ARG_ENABLE([example],AS_HELP_STRING([--enable-example],[Enable example build.]),[enable_example=$enableval],[enable_example="yes"])
63 +
64 +AC_MSG_CHECKING(for example build)
65 +AC_MSG_RESULT($enable_example)
66 +
67 +AM_CONDITIONAL(EXAMPLE_ENABLED, [test x"$enable_example" = xyes])
68 +
69  # Dependencies
70  PKG_CONFIG_REQUIRES=""
71  
72 @@ -160,7 +168,10 @@ if test x$ac_cv_with_cutter = xyes -a x$
73  fi
74  AM_CONDITIONAL([WITH_CUTTER], [test "$ac_cv_use_cutter" != "no"])
75  
76 +if test x"$enable_example" = "xyes"
77 +then
78  AC_CHECK_READLINE
79 +fi
80  
81  # Help us to write great code ;-)
82  CFLAGS="$CFLAGS -Wall -pedantic -Wextra"