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

4.104.114.84.95
Last change on this file since 3c89bd55 was d8f6534, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/12/06 at 11:18:21

Remove RTEMS_PROVIDES_STDINT_H, RTEMS_PROVIDES_INTTYPES_H.

  • Property mode set to 100644
File size: 7.7 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 using newlib, force using stdint.h
92AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
93[RTEMS_USES_STDINT_H=yes],
94[RTEMS_USES_STDINT_H=$ac_cv_header_stdint_h])
95
96AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
97[RTEMS_USES_TAR_H=yes],
98[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
99
100AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
101## FIXME: This check is doubtful
102AS_IF([test "$HAS_MP" = "yes"],
103  [RTEMS_CHECK_SYSV_UNIX])
104
105## The code fragment below had been used in tools/cpu/unix/gensize.c.
106## FIXME:
107## * The pad very likely is not necessary.
108AC_CHECK_SIZEOF([CPU_CONTEXT],[],[
109#include <stdio.h>
110#include <setjmp.h>
111
112typedef struct {
113  jmp_buf     regs;
114  int         isr_level;
115  int         pad[4]; /* just in case */
116} CPU_CONTEXT;
117])
118])
119
120cat >>cpuopts.tmp <<\_ACEOF
121/**
122 * @file rtems/score/cpuopts.h
123 */
124/* target cpu dependent options file */
125/* automatically generated -- DO NOT EDIT!! */
126#ifndef _RTEMS_SCORE_CPUOPTS_H
127#define _RTEMS_SCORE_CPUOPTS_H
128_ACEOF
129
130RTEMS_CPUOPT([RTEMS_DEBUG],
131  [test x"${enable_rtems_debug}" = x"yes"],
132  [1],
133  [if RTEMS_DEBUG is enabled])
134
135RTEMS_CPUOPT([RTEMS_ITRON_API],
136  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
137  [1],
138  [if itron api is supported])
139
140RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
141  [test x"$enable_multiprocessing" = xyes],
142  [1],
143  [if multiprocessing is enabled])
144
145RTEMS_CPUOPT([RTEMS_NEWLIB],
146  [test x"$RTEMS_USE_NEWLIB" = xyes],
147  [1],
148  [if using newlib])
149
150RTEMS_CPUOPT([RTEMS_POSIX_API],
151  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
152  [1],
153  [if posix api is supported])
154
155RTEMS_CPUOPT([RTEMS_NETWORKING],
156  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
157  [1],
158  [if networking is enabled])
159
160RTEMS_CPUOPT([RTEMS_UNIX],
161  [test x"$RTEMS_CPU" = xunix],
162  [1],
163  [to indicate RTEMS unix])
164
165RTEMS_CPUOPT([RTEMS_UNIXLIB],
166  [test x"${enable_unixlib}" = xyes],
167  [1],
168  [to indicate RTEMS using RTEMS's unixlib])
169
170RTEMS_CPUOPT([RTEMS_USES_STDINT_H],
171  [test x"${RTEMS_USES_STDINT_H}" = x"yes"],
172  [1],
173  [if RTEMS uses stdint.h])
174
175RTEMS_CPUOPT([RTEMS_USES_TAR_H],
176  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
177  [1],
178  [if RTEMS uses tar.h])
179
180RTEMS_CPUOPT([RTEMS_VERSION],
181  [true],
182  ["]_RTEMS_VERSION["],
183  [RTEMS version string])
184
185RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
186  [test x"$RTEMS_CPU" = x"unix"],
187  [$ac_cv_sizeof_CPU_CONTEXT],
188  [The size of a 'CPU_CONTEXT', as computed by sizeof])
189
190cat >>cpuopts.tmp <<\_ACEOF
191
192#endif /* _RTEMS_SCORE_CPUOPTS_H */
193_ACEOF
194
195AS_MKDIR_P(score/include/rtems/score)
196AS_IF([test -f score/include/rtems/score/cpuopts.h],
197[
198  AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
199  [
200    AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
201    rm -f cpuopts.tmp
202  ],[
203    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
204    rm -f score/include/rtems/score/cpuopts.h
205    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
206  ])
207],[
208    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
209    rm -f score/include/rtems/score/cpuopts.h
210    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
211])
212
213AC_ENABLE_MULTILIB([Makefile],[..])
214
215# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
216AC_MSG_CHECKING([for assignable stdio])
217AC_COMPILE_IFELSE(
218  [AC_LANG_PROGRAM(
219    [#include <stdio.h>],
220    [stdin = fopen("/tmp", "r")])],
221  [HAVE_ASSIGNABLE_STDIO=yes],
222  [HAVE_ASSIGNABLE_STDIO=no])
223AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
224
225# libmisc/serdbg exploits weak symbols
226RTEMS_CHECK_GCC_WEAK
227
228AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
229AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
230
231# FIXME: These checks are only in here to provide
232# configuration-time diagnostics and are not really used.
233AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
234AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
235
236## BSD-ism, excluded from POSIX, but available on most platforms
237AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
238
239## Check if libc provides BSD's strlcpy/strlcat
240AC_CHECK_FUNCS(strlcpy strlcat)
241
242
243# ... far too many conditionals ...
244AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
245AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
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_POSIX,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
251AM_CONDITIONAL(HAS_ITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
252AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes")
253
254AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
255AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
256
257AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
258AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
259
260RTEMS_AMPOLISH3
261
262AC_CONFIG_HEADER(config.h)
263
264# Explicitly list all Makefiles here
265AC_CONFIG_FILES([
266Makefile
267rtems/Makefile
268sapi/Makefile
269score/Makefile
270score/cpu/Makefile
271score/cpu/arm/Makefile
272score/cpu/bfin/Makefile
273score/cpu/avr/Makefile
274score/cpu/c4x/Makefile
275score/cpu/h8300/Makefile
276score/cpu/i386/Makefile
277score/cpu/m68k/Makefile
278score/cpu/mips/Makefile
279score/cpu/nios2/Makefile
280score/cpu/powerpc/Makefile
281score/cpu/sh/Makefile
282score/cpu/sparc/Makefile
283score/cpu/unix/Makefile
284score/cpu/no_cpu/Makefile
285posix/Makefile
286itron/Makefile
287libblock/Makefile
288libfs/Makefile
289libcsupport/Makefile
290libnetworking/Makefile
291librpc/Makefile
292libmisc/Makefile
293libi2c/Makefile
294zlib/Makefile
295httpd/Makefile
296ftpd/Makefile
297telnetd/Makefile
298pppd/Makefile
299wrapup/Makefile])
300
301AC_CONFIG_COMMANDS([preinstall-stamp],
302[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
303[MAKE=${MAKE}
304with_multisubdir="$with_multisubdir"])
305
306AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.