Add -lrt for all operating systems for clock_gettime
authorDagobert Michelsen <dam@opencsw.org>
Tue, 16 Jul 2019 11:36:12 +0000 (13:36 +0200)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 16 Jul 2019 22:16:39 +0000 (08:16 +1000)
configure.ac

index 3d18bb9..76aaa6f 100644 (file)
@@ -411,11 +411,11 @@ AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
 fi
 
-AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
-if test x$have_clock_gettime = xyes; then
+AC_CHECK_LIB(rt, clock_gettime,
+        LIB_CLOCK_GETTIME=-lrt
         AC_DEFINE(HAVE_CLOCK_GETTIME)
-        AH_TEMPLATE(HAVE_CLOCK_GETTIME, [define if you have clock_gettime])
-fi
+        AH_TEMPLATE(HAVE_CLOCK_GETTIME, [define if you have clock_gettime]))
+AC_SUBST(LIB_CLOCK_GETTIME)
 
 # only matters for x86
 AC_CHECK_PROGS(NASM, nasm)
@@ -493,11 +493,6 @@ if test x$enable_stack_smash_protection = "xyes" ; then
        XIPH_GXX_STACK_PROTECTOR
        fi
 
-if test "x$sys_linux" = xtrue ; then
-       LIB_CLOCK_GETTIME=-lrt
-       fi
-AC_SUBST(LIB_CLOCK_GETTIME)
-
 AC_CONFIG_FILES([ \
        Makefile \
        src/Makefile \