source: rtems/cpukit/configure.ac @ f9f51d0

4.104.114.84.95
Last change on this file since f9f51d0 was f9f51d0, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/19/06 at 02:59:47

Cosmetics.

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