This is a guide on how to compile boost for ARM processors using the devkitARM compiler. I’ll asume you already have devkitARM installed and that the DEVKITPRO and DEVKITARM environment variables set. I have the latest boost version (1.43.0) compiled with the latest devkitARM (r31) as a download at the botom of this post, if you want to use that.
First thing to do is download the latest boost and bjam version from the boost website, and unzip them to some directory. Next, create a file called user-config.jam and put “using gcc : 4.5.0 : arm-eabi-g++ ;” in it, without the quotes (change the version number if needed). You can use the default one at BOOST_DIR/tools/build/v2/user-config.jam, but personally I prefer not to change anything in the boost directory.
Next, change your PATH environment variable to include $(DEVKITPRO)/msys/bin/, $(DEVKITARM)/bin/ and the path to bjam (the first may already be in your PATH variable). It doesn’t really matter how you do it, as long as the PATH variable contains those directories when you execute bjam (I personally use a makefile to change the path and execute bjam).
Now open up a command shell, change the directory to the boost directory, and execute the following command:
bjam –user-config=”$CONFIG” –build-dir=”$BUILD_DIR” –layout=system –toolset=gcc variant=release link=static threading=single runtime-link=static –prefix=”$DEVKITPRO/boost” install
If you use a custom user-config.jam file, then change $CONFIG with the location of the file (including the filename) or if you use the default one, you can remove the –user-config=”$CONFIG” part. $BUILD_DIR should be the directory where all the intermediary files are stored. If you use a shell other than bash, then you should change $DEVKITPRO to the correct way of using environment variables. e.g. %DEVKITPRO% for cmd.exe etc. You can use –with-XXX or –without-XXX to compile just a few libraries or to omit libraries from compiling.
Compiling boost takes a while, so I suggest you do something else in the mean time. after its done, it should output something like this:
…failed updating 8 targets…
…skipped 159 targets…
…updated 8136 targets…
and the library should be installed in $DEVKITPRO/boost. Do note that some libraries have errors during compiling, and therefore aren’t available.
And now you can use boost in all your DS projects. Just don’t forget to to add boost in the makefile and remove -fno-exceptions from the CXXFLAGS, because boost uses exceptions pretty heavily.