source: rtems/cpukit/configure.ac @ d62a2e0

4.104.114.84.95
Last change on this file since d62a2e0 was d62a2e0, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/14/06 at 09:14:58

2006-11-14 Ralf Corsépius <ralf.corsepius@…>

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