llvm: Improve the script and the compatibility with Mac OS X