Pandora Crosscompiler Toolchain Based On Openpandora.org Ipks


crow_riot said:
just have another issue (sorry for bugging ;) ) ... libpnd is only available as a static library but not as a dynamic one. thus i have some missing externals ...
like:

Code:
../../Binaries/Debug/Pandora/libLibertine.so||undefined reference to `pnd_evdev_open(pnd_evdev_e)'|
../../Binaries/Debug/Pandora/libLibertine.so||undefined reference to `pnd_evdev_close(pnd_evdev_e)'|
../../Binaries/Debug/Pandora/libLibertine.so||undefined reference to `pnd_evdev_dpad_state(pnd_evdev_e)'|
||=== Build finished: 3 errors, 0 warnings ===|

is there a reason for this being not available in your toolchain?

*edit2*
static linking builds fine btw.
There is a good reason for this: there seems to be no -dev package in the pandora feed for this. Just tell me the package name and I can add it to the list of stuff to install. So far this stuff seems to not be done as .ipk, at least I have not found it at http://www.openpandora.org/feeds. So I basically need to know what to install where and where to get this stuff from, then I should be able to add it in the SDK installer.
 
Last edited by a moderator:
Ivanovic said:
crow_riot said:
just have another issue (sorry for bugging ;) ) ... libpnd is only available as a static library but not as a dynamic one. thus i have some missing externals ...
like:

Code:
../../Binaries/Debug/Pandora/libLibertine.so||undefined reference to `pnd_evdev_open(pnd_evdev_e)'|
../../Binaries/Debug/Pandora/libLibertine.so||undefined reference to `pnd_evdev_close(pnd_evdev_e)'|
../../Binaries/Debug/Pandora/libLibertine.so||undefined reference to `pnd_evdev_dpad_state(pnd_evdev_e)'|
||=== Build finished: 3 errors, 0 warnings ===|

is there a reason for this being not available in your toolchain?

*edit2*
static linking builds fine btw.
There is a good reason for this: there seems to be no -dev package in the pandora feed for this. Just tell me the package name and I can add it to the list of stuff to install. So far this stuff seems to not be done as .ipk, at least I have not found it at http://www.openpandora.org/feeds. So I basically need to know what to install where and where to get this stuff from, then I should be able to add it in the SDK installer.

skeezix told me that these functions reside in libpnd...

http://www.openpandora.org/feeds/unstable/armv7a/pandora-libpnd-dev_1.0-r40.5_armv7a.ipk

just checked the package contents. it's not available inside where it should be... bummer. should we/i file a bug report?
 
Last edited by a moderator:
Hey Ivanovic, have you thought about putting this up on github or something so that we can check for updates without having to be attached to this thread? I know I'd sure appreciate it :)

Cheers!
 
Thought I'd post a success story here!

I managed to write and debug a small silly C++ app on my home desktop in QT4 using Qt Creator 2.0.1 (wow, what an easy IDE to work with!) After I built it on my PC, I took a look at the Makefile it generated, added a $(CROSS_COMPILE) here, converted a few -L/usr/lib to -L$(SDK_PATH)/usr/lib there, and corrected the QMAKE command lines and finally called MAKE.

I copied the executable over to my Pandora and... It worked! IT FREAKING WORKED! This is a serious milestone for me personally, as I've never compiled anything significant on Linux, let alone anything with a GUI in C++!

It hit a minor snag starting up the app, but it ran nonetheless. Something about QIconvCodec having issues with Unicode (QIconvCodec::convertFromUnicode: using ASCII for conversion, iconv_open failed). Maybe I'll change a compiler setting on my host and default everything to ASCII and everyone will be happy, except a few people who use foreign characters.

But I thought I'd share this as a testimony to Ivanovic's awesome work at putting this toolchain together!

