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
RevLine 
[66387986]1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
[eb299afc]4
[ce1bdb08]5AC_PREREQ(2.60)
[7dcc3fe]6AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
[66387986]7AC_CONFIG_SRCDIR([score])
[2f4c86f]8RTEMS_TOP([..],[])
[eb299afc]9
10RTEMS_CANONICAL_TARGET_CPU
11
[ed908735]12AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.10])
[eb299afc]13AM_MAINTAINER_MODE
[04e6f7bf]14
15RTEMS_ENABLE_MULTILIB
[eb299afc]16RTEMS_ENABLE_MULTIPROCESSING
17RTEMS_ENABLE_POSIX
[352c9b2]18RTEMS_ENABLE_ITRON
[39607984]19RTEMS_ENABLE_RTEMS_DEBUG
[3e39b47]20RTEMS_ENABLE_NETWORKING
[eb299afc]21
[04e6f7bf]22RTEMS_ENV_RTEMSCPU
[39607984]23RTEMS_CHECK_RTEMS_DEBUG
[eb299afc]24
[5b2e199]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
[e7ab8899]33RTEMS_PROG_CC_FOR_TARGET([-fasm])
[10ae124c]34RTEMS_PROG_CCAS
[eb299afc]35RTEMS_CANONICALIZE_TOOLS
[e7d110ba]36AM_PROG_CC_C_O
[e73e576]37AC_PROG_RANLIB
[eb299afc]38
39RTEMS_CHECK_NEWLIB
40
[27f9f12]41RTEMS_CHECK_MULTIPROCESSING
42RTEMS_CHECK_POSIX_API
43RTEMS_CHECK_ITRON_API
[3e39b47]44RTEMS_CHECK_NETWORKING
[1896a650]45
[85eb57e7]46AS_IF([test x"$HAS_NETWORKING" = x"yes"],[
47## FIXME: Should better use a feature-based test
[e336882]48AC_MSG_CHECKING([whether CPU supports librpc])
[85eb57e7]49  case "$RTEMS_CPU" in
50  c4x )  LIBRPC=no;;
51  * )    LIBRPC=yes;;
52  esac
[e336882]53AC_MSG_RESULT([$LIBRPC])
[2a582aa5]54])
[07da959]55
[f8284c95]56AC_ARG_ENABLE([deprecated],
57[AS_HELP_STRING(--enable-deprecated,allow using deprecated files)],
58[case "${enable_deprecated}" in
59  yes) ;;
60  no) ;;
[f321fdc8]61  *) enable_deprecated=no ;;
62esac],[enable_deprecated=no])
[f8284c95]63AM_CONDITIONAL([DEPRECATED],[test "$enable_deprecated" = "yes"])
64
[28caa1d]65AS_IF([ test "$enable_deprecated" = "yes" ],[
66AC_DEFINE_UNQUOTED([RTEMS_DEPRECATED_TYPES],[1],
67  [whether to support deprecated types])
68])
69
[c0394d4b]70# HACK: We should use a feature-based configuration.
[8217c40]71AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
72# HACK: silently accept --enable-unixlib
[64b1f81]73  test -n "${enable_unixlib}" || enable_unixlib="yes"
[8217c40]74])
75
[b422de6c]76# BSD-isms, used throughout the sources
77# Not really used by this configure script
78# FIXME: They should be eliminated if possible.
[85956f9]79AC_CHECK_FUNCS([strsep strcasecmp snprintf])
[b422de6c]80AC_CHECK_FUNCS([bcopy bcmp])
81AC_CHECK_FUNCS([isascii fileno])
[f31a078]82
[a5777f0]83## Check if the installed toolchain has these headers
[9d0e65ed]84AC_CHECK_HEADER([tar.h])
[bffdb82]85
[5f7d9d0e]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
[d62a2e0]91## if libc provides stdint.h, use it.
92AS_IF([test x"${ac_cv_header_stdint_h}" = xyes],
[bffdb82]93[RTEMS_USES_STDINT_H=yes],
[d62a2e0]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])])
[ec75ddc]99
[9d0e65ed]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
[10ae124c]104AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
[e9d90764]105## FIXME: This check is doubtful
106AS_IF([test "$HAS_MP" = "yes"],
107  [RTEMS_CHECK_SYSV_UNIX])
108
[10ae124c]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
[1bcbe41]124cat >>cpuopts.tmp <<\_ACEOF
[07a984b]125/**
126 * @file rtems/score/cpuopts.h
127 */
[3da33bf8]128/* target cpu dependent options file */
129/* automatically generated -- DO NOT EDIT!! */
[3a805b2]130#ifndef _RTEMS_SCORE_CPUOPTS_H
131#define _RTEMS_SCORE_CPUOPTS_H
[1bcbe41]132_ACEOF
[3da33bf8]133
[926e856a]134RTEMS_CPUOPT([RTEMS_DEBUG],
135  [test x"${enable_rtems_debug}" = x"yes"],
136  [1],
137  [if RTEMS_DEBUG is enabled])
138
[3da33bf8]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],
[28caa1d]145  [test x"$enable_multiprocessing" = xyes],
[3da33bf8]146  [1],
147  [if multiprocessing is enabled])
148
149RTEMS_CPUOPT([RTEMS_NEWLIB],
[28caa1d]150  [test x"$RTEMS_USE_NEWLIB" = xyes],
[3da33bf8]151  [1],
152  [if using newlib])
153
154RTEMS_CPUOPT([RTEMS_POSIX_API],
[28caa1d]155  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
[3da33bf8]156  [1],
157  [if posix api is supported])
158
[28caa1d]159RTEMS_CPUOPT([RTEMS_NETWORKING],
160  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
161  [1],
162  [if networking is enabled])
163
[3da33bf8]164RTEMS_CPUOPT([RTEMS_UNIX],
[28caa1d]165  [test x"$RTEMS_CPU" = xunix],
[3da33bf8]166  [1],
167  [to indicate RTEMS unix])
168
169RTEMS_CPUOPT([RTEMS_UNIXLIB],
[28caa1d]170  [test x"${enable_unixlib}" = xyes],
[3da33bf8]171  [1],
172  [to indicate RTEMS using RTEMS's unixlib])
173
[a5777f0]174RTEMS_CPUOPT([RTEMS_USES_STDINT_H],
175  [test x"${RTEMS_USES_STDINT_H}" = x"yes"],
176  [1],
177  [if RTEMS uses stdint.h])
178
[9d0e65ed]179RTEMS_CPUOPT([RTEMS_USES_TAR_H],
180  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
181  [1],
182  [if RTEMS uses tar.h])
183
[3da33bf8]184RTEMS_CPUOPT([RTEMS_VERSION],
185  [true],
[1bcbe41]186  ["]_RTEMS_VERSION["],
[3da33bf8]187  [RTEMS version string])
188
[10ae124c]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
[1bcbe41]194cat >>cpuopts.tmp <<\_ACEOF
195
[3a805b2]196#endif /* _RTEMS_SCORE_CPUOPTS_H */
[1bcbe41]197_ACEOF
[3da33bf8]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
[f31a078]215])
[e0ba3e8]216
[8217c40]217AC_ENABLE_MULTILIB([Makefile],[..])
218
[e30210ea]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
[d71ab7fd]230RTEMS_CHECK_GCC_WEAK
[f7952533]231
[62f0829]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
[07da959]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 ...
[b422de6c]248AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
249AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
[07da959]250AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
[b422de6c]251
[1bcbe41]252AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
[b422de6c]253
[1bcbe41]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")
[b422de6c]256AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes")
257
[07da959]258AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
[62f0829]259AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
[07da959]260
[e30210ea]261AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
262AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
263
[068cf700]264RTEMS_AMPOLISH3
[b1f1bfbb]265
[3da33bf8]266AC_CONFIG_HEADER(config.h)
267
[70810dc]268# Explicitly list all Makefiles here
[b422de6c]269AC_CONFIG_FILES([
270Makefile
[1896a650]271rtems/Makefile
272sapi/Makefile
[eb299afc]273score/Makefile
274score/cpu/Makefile
[e9d90764]275score/cpu/arm/Makefile
[b78d94d]276score/cpu/bfin/Makefile
[05f3270]277score/cpu/avr/Makefile
[e9d90764]278score/cpu/c4x/Makefile
279score/cpu/h8300/Makefile
280score/cpu/i386/Makefile
281score/cpu/m68k/Makefile
282score/cpu/mips/Makefile
[60eae27d]283score/cpu/nios2/Makefile
[e9d90764]284score/cpu/powerpc/Makefile
285score/cpu/sh/Makefile
286score/cpu/sparc/Makefile
287score/cpu/unix/Makefile
[6b400fed]288score/cpu/no_cpu/Makefile
[b422de6c]289posix/Makefile
290itron/Makefile
291libblock/Makefile
292libfs/Makefile
[07da959]293libcsupport/Makefile
[b422de6c]294libnetworking/Makefile
[da0fc5d]295librpc/Makefile
[b422de6c]296libmisc/Makefile
[6339f467]297libi2c/Makefile
[fa645f6]298zlib/Makefile
[be4bd26]299httpd/Makefile
[f26145b]300ftpd/Makefile
[8280caa4]301telnetd/Makefile
[c5bb2a4e]302pppd/Makefile
[28caa1d]303wrapup/Makefile])
304
305AC_CONFIG_COMMANDS([preinstall-stamp],
306[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
307[MAKE=${MAKE}
308with_multisubdir="$with_multisubdir"])
[92ed8c2]309
[66387986]310AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.