blob: af2cbe4c05ee6156d4bb262304b6985b7f28b322 [file] [log] [blame]
yaberauneya5ac23b12009-10-25 10:33:31 +00001AC_PREREQ(2.61)
2AC_INIT([realtime],[realtime-20090930],[ltp-results@lists.sourceforge.net])
3AC_CONFIG_AUX_DIR([.])
4AM_INIT_AUTOMAKE
5AC_CONFIG_HEADERS([include/realtime_config.h])
6AC_CONFIG_FILES([ \
7 m4/Makefile \
8])
9AC_CHECK_HEADERS_ONCE([ \
10 pthread.h \
11])
12AM_CONDITIONAL(CROSS_COMPILATION, test x$cross_compiling = xyes)
13
14AC_CANONICAL_HOST
15
16AC_PROG_CC
17# <= autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it. Not sure about
18# 2.62.
19AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
20AC_PROG_AR
21AC_PROG_RANLIB
22
Garrett Cooper88f99672010-11-16 19:32:20 -080023AC_MSG_CHECKING([for __sync_add_and_fetch gcc builtin function])
Garrett Cooper6b9a2422010-11-16 21:53:29 -080024AC_LINK_IFELSE([AC_LANG_SOURCE([
Garrett Cooper7c90af22010-11-11 01:14:37 -080025#ifndef _GNU_SOURCE
26#define _GNU_SOURCE
27#endif
Garrett Cooper08b93fd2010-11-16 08:58:55 -080028#include <stdlib.h>
29int main(void) {
Garrett Cooper7c90af22010-11-11 01:14:37 -080030 char *c;
31 return __sync_add_and_fetch(c, 1);
Garrett Cooper6b9a2422010-11-16 21:53:29 -080032}])],[has___sync_add_and_fetch=yes])
Garrett Cooper7c90af22010-11-11 01:14:37 -080033if test "x$has___sync_add_and_fetch" = xyes; then
34 AC_DEFINE(HAVE___SYNC_ADD_AND_FETCH,1,[Define to 1 if you have the __sync_add_and_fetch gcc builtin function])
35 AC_MSG_RESULT(yes)
36else
37 AC_MSG_RESULT(no)
38fi
39
yaberauneya5ac23b12009-10-25 10:33:31 +000040REALTIME_CHECK_PRIO_INHERIT
Garrett Cooper84ab8202010-11-09 02:00:43 -080041
42if test "x$has_priority_inherit" = xyes; then
43
Garrett Cooper88f99672010-11-16 19:32:20 -080044 AC_MSG_CHECKING([for pthread mutex attr protocol functions])
Garrett Cooper84ab8202010-11-09 02:00:43 -080045 AC_TRY_COMPILE([
46#ifndef _GNU_SOURCE
47#define _GNU_SOURCE
48#endif
49#include <pthread.h>],[int main(void) {
50 pthread_mutexattr_t attr;
51 (void) pthread_mutexattr_getprotocol(&attr, (void*) NULL);
52 (void) pthread_mutexattr_setprotocol(&attr, 0);
53 return 0;
54}],[has_pthread_mutexattr_protocol_functions="yes"])
55fi
56if test "x$has_pthread_mutexattr_protocol_functions" = "xyes" ; then
57 AC_DEFINE(HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS,1,[Define to 1 if you have the pthread_mutexattr protocol APIs])
58 AC_MSG_RESULT(yes)
59else
60 AC_MSG_RESULT(no)
61fi
yaberauneya5ac23b12009-10-25 10:33:31 +000062REALTIME_CHECK_ROBUST_APIS
63
Cyril Hrubis0ec088f2014-07-15 11:24:25 +020064LTP_CHECK_EXP10
65
yaberauneya5ac23b12009-10-25 10:33:31 +000066AC_OUTPUT