For basic information on how to compile Linknx, please refer to Compiling Linknx
Here I'll briefly introduce the method to cross-compile Linknx for Optware.

The OptWare package system was originally created to accompany the Unslung firmware for the NSLU2 (originally the packages were also called Unslung packages). It has since been expanded to cover a variety of other platforms, including Linksys NSLU2, Synology DS101, Freecom FSG3, ... More info on http://www.nslu2-linux.org/wiki/Optware/

In this example, I'll explain how to create the linknx package for Synology DS101 platform.
First get a copy of optware
svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware
cd optware/
 
Then prepare the toolchain for DS101
make ds101-target
cd ds101
make directories ipkg-utils crosstool
 
Now we'll have to create a makefile for each new package to build explaining how to build it. These makefiles are named <package_name>.mk and placed in the "optware/make" directory.
The makefiles I use can be found in http://ouaye.net/linknx/optware-DS101/build/

To create the linknx package makefile from scratch, go to optware directory and execute
make make/linknx.mk
It will create a template linknx.mk file in optware/make that you can customize to your needs
More details at http://www.nslu2-linux.org/wiki/Optware/AddAPackageToOptware

Once you have the makefiles, go to optware/ds101 directory and build the packages like this:
make pthsem-ipk
make eibd-ipk
make linknx-ipk
After a successfull build, the ".ipk" files are located in optware/ds101/builds