More generally, default.func.rc.od wasn't super useful because you couldn't specify either a header file or library dependencies. Drop it and make an explicit clock_gettime.rc.od. As a bonus, this also checks that CLOCK_MONOTONIC exists as expected. Reported-by: Wayne Scott <wsc9tt@gmail.com>
17 lines
311 B
Text
17 lines
311 B
Text
. ./redoconf.rc
|
|
rc_include rc/CC.rc rc/rt.autolib.rc rc/posix.rc
|
|
|
|
prog="
|
|
#include <time.h>
|
|
|
|
void test() { clock_gettime(CLOCK_MONOTONIC, NULL); }
|
|
"
|
|
|
|
rc_appendln LIBS "$LIBRT"
|
|
if rc_compile cc link "$prog"; then
|
|
rc_replaceln "HAVE_CLOCK_GETTIME" 1
|
|
else
|
|
rc_undo
|
|
rc_replaceln "HAVE_CLOCK_GETTIME" ""
|
|
fi
|
|
rc_save
|