source: rtems/cpukit/configure.ac @ 25bec29

4.104.115
Last change on this file since 25bec29 was 25bec29, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/14/09 at 12:32:00

Remove unix-CPU_CONTEXT size checking.

  • 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_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([-fasm])
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
60# Newlib's unix/ directory
61AC_CHECK_FUNCS([ttyname getcwd])
62# </FIXME>
63
64## Check if the installed toolchain has these headers
65AC_CHECK_HEADERS([tar.h errno.h])
66
67## error out if libc doesn't provide stdint.h
68AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
69[AC_MSG_ERROR([Required header stdint.h not found])])
70
71## error out if libc doesn't provide inttypes.h
72AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
73[AC_MSG_ERROR([Required header inttypes.h not found])])
74
75## error out if libc doesn't provide errno.h
76AS_IF([test x"${ac_cv_header_errno_h}" != xyes],
77[AC_MSG_ERROR([Required header errno.h not found])])
78
79AC_HEADER_STDBOOL
80AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
81[AC_MSG_ERROR([No sufficient stdbool.h found])])
82
83AC_CHECK_TYPES([ uint8_t,  int8_t])
84AC_CHECK_TYPES([uint16_t, int16_t])
85AC_CHECK_TYPES([uint32_t, int32_t])
86AC_CHECK_TYPES([uint64_t, int64_t])
87AC_CHECK_TYPES([uintmax_t, intmax_t])
88AC_CHECK_TYPES([uintptr_t, intptr_t])
89
90AC_CACHE_CHECK([if PRIxPTR works],
91[rtems_cv_PRIxPTR],[
92  AS_IF([test x"$GCC" = xyes],[
93    save_CFLAGS=$CFLAGS
94    CFLAGS=-Werror])
95
96  AC_COMPILE_IFELSE([
97    AC_LANG_PROGRAM([
98      #include <inttypes.h>
99      #include <stdio.h>
100    ],[
101      void *ptr;
102      printf("%" PRIxPTR "\n", (intptr_t) ptr);
103    ])],
104    [rtems_cv_PRIxPTR=yes],
105    [rtems_cv_PRIxPTR=no])
106
107  AS_IF([test x"$GCC" = xyes],[
108    CFLAGS=$save_CFLAGS])
109])
110
111# These are conditionally defined by the toolchain
112# FIXME: we should either conditionally compile those parts in
113# RTEMS depending on them, or abort - For now, simply check.
114AC_CHECK_HEADER([pthread.h],[
115  AC_CHECK_TYPES([pthread_rwlock_t])
116  AC_CHECK_TYPES([pthread_barrier_t])
117  AC_CHECK_TYPES([pthread_spinlock_t])
118])
119
120RTEMS_CHECK_MULTIPROCESSING
121RTEMS_CHECK_POSIX_API
122RTEMS_CHECK_ITRON_API
123RTEMS_CHECK_NETWORKING
124
125AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
126[RTEMS_USES_TAR_H=yes],
127[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
128
129rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
130rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
131rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
132
133_RTEMS_CPUOPT_INIT
134
135RTEMS_CPUOPT([RTEMS_DEBUG],
136  [test x"${enable_rtems_debug}" = x"yes"],
137  [1],
138  [if RTEMS_DEBUG is enabled])
139
140RTEMS_CPUOPT([RTEMS_ITRON_API],
141  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
142  [1],
143  [if itron api is supported])
144
145RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
146  [test x"$enable_multiprocessing" = xyes],
147  [1],
148  [if multiprocessing is enabled])
149
150RTEMS_CPUOPT([RTEMS_NEWLIB],
151  [test x"$RTEMS_USE_NEWLIB" = xyes],
152  [1],
153  [if using newlib])
154
155RTEMS_CPUOPT([RTEMS_POSIX_API],
156  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
157  [1],
158  [if posix api is supported])
159
160RTEMS_CPUOPT([RTEMS_NETWORKING],
161  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
162  [1],
163  [if networking is enabled])
164
165RTEMS_CPUOPT([RTEMS_UNIX],
166  [test x"$RTEMS_CPU" = xunix],
167  [1],
168  [to indicate RTEMS unix])
169
170RTEMS_CPUOPT([RTEMS_UNIXLIB],
171  [test x"${enable_unixlib}" = xyes],
172  [1],
173  [to indicate RTEMS using RTEMS's unixlib])
174
175RTEMS_CPUOPT([RTEMS_USES_TAR_H],
176  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
177  [1],
178  [if RTEMS uses tar.h])
179
180RTEMS_CPUOPT([RTEMS_VERSION],
181  [true],
182  ["]_RTEMS_VERSION["],
183  [RTEMS version string])
184
185RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
186  [test x"$RTEMS_CPU" = x"unix"],
187  [$ac_cv_sizeof_CPU_CONTEXT],
188  [The size of a 'CPU_CONTEXT', as computed by sizeof])
189
190RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
191  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
192  [1],
193  [disable nanosecond granularity for cpu usage statistics])
194
195RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
196  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
197  [1],
198  [disable nanosecond granularity for period statistics])
199
200## This improves both the size and coverage analysis.
201RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
202  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
203  [1],
204  [disable inlining _Thread_Enable_dispatch])
205
206## This improves both the size and coverage analysis.
207RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
208  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
209  [1],
210  [disable inlining _Thread_Enable_dispatch])
211
212## This improves both the size and coverage analysis.
213RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
214  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
215  [1],
216  [disable inlining _Thread_queue_Enqueue_priority])
217
218## This gives the same behavior as 4.8 and older
219RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
220  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
221  [1],
222  [disable strict order mutex])
223
224## Deactivate ada bindings
225RTEMS_CPUOPT([__RTEMS_ADA__],
226  [test x"${enable_ada}" = x"yes"],
227  [1],
228  [Define to 1 if ada/gnat bindings are built-in])
229
230RTEMS_CPUOPT([__RTEMS_MAJOR__],
231  [true],
232  [$rtems_major],
233  [major version portion of an RTEMS release])
234
235RTEMS_CPUOPT([__RTEMS_MINOR__],
236  [true],
237  [$rtems_minor],
238  [minor version portion of an RTEMS release])
239
240RTEMS_CPUOPT([__RTEMS_REVISION__],
241  [true],
242  [$rtems_revision],
243  [revision version portion of an RTEMS release])
244
245_RTEMS_CPUOPT_FINI
246
247AC_ENABLE_MULTILIB([Makefile],[..])
248
249# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
250AC_MSG_CHECKING([for assignable stdio])
251AC_COMPILE_IFELSE(
252  [AC_LANG_PROGRAM(
253    [#include <stdio.h>],
254    [stdin = fopen("/tmp", "r")])],
255  [HAVE_ASSIGNABLE_STDIO=yes],
256  [HAVE_ASSIGNABLE_STDIO=no])
257AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
258
259# libmisc/serdbg exploits weak symbols
260RTEMS_CHECK_GCC_WEAK
261
262AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
263AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
264
265# FIXME: These checks are only in here to provide
266# configuration-time diagnostics and are not really used.
267AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
268AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
269
270## BSD-ism, excluded from POSIX, but available on most platforms
271AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
272
273## Check if libc provides BSD's strlcpy/strlcat
274AC_CHECK_FUNCS(strlcpy strlcat)
275
276
277# ... far too many conditionals ...
278AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
279AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
280AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
281
282AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
283
284AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
285AM_CONDITIONAL(LIBPOSIX,test x"${RTEMS_CPU}" != x"unix")
286AM_CONDITIONAL(LIBITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
287AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
288
289AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
290AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
291
292AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes" \
293&& test x"${RTEMS_CPU}" != x"unix"])
294AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
295AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
296&& test x"$enable_ada" = x"yes"])
297
298AM_CONDITIONAL([LIBDOSFS],[dnl
299test x"${RTEMS_CPU}" != x"unix" \
300&& test x"$ac_cv_type_uint8_t" = xyes \
301&& test x"$ac_cv_type_uint16_t" = xyes])
302
303AC_CONFIG_HEADER(config.h)
304
305## These are needed by the NFS Client
306AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
307AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
308&& test -n "$AWK" \
309&& test "$enable_rpcgen" = yes])
310
311RTEMS_AMPOLISH3
312
313# Explicitly list all Makefiles here
314AC_CONFIG_FILES([
315Doxyfile
316Makefile
317rtems/Makefile
318sapi/Makefile
319score/Makefile
320score/cpu/Makefile
321score/cpu/arm/Makefile
322score/cpu/bfin/Makefile
323score/cpu/avr/Makefile
324score/cpu/c4x/Makefile
325score/cpu/h8300/Makefile
326score/cpu/i386/Makefile
327score/cpu/lm32/Makefile
328score/cpu/m68k/Makefile
329score/cpu/m32c/Makefile
330score/cpu/m32r/Makefile
331score/cpu/mips/Makefile
332score/cpu/nios2/Makefile
333score/cpu/powerpc/Makefile
334score/cpu/sh/Makefile
335score/cpu/sparc/Makefile
336score/cpu/no_cpu/Makefile
337posix/Makefile
338itron/Makefile
339libblock/Makefile
340libfs/Makefile
341libfs/src/nfsclient/Makefile
342libgnat/Makefile
343libcsupport/Makefile
344libnetworking/Makefile
345librpc/Makefile
346libmisc/Makefile
347libi2c/Makefile
348libmd/Makefile
349zlib/Makefile
350httpd/Makefile
351ftpd/Makefile
352telnetd/Makefile
353pppd/Makefile
354shttpd/Makefile
355wrapup/Makefile])
356
357AC_CONFIG_COMMANDS([preinstall-stamp],
358[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
359[MAKE=${MAKE}
360with_multisubdir="$with_multisubdir"])
361
362AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.