source: rtems/cpukit/configure.ac @ b2b143f4

4.104.114.84.9
Last change on this file since b2b143f4 was faf45cc, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jan 21, 2004 at 5:56:37 PM

2004-01-21 Ralf Corsepius <corsepiu@…>

  • aclocal/rtems-top.m4: Remove PROJECT_ROOT. Prepend ../ to $1.
  • aclocal/env-rtemscpu.m4: Reworked.
  • configure.ac: RTEMS_TOP(.).
  • 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.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.8.1])
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([-ansi -fasm])
35RTEMS_CANONICALIZE_TOOLS
36AM_PROG_CC_C_O
37AC_PROG_RANLIB
38
39# FIXME: For the moment, no reason to check for ada
40# RTEMS_PROG_GNAT
41
42RTEMS_CHECK_NEWLIB
43
44RTEMS_CHECK_MULTIPROCESSING
45RTEMS_CHECK_POSIX_API
46RTEMS_CHECK_ITRON_API
47RTEMS_CHECK_NETWORKING
48
49RTEMS_CPU_SUBDIRS([score/cpu])
50
51AS_IF([test x"$HAS_NETWORKING" = x"yes"],[
52## FIXME: Should better use a feature-based test
53AC_MSG_CHECKING([whether CPU supports librpc])
54  case "$RTEMS_CPU" in
55  c4x )  LIBRPC=no;;
56  or32 ) LIBRPC=no;;
57  * )    LIBRPC=yes;;
58  esac
59AC_MSG_RESULT([$LIBRPC])
60])
61
62AC_ARG_ENABLE([ada],
63[AS_HELP_STRING(--enable-ada,enable ada support)],
64[case "${enable_ada}" in
65  yes) ;;
66  no) ;;
67  *)  AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;;
68esac],[enable_ada=no])
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
83cat >>cpuopts.tmp <<\_ACEOF
84/* target cpu dependent options file */
85/* automatically generated -- DO NOT EDIT!! */
86#ifndef __CPU_OPTIONS_h
87#define __CPU_OPTIONS_h
88_ACEOF
89
90RTEMS_CPUOPT([RTEMS_DEBUG],
91  [test x"${enable_rtems_debug}" = x"yes"],
92  [1],
93  [if RTEMS_DEBUG is enabled])
94
95RTEMS_CPUOPT([RTEMS_INLINES],
96  [test x"${enable_rtems_inlines}" = x"yes"],
97  [1],
98  [if using inlines])
99
100RTEMS_CPUOPT([RTEMS_ITRON_API],
101  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
102  [1],
103  [if itron api is supported])
104
105RTEMS_CPUOPT([RTEMS_MULTILIBS],
106  [test x"$RTEMS_MULTILIBS" = x"yes"],
107  [1],
108  [using multilib'ed RTEMS])
109
110RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
111  [test x"$enable_multiprocessing" = x"yes"],
112  [1],
113  [if multiprocessing is enabled])
114
115RTEMS_CPUOPT([RTEMS_NEWLIB],
116  [test x"$RTEMS_USE_NEWLIB" = x"yes"],
117  [1],
118  [if using newlib])
119
120RTEMS_CPUOPT([RTEMS_POSIX_API],
121  [test x"$rtems_cv_HAS_POSIX_API" = x"yes"],
122  [1],
123  [if posix api is supported])
124
125RTEMS_CPUOPT([RTEMS_UNIX],
126  [test x"$RTEMS_CPU" = x"unix"],
127  [1],
128  [to indicate RTEMS unix])
129
130RTEMS_CPUOPT([RTEMS_UNIXLIB],
131  [test x"${enable_unixlib}" = x"yes"],
132  [1],
133  [to indicate RTEMS using RTEMS's unixlib])
134
135RTEMS_CPUOPT([RTEMS_VERSION],
136  [true],
137  ["]_RTEMS_VERSION["],
138  [RTEMS version string])
139
140cat >>cpuopts.tmp <<\_ACEOF
141
142#endif
143_ACEOF
144
145AS_MKDIR_P(score/include/rtems/score)
146AS_IF([test -f score/include/rtems/score/cpuopts.h],
147[
148  AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
149  [
150    AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
151    rm -f cpuopts.tmp
152  ],[
153    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
154    rm -f score/include/rtems/score/cpuopts.h
155    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
156  ])
157],[
158    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
159    rm -f score/include/rtems/score/cpuopts.h
160    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
161])
162
163AC_ENABLE_MULTILIB([Makefile],[..])
164
165# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
166AC_MSG_CHECKING([for assignable stdio])
167AC_COMPILE_IFELSE(
168  [AC_LANG_PROGRAM(
169    [#include <stdio.h>],
170    [stdin = fopen("/tmp", "r")])],
171  [HAVE_ASSIGNABLE_STDIO=yes],
172  [HAVE_ASSIGNABLE_STDIO=no])
173AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
174
175# libmisc/serdbg exploits weak symbols
176AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))],
177[rtems_cv_cc_attribute_weak],[
178  AS_IF([test x"$GCC" = xyes],[
179    save_CFLAGS=$CFLAGS
180    CFLAGS=-Werror])
181
182  AC_COMPILE_IFELSE([
183    AC_LANG_PROGRAM(
184    [void myfunc(char c) __attribute__ ((weak));
185     void myfunc(char c) {}],
186    [])],
187    [rtems_cv_cc_attribute_weak=yes],
188    [rtems_cv_cc_attribute_weak=no])
189
190  AS_IF([test x"$GCC" = xyes],[
191    CFLAGS=$save_CFLAGS])
192])
193
194AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
195AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
196
197AS_IF([test x"$RTEMS_USE_NEWLIB" != x"yes"],[
198## Provide headers only if the host doesn't.
199  AC_CHECK_HEADERS([stdint.h],[NEED_STDINT_H=no],[NEED_STDINT_H=yes])
200  AC_CHECK_HEADERS([inttypes.h],[NEED_INTTYPES_H=no],[NEED_INTTYPES=yes])
201],[
202## Using newlib, we provide sys/cdefs.h
203  NEED_STDINT_H=yes
204  NEED_INTTYPES_H=yes
205])
206
207# FIXME: These checks are only in here to provide
208# configuration-time diagnostics and are not really used.
209AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
210AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
211
212AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],[
213ac_cv_have_decl_XTABS=yes
214ac_cv_have_decl_OLCUC=yes
215## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
216ac_cv_have_decl_ONLRET=yes
217ac_cv_have_decl_ONOCR=yes
218ac_cv_have_decl_TABDLY=yes
219ac_cv_have_decl_OCRNL=yes
220ac_cv_have_decl_IUCLC=yes
221## SUSV3-XSI extension
222ac_cv_have_decl_ECHOPRT=yes
223])
224
225# FIXME: Some cruft to work around portability issues with termios.c
226## Seemingly not covered by any standard.
227AC_CHECK_DECLS([XTABS],,,[#include <termios.h>])
228AC_CHECK_DECLS([OLCUC],,,[#include <termios.h>])
229## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
230AC_CHECK_DECLS([ONLRET],,,[#include <termios.h>])
231AC_CHECK_DECLS([ONOCR],,,[#include <termios.h>])
232AC_CHECK_DECLS([TABDLY],,,[#include <termios.h>])
233AC_CHECK_DECLS([OCRNL],,,[#include <termios.h>])
234AC_CHECK_DECLS([IUCLC],,,[#include <termios.h>])
235## SUSV3-XSI extension
236AC_CHECK_DECLS([ECHOPRT],,,[#include <termios.h>])
237
238## BSD-ism, excluded from POSIX, but available on most platforms
239AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
240
241## Check if libc provides BSD's strlcpy/strlcat
242AC_CHECK_FUNCS(strlcpy strlcat)
243
244
245# ... far too many conditionals ...
246AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
247AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
248AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
249
250AM_CONDITIONAL(INLINE,test x"$enable_rtems_inlines" = x"yes" )
251AM_CONDITIONAL(MACROS,test x"$enable_rtems_inlines" = x"no" )
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
258# FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't!
259AM_CONDITIONAL([LIBSCORECPU],
260[test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"])
261
262AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
263  && test x"$HAS_POSIX_API" = x"yes"])
264
265AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
266AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
267AM_CONDITIONAL([NEED_STDINT_H],[test x"$NEED_STDINT_H" = x"yes"])
268AM_CONDITIONAL([NEED_INTTYPES_H],[test x"$NEED_INTTYPES_H" = x"yes"])
269
270AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
271AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
272
273AC_CONFIG_HEADER(config.h)
274
275# Explicitly list all Makefiles here
276AC_CONFIG_FILES([
277Makefile
278ada/Makefile
279rtems/Makefile
280sapi/Makefile
281score/Makefile
282score/cpu/Makefile
283posix/Makefile
284itron/Makefile
285libblock/Makefile
286libfs/Makefile
287libcsupport/Makefile
288libnetworking/Makefile
289librpc/Makefile
290libmisc/Makefile
291
292wrapup/Makefile
293])
294
295AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.