source: rtems/cpukit/configure.ac @ 3274c876

4.104.114.84.95
Last change on this file since 3274c876 was d3edb9ec, checked in by Jennifer Averett <Jennifer.Averett@…>, on 04/28/05 at 15:21:39

2005-04-28 Jennifer Averett <jennifer.averett@…>

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