Merge pull request #1287 from ivadasz/dragonfly_patches

Add support for DragonFly BSD.