Skip to contentSkip to conversation

Error when adding media-ctl as package

Buildroot Patrick 3 participants 12 messages Jan 8, 2013 – Jan 9, 2013

lore
Share & tools
lore

Patrick

author
#0 lore raw

Dear mailing list,

I am working with buildroot 2012.11 and I need to add the media-ctl tool
(http://git.ideasonboard.org/media-ctl.git).

I have added this tool in buildroot as a package following the buildroot user manual and this:
https://github.com/MaxGalemin/buildroot/commit/2ac3323f9d40c2610128d3a22fee8dd195979dc9

The Config.in and media-ctl.mk files I have added are attached to this mail.

When doing "make media-ctl" I have the following error when buildroot do the configure step :

checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
./configure: 10676: ./configure.lineno: Syntax error: word unexpected
(expecting ")")
make: *** [/home/pgerber/imusba/buildroot/output/build/media-ctl-36a1357c9c879092fe2e36c82187f1d35b1efe13/.stamp_configured] Error 2

As anyone have any idea why I have this and how to fix it ? Any help is welcome.

Thanks in advance

Patrick
-------------- next part --------------
config BR2_PACKAGE_MEDIA_CTL
bool "media-ctl"
help
Media controller control application
-------------- next part --------------
#############################################################
#

# media-ctl
#
#############################################################

#MEDIA_CTL_VERSION = ac40b79f002a2315f909548614ccd2d408da25b7 MEDIA_CTL_VERSION = 36a1357c9c879092fe2e36c82187f1d35b1efe13 MEDIA_CTL_SITE = git://git.ideasonboard.org/media-ctl.git
MEDIA_CTL_INSTALL_STAGING = YES
MEDIA_CTL_LICENSE = GPLv2
MEDIA_CTL_LICENSE_FILES = COPYING.LIB
MEDIA_CTL_AUTORECONF = YES
MEDIA_CTL_AUTORECONF_OPT = --install
MEDIA_CTL_CONF_OPT = --with-kernel-headers=$(STAGING_DIR)/usr/include

$(eval $(autotools-package))

#1 lore raw
Quoted 24 lines · Patrick

Dear mailing list,

I am working with buildroot 2012.11 and I need to add the media-ctl tool
(http://git.ideasonboard.org/media-ctl.git).

I have added this tool in buildroot as a package following the buildroot user manual and this:
https://github.com/MaxGalemin/buildroot/commit/2ac3323f9d40c2610128d3a22fee8dd195979dc9

The Config.in and media-ctl.mk files I have added are attached to this mail.

When doing "make media-ctl" I have the following error when buildroot do the configure step :

checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
./configure: 10676: ./configure.lineno: Syntax error: word unexpected
(expecting ")")
make: *** [/home/pgerber/imusba/buildroot/output/build/media-ctl-36a1357c9c879092fe2e36c82187f1d35b1efe13/.stamp_configured] Error 2

Quoted 2 lines

As anyone have any idea why I have this and how to fix it ? Any help is welcome.

Can you

- post the way that configure is called (just after "media-ctl 36a... Configuring");

- look at line 10676 of output/build/media-ctl-36a*/configure and see if there's anything suspicious;

- perhaps add some additional echo's before line 10676 to see what might go wrong.

Note that it works fine for me.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
author
#2 lore raw
Quoted 39 lines · Arnout Vandecappelle
Quoted 25 lines · Patrick

Dear mailing list,

I am working with buildroot 2012.11 and I need to add the media-ctl tool
(http://git.ideasonboard.org/media-ctl.git).

I have added this tool in buildroot as a package following the buildroot user manual and this:
https://github.com/MaxGalemin/buildroot/commit/2ac3323f9d40c2610128d3a22fee8dd195979dc9

The Config.in and media-ctl.mk files I have added are attached to this mail.

When doing "make media-ctl" I have the following error when buildroot do the configure step :

checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
./configure: 10676: ./configure.lineno: Syntax error: word unexpected
(expecting ")")
make: *** [/home/patrick/project/buildroot/output/build/media-ctl-36a1357c9c879092fe2e36c82187f1d35b1efe13/.stamp_configured]

Quoted 4 lines

Error 2

As anyone have any idea why I have this and how to fix it ? Any help is welcome.

Can you

- post the way that configure is called (just after "media-ctl 36a... Configuring");

- look at line 10676 of output/build/media-ctl-36a*/configure and see if there's anything suspicious;

Quoted 9 lines

- perhaps add some additional echo's before line 10676 to see what might go wrong.

Note that it works fine for me.

Regards,
Arnout

The line 10964 is the following:

PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no)

When building media-ctl by hand following this
(http://www.dobots.nl/blog/-/blogs/in-the-spotlight-linux-) is works nicelly. When looking at the configure file generated when building by hand the 10964 is completely different... I have checked that in both case I use autoreconf 2.68.

You say that it works fine for you ? Which version of buildroot do you use ?

Please find below the way that configure is called. Could you please copy-paste me your call of configure ?

Quoted 1 line
Quoted 1 line
Quoted 1 line

media-ctl ac40b79f002a2315f909548614ccd2d408da25b7 Configuring

(cd
/home/patrick/project/buildroot/output/build/media-ctl-ac40b79f002a2315f909548614ccd2d408da25b7/
&& rm -rf config.cache && PATH="/home/patrick/project/buildroot/output/host/bin:/home/patrick/project/buildroot/output/host/usr/bin:/home/patrick/project/buildroot/output/host/usr/sbin/:/usr/local/context/tex/texmf-linux/bin:/usr/local/context/bin:/opt/CodeSourcery/bin:/opt/OSELAS.Toolchain-2011.02.0/arm-cortexa9-linux-gnueabi/gcc-linaro-4.5-2011.02-0-glibc-2.13-binutils-2.21-kernel-2.6.36-sanitized/bin/:/usr/local/angstrom/arm/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" AR="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-ar"
AS="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-as"
LD="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-ld"
NM="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-nm"
CC="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-gcc"
GCC="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-gcc"
CPP="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-cpp"
CXX="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-g++"
FC="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-gfortran"
RANLIB="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-ranlib"
READELF="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-readelf"
STRIP="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-strip"
OBJCOPY="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-objcopy"
OBJDUMP="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-objdump"
AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as"
CC_FOR_BUILD="/usr/bin/gcc" GCC_FOR_BUILD="/usr/bin/gcc"
CXX_FOR_BUILD="/usr/bin/g++" FC_FOR_BUILD="/usr/bin/ld"
LD_FOR_BUILD="/usr/bin/ld"
CPPFLAGS_FOR_BUILD="-I/home/patrick/project/buildroot/output/host/usr/include"
CFLAGS_FOR_BUILD="-O2
-I/home/patrick/project/buildroot/output/host/usr/include"
CXXFLAGS_FOR_BUILD="-O2
-I/home/patrick/project/buildroot/output/host/usr/include"
LDFLAGS_FOR_BUILD="-L/home/patrick/project/buildroot/output/host/lib
-L/home/patrick/project/buildroot/output/host/usr/lib
-Wl,-rpath,/home/patrick/project/buildroot/output/host/usr/lib"
FCFLAGS_FOR_BUILD=""
DEFAULT_ASSEMBLER="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-as"
DEFAULT_LINKER="/home/patrick/project/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-ld"
CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os "
CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -pipe -Os " LDFLAGS="" FCFLAGS=""
PKG_CONFIG="/home/patrick/project/buildroot/output/host/usr/bin/pkg-config"
PERLLIB="/home/patrick/project/buildroot/output/host/usr/lib/perl"
STAGING_DIR="/home/patrick/project/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot"
ac_cv_lbl_unaligned_fail=yes ac_cv_func_mmap_fixed_mapped=yes
ac_cv_func_memcmp_working=yes ac_cv_have_decl_malloc=yes
gl_cv_func_malloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_calloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes
lt_cv_sys_lib_search_path_spec="" ac_cv_c_bigendian=no ARCH=arm
CROSS_COMPILE=arm-none-linux-gnueabi- ./configure
--target=arm-buildroot-linux-gnueabi --host=arm-buildroot-linux-gnueabi
--build=i686-pc-linux-gnu --prefix=/usr --exec-prefix=/usr
--sysconfdir=/etc --program-prefix="" --disable-gtk-doc --enable-ipv6
--enable-static --enable-shared
--with-kernel-headers=/home/patrick/project/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include
)
configure: WARNING: unrecognized options: --disable-gtk-doc, --enable-ipv6

Thanks for your help

Patrick

#3 lore raw

Dear Patrick,

Quoted 3 lines · Patrick

The line 10964 is the following:

PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no)

This macro should have been expanded during the autoreconf. So there is some .m4 file missing with the definition of this PKG_CHECK_MODULES() macro.

Could you add:

MEDIA_CTL_DEPENDENCIES = host-pkgconf

in your media-ctl.mk file?

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#4 lore raw
Quoted 8 lines · Thomas Petazzoni

Dear Patrick,
Could you add:

MEDIA_CTL_DEPENDENCIES = host-pkgconf

in your media-ctl.mk file?

Dear Thomas,

Thanks that it, issues fixed ! Thanks

I now have another issue:

checking linux/media.h usability... no checking linux/media.h presence... no checking for linux/media.h... no
ERROR: Kernel header file not found or not usable!

I think that a "make headers_install" is missing when compiling the kernel. I use a buildroot external toolchain. How could I say to buildboot to add the "make headers_install" step ?

Thanks in advance

Patrick

#5 lore raw

Dear Patrick,

Quoted 8 lines · Patrick

checking linux/media.h usability... no checking linux/media.h presence... no checking for linux/media.h... no
ERROR: Kernel header file not found or not usable!

I think that a "make headers_install" is missing when compiling the kernel. I use a buildroot external toolchain. How could I say to buildboot to add the "make headers_install" step ?

Normally, the kernel headers are part of the toolchain, so they should already be in $(STAGING_DIR)/usr/include without having to do anything special.

However, if your toolchain is too old, it may not contain sufficiently up-to-date kernel headers. The simplest option is to try to update your toolchain to a slightly more recent one, so that media.h is provided directly with your toolchain, and we have nothing to do.

If it doesn't work, then it's annoying, because we don't really have a good way to install the kernel headers of the kernel being built by Buildroot... It's doable, but it would probably mean that the media-ctl package would depend on BR2_LINUX_KERNEL, which would make it unusable for people who build their kernel outside of Buildroot. Maybe an acceptable compromise.

Another solution is to carry a patch in the media-ctl package that adds a local copy of the media.h header (and other needed kernel headers).

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#6 lore raw
Quoted 29 lines · Thomas Petazzoni

Dear Patrick,

Quoted 8 lines · Patrick

checking linux/media.h usability... no checking linux/media.h presence... no checking for linux/media.h... no
ERROR: Kernel header file not found or not usable!

I think that a "make headers_install" is missing when compiling the kernel. I use a buildroot external toolchain. How could I say to buildboot to add the "make headers_install" step ?

Normally, the kernel headers are part of the toolchain, so they should already be in $(STAGING_DIR)/usr/include without having to do anything special.

However, if your toolchain is too old, it may not contain sufficiently up-to-date kernel headers. The simplest option is to try to update your toolchain to a slightly more recent one, so that media.h is provided directly with your toolchain, and we have nothing to do.

If it doesn't work, then it's annoying, because we don't really have a good way to install the kernel headers of the kernel being built by Buildroot... It's doable, but it would probably mean that the media-ctl package would depend on BR2_LINUX_KERNEL, which would make it unusable for people who build their kernel outside of Buildroot. Maybe an acceptable compromise.

Quoted 5 lines

Another solution is to carry a patch in the media-ctl package that adds a local copy of the media.h header (and other needed kernel headers).

Thomas

Ok I updated to a more recent toolchain and it works.

Thanks for your help

Patrick

#7 lore raw

Dear Patrick,

Quoted 1 line · Patrick

Ok I updated to a more recent toolchain and it works.

Good. Could you submit a proper patch adding the media-ctl package in Buildroot?

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#8 lore raw
Quoted 4 lines · Thomas Petazzoni

Dear Patrick,

On Wed, 09 Jan 2013 10:36:00 +0100, Patrick wrote:

Quoted 9 lines
Quoted 1 line

Ok I updated to a more recent toolchain and it works.

Good. Could you submit a proper patch adding the media-ctl package in Buildroot?

Thanks!

Thomas

Ok I will did it !

Patrick

author
#9 lore raw
In reply to Patrick
Quoted 12 lines · Patrick
Quoted 9 lines · Thomas Petazzoni

Dear Patrick,

However, if your toolchain is too old, it may not contain sufficiently up-to-date kernel headers. The simplest option is to try to update your toolchain to a slightly more recent one, so that media.h is provided directly with your toolchain, and we have nothing to do.

Thomas

Ok I updated to a more recent toolchain and it works.

After changing the toolchain I have a really annoying side effect: my kernel do not boot anymore !

My previous toolchain was Sourcery G++ Lite 2009q1-203 GCC 4.3.3, my new toolchain is Sourcery CodeBench ARM 2012.03. I run Linux 3.0 on a Ti DM3730 processor.

With both toolchain I do not change the kernel configuration. With the old toolchain the kernel boot nicelly, with the new toolchain the kernel do not boot after u-boot message "Starting kernel ...". I use the same version of u-boot in both case with the same rootfs...

Any idea why changing the toolchain could result in this issue ?

Thanks in advance for any help

Patrick

#10 lore raw

Dear Patrick,

Quoted 7 lines · Patrick

After changing the toolchain I have a really annoying side effect: my kernel do not boot anymore !

My previous toolchain was Sourcery G++ Lite 2009q1-203 GCC 4.3.3, my new toolchain is Sourcery CodeBench ARM 2012.03. I run Linux 3.0 on a Ti DM3730 processor.

Quoted 6 lines

With both toolchain I do not change the kernel configuration. With the old toolchain the kernel boot nicelly, with the new toolchain the kernel do not boot after u-boot message "Starting kernel ...". I use the same version of u-boot in both case with the same rootfs...

Any idea why changing the toolchain could result in this issue ?

Most likely a compiler bug. Maybe you're being hit by
https://patchwork.kernel.org/patch/1438281/. Since you're using a Ti DM3730, can you instead use the Linaro toolchains, that are also pre-configured in Buildroot (just make sure you selected the Cortex-A8 architecture variant in Buildroot) ?

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#11 lore raw
Quoted 24 lines · Thomas Petazzoni

Dear Patrick,

Quoted 7 lines · Patrick

After changing the toolchain I have a really annoying side effect: my kernel do not boot anymore !

My previous toolchain was Sourcery G++ Lite 2009q1-203 GCC 4.3.3, my new toolchain is Sourcery CodeBench ARM 2012.03. I run Linux 3.0 on a Ti DM3730 processor.

Quoted 6 lines

With both toolchain I do not change the kernel configuration. With the old toolchain the kernel boot nicelly, with the new toolchain the kernel do not boot after u-boot message "Starting kernel ...". I use the same version of u-boot in both case with the same rootfs...

Any idea why changing the toolchain could result in this issue ?

Most likely a compiler bug. Maybe you're being hit by
https://patchwork.kernel.org/patch/1438281/. Since you're using a Ti DM3730, can you instead use the Linaro toolchains, that are also pre-configured in Buildroot (just make sure you selected the Cortex-A8 architecture variant in Buildroot) ?

Quoted 4 lines

Thanks,

Thomas

Same issue with Linaro 2012.10...
I have selected ARM little Endian and Cortex-A8

Patrick