Hi Patrick,
Nice findings, thanks for the report and the patches.
The first changes /bin/sh to /bin/bash so that "echo -n" works as intended (with /bin/sh, the "-n" is not interpreted as an argument).
Do you mean it's interpreted literally instead of as an option ? I'd rather not depend on bash for the build. If OS X's /bin/sh has an echo builtin that does not understand -n, I should provide another workaround. POSIX recommends using printf instead of echo for portability purposes. I acknowledge that echo -n is nonconformant and am willing to change it, but for printf ? Really ? I'm open to alternative suggestions, because this is yet another case of standard misdesign that should be actively fought.
It also changes "exec ./compile tryclockrt.c" to "./compile tryclockrt.c; :". Without that change, the build fails:
Good catch, it's a bug indeed - but the correct fix is to put the ./compile line within the test, alongside the ./load line: if the compilation or the link fails, then CLOCK_REALTIME isn't supported.
The second patch changes some gcc and ld args for Mac OS X:
Things only break when flag-allstatic is absent, i.e. you're trying to build shared libraries. Supporting shared libraries on MacOS X is too much work, at least in the short term; if it builds with flag-allstatic, it's good enough for me atm. However, I'm interested in supporting llvm/clang; if upstream clang needs those changes and has good reasons for not accepting the gcc-style options, there's a case for this patch. -- Laurent
