source: rtems/cpukit/configure.ac @ a2be291

Last change on this file since a2be291 was a2be291, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/14/06 at 16:26:08

RTEMS_PROVIDES_STDINT_H, RTEMS_PROVIDES_INTTYPES_H. Use external stdint.h, inttypes.h.

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