summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-10-24 13:05:48 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-10-24 13:05:48 +0000
commit0b2719640e69c8bc929c43338646674a2a00582c (patch)
tree6c3ca6f91d20d795f8f18ac2d8160e3a92eff341 /configure
parentb4048073e620a8d84baebf299819a4f409cbbfea (diff)
downloadskalibs-0b2719640e69c8bc929c43338646674a2a00582c.tar.xz
Add timer_lib for support (GNU requires -lrt for timer_create!)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure13
1 files changed, 12 insertions, 1 deletions
diff --git a/configure b/configure
index bb100ed..47c1b95 100755
--- a/configure
+++ b/configure
@@ -449,6 +449,17 @@ EOF
echo 'posixspawn: no' >> $sysdeps/sysdeps
echo "#undef ${package_macro_name}_HASPOSIXSPAWN" >> $sysdeps/sysdeps.h
fi
+
+ hastimer=true
+ timer_lib=`trylibs timer 'timer_create()' -lrt` || hastimer=false
+ echo "$timer_lib" > $sysdeps/timer.lib
+ if $hastimer ; then
+ echo 'timer: yes' >> $sysdeps/sysdeps
+ echo "#define ${package_macro_name}_HASTIMER" >> $sysdeps/sysdeps.h
+ else
+ echo 'timer: no' >> $sysdeps/sysdeps
+ echo "#undef ${package_macro_name}_HASTIMER" >> $sysdeps/sysdeps.h
+ fi
exec 3>&-
echo "Checking system endianness..."
@@ -495,7 +506,6 @@ EOF
choose cl futimes FUTIMES 'futimes()'
choose cl arc4random ARC4RANDOM 'arc4random()'
choose cl getrandom GETRANDOM 'getrandom()'
- choose cl timer TIMER 'timer_create()' $sysclock_lib
choose cl itimer ITIMER 'setitimer()'
echo '#endif' >> $sysdeps/sysdeps.h
@@ -532,6 +542,7 @@ SPAWN_LIB := ${spawn_lib}
SOCKET_LIB := ${socket_lib}
SYSCLOCK_LIB := ${sysclock_lib}
TAINNOW_LIB := ${tainnow_lib}
+TIMER_LIB := ${timer_lib}
UTIL_LIB := ${util_lib}
CC := ${CC_AUTO##${cross}}
CFLAGS := $CFLAGS_AUTO