Skip to contentSkip to conversation

Python distutils.sysconfig values

Buildroot Zoltan Gyarmati 2 participants 2 messages Jun 30, 2016 – Jul 2, 2016

lore
Share & tools
lore
#0 lore raw

Dear All,

i'm trying to enable the gpsd python module in Buildroot (currently it's disabled, see package/gpsd/gpsd.mk line #25). The gpsd build system uses scons, which in turn uses distutils.sysconfig to get the value of various paramaters (like the compiler to use, etc) like this:

Quoted 1 line

vars = sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'BASECFLAGS', 'CCSHARED', 'LDSHARED', 'SO', 'INCLUDEPY', 'LDFLAGS')

which apparently yields the following values:

Quoted 1 line

['/usr/bin/gcc -pthread', '/usr/bin/g++ -pthread', '-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes', '-fno-strict-aliasing', '-fPIC', '/usr/bin/gcc -pthread -shared -L/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/lib -L/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/lib -Wl,-rpath,/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/lib -Wl,--enable-new-dtags', '.so', '/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/include/python2.7', '-L/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/lib -L/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/lib -Wl,-rpath,/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/lib -Wl,--enable-new-dtags']

Note that some of the variables related to the BR environment (like the
python include dir), while others (most importantly CC) are coming from the host environment.
Does anybody could offer a hint where to look to get
distutils.sysconfig to set all of these values correctly?

Thanks in advance,

Signature · 2 lines
Zoltan Gyarmati
https://zgyarmati.de
#1 lore raw
Quoted 11 lines · Zoltan Gyarmati

Dear All,

i'm trying to enable the gpsd python module in Buildroot (currently it's disabled, see package/gpsd/gpsd.mk line #25). The gpsd build system uses scons, which in turn uses distutils.sysconfig to get the value of various paramaters (like the compiler to use, etc) like this:

Quoted 1 line

vars = sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'BASECFLAGS', 'CCSHARED', 'LDSHARED', 'SO', 'INCLUDEPY', 'LDFLAGS')

which apparently yields the following values:

Quoted 8 lines
Quoted 1 line

['/usr/bin/gcc -pthread', '/usr/bin/g++ -pthread', '-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes', '-fno-strict-aliasing', '-fPIC', '/usr/bin/gcc -pthread -shared -L/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/lib -L/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/lib -Wl,-rpath,/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/lib -Wl,--enable-new-dtags', '.so', '/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/include/python2.7', '-L/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/lib -L/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/lib -Wl,-rpath,/home/zgyarmati/projects/buildroot-upstream/buildroot/output/host/usr/lib -Wl,--enable-new-dtags']

Note that some of the variables related to the BR environment (like the
python include dir), while others (most importantly CC) are coming from the host environment.
Does anybody could offer a hint where to look to get
distutils.sysconfig to set all of these values correctly?

You need to pass $(TARGET_CONFIGURE_OPTS) in the environment to set everything
correctly. gpsd does this:

GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)

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:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF