Gnuk support

Hi

This is the redo of Pull Requet #153, with some update based on Viktor and Frank's comments.

This is the log to show that it works http://kopy.io/6wqKd
Could you use defines instead of hard coded values?