diff options
-rw-r--r-- | configure.ac | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 7a44c0d5..936550ce 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -918,9 +918,20 @@ AC_CHECK_DECLS([SOCK_NONBLOCK], [AC_DEFINE([HAVE_SOCK_NONBLOCK], [1], [SOCK_NONB | |||
918 | ]) | 918 | ]) |
919 | 919 | ||
920 | 920 | ||
921 | AC_SEARCH_LIBS([clock_gettime], [rt], [ | 921 | AC_CHECK_DECL([[clock_gettime]], |
922 | AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Have clock_gettime]) | 922 | [ |
923 | ]) | 923 | SAVE_LIBS="$LIBS" |
924 | AC_SEARCH_LIBS([clock_gettime], [rt], | ||
925 | [ | ||
926 | AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime]) | ||
927 | AS_VAR_IF([[ac_cv_search_clock_gettime]],[["none required"]], [], | ||
928 | [ | ||
929 | MHD_LIBDEPS="$ac_cv_search_clock_gettime $MHD_LIBDEPS" | ||
930 | MHD_LIBDEPS_PKGCFG="$ac_cv_search_clock_gettime $MHD_LIBDEPS_PKGCFG" | ||
931 | ]) | ||
932 | ], [], [$MHD_LIBDEPS]) | ||
933 | LIBS="$SAVE_LIBS" | ||
934 | ], [], [[#include <time.h>]]) | ||
924 | 935 | ||
925 | AC_MSG_CHECKING([[for clock_get_time]]) | 936 | AC_MSG_CHECKING([[for clock_get_time]]) |
926 | AC_LINK_IFELSE( | 937 | AC_LINK_IFELSE( |
@@ -939,8 +950,6 @@ AC_LINK_IFELSE( | |||
939 | ], | 950 | ], |
940 | [ | 951 | [ |
941 | AC_DEFINE([HAVE_CLOCK_GET_TIME], [1], [Define to 1 if you have `clock_get_time', `host_get_clock_service' and `mach_port_deallocate' functions.]) | 952 | AC_DEFINE([HAVE_CLOCK_GET_TIME], [1], [Define to 1 if you have `clock_get_time', `host_get_clock_service' and `mach_port_deallocate' functions.]) |
942 | # For glibc < 2.17, we need -lrt: | ||
943 | MHD_LIBDEPS="-lrt $MHD_LIBDEPS" | ||
944 | AC_MSG_RESULT([[yes]]) | 953 | AC_MSG_RESULT([[yes]]) |
945 | ], | 954 | ], |
946 | [AC_MSG_RESULT([[no]]) | 955 | [AC_MSG_RESULT([[no]]) |