Okay, updated the script and made it all into a "one script to do it all" version. General notes:
Pre start dependencies:
- wget
- bash
- sed
- md5sum
- working compile env for host system
In case of a gentoo system all dependencies should already be met, on an Ubuntu system this command should install the required compile env, though I have no way to test this and can't be sure:
sudo apt-get install libcurl4-openssl-dev libgpgme11-dev libtool build-essential
Some notes regarding the scripts:
- Make sure to change the variable PNDSDK_DIR at the top of the script to match your system. Make sure that your current user has permissions to write into this folder.
- After installation the SDK itself requires about 2.1GB on your harddrive. During installation about 700MB are downloaded into a tmp/ folder created where you call the scripts from. Those files can be removed after the script completed.
- After installation is done and everything works you can remove the following files/folders:
- the installation script itself
- the folder "tmp/" (all downloaded files should have been stored here, as well as some folders used for temporary compilation)
- For the moment the file is hosted at a pastebin site. After downloading it there (clicking on "download" will get the job done) you should run "dos2unix" on the file to make sure that they work nicely for you.
Now to the most important part, the sdk itself:
- Download the script
Download the script openpandora_toolchain.sh. The installer script is still a single file but now available directly from the openpandora.org git repositories. To check the history of the file, please head over to git.openpandora.org/pandora-misc.git/sdk_installer.
- Fix line endings using "dos2unix"
After downloading the script in the step before you should run "dos2unix" on the file to make sure that they work nicely for you.
dos2unix openpandora_toolchain.sh
- Make the script executable
chmod +x openpandora_toolchain.sh
- Check that everything is correctly setup
Have a look into the script using a texteditor. If you want your toolchain installed somewhere else (aka "not in $HOME/pandora-dev") you have to change the variable PNDSDK_DIR in line 100. You should also read through the comments at the top since they might include some useful information.
- Execute the script
Once everything else is done (and you got the dependencies installed!) execute the script:
./openpandora_toolchain.sh
- In case of errors
If you get an error message, you should try to fix those problems. They are likely related to you missing some dependencies for compiling opkg or pkg-config. Once you got the deps, rerun the step above.
- (optional) Remove temporary folder
Now that the script has completed running you can remove the temporary folder. Have a look at the last output from the script, it should name the folder.
Once the script is done, enjoy the crosscompiler toolchain. This new version does directly ship helper files to use with cmake, qmake as well as configure. Using autotools based configure is still problematic though since there are no fixed settings to be used and every script can behave differently, so the wrapper might not work for you... If you encounter any problems, please tell me. If you have suggested improvements or patches for this script I do highly welcome them!
That should be it for the moment. I hope this toolchain works for you as well as it seems to for me.
EDIT1:Updated toolchain installer file to install the latest codesourcery toolchain (Sourcery G++ Lite 2010.09-50). Had to fix some smaller parts for this to work (had some references to the "old" one still hardcoded in the script, those were fixed). Beside this now the compile folders for opkg and pkg-config are automatically removed before trying to extract those source tarballs, otherwise changes in the path setup would not register.
EDIT2:Fixed "moving away" of libstdc++.so.6.0.14. Due to a change in the respective version shipped by the "new" sdk it was not moved correctly. The new way to move stuff around should not depend on explicit filenames anymore. Please fetch the new script and retry if you had problems executing the progs.
EDIT3:Just another version of the scripts with many changes!
- Create missing file usr/bin/libpng-config.
- Create missing file usr/lib/pkgconfig/lua5.1.pc.
- Simplify the section used during fixing libs. Commented out some parts that should not be required there since they were already covered by the stuff done before.
- Supply more "useful files" and place them in a dir of their own (PNDSDK_DIR/sdk_utils/). List of files:
- PandoraToolchain.cmake: useful for crosscompiling with cmake.
- pandora_configure.sh: wrapper around ./configure that allows calling configure via this script and directly setting most vars that should be required to run it.
- opkg-pandora.sh: script for calling opkg in a way that the stuff setup is used correctly.
- fix-libs.sh: script to fix libs. Eg required after running some opkg update.
- pnd_make.sh: script for packaging things into a .pnd.
- genpxml.sh: script for generating some basic PXML.xml file.
Another tiny change after the last update:
- Changed optimization level provided by extra files from -O3 to -Os. Reason: -O3 can be unsafe and -Os might even be faster in some situations on architectures that only got a small cache (like eg ARM).
EDIT4:JayFoxRox requested some changes/additions in the script, here they are:
- Added a symlink from all files in bin/ folders being named $TARGET_SYS-something (usually arm-none-linux-gnueabi-something) to pandora-something. This eg make accessing gcc by far easier. Instead of remembering arm-none-linux-gnueabi-gcc as binary name, you can just use pandora-gcc.
- Added the environment variable $PNDSDK to ~/.bashrc. If you are using bash as login shell you will now have the variable set allowing you to easily access stuff from the toolchain. This way you can eg call the gcc of the toolchain by simply calling $PNDSDK/bin/pandora-gcc
EDIT5:I tried getting qmake to work with the crosscompiler toolchain which resulting in me implementing some changes:
EDIT6:Thanks to yannick for pointing out a really strange issue with the crosscompiler toolchain installer:
The Qt libs were not installed automatically. Somehow it does only install all the required libs when rerunning the whole opkg update && opkg install part. In theory for just fixing the qt stuff a simple "opkg install libqtcore4" would be enough, but I prefer to be sure that no other things were missed, so rerunning the whole section that installs packages. This does of course significantly increase the installer runtime (about +5min on my Desktop system with decent harddrive and CPU), but since the packages are only downloaded once this should not be too much of a problem.
EDIT7:It was again yannick who pointed out that the versions of
genpxml.sh and
pnd_make.sh shipped/created by the scripts were outdated. Updated those files in this latest revision.
EDIT8:Finally a new version of the
openpandora_toolchain.sh with some tiny updates:
- This version is now based on the latest codesourcery toolchain which was released some weeks ago ("Sourcery G++ Lite 2011.03-41 for ARM GNU/Linux").
- Updated pkg-config from 0.25 to 0.26.
- Updated to latest version of pnd_make.sh from the openpandora git. This should fix any problems you had with the script so far.
- Updated to latest version of genpxml.sh from the openpandora git.
- Added PXML_schema.xsd from the openpandora git.
- Don't install "mesa" packages, since they would offer headers for OpenGL which is not available on the pandora.
- Created some symlinks in $PNDSDK/usr/include as recommended by sebt3. This should improve the ability of autotools/cmake/... to detect header files that were placed into a strange dir by angstrom.
Since this is a new version of the base toolchain, it will install itself into a different folder. You can remove the old folder
arm-2010.09/ once you are confident this new toolchain is working nicely for you. It will also add a new entry in your .bashrc. You can remove the old line (referencing
arm-2010.09/), if you want to.
EDIT9:You can now download the script
openpandora_toolchain.sh directly from the openpandora git repository. The installer script is still a single file. To check the history of the file, please head over to
git.openpandora.org/pandora-misc.git/sdk_installer. Here is a list of the changes in this veryion:
- This version is now based on the latest codesourcery toolchain which was released on 16 December 2011 ("Sourcery CodeBench Lite 2011.09-70 for ARM GNU/Linux "). The main change is that the compiler is now based upon GCC 4.6.1 instead of 4.5.x which might improve some optimization settings.
- Removed "-fsingle-precision-constant" from the default flags in the provided helper files since, at least in case of Wesnoth it can lead to some problematic behaviour in those cases where double precision is actually required.
Since this is a new version of the base toolchain, it will install itself into a different folder. You can remove the old folders
arm-2010.09/ and/or
arm-2011.03/ once you are confident this new toolchain is working nicely for you. It will also add a new entry in your .bashrc. You can remove the old lines (referencing
arm-2010.09/ and/or
arm-2011.03/), if you want to.
Edited by Ivanovic, 14 February 2012 - 10:31 AM.