portlibs: Difference between revisions

From devkitPro
Jump to navigation Jump to search
Line 33: Line 33:
==libpng==
==libpng==


   CPPFLAGS=-I$DEVKITPRO/portlibs/arm/include LDFLAGS=-L$DEVKITPRO/portlibs/arm/lib <path/to/>configure --prefix=$DEVKITPRO/portlibs/arm --host=arm-eabi --disable-shared --enable-static
   CPPFLAGS=-I$DEVKITPRO/portlibs/arm/include LDFLAGS=-L$DEVKITPRO/portlibs/arm/lib <path/to/>configure \
  --prefix=$DEVKITPRO/portlibs/arm --host=arm-eabi --disable-shared --enable-static


==freetype==
==freetype==
   <path/to/>freetype-2.4.2/builds/unix/configure --disable-shared --enable-static --host=arm-eabi --prefix=/opt/devkitpro/portlibs/arm
   <path/to/>freetype-2.4.2/builds/unix/configure --disable-shared --enable-static --host=arm-eabi --prefix=/opt/devkitpro/portlibs/arm

Revision as of 14:06, 19 October 2010

devkitPro are currently supplying a selection of useful libraries for porting purposes. These can be found in the portlibs section of sourceforge. Eventually we hope to have the installer/updater pull these automatically but for now they can be installed manually. The archives should be extracted into the $DEVKITPRO/portlibs/<cpu> directory as appropriate, i.e. libpng-1.2.40-arm.tar.bz2 should be extracted to $DEVKITPRO/portlibs/arm and libpng-1.2.40-ppc.tar.bz2 to $DEVKITPRO/portlibs/ppc.

To use these libraries in your projects just add $(PORTLIBS) to the LIBDIRS line and the appropriate lib to the LIBS line in the template makefiles, the devkitPro build system takes care of the rest.

For libraries which aren't currently provided you can attempt to build them manually - most portable libraries which use autotools should work. You'll need to do this from a bash shell (provided by msys under windows) with a fairly standard configure && make && make install approach.

For arm libraries you do this - please note, configure should usually not be run from the source directory directly, create a build directory outside the source tree and configure from there. Most libraries work this way but some will require configuring & building from inside the source tree using ./configure

 PATH=$DEVKITARM/bin:$PATH
 <path/to/>configure --prefix=$DEVKITPRO/portlibs/arm --host=arm-eabi --disable-shared --enable-static
 make && make install

For ppc libraries obviously you use devkitPPC and --host=powerpc-eabi

 PATH=$DEVKITPPC/bin:$PATH
 <path/to/>configure --prefix=$DEVKITPRO/portlibs/ppc --host=powerpc-eabi --disable-shared --enable-static
 make && make install


These are the configure lines used for the prebuilt portlibs provided on Sourceforge. Where <path/to/> is used then the library was configured and built in a directory outside the source tree.

zlib

While zlib provides a configure script, it isn't a standard autotools configure and needs to be used differently.

 AR="arm-eabi-ar rc" RANLIB=arm-eabi-ranlib CC=arm-eabi-gcc prefix=$DEVKITPRO/portlibs/arm ./configure

For devkitPPC replace arm-eabi with powerpc-eabi and prefix with $DEVKITPRO/portlibs/ppc.

sqlite

 CFLAGS=-DSQLITE_OS_OTHER=1 <path/to/>configure --disable-shared --disable-threadsafe --disable-dynamic-extensions --host=arm-eabi --prefix=$DEVKITPRO/portlibs/arm

libpng

 CPPFLAGS=-I$DEVKITPRO/portlibs/arm/include LDFLAGS=-L$DEVKITPRO/portlibs/arm/lib <path/to/>configure \
 --prefix=$DEVKITPRO/portlibs/arm --host=arm-eabi --disable-shared --enable-static

freetype

 <path/to/>freetype-2.4.2/builds/unix/configure --disable-shared --enable-static --host=arm-eabi --prefix=/opt/devkitpro/portlibs/arm