raspberrypi: bump raspberrypi_dt_defconfig kernel
[buildroot-gz.git] / package / libnfc / 0001-build-systems-make-example-build-optional.patch
blob06577c58ec3615547256874ff27b3705604053d9
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
6 This patch makes example build optional for both cmake and autotools build
7 systems.
9 In order to keep the former behavior, example build is enabled by default.
11 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
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)
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)
30 +IF(BUILD_EXAMPLES)
31 + ADD_SUBDIRECTORY(examples)
32 +ENDIF(BUILD_EXAMPLES)
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
41 AM_CFLAGS = $(LIBNFC_CFLAGS)
43 -SUBDIRS = libnfc utils examples include contrib cmake test
44 +SUBDIRS = libnfc utils
46 +if EXAMPLE_ENABLED
47 +SUBDIRS += examples
48 +endif
50 +SUBDIRS += include contrib cmake test
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
59 AM_CONDITIONAL(DOC_ENABLED, [test x"$enable_doc" = xyes])
61 +# Example build (default: yes)
62 +AC_ARG_ENABLE([example],AS_HELP_STRING([--enable-example],[Enable example build.]),[enable_example=$enableval],[enable_example="yes"])
64 +AC_MSG_CHECKING(for example build)
65 +AC_MSG_RESULT($enable_example)
67 +AM_CONDITIONAL(EXAMPLE_ENABLED, [test x"$enable_example" = xyes])
69 # Dependencies
70 PKG_CONFIG_REQUIRES=""
72 @@ -160,7 +168,10 @@ if test x$ac_cv_with_cutter = xyes -a x$
74 AM_CONDITIONAL([WITH_CUTTER], [test "$ac_cv_use_cutter" != "no"])
76 +if test x"$enable_example" = "xyes"
77 +then
78 AC_CHECK_READLINE
79 +fi
81 # Help us to write great code ;-)
82 CFLAGS="$CFLAGS -Wall -pedantic -Wextra"