source: rtems/cpukit/configure.ac @ f172fc89

4.104.114.84.95
Last change on this file since f172fc89 was d547ff9f, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/13/06 at 07:21:38

Abandon DEPRECATED_TYPES/--enable-deprecated.

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