source: rtems/cpukit/configure.ac @ c050143

4.115
Last change on this file since c050143 was c050143, checked in by Petr Benes <petben@…>, on 04/16/12 at 03:06:34

PR1908: QoS library for CBS scheduler

Since the CBS scheduler is inspired by AQuoSA project for Linux, additional API
(qreslib) compliant with Linux has been created.

Sptest for qreslib included.

  • Property mode set to 100644
File size: 12.0 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ([2.68])
6AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
7AC_CONFIG_SRCDIR([score])
8RTEMS_TOP([..],[])
9
10RTEMS_CANONICAL_TARGET_CPU
11
12AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.11.1])
13AM_MAINTAINER_MODE
14
15RTEMS_ENABLE_MULTILIB
16RTEMS_ENABLE_MULTIPROCESSING
17RTEMS_ENABLE_POSIX
18RTEMS_ENABLE_RTEMS_DEBUG
19RTEMS_ENABLE_NETWORKING
20
21RTEMS_ENV_RTEMSCPU
22RTEMS_CHECK_RTEMS_DEBUG
23
24# Is this a supported CPU?
25AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
26if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
27  AC_MSG_RESULT(yes)
28else
29  AC_MSG_ERROR(no)
30fi
31
32RTEMS_PROG_CC_FOR_TARGET
33RTEMS_PROG_CCAS
34RTEMS_CANONICALIZE_TOOLS
35AM_PROG_CC_C_O
36AC_PROG_RANLIB
37
38RTEMS_CHECK_NEWLIB
39
40# BSD-isms, used throughout the sources
41# Not really used by this configure script
42# FIXME: They should be eliminated if possible.
43AC_CHECK_FUNCS([strsep strcasecmp snprintf])
44AC_CHECK_FUNCS([strdup strndup strncasecmp])
45AC_CHECK_FUNCS([bcopy bcmp])
46AC_CHECK_FUNCS([isascii fileno])
47
48# <FIXME>
49#   Check for functions supplied by newlib >= 1.17.0
50# Newlib's posix/ directory
51AC_CHECK_FUNCS([readdir_r isatty])
52AC_CHECK_FUNCS([creat \
53  opendir closedir readdir rewinddir scandir seekdir \
54  sleep \
55  telldir \
56  usleep],,
57  [rtems_missing_func="$ac_func";break])
58AS_IF([test -n "$rtems_missing_func"],
59  AC_MSG_ERROR([Missing function $rtems_missing_func in libc])])
60AC_CHECK_FUNCS([__assert])
61AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
62AC_CHECK_FUNCS([regcomp regexec regerror regfree])
63
64# Mandated by POSIX, decls not present in some versions of newlib
65AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>])
66AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>])
67AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>])
68
69# Newlib proprietary
70AC_CHECK_HEADERS([envlock.h])
71AC_CHECK_DECLS([__env_lock],,,[#include <envlock.h>])
72AC_CHECK_DECLS([__env_unlock],,,[#include <envlock.h>])
73
74# Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME
75AC_CHECK_DECL([CLOCK_PROCESS_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_PROCESS_CPUTIME_ID])],[#include <time.h>])
76AC_CHECK_DECL([CLOCK_THREAD_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_THREAD_CPUTIME_ID])],[#include <time.h>])
77
78# Mandated by POSIX, decls not present in some versions of newlib,
79# some versions stubbed in newlib's rtems crt0
80RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>])
81RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>])
82RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>])
83RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>])
84RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>])
85RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>])
86RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>])
87RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>])
88RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>])
89RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>])
90RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>])
91RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>])
92RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>])
93RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>])
94
95# pthread-functions not declared in some versions of newlib.
96RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
97RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
98RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
99RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
100
101# Mandated by POSIX, not declared in some versions of newlib.
102AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
103
104# Newlib's unix/ directory
105AC_CHECK_FUNCS([ttyname getcwd])
106# </FIXME>
107
108# Check if the installed toolchain provides these headers
109# and error out if not.
110AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
111  [rtems_missing_header="$ac_header";break])
112AS_IF([test -n "$rtems_missing_header"],
113  AC_MSG_ERROR([Missing required header $rtems_missing_header])])
114
115## error out if libc doesn't provide stdint.h
116AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
117[AC_MSG_ERROR([Required header stdint.h not found])])
118
119## error out if libc doesn't provide inttypes.h
120AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
121[AC_MSG_ERROR([Required header inttypes.h not found])])
122
123AC_HEADER_STDBOOL
124AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
125[AC_MSG_ERROR([No sufficient stdbool.h found])])
126
127AC_CHECK_TYPES([ uint8_t,  int8_t])
128AC_CHECK_TYPES([uint16_t, int16_t])
129AC_CHECK_TYPES([uint32_t, int32_t])
130AC_CHECK_TYPES([uint64_t, int64_t])
131AC_CHECK_TYPES([uintmax_t, intmax_t])
132AC_CHECK_TYPES([uintptr_t, intptr_t])
133
134# Some toolchain sanity checks and diagnostics
135RTEMS_CHECK_GCC_SANITY
136
137# These are conditionally defined by the toolchain
138# FIXME: we should either conditionally compile those parts in
139# RTEMS depending on them, or abort - For now, simply check.
140AC_CHECK_HEADER([pthread.h],[
141  AC_CHECK_TYPES([pthread_rwlock_t])
142  AC_CHECK_TYPES([pthread_barrier_t])
143  AC_CHECK_TYPES([pthread_spinlock_t])
144])
145
146AC_CHECK_HEADER([signal.h],[
147  AC_CHECK_TYPES([sighandler_t])
148])
149
150RTEMS_CHECK_MULTIPROCESSING
151RTEMS_CHECK_POSIX_API
152RTEMS_CHECK_NETWORKING
153RTEMS_CHECK_SMP
154
155rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
156rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
157rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
158
159## This is needed to generate the field offsets of the per CPU
160## data structure so they can be accessed from assembly code.
161AC_CHECK_SIZEOF([void *])
162
163_RTEMS_CPUOPT_INIT
164
165RTEMS_CPUOPT([RTEMS_DEBUG],
166  [test x"${enable_rtems_debug}" = x"yes"],
167  [1],
168  [if RTEMS_DEBUG is enabled])
169
170RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
171  [test x"$enable_multiprocessing" = xyes],
172  [1],
173  [if multiprocessing is enabled])
174
175RTEMS_CPUOPT([RTEMS_NEWLIB],
176  [test x"$RTEMS_USE_NEWLIB" = xyes],
177  [1],
178  [if using newlib])
179
180RTEMS_CPUOPT([RTEMS_POSIX_API],
181  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
182  [1],
183  [if posix api is supported])
184
185RTEMS_CPUOPT([RTEMS_SMP],
186  [test x"$RTEMS_HAS_SMP" = xyes],
187  [1],
188  [if SMP is enabled])
189
190RTEMS_CPUOPT([RTEMS_NETWORKING],
191  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
192  [1],
193  [if networking is enabled])
194
195RTEMS_CPUOPT([RTEMS_VERSION],
196  [true],
197  ["]_RTEMS_VERSION["],
198  [RTEMS version string])
199
200RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
201  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
202  [1],
203  [disable nanosecond granularity for statistics])
204
205RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
206  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
207  [1],
208  [disable nanosecond granularity for cpu usage statistics])
209
210RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
211  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
212  [1],
213  [disable nanosecond granularity for period statistics])
214
215## This improves both the size and coverage analysis.
216RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
217  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
218  [1],
219  [disable inlining _Thread_Enable_dispatch])
220
221## This improves both the size and coverage analysis.
222RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
223  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
224  [1],
225  [disable inlining _Thread_Enable_dispatch])
226
227## This improves both the size and coverage analysis.
228RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
229  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
230  [1],
231  [disable inlining _Thread_queue_Enqueue_priority])
232
233## This gives the same behavior as 4.8 and older
234RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
235  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
236  [1],
237  [disable strict order mutex])
238
239## Deactivate ada bindings
240RTEMS_CPUOPT([__RTEMS_ADA__],
241  [test x"${enable_ada}" = x"yes"],
242  [1],
243  [Define to 1 if ada/gnat bindings are built-in])
244
245## Then we propagate a private copy of the value into cpuopts.h
246## so it is always available to the RTEMS header files.
247
248RTEMS_CPUOPT([__RTEMS_SIZEOF_VOID_P__],
249  [true],
250  [$ac_cv_sizeof_void_p],
251  [Size of a void * pointer])
252
253RTEMS_CPUOPT([__RTEMS_MAJOR__],
254  [true],
255  [$rtems_major],
256  [major version portion of an RTEMS release])
257
258RTEMS_CPUOPT([__RTEMS_MINOR__],
259  [true],
260  [$rtems_minor],
261  [minor version portion of an RTEMS release])
262
263RTEMS_CPUOPT([__RTEMS_REVISION__],
264  [true],
265  [$rtems_revision],
266  [revision version portion of an RTEMS release])
267
268_RTEMS_CPUOPT_FINI
269
270AC_ENABLE_MULTILIB([Makefile],[..])
271
272# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
273AC_MSG_CHECKING([for assignable stdio])
274AC_COMPILE_IFELSE(
275  [AC_LANG_PROGRAM(
276    [#include <stdio.h>],
277    [stdin = fopen("/tmp", "r")])],
278  [HAVE_ASSIGNABLE_STDIO=yes],
279  [HAVE_ASSIGNABLE_STDIO=no])
280AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
281
282# libmisc/serdbg exploits weak symbols
283RTEMS_CHECK_GCC_WEAK
284
285# FIXME: These checks are only in here to provide
286# configuration-time diagnostics and are not really used.
287AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
288AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
289
290# FIXME: We should get rid of this.
291# So far, only used in libfs/src/nfsclient/src/dirutils.c
292AC_CHECK_SIZEOF([mode_t])
293AC_CHECK_SIZEOF([off_t])
294
295# FIXME: We should get rid of this. It's a cludge.
296AC_CHECK_SIZEOF([time_t])
297
298# FIXME: Mandatory in SUSv4, optional in SUSv3.
299#   Not implemented in GCC/newlib, so far.
300AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
301AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
302
303## BSD-ism, excluded from POSIX, but available on most platforms
304AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
305AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
306
307## Check if libc provides BSD's strlcpy/strlcat
308AC_CHECK_FUNCS(strlcpy strlcat)
309
310## Check if libc provides decl of utime
311## FIXME: utime has been deprecated in SUSv4.
312##        and is likely to be removed in future versions.
313## FIXME (BUG in newlib): SUSv4 saids including <utime.h> should be sufficient.
314AC_CHECK_DECLS([utime],,,[#include <sys/types.h>
315#include <utime.h>])
316## Check if libc provides decl of utimes
317AC_CHECK_DECLS([utimes],,,[#include <sys/time.h>])
318
319# ... far too many conditionals ...
320AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
321AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
322
323AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
324AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
325
326AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
327AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
328
329AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
330AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
331AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
332&& test x"$enable_ada" = x"yes"])
333
334AM_CONDITIONAL([LIBDOSFS],[dnl
335test x"$ac_cv_type_uint8_t" = xyes \
336&& test x"$ac_cv_type_uint16_t" = xyes])
337
338AC_CONFIG_HEADER(config.h)
339
340## These are needed by the NFS Client
341AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
342AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
343&& test -n "$AWK" \
344&& test "$enable_rpcgen" = yes])
345
346RTEMS_AMPOLISH3
347
348# Explicitly list all Makefiles here
349AC_CONFIG_FILES([
350Doxyfile
351Makefile
352rtems/Makefile
353sapi/Makefile
354score/Makefile
355score/cpu/Makefile
356score/cpu/arm/Makefile
357score/cpu/bfin/Makefile
358score/cpu/avr/Makefile
359score/cpu/h8300/Makefile
360score/cpu/i386/Makefile
361score/cpu/lm32/Makefile
362score/cpu/m68k/Makefile
363score/cpu/m32c/Makefile
364score/cpu/m32r/Makefile
365score/cpu/mips/Makefile
366score/cpu/nios2/Makefile
367score/cpu/powerpc/Makefile
368score/cpu/sh/Makefile
369score/cpu/sparc/Makefile
370score/cpu/sparc64/Makefile
371score/cpu/no_cpu/Makefile
372posix/Makefile
373libblock/Makefile
374libfs/Makefile
375libfs/src/nfsclient/Makefile
376libgnat/Makefile
377libcsupport/Makefile
378libnetworking/Makefile
379librpc/Makefile
380libmisc/Makefile
381libi2c/Makefile
382libmd/Makefile
383libqos/Makefile
384zlib/Makefile
385ftpd/Makefile
386telnetd/Makefile
387pppd/Makefile
388mghttpd/Makefile
389wrapup/Makefile])
390
391AC_CONFIG_COMMANDS([preinstall-stamp],
392[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
393[MAKE=${MAKE}
394with_multisubdir="$with_multisubdir"])
395
396AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.