source: rtems/cpukit/configure.ac @ ed4b894

4.104.114.84.95
Last change on this file since ed4b894 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
RevLine 
[66387986]1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
[eb299afc]4
[9b353a5]5AC_PREREQ(2.57)
[7dcc3fe]6AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
[66387986]7AC_CONFIG_SRCDIR([score])
[51b4875]8RTEMS_TOP(..)
[eb299afc]9
10RTEMS_CANONICAL_TARGET_CPU
11
[33e6983]12AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.7.2])
[eb299afc]13AM_MAINTAINER_MODE
[04e6f7bf]14
15RTEMS_ENABLE_MULTILIB
[eb299afc]16RTEMS_ENABLE_MULTIPROCESSING
17RTEMS_ENABLE_POSIX
[352c9b2]18RTEMS_ENABLE_ITRON
[eb299afc]19RTEMS_ENABLE_INLINES
[39607984]20RTEMS_ENABLE_RTEMS_DEBUG
[3e39b47]21RTEMS_ENABLE_NETWORKING
[eb299afc]22
[04e6f7bf]23RTEMS_ENV_RTEMSCPU
[39607984]24RTEMS_CHECK_RTEMS_DEBUG
[eb299afc]25
[5b2e199]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
[53c3a2c6]34RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
[eb299afc]35RTEMS_CANONICALIZE_TOOLS
[e73e576]36AC_PROG_RANLIB
[eb299afc]37
[92ed8c2]38# FIXME: For the moment, no reason to check for ada
39# RTEMS_PROG_GNAT
40
[eb299afc]41RTEMS_CHECK_NEWLIB
42
[27f9f12]43RTEMS_CHECK_MULTIPROCESSING
44RTEMS_CHECK_POSIX_API
45RTEMS_CHECK_ITRON_API
[3e39b47]46RTEMS_CHECK_NETWORKING
[1896a650]47
[eb299afc]48# If RTEMS macros are enabled, then use them.  Otherwise, use inlines.
[8217c40]49AS_IF([test "$RTEMS_USE_MACROS" = "yes"],
50  [INLINEdir="macros"],
51  [INLINEdir="inline"])
[120e9fb]52AC_SUBST(INLINEdir)
[85956f9]53AC_DEFINE(RTEMS_VERSION,["][_RTEMS_VERSION]["],[RTEMS version string])
[1896a650]54
[7660ccd8]55RTEMS_CPU_SUBDIRS([score/cpu])
[85956f9]56
[85eb57e7]57AS_IF([test x"$HAS_NETWORKING" = x"yes"],[
58## FIXME: Should better use a feature-based test
[e336882]59AC_MSG_CHECKING([whether CPU supports librpc])
[85eb57e7]60  case "$RTEMS_CPU" in
61  c4x )  LIBRPC=no;;
62  or32 ) LIBRPC=no;;
63  * )    LIBRPC=yes;;
64  esac
[e336882]65AC_MSG_RESULT([$LIBRPC])
[2a582aa5]66])
[07da959]67
[965c49b2]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
[b8a30d07]76RTEMS_DEFINE_POSIX_API
77RTEMS_DEFINE_ITRON_API
78RTEMS_DEFINE_MULTIPROCESSING
79
[c0394d4b]80# HACK: We should use a feature-based configuration.
[8217c40]81AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
[64b1f81]82  AC_DEFINE_UNQUOTED([RTEMS_UNIX],[1],[to indicate RTEMS unix])
[8217c40]83# HACK: silently accept --enable-unixlib
[64b1f81]84  test -n "${enable_unixlib}" || enable_unixlib="yes"
[8217c40]85])
86
87AS_IF([test x"${enable_unixlib}" = x"yes"],
[64b1f81]88  [AC_DEFINE_UNQUOTED([RTEMS_UNIXLIB],[1],
[8217c40]89    [to indicate RTEMS using RTEMS's unixlib])]
90)
[c0394d4b]91
[b422de6c]92# BSD-isms, used throughout the sources
93# Not really used by this configure script
94# FIXME: They should be eliminated if possible.
[85956f9]95AC_CHECK_FUNCS([strsep strcasecmp snprintf])
[b422de6c]96AC_CHECK_FUNCS([bcopy bcmp])
97AC_CHECK_FUNCS([isascii fileno])
[f31a078]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])
[e0ba3e8]116
[8217c40]117AC_ENABLE_MULTILIB([Makefile],[..])
118
[64b1f81]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
[e30210ea]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])
[f7952533]154
[62f0829]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
[07da959]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 ...
[b422de6c]207AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
208AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
[07da959]209AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
[b422de6c]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
[92ed8c2]223AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
224  && test x"$HAS_POSIX_API" = x"yes"])
225
[07da959]226AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
[62f0829]227AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
[07da959]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
[e30210ea]231AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
232AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
233
[70810dc]234# Explicitly list all Makefiles here
[b422de6c]235AC_CONFIG_FILES([
236Makefile
237ada/Makefile
[1896a650]238rtems/Makefile
239sapi/Makefile
[eb299afc]240score/Makefile
241score/cpu/Makefile
[b422de6c]242posix/Makefile
243itron/Makefile
244libblock/Makefile
245libfs/Makefile
[e604ab6]246libfs/src/Makefile
247libfs/src/imfs/Makefile
[b422de6c]248libfs/src/dosfs/Makefile
[07da959]249libcsupport/Makefile
[b422de6c]250libnetworking/Makefile
[85956f9]251libnetworking/lib/Makefile
252libnetworking/libc/Makefile
[b422de6c]253libnetworking/wrapup/Makefile
[da0fc5d]254librpc/Makefile
255librpc/src/Makefile
256librpc/src/xdr/Makefile
257librpc/src/rpc/Makefile
[b422de6c]258libmisc/Makefile
[e30210ea]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
[652b53a]269libmisc/fsmount/Makefile
[e30210ea]270libmisc/untar/Makefile
271libmisc/mw-fb/Makefile
272libmisc/wrapup/Makefile
273
[b422de6c]274wrapup/Makefile
275])
[92ed8c2]276
[66387986]277AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.