Right, very quick bunch of information to get up and running!
1. Download and install arm-2010q1-202-arm-none-linux-gnueabi.exe - it's important to get this one and not arm-2010q1-188-arm-none-eabi.exe otherwise you'll be missing a bunch of functionality (for example dirent.h/utime.h) as this functionality is provided by the Linux layer.
You can then compile/link with:
Code:
Make libraries from objects : arm-none-linux-gnueabi-ar.exe ru
Compile C code : arm-none-linux-gnueabi-g++.exe
Compile C++ code : arm-none-linux-gnueabi-g++.exe
Link an application : arm-none-linux-gnueabi-g++.exe
Index a library : arm-none-linux-gnueabi-ranlib.exe
They all live in:
Code:
C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite\bin
If you used the default install options.
2. I haven't got around to finding out what the best CFLAGS/LDFLAGS are to use yet, but the ones I have for now (that at least produce an executable I can run) are:
CFLAGS
Code:
-fsigned-char
-march=armv7-a
-mtune=cortex-a8
-mfpu=neon
-mfloat-abi=softfp
-Wno-deprecated
-Wno-psabi
CFLAGS DEBUG (additional)
CFLAGS RELEASE (additional)
C++FLAGS - assumes you don't want RTTI or exceptions
Code:
-fno-exceptions
-fno-rtti
DEFINES
Code:
__ARM_ARCH_5__
__ARM_ARCH_5T__
__ARM_ARCH_5E__
__ARM_ARCH_5TE__
__NEW__
__SGI_STL_INTERNAL_PAIR_H
_PANDORA
TCHAR=char
LDFLAGS - these don't completely make sense, I just copied them from Android for now - they at least work!
Code:
-Wl,--whole-archive
-Wl,--no-whole-archive
-Wl,--no-undefined
-g
-lstdc++
-lrt
-Wl,-rpath=libs
You can note that the -Wl,-rpath=libs means at runtime, it'll look for any shared/dynamic libraries in a libs folder, more about this later...
3. Libraries - a couple of libraries I compiled myself (OpenAL/ALUT), but in general, most libraries are already available. I do not know too much about Linux, so there might be a better way to do this, but the thing I found is, if you download this:
20100611-i686-linux-armv7a-linux-gnueabi-toolchain-openpandora.tar.bz2
And then extract it somewhere (I used 7zip), you should end up with a bunch of files/directories, with the top one being 'usr'. You'll find a bunch of 'useful' headers in this subdirectory:
Code:
usr\local\angstrom\arm\arm-angstrom-linux-gnueabi\usr\include
And the corresponding libraries:
Code:
usr\local\angstrom\arm\arm-angstrom-linux-gnueabi\usr\lib
It's up to you what you do with this lot, but personally I decided to copy what I needed into a separate directory, for example, you could copy them into:
So you end up with:
Code:
c:\pandorasdk\include
c:\pandorasdk\lib
Then you can compile/link against this by adding to your flags:
Code:
CFLAGS += -Ic:/pandorasdk/include
LDFLAGS += -Wl,-rpath=c:/pandorasdk/lib -Lc:/pandorasdk/lib
I found both -rpath and -L were necessary. That should allow you to #include what you like, and allow you to link to a library by adding to your LDFLAGS like:
Code:
LDFLAGS += -lopenal -lGLES_CM -lx11
There is one additional thing you need to do (someone else might be able to suggest a way to skip this step), but I found it often tried to link to against a library which is 0 bytes in size, for example if we look at the GLES library, we have:
Code:
000,000 bytes - libGLES_CM.so
000,000 bytes - libGLES_CM.so.1
000,000 bytes - libGLES_CM.so.1.4
563,796 bytes - libGLES_CM.so.1.4.14.2514
I think essentially on Linux the first three would be a symlink to the last one, but on Windows this didn't work. So I just duplicated the last file three times, and renamed it to match the first free entries. I've repeated this for each library I have linked against. Maybe this sounds bonkers, but I have my complete game running now, and I think I only link against three libraries (x11/openal/GLES_CM) so I only had to copy/rename less than 10 files).
4. Once I had built my application, I copied it into a directory on an SD card, and created a libs folder along side, in this folder I put in any shared libraries I used (OpenAL/GLES/x11), one way to find out what libraries you need is not to include any, and just try running your application form the console window, it'll tell you what libraries are required, and you can just keep copying them in until you have everything. I'm sure there is a better way to do this, but I found I could do this in a minute or two and be all good to go.
5. Profit!
I hope that at least gives you a push in the right direction; as I say, I had planned on doing a more detailed tutorial after my holiday, but I thought I better just throw something quick together now to get you going. I should also mention I am using the JamPlus build system, it generates a Visual Studio workspace and lets you build from there, it is all very slick. JamPlus doesn't ship with Pandora support, but I've added support for Pandora, which I will be submitting to get included in the next release. So you may potentially want to check out JamPlus, it's up to you.
If anything doesn't make sense, I'm sure some of the brains on the forum will be able to help you out, and correct my crazy guide above!
Steve