Compile Open Source Projects

To compile an application on most open source projects, you will be asked to execute the following three steps:

  1. configure
  2. make
  3. make install

The configure script basically consists of many lines which are used to check details about the machine on where the software is going to be installed. The script will check for a lot of dependencies on your system. When you run the configure script, you will see a lot of output on the screen, each being some sort of question with a respective yes/no reply. If there are any major requirements missing on your system, the configure script will exit and you will not be able to proceed with the installation until you meet all the requirements. In most cases, compile applications on some particular target machines will require you to modify the configure script manually to provide the correct values.

When running the configure script to configure software packages for cross-compiling, you will need to specify the CC, LD, RANLIB, CFLAGS, LDFLAGS, host, target, and build, etc. Some examples are given below.

For PowerPC QorIQ platform in DSM 5.0:

env CC=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linuxgnuspe-gcc \
    LD=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linuxgnuspe-ld \
    RANLIB=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linuxgnuspe-ranlib \
    CFLAGS="-I/usr/local/powerpc-none-linux-gnuspe/include -mcpu=8548 -mhard-float -mfloat-gprs=double" \
    LDFLAGS="-L/usr/local/powerpc-none-linux-gnuspe/lib" \
./configure \
    --host=powerpc-unknown-linux \
    --target=powerpc-unknown-linux \
    --build=i686-pc-linux \
    --prefix=/usr/local

For Marvell 6281 platform in DSM 5.0:

env CC=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linuxgnueabi-gcc \
    LD=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linuxgnueabi-ld \
    RANLIB=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linuxgnueabi-ranlib \
    CFLAGS="-I/usr/local/arm-marvell-linux-gnueabi/arm-marvell-linuxgnueabi/libc/include" \
    LDFLAGS="-L/usr/local/arm-marvell-linux-gnueabi/arm-marvell-linuxgnueabi/libc/lib" \
./configure \
    --host=armle-unknown-linux \
    --target=armle-unknown-linux \
    --build=i686-pc-linux \
    --prefix=/usr/local

For Marvell Armada 370 platform in DSM 5.0:

env CC=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linuxgnueabi-gcc \
    LD=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linuxgnueabi-ld \
    RANLIB=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linuxgnueabi-ranlib \
    CFLAGS="-I/usr/local/arm-marvell-linux-gnueabi/arm-marvell-linuxgnueabi/libc/include -mhard-float -mfpu=vfpv3-d16" \
    LDFLAGS="-L/usr/local/arm-marvell-linux-gnueabi/arm-marvell-linuxgnueabi/libc/lib" \
./configure \
    --host=armle-unknown-linux \
    --target=armle-unknown-linux \
    --build=i686-pc-linux" \
    --prefix=/usr/local

For Marvell Armada 375 platform in DSM 5.1:

env CC=/usr/local/armv7-marvell-linux-gnueabi-hard/bin/arm-marvelllinux-gnueabi-ccache-gcc \
    LD=/usr/local/armv7-marvell-linux-gnueabi-hard/bin/arm-marvell-linuxgnueabi-ld \
    RANLIB=/usr/local/armv7-marvell-linux-gnueabi-hard/bin/arm-marvelllinux-gnueabi-ranlib \
    CFLAGS="-I/usr/local/armv7-marvell-linux-gnueabi-hard/arm-marvelllinux-gnueabi/libc/usr/include -mhard-float -mfpu=vfpv3" \
    LDFLAGS="-L/usr/local/armv7-marvell-linux-gnueabi-hard/arm-marvelllinux-gnueabi/libc/lib" \
./configure \
    --host=armle-unknown-linux \
    --target=armle-unknown-linux \
    --build=i686-pc-linux" \
    --prefix=/usr/local

For Marvell Armada XP platform in DSM 5.0:

env CC=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linuxgnueabi-gcc \
    LD=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linuxgnueabi-ld \
    RANLIB=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linuxgnueabi-ranlib \
    CFLAGS="-I/usr/local/arm-marvell-linux-gnueabi/arm-marvell-linuxgnueabi/libc/include -mhard-float -mfpu=vfpv3-d16" \
    LDFLAGS="-L/usr/local/arm-marvell-linux-gnueabi/arm-marvell-linuxgnueabi/libc/lib" \
./configure \
    --host=armle-unknown-linux \
    --target=armle-unknown-linux \
    --build=i686-pc-linux" \
    --prefix=/usr/local

For Annapurnalabs, Alpine platform in DSM 5.1:

env CC=/usr/local/arm-cortex_a15-linux-gnueabi/bin/arm-cortex_a15-linux-gnueabi-ccache-gcc \
    LD=/usr/local/arm-cortex_a15-linux-gnueabi/bin/arm-cortex_a15-linuxgnueabi-ld \
    RANLIB=/usr/local/arm-cortex_a15-linux-gnueabi/bin/arm-cortex_a15-linux-gnueabi-ranlib \
    CFLAGS="-I/usr/local/arm-cortex_a15-linux-gnueabi/arm-cortex_a15-linux-gnueabi/sysroot/usr/include -mfloat-abi=hard -mtune=cortex-a15 -mfpu=neon-vfpv4 -mthumb" \
    LDFLAGS="-L/usr/local/arm-cortex_a15-linux-gnueabi/arm-cortex_a15-linux-gnueabi/sysroot/lib" \
./configure \
    --host=arm-cortex_a15-linux-gnueabi \
    --target=arm-cortex_a15-linux-gnueabi \
    --build=i686-pc-linux" \
    --prefix=/usr/local

For Mindspeed, Comcerto, C2000 platform in DSM 5.0:

env CC=/usr/local/arm-cortexa9-linux-gnueabi/bin/arm-cortexa9-linuxgnueabi-ccache-gcc \
    LD=/usr/local/arm-cortexa9-linux-gnueabi/bin/arm-cortexa9-linuxgnueabi-ld \
    RANLIB=/usr/local/arm-cortexa9-linux-gnueabi/bin/arm-cortexa9-linuxgnueabi-ranlib \
    CFLAGS="-I/usr/local/arm-cortexa9-linux-gnueabi/arm-cortexa9-linuxgnueabi/sysroot/include -mcpu=cortex-a9 -march=armv7-a -mfpu=neon -mfloat-abi=hard -mthumb" \
    LDFLAGS="-L/usr/local/arm-cortexa9-linux-gnueabi/arm-cortexa9-linuxgnueabi/sysroot/lib" \
./configure \
    --host=armle-unknown-linux \
    --target=armle-unknown-linux \
    --build=i686-pc-linux" \
    --prefix=/usr/local

For Intel X86 platform in DSM 5.0:

env CC=/usr/local/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-gcc \
    LD=/usr/local/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-ld \
    RANLIB=/usr/local/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-ranlib \
    CFLAGS="-I/usr/local/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/include" \
    LDFLAGS="-L/usr/local/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/lib" \
./configure \
    --host=i686-pc-linux-gnu \
    --target=i686-pc-linux-gnu \
    --build=i686-pc-linux \
    --prefix=/usr/local

For Intel Atom Evansport platform in DSM 5.0:

env CC=/usr/local/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-gcc \
    LD=/usr/local/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-ld \
    RANLIB=/usr/local/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-ranlib \
    CFLAGS="-I/usr/local/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/include" \
    LDFLAGS="-L/usr/local/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/lib" \
./configure \
    --host=i686-pc-linux-gnu \
    --target=i686-pc-linux-gnu \
    --build=i686-pc-linux \
    --prefix=/usr/local