1 dnl Check for things that check needs/wants and that we don't check for already
2 dnl AM_GST_CHECK_CHECKS()
4 AC_DEFUN([AG_GST_CHECK_CHECKS],
6 AC_MSG_NOTICE([Running check unit test framework checks now...])
11 CHECK_VERSION=$CHECK_MAJOR_VERSION.$CHECK_MINOR_VERSION.$CHECK_MICRO_VERSION
13 AC_SUBST(CHECK_MAJOR_VERSION)
14 AC_SUBST(CHECK_MINOR_VERSION)
15 AC_SUBST(CHECK_MICRO_VERSION)
16 AC_SUBST(CHECK_VERSION)
18 dnl Checks for header files and declarations
19 AC_CHECK_HEADERS([unistd.h sys/wait.h sys/time.h], [], [], [AC_INCLUDES_DEFAULT])
21 dnl Check for localtime_r()
22 AC_CHECK_FUNCS([localtime_r])
23 AM_CONDITIONAL(HAVE_LOCALTIME_R, test "x$ac_cv_func_localtime_r" = "xyes")
25 dnl Check for gettimeofday()
26 AC_CHECK_FUNCS([gettimeofday])
27 AM_CONDITIONAL(HAVE_GETTIMEOFDAY, test "x$ac_cv_func_gettimeofday" = "xyes")
29 dnl Check for getpid() and _getpid()
30 AC_CHECK_FUNCS([getpid _getpid])
32 dnl Check for strdup() and _strdup()
33 AC_CHECK_DECLS([strdup])
34 AC_CHECK_FUNCS([_strdup])
35 AM_CONDITIONAL(HAVE_STRDUP, test "x$ac_cv_have_decl_strdup" = "xyes" -o "x$ac_cv_func__strdup" = "xyes")
37 dnl Check for getline()
38 AC_CHECK_FUNCS([getline])
39 AM_CONDITIONAL(HAVE_GETLINE, test "x$ac_cv_func_getline" = "xyes")
42 AC_CHECK_FUNCS([mkstemp])
45 AC_CHECK_FUNCS([fork], HAVE_FORK=1, HAVE_FORK=0)
48 dnl Check for alarm, localtime_r and strsignal
49 dnl First check for time.h as it might be used by localtime_r
50 AC_CHECK_HEADERS([time.h])
51 AC_CHECK_DECLS([alarm, localtime_r, strsignal], [], [], [
55 #endif /* HAVE_TIME_H */
57 AC_CHECK_FUNCS([alarm setitimer strsignal])
58 AM_CONDITIONAL(HAVE_ALARM, test "x$ac_cv_func_alarm" = "xyes")
59 AM_CONDITIONAL(HAVE_LOCALTIME_R, test "x$ac_cv_func_localtime_r" = "xyes")
60 AM_CONDITIONAL(HAVE_STRSIGNAL, test "x$ac_cv_func_strsignal" = "xyes")
62 dnl Check if struct timespec/itimerspec are defined in time.h. If not, we need
63 dnl to define it in libs/gst/check/libcheck/libcompat.h. Note the optional
64 dnl inclusion of pthread.h. On MinGW(-w64), the pthread.h file contains the
65 dnl timespec/itimerspec definitions.
66 AC_CHECK_MEMBERS([struct timespec.tv_sec, struct timespec.tv_nsec], [],
67 [AC_DEFINE_UNQUOTED(STRUCT_TIMESPEC_DEFINITION_MISSING, 1,
68 [Need to define the timespec structure])], [
72 #endif /* HAVE_PTHREAD */
74 AC_CHECK_MEMBERS([struct itimerspec.it_interval, struct itimerspec.it_value],
75 [], [AC_DEFINE_UNQUOTED(STRUCT_ITIMERSPEC_DEFINITION_MISSING, 1,
76 [Need to define the itimerspec structure])], [
80 #endif /* HAVE_PTHREAD */
83 dnl Check if types timer_t/clockid_t are defined. If not, we need to define it
84 dnl in libs/gst/check/libcheck/libcompat/libcompat.h. Note the optional
85 dnl inclusion of pthread.h. On MinGW(-w64), the pthread.h file contains the
86 dnl timer_t/clockid_t definitions.
87 AC_CHECK_TYPE(timer_t, [], [
88 AC_DEFINE([timer_t], [int], [timer_t])
93 #endif /* HAVE_PTHREAD */
95 AC_CHECK_TYPE(clockid_t, [], [
96 AC_DEFINE([clockid_t], [int], [clockid_t])
101 #endif /* HAVE_PTHREAD */
104 dnl Check for POSIX timer functions in librt
105 AC_CHECK_LIB([rt], [timer_create, timer_settime, timer_delete])
106 AM_CONDITIONAL(HAVE_TIMER_CREATE_SETTIME_DELETE, test "x$ac_cv_lib_rt_timer_create__timer_settime__timer_delete" = "xyes")
108 dnl Allow for checking HAVE_CLOCK_GETTIME in automake files
109 AM_CONDITIONAL(HAVE_CLOCK_GETTIME, test "x$CLOCK_GETTIME_FOUND" = "xyes")
111 dnl Create _stdint.h in the top-level directory
114 dnl Disable subunit support for the time being
117 if test xfalse = x"$enable_subunit"; then
122 AC_SUBST(ENABLE_SUBUNIT)
123 AC_DEFINE_UNQUOTED(ENABLE_SUBUNIT, $ENABLE_SUBUNIT, [Subunit protocol result output])
125 AM_CONDITIONAL(SUBUNIT, test x"$enable_subunit" != "xfalse")