source: rtems/cpukit/configure.ac @ 9ca05b1

4.104.114.84.95
Last change on this file since 9ca05b1 was 5b2e199, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/21/03 at 14:51:01

2003-10-21 Ralf Corsepius <corsepiu@…>

  • aclocal/check-multiprocessing.m4: Add m4-quotes. Remove RTEMS_CHECK_CPU.
  • aclocal/check-itron.m4: Add m4-quotes. Require RTEMS_CANONICAL_TARGET_CPU instead of RTEMS_CHECK_CPU.
  • aclocal/check-networking.m4: Add m4-quotes. Require RTEMS_CANONICAL_TARGET_CPU instead of RTEMS_CHECK_CPU.
  • aclocal/check-cpu.m4: Remove.
  • aclocal/canonical-target-name.m4: Add m4-quotes.
  • configure.ac: Merge-in former aclocal/check-cpu.m4.
  • Property mode set to 100644
File size: 8.4 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.57)
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 foreign 1.7.2])
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_CANONICAL_HOST
35
36RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
37RTEMS_CANONICALIZE_TOOLS
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
50# If RTEMS macros are enabled, then use them.  Otherwise, use inlines.
51AS_IF([test "$RTEMS_USE_MACROS" = "yes"],
52  [INLINEdir="macros"],
53  [INLINEdir="inline"])
54AC_SUBST(INLINEdir)
55AC_DEFINE(RTEMS_VERSION,["][_RTEMS_VERSION]["],[RTEMS version string])
56
57RTEMS_CPU_SUBDIRS([score/cpu])
58
59AS_IF([test x"$HAS_NETWORKING" = x"yes"],[
60## FIXME: Should better use a feature-based test
61AC_MSG_CHECKING([whether CPU supports librpc])
62  case "$RTEMS_CPU" in
63  c4x )  LIBRPC=no;;
64  or32 ) LIBRPC=no;;
65  * )    LIBRPC=yes;;
66  esac
67AC_MSG_RESULT([$LIBRPC])
68])
69
70AC_ARG_ENABLE([ada],
71[AC_HELP_STRING([--enable-ada],[enable ada support])],
72[case "${enable_ada}" in
73  yes) ;;
74  no) ;;
75  *)  AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;;
76esac],[enable_ada=no])
77
78RTEMS_DEFINE_POSIX_API
79RTEMS_DEFINE_ITRON_API
80RTEMS_DEFINE_MULTIPROCESSING
81
82# HACK: We should use a feature-based configuration.
83AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
84  AC_DEFINE_UNQUOTED([RTEMS_UNIX],[1],[to indicate RTEMS unix])
85# HACK: silently accept --enable-unixlib
86  test -n "${enable_unixlib}" || enable_unixlib="yes"
87])
88
89AS_IF([test x"${enable_unixlib}" = x"yes"],
90  [AC_DEFINE_UNQUOTED([RTEMS_UNIXLIB],[1],
91    [to indicate RTEMS using RTEMS's unixlib])]
92)
93
94# BSD-isms, used throughout the sources
95# Not really used by this configure script
96# FIXME: They should be eliminated if possible.
97AC_CHECK_FUNCS([strsep strcasecmp snprintf])
98AC_CHECK_FUNCS([bcopy bcmp])
99AC_CHECK_FUNCS([isascii fileno])
100
101AM_CONFIG_HEADER([score/include/rtems/score/cpuopts-tmp.h],[
102echo "/* target cpu dependent options file */"         >$tmp/config.h
103echo "/* automatically generated -- DO NOT EDIT!! */" >>$tmp/config.h
104echo                                                  >>$tmp/config.h
105echo "#ifndef __CPU_OPTIONS_h"                        >>$tmp/config.h
106echo "#define __CPU_OPTIONS_h"                        >>$tmp/config.h
107echo                                                  >>$tmp/config.h
108sed -e '/.*PACKAGE.*/d' score/include/rtems/score/cpuopts-tmp.h >> $tmp/config.h
109echo                                                  >>$tmp/config.h
110echo "#endif"                                         >>$tmp/config.h
111AS_IF([cmp -s score/include/rtems/score/cpuopts.h $tmp/config.h 2>/dev/null],
112  [AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
113   rm -f $tmp/config.h],
114  [AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
115   rm -f score/include/rtems/score/cpuopts.h
116   mv $tmp/config.h score/include/rtems/score/cpuopts.h])
117])
118
119AC_ENABLE_MULTILIB([Makefile],[..])
120
121## HACK: Add a define to cpuopts.h to indicate using multilibs
122## Can be applied to produce compiler errors if using
123## multilib-incompatible settings somewhere else (eg. bspopts.h).
124AS_IF([test x"${enable_multilib}" = x"yes"],[
125  AC_DEFINE_UNQUOTED([RTEMS_MULTILIBS],[1],[using multilib'ed RTEMS])
126])
127
128# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
129AC_MSG_CHECKING([for assignable stdio])
130AC_COMPILE_IFELSE(
131  [AC_LANG_PROGRAM(
132    [#include <stdio.h>],
133    [stdin = fopen("/tmp", "r")])],
134  [HAVE_ASSIGNABLE_STDIO=yes],
135  [HAVE_ASSIGNABLE_STDIO=no])
136AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
137
138# libmisc/serdbg exploits weak symbols
139AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))],
140[rtems_cv_cc_attribute_weak],[
141  AS_IF([test x"$GCC" = xyes],[
142    save_CFLAGS=$CFLAGS
143    CFLAGS=-Werror])
144
145  AC_COMPILE_IFELSE([
146    AC_LANG_PROGRAM(
147    [void myfunc(char c) __attribute__ ((weak));
148     void myfunc(char c) {}],
149    [])],
150    [rtems_cv_cc_attribute_weak=yes],
151    [rtems_cv_cc_attribute_weak=no])
152
153  AS_IF([test x"$GCC" = xyes],[
154    CFLAGS=$save_CFLAGS])
155])
156
157AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
158AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
159
160AS_IF([test x"$RTEMS_USE_NEWLIB" != x"yes"],[
161## Provide headers only if the host doesn't.
162  AC_CHECK_HEADERS([stdint.h],[NEED_STDINT_H=no],[NEED_STDINT_H=yes])
163  AC_CHECK_HEADERS([inttypes.h],[NEED_INTTYPES_H=no],[NEED_INTTYPES=yes])
164],[
165## Using newlib, we provide sys/cdefs.h
166  NEED_STDINT_H=yes
167  NEED_INTTYPES_H=yes
168])
169
170# FIXME: These checks are only in here to provide
171# configuration-time diagnostics and are not really used.
172AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
173AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
174
175AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],[
176ac_cv_have_decl_XTABS=yes
177ac_cv_have_decl_OLCUC=yes
178## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
179ac_cv_have_decl_ONLRET=yes
180ac_cv_have_decl_ONOCR=yes
181ac_cv_have_decl_TABDLY=yes
182ac_cv_have_decl_OCRNL=yes
183ac_cv_have_decl_IUCLC=yes
184## SUSV3-XSI extension
185ac_cv_have_decl_ECHOPRT=yes
186])
187
188# FIXME: Some cruft to work around portability issues with termios.c
189## Seemingly not covered by any standard.
190AC_CHECK_DECLS([XTABS],,,[#include <termios.h>])
191AC_CHECK_DECLS([OLCUC],,,[#include <termios.h>])
192## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
193AC_CHECK_DECLS([ONLRET],,,[#include <termios.h>])
194AC_CHECK_DECLS([ONOCR],,,[#include <termios.h>])
195AC_CHECK_DECLS([TABDLY],,,[#include <termios.h>])
196AC_CHECK_DECLS([OCRNL],,,[#include <termios.h>])
197AC_CHECK_DECLS([IUCLC],,,[#include <termios.h>])
198## SUSV3-XSI extension
199AC_CHECK_DECLS([ECHOPRT],,,[#include <termios.h>])
200
201## BSD-ism, excluded from POSIX, but available on most platforms
202AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
203
204## Check if libc provides BSD's strlcpy/strlcat
205AC_CHECK_FUNCS(strlcpy strlcat)
206
207
208# ... far too many conditionals ...
209AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
210AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
211AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
212
213AM_CONDITIONAL(INLINE,test x"$INLINEdir" = x"inline" )
214AM_CONDITIONAL(MACROS,test x"$INLINEdir" = x"macros" )
215AM_CONDITIONAL(HAS_MP,test x"$HAS_MP" = x"yes" )
216
217AM_CONDITIONAL(HAS_POSIX,test x"$HAS_POSIX_API" = x"yes")
218AM_CONDITIONAL(HAS_ITRON,test x"$HAS_ITRON_API" = x"yes")
219AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes")
220
221# FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't!
222AM_CONDITIONAL([LIBSCORECPU],
223[test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"])
224
225AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
226  && test x"$HAS_POSIX_API" = x"yes"])
227
228AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
229AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
230AM_CONDITIONAL([NEED_STDINT_H],[test x"$NEED_STDINT_H" = x"yes"])
231AM_CONDITIONAL([NEED_INTTYPES_H],[test x"$NEED_INTTYPES_H" = x"yes"])
232
233AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
234AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
235
236# Explicitly list all Makefiles here
237AC_CONFIG_FILES([
238Makefile
239ada/Makefile
240rtems/Makefile
241sapi/Makefile
242score/Makefile
243score/cpu/Makefile
244posix/Makefile
245itron/Makefile
246libblock/Makefile
247libfs/Makefile
248libfs/src/Makefile
249libfs/src/imfs/Makefile
250libfs/src/dosfs/Makefile
251libcsupport/Makefile
252libnetworking/Makefile
253libnetworking/lib/Makefile
254libnetworking/libc/Makefile
255libnetworking/wrapup/Makefile
256librpc/Makefile
257librpc/src/Makefile
258librpc/src/xdr/Makefile
259librpc/src/rpc/Makefile
260libmisc/Makefile
261libmisc/cpuuse/Makefile
262libmisc/shell/Makefile
263libmisc/devnull/Makefile
264libmisc/dummy/Makefile
265libmisc/dumpbuf/Makefile
266libmisc/monitor/Makefile
267libmisc/rtmonuse/Makefile
268libmisc/serdbg/Makefile
269libmisc/stackchk/Makefile
270libmisc/capture/Makefile
271libmisc/fsmount/Makefile
272libmisc/untar/Makefile
273libmisc/mw-fb/Makefile
274libmisc/wrapup/Makefile
275
276wrapup/Makefile
277])
278
279AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.