source: rtems/cpukit/configure.ac @ 926e856a

4.104.114.84.95
Last change on this file since 926e856a was 926e856a, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/23/03 at 17:07:21

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

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