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...])
10 CHECK_MICRO_VERSION=14
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 AC_CHECK_FUNCS([localtime_r])
23 dnl Check for getpid() and _getpid()
24 AC_CHECK_FUNCS([getpid _getpid])
26 dnl Check for strdup() and _strdup()
27 AC_CHECK_DECLS([strdup])
28 AC_CHECK_FUNCS([_strdup])
31 AC_CHECK_FUNCS([mkstemp])
34 AC_CHECK_FUNCS([fork], HAVE_FORK=1, HAVE_FORK=0)
37 dnl Check for alarm, localtime_r and strsignal
38 dnl First check for time.h as it might be used by localtime_r
39 AC_CHECK_HEADERS([time.h])
40 AC_CHECK_DECLS([alarm, localtime_r, strsignal], [], [], [
44 #endif /* HAVE_TIME_H */
46 AC_CHECK_FUNCS([alarm setitimer strsignal])
47 AM_CONDITIONAL(HAVE_ALARM, test "x$ac_cv_func_alarm" = "xyes")
48 AM_CONDITIONAL(HAVE_LOCALTIME_R, test "x$ac_cv_func_localtime_r" = "xyes")
49 AM_CONDITIONAL(HAVE_STRSIGNAL, test "x$ac_cv_func_strsignal" = "xyes")
51 dnl Check if struct timespec/itimerspec are defined in time.h. If not, we need
52 dnl to define it in libs/gst/check/libcheck/libcompat.h. Note the optional
53 dnl inclusion of pthread.h. On MinGW(-w64), the pthread.h file contains the
54 dnl timespec/itimerspec definitions.
55 AC_CHECK_MEMBERS([struct timespec.tv_sec, struct timespec.tv_nsec], [],
56 [AC_DEFINE_UNQUOTED(STRUCT_TIMESPEC_DEFINITION_MISSING, 1,
57 [Need to define the timespec structure])], [
61 #endif /* HAVE_PTHREAD */
63 AC_CHECK_MEMBERS([struct itimerspec.it_interval, struct itimerspec.it_value],
64 [], [AC_DEFINE_UNQUOTED(STRUCT_ITIMERSPEC_DEFINITION_MISSING, 1,
65 [Need to define the itimerspec structure])], [
69 #endif /* HAVE_PTHREAD */
72 dnl Check if types timer_t/clockid_t are defined. If not, we need to define
73 dnl it in libs/gst/check/libcheck/ibcompat.h. Note the optional inclusion of
74 dnl pthread.h. On MinGW(-w64), the pthread.h file contains the
75 dnl timer_t/clockid_t definitions.
76 AC_CHECK_TYPE(timer_t, [], [
77 AC_DEFINE([timer_t], [int], [timer_t])
82 #endif /* HAVE_PTHREAD */
84 AC_CHECK_TYPE(clockid_t, [], [
85 AC_DEFINE([clockid_t], [int], [clockid_t])
90 #endif /* HAVE_PTHREAD */
93 dnl Check for POSIX timer functions in librt
94 AC_CHECK_LIB([rt], [timer_create, timer_settime, timer_delete])
95 AM_CONDITIONAL(HAVE_TIMER_CREATE_SETTIME_DELETE, test "x$ac_cv_lib_rt_timer_create__timer_settime__timer_delete" = "xyes")
97 dnl Allow for checking HAVE_CLOCK_GETTIME in automake files
98 AM_CONDITIONAL(HAVE_CLOCK_GETTIME, test "x$CLOCK_GETTIME_FOUND" = "xyes")
100 dnl Create _stdint.h in the top-level directory
103 dnl Disable subunit support for the time being
106 if test xfalse = x"$enable_subunit"; then
111 AC_SUBST(ENABLE_SUBUNIT)
112 AC_DEFINE_UNQUOTED(ENABLE_SUBUNIT, $ENABLE_SUBUNIT, [Subunit protocol result output])
114 AM_CONDITIONAL(SUBUNIT, test x"$enable_subunit" != "xfalse")