Discussion:
[PATCH] Add option to specify the path to ncurses5-config
Thomas Petazzoni
2012-07-24 20:16:48 UTC
Permalink
By default, gpsd's SConstruct looks in the PATH to find
ncurses5-config. However, in cross-compiling environments, we may need
to tell the SConstruct script to use another ncurses5-config script.

The following implements the equivalent of the
ac_cv_prog_ncurses5_config variable that exists to solve the same
problem in autoconf configure scripts.

The path to the ncurses5-config script can be passed using the
ncurses_config= variable. If no value is passed, the existing behavior
is preserved.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/***@public.gmane.org>

Index: b/SConstruct
===================================================================
--- a/SConstruct
+++ b/SConstruct
@@ -172,6 +172,7 @@
("fixed_stop_bits", 0, "fixed serial port stop bits"),
("target", "", "cross-development target"),
("sysroot", "", "cross-development system root"),
+ ("ncurses_config", "", "ncurses5-config path"),
)
for (name, default, help) in nonboolopts:
opts.Add(name, help, default)
@@ -447,6 +448,11 @@
else:
pkg_config = lambda pkg: ['!%s --cflags --libs --static %s' %(env['PKG_CONFIG'], pkg, )]

+if env['ncurses_config']:
+ ncurses_config = env['ncurses_config']
+else:
+ ncurses_config = "ncurses5-config"
+
# The actual distinction here is whether the platform has ncurses in the
# base system or not. If it does, pkg-config is not likely to tell us
# anything useful. FreeBSD does, Linux doesn't. Most likely other BSDs
@@ -455,8 +461,8 @@
if env['ncurses']:
if config.CheckPKG('ncurses'):
ncurseslibs = pkg_config('ncurses')
- elif config.CheckExecutable('ncurses5-config --version', 'ncurses5-config'):
- ncurseslibs = ['!ncurses5-config --libs --cflags']
+ elif config.CheckExecutable('%s --version' % ncurses_config, 'ncurses5-config'):
+ ncurseslibs = ['!%s --libs --cflags' % ncurses_config]
elif sys.platform.startswith('freebsd'):
ncurseslibs= [ '-lncurses' ]
elif sys.platform.startswith('openbsd'):
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
Mike Frysinger
2012-07-25 16:03:19 UTC
Permalink
Post by Thomas Petazzoni
By default, gpsd's SConstruct looks in the PATH to find
ncurses5-config. However, in cross-compiling environments, we may need
to tell the SConstruct script to use another ncurses5-config script.
why bother at all ? gpsd supports ncurses pkg-config files which solves all
these sort of problems. did you pass --enable-pc-files when running ncurses'
configure script ?
-mike
Thomas Petazzoni
2012-07-25 16:09:37 UTC
Permalink
Le Wed, 25 Jul 2012 12:03:19 -0400,
Post by Mike Frysinger
why bother at all ? gpsd supports ncurses pkg-config files which
solves all these sort of problems. did you pass --enable-pc-files
when running ncurses' configure script ?
Ah, ah. I had seen that gpsd used pkg-config in the first place before
trying ncurses5-config, but I didn't see ncurses having installed .pc
files. I guess we lack the --enable-pc-files, which I'll try. .pc files
are definitely much nicer than those ugly -config shell scripts.

On a different note, we're having cross-compilation problems with the
Python support of gpsd: it uses the host compiler, and wrong library
locations. I haven't gotten to the bottom of it at the moment. Is
anyone using this?

Anyway, thanks Mike for the interesting pointer!

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

____________________________________________
Mike Frysinger
2012-07-25 18:39:38 UTC
Permalink
Post by Thomas Petazzoni
On a different note, we're having cross-compilation problems with the
Python support of gpsd: it uses the host compiler, and wrong library
locations. I haven't gotten to the bottom of it at the moment. Is
anyone using this?
we specifically disable python support when cross-compiling (mostly because we
don't care about python on the target), so haven't hit any problems.

however, be aware that cross-compiling python modules is completely f-ed up,
and it's usually not the fault of end module builders (i.e. gpsd). the python
system itself is pretty bad when it comes to distutils as it likes to mix the
compiler settings used to build python itself when building modules.

ChromiumOS has a few hacks to try and make this work, but i haven't looked too
closely at is as we don't generally do python for the target.
-mike
Marcin Juszkiewicz
2012-07-26 08:41:49 UTC
Permalink
Post by Mike Frysinger
however, be aware that cross-compiling python modules is completely
f-ed up, and it's usually not the fault of end module builders (i.e.
gpsd). the python system itself is pretty bad when it comes to
distutils as it likes to mix the compiler settings used to build
python itself when building modules.
ChromiumOS has a few hacks to try and make this work, but i haven't
looked too closely at is as we don't generally do python for the
target.
Please check how OpenEmbedded handles Python cross compilation. We have
it sorted out long time ago.
Mike Frysinger
2012-07-26 16:31:11 UTC
Permalink
Post by Marcin Juszkiewicz
Post by Mike Frysinger
however, be aware that cross-compiling python modules is completely
f-ed up, and it's usually not the fault of end module builders (i.e.
gpsd). the python system itself is pretty bad when it comes to
distutils as it likes to mix the compiler settings used to build
python itself when building modules.
ChromiumOS has a few hacks to try and make this work, but i haven't
looked too closely at is as we don't generally do python for the
target.
Please check how OpenEmbedded handles Python cross compilation. We have
it sorted out long time ago.
have you worked with python upstream to get it sorted out in the right place ?
-mike
Marcin Juszkiewicz
2012-07-26 16:49:47 UTC
Permalink
Post by Mike Frysinger
Post by Marcin Juszkiewicz
Please check how OpenEmbedded handles Python cross compilation. We have
it sorted out long time ago.
have you worked with python upstream to get it sorted out in the right place ?
I do not remember how it ended as it was not my part of metadata.
Zafer Dirilgen
2012-07-27 06:16:15 UTC
Permalink
Hello,

I don't want to quit from crossdev email distribution list.
Do you have any idea how can I remove my email address from distribution list.

Thanks,
Zafer

-----Original Message-----
From: crossdev-bounces-iOHc7L4DgpLFDiOEh+***@public.gmane.org [mailto:crossdev-bounces-iOHc7L4DgpLFDiOEh+***@public.gmane.org] On Behalf Of Marcin Juszkiewicz
Sent: Thursday, July 26, 2012 7:50 PM
To: crossdev-iOHc7L4DgpLFDiOEh+***@public.gmane.org
Subject: Re: [crossdev] [PATCH] Add option to specify the path to ncurses5-config
Post by Mike Frysinger
Post by Marcin Juszkiewicz
Please check how OpenEmbedded handles Python cross compilation. We
have it sorted out long time ago.
have you worked with python upstream to get it sorted out in the right place ?
I do not remember how it ended as it was not my part of metadata.

_______________________________________________
crossdev mailing list

________________________________

Bu e-posta mesaji kisiye ozel olup, gizli bilgiler iceriyor olabilir. Eger bu e-posta mesaji size yanlislikla ulasmissa, icerigini hic bir sekilde kullanmayiniz ve ekli dosyalari acmayiniz. Bu durumda lutfen e-posta mesajini kullaniciya hemen geri gonderiniz ve tum kopyalarini mesaj kutunuzdan siliniz. Bu e-posta mesaji, hic bir sekilde, herhangi bir amac icin cogaltilamaz, yayinlanamaz ve para karsiligi satilamaz. Bu e-posta mesaji viruslere karsi anti-virus sistemleri tarafindan taranmistir. Ancak yollayici, bu e-posta mesajinin - virus koruma sistemleri ile kontrol ediliyor olsa bile - virus icermedigini garanti etmez ve meydana gelebilecek zararlardan dogacak hicbir sorumlulugu kabul etmez.
This message is intended solely for the use of the individual or entity to whom it is addressed , and may contain confidential information. If you are not the intended recipient of this message or you receive this mail in error, you should refrain from making any use of the contents and from opening any attachment. In that case, please notify the sender immediately and return the message to the sender, then, delete and destroy all copies. This e-mail message, can not be copied, published or sold for any reason. This e-mail message has been swept by anti-virus systems for the presence of computer viruses. In doing so, however, sender cannot warrant that virus or other forms of data corruption may not be present and do not take any responsibility in any occurrence.
Zafer Dirilgen
2012-07-27 06:23:18 UTC
Permalink
Sorry, I made a mistake while writing
I want to quit from crossdev email distribution list.
Do you have any idea how can I remove my email address from distribution list.

Thanks,
Zafer

-----Original Message-----
From: crossdev-bounces-iOHc7L4DgpLFDiOEh+***@public.gmane.org [mailto:crossdev-bounces-iOHc7L4DgpLFDiOEh+***@public.gmane.org] On Behalf Of Zafer Dirilgen
Sent: Friday, July 27, 2012 9:16 AM
To: crossdev-iOHc7L4DgpLFDiOEh+***@public.gmane.org
Subject: Re: [crossdev] [PATCH] Add option to specify the path to ncurses5-config

Hello,

I don't want to quit from crossdev email distribution list.
Do you have any idea how can I remove my email address from distribution list.

Thanks,
Zafer

-----Original Message-----
From: crossdev-bounces-iOHc7L4DgpLFDiOEh+***@public.gmane.org [mailto:crossdev-bounces-iOHc7L4DgpLFDiOEh+***@public.gmane.org] On Behalf Of Marcin Juszkiewicz
Sent: Thursday, July 26, 2012 7:50 PM
To: crossdev-iOHc7L4DgpLFDiOEh+***@public.gmane.org
Subject: Re: [crossdev] [PATCH] Add option to specify the path to ncurses5-config
Post by Mike Frysinger
Post by Marcin Juszkiewicz
Please check how OpenEmbedded handles Python cross compilation. We
have it sorted out long time ago.
have you worked with python upstream to get it sorted out in the right place ?
I do not remember how it ended as it was not my part of metadata.

_______________________________________________
crossdev mailing list

________________________________

Bu e-posta mesaji kisiye ozel olup, gizli bilgiler iceriyor olabilir. Eger bu e-posta mesaji size yanlislikla ulasmissa, icerigini hic bir sekilde kullanmayiniz ve ekli dosyalari acmayiniz. Bu durumda lutfen e-posta mesajini kullaniciya hemen geri gonderiniz ve tum kopyalarini mesaj kutunuzdan siliniz. Bu e-posta mesaji, hic bir sekilde, herhangi bir amac icin cogaltilamaz, yayinlanamaz ve para karsiligi satilamaz. Bu e-posta mesaji viruslere karsi anti-virus sistemleri tarafindan taranmistir. Ancak yollayici, bu e-posta mesajinin - virus koruma sistemleri ile kontrol ediliyor olsa bile - virus icermedigini garanti etmez ve meydana gelebilecek zararlardan dogacak hicbir sorumlulugu kabul etmez.
This message is intended solely for the use of the individual or entity to whom it is addressed , and may contain confidential information. If you are not the intended recipient of this message or you receive this mail in error, you should refrain from making any use of the contents and from opening any attachment. In that case, please notify the sender immediately and return the message to the sender, then, delete and destroy all copies. This e-mail message, can not be copied, published or sold for any reason. This e-mail message has been swept by anti-virus systems for the presence of computer viruses. In doing so, however, sender cannot warrant that virus or other forms of data corruption may not be present and do not take any responsibility in any occurrence.

_______________________________________________
crossdev mailing list

________________________________

Bu e-posta mesaji kisiye ozel olup, gizli bilgiler iceriyor olabilir. Eger bu e-posta mesaji size yanlislikla ulasmissa, icerigini hic bir sekilde kullanmayiniz ve ekli dosyalari acmayiniz. Bu durumda lutfen e-posta mesajini kullaniciya hemen geri gonderiniz ve tum kopyalarini mesaj kutunuzdan siliniz. Bu e-posta mesaji, hic bir sekilde, herhangi bir amac icin cogaltilamaz, yayinlanamaz ve para karsiligi satilamaz. Bu e-posta mesaji viruslere karsi anti-virus sistemleri tarafindan taranmistir. Ancak yollayici, bu e-posta mesajinin - virus koruma sistemleri ile kontrol ediliyor olsa bile - virus icermedigini garanti etmez ve meydana gelebilecek zararlardan dogacak hicbir sorumlulugu kabul etmez.
This message is intended solely for the use of the individual or entity to whom it is addressed , and may contain confidential information. If you are not the intended recipient of this message or you receive this mail in error, you should refrain from making any use of the contents and from opening any attachment. In that case, please notify the sender immediately and return the message to the sender, then, delete and destroy all copies. This e-mail message, can not be copied, published or sold for any reason. This e-mail message has been swept by anti-virus systems for the presence of computer viruses. In doing so, however, sender cannot warrant that virus or other forms of data corruption may not be present and do not take any responsibility in any occurrence.
Thomas Petazzoni
2012-07-27 06:28:58 UTC
Permalink
Le Fri, 27 Jul 2012 06:23:18 +0000,
Post by Zafer Dirilgen
Sorry, I made a mistake while writing
I want to quit from crossdev email distribution list.
Do you have any idea how can I remove my email address from distribution list.
In the headers of each mail you have received from this list:

List-Unsubscribe: <http://metis.pengutronix.de/cgi-bin/mailman/options/crossdev>,
<mailto:crossdev-***@send-patches.org?subject=unsubscribe>

Best regards,

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

_____________________________
Thomas Petazzoni
2012-07-26 08:29:51 UTC
Permalink
Le Wed, 25 Jul 2012 12:03:19 -0400,
Post by Mike Frysinger
why bother at all ? gpsd supports ncurses pkg-config files which solves all
these sort of problems. did you pass --enable-pc-files when running ncurses'
configure script ?
And the --enable-pc-files support in ncurses is completely stupid:

(*) In its configure.in file, it checks whether the PKG_CONFIG_LIBDIR
directory exists to decide whether it should install .pc files or
not. This is stupid, it should just install them unconditionally
(you already said --enable-pc-files, so why bothering checking
once again?). But anyway, you pass
PKG_CONFIG_LIBDIR=/home/foo/mybuildsystem/staging/usr/lib/pkgconfig,
and there you go, ./configure understands that you *REALLY* want
those damn .pc files to be installed.

(*) But then, their misc/Makefile.in installs the .pc files not in
$(PKG_CONFIG_LIBDIR), but in $(DESTDIR)/$(PKG_CONFIG_LIBDIR). So,
since your DESTDIR is going to be /home/foo/mybuildsystem/staging,
and PKG_CONFIG_LIBDIR
is /home/foo/mybuildsystem/staging/usr/lib/pkgconfig, guess what
happens... your .pc files are installed
in /home/foo/mybuildsystem/staging//home/foo/mybuildsystem/staging/usr/lib/pkgconfig.

And, to make things even better, their configure.in can't be parsed by
the normal autoconf, it needs a special fork of autoconf 2.13 to
regenerate the configure script, so you have basically no chance of
fixing things properly.

Sigh.

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

_______________________
Mike Frysinger
2012-07-26 16:38:37 UTC
Permalink
Post by Thomas Petazzoni
(*) In its configure.in file, it checks whether the PKG_CONFIG_LIBDIR
directory exists to decide whether it should install .pc files or
not. This is stupid, it should just install them unconditionally
(you already said --enable-pc-files, so why bothering checking
once again?). But anyway, you pass
PKG_CONFIG_LIBDIR=/home/foo/mybuildsystem/staging/usr/lib/pkgconfig,
and there you go, ./configure understands that you *REALLY* want
those damn .pc files to be installed.
i haven't seen that, but that's because we build with the libdir set to
/usr/lib/pkgconfig regardless of compiling (since we don't do non-standard --
prefix installs)

be good to send a patch upstream for that though :)
Post by Thomas Petazzoni
(*) But then, their misc/Makefile.in installs the .pc files not in
$(PKG_CONFIG_LIBDIR), but in $(DESTDIR)/$(PKG_CONFIG_LIBDIR).
which is correct ...

we also do this in Gentoo:
# For some reason, sources depends on pc-files which depends on
# compiled libraries which depends on sources which ...
# Manually delete the pc-files file so the install step will
# create the .pc files we want.
rm -f misc/pc-files
Post by Thomas Petazzoni
And, to make things even better, their configure.in can't be parsed by
the normal autoconf, it needs a special fork of autoconf 2.13 to
regenerate the configure script, so you have basically no chance of
fixing things properly.
patching the configure to not do the `test` would probably be a one line hack,
so it sucks, but shouldn't be that bad to carry until the next rev
-mike
Loading...