source: rtems/cpukit/configure.ac @ 10ae124c

4.104.114.84.95
Last change on this file since 10ae124c was 10ae124c, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/05/04 at 06:12:14

2004-04-05 Ralf Corsepius <ralf_corsepius@…>

  • configure.ac: Add AC_CHECK_SIZEOF([CPU_CONTEXT]..). Add SIZEOF_CPU_CONTEXT to cpuopts.h. Add RTEMS_PROG_CCAS.
  • acinclude.m4: Use unquoted "here" document to propagate $3 to cpuopts.tmp.
  • Property mode set to 100644
File size: 8.8 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.59)
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.8.1])
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([-ansi -fasm])
35RTEMS_PROG_CCAS
36RTEMS_CANONICALIZE_TOOLS
37AM_PROG_CC_C_O
38AC_PROG_RANLIB
39
40# FIXME: For the moment, no reason to check for ada
41# RTEMS_PROG_GNAT
42
43RTEMS_CHECK_NEWLIB
44
45RTEMS_CHECK_MULTIPROCESSING
46RTEMS_CHECK_POSIX_API
47RTEMS_CHECK_ITRON_API
48RTEMS_CHECK_NETWORKING
49
50RTEMS_CPU_SUBDIRS([score/cpu])
51
52AS_IF([test x"$HAS_NETWORKING" = x"yes"],[
53## FIXME: Should better use a feature-based test
54AC_MSG_CHECKING([whether CPU supports librpc])
55  case "$RTEMS_CPU" in
56  c4x )  LIBRPC=no;;
57  or32 ) LIBRPC=no;;
58  * )    LIBRPC=yes;;
59  esac
60AC_MSG_RESULT([$LIBRPC])
61])
62
63AC_ARG_ENABLE([ada],
64[AS_HELP_STRING(--enable-ada,enable ada support)],
65[case "${enable_ada}" in
66  yes) ;;
67  no) ;;
68  *)  AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;;
69esac],[enable_ada=no])
70
71AC_ARG_ENABLE([deprecated],
72[AS_HELP_STRING(--enable-deprecated,allow using deprecated files)],
73[case "${enable_deprecated}" in
74  yes) ;;
75  no) ;;
76  *) enable_deprecated=yes ;;
77esac],[enable_deprecated=yes])
78AM_CONDITIONAL([DEPRECATED],[test "$enable_deprecated" = "yes"])
79
80# HACK: We should use a feature-based configuration.
81AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
82# HACK: silently accept --enable-unixlib
83  test -n "${enable_unixlib}" || enable_unixlib="yes"
84])
85
86# BSD-isms, used throughout the sources
87# Not really used by this configure script
88# FIXME: They should be eliminated if possible.
89AC_CHECK_FUNCS([strsep strcasecmp snprintf])
90AC_CHECK_FUNCS([bcopy bcmp])
91AC_CHECK_FUNCS([isascii fileno])
92
93AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
94## The code fragment below had been used in tools/cpu/unix/gensize.c.
95## FIXME:
96## * The pad very likely is not necessary.
97AC_CHECK_SIZEOF([CPU_CONTEXT],[],[
98#include <stdio.h>
99#include <setjmp.h>
100
101typedef struct {
102  jmp_buf     regs;
103  int         isr_level;
104  int         pad[4]; /* just in case */
105} CPU_CONTEXT;
106])
107])
108
109cat >>cpuopts.tmp <<\_ACEOF
110/* target cpu dependent options file */
111/* automatically generated -- DO NOT EDIT!! */
112#ifndef __CPU_OPTIONS_h
113#define __CPU_OPTIONS_h
114_ACEOF
115
116RTEMS_CPUOPT([RTEMS_DEBUG],
117  [test x"${enable_rtems_debug}" = x"yes"],
118  [1],
119  [if RTEMS_DEBUG is enabled])
120
121RTEMS_CPUOPT([RTEMS_INLINES],
122  [test x"${enable_rtems_inlines}" = x"yes"],
123  [1],
124  [if using inlines])
125
126RTEMS_CPUOPT([RTEMS_ITRON_API],
127  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
128  [1],
129  [if itron api is supported])
130
131RTEMS_CPUOPT([RTEMS_MULTILIBS],
132  [test x"$RTEMS_MULTILIBS" = x"yes"],
133  [1],
134  [using multilib'ed RTEMS])
135
136RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
137  [test x"$enable_multiprocessing" = x"yes"],
138  [1],
139  [if multiprocessing is enabled])
140
141RTEMS_CPUOPT([RTEMS_NEWLIB],
142  [test x"$RTEMS_USE_NEWLIB" = x"yes"],
143  [1],
144  [if using newlib])
145
146RTEMS_CPUOPT([RTEMS_POSIX_API],
147  [test x"$rtems_cv_HAS_POSIX_API" = x"yes"],
148  [1],
149  [if posix api is supported])
150
151RTEMS_CPUOPT([RTEMS_UNIX],
152  [test x"$RTEMS_CPU" = x"unix"],
153  [1],
154  [to indicate RTEMS unix])
155
156RTEMS_CPUOPT([RTEMS_UNIXLIB],
157  [test x"${enable_unixlib}" = x"yes"],
158  [1],
159  [to indicate RTEMS using RTEMS's unixlib])
160
161RTEMS_CPUOPT([RTEMS_VERSION],
162  [true],
163  ["]_RTEMS_VERSION["],
164  [RTEMS version string])
165
166RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
167  [test x"$RTEMS_CPU" = x"unix"],
168  [$ac_cv_sizeof_CPU_CONTEXT],
169  [The size of a 'CPU_CONTEXT', as computed by sizeof])
170
171cat >>cpuopts.tmp <<\_ACEOF
172
173#endif
174_ACEOF
175
176AS_MKDIR_P(score/include/rtems/score)
177AS_IF([test -f score/include/rtems/score/cpuopts.h],
178[
179  AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
180  [
181    AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
182    rm -f cpuopts.tmp
183  ],[
184    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
185    rm -f score/include/rtems/score/cpuopts.h
186    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
187  ])
188],[
189    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
190    rm -f score/include/rtems/score/cpuopts.h
191    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
192])
193
194AC_ENABLE_MULTILIB([Makefile],[..])
195
196# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
197AC_MSG_CHECKING([for assignable stdio])
198AC_COMPILE_IFELSE(
199  [AC_LANG_PROGRAM(
200    [#include <stdio.h>],
201    [stdin = fopen("/tmp", "r")])],
202  [HAVE_ASSIGNABLE_STDIO=yes],
203  [HAVE_ASSIGNABLE_STDIO=no])
204AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
205
206# libmisc/serdbg exploits weak symbols
207AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))],
208[rtems_cv_cc_attribute_weak],[
209  AS_IF([test x"$GCC" = xyes],[
210    save_CFLAGS=$CFLAGS
211    CFLAGS=-Werror])
212
213  AC_COMPILE_IFELSE([
214    AC_LANG_PROGRAM(
215    [void myfunc(char c) __attribute__ ((weak));
216     void myfunc(char c) {}],
217    [])],
218    [rtems_cv_cc_attribute_weak=yes],
219    [rtems_cv_cc_attribute_weak=no])
220
221  AS_IF([test x"$GCC" = xyes],[
222    CFLAGS=$save_CFLAGS])
223])
224
225AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
226AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
227
228AS_IF([test x"$RTEMS_USE_NEWLIB" != x"yes"],[
229## Provide headers only if the host doesn't.
230  AC_CHECK_HEADERS([stdint.h],[NEED_STDINT_H=no],[NEED_STDINT_H=yes])
231  AC_CHECK_HEADERS([inttypes.h],[NEED_INTTYPES_H=no],[NEED_INTTYPES=yes])
232],[
233## Using newlib, we provide sys/cdefs.h
234  NEED_STDINT_H=yes
235  NEED_INTTYPES_H=yes
236])
237
238# FIXME: These checks are only in here to provide
239# configuration-time diagnostics and are not really used.
240AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
241AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
242
243AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],[
244ac_cv_have_decl_XTABS=yes
245ac_cv_have_decl_OLCUC=yes
246## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
247ac_cv_have_decl_ONLRET=yes
248ac_cv_have_decl_ONOCR=yes
249ac_cv_have_decl_TABDLY=yes
250ac_cv_have_decl_OCRNL=yes
251ac_cv_have_decl_IUCLC=yes
252## SUSV3-XSI extension
253ac_cv_have_decl_ECHOPRT=yes
254])
255
256# FIXME: Some cruft to work around portability issues with termios.c
257## Seemingly not covered by any standard.
258AC_CHECK_DECLS([XTABS],,,[#include <termios.h>])
259AC_CHECK_DECLS([OLCUC],,,[#include <termios.h>])
260## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
261AC_CHECK_DECLS([ONLRET],,,[#include <termios.h>])
262AC_CHECK_DECLS([ONOCR],,,[#include <termios.h>])
263AC_CHECK_DECLS([TABDLY],,,[#include <termios.h>])
264AC_CHECK_DECLS([OCRNL],,,[#include <termios.h>])
265AC_CHECK_DECLS([IUCLC],,,[#include <termios.h>])
266## SUSV3-XSI extension
267AC_CHECK_DECLS([ECHOPRT],,,[#include <termios.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 "$LIBRPC" = "yes"])
278AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
279AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
280
281AM_CONDITIONAL(INLINE,test x"$enable_rtems_inlines" = x"yes" )
282AM_CONDITIONAL(MACROS,test x"$enable_rtems_inlines" = x"no" )
283AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
284
285AM_CONDITIONAL(HAS_POSIX,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
286AM_CONDITIONAL(HAS_ITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
287AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes")
288
289# FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't!
290AM_CONDITIONAL([LIBSCORECPU],
291[test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"])
292
293AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
294  && test x"$HAS_POSIX_API" = x"yes"])
295
296AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
297AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
298AM_CONDITIONAL([NEED_STDINT_H],[test x"$NEED_STDINT_H" = x"yes"])
299AM_CONDITIONAL([NEED_INTTYPES_H],[test x"$NEED_INTTYPES_H" = x"yes"])
300
301AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
302AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
303
304AC_CONFIG_HEADER(config.h)
305
306# Explicitly list all Makefiles here
307AC_CONFIG_FILES([
308Makefile
309ada/Makefile
310rtems/Makefile
311sapi/Makefile
312score/Makefile
313score/cpu/Makefile
314posix/Makefile
315itron/Makefile
316libblock/Makefile
317libfs/Makefile
318libcsupport/Makefile
319libnetworking/Makefile
320librpc/Makefile
321libmisc/Makefile
322
323wrapup/Makefile
324])
325
326AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.