Skip to contentSkip to conversation

Problem passing environment variables

DISCUSSION Stuart Gray 2 participants 4 messages Aug 19, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to build with support for Qt4 Embedded. This was working, but then I tried to add our most recent Qt4 project files and updated code, but the build failed.

The issue is that the project files use environment variables which when using the Qt4 development environment works fine, but when this is compiled under the OE environment I cannot find a way to pass the variables into the qmake2 build.

I have tried to add them on the line calling qmake2, but this has not worked.

I have also tried to add then into my environment setup changing my .bashrc to add the variables. I have also added these to the BB_ENV_EXTRAWHITE, but the variables are still not found.

Running bitbake with the -D option I can see that these variables are found and exported, but still the build fails as it cannot find the environment variables.

I am building for overo with a 2.6.29 kernel. I am convinced that there is something not being cleaned when I run bitbake ???.bb -c clean.

Is there a better way to pass environment variables into the qmake build. I had been using autotools, but now we are trying to override using do_compile.

I will post an update to this after deleting the tmp directory and rebuilding.

#1 lore raw
Quoted 10 lines · On Wednesday 19 August 2009 05:55:14 Stuart Gray wrote:

Hi,

I am trying to build with support for Qt4 Embedded. This was working, but then I tried to add our most recent Qt4 project files and updated code, but the build failed.

The issue is that the project files use environment variables which when using the Qt4 development environment works fine, but when this is compiled under the OE environment I cannot find a way to pass the variables into the qmake2 build.

Please paste your project file, or create an example project using environment variables, so others can have a look.

z.

#2 lore raw
In reply to Stuart Gray
Quoted 11 lines · On Wednesday 19 August 2009 05:55:14 Stuart Gray wrote:

Hi,

I am trying to build with support for Qt4 Embedded. This was working, but then I tried to add our most recent Qt4 project files and updated code, but the build failed.

The issue is that the project files use environment variables which when using the Qt4 development environment works fine, but when this is compiled under the OE environment I cannot find a way to pass the variables into the qmake2 build.

Quoted 6 lines

I have tried to add them on the line calling qmake2, but this has not worked.

I have also tried to add then into my environment setup changing my .bashrc to add the variables. I have also added these to the BB_ENV_EXTRAWHITE, but the variables are still not found.

Well, it is hard to tell what kind of environment variables you have. But if you are using environment variables to configure you could

a) reconsider and use the qmake way to set variables on the command line. This can be achieved using the EXTRA_QMAKEVARS_PRE and EXTRA_QMAKEVARS_POST vars which will result in a command line like: qmake PRE -after POST

b) you can use "export VAR" in the recipe to ask bitbake to export the VAR to the shell. then export VAR should show up in the generated shell script for do_configure and do_compile.

z.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi,

Here is what I had tried within the recipe to export:

do_configure_prepend () {
export WORKING_DIR=~/overo-oe/SA/trunk
export JSONHOME=$WORKING_DIR/JSON
export
QTSTATE_DIR=$WORKING_DIR/build_dependencies/qtstatemachine-1.1-opensource }

My qmake files are as follows:

within my user.collections/recipes/dockamp/files I have the follwoing:

TEMPLATE =subdirs
COMFIG +=ordered

SUBDIRS  = \
    ~/overo-oe/SA/trunk/JSON/trunk \
    ~/overo-oe/SA/trunk/dockamp

This is the first place where I would like to use the environment variables.

Then within the ~/overo-oe/SA/trunk/dockamp/dockamp I have another dockamp.pro file

TEMPLATE = app
TARGET = dockamp

include( $${WORKING_DIR}/settings.pri )
include( $${WORKING_DIR}/util/util.pri )
include( $${QTSTATE_DIR}/src/qtstatemachine.pri )

DEPENDPATH += \
    . \
    $$(WORKING_DIR)
INCLUDEPATH += \
    . \
    $$(WORKING_DIR)

When qmake gets to compiling my cpp files it fails as it cannot find the .hpp file which is included, util.pri.

Previously I had hard coded the paths and it was compiling, but now it fails no matter what I do. We had tried to add a do_compile as follows:

do_configure() {
oenote Running our qmake work dir is $WORKING_DIR WORKING_DIR=${WORKING_DIR} JSONHOME=${JSONHOME}
QTSTATE_DIR=${QTSTATE_DIR} qmake2 ~/overo-oe/user.collection/recipes/dockamp/files/dockamp.pro
oenote Finished our qmake
}

But again we get the same result of .hpp files not found.

If the call to qmake2 can be made to pass the varaiable could you please show the complete example. I am new to Linux and OE and it gets confusing pretty quickly.

Thanks,
Stuart

2009/8/19 Koen Kooi <[email protected]>

Quoted 28 lines · Stuart Gray
Quoted 4 lines

I have also tried to add then into my environment setup changing my .bashrc to add the variables. I have also added these to the BB_ENV_EXTRAWHITE, but the variables are still not found.

If you're going to pass variables intended for recipes using BB_ENV_EXTRAWHITE your QA dudes will have a nervous breakdown. If you want to pass something to a recipe using shell env, do 'export FOO = bar' in the recipe.

regards,

Koen

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gumstix-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gumstix-users