[oe] [Gumstix-users] Problem passing environment variables

Holger Hans Peter Freyther holger+oe at freyther.de
Thu Aug 20 01:43:28 UTC 2009


On Wednesday 19 August 2009 11:51:11 Stuart Gray wrote:
> 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.

I have no real answer just some hints regarding qmake. include() can fail and 
there will be no error printed, variables are always a bit messy and I can't 
remember if $(FOO) $$FOO, $$[FOO] or $FOO should be used.

My two hints for debugging this are:
	- Use strace -f and run the "run.do_configure.OLD_PID" script by hand and see 
which files qmake tries to open.
	- Use "message" inside the pro files and see what gets printed when you run 
the above run.do_configure script from $WORKDIR/temp/.



your approach to change do_configure_prepend should work, you could skip that 
by using: export WORKING_DIR = "some/dir" inside the bb file... this should 
export variables too.

	z.




More information about the Openembedded-devel mailing list