flexible the build scripts and add a freebsd build script

Please add my change for build scripts (has now a freebsd script)