source: rtems/cpukit/configure.ac @ 363d291

4.104.114.95
Last change on this file since 363d291 was 4c656cb, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/30/08 at 13:36:33

Remove magic to update cpuopt.h.

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