source: rtems/cpukit/configure.ac @ 19a0136

4.104.114.84.9
Last change on this file since 19a0136 was 3a805b2, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 21, 2005 at 9:00:35 AM

2005-11-21 Ralf Corsepius <ralf.corsepius@…>

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