source: rtems/cpukit/configure.ac @ f724f4f4

4.104.114.84.9
Last change on this file since f724f4f4 was f554b02, checked in by Ralf Corsepius <ralf.corsepius@…>, on May 23, 2005 at 7:28:06 AM

Remove ada.

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