source: rtems/cpukit/configure.ac @ ee613aa

4.115
Last change on this file since ee613aa was 06dcaf0, checked in by Joel Sherrill <joel.sherrill@…>, on 03/16/11 at 20:05:06

2011-03-16 Jennifer Averett <jennifer.averett@…>

PR 1729/cpukit

  • configure.ac, sapi/include/confdefs.h, sapi/src/exinit.c, score/Makefile.am, score/preinstall.am, score/cpu/i386/rtems/score/cpu.h, score/cpu/sparc/cpu_asm.S, score/cpu/sparc/rtems/score/cpu.h, score/include/rtems/score/basedefs.h, score/include/rtems/score/context.h, score/include/rtems/score/percpu.h, score/src/percpu.c, score/src/thread.c, score/src/threadcreateidle.c: Add next step in SMP support. This adds an allocated array of the Per_CPU structures to support multiple cpus vs a single instance of the structure which is still used if SMP support is disabled. Configuration support is also added to explicitly enable or disable SMP. But SMP can only be enabled for the CPUs which will support it initially -- SPARC and i386. With the stub BSP support, a BSP can be run as a single core SMP system from an RTEMS data structure standpoint.
  • aclocal/check-smp.m4, aclocal/enable-smp.m4, score/include/rtems/bspsmp.h, score/include/rtems/score/smplock.h, score/src/smp.c, score/src/smplock.c: New files.
  • Property mode set to 100644
File size: 10.8 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# Mandated by POSIX, decls not present in some versions of newlib,
70# some versions stubbed in newlib's rtems crt0
71RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>])
72RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>])
73RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>])
74RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>])
75RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>])
76RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>])
77RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>])
78RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>])
79RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>])
80RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>])
81RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>])
82RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>])
83RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>])
84RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>])
85
86# pthread-functions not declared in some versions of newlib.
87RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
88RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
89RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
90RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
91
92# Newlib's unix/ directory
93AC_CHECK_FUNCS([ttyname getcwd])
94# </FIXME>
95
96# Check if the installed toolchain provides these headers
97# and error out if not.
98AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
99  [rtems_missing_header="$ac_header";break])
100AS_IF([test -n "$rtems_missing_header"],
101  AC_MSG_ERROR([Missing required header $rtems_missing_header])])
102
103## error out if libc doesn't provide stdint.h
104AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
105[AC_MSG_ERROR([Required header stdint.h not found])])
106
107## error out if libc doesn't provide inttypes.h
108AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
109[AC_MSG_ERROR([Required header inttypes.h not found])])
110
111AC_HEADER_STDBOOL
112AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
113[AC_MSG_ERROR([No sufficient stdbool.h found])])
114
115AC_CHECK_TYPES([ uint8_t,  int8_t])
116AC_CHECK_TYPES([uint16_t, int16_t])
117AC_CHECK_TYPES([uint32_t, int32_t])
118AC_CHECK_TYPES([uint64_t, int64_t])
119AC_CHECK_TYPES([uintmax_t, intmax_t])
120AC_CHECK_TYPES([uintptr_t, intptr_t])
121
122# Some toolchain sanity checks and diagnostics
123RTEMS_CHECK_GCC_SANITY
124
125# These are conditionally defined by the toolchain
126# FIXME: we should either conditionally compile those parts in
127# RTEMS depending on them, or abort - For now, simply check.
128AC_CHECK_HEADER([pthread.h],[
129  AC_CHECK_TYPES([pthread_rwlock_t])
130  AC_CHECK_TYPES([pthread_barrier_t])
131  AC_CHECK_TYPES([pthread_spinlock_t])
132])
133
134AC_CHECK_HEADER([signal.h],[
135  AC_CHECK_TYPES([sighandler_t])
136])
137
138RTEMS_CHECK_MULTIPROCESSING
139RTEMS_CHECK_POSIX_API
140RTEMS_CHECK_NETWORKING
141RTEMS_CHECK_SMP
142
143rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
144rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
145rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
146
147## This is needed to generate the field offsets of the per CPU
148## data structure so they can be accessed from assembly code.
149AC_CHECK_SIZEOF([void *])
150
151_RTEMS_CPUOPT_INIT
152
153RTEMS_CPUOPT([RTEMS_DEBUG],
154  [test x"${enable_rtems_debug}" = x"yes"],
155  [1],
156  [if RTEMS_DEBUG is enabled])
157
158RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
159  [test x"$enable_multiprocessing" = xyes],
160  [1],
161  [if multiprocessing is enabled])
162
163RTEMS_CPUOPT([RTEMS_NEWLIB],
164  [test x"$RTEMS_USE_NEWLIB" = xyes],
165  [1],
166  [if using newlib])
167
168RTEMS_CPUOPT([RTEMS_POSIX_API],
169  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
170  [1],
171  [if posix api is supported])
172
173RTEMS_CPUOPT([RTEMS_SMP],
174  [test x"$RTEMS_HAS_SMP" = xyes],
175  [1],
176  [if SMP is enabled])
177
178RTEMS_CPUOPT([RTEMS_NETWORKING],
179  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
180  [1],
181  [if networking is enabled])
182
183RTEMS_CPUOPT([RTEMS_VERSION],
184  [true],
185  ["]_RTEMS_VERSION["],
186  [RTEMS version string])
187
188RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
189  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
190  [1],
191  [disable nanosecond granularity for statistics])
192
193RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
194  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
195  [1],
196  [disable nanosecond granularity for cpu usage statistics])
197
198RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
199  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
200  [1],
201  [disable nanosecond granularity for period statistics])
202
203## This improves both the size and coverage analysis.
204RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
205  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
206  [1],
207  [disable inlining _Thread_Enable_dispatch])
208
209## This improves both the size and coverage analysis.
210RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
211  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
212  [1],
213  [disable inlining _Thread_Enable_dispatch])
214
215## This improves both the size and coverage analysis.
216RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
217  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
218  [1],
219  [disable inlining _Thread_queue_Enqueue_priority])
220
221## This gives the same behavior as 4.8 and older
222RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
223  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
224  [1],
225  [disable strict order mutex])
226
227## Deactivate ada bindings
228RTEMS_CPUOPT([__RTEMS_ADA__],
229  [test x"${enable_ada}" = x"yes"],
230  [1],
231  [Define to 1 if ada/gnat bindings are built-in])
232
233## Then we propagate a private copy of the value into cpuopts.h
234## so it is always available to the RTEMS header files.
235
236RTEMS_CPUOPT([__RTEMS_SIZEOF_VOID_P__],
237  [true],
238  [$ac_cv_sizeof_void_p],
239  [Size of a void * pointer])
240
241RTEMS_CPUOPT([__RTEMS_MAJOR__],
242  [true],
243  [$rtems_major],
244  [major version portion of an RTEMS release])
245
246RTEMS_CPUOPT([__RTEMS_MINOR__],
247  [true],
248  [$rtems_minor],
249  [minor version portion of an RTEMS release])
250
251RTEMS_CPUOPT([__RTEMS_REVISION__],
252  [true],
253  [$rtems_revision],
254  [revision version portion of an RTEMS release])
255
256_RTEMS_CPUOPT_FINI
257
258AC_ENABLE_MULTILIB([Makefile],[..])
259
260# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
261AC_MSG_CHECKING([for assignable stdio])
262AC_COMPILE_IFELSE(
263  [AC_LANG_PROGRAM(
264    [#include <stdio.h>],
265    [stdin = fopen("/tmp", "r")])],
266  [HAVE_ASSIGNABLE_STDIO=yes],
267  [HAVE_ASSIGNABLE_STDIO=no])
268AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
269
270# libmisc/serdbg exploits weak symbols
271RTEMS_CHECK_GCC_WEAK
272
273# FIXME: These checks are only in here to provide
274# configuration-time diagnostics and are not really used.
275AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
276AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
277
278# FIXME: We should get rid of this.
279# So far, only used in libfs/src/nfsclient/src/dirutils.c
280AC_CHECK_SIZEOF([mode_t])
281AC_CHECK_SIZEOF([off_t])
282
283# FIXME: Mandatory in SUSv4, optional in SUSv3.
284#   Not implemented in GCC/newlib, so far.
285AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
286AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
287
288## BSD-ism, excluded from POSIX, but available on most platforms
289AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
290
291## Check if libc provides BSD's strlcpy/strlcat
292AC_CHECK_FUNCS(strlcpy strlcat)
293
294# ... far too many conditionals ...
295AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
296AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
297
298AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
299AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
300
301AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
302AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
303
304AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
305AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
306AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
307&& test x"$enable_ada" = x"yes"])
308
309AM_CONDITIONAL([LIBDOSFS],[dnl
310test x"$ac_cv_type_uint8_t" = xyes \
311&& test x"$ac_cv_type_uint16_t" = xyes])
312
313AC_CONFIG_HEADER(config.h)
314
315## These are needed by the NFS Client
316AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
317AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
318&& test -n "$AWK" \
319&& test "$enable_rpcgen" = yes])
320
321RTEMS_AMPOLISH3
322
323# Explicitly list all Makefiles here
324AC_CONFIG_FILES([
325Doxyfile
326Makefile
327rtems/Makefile
328sapi/Makefile
329score/Makefile
330score/cpu/Makefile
331score/cpu/arm/Makefile
332score/cpu/bfin/Makefile
333score/cpu/avr/Makefile
334score/cpu/h8300/Makefile
335score/cpu/i386/Makefile
336score/cpu/lm32/Makefile
337score/cpu/m68k/Makefile
338score/cpu/m32c/Makefile
339score/cpu/m32r/Makefile
340score/cpu/mips/Makefile
341score/cpu/nios2/Makefile
342score/cpu/powerpc/Makefile
343score/cpu/sh/Makefile
344score/cpu/sparc/Makefile
345score/cpu/sparc64/Makefile
346score/cpu/no_cpu/Makefile
347posix/Makefile
348libblock/Makefile
349libfs/Makefile
350libfs/src/nfsclient/Makefile
351libgnat/Makefile
352libcsupport/Makefile
353libnetworking/Makefile
354librpc/Makefile
355libmisc/Makefile
356libi2c/Makefile
357libmd/Makefile
358zlib/Makefile
359ftpd/Makefile
360telnetd/Makefile
361pppd/Makefile
362mghttpd/Makefile
363wrapup/Makefile])
364
365AC_CONFIG_COMMANDS([preinstall-stamp],
366[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
367[MAKE=${MAKE}
368with_multisubdir="$with_multisubdir"])
369
370AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.