• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/libnfc/libnfc-build-systems-make-example-build-optional.patch
Samuel MartinSamuel Martin committed 6855bd3470110 Jun 2012
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
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 --git a/CMakeLists.txt b/CMakeLists.txt
14
index dd7904d..0e35229 100644
15
--- a/CMakeLists.txt
16
+++ b/CMakeLists.txt
17
@@ -27,6 +27,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/incl
18
 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
19
 
20
 # Options
21
+SET(BUILD_EXAMPLES ON CACHE BOOL "Build examples")
22
 SET(LIBNFC_DEBUG_OUTPUT OFF CACHE BOOL "Debug output of communication with the NFC chip")
23
 IF(LIBNFC_DEBUG_OUTPUT)
24
   ADD_DEFINITIONS(-DDEBUG -g3)
25
@@ -84,7 +85,7 @@ IF(NOT WIN32)
26
   ENDIF(LIBNFC_DRIVER_ACR122)
27
   # CMake lists are separated by a semi colon, replace with colon
28
   STRING(REPLACE ";" "," PKG_CONFIG_REQUIRES "${PKG_REQ}")
29
-  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libnfc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libnfc.pc @ONLY) 
30
+  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libnfc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libnfc.pc @ONLY)
31
   INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnfc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
32
 ENDIF(NOT WIN32)
33
 
34
@@ -101,7 +102,10 @@ ENDIF(LIBUSB_INCLUDE_DIRS)
35
 ADD_SUBDIRECTORY(libnfc)
36
 ADD_SUBDIRECTORY(include)
37
 ADD_SUBDIRECTORY(utils)
38
-ADD_SUBDIRECTORY(examples)
39
+
40
+IF(BUILD_EXAMPLES)
41
+  ADD_SUBDIRECTORY(examples)
42
+ENDIF(BUILD_EXAMPLES)
43
 
44
 # Binary Package
45
 IF(WIN32)
46
diff --git a/Makefile.am b/Makefile.am
47
index 3671cb6..59fd75a 100644
48
--- a/Makefile.am
49
+++ b/Makefile.am
50
@@ -2,7 +2,13 @@ ACLOCAL_AMFLAGS = -I m4
51
 
52
 AM_CFLAGS = $(LIBNFC_CFLAGS)
53
 
54
-SUBDIRS = libnfc utils examples include contrib cmake test
55
+SUBDIRS = libnfc utils
56
+
57
+if EXAMPLE_ENABLED
58
+SUBDIRS += examples
59
+endif
60
+
61
+SUBDIRS += include contrib cmake test
62
 
63
 pkgconfigdir = $(libdir)/pkgconfig
64
 pkgconfig_DATA = libnfc.pc
65
diff --git a/configure.ac b/configure.ac
66
index 0a222a8..6988164 100644
67
--- a/configure.ac
68
+++ b/configure.ac
69
@@ -111,6 +111,14 @@ then
70
 fi
71
 AM_CONDITIONAL(DOC_ENABLED, [test x"$enable_doc" = xyes])
72
 
73
+# Example build (default: yes)
74
+AC_ARG_ENABLE([example],AS_HELP_STRING([--enable-example],[Enable example build.]),[enable_example=$enableval],[enable_example="yes"])
75
+
76
+AC_MSG_CHECKING(for example build)
77
+AC_MSG_RESULT($enable_example)
78
+
79
+AM_CONDITIONAL(EXAMPLE_ENABLED, [test x"$enable_example" = xyes])
80
+
81
 # Dependencies
82
 PKG_CONFIG_REQUIRES=""
83
 
84
@@ -129,7 +137,11 @@ if test x$ac_cv_with_cutter = xyes -a x$ac_cv_use_cutter = xno; then
85
 fi
86
 AM_CONDITIONAL([WITH_CUTTER], [test "$ac_cv_use_cutter" != "no"])
87
 
88
+
89
+if test x"$enable_example" = "xyes"
90
+then
91
 AC_CHECK_READLINE
92
+fi
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.