source: rtems/cpukit/configure.ac @ bfe2fd3

4.104.114.84.9
Last change on this file since bfe2fd3 was bfe2fd3, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 15, 2006 at 2:17:57 PM

Remove RTEMS_AMPOLISH3.
Add checks for uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t.

  • Property mode set to 100644
File size: 8.0 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.60)
6AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
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
41RTEMS_CHECK_MULTIPROCESSING
42RTEMS_CHECK_POSIX_API
43RTEMS_CHECK_ITRON_API
44RTEMS_CHECK_NETWORKING
45
46AS_IF([test x"$HAS_NETWORKING" = x"yes"],[
47## FIXME: Should better use a feature-based test
48AC_MSG_CHECKING([whether CPU supports librpc])
49  case "$RTEMS_CPU" in
50  c4x )  LIBRPC=no;;
51  * )    LIBRPC=yes;;
52  esac
53AC_MSG_RESULT([$LIBRPC])
54])
55
56AC_ARG_ENABLE([deprecated],
57[AS_HELP_STRING(--enable-deprecated,allow using deprecated files)],
58[case "${enable_deprecated}" in
59  yes) ;;
60  no) ;;
61  *) enable_deprecated=no ;;
62esac],[enable_deprecated=no])
63AM_CONDITIONAL([DEPRECATED],[test "$enable_deprecated" = "yes"])
64
65AS_IF([ test "$enable_deprecated" = "yes" ],[
66AC_DEFINE_UNQUOTED([RTEMS_DEPRECATED_TYPES],[1],
67  [whether to support deprecated types])
68])
69
70# HACK: We should use a feature-based configuration.
71AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
72# HACK: silently accept --enable-unixlib
73  test -n "${enable_unixlib}" || enable_unixlib="yes"
74])
75
76# BSD-isms, used throughout the sources
77# Not really used by this configure script
78# FIXME: They should be eliminated if possible.
79AC_CHECK_FUNCS([strsep strcasecmp snprintf])
80AC_CHECK_FUNCS([bcopy bcmp])
81AC_CHECK_FUNCS([isascii fileno])
82
83## Check if the installed toolchain has these headers
84AC_CHECK_HEADER([tar.h])
85
86## BSD-ism, should not be used in RTEMS,
87## nevertheless it still is.
88AC_CHECK_HEADER([sys/errno.h],[],
89  [AC_MSG_ERROR([Missing required header sys/errno.h])])
90
91## if libc provides stdint.h, use it.
92AS_IF([test x"${ac_cv_header_stdint_h}" = xyes],
93[RTEMS_USES_STDINT_H=yes],
94[RTEMS_USES_STDINT_H=no])
95
96## error out if libc doesn't at least provide inttypes.h
97AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
98[AC_MSG_ERROR([Required header inttypes.h not found])])
99
100AC_CHECK_TYPES([ uint8_t,  int8_t])
101AC_CHECK_TYPES([uint16_t, int16_t])
102AC_CHECK_TYPES([uint32_t, int32_t])
103
104AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
105[RTEMS_USES_TAR_H=yes],
106[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
107
108AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
109## FIXME: This check is doubtful
110AS_IF([test "$HAS_MP" = "yes"],
111  [RTEMS_CHECK_SYSV_UNIX])
112
113## The code fragment below had been used in tools/cpu/unix/gensize.c.
114## FIXME:
115## * The pad very likely is not necessary.
116AC_CHECK_SIZEOF([CPU_CONTEXT],[],[
117#include <stdio.h>
118#include <setjmp.h>
119
120typedef struct {
121  jmp_buf     regs;
122  int         isr_level;
123  int         pad[4]; /* just in case */
124} CPU_CONTEXT;
125])
126])
127
128cat >>cpuopts.tmp <<\_ACEOF
129/**
130 * @file rtems/score/cpuopts.h
131 */
132/* target cpu dependent options file */
133/* automatically generated -- DO NOT EDIT!! */
134#ifndef _RTEMS_SCORE_CPUOPTS_H
135#define _RTEMS_SCORE_CPUOPTS_H
136_ACEOF
137
138RTEMS_CPUOPT([RTEMS_DEBUG],
139  [test x"${enable_rtems_debug}" = x"yes"],
140  [1],
141  [if RTEMS_DEBUG is enabled])
142
143RTEMS_CPUOPT([RTEMS_ITRON_API],
144  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
145  [1],
146  [if itron api is supported])
147
148RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
149  [test x"$enable_multiprocessing" = xyes],
150  [1],
151  [if multiprocessing is enabled])
152
153RTEMS_CPUOPT([RTEMS_NEWLIB],
154  [test x"$RTEMS_USE_NEWLIB" = xyes],
155  [1],
156  [if using newlib])
157
158RTEMS_CPUOPT([RTEMS_POSIX_API],
159  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
160  [1],
161  [if posix api is supported])
162
163RTEMS_CPUOPT([RTEMS_NETWORKING],
164  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
165  [1],
166  [if networking is enabled])
167
168RTEMS_CPUOPT([RTEMS_UNIX],
169  [test x"$RTEMS_CPU" = xunix],
170  [1],
171  [to indicate RTEMS unix])
172
173RTEMS_CPUOPT([RTEMS_UNIXLIB],
174  [test x"${enable_unixlib}" = xyes],
175  [1],
176  [to indicate RTEMS using RTEMS's unixlib])
177
178RTEMS_CPUOPT([RTEMS_USES_STDINT_H],
179  [test x"${RTEMS_USES_STDINT_H}" = x"yes"],
180  [1],
181  [if RTEMS uses stdint.h])
182
183RTEMS_CPUOPT([RTEMS_USES_TAR_H],
184  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
185  [1],
186  [if RTEMS uses tar.h])
187
188RTEMS_CPUOPT([RTEMS_VERSION],
189  [true],
190  ["]_RTEMS_VERSION["],
191  [RTEMS version string])
192
193RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
194  [test x"$RTEMS_CPU" = x"unix"],
195  [$ac_cv_sizeof_CPU_CONTEXT],
196  [The size of a 'CPU_CONTEXT', as computed by sizeof])
197
198cat >>cpuopts.tmp <<\_ACEOF
199
200#endif /* _RTEMS_SCORE_CPUOPTS_H */
201_ACEOF
202
203AS_MKDIR_P(score/include/rtems/score)
204AS_IF([test -f score/include/rtems/score/cpuopts.h],
205[
206  AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
207  [
208    AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
209    rm -f cpuopts.tmp
210  ],[
211    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
212    rm -f score/include/rtems/score/cpuopts.h
213    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
214  ])
215],[
216    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
217    rm -f score/include/rtems/score/cpuopts.h
218    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
219])
220
221AC_ENABLE_MULTILIB([Makefile],[..])
222
223# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
224AC_MSG_CHECKING([for assignable stdio])
225AC_COMPILE_IFELSE(
226  [AC_LANG_PROGRAM(
227    [#include <stdio.h>],
228    [stdin = fopen("/tmp", "r")])],
229  [HAVE_ASSIGNABLE_STDIO=yes],
230  [HAVE_ASSIGNABLE_STDIO=no])
231AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
232
233# libmisc/serdbg exploits weak symbols
234RTEMS_CHECK_GCC_WEAK
235
236AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
237AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
238
239# FIXME: These checks are only in here to provide
240# configuration-time diagnostics and are not really used.
241AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
242AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
243
244## BSD-ism, excluded from POSIX, but available on most platforms
245AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
246
247## Check if libc provides BSD's strlcpy/strlcat
248AC_CHECK_FUNCS(strlcpy strlcat)
249
250
251# ... far too many conditionals ...
252AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
253AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
254AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
255
256AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
257
258AM_CONDITIONAL(HAS_POSIX,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
259AM_CONDITIONAL(HAS_ITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
260AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes")
261
262AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
263AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
264
265AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
266AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
267
268AC_CONFIG_HEADER(config.h)
269
270# Explicitly list all Makefiles here
271AC_CONFIG_FILES([
272Makefile
273rtems/Makefile
274sapi/Makefile
275score/Makefile
276score/cpu/Makefile
277score/cpu/arm/Makefile
278score/cpu/bfin/Makefile
279score/cpu/avr/Makefile
280score/cpu/c4x/Makefile
281score/cpu/h8300/Makefile
282score/cpu/i386/Makefile
283score/cpu/m68k/Makefile
284score/cpu/mips/Makefile
285score/cpu/nios2/Makefile
286score/cpu/powerpc/Makefile
287score/cpu/sh/Makefile
288score/cpu/sparc/Makefile
289score/cpu/unix/Makefile
290score/cpu/no_cpu/Makefile
291posix/Makefile
292itron/Makefile
293libblock/Makefile
294libfs/Makefile
295libcsupport/Makefile
296libnetworking/Makefile
297librpc/Makefile
298libmisc/Makefile
299libi2c/Makefile
300zlib/Makefile
301httpd/Makefile
302ftpd/Makefile
303telnetd/Makefile
304pppd/Makefile
305wrapup/Makefile])
306
307AC_CONFIG_COMMANDS([preinstall-stamp],
308[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
309[MAKE=${MAKE}
310with_multisubdir="$with_multisubdir"])
311
312AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.