Edit: Of course, using qmake-qt4 with a properly set QMAKESPEC variable (that one's going in my environment-setup.sh! ;-) ) can take a lot of those manual Makefile edits and headaches away! (facepalm)(hides in shame)
 
Well, just to give a bit of help for users of this toolchain, which is what I used to build panplayer, I'm going to post the environment-setup file that I modified from sebt3's toolchain to work with this one. I liked the way that everything was integrated, and it was quite easy to compile stuff and other things. Hopefully this will be of some use to someone, I changed the default location that it's in, but you just have to change the $SDK_ROOT variable to point to it, and $TOOLS_PATH also points to some stuff, mainly the location of the script and such. It's set up to be pretty much the same as sebt3's, with the setprj operator which will automatically set all the environment variables and everything else. pndconfigure is the base command you use for autotools based stuff, I didn't really mess too much with cmake stuff, but it might work. There are probably mistakes here and there, but it worked well enough for me. :)

Code:
#!/bin/sh

export SDK_ROOT=$HOME/Code/pandora
# Where you store your pandora's projects
export PROJECTS_BASEDIR=${PROJECTS_BASEDIR:-"$SDK_ROOT/build"}
# Local storage for PNDs
export PND_TARGETDIR=$PROJECTS_BASEDIR/pnds
# Build target and pnd moint point
export PND_BASEDIR=/mnt/utmp
export TOOLS_PATH=$SDK_ROOT/tools

export CMAKETOOLCHAINFILE="$TOOLS_PATH/sdk_utils/PandoraToolchain.cmake"

export SDK_PATH=$SDK_ROOT/sdk TARGET_SYS=arm-none-linux-gnueabi
export CONFIG_SITE=$TOOLS_PATH/site-config
export PATH=$SDK_PATH/bin:$SDK_PATH/usr/bin:$PATH:$SDK_PATH/$TARGET_SYS/usr/bin
export CPATH="$SDK_PATH/usr/include:$SDK_PATH/$TARGET_SYS/include:$CPATH"
export LIBTOOL_SYSROOT_PATH=$SDK_PATH
export PKG_CONFIG=$SDK_PATH/bin/arm-none-linux-gnueabi-pkg-config
export PKG_CONFIG_PATH=$SDK_PATH/usr/lib/pkgconfig
export CFLAGS="-DPANDORA -Os -pipe -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=sosoftfb -ftree-vectorize -ffast-math -fsingle-precision-constant" # Default build flags
#export CFLAGS="-DPANDORA -O4 -pipe -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -fexpensive-optimizations -marm -fomit-frame-pointer" # The build flags for panplayer
export CXXFLAGS="-I$SDK_PATH/usr/include" 
export LDFLAGS="-L$SDK_PATH/usr/lib -Wl,-rpath,$SDK_PATH/usr/lib -ldl -lrt"
export CPPFLAGS="$CFLAGS"

export CROSSTOOL="$SDK_PATH/bin/$TARGET_SYS"
export CXX=$CROSSTOOL-g++ CC=$CROSSTOOL-gcc AR=$CROSSTOOL-ar AS=$CROSSTOOL-as RANLIB=$CROSSTOOL-ranlib STRIP=$CROSSTOOL-strip
export HOST_CC=gcc HOST_CXX=g++

if [ -z "$LD_LIBRARY_PATH" ];then
	LD_LIBRARY_PATH=$SDK_PATH/lib
else
	LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SDK_PATH/lib
fi
export LD_LIBRARY_PATH

alias opkg-pandora="$SDK_PATH/bin/opkg-cl -f $SDK_PATH/opkg.conf -o $SDK_PATH"

unsetSDK() {
	unset PND_TARGETDIR PND_BASEDIR CMAKETOOLCHAINFILE SDK_PATH CONFIG_SITE CPATH LIBTOOL_SYSROOT_PATH PKG_CONFIG PKG_CONFIG_PATH CFLAGS CXXFLAGS LDFLAGS CPPFLAGS CROSSTOOL CXX CC AR AS RANLIB STRIP HOST_CC HOST_CXX LD_LIBRARY_PATH PRJ TOOLS_PATH
	. /etc/profile
}

