diff --git a/Makefile.am b/Makefile.am index 0af391e8e..6f07c5bea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,3 @@ -< contrib/libtests/timepng.o: pnglibconf.h - # Makefile.am: # Source file for Makefile.in (and hence Makefile) # @@ -9,7 +7,10 @@ PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ ACLOCAL_AMFLAGS = -I scripts # test programs - run on make check, make distcheck -check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage timepng +check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage +if HAVE_CLOCK_GETTIME +check_PROGRAMS += timepng +endif # Utilities - installed bin_PROGRAMS= pngfix png-fix-itxt diff --git a/configure.ac b/configure.ac index 445c8ecb2..8c9465532 100644 --- a/configure.ac +++ b/configure.ac @@ -136,6 +136,11 @@ AC_C_RESTRICT AC_CHECK_FUNCS([memset memcpy strncpy],, AC_MSG_FAILURE([missing ANSI-C functions])) +# Some later POSIX 1003.1 functions are required for test programs, failure here +# is soft (the corresponding test program is not built). +AC_CHECK_FUNC([clock_gettime],,[AC_MSG_WARN([not building timepng])]) +AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "$ac_cv_func_clock_gettime" = "yes"]) + # floor and ceil are required for FLOATING_POINT, but they can be turned off on # the configure command line (and they are independent.) Default is to 'on' AC_ARG_ENABLE([floating-point],