source: rtems/cpukit/configure.ac @ c6328bee

4.104.114.84.95
Last change on this file since c6328bee was ed4b894, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/21/03 at 15:17:21

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

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