BUILDING PACKAGES
1. Prepare the environment
$ sudo install -d -m 0775 -g users /devel
$ mkdir /devel/crux-arm
2. Checkout git sources for the current toolchain and build them:
$ cd /devel/crux-arm
$ git clone git://crux-arm.nu/toolchain.git
$ cd toolchain
$ git branch 2.6 origin/2.6
$ git checkout 2.6
$ make
2.2 no-eabi toolchain
$ cd /devel/crux-arm
$ git clone git://crux-arm.nu/toolchain.git toolchain-noeabi
$ cd toolchain-noeabi
$ git branch 2.6-noeabi origin/2.6-noeabi
$ git checkout 2.6-noeabi
$ make
3. Checkout git sources for pkgutils-cross and build them
$ cd /devel/crux-arm
$ git clone git://crux-arm.nu/pkgutils-cross.git
$ cd pkgutils-cross
$ git branch 2.6 origin/2.6
$ git checkout 2.6
$ make
4. Configure the cross enviroment for building ports
- 4.1 Setup for eabi toolchain:
$ vim /devel/crux-arm/pkgutils-cross/src/pkgmk.conf
# Both vars must point to your clfs path
export CLFS="/devel/crux-arm/toolchain/clfs"
export CROSSTOOLS="/devel/crux-arm/toolchain/crosstools"
export CTARGET="arm-crux-linux-gnueabi"
4.2 Setup for no-eabi toolchain:
$ vim /devel/crux-arm/pkgutils-cross/src/pkgmk.conf
# Both vars must point to your clfs path
export CLFS="/devel/crux-arm/toolchain-noeabi/clfs"
export CROSSTOOLS="/devel/crux-arm/toolchain-noeabi/crosstools"
export CTARGET="arm-crux-linux-gnu"
5. Checkout git sources for port repositories
$ mkdir /devel/crux-arm/ports
$ cd /devel/crux-arm/ports
$ git clone git://crux-arm.nu/ports/core-cross.git
$ cd core-cross
$ git branch 2.6 origin/2.6
$ git checkout 2.6
6. Build ports
$ cd /devel/crux-arm/ports/core-cross/ncurses
$ export PATH=/devel/crux-arm/pkgutils-cross:$PATH
$ fakeroot pkgmk-cross -d
FAQ
Q. How should I cross build a port which requires some other deps?
A. Just build all deps with pkgmk-cross and install them in your $CLFS.
i.e: (if you need zlib installed for building a port)
$ cd /devel/crux-arm/ports/core-cross/zlib
$ fakeroot pkgmk-cross -d
$ sudo pkgadd-cross zlib#1.2.3-1.pkg.tar.gz
A. For debian or ubuntu based systems it's needed to use the env:
$ sudo env PATH=$PATH pkgadd-cross zlib#1.2.3-1.pkg.tar.gz
or making an alias:
$ alias sudo='sudo env PATH=$PATH'
Q. Can I use optimize flags for my ARM processor?
A. Yes, pkgmk-cross can be used with -o option to specify the optimization to use.
There are some optimizations predefined in pkgmk.conf file and can be added more.
arm9tdmi_CFLAGS="-O2 -pipe -march=armv4 -mtune=arm9tdmi"
armv5te_CFLAGS="-O2 -pipe -msoft-float -march=armv5te"
strongarm_CFLAGS="-O2 -pipe -march=armv4 -mtune=strongarm"
xscale_CFLAGS="-O2 -pipe -msoft-float -march=armv5te -mtune=xscale"
i.e. of usage: pkgmk-cross -o
name
where
name is the optimization selected, arm9tdmi, armv5te, strongarm, xscale or your custom CFLAGS