setprj() {
        export PRJ=$1;
        export LDFLAGS="-L/mnt/utmp/$PRJ/lib -Wl,-rpath,/mnt/utmp/$PRJ/lib $LDFLAGS" CXXFLAGS=" -I/mnt/utmp/$PRJ/include $CXXFLAGS " PKG_CONFIG_PATH="/mnt/utmp/$PRJ/lib/pkgconfig:$PKG_CONFIG_PATH" CPATH="/mnt/utmp/$PRJ/include:$SDK_PATH/usr/include"
        if [ -d $PROJECTS_BASEDIR/$PRJ ];then
                cd $PROJECTS_BASEDIR/$PRJ
        fi
}

# Help to configure stuff
#-------------------------

pndconfigure() {
        ./configure --host=$TARGET_SYS --prefix=$PND_BASEDIR/$PRJ $@
}

pndcmake() {
        cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKETOOLCHAINFILE -DCMAKE_PREFIX=$PND_BASEDIR/$PRJ -DCMAKE_INSTALL_PREFIX=$PND_BASEDIR/$PRJ $@
}

pndqmake() {
        qmake-qt4 -spec $TOOLS_PATH/sdk_utils/qmake_linux-pandora-g++ $@
}

# To build the pnd file
#-----------------------

pndmakeauto(){
        NAME=${1:-$PRJ}
	[ ! -f $PND_BASEDIR/$NAME/PXML.xml ] && PRJ=$NAME genpxml
        pnd_make -c -p $PND_TARGETDIR/$NAME.pnd -d $PND_BASEDIR/$NAME -i $PND_BASEDIR/$NAME/icon.png -x $PND_BASEDIR/$NAME/PXML.xml
}

_setprj ()
{
        local cur
        _get_comp_words_by_ref cur
        COMPREPLY=()
        if ls $PROJECTS_BASEDIR/${cur}* >/dev/null 2>&1;then
                COMPREPLY=( $(ls -1d $PROJECTS_BASEDIR/${cur}*|sed "s#$PROJECTS_BASEDIR/##") )
        fi
        return 0
} 
complete -F _setprj setprj

reloadSDK ()
{
	. $TOOLS_PATH/environment-setup
}

setAngstrom ()
{
	export CROSSTOOL=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi
	export CXX=$CROSSTOOL-g++ CC=$CROSSTOOL-gcc AR=$CROSSTOOL-ar AS=$CROSSTOOL-as RANLIB=$CROSSTOOL-ranlib STRIP=$CROSSTOOL-strip
}

This is what you can add to your ~/.bashrc file so that to set up everything correctly, just from within a terminal, you can do a setprj projectname to change to it and set up everything correctly.

Code:
export SDK_ROOT=$HOME/Code/pandora
export SDK_PATH=$SDK_ROOT/sdk

export PROJECTS_BASEDIR=$SDK_ROOT/build
 
 setprj() {
         . $SDK_ROOT/tools/environment-setup;
         setprj $@
 }
 
 _setprj ()
 {
         local cur
         _get_comp_words_by_ref cur
         COMPREPLY=()
         if ls $PROJECTS_BASEDIR/${cur}* >/dev/null 2>&1;then
                 COMPREPLY=( $(ls -1d $PROJECTS_BASEDIR/${cur}*|sed "s#$PROJECTS_BASEDIR/##") )
         fi
         return 0
 } 
 complete -F _setprj setprj
 
sebt3 said:
Bryce Leo said:
I have both of those already set up afaik.
Then give us your errors so we know what's going and what can we do to fix these ;)
How do I actually use this? When I type cmake or make, what do I need to do to tell them to use the toolchain?
 
