source: rtems/cpukit/configure.ac @ fce31ab

4.115
Last change on this file since fce31ab was fce31ab, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/17/10 at 15:29:22

Remove itron.

  • Property mode set to 100644
File size: 9.5 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_RTEMS_CPUOPT_INIT
122
123RTEMS_CPUOPT([RTEMS_DEBUG],
124  [test x"${enable_rtems_debug}" = x"yes"],
125  [1],
126  [if RTEMS_DEBUG is enabled])
127
128RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
129  [test x"$enable_multiprocessing" = xyes],
130  [1],
131  [if multiprocessing is enabled])
132
133RTEMS_CPUOPT([RTEMS_NEWLIB],
134  [test x"$RTEMS_USE_NEWLIB" = xyes],
135  [1],
136  [if using newlib])
137
138RTEMS_CPUOPT([RTEMS_POSIX_API],
139  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
140  [1],
141  [if posix api is supported])
142
143RTEMS_CPUOPT([RTEMS_NETWORKING],
144  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
145  [1],
146  [if networking is enabled])
147
148RTEMS_CPUOPT([RTEMS_VERSION],
149  [true],
150  ["]_RTEMS_VERSION["],
151  [RTEMS version string])
152
153RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
154  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
155  [1],
156  [disable nanosecond granularity for statistics])
157
158RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
159  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
160  [1],
161  [disable nanosecond granularity for cpu usage statistics])
162
163RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
164  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
165  [1],
166  [disable nanosecond granularity for period statistics])
167
168## This improves both the size and coverage analysis.
169RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
170  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
171  [1],
172  [disable inlining _Thread_Enable_dispatch])
173
174## This improves both the size and coverage analysis.
175RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
176  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
177  [1],
178  [disable inlining _Thread_Enable_dispatch])
179
180## This improves both the size and coverage analysis.
181RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
182  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
183  [1],
184  [disable inlining _Thread_queue_Enqueue_priority])
185
186## This gives the same behavior as 4.8 and older
187RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
188  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
189  [1],
190  [disable strict order mutex])
191
192## Deactivate ada bindings
193RTEMS_CPUOPT([__RTEMS_ADA__],
194  [test x"${enable_ada}" = x"yes"],
195  [1],
196  [Define to 1 if ada/gnat bindings are built-in])
197
198RTEMS_CPUOPT([__RTEMS_MAJOR__],
199  [true],
200  [$rtems_major],
201  [major version portion of an RTEMS release])
202
203RTEMS_CPUOPT([__RTEMS_MINOR__],
204  [true],
205  [$rtems_minor],
206  [minor version portion of an RTEMS release])
207
208RTEMS_CPUOPT([__RTEMS_REVISION__],
209  [true],
210  [$rtems_revision],
211  [revision version portion of an RTEMS release])
212
213_RTEMS_CPUOPT_FINI
214
215AC_ENABLE_MULTILIB([Makefile],[..])
216
217# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
218AC_MSG_CHECKING([for assignable stdio])
219AC_COMPILE_IFELSE(
220  [AC_LANG_PROGRAM(
221    [#include <stdio.h>],
222    [stdin = fopen("/tmp", "r")])],
223  [HAVE_ASSIGNABLE_STDIO=yes],
224  [HAVE_ASSIGNABLE_STDIO=no])
225AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
226
227# libmisc/serdbg exploits weak symbols
228RTEMS_CHECK_GCC_WEAK
229
230AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
231AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
232
233# FIXME: These checks are only in here to provide
234# configuration-time diagnostics and are not really used.
235AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
236AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
237
238# FIXME: We should get rid of this.
239# So far, only used in libfs/src/nfsclient/src/dirutils.c
240AC_CHECK_SIZEOF([mode_t])
241AC_CHECK_SIZEOF([off_t])
242
243# FIXME: Mandatory in SUSv4, optional in SUSv3.
244#   Not implemented in GCC/newlib, so far.
245AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
246AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
247
248## BSD-ism, excluded from POSIX, but available on most platforms
249AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
250
251## Check if libc provides BSD's strlcpy/strlcat
252AC_CHECK_FUNCS(strlcpy strlcat)
253
254
255# ... far too many conditionals ...
256AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
257AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
258
259AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
260
261AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
262AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
263
264AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
265AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
266
267AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
268AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
269AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
270&& test x"$enable_ada" = x"yes"])
271
272AM_CONDITIONAL([LIBDOSFS],[dnl
273test x"$ac_cv_type_uint8_t" = xyes \
274&& test x"$ac_cv_type_uint16_t" = xyes])
275
276AC_CONFIG_HEADER(config.h)
277
278## These are needed by the NFS Client
279AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
280AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
281&& test -n "$AWK" \
282&& test "$enable_rpcgen" = yes])
283
284RTEMS_AMPOLISH3
285
286# Explicitly list all Makefiles here
287AC_CONFIG_FILES([
288Doxyfile
289Makefile
290rtems/Makefile
291sapi/Makefile
292score/Makefile
293score/cpu/Makefile
294score/cpu/arm/Makefile
295score/cpu/bfin/Makefile
296score/cpu/avr/Makefile
297score/cpu/h8300/Makefile
298score/cpu/i386/Makefile
299score/cpu/lm32/Makefile
300score/cpu/m68k/Makefile
301score/cpu/m32c/Makefile
302score/cpu/m32r/Makefile
303score/cpu/mips/Makefile
304score/cpu/nios2/Makefile
305score/cpu/powerpc/Makefile
306score/cpu/sh/Makefile
307score/cpu/sparc/Makefile
308score/cpu/sparc64/Makefile
309score/cpu/no_cpu/Makefile
310posix/Makefile
311libblock/Makefile
312libfs/Makefile
313libfs/src/nfsclient/Makefile
314libgnat/Makefile
315libcsupport/Makefile
316libnetworking/Makefile
317librpc/Makefile
318libmisc/Makefile
319libi2c/Makefile
320libmd/Makefile
321zlib/Makefile
322ftpd/Makefile
323telnetd/Makefile
324pppd/Makefile
325mghttpd/Makefile
326wrapup/Makefile])
327
328AC_CONFIG_COMMANDS([preinstall-stamp],
329[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
330[MAKE=${MAKE}
331with_multisubdir="$with_multisubdir"])
332
333AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.