source: rtems/cpukit/configure.ac @ 8ffd6be0

4.8
Last change on this file since 8ffd6be0 was dea5bb9, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/05/07 at 09:37:49

Remove score/cpu/avr/Makefile, score/cpu/nios2/Makefile, score/cpu/avr/Makefile.

  • 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
139cat >>cpuopts.tmp <<\_ACEOF
140/**
141 * @file rtems/score/cpuopts.h
142 */
143/* target cpu dependent options file */
144/* automatically generated -- DO NOT EDIT!! */
145#ifndef _RTEMS_SCORE_CPUOPTS_H
146#define _RTEMS_SCORE_CPUOPTS_H
147_ACEOF
148
149RTEMS_CPUOPT([RTEMS_DEBUG],
150  [test x"${enable_rtems_debug}" = x"yes"],
151  [1],
152  [if RTEMS_DEBUG is enabled])
153
154RTEMS_CPUOPT([RTEMS_ITRON_API],
155  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
156  [1],
157  [if itron api is supported])
158
159RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
160  [test x"$enable_multiprocessing" = xyes],
161  [1],
162  [if multiprocessing is enabled])
163
164RTEMS_CPUOPT([RTEMS_NEWLIB],
165  [test x"$RTEMS_USE_NEWLIB" = xyes],
166  [1],
167  [if using newlib])
168
169RTEMS_CPUOPT([RTEMS_POSIX_API],
170  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
171  [1],
172  [if posix api is supported])
173
174RTEMS_CPUOPT([RTEMS_NETWORKING],
175  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
176  [1],
177  [if networking is enabled])
178
179RTEMS_CPUOPT([RTEMS_UNIX],
180  [test x"$RTEMS_CPU" = xunix],
181  [1],
182  [to indicate RTEMS unix])
183
184RTEMS_CPUOPT([RTEMS_UNIXLIB],
185  [test x"${enable_unixlib}" = xyes],
186  [1],
187  [to indicate RTEMS using RTEMS's unixlib])
188
189RTEMS_CPUOPT([RTEMS_USES_STDINT_H],
190  [test x"${RTEMS_USES_STDINT_H}" = x"yes"],
191  [1],
192  [if RTEMS uses stdint.h])
193
194RTEMS_CPUOPT([RTEMS_USES_TAR_H],
195  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
196  [1],
197  [if RTEMS uses tar.h])
198
199RTEMS_CPUOPT([RTEMS_VERSION],
200  [true],
201  ["]_RTEMS_VERSION["],
202  [RTEMS version string])
203
204RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
205  [test x"$RTEMS_CPU" = x"unix"],
206  [$ac_cv_sizeof_CPU_CONTEXT],
207  [The size of a 'CPU_CONTEXT', as computed by sizeof])
208
209RTEMS_CPUOPT([NDEBUG],
210  [test x"${NDEBUG}" = x"1"],
211  [1],
212  [disable asserts]
213)
214
215RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
216  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
217  [1],
218  [disable nanosecond granularity for cpu usage statistics]
219)
220
221RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
222  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
223  [1],
224  [disable nanosecond granularity for period statistics]
225)
226
227RTEMS_CPUOPT([__RTEMS_MAJOR__],
228  [true],
229  [$rtems_major],
230  [major version portion of an RTEMS release])
231
232RTEMS_CPUOPT([__RTEMS_MINOR__],
233  [true],
234  [$rtems_minor],
235  [minor version portion of an RTEMS release])
236
237RTEMS_CPUOPT([__RTEMS_REVISION__],
238  [true],
239  [$rtems_revision],
240  [revision version portion of an RTEMS release])
241
242cat >>cpuopts.tmp <<\_ACEOF
243
244#endif /* _RTEMS_SCORE_CPUOPTS_H */
245_ACEOF
246
247AS_MKDIR_P(score/include/rtems/score)
248AS_IF([test -f score/include/rtems/score/cpuopts.h],
249[
250  AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
251  [
252    AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
253    rm -f cpuopts.tmp
254  ],[
255    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
256    rm -f score/include/rtems/score/cpuopts.h
257    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
258  ])
259],[
260    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
261    rm -f score/include/rtems/score/cpuopts.h
262    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
263])
264
265AC_ENABLE_MULTILIB([Makefile],[..])
266
267# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
268AC_MSG_CHECKING([for assignable stdio])
269AC_COMPILE_IFELSE(
270  [AC_LANG_PROGRAM(
271    [#include <stdio.h>],
272    [stdin = fopen("/tmp", "r")])],
273  [HAVE_ASSIGNABLE_STDIO=yes],
274  [HAVE_ASSIGNABLE_STDIO=no])
275AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
276
277# libmisc/serdbg exploits weak symbols
278RTEMS_CHECK_GCC_WEAK
279
280AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
281AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
282
283# FIXME: These checks are only in here to provide
284# configuration-time diagnostics and are not really used.
285AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
286AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
287
288## BSD-ism, excluded from POSIX, but available on most platforms
289AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
290
291## Check if libc provides BSD's strlcpy/strlcat
292AC_CHECK_FUNCS(strlcpy strlcat)
293
294
295# ... far too many conditionals ...
296AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
297AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
298AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
299
300AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
301
302AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
303AM_CONDITIONAL(LIBPOSIX,test x"${RTEMS_CPU}" != x"unix")
304AM_CONDITIONAL(LIBITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
305AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
306
307AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
308AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
309
310AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
311AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
312
313AM_CONDITIONAL([LIBDOSFS],[dnl
314test x"${RTEMS_CPU}" != x"unix" \
315&& test x"$ac_cv_type_uint8_t" = xyes \
316&& test x"$ac_cv_type_uint16_t" = xyes])
317
318AC_CONFIG_HEADER(config.h)
319
320RTEMS_AMPOLISH3
321
322# Explicitly list all Makefiles here
323AC_CONFIG_FILES([
324Makefile
325rtems/Makefile
326sapi/Makefile
327score/Makefile
328score/cpu/Makefile
329score/cpu/arm/Makefile
330score/cpu/bfin/Makefile
331score/cpu/h8300/Makefile
332score/cpu/i386/Makefile
333score/cpu/m68k/Makefile
334score/cpu/mips/Makefile
335score/cpu/powerpc/Makefile
336score/cpu/sh/Makefile
337score/cpu/sparc/Makefile
338score/cpu/unix/Makefile
339score/cpu/no_cpu/Makefile
340posix/Makefile
341itron/Makefile
342libblock/Makefile
343libfs/Makefile
344libcsupport/Makefile
345libnetworking/Makefile
346librpc/Makefile
347libmisc/Makefile
348libi2c/Makefile
349libmd/Makefile
350zlib/Makefile
351httpd/Makefile
352ftpd/Makefile
353telnetd/Makefile
354pppd/Makefile
355shttpd/Makefile
356wrapup/Makefile])
357
358AC_CONFIG_COMMANDS([preinstall-stamp],
359[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
360[MAKE=${MAKE}
361with_multisubdir="$with_multisubdir"])
362
363AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.