Last edited by a moderator:
Silent-Hunter said:
sebt3 said:
Bryce Leo said:
I have both of those already set up afaik.
Then give us your errors so we know what's going and what can we do to fix these ;)
How do I actually use this? When I type cmake or make, what do I need to do to tell them to use the toolchain?
For cmake you need to provide it with a crosscompiler definition file. For this one look into the sdk_utils/ folder (by default: ~/pandora-dev/sdk_utils/). In there you will find the file PandoraToolchain.cmake. This is a crosscompiler toolchain file that should work with your SDK. At the end is an example of how I call cmake for building Wesnoth using this toolchain. Yes, it basically adds a whole lot of different stuff, but the C*FLAGS make sense (compiler optimizations) as well as this part (you have to look at your file for your paths!):
Code:
cmake -DCMAKE_TOOLCHAIN_FILE=/home/nils/pandora-dev/sdk_utils/PandoraToolchain.cmake PATH/TO/FOLDER/WITH/CMakeLists.txt
(PATH/TO/FOLDER/WITH/CMakeLists.txt can also be . if you have it in the same folder!)
 
Last edited by a moderator:
Ivanovic said:
Silent-Hunter said:
sebt3 said:
Bryce Leo said:
I have both of those already set up afaik.
Then give us your errors so we know what's going and what can we do to fix these ;)
How do I actually use this? When I type cmake or make, what do I need to do to tell them to use the toolchain?
For cmake you need to provide it with a crosscompiler definition file. For this one look into the sdk_utils/ folder (by default: ~/pandora-dev/sdk_utils/). In there you will find the file PandoraToolchain.cmake. This is a crosscompiler toolchain file that should work with your SDK. At the end is an example of how I call cmake for building Wesnoth using this toolchain. Yes, it basically adds a whole lot of different stuff, but the C*FLAGS make sense (compiler optimizations) as well as this part (you have to look at your file for your paths!):
Code:
cmake -DCMAKE_TOOLCHAIN_FILE=/home/nils/pandora-dev/sdk_utils/PandoraToolchain.cmake PATH/TO/FOLDER/WITH/CMakeLists.txt
(PATH/TO/FOLDER/WITH/CMakeLists.txt can also be . if you have it in the same folder!)
Thank you!

What about qmake? Is it similar?

Also, what if a source doesn't use cmake, but configure instead? Can I still use cmake with it?
 
Last edited by a moderator:
Silent-Hunter said:
What about qmake? Is it similar?
For qmake have a look at this post: http://www.gp32x.de/board/index.php?/topic/58443-crosscompiler-toolchain-based-on-openpandora-org-ipks/page__view__findpost__p__937274

Silent-Hunter said:
Also, what if a source doesn't use cmake, but configure instead? Can I still use cmake with it?
There is a wrapper script for configure (though it will only work for a "real" configure generated by autotools, not for the configure eg available with ffmpeg or mplayer!). In the folder where you would normally call ./configure call this:
Code:
$PNDSDK/../sdk_utils/pandora_configure.sh
You can supply any parameters that you want to have supplied to configure just to this script. Basically you use this wrapper in the place of ./configure and use it exactly the same way.
 
Last edited by a moderator:
Ivanovic said:
Silent-Hunter said:
What about qmake? Is it similar?
For qmake have a look at this post: http://www.gp32x.de/board/index.php?/topic/58443-crosscompiler-toolchain-based-on-openpandora-org-ipks/page__view__findpost__p__937274

Silent-Hunter said:
Also, what if a source doesn't use cmake, but configure instead? Can I still use cmake with it?
There is a wrapper script for configure (though it will only work for a "real" configure generated by autotools, not for the configure eg available with ffmpeg or mplayer!). In the folder where you would normally call ./configure call this:
Code:
$PNDSDK/../sdk_utils/pandora_configure.sh
You can supply any parameters that you want to have supplied to configure just to this script. Basically you use this wrapper in the place of ./configure and use it exactly the same way.
pnd_make.sh doesn't seem to work. I get this:

Code:
[silent@TERMINAL-BMRF-9 sdk_utils]$ ./pnd_make.sh
./pnd_make.sh: line 5: --: command not found
Terminating...
 
Last edited by a moderator:
Silent-Hunter said:
pnd_make.sh doesn't seem to work. I get this:

Code:
[silent@TERMINAL-BMRF-9 sdk_utils]$ ./pnd_make.sh
./pnd_make.sh: line 5: --: command not found
Terminating...
The cause of this one is something that I still have to look into, basically an issue at script creation time. After HF5 is out those scripts will get a work over anyway, that is why I have not bothered yet. For the moment to fix it replace line 5 with this:
Code:
TEMP=`getopt -o p:d:x:i:c -- "$@"`
 
