neon: replace 'choice' for XML library with two options
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 27 Aug 2013 17:08:04 +0000 (19:08 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 27 Aug 2013 22:23:49 +0000 (00:23 +0200)
The NEON library can either be compiled without XML support, with XML
support provided by Expat, or with XML support provided by
libxml2. Until now, to represent this, a Kconfig 'choice..endchoice'
was used. Unfortunately, another package cannot 'select' one of the
possible choices. So for example, a package such as 'rpm', or the
to-be-added 'subversion' package could not select their dependencies,
they had to do a 'depends on !BR2_PACKAGE_NEON_NOXML', which is not
how Buildroot handles library dependencies in general.

So, this commit replaces the 'choice...endchoice' block with simply
two configuration options that are mutually exclusive. The option
names are not changed, so no Config.in.legacy addition is needed.

An hidden option BR2_PACKAGE_NEON_XML is provided, so that packages
that need XML support in NEON but don't care whether it's provided by
Expat or libxml2 can simply select BR2_PACKAGE_NEON_XML.

The rpm package is updated accordingly.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/neon/Config.in
package/rpm/Config.in

index 54b51c8ffd64b1d206823ed5a11791091fbb3af4..e76278c37e50016e10f3967d2118009147f9c8f1 100644 (file)
@@ -19,31 +19,23 @@ config BR2_PACKAGE_NEON_SSL
        help
          build with SSL support
 
-choice
-       prompt "XML Support"
-       help
-         Select which XML library to use...
-         none       do not build with XML support
-         expat      use expat
-         libxml2    use libxml2
-
-config BR2_PACKAGE_NEON_NOXML
-       bool "none"
-       help
-         none       do not build with XML support
+# This is an hidden symbol other packages can select to ensure that
+# Neon has XML support, either provided by Expat or libxml2.
+config BR2_PACKAGE_NEON_XML
+       bool
+       select BR2_PACKAGE_NEON_EXPAT if !BR2_PACKAGE_NEON_LIBXML2
 
 config BR2_PACKAGE_NEON_EXPAT
-       bool "expat"
+       bool "XML support with expat"
        select BR2_PACKAGE_EXPAT
+       depends on !BR2_PACKAGE_NEON_LIBXML2
        help
-         expat      use expat, a library for parsing XML.
+         Enable XML support in neon, using the Expat XML library.
 
 config BR2_PACKAGE_NEON_LIBXML2
-       bool "libxml2"
+       bool "XML support with libxml2"
        select BR2_PACKAGE_LIBXML2
        help
-         libxml2    use libxml2, a library to read, modify and
-                    write XML and HTML files.
-endchoice
+         Enable XML support in neon, using the libxml2 XML library.
 
 endif
index 14072c95f9cefe372ccfb390eef1afb08d832bf2..63e53677263d02deec60ac774f2bad23001bcee5 100644 (file)
@@ -1,17 +1,14 @@
 comment "rpm requires a toolchain with thread support"
        depends on !BR2_TOOLCHAIN_HAS_THREADS
 
-comment "rpm requires libneon with SSL, XML and ZLIB support"
-       depends on !BR2_PACKAGE_NEON || BR2_PACKAGE_NEON_NOXML && BR2_TOOLCHAIN_HAS_THREADS
-
 config BR2_PACKAGE_RPM
        bool "rpm"
        depends on BR2_TOOLCHAIN_HAS_THREADS # beecrypt
        select BR2_PACKAGE_BEECRYPT
        select BR2_PACKAGE_POPT
        select BR2_PACKAGE_OPENSSL
-       depends on BR2_PACKAGE_NEON
-       depends on !BR2_PACKAGE_NEON_NOXML
+       select BR2_PACKAGE_NEON
+       select BR2_PACKAGE_NEON_XML
        select BR2_PACKAGE_NEON_ZLIB
        select BR2_PACKAGE_NEON_SSL
        help