All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] gpsd: fix qt build problem
@ 2012-07-24 20:29 spdawson at gmail.com
  2012-07-24 21:00 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: spdawson at gmail.com @ 2012-07-24 20:29 UTC (permalink / raw)
  To: buildroot

From: Simon Dawson <spdawson@gmail.com>

When gpsd is configured with Qt bindings enabled, the build falls over
because the Qt headers are not found.

A representative build log can be seen at

  http://autobuild.buildroot.org/results/c76888749337788c9ae9a04499f1fc1e1c5a2e81/build-end.log

This patch sets CFLAGS in the environment, so that the headers are found.

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 package/gpsd/gpsd.mk |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
index 7d1dbcd..7a492ad 100644
--- a/package/gpsd/gpsd.mk
+++ b/package/gpsd/gpsd.mk
@@ -12,6 +12,7 @@ GPSD_INSTALL_STAGING = YES
 GPSD_DEPENDENCIES = host-scons
 
 GPSD_LDFLAGS = $(TARGET_LDFLAGS)
+GPSD_CFLAGS = $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/QtCore -I$(STAGING_DIR)/usr/include/QtNetwork
 
 GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)
 
@@ -198,7 +199,7 @@ ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
 	GPSD_SCONS_OPTS += limited_max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
 endif
 
-GPSD_SCONS_ENV += LDFLAGS="$(GPSD_LDFLAGS)"
+GPSD_SCONS_ENV += LDFLAGS="$(GPSD_LDFLAGS)" CFLAGS="$(GPSD_CFLAGS)"
 
 define GPSD_BUILD_CMDS
 	(cd $(@D); \
-- 
1.7.9.5

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

* [Buildroot] [PATCH] gpsd: fix qt build problem
  2012-07-24 20:29 [Buildroot] [PATCH] gpsd: fix qt build problem spdawson at gmail.com
@ 2012-07-24 21:00 ` Thomas Petazzoni
  2012-07-25  6:42   ` Simon Dawson
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2012-07-24 21:00 UTC (permalink / raw)
  To: buildroot

Le Tue, 24 Jul 2012 21:29:09 +0100,
spdawson at gmail.com a ?crit :

>  GPSD_LDFLAGS = $(TARGET_LDFLAGS)
> +GPSD_CFLAGS = $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/QtCore -I$(STAGING_DIR)/usr/include/QtNetwork

I'm sorry but no, this is not the right way of fixing it. The QtCore
and QtNetwork header paths are already on the build command line. It's
just that they are wrong because they have two times the sysroot
location:

/home/test/outputs/gpsd/host/usr/bin/arm-linux-gnueabi-g++ -o gpsutils-qt.os -c -pipe -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wpointer-arith -Wreturn-type -O2 -fPIC -DUSE_QT -DQT_SHARED -I/home/test/outputs/gpsd/host/usr/arm-unknown-linux-gnueabi/sysroot/home/test/outputs/gpsd/host/usr/arm-unknown-linux-gnueabi/sysroot/usr/include -I/home/test/outputs/gpsd/host/usr/arm-unknown-linux-gnueabi/sysroot/home/test/outputs/gpsd/host/usr/arm-unknown-linux-gnueabi/sysroot/usr/include/QtNetwork -I/home/test/outputs/gpsd/host/usr/arm-unknown-linux-gnueabi/sysroot/home/test/outputs/gpsd/host/usr/arm-unknown-linux-gnueabi/sysroot/usr/include/QtCore gpsutils.c
gpsutils.c:26:21: fatal error: QDateTime: No such file or directory
compilation terminated.

See
the /home/test/outputs/gpsd/host/usr/arm-unknown-linux-gnueabi/sysroot/home/test/outputs/gpsd/host/usr/arm-unknown-linux-gnueabi/sysroot/usr/include/QtCore
path. The problem is in the directory arguments passed to Scons.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] gpsd: fix qt build problem
  2012-07-24 21:00 ` Thomas Petazzoni
@ 2012-07-25  6:42   ` Simon Dawson
  2012-07-25  6:47     ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Dawson @ 2012-07-25  6:42 UTC (permalink / raw)
  To: buildroot

On 24 July 2012 22:00, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> I'm sorry but no, this is not the right way of fixing it. The QtCore
> and QtNetwork header paths are already on the build command line. It's
> just that they are wrong because they have two times the sysroot
> location:

Yes, agreed. Thanks for the feedback. (I see that you have now
submitted patches to fix this properly.)

Simon.

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

* [Buildroot] [PATCH] gpsd: fix qt build problem
  2012-07-25  6:42   ` Simon Dawson
@ 2012-07-25  6:47     ` Thomas Petazzoni
  2012-07-25  7:03       ` Simon Dawson
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2012-07-25  6:47 UTC (permalink / raw)
  To: buildroot

Le Wed, 25 Jul 2012 07:42:58 +0100,
Simon Dawson <spdawson@gmail.com> a ?crit :

> On 24 July 2012 22:00, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
> > I'm sorry but no, this is not the right way of fixing it. The QtCore
> > and QtNetwork header paths are already on the build command line. It's
> > just that they are wrong because they have two times the sysroot
> > location:
> 
> Yes, agreed. Thanks for the feedback. (I see that you have now
> submitted patches to fix this properly.)

Well, in fact the problem was not in the arguments passed to scons, but
in the .pc files installed by Qt. They contained the full sysroot
location, while they are not supposed to, so when our special
pkg-config prefixed the locations coming from Qt .pc files by the
sysroot again, we had a wrong path.

I wish I didn't had to do this horrible SED'ing of Qt .pc files after
their installation, but unfortunately, the Qt build system handling of
paths is non-standard and it's really not trivial to get something that
builds, installs in the right place, and has the right prefix.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] gpsd: fix qt build problem
  2012-07-25  6:47     ` Thomas Petazzoni
@ 2012-07-25  7:03       ` Simon Dawson
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Dawson @ 2012-07-25  7:03 UTC (permalink / raw)
  To: buildroot

On 25 July 2012 07:47, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> I wish I didn't had to do this horrible SED'ing of Qt .pc files after
> their installation, but unfortunately, the Qt build system handling of
> paths is non-standard and it's really not trivial to get something that
> builds, installs in the right place, and has the right prefix.

Sure. It might not be the prettiest of fixes, but it's still a good
find: no doubt this would have caused a problem sooner or later,
regardless of the gpsd issues.

Simon.

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

end of thread, other threads:[~2012-07-25  7:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-24 20:29 [Buildroot] [PATCH] gpsd: fix qt build problem spdawson at gmail.com
2012-07-24 21:00 ` Thomas Petazzoni
2012-07-25  6:42   ` Simon Dawson
2012-07-25  6:47     ` Thomas Petazzoni
2012-07-25  7:03       ` Simon Dawson

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.