support for DragonFly BSD

x86(-64) only for now, and threads are currently non-functional.
Closes lp#1292845, thanks to Vasily Postnicov.