Last edited by a moderator:
Ivanovic said:
Silent-Hunter said:
pnd_make.sh doesn't seem to work. I get this:

Code:
[silent@TERMINAL-BMRF-9 sdk_utils]$ ./pnd_make.sh
./pnd_make.sh: line 5: --: command not found
Terminating...
The cause of this one is something that I still have to look into, basically an issue at script creation time. After HF5 is out those scripts will get a work over anyway, that is why I have not bothered yet. For the moment to fix it replace line 5 with this:
Code:
TEMP=`getopt -o p:d:x:i:c -- "$@"`
Well, now it makes the pnd, but it won't run. And it's title says "- german! (lol)"

EDIT: Never mind, I worked it out.
 
Last edited by a moderator:
Ivanovic, would you mind posting this script on GitHub or BitBucket, or something? I've downloaded the pastebin version of your script but have no idea just how updated that actually is... :(
 
myownlittlworld said:
Ivanovic, would you mind posting this script on GitHub or BitBucket, or something? I've downloaded the pastebin version of your script but have no idea just how updated that actually is... :(
Agreed and I suggested this before but it never happened so I'm assuming he's either killer busy or just not interested in doing that for some reason.
 
Last edited by a moderator:
Bryce Leo said:
myownlittlworld said:
Ivanovic, would you mind posting this script on GitHub or BitBucket, or something? I've downloaded the pastebin version of your script but have no idea just how updated that actually is... :(
Agreed and I suggested this before but it never happened so I'm assuming he's either killer busy or just not interested in doing that for some reason.
Basically both. I am busy working on my final thesis for university. The reason why I am not this much interested in this is that sebt3 is working on unifying both toolchains "soon" (that is I got to check his latest results to see if it works for me, too). This result will then become the "official" toolchain.
 
Last edited by a moderator:
Ivanovic said:
Basically both. I am busy working on my final thesis for university. The reason why I am not this much interested in this is that sebt3 is working on unifying both toolchains "soon" (that is I got to check his latest results to see if it works for me, too). This result will then become the "official" toolchain.

I can totally understand that. I personally prefer your method but as long as it supports both I'll be pleased with that.
 
Last edited by a moderator:
Bryce Leo said:
I can totally understand that. I personally prefer your method but as long as it supports both I'll be pleased with that.

One of the point of the lastest release of yactfeau was exacly that : allowing to be used like Ivanovic method
 
Last edited by a moderator:
sebt3 said:
Bryce Leo said:
I can totally understand that. I personally prefer your method but as long as it supports both I'll be pleased with that.

One of the point of the lastest release of yactfeau was exacly that : allowing to be used like Ivanovic method
Sweet Deal! Thread link?
 
Last edited by a moderator:
Bryce Leo said:
sebt3 said:
Bryce Leo said:
I can totally understand that. I personally prefer your method but as long as it supports both I'll be pleased with that.

One of the point of the lastest release of yactfeau was exacly that : allowing to be used like Ivanovic method
Sweet Deal! Thread link?

4 lines below this thread, lay the yactfeau one. Using it as I describe in the post is not mandatory. You can install it anywhere (be sure to create a directory for it first and run the install script). and you can use it like this toolchain.
 
Last edited by a moderator:
sebt3 said:
Bryce Leo said:
sebt3 said:
Bryce Leo said:
I can totally understand that. I personally prefer your method but as long as it supports both I'll be pleased with that.

One of the point of the lastest release of yactfeau was exacly that : allowing to be used like Ivanovic method
Sweet Deal! Thread link?

4 lines below this thread, lay the yactfeau one. Using it as I describe in the post is not mandatory. You can install it anywhere (be sure to create a directory for it first and run the install script). and you can use it like this toolchain.
Awesome. Thanks Sebt3
 
Last edited by a moderator:
Back
Top