source: rtems/cpukit/configure.ac @ 3d5515b

4.104.115
Last change on this file since 3d5515b was 72e975e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/30/09 at 05:45:51

2009-10-30 Ralf Corsépius <ralf.corsepiu@…>

  • aclocal/gcc-sanity.m4: New.
  • configure.ac: Add RTEMS_CHECK_GCC_SANITY.
  • Property mode set to 100644
File size: 8.9 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
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
90# Some toolchain sanity checks and diagnostics
91RTEMS_CHECK_GCC_SANITY
92
93# These are conditionally defined by the toolchain
94# FIXME: we should either conditionally compile those parts in
95# RTEMS depending on them, or abort - For now, simply check.
96AC_CHECK_HEADER([pthread.h],[
97  AC_CHECK_TYPES([pthread_rwlock_t])
98  AC_CHECK_TYPES([pthread_barrier_t])
99  AC_CHECK_TYPES([pthread_spinlock_t])
100])
101
102RTEMS_CHECK_MULTIPROCESSING
103RTEMS_CHECK_POSIX_API
104RTEMS_CHECK_ITRON_API
105RTEMS_CHECK_NETWORKING
106
107AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
108[RTEMS_USES_TAR_H=yes],
109[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
110
111rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
112rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
113rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
114
115_RTEMS_CPUOPT_INIT
116
117RTEMS_CPUOPT([RTEMS_DEBUG],
118  [test x"${enable_rtems_debug}" = x"yes"],
119  [1],
120  [if RTEMS_DEBUG is enabled])
121
122RTEMS_CPUOPT([RTEMS_ITRON_API],
123  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
124  [1],
125  [if itron api is supported])
126
127RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
128  [test x"$enable_multiprocessing" = xyes],
129  [1],
130  [if multiprocessing is enabled])
131
132RTEMS_CPUOPT([RTEMS_NEWLIB],
133  [test x"$RTEMS_USE_NEWLIB" = xyes],
134  [1],
135  [if using newlib])
136
137RTEMS_CPUOPT([RTEMS_POSIX_API],
138  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
139  [1],
140  [if posix api is supported])
141
142RTEMS_CPUOPT([RTEMS_NETWORKING],
143  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
144  [1],
145  [if networking is enabled])
146
147RTEMS_CPUOPT([RTEMS_USES_TAR_H],
148  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
149  [1],
150  [if RTEMS uses tar.h])
151
152RTEMS_CPUOPT([RTEMS_VERSION],
153  [true],
154  ["]_RTEMS_VERSION["],
155  [RTEMS version string])
156
157RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
158  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
159  [1],
160  [disable nanosecond granularity for cpu usage statistics])
161
162RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
163  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
164  [1],
165  [disable nanosecond granularity for period statistics])
166
167## This improves both the size and coverage analysis.
168RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
169  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
170  [1],
171  [disable inlining _Thread_Enable_dispatch])
172
173## This improves both the size and coverage analysis.
174RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
175  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
176  [1],
177  [disable inlining _Thread_Enable_dispatch])
178
179## This improves both the size and coverage analysis.
180RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
181  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
182  [1],
183  [disable inlining _Thread_queue_Enqueue_priority])
184
185## This gives the same behavior as 4.8 and older
186RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
187  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
188  [1],
189  [disable strict order mutex])
190
191## Deactivate ada bindings
192RTEMS_CPUOPT([__RTEMS_ADA__],
193  [test x"${enable_ada}" = x"yes"],
194  [1],
195  [Define to 1 if ada/gnat bindings are built-in])
196
197RTEMS_CPUOPT([__RTEMS_MAJOR__],
198  [true],
199  [$rtems_major],
200  [major version portion of an RTEMS release])
201
202RTEMS_CPUOPT([__RTEMS_MINOR__],
203  [true],
204  [$rtems_minor],
205  [minor version portion of an RTEMS release])
206
207RTEMS_CPUOPT([__RTEMS_REVISION__],
208  [true],
209  [$rtems_revision],
210  [revision version portion of an RTEMS release])
211
212_RTEMS_CPUOPT_FINI
213
214AC_ENABLE_MULTILIB([Makefile],[..])
215
216# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
217AC_MSG_CHECKING([for assignable stdio])
218AC_COMPILE_IFELSE(
219  [AC_LANG_PROGRAM(
220    [#include <stdio.h>],
221    [stdin = fopen("/tmp", "r")])],
222  [HAVE_ASSIGNABLE_STDIO=yes],
223  [HAVE_ASSIGNABLE_STDIO=no])
224AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
225
226# libmisc/serdbg exploits weak symbols
227RTEMS_CHECK_GCC_WEAK
228
229AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
230AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
231
232# FIXME: These checks are only in here to provide
233# configuration-time diagnostics and are not really used.
234AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
235AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
236
237## BSD-ism, excluded from POSIX, but available on most platforms
238AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
239
240## Check if libc provides BSD's strlcpy/strlcat
241AC_CHECK_FUNCS(strlcpy strlcat)
242
243
244# ... far too many conditionals ...
245AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
246AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
247
248AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
249
250AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
251AM_CONDITIONAL(LIBPOSIX,test x"${RTEMS_CPU}" != x"unix")
252AM_CONDITIONAL(LIBITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
253AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
254
255AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
256AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
257
258AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
259AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
260AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
261&& test x"$enable_ada" = x"yes"])
262
263AM_CONDITIONAL([LIBDOSFS],[dnl
264test x"$ac_cv_type_uint8_t" = xyes \
265&& test x"$ac_cv_type_uint16_t" = xyes])
266
267AC_CONFIG_HEADER(config.h)
268
269## These are needed by the NFS Client
270AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
271AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
272&& test -n "$AWK" \
273&& test "$enable_rpcgen" = yes])
274
275RTEMS_AMPOLISH3
276
277# Explicitly list all Makefiles here
278AC_CONFIG_FILES([
279Doxyfile
280Makefile
281rtems/Makefile
282sapi/Makefile
283score/Makefile
284score/cpu/Makefile
285score/cpu/arm/Makefile
286score/cpu/bfin/Makefile
287score/cpu/avr/Makefile
288score/cpu/c4x/Makefile
289score/cpu/h8300/Makefile
290score/cpu/i386/Makefile
291score/cpu/lm32/Makefile
292score/cpu/m68k/Makefile
293score/cpu/m32c/Makefile
294score/cpu/m32r/Makefile
295score/cpu/mips/Makefile
296score/cpu/nios2/Makefile
297score/cpu/powerpc/Makefile
298score/cpu/sh/Makefile
299score/cpu/sparc/Makefile
300score/cpu/no_cpu/Makefile
301posix/Makefile
302itron/Makefile
303libblock/Makefile
304libfs/Makefile
305libfs/src/nfsclient/Makefile
306libgnat/Makefile
307libcsupport/Makefile
308libnetworking/Makefile
309librpc/Makefile
310libmisc/Makefile
311libi2c/Makefile
312libmd/Makefile
313zlib/Makefile
314httpd/Makefile
315ftpd/Makefile
316telnetd/Makefile
317pppd/Makefile
318shttpd/Makefile
319wrapup/Makefile])
320
321AC_CONFIG_COMMANDS([preinstall-stamp],
322[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
323[MAKE=${MAKE}
324with_multisubdir="$with_multisubdir"])
325
326AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.