source: rtems/cpukit/configure.ac @ 04323c98

4.115
Last change on this file since 04323c98 was 263ab4b, checked in by Joel Sherrill <joel.sherrill@…>, on 06/29/10 at 18:51:49

2010-06-29 Joel Sherrill <joel.sherrill@…>

  • configure.ac, score/include/rtems/score/percpu.h: Add RTEMS_SIZEOF_VOID_P to cpuopts.h so percpu.h has this information available during build and after installation.
  • Property mode set to 100644
File size: 9.8 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_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([sleep usleep \
52  opendir closedir readdir readdir_r \
53  rewinddir scandir seekdir telldir isatty])
54AC_CHECK_FUNCS([creat])
55AC_CHECK_FUNCS([__assert])
56AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
57AC_CHECK_FUNCS([regcomp regexec regerror regfree])
58# Mandated by POSIX but not present in newlib
59AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>])
60AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>])
61AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>])
62
63# Newlib's unix/ directory
64AC_CHECK_FUNCS([ttyname getcwd])
65# </FIXME>
66
67## Check if the installed toolchain has these headers
68AC_CHECK_HEADERS([tar.h errno.h sched.h])
69
70## error out if libc doesn't provide stdint.h
71AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
72[AC_MSG_ERROR([Required header stdint.h not found])])
73
74## error out if libc doesn't provide inttypes.h
75AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
76[AC_MSG_ERROR([Required header inttypes.h not found])])
77
78## error out if libc doesn't provide errno.h
79AS_IF([test x"${ac_cv_header_errno_h}" != xyes],
80[AC_MSG_ERROR([Required header errno.h not found])])
81
82## error out if libc doesn't provide sched.h
83AS_IF([test x"${ac_cv_header_sched_h}" != xyes],
84[AC_MSG_ERROR([Required header sched.h not found])])
85
86## error out if libc doesn't provide tar.h
87AS_IF([test x"${ac_cv_header_tar_h}" != xyes],
88[AC_MSG_ERROR([Required header tar.h not found])])
89
90AC_HEADER_STDBOOL
91AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
92[AC_MSG_ERROR([No sufficient stdbool.h found])])
93
94AC_CHECK_TYPES([ uint8_t,  int8_t])
95AC_CHECK_TYPES([uint16_t, int16_t])
96AC_CHECK_TYPES([uint32_t, int32_t])
97AC_CHECK_TYPES([uint64_t, int64_t])
98AC_CHECK_TYPES([uintmax_t, intmax_t])
99AC_CHECK_TYPES([uintptr_t, intptr_t])
100
101# Some toolchain sanity checks and diagnostics
102RTEMS_CHECK_GCC_SANITY
103
104# These are conditionally defined by the toolchain
105# FIXME: we should either conditionally compile those parts in
106# RTEMS depending on them, or abort - For now, simply check.
107AC_CHECK_HEADER([pthread.h],[
108  AC_CHECK_TYPES([pthread_rwlock_t])
109  AC_CHECK_TYPES([pthread_barrier_t])
110  AC_CHECK_TYPES([pthread_spinlock_t])
111])
112
113RTEMS_CHECK_MULTIPROCESSING
114RTEMS_CHECK_POSIX_API
115RTEMS_CHECK_NETWORKING
116
117rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
118rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
119rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
120
121## This is needed to generate the field offsets of the per CPU
122## data structure so they can be accessed from assembly code.
123AC_CHECK_SIZEOF([void *])
124
125_RTEMS_CPUOPT_INIT
126
127RTEMS_CPUOPT([RTEMS_DEBUG],
128  [test x"${enable_rtems_debug}" = x"yes"],
129  [1],
130  [if RTEMS_DEBUG is enabled])
131
132RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
133  [test x"$enable_multiprocessing" = xyes],
134  [1],
135  [if multiprocessing is enabled])
136
137RTEMS_CPUOPT([RTEMS_NEWLIB],
138  [test x"$RTEMS_USE_NEWLIB" = xyes],
139  [1],
140  [if using newlib])
141
142RTEMS_CPUOPT([RTEMS_POSIX_API],
143  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
144  [1],
145  [if posix api is supported])
146
147RTEMS_CPUOPT([RTEMS_NETWORKING],
148  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
149  [1],
150  [if networking is enabled])
151
152RTEMS_CPUOPT([RTEMS_VERSION],
153  [true],
154  ["]_RTEMS_VERSION["],
155  [RTEMS version string])
156
157RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
158  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
159  [1],
160  [disable nanosecond granularity for statistics])
161
162RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
163  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
164  [1],
165  [disable nanosecond granularity for cpu usage statistics])
166
167RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
168  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
169  [1],
170  [disable nanosecond granularity for period statistics])
171
172## This improves both the size and coverage analysis.
173RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
174  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
175  [1],
176  [disable inlining _Thread_Enable_dispatch])
177
178## This improves both the size and coverage analysis.
179RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
180  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
181  [1],
182  [disable inlining _Thread_Enable_dispatch])
183
184## This improves both the size and coverage analysis.
185RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
186  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
187  [1],
188  [disable inlining _Thread_queue_Enqueue_priority])
189
190## This gives the same behavior as 4.8 and older
191RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
192  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
193  [1],
194  [disable strict order mutex])
195
196## Deactivate ada bindings
197RTEMS_CPUOPT([__RTEMS_ADA__],
198  [test x"${enable_ada}" = x"yes"],
199  [1],
200  [Define to 1 if ada/gnat bindings are built-in])
201
202## Then we propagate a private copy of the value into cpuopts.h
203## so it is always available to the RTEMS header files.
204
205RTEMS_CPUOPT([__RTEMS_SIZEOF_VOID_P__],
206  [true],
207  [$ac_cv_sizeof_void_p],
208  [Size of a void * pointer])
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
250# FIXME: We should get rid of this.
251# So far, only used in libfs/src/nfsclient/src/dirutils.c
252AC_CHECK_SIZEOF([mode_t])
253AC_CHECK_SIZEOF([off_t])
254
255# FIXME: Mandatory in SUSv4, optional in SUSv3.
256#   Not implemented in GCC/newlib, so far.
257AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
258AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
259
260## BSD-ism, excluded from POSIX, but available on most platforms
261AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
262
263## Check if libc provides BSD's strlcpy/strlcat
264AC_CHECK_FUNCS(strlcpy strlcat)
265
266# ... far too many conditionals ...
267AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
268AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
269
270AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
271
272AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
273AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
274
275AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
276AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
277
278AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
279AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
280AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
281&& test x"$enable_ada" = x"yes"])
282
283AM_CONDITIONAL([LIBDOSFS],[dnl
284test x"$ac_cv_type_uint8_t" = xyes \
285&& test x"$ac_cv_type_uint16_t" = xyes])
286
287AC_CONFIG_HEADER(config.h)
288
289## These are needed by the NFS Client
290AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
291AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
292&& test -n "$AWK" \
293&& test "$enable_rpcgen" = yes])
294
295RTEMS_AMPOLISH3
296
297# Explicitly list all Makefiles here
298AC_CONFIG_FILES([
299Doxyfile
300Makefile
301rtems/Makefile
302sapi/Makefile
303score/Makefile
304score/cpu/Makefile
305score/cpu/arm/Makefile
306score/cpu/bfin/Makefile
307score/cpu/avr/Makefile
308score/cpu/h8300/Makefile
309score/cpu/i386/Makefile
310score/cpu/lm32/Makefile
311score/cpu/m68k/Makefile
312score/cpu/m32c/Makefile
313score/cpu/m32r/Makefile
314score/cpu/mips/Makefile
315score/cpu/nios2/Makefile
316score/cpu/powerpc/Makefile
317score/cpu/sh/Makefile
318score/cpu/sparc/Makefile
319score/cpu/sparc64/Makefile
320score/cpu/no_cpu/Makefile
321posix/Makefile
322libblock/Makefile
323libfs/Makefile
324libfs/src/nfsclient/Makefile
325libgnat/Makefile
326libcsupport/Makefile
327libnetworking/Makefile
328librpc/Makefile
329libmisc/Makefile
330libi2c/Makefile
331libmd/Makefile
332zlib/Makefile
333ftpd/Makefile
334telnetd/Makefile
335pppd/Makefile
336mghttpd/Makefile
337wrapup/Makefile])
338
339AC_CONFIG_COMMANDS([preinstall-stamp],
340[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
341[MAKE=${MAKE}
342with_multisubdir="$with_multisubdir"])
343
344AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.