protobuf: introduce BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 4 Feb 2016 22:04:13 +0000 (23:04 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 4 Feb 2016 22:04:13 +0000 (23:04 +0100)
The architecture dependencies of protobuf are going to change, and
they are already duplicated between protobuf, ola and mosh. In order
to factorize the expression of those dependencies, this commit
introduces BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS.

Note that we include in this hidden Config.in option both the target
architecture dependency and the host architecture dependency.

Finally, this commit also fixes a real mistake in the mosh Config.in
file, where the condition on the architecture dependency for the
Config.in comment was inverted: we only want to show the Config.in
comment when we are on supported architectures.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/mosh/Config.in
package/ola/Config.in
package/protobuf/Config.in

index 868b9ffcb38d112b585e7d7b6cbd69dafe0afc51..26f72339896ad5a16fcc79e2bfa2e07c2266ea73 100644 (file)
@@ -1,15 +1,14 @@
 comment "mosh needs a toolchain w/ C++, threads, dynamic library"
        depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP \
                || BR2_STATIC_LIBS
-       depends on !(BR2_arm || BR2_i386 || BR2_mipsel || BR2_x86_64)
+       depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
 
 config BR2_PACKAGE_MOSH
        bool "mosh"
-       depends on BR2_arm || BR2_i386 || BR2_mipsel || BR2_x86_64 # protobuf
+       depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
        depends on BR2_INSTALL_LIBSTDCPP # protobuf
        depends on BR2_TOOLCHAIN_HAS_THREADS # protobuf
        depends on !BR2_STATIC_LIBS # protobuf
-       depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" # protobuf
        select BR2_PACKAGE_PROTOBUF
        select BR2_PACKAGE_NCURSES
        select BR2_PACKAGE_OPENSSL
index fd693ded8cf073fc1c1d4add6ab3365ae8428a7f..55cea65d87d48377084f971da80331bcb3dfc970 100644 (file)
@@ -1,7 +1,7 @@
 comment "ola needs a toolchain w/ C++, threads, wchar, dynamic library"
        depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR \
                || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
-       depends on BR2_arm || BR2_i386 || BR2_mipsel || BR2_x86_64
+       depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
 
 config BR2_PACKAGE_OLA
        bool "ola (open lighting architecture)"
@@ -12,9 +12,7 @@ config BR2_PACKAGE_OLA
        depends on !BR2_STATIC_LIBS # protobuf
        depends on BR2_USE_WCHAR # util-linux
        depends on BR2_TOOLCHAIN_HAS_THREADS
-       depends on BR2_arm || BR2_i386 || BR2_mipsel || BR2_x86_64 # protobuf
-       # protobuf -> host-protobuf
-       depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+       depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
        help
          Open Lighting Architecture provides applications
          with a mechanism to send and receive DMX512 & RDM
index 9ee7e7df451515e3ea63e78333b510410b237e4c..3d4320bfca1ac7f65ebb600c954f4b1437e32ff2 100644 (file)
@@ -1,12 +1,19 @@
+# See src/google/protobuf/stubs/platform_macros.h for supported archs.
+# PowerPC doesn't actually work.
+# host-protobuf only builds on certain architectures
+config BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
+       bool
+       default y if BR2_arm
+       default y if BR2_i386
+       default y if BR2_mipsel
+       default y if BR2_x86_64
+       depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+
 config BR2_PACKAGE_PROTOBUF
        bool "protobuf"
        depends on BR2_INSTALL_LIBSTDCPP
        depends on BR2_TOOLCHAIN_HAS_THREADS
-       # See src/google/protobuf/stubs/platform_macros.h for supported archs.
-       # PowerPC doesn't actually work.
-       depends on BR2_arm || BR2_i386 || BR2_mipsel || BR2_x86_64
-       # host-protobuf only builds on certain architectures
-       depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+       depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
        depends on !BR2_STATIC_LIBS
        help
          Protocol buffers are Google's language-neutral, platform-neutral,
@@ -17,5 +24,4 @@ config BR2_PACKAGE_PROTOBUF
 comment "protobuf needs a toolchain w/ C++, threads, dynamic library"
        depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
                || BR2_STATIC_LIBS
-       depends on BR2_arm || BR2_i386 || BR2_mipsel || BR2_x86_64
-       depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+       depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS