d8b3d2e40940435457262fcfd0faaa659a98673b
[openpandora.oe.git] / recipes / meta / meta-toolchain-pandora.bb
1 # OpenPandora Sample toolchain/SDK scripts.
2
3 PR = "r4"
4 TOOLCHAIN_HOST_TASK = "task-pandora-toolchain-host"
5 TOOLCHAIN_TARGET_TASK = "task-pandora-toolchain-target"
6
7 require meta-toolchain.bb
8
9 SDK_SUFFIX = "toolchain-openpandora"
10
11 PANDORA_VERSION_FILE = "${SDK_OUTPUT}/${SDKPATH}/op-toolchain-version"
12
13 QT_DIR_NAME = "qt4"
14
15 do_populate_sdk_append() {
16
17        # SED out incorrect paths in SDK support *-config files so tools can use the files to find libs to cross compile.
18        # not ready to commit.
19
20        # Tweak the environment-setup script to get QT4 dev working.
21        
22        script = "${SDK_OUTPUT}/${SDKPATH}/environment-setup"
23        touch $script
24        echo 'export OE_QMAKE_CC=${TARGET_SYS}-gcc' >> $script
25        echo 'export OE_QMAKE_CXX=${TARGET_SYS}-g++' >> $script
26        echo 'export OE_QMAKE_LINK=${TARGET_SYS}-g++' >> $script
27        echo 'export OE_QMAKE_LIBDIR_QT=${SDKPATH}/${TARGET_SYS}/${libdir}' >> $script
28        echo 'export OE_QMAKE_INCDIR_QT=${SDKPATH}/${TARGET_SYS}/${includedir}/${QT_DIR_NAME}' >> $script
29        echo 'export OE_QMAKE_MOC=${SDKPATH}/bin/moc4' >> $script
30        echo 'export OE_QMAKE_UIC=${SDKPATH}/bin/uic4' >> $script
31        echo 'export OE_QMAKE_UIC3=${SDKPATH}/bin/uic34' >> $script
32        echo 'export OE_QMAKE_RCC=${SDKPATH}/bin/rcc4' >> $script
33        echo 'export OE_QMAKE_QDBUSCPP2XML=${SDKPATH}/bin/qdbuscpp2xml4' >> $script
34        echo 'export OE_QMAKE_QDBUSXML2CPP=${SDKPATH}/bin/qdbusxml2cpp4' >> $script
35        echo 'export OE_QMAKE_QT_CONFIG=${SDKPATH}/${TARGET_SYS}/${datadir}/${QT_DIR_NAME}/mkspecs/qconfig.pri' >> $script
36        echo 'export QMAKESPEC=${SDKPATH}/${TARGET_SYS}/${datadir}/${QT_DIR_NAME}/mkspecs/linux-g++' >> $script
37
38
39        # Helper to say what toolchain we built, include GIT tag etc.
40
41        OLD_PWD=$PWD; cd `dirname '${FILE_DIRNAME}'`; echo Tag Name: `git tag|tail -n 1`> ${PANDORA_VERSION_FILE};cd $OLD_PWD;
42        OLD_PWD=$PWD; cd `dirname '${FILE_DIRNAME}'`; echo VERSION: `git-log -n1 --pretty=oneline|awk '{print $1}'` >> ${PANDORA_VERSION_FILE}; cd $OLD_PWD;
43        OLD_PWD=$PWD; cd `dirname '${FILE_DIRNAME}'`; echo Branch: ` git branch |awk '/*/{print $2}'` >> ${PANDORA_VERSION_FILE}; cd $OLD_PWD;
44        echo Toolchain Builder: '${LOGNAME}'@`cat /etc/hostname` >> ${PANDORA_VERSION_FILE};
45        echo Time Stamp: `date -R` >> ${PANDORA_VERSION_FILE};
46        echo Toolchain Name: '${TOOLCHAIN_OUTPUTNAME}' >> ${PANDORA_VERSION_FILE};
47
48        # Repack SDK after 'munging'
49        cd ${SDK_OUTPUT}
50        fakeroot tar cfj ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
51 }