[oe] [SDK] meta-toolchain.bb generates very interesting environment-setup

Tom Rini tom_rini at mentor.com
Thu Mar 25 18:33:21 UTC 2010


On Thu, 2010-03-25 at 14:01 -0400, Denys Dmytriyenko wrote:
> On Thu, Mar 25, 2010 at 06:16:49PM +0300, Sergey Lapin wrote:
> > $ cat /usr/local/angstrom/arm/environment-setup
> > export SDK_PATH=/usr/local/angstrom/arm
> > export TARGET_SYS=arm-angstrom-linux-gnueabi
> > export PATH=$SDK_PATH/bin:$PATH
> > export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH
> > export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS
> > export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS
> > export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS/usr/lib/pkgconfig
> > export CONFIG_SITE=$SDK_PATH/site-config
> > alias opkg='LD_LIBRARY_PATH=/lib /bin/opkg-cl -f //etc/opkg-sdk.conf -o '
> > alias opkg-target='LD_LIBRARY_PATH=/lib /bin/opkg-cl -f //etc/opkg.conf -o /'
> > 
> > A problem seems to be this code:
> > 
> > # Create environment setup script
> >         script=${SDK_OUTPUT}/${SDKPATH}/environment-setup
> >         touch $script
> >         echo 'export SDK_PATH=${SDKPATH}' >> $script
> >         echo 'export TARGET_SYS=${TARGET_SYS}' >> $script
> >         echo 'export PATH=$SDK_PATH/bin:$PATH' >> $script
> >         echo 'export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH' >> $script
> >         echo 'export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS' >> $script
> >         echo 'export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS' >> $script
> >         echo 'export
> > PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}/pkgconfig' >> $script
> >         echo 'export CONFIG_SITE=$SDK_PATH/site-config' >> $script
> >         echo "alias opkg='LD_LIBRARY_PATH=$SDK_PATH/lib
> > $SDK_PATH/bin/opkg-cl -f $SDK_PATH/${sysconfdir}/opkg-s
> > dk.conf -o $SDK_PATH'" >> $script
> >         echo "alias opkg-target='LD_LIBRARY_PATH=$SDK_PATH/lib
> > $SDK_PATH/bin/opkg-cl -f $SDK_PATH/$TARGET_SYS${
> > sysconfdir}/opkg.conf -o $SDK_PATH/$TARGET_SYS'" >> $script
> > 
> > 
> > it seems that $SDK_PATH in last two lines gets resolved instead of
> > being written literally. adding \ before $ in these lines seems to fix
> > this problem. Is it appropriate fix?
> 
> Ah, interesting... It worked for me when the last two lines had double quotes 
> inside single quotes. But to match RP's styling, I had to revert that to 
> single quotes inside double quotes and it doesn't seem to work:
> 
> $ echo 'show "$SDK_PATH"'
> show "$SDK_PATH"
> 
> $ echo "show '$SDK_PATH'"
> show ''
> 
> I wonder if it would be Ok to revert back to the original quoting... Or is 
> escaping with \ a better fix?

Ordered quoting ('""') is how we handle this in other recipes, so we
should do it here.

-- 
Tom Rini <tom_rini at mentor.com>
Mentor Graphics Corporation




More information about the Openembedded-devel mailing list