source: rtems/cpukit/configure.ac @ 44557f8

4.104.114.84.95
Last change on this file since 44557f8 was ff1eb4c0, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/04/05 at 16:20:05

2005-03-04 Ralf Corsepius <ralf.corsepius@…>

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