source: rtems/cpukit/configure.ac @ 5322d6e

4.104.115
Last change on this file since 5322d6e was 84221cb, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/12/10 at 06:36:35

2010-04-12 Ralf Corsépius <ralf.corsepius@…>

  • configure.ac: Check for sched.h.
  • Property mode set to 100644
File size: 9.7 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.61)
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.10])
13AM_MAINTAINER_MODE
14
15RTEMS_ENABLE_MULTILIB
16RTEMS_ENABLE_MULTIPROCESSING
17RTEMS_ENABLE_POSIX
18RTEMS_ENABLE_ITRON
19RTEMS_ENABLE_RTEMS_DEBUG
20RTEMS_ENABLE_NETWORKING
21
22RTEMS_ENV_RTEMSCPU
23RTEMS_CHECK_RTEMS_DEBUG
24
25# Is this a supported CPU?
26AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
27if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
28  AC_MSG_RESULT(yes)
29else
30  AC_MSG_ERROR(no)
31fi
32
33RTEMS_PROG_CC_FOR_TARGET
34RTEMS_PROG_CCAS
35RTEMS_CANONICALIZE_TOOLS
36AM_PROG_CC_C_O
37AC_PROG_RANLIB
38
39RTEMS_CHECK_NEWLIB
40
41# BSD-isms, used throughout the sources
42# Not really used by this configure script
43# FIXME: They should be eliminated if possible.
44AC_CHECK_FUNCS([strsep strcasecmp snprintf])
45AC_CHECK_FUNCS([strdup strndup strncasecmp])
46AC_CHECK_FUNCS([bcopy bcmp])
47AC_CHECK_FUNCS([isascii fileno])
48
49# <FIXME>
50#   Check for functions supplied by newlib >= 1.17.0
51# Newlib's posix/ directory
52AC_CHECK_FUNCS([sleep usleep \
53  opendir closedir readdir readdir_r \
54  rewinddir scandir seekdir telldir isatty])
55AC_CHECK_FUNCS([creat])
56AC_CHECK_FUNCS([__assert])
57AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
58AC_CHECK_FUNCS([regcomp regexec regerror regfree])
59# Mandated by POSIX but not present in newlib
60AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>])
61AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>])
62AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>])
63
64# Newlib's unix/ directory
65AC_CHECK_FUNCS([ttyname getcwd])
66# </FIXME>
67
68## Check if the installed toolchain has these headers
69AC_CHECK_HEADERS([tar.h errno.h sched.h])
70
71## error out if libc doesn't provide stdint.h
72AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
73[AC_MSG_ERROR([Required header stdint.h not found])])
74
75## error out if libc doesn't provide inttypes.h
76AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
77[AC_MSG_ERROR([Required header inttypes.h not found])])
78
79## error out if libc doesn't provide errno.h
80AS_IF([test x"${ac_cv_header_errno_h}" != xyes],
81[AC_MSG_ERROR([Required header errno.h not found])])
82
83## error out if libc doesn't provide sched.h
84AS_IF([test x"${ac_cv_header_sched_h}" != xyes],
85[AC_MSG_ERROR([Required header sched.h not found])])
86
87AC_HEADER_STDBOOL
88AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
89[AC_MSG_ERROR([No sufficient stdbool.h found])])
90
91AC_CHECK_TYPES([ uint8_t,  int8_t])
92AC_CHECK_TYPES([uint16_t, int16_t])
93AC_CHECK_TYPES([uint32_t, int32_t])
94AC_CHECK_TYPES([uint64_t, int64_t])
95AC_CHECK_TYPES([uintmax_t, intmax_t])
96AC_CHECK_TYPES([uintptr_t, intptr_t])
97
98# Some toolchain sanity checks and diagnostics
99RTEMS_CHECK_GCC_SANITY
100
101# These are conditionally defined by the toolchain
102# FIXME: we should either conditionally compile those parts in
103# RTEMS depending on them, or abort - For now, simply check.
104AC_CHECK_HEADER([pthread.h],[
105  AC_CHECK_TYPES([pthread_rwlock_t])
106  AC_CHECK_TYPES([pthread_barrier_t])
107  AC_CHECK_TYPES([pthread_spinlock_t])
108])
109
110RTEMS_CHECK_MULTIPROCESSING
111RTEMS_CHECK_POSIX_API
112RTEMS_CHECK_ITRON_API
113RTEMS_CHECK_NETWORKING
114
115AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
116[RTEMS_USES_TAR_H=yes],
117[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
118
119rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
120rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
121rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
122
123_RTEMS_CPUOPT_INIT
124
125RTEMS_CPUOPT([RTEMS_DEBUG],
126  [test x"${enable_rtems_debug}" = x"yes"],
127  [1],
128  [if RTEMS_DEBUG is enabled])
129
130RTEMS_CPUOPT([RTEMS_ITRON_API],
131  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
132  [1],
133  [if itron api is supported])
134
135RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
136  [test x"$enable_multiprocessing" = xyes],
137  [1],
138  [if multiprocessing is enabled])
139
140RTEMS_CPUOPT([RTEMS_NEWLIB],
141  [test x"$RTEMS_USE_NEWLIB" = xyes],
142  [1],
143  [if using newlib])
144
145RTEMS_CPUOPT([RTEMS_POSIX_API],
146  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
147  [1],
148  [if posix api is supported])
149
150RTEMS_CPUOPT([RTEMS_NETWORKING],
151  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
152  [1],
153  [if networking is enabled])
154
155RTEMS_CPUOPT([RTEMS_USES_TAR_H],
156  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
157  [1],
158  [if RTEMS uses tar.h])
159
160RTEMS_CPUOPT([RTEMS_VERSION],
161  [true],
162  ["]_RTEMS_VERSION["],
163  [RTEMS version string])
164
165RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
166  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
167  [1],
168  [disable nanosecond granularity for statistics])
169
170RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
171  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
172  [1],
173  [disable nanosecond granularity for cpu usage statistics])
174
175RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
176  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
177  [1],
178  [disable nanosecond granularity for period statistics])
179
180## This improves both the size and coverage analysis.
181RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
182  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
183  [1],
184  [disable inlining _Thread_Enable_dispatch])
185
186## This improves both the size and coverage analysis.
187RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
188  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
189  [1],
190  [disable inlining _Thread_Enable_dispatch])
191
192## This improves both the size and coverage analysis.
193RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
194  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
195  [1],
196  [disable inlining _Thread_queue_Enqueue_priority])
197
198## This gives the same behavior as 4.8 and older
199RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
200  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
201  [1],
202  [disable strict order mutex])
203
204## Deactivate ada bindings
205RTEMS_CPUOPT([__RTEMS_ADA__],
206  [test x"${enable_ada}" = x"yes"],
207  [1],
208  [Define to 1 if ada/gnat bindings are built-in])
209
210RTEMS_CPUOPT([__RTEMS_MAJOR__],
211  [true],
212  [$rtems_major],
213  [major version portion of an RTEMS release])
214
215RTEMS_CPUOPT([__RTEMS_MINOR__],
216  [true],
217  [$rtems_minor],
218  [minor version portion of an RTEMS release])
219
220RTEMS_CPUOPT([__RTEMS_REVISION__],
221  [true],
222  [$rtems_revision],
223  [revision version portion of an RTEMS release])
224
225_RTEMS_CPUOPT_FINI
226
227AC_ENABLE_MULTILIB([Makefile],[..])
228
229# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
230AC_MSG_CHECKING([for assignable stdio])
231AC_COMPILE_IFELSE(
232  [AC_LANG_PROGRAM(
233    [#include <stdio.h>],
234    [stdin = fopen("/tmp", "r")])],
235  [HAVE_ASSIGNABLE_STDIO=yes],
236  [HAVE_ASSIGNABLE_STDIO=no])
237AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
238
239# libmisc/serdbg exploits weak symbols
240RTEMS_CHECK_GCC_WEAK
241
242AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
243AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
244
245# FIXME: These checks are only in here to provide
246# configuration-time diagnostics and are not really used.
247AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
248AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
249# FIXME: Mandatory in SUSv4, optional in SUSv3.
250#   Not implemented in GCC/newlib, so far.
251AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
252AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
253
254## BSD-ism, excluded from POSIX, but available on most platforms
255AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
256
257## Check if libc provides BSD's strlcpy/strlcat
258AC_CHECK_FUNCS(strlcpy strlcat)
259
260
261# ... far too many conditionals ...
262AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
263AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
264
265AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
266
267AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
268AM_CONDITIONAL(LIBITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
269AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
270
271AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
272AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
273
274AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
275AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
276AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
277&& test x"$enable_ada" = x"yes"])
278
279AM_CONDITIONAL([LIBDOSFS],[dnl
280test x"$ac_cv_type_uint8_t" = xyes \
281&& test x"$ac_cv_type_uint16_t" = xyes])
282
283AC_CONFIG_HEADER(config.h)
284
285## These are needed by the NFS Client
286AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
287AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
288&& test -n "$AWK" \
289&& test "$enable_rpcgen" = yes])
290
291RTEMS_AMPOLISH3
292
293# Explicitly list all Makefiles here
294AC_CONFIG_FILES([
295Doxyfile
296Makefile
297rtems/Makefile
298sapi/Makefile
299score/Makefile
300score/cpu/Makefile
301score/cpu/arm/Makefile
302score/cpu/bfin/Makefile
303score/cpu/avr/Makefile
304score/cpu/c4x/Makefile
305score/cpu/h8300/Makefile
306score/cpu/i386/Makefile
307score/cpu/lm32/Makefile
308score/cpu/m68k/Makefile
309score/cpu/m32c/Makefile
310score/cpu/m32r/Makefile
311score/cpu/mips/Makefile
312score/cpu/nios2/Makefile
313score/cpu/powerpc/Makefile
314score/cpu/sh/Makefile
315score/cpu/sparc/Makefile
316score/cpu/no_cpu/Makefile
317posix/Makefile
318itron/Makefile
319libblock/Makefile
320libfs/Makefile
321libfs/src/nfsclient/Makefile
322libgnat/Makefile
323libcsupport/Makefile
324libnetworking/Makefile
325librpc/Makefile
326libmisc/Makefile
327libi2c/Makefile
328libmd/Makefile
329zlib/Makefile
330httpd/Makefile
331ftpd/Makefile
332telnetd/Makefile
333pppd/Makefile
334shttpd/Makefile
335mghttpd/Makefile
336wrapup/Makefile])
337
338AC_CONFIG_COMMANDS([preinstall-stamp],
339[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
340[MAKE=${MAKE}
341with_multisubdir="$with_multisubdir"])
342
343AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.