source: rtems/cpukit/configure.ac @ 3da33bf8

4.104.114.84.95
Last change on this file since 3da33bf8 was 3da33bf8, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/20/03 at 07:02:53

2003-11-20 Ralf Corsepius <corsepiu@…>

  • acinclude.m4: New.
  • configure.ac: Don't use AUTOHEADER to generate cpuopts.h. Add local autoheader config.h.
  • aclocal/canonical-target-name.m4: Require AC_CANONICAL_HOST.
  • aclocal/enable-inlines.m4: Remove USE_MACROS (Unused).
  • Property mode set to 100644
File size: 8.6 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# HACK: silently accept --enable-unixlib
83  test -n "${enable_unixlib}" || enable_unixlib="yes"
84])
85
86# BSD-isms, used throughout the sources
87# Not really used by this configure script
88# FIXME: They should be eliminated if possible.
89AC_CHECK_FUNCS([strsep strcasecmp snprintf])
90AC_CHECK_FUNCS([bcopy bcmp])
91AC_CHECK_FUNCS([isascii fileno])
92
93cat << EOF > cpuopts.tmp
94/* target cpu dependent options file */
95/* automatically generated -- DO NOT EDIT!! */
96#ifndef __CPU_OPTIONS_h
97#define __CPU_OPTIONS_h
98EOF
99
100RTEMS_CPUOPT([USE_INLINES],
101  [! test x"${RTEMS_USE_MACROS}" = x"yes"],
102  [1],
103  [if using inlines])
104
105RTEMS_CPUOPT([RTEMS_ITRON_API],
106  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
107  [1],
108  [if itron api is supported])
109
110RTEMS_CPUOPT([RTEMS_MULTILIBS],
111  [test x"$RTEMS_MULTILIBS" = x"yes"],
112  [1],
113  [using multilib'ed RTEMS])
114
115RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
116  [test x"$HAS_MP" = "yes"],
117  [1],
118  [if multiprocessing is enabled])
119
120RTEMS_CPUOPT([RTEMS_NEWLIB],
121  [test x"$RTEMS_USE_NEWLIB" = x"yes"],
122  [1],
123  [if using newlib])
124
125RTEMS_CPUOPT([RTEMS_POSIX_API],
126  [test x"$HAS_POSIX_API" = x"yes"],
127  [1],
128  [if posix api is supported])
129
130RTEMS_CPUOPT([RTEMS_UNIX],
131  [test x"$RTEMS_CPU" = x"unix"],
132  [1],
133  [to indicate RTEMS unix])
134
135RTEMS_CPUOPT([RTEMS_UNIXLIB],
136  [test x"${enable_unixlib}" = x"yes"],
137  [1],
138  [to indicate RTEMS using RTEMS's unixlib])
139
140RTEMS_CPUOPT([RTEMS_VERSION],
141  [true],
142  [\"]_RTEMS_VERSION[\"],
143  [RTEMS version string])
144
145echo >> cpuopts.tmp
146echo "#endif" >> cpuopts.tmp
147
148AS_MKDIR_P(score/include/rtems/score)
149AS_IF([test -f score/include/rtems/score/cpuopts.h],
150[
151  AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
152  [
153    AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
154    rm -f cpuopts.tmp
155  ],[
156    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
157    rm -f score/include/rtems/score/cpuopts.h
158    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
159  ])
160],[
161    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
162    rm -f score/include/rtems/score/cpuopts.h
163    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
164])
165
166AC_ENABLE_MULTILIB([Makefile],[..])
167
168# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
169AC_MSG_CHECKING([for assignable stdio])
170AC_COMPILE_IFELSE(
171  [AC_LANG_PROGRAM(
172    [#include <stdio.h>],
173    [stdin = fopen("/tmp", "r")])],
174  [HAVE_ASSIGNABLE_STDIO=yes],
175  [HAVE_ASSIGNABLE_STDIO=no])
176AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
177
178# libmisc/serdbg exploits weak symbols
179AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))],
180[rtems_cv_cc_attribute_weak],[
181  AS_IF([test x"$GCC" = xyes],[
182    save_CFLAGS=$CFLAGS
183    CFLAGS=-Werror])
184
185  AC_COMPILE_IFELSE([
186    AC_LANG_PROGRAM(
187    [void myfunc(char c) __attribute__ ((weak));
188     void myfunc(char c) {}],
189    [])],
190    [rtems_cv_cc_attribute_weak=yes],
191    [rtems_cv_cc_attribute_weak=no])
192
193  AS_IF([test x"$GCC" = xyes],[
194    CFLAGS=$save_CFLAGS])
195])
196
197AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
198AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
199
200AS_IF([test x"$RTEMS_USE_NEWLIB" != x"yes"],[
201## Provide headers only if the host doesn't.
202  AC_CHECK_HEADERS([stdint.h],[NEED_STDINT_H=no],[NEED_STDINT_H=yes])
203  AC_CHECK_HEADERS([inttypes.h],[NEED_INTTYPES_H=no],[NEED_INTTYPES=yes])
204],[
205## Using newlib, we provide sys/cdefs.h
206  NEED_STDINT_H=yes
207  NEED_INTTYPES_H=yes
208])
209
210# FIXME: These checks are only in here to provide
211# configuration-time diagnostics and are not really used.
212AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
213AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
214
215AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],[
216ac_cv_have_decl_XTABS=yes
217ac_cv_have_decl_OLCUC=yes
218## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
219ac_cv_have_decl_ONLRET=yes
220ac_cv_have_decl_ONOCR=yes
221ac_cv_have_decl_TABDLY=yes
222ac_cv_have_decl_OCRNL=yes
223ac_cv_have_decl_IUCLC=yes
224## SUSV3-XSI extension
225ac_cv_have_decl_ECHOPRT=yes
226])
227
228# FIXME: Some cruft to work around portability issues with termios.c
229## Seemingly not covered by any standard.
230AC_CHECK_DECLS([XTABS],,,[#include <termios.h>])
231AC_CHECK_DECLS([OLCUC],,,[#include <termios.h>])
232## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
233AC_CHECK_DECLS([ONLRET],,,[#include <termios.h>])
234AC_CHECK_DECLS([ONOCR],,,[#include <termios.h>])
235AC_CHECK_DECLS([TABDLY],,,[#include <termios.h>])
236AC_CHECK_DECLS([OCRNL],,,[#include <termios.h>])
237AC_CHECK_DECLS([IUCLC],,,[#include <termios.h>])
238## SUSV3-XSI extension
239AC_CHECK_DECLS([ECHOPRT],,,[#include <termios.h>])
240
241## BSD-ism, excluded from POSIX, but available on most platforms
242AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
243
244## Check if libc provides BSD's strlcpy/strlcat
245AC_CHECK_FUNCS(strlcpy strlcat)
246
247
248# ... far too many conditionals ...
249AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
250AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
251AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
252
253AM_CONDITIONAL(INLINE,test x"$INLINEdir" = x"inline" )
254AM_CONDITIONAL(MACROS,test x"$INLINEdir" = x"macros" )
255AM_CONDITIONAL(HAS_MP,test x"$HAS_MP" = x"yes" )
256
257AM_CONDITIONAL(HAS_POSIX,test x"$HAS_POSIX_API" = x"yes")
258AM_CONDITIONAL(HAS_ITRON,test x"$HAS_ITRON_API" = x"yes")
259AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes")
260
261# FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't!
262AM_CONDITIONAL([LIBSCORECPU],
263[test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"])
264
265AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
266  && test x"$HAS_POSIX_API" = x"yes"])
267
268AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
269AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
270AM_CONDITIONAL([NEED_STDINT_H],[test x"$NEED_STDINT_H" = x"yes"])
271AM_CONDITIONAL([NEED_INTTYPES_H],[test x"$NEED_INTTYPES_H" = x"yes"])
272
273AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
274AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
275
276AC_CONFIG_HEADER(config.h)
277
278# Explicitly list all Makefiles here
279AC_CONFIG_FILES([
280Makefile
281ada/Makefile
282rtems/Makefile
283sapi/Makefile
284score/Makefile
285score/cpu/Makefile
286posix/Makefile
287itron/Makefile
288libblock/Makefile
289libfs/Makefile
290libfs/src/Makefile
291libfs/src/imfs/Makefile
292libfs/src/dosfs/Makefile
293libcsupport/Makefile
294libnetworking/Makefile
295libnetworking/lib/Makefile
296libnetworking/libc/Makefile
297libnetworking/wrapup/Makefile
298librpc/Makefile
299librpc/src/Makefile
300librpc/src/xdr/Makefile
301librpc/src/rpc/Makefile
302libmisc/Makefile
303libmisc/cpuuse/Makefile
304libmisc/shell/Makefile
305libmisc/devnull/Makefile
306libmisc/dummy/Makefile
307libmisc/dumpbuf/Makefile
308libmisc/monitor/Makefile
309libmisc/rtmonuse/Makefile
310libmisc/serdbg/Makefile
311libmisc/stackchk/Makefile
312libmisc/capture/Makefile
313libmisc/fsmount/Makefile
314libmisc/untar/Makefile
315libmisc/mw-fb/Makefile
316libmisc/wrapup/Makefile
317
318wrapup/Makefile
319])
320
321AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.