Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCHv2 1/1] package/pugixml: add support for a limited set of configuration options
Date: Thu, 31 Jan 2019 08:40:19 +0100	[thread overview]
Message-ID: <20190131074019.19252-1-patrickdepinguin@gmail.com> (raw)

From: Wouter Vermeiren <wouter.vermeiren@nokia.com>

Signed-off-by: Wouter Vermeiren <wouter.vermeiren@nokia.com>
[ThomasDS: align with Buildroot coding style; rename some options]
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 package/pugixml/Config.in  | 71 ++++++++++++++++++++++++++++++++++++++
 package/pugixml/pugixml.mk | 26 ++++++++++++++
 2 files changed, 97 insertions(+)

v2: (feedback Thomas Petazzoni)
- change 'disable' options into 'enable' and reorder them to be first
- rename 'has-long-long' option

diff --git a/package/pugixml/Config.in b/package/pugixml/Config.in
index c37b1df9e5..65ff2a7b4d 100644
--- a/package/pugixml/Config.in
+++ b/package/pugixml/Config.in
@@ -18,5 +18,76 @@ config BR2_PACKAGE_PUGIXML
 	  http://pugixml.org/
 	  https://github.com/zeux/pugixml
 
+if BR2_PACKAGE_PUGIXML
+
+config BR2_PACKAGE_PUGIXML_XPATH_SUPPORT
+	bool "Enable XPath support"
+	default y
+	help
+	  Enables XPath support in pugixml.
+	  When disabled, both XPath interfaces and XPath implementation
+	  are excluded from compilation. This option is provided in case
+	  you do not need XPath functionality and need to save code
+	  space.
+
+config BR2_PACKAGE_PUGIXML_STL_SUPPORT
+	bool "Enable STL support"
+	default y
+	help
+	  Enables use of STL in pugixml.
+	  When disabled, the functions that operate on STL types are no
+	  longer present (i.e. load/save via iostream). This option is
+	  provided in case your target platform does not have a
+	  standard-compliant STL implementation.
+
+config BR2_PACKAGE_PUGIXML_EXCEPTIONS
+	bool "Enable exceptions"
+	default y
+	help
+	  Enables use of exceptions in pugixml. This option is provided
+	  in case your target platform does not have exception handling
+	  capabilities.
+
+config BR2_PACKAGE_PUGIXML_WCHAR_MODE
+	bool "Enable wchar_t mode"
+	help
+	  Toggles between UTF-8 (default) style interface (the in-memory
+	  text encoding is assumed to be UTF-8, most functions use char
+	  as character type) and UTF-16/32 style interface (the
+	  in-memory text encoding is assumed to be UTF-16/32, depending
+	  on wchar_t size, most functions use wchar_t as character type)
+
+	  http://pugixml.org/docs/manual.html#dom.unicode
+
+config BR2_PACKAGE_PUGIXML_COMPACT
+	bool "Enable compact mode"
+	help
+	  Activates a different internal representation of document
+	  storage that is much more memory efficient for documents with
+	  a lot of markup (i.e.  nodes and attributes), but is slightly
+	  slower to parse and access.
+
+	  http://pugixml.org/docs/manual.html#dom.memory.compact
+
+config BR2_PACKAGE_PUGIXML_HEADER_ONLY
+	bool "Enable header-only version"
+	help
+	  All source code for pugixml will be included in every
+	  translation unit that includes pugixml.hpp. This is how most
+	  of Boost and STL libraries work.
+
+	  http://pugixml.org/docs/manual.html#install.building.header
+
+config BR2_PACKAGE_PUGIXML_FORCE_ENABLE_LONG_LONG
+	bool "Force-enable long long support"
+	help
+	  Force-enables support for long long type in pugixml.  Long
+	  long support is automatically enabled if your platform is
+	  known to have long long support (i.e. has C++11 support or
+	  uses a reasonably modern version of a known compiler). If
+	  pugixml does not recognize that your platform supports long
+	  long but in fact it does, you can enable the define manually.
+endif
+
 comment "pugixml needs a toolchain w/ C++"
 	depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/package/pugixml/pugixml.mk b/package/pugixml/pugixml.mk
index e5188e5f53..7a35959409 100644
--- a/package/pugixml/pugixml.mk
+++ b/package/pugixml/pugixml.mk
@@ -10,4 +10,30 @@ PUGIXML_LICENSE = MIT
 PUGIXML_LICENSE_FILES = readme.txt
 PUGIXML_INSTALL_STAGING = YES
 
+ifeq ($(BR2_PACKAGE_PUGIXML_XPATH_SUPPORT),)
+PUGIXML_BUILD_DEFINES += PUGIXML_NO_XPATH
+endif
+ifeq ($(BR2_PACKAGE_PUGIXML_STL_SUPPORT),)
+PUGIXML_BUILD_DEFINES += PUGIXML_NO_STL
+endif
+ifeq ($(BR2_PACKAGE_PUGIXML_EXCEPTIONS),)
+PUGIXML_BUILD_DEFINES += PUGIXML_NO_EXCEPTIONS
+endif
+ifeq ($(BR2_PACKAGE_PUGIXML_WCHAR_MODE),y)
+PUGIXML_BUILD_DEFINES += PUGIXML_WCHAR_MODE
+endif
+ifeq ($(BR2_PACKAGE_PUGIXML_COMPACT),y)
+PUGIXML_BUILD_DEFINES += PUGIXML_COMPACT
+endif
+ifeq ($(BR2_PACKAGE_PUGIXML_HEADER_ONLY),y)
+PUGIXML_BUILD_DEFINES += PUGIXML_HEADER_ONLY
+endif
+ifeq ($(BR2_PACKAGE_PUGIXML_FORCE_ENABLE_LONG_LONG),y)
+PUGIXML_BUILD_DEFINES += PUGIXML_HAS_LONG_LONG
+endif
+
+ifneq (,$(PUGIXML_BUILD_DEFINES))
+PUGIXML_CONF_OPTS += -DBUILD_DEFINES="$(subst $(space),;,$(strip $(PUGIXML_BUILD_DEFINES)))"
+endif
+
 $(eval $(cmake-package))
-- 
2.19.2

             reply	other threads:[~2019-01-31  7:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31  7:40 Thomas De Schampheleire [this message]
2019-02-02 13:37 ` [Buildroot] [PATCHv2 1/1] package/pugixml: add support for a limited set of configuration options Arnout Vandecappelle
2019-02-02 14:14   ` Thomas De Schampheleire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190131074019.19252-1-patrickdepinguin@gmail.com \
    --to=patrickdepinguin@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox