Detect clock_gettime(2) and use (if available) for the fetch cb.

This commit is contained in:
Juan RP
2011-12-19 16:41:57 +01:00
parent 866c395d12
commit 6ad7289d68
2 changed files with 39 additions and 2 deletions

23
configure vendored
View File

@@ -443,6 +443,29 @@ fi
echo "$PROPLIB."
rm -f _$func.c _$func
#
# Check for clock_gettime(3).
#
func=clock_gettime
printf "Checking for $func() ... "
cat <<EOF > _$func.c
#include <time.h>
int main(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return 0;
}
EOF
if $XCC -lrt _$func.c -o _$func 2>/dev/null; then
echo yes.
echo "CPPFLAGS += -DHAVE_CLOCK_GETTIME" >>$CONFIG_MK
echo "LDFLAGS += -lrt" >>$CONFIG_MK
echo "STATIC_LIBS += -lrt" >>$CONFIG_MK
else
echo no.
fi
rm -f _$func.c _$func
#
# zlib is required.
#