* [Buildroot] [PATCH 2/2] package/powertop: depends on c++
2015-03-27 16:01 [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw Bernd Kuhls
@ 2015-03-27 16:01 ` Bernd Kuhls
2015-03-31 23:06 ` Gustavo Zacarias
2015-04-01 22:07 ` Thomas Petazzoni
2015-03-27 16:34 ` [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw Thomas Petazzoni
2015-04-01 22:07 ` Thomas Petazzoni
2 siblings, 2 replies; 8+ messages in thread
From: Bernd Kuhls @ 2015-03-27 16:01 UTC (permalink / raw)
To: buildroot
Fixes configure error due to missing c++
checking for library containing pthread_create... no
configure: error: libpthread is required but was not found
Quote from config.log:
configure:21552: checking for library containing pthread_create
configure:21583: false -o conftest -Os conftest.cpp -lintl >&5
[...]
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value=false
using this defconfig
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_PACKAGE_POWERTOP=y
Please note the number of .cpp files belonging to powertop
output/build/powertop-2.7$ find -iname *.cpp | wc -l
59
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
package/powertop/Config.in | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/package/powertop/Config.in b/package/powertop/Config.in
index cee78e5..398764e 100644
--- a/package/powertop/Config.in
+++ b/package/powertop/Config.in
@@ -1,9 +1,8 @@
config BR2_PACKAGE_POWERTOP
bool "powertop"
- # pciutils dependency
- depends on !BR2_bfin
- # libnl dependency
- depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on !BR2_bfin # pciutils
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_TOOLCHAIN_HAS_THREADS # libnl
depends on BR2_USE_WCHAR # ncurses
select BR2_PACKAGE_NCURSES
select BR2_PACKAGE_NCURSES_WCHAR
@@ -15,6 +14,7 @@ config BR2_PACKAGE_POWERTOP
https://01.org/powertop/
-comment "powertop needs a toolchain w/ threads, wchar"
+comment "powertop needs a toolchain w/ C++, threads, wchar"
depends on !BR2_bfin
- depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
+ depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
+ !BR2_USE_WCHAR
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 2/2] package/powertop: depends on c++
2015-03-27 16:01 ` [Buildroot] [PATCH 2/2] package/powertop: depends on c++ Bernd Kuhls
@ 2015-03-31 23:06 ` Gustavo Zacarias
2015-04-01 22:07 ` Thomas Petazzoni
1 sibling, 0 replies; 8+ messages in thread
From: Gustavo Zacarias @ 2015-03-31 23:06 UTC (permalink / raw)
To: buildroot
On 03/27/2015 01:01 PM, Bernd Kuhls wrote:
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
.cpp files which #include <iostream> are a pretty good indication of C++ :)
Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 2/2] package/powertop: depends on c++
2015-03-27 16:01 ` [Buildroot] [PATCH 2/2] package/powertop: depends on c++ Bernd Kuhls
2015-03-31 23:06 ` Gustavo Zacarias
@ 2015-04-01 22:07 ` Thomas Petazzoni
1 sibling, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2015-04-01 22:07 UTC (permalink / raw)
To: buildroot
Dear Bernd Kuhls,
On Fri, 27 Mar 2015 17:01:37 +0100, Bernd Kuhls wrote:
> Fixes configure error due to missing c++
>
> checking for library containing pthread_create... no
> configure: error: libpthread is required but was not found
>
> Quote from config.log:
>
> configure:21552: checking for library containing pthread_create
> configure:21583: false -o conftest -Os conftest.cpp -lintl >&5
> [...]
> ac_cv_env_CXX_set=set
> ac_cv_env_CXX_value=false
>
> using this defconfig
>
> BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
> BR2_PACKAGE_POWERTOP=y
>
> Please note the number of .cpp files belonging to powertop
>
> output/build/powertop-2.7$ find -iname *.cpp | wc -l
> 59
>
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Applied, thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw
2015-03-27 16:01 [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw Bernd Kuhls
2015-03-27 16:01 ` [Buildroot] [PATCH 2/2] package/powertop: depends on c++ Bernd Kuhls
@ 2015-03-27 16:34 ` Thomas Petazzoni
2015-03-27 17:16 ` Bernd Kuhls
2015-04-01 22:07 ` Thomas Petazzoni
2 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2015-03-27 16:34 UTC (permalink / raw)
To: buildroot
Dear Bernd Kuhls,
On Fri, 27 Mar 2015 17:01:36 +0100, Bernd Kuhls wrote:
> Fixes
> http://autobuild.buildroot.net/results/913/913cea22f8a8f5902d8da5f64c3fce056d66790f/
> http://autobuild.buildroot.net/results/6e1/6e11fa2a7405a69c59ced046b92ff08660c4aab7/
> http://autobuild.buildroot.net/results/1d3/1d3323b2afaefa7989854dbccf92015731199e66/
> http://autobuild.buildroot.net/results/1e3/1e31d412d8b3a38a375ad0be8f696bee993ec297/
> http://autobuild.buildroot.net/results/2ff/2ff511eb8d00b94aca68427446e2d0f6e4317a5a/
> and maybe others
>
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
I am not sure about this patch. I believe there might be a bug in the
powertop configure.ac script. It's doing:
PKG_CHECK_MODULES([NCURSES], [ncursesw ncurses], [LIBS="$LIBS $ncurses_LIBS"], [
AC_SEARCH_LIBS([delwin], [ncursesw ncurses], [], [
AC_MSG_ERROR([ncurses is required but was not found])
], [])
])
So, when using PKG_CHECK_MODULES(), it wants both ncursesw and ncurses.
But if that fails, it tests with AC_SEARCH_LIBS(), but in this case, it
is looking for either ncursesw *or* ncurses.
Am I missing something?
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread* [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw
2015-03-27 16:34 ` [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw Thomas Petazzoni
@ 2015-03-27 17:16 ` Bernd Kuhls
2015-03-31 23:03 ` Gustavo Zacarias
0 siblings, 1 reply; 8+ messages in thread
From: Bernd Kuhls @ 2015-03-27 17:16 UTC (permalink / raw)
To: buildroot
[posted and mailed]
Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8
@public.gmane.org> wrote in news:20150327173446.779683cf at free-electrons.com:
> Am I missing something?
Hi,
powertop is a weird piece of code;)
Using this defconfig
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_POWERTOP=y
configure works
checking for NCURSES... no
checking for library containing delwin... -lncurses
[...]
but then this happens:
lib.cpp: In function 'void align_string(char*, size_t, size_t)':
lib.cpp:271:59: error: 'mbsrtowcs' was not declared in this scope
sz = mbsrtowcs(NULL, (const char **)&buffer, max_sz, NULL);
Afaics mbsrtowcs() is a function which is only available with a wchar-enabled
toolchain, so my patch does the right thing, but the description needs some
additions.
Regards, Bernd
PS: Upstream of the powertop tarball is problematic:
http://autobuild.buildroot.net/results/50e/50e70b0c7c3533ddb7397fa7542a9369bf
7a7249/build-end.log
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw
2015-03-27 17:16 ` Bernd Kuhls
@ 2015-03-31 23:03 ` Gustavo Zacarias
0 siblings, 0 replies; 8+ messages in thread
From: Gustavo Zacarias @ 2015-03-31 23:03 UTC (permalink / raw)
To: buildroot
On 03/27/2015 02:16 PM, Bernd Kuhls wrote:
> Hi,
>
> powertop is a weird piece of code;)
>
> Using this defconfig
>
> BR2_TOOLCHAIN_BUILDROOT_CXX=y
> BR2_PACKAGE_POWERTOP=y
>
> configure works
>
> checking for NCURSES... no
> checking for library containing delwin... -lncurses
> [...]
>
> but then this happens:
>
> lib.cpp: In function 'void align_string(char*, size_t, size_t)':
> lib.cpp:271:59: error: 'mbsrtowcs' was not declared in this scope
> sz = mbsrtowcs(NULL, (const char **)&buffer, max_sz, NULL);
>
> Afaics mbsrtowcs() is a function which is only available with a wchar-enabled
> toolchain, so my patch does the right thing, but the description needs some
> additions.
Hi.
Actually mb* and wc* usage is a pointer towards wchar, yes.
But in ncurses-land there's no need for ncursesw since powertop doesn't
use any of the wide (*_wch) variant functions.
Hence it just sucks at finding libncurses: you can drop the
NCURSES_WCHAR select and do something like:
$(if $(BR2_PACKAGE_NCURSES_WCHAR),y)
POWERTOP_CONF_ENV += ac_cv_search_delwin="-lncursesw"
else
POWERTOP_CONF_ENV += ac_cv_search_delwin="-lncurses"
fi
(or in a single if if you're so inclined).
Regards.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw
2015-03-27 16:01 [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw Bernd Kuhls
2015-03-27 16:01 ` [Buildroot] [PATCH 2/2] package/powertop: depends on c++ Bernd Kuhls
2015-03-27 16:34 ` [Buildroot] [PATCH 1/2] package/powertop: needs ncursesw Thomas Petazzoni
@ 2015-04-01 22:07 ` Thomas Petazzoni
2 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2015-04-01 22:07 UTC (permalink / raw)
To: buildroot
Dear Bernd Kuhls,
On Fri, 27 Mar 2015 17:01:36 +0100, Bernd Kuhls wrote:
> Fixes
> http://autobuild.buildroot.net/results/913/913cea22f8a8f5902d8da5f64c3fce056d66790f/
> http://autobuild.buildroot.net/results/6e1/6e11fa2a7405a69c59ced046b92ff08660c4aab7/
> http://autobuild.buildroot.net/results/1d3/1d3323b2afaefa7989854dbccf92015731199e66/
> http://autobuild.buildroot.net/results/1e3/1e31d412d8b3a38a375ad0be8f696bee993ec297/
> http://autobuild.buildroot.net/results/2ff/2ff511eb8d00b94aca68427446e2d0f6e4317a5a/
> and maybe others
>
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
> package/powertop/Config.in | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
I've applied your patch, but after changing it according to Gustavo's
suggestion: ncurses wchar is not mandatory, but a little help is needed
to teach powertop about which variant of ncurses is available.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread