blob: 354954a5388b3869fe96cebfc3d251dce44f2ba9 [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 Cooper7c90af22010-11-11 01:14:37 -080023AC_MSG_CHECKING([Checking for __sync_add_and_fetch gcc builtin function])
24AC_TRY_COMPILE([
25#ifndef _GNU_SOURCE
26#define _GNU_SOURCE
27#endif
28#include <stdlib.h>],[int main(void) {
29 char *c;
30 return __sync_add_and_fetch(c, 1);
31}],[has___sync_add_and_fetch=yes])
32if test "x$has___sync_add_and_fetch" = xyes; then
33 AC_DEFINE(HAVE___SYNC_ADD_AND_FETCH,1,[Define to 1 if you have the __sync_add_and_fetch gcc builtin function])
34 AC_MSG_RESULT(yes)
35else
36 AC_MSG_RESULT(no)
37fi
38
yaberauneya5ac23b12009-10-25 10:33:31 +000039REALTIME_CHECK_PRIO_INHERIT
Garrett Cooper84ab8202010-11-09 02:00:43 -080040
41if test "x$has_priority_inherit" = xyes; then
42
43 AC_MSG_CHECKING([Checking for pthread mutex attr protocol functions])
44 AC_TRY_COMPILE([
45#ifndef _GNU_SOURCE
46#define _GNU_SOURCE
47#endif
48#include <pthread.h>],[int main(void) {
49 pthread_mutexattr_t attr;
50 (void) pthread_mutexattr_getprotocol(&attr, (void*) NULL);
51 (void) pthread_mutexattr_setprotocol(&attr, 0);
52 return 0;
53}],[has_pthread_mutexattr_protocol_functions="yes"])
54fi
55if test "x$has_pthread_mutexattr_protocol_functions" = "xyes" ; then
56 AC_DEFINE(HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS,1,[Define to 1 if you have the pthread_mutexattr protocol APIs])
57 AC_MSG_RESULT(yes)
58else
59 AC_MSG_RESULT(no)
60fi
yaberauneya5ac23b12009-10-25 10:33:31 +000061REALTIME_CHECK_ROBUST_APIS
62
63AC_OUTPUT