There is one remaining problem. Since I found out almost every major distributions packages mozilla js already. It simpler to installed the package instead of compiling by oneself. But some of the distributions change the name of library, or the include path, so I am still looking through documents on how to detected the variations automatically, but I think it a solvable problem.
I think we can compile in linux/bsd reliably pretty soon.