All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/2] Config.in: add symbols for BR2_HOST_GCC_AT_LEAST_X_Y
@ 2015-12-29 23:22 Arnout Vandecappelle
  2015-12-29 23:22 ` [Buildroot] [PATCH v2 2/2] nodejs: version 4.X needs host GCC >= 4.8 Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2015-12-29 23:22 UTC (permalink / raw)
  To: buildroot

Some host packages need a recent gcc version. Add symbols to Config.in
to specify the HOSTCC version. The values are passed through the
environment, and this environment is generated in a new support script.

Also update the documentation to mention the new symbols.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
v2: Use a single environment variable and select statements (Yann)
    This makes the shell script ridiculously simple. I've tried to move
    it to the Makefile, but then all the additional quoting etc. makes
    it complicated again.
---
 Config.in                                 | 24 ++++++++++++++++++++++
 Makefile                                  |  1 +
 docs/manual/adding-packages-directory.txt |  7 +++++++
 support/scripts/gcc-version-variables     | 33 +++++++++++++++++++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100755 support/scripts/gcc-version-variables

diff --git a/Config.in b/Config.in
index 9513cc1..bbbefb0 100644
--- a/Config.in
+++ b/Config.in
@@ -18,6 +18,30 @@ config BR2_EXTERNAL
 	string
 	option env="BR2_EXTERNAL"
 
+# Hidden config symbols for packages to check system gcc version
+config BR2_HOST_GCC_VERSION
+	string
+	option env="HOST_GCC_VERSION"
+
+config BR2_HOST_GCC_AT_LEAST_4_7
+	bool
+	default y if BR2_HOST_GCC_VERSION = "47"
+
+config BR2_HOST_GCC_AT_LEAST_4_8
+	bool
+	default y if BR2_HOST_GCC_VERSION = "48"
+	select BR2_HOST_GCC_AT_LEAST_4_7
+
+config BR2_HOST_GCC_AT_LEAST_4_9
+	bool
+	default y if BR2_HOST_GCC_VERSION = "49"
+	select BR2_HOST_GCC_AT_LEAST_4_8
+
+config BR2_HOST_GCC_AT_LEAST_5
+	bool
+	default y if BR2_HOST_GCC_VERSION = "5"
+	select BR2_HOST_GCC_AT_LEAST_4_9
+
 # Hidden boolean selected by packages in need of Java in order to build
 # (example: xbmc)
 config BR2_NEEDS_HOST_JAVA
diff --git a/Makefile b/Makefile
index 1d69192..93fae7d 100644
--- a/Makefile
+++ b/Makefile
@@ -724,6 +724,7 @@ COMMON_CONFIG_ENV = \
 	KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
 	BR2_CONFIG=$(BR2_CONFIG) \
 	BR2_EXTERNAL=$(BR2_EXTERNAL) \
+	$(shell support/scripts/gcc-version-variables $(HOSTCC_NOCCACHE)) \
 	SKIP_LEGACY=
 
 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
diff --git a/docs/manual/adding-packages-directory.txt b/docs/manual/adding-packages-directory.txt
index 139123e..c2d9f75 100644
--- a/docs/manual/adding-packages-directory.txt
+++ b/docs/manual/adding-packages-directory.txt
@@ -283,6 +283,13 @@ use in the comment.
 ** Comment string: +gcc >= X.Y+ and/or `gcc <= X.Y` (replace
    +X.Y+ with the proper version)
 
+* Host GCC version
+** Dependency symbol: +BR2_HOST_GCC_AT_LEAST_X_Y+, (replace
+   +X_Y+ with the proper version, see +Config.in+)
+** Comment string: no comment to be added
+** Note that it is usually not the package itself that has a minimum
+   host GCC version, but rather a host-package on which it depends.
+
 * C library
 ** Dependency symbol: +BR2_TOOLCHAIN_USES_GLIBC+,
    +BR2_TOOLCHAIN_USES_MUSL+, +BR2_TOOLCHAIN_USES_UCLIBC+
diff --git a/support/scripts/gcc-version-variables b/support/scripts/gcc-version-variables
new file mode 100755
index 0000000..346215d
--- /dev/null
+++ b/support/scripts/gcc-version-variables
@@ -0,0 +1,33 @@
+#! /bin/sh
+#
+# Print the environment variables for top-level Config.in's
+# HOST_GCC_AT_LEAST_X_Y. First argument is the compiler.
+#
+# Copyright (C) 2014 by the Buildroot developers <buildroot@buildroot.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+HOSTCC_NOCCACHE="$1"
+
+# hostcc version as an integer - E.G. 4.9.2 => 49
+HOSTCC_VERSION=$(${HOSTCC_NOCCACHE} --version | \
+    sed -n 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[ ]*.*$/\1\2/p')
+
+if [ "$HOSTCC_VERSION" -ge 50 ]; then
+    HOSTCC_VERSION=${HOSTCC_VERSION%?}
+fi
+printf "HOST_GCC_VERSION=%d " "$HOSTCC_VERSION"
+
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 2/2] nodejs: version 4.X needs host GCC >= 4.8
  2015-12-29 23:22 [Buildroot] [PATCH v2 1/2] Config.in: add symbols for BR2_HOST_GCC_AT_LEAST_X_Y Arnout Vandecappelle
@ 2015-12-29 23:22 ` Arnout Vandecappelle
  2015-12-29 23:27   ` [Buildroot] [PATCH v3] nodejs: version 5.X " Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2015-12-29 23:22 UTC (permalink / raw)
  To: buildroot

Fixes
http://autobuild.buildroot.org/results/4589dd076585d6472ad1e65926ffe68343b94422
http://autobuild.buildroot.org/results/e3147c0d9c9eb9f58773b75c8cb4ea49df483611
and many more.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
v2: no change, just updated autobuild references
---
 package/nodejs/Config.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/nodejs/Config.in b/package/nodejs/Config.in
index 008fbbf..3dfccac 100644
--- a/package/nodejs/Config.in
+++ b/package/nodejs/Config.in
@@ -48,12 +48,14 @@ config BR2_PACKAGE_NODEJS_0_10_X
 config BR2_PACKAGE_NODEJS_5_X
 	bool "v5.3.0"
 	depends on BR2_PACKAGE_NODEJS_V8_ARCH_SUPPORTS
+	depends on BR2_HOST_GCC_AT_LEAST_4_8
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
 	depends on BR2_USE_WCHAR
 
 comment "v5.3.0 needs a toolchain w/ gcc >= 4.8, wchar"
 	depends on BR2_PACKAGE_NODEJS_V8_ARCH_SUPPORTS
 	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || !BR2_USE_WCHAR
+	depends on BR2_HOST_GCC_AT_LEAST_4_8
 
 endchoice
 
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v3] nodejs: version 5.X needs host GCC >= 4.8
  2015-12-29 23:22 ` [Buildroot] [PATCH v2 2/2] nodejs: version 4.X needs host GCC >= 4.8 Arnout Vandecappelle
@ 2015-12-29 23:27   ` Arnout Vandecappelle
  2015-12-31  9:36     ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2015-12-29 23:27 UTC (permalink / raw)
  To: buildroot

Fixes
http://autobuild.buildroot.org/results/4589dd076585d6472ad1e65926ffe68343b94422
http://autobuild.buildroot.org/results/e3147c0d9c9eb9f58773b75c8cb4ea49df483611
and many more.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
v3: update commit message 4.X -> 5.X
v2: no change, just updated autobuild references
---
 package/nodejs/Config.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/nodejs/Config.in b/package/nodejs/Config.in
index 008fbbf..3dfccac 100644
--- a/package/nodejs/Config.in
+++ b/package/nodejs/Config.in
@@ -48,12 +48,14 @@ config BR2_PACKAGE_NODEJS_0_10_X
 config BR2_PACKAGE_NODEJS_5_X
 	bool "v5.3.0"
 	depends on BR2_PACKAGE_NODEJS_V8_ARCH_SUPPORTS
+	depends on BR2_HOST_GCC_AT_LEAST_4_8
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
 	depends on BR2_USE_WCHAR
 
 comment "v5.3.0 needs a toolchain w/ gcc >= 4.8, wchar"
 	depends on BR2_PACKAGE_NODEJS_V8_ARCH_SUPPORTS
 	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || !BR2_USE_WCHAR
+	depends on BR2_HOST_GCC_AT_LEAST_4_8
 
 endchoice
 
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v3] nodejs: version 5.X needs host GCC >= 4.8
  2015-12-29 23:27   ` [Buildroot] [PATCH v3] nodejs: version 5.X " Arnout Vandecappelle
@ 2015-12-31  9:36     ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2015-12-31  9:36 UTC (permalink / raw)
  To: buildroot

Arnout,

On Wed, 30 Dec 2015 00:27:48 +0100, Arnout Vandecappelle
(Essensium/Mind) wrote:
> Fixes
> http://autobuild.buildroot.org/results/4589dd076585d6472ad1e65926ffe68343b94422
> http://autobuild.buildroot.org/results/e3147c0d9c9eb9f58773b75c8cb4ea49df483611
> and many more.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> v3: update commit message 4.X -> 5.X
> v2: no change, just updated autobuild references
> ---
>  package/nodejs/Config.in | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-31  9:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-29 23:22 [Buildroot] [PATCH v2 1/2] Config.in: add symbols for BR2_HOST_GCC_AT_LEAST_X_Y Arnout Vandecappelle
2015-12-29 23:22 ` [Buildroot] [PATCH v2 2/2] nodejs: version 4.X needs host GCC >= 4.8 Arnout Vandecappelle
2015-12-29 23:27   ` [Buildroot] [PATCH v3] nodejs: version 5.X " Arnout Vandecappelle
2015-12-31  9:36     ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.