source: rtems/cpukit/configure.ac @ 9876707a

4.104.114.84.95
Last change on this file since 9876707a was f8284c95, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/01/04 at 15:12:39

2004-04-01 Ralf Corsepius <ralf_corsepius@…>

  • backward/confdefs.h: New.
  • Makefile.am: Add backward/confdefs.h. Add conditional DEPRECATED.
  • configure.ac: Add --enable-deprecated. Add conditional DEPRECATED.
  • Property mode set to 100644
File size: 8.2 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.59)
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 subdir-objects foreign 1.8.1])
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
36AM_PROG_CC_C_O
37AC_PROG_RANLIB
38
39# FIXME: For the moment, no reason to check for ada
40# RTEMS_PROG_GNAT
41
42RTEMS_CHECK_NEWLIB
43
44RTEMS_CHECK_MULTIPROCESSING
45RTEMS_CHECK_POSIX_API
46RTEMS_CHECK_ITRON_API
47RTEMS_CHECK_NETWORKING
48
49RTEMS_CPU_SUBDIRS([score/cpu])
50
51AS_IF([test x"$HAS_NETWORKING" = x"yes"],[
52## FIXME: Should better use a feature-based test
53AC_MSG_CHECKING([whether CPU supports librpc])
54  case "$RTEMS_CPU" in
55  c4x )  LIBRPC=no;;
56  or32 ) LIBRPC=no;;
57  * )    LIBRPC=yes;;
58  esac
59AC_MSG_RESULT([$LIBRPC])
60])
61
62AC_ARG_ENABLE([ada],
63[AS_HELP_STRING(--enable-ada,enable ada support)],
64[case "${enable_ada}" in
65  yes) ;;
66  no) ;;
67  *)  AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;;
68esac],[enable_ada=no])
69
70AC_ARG_ENABLE([deprecated],
71[AS_HELP_STRING(--enable-deprecated,allow using deprecated files)],
72[case "${enable_deprecated}" in
73  yes) ;;
74  no) ;;
75  *) enable_deprecated=yes ;;
76esac],[enable_deprecated=yes])
77AM_CONDITIONAL([DEPRECATED],[test "$enable_deprecated" = "yes"])
78
79# HACK: We should use a feature-based configuration.
80AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
81# HACK: silently accept --enable-unixlib
82  test -n "${enable_unixlib}" || enable_unixlib="yes"
83])
84
85# BSD-isms, used throughout the sources
86# Not really used by this configure script
87# FIXME: They should be eliminated if possible.
88AC_CHECK_FUNCS([strsep strcasecmp snprintf])
89AC_CHECK_FUNCS([bcopy bcmp])
90AC_CHECK_FUNCS([isascii fileno])
91
92cat >>cpuopts.tmp <<\_ACEOF
93/* target cpu dependent options file */
94/* automatically generated -- DO NOT EDIT!! */
95#ifndef __CPU_OPTIONS_h
96#define __CPU_OPTIONS_h
97_ACEOF
98
99RTEMS_CPUOPT([RTEMS_DEBUG],
100  [test x"${enable_rtems_debug}" = x"yes"],
101  [1],
102  [if RTEMS_DEBUG is enabled])
103
104RTEMS_CPUOPT([RTEMS_INLINES],
105  [test x"${enable_rtems_inlines}" = x"yes"],
106  [1],
107  [if using inlines])
108
109RTEMS_CPUOPT([RTEMS_ITRON_API],
110  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
111  [1],
112  [if itron api is supported])
113
114RTEMS_CPUOPT([RTEMS_MULTILIBS],
115  [test x"$RTEMS_MULTILIBS" = x"yes"],
116  [1],
117  [using multilib'ed RTEMS])
118
119RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
120  [test x"$enable_multiprocessing" = x"yes"],
121  [1],
122  [if multiprocessing is enabled])
123
124RTEMS_CPUOPT([RTEMS_NEWLIB],
125  [test x"$RTEMS_USE_NEWLIB" = x"yes"],
126  [1],
127  [if using newlib])
128
129RTEMS_CPUOPT([RTEMS_POSIX_API],
130  [test x"$rtems_cv_HAS_POSIX_API" = x"yes"],
131  [1],
132  [if posix api is supported])
133
134RTEMS_CPUOPT([RTEMS_UNIX],
135  [test x"$RTEMS_CPU" = x"unix"],
136  [1],
137  [to indicate RTEMS unix])
138
139RTEMS_CPUOPT([RTEMS_UNIXLIB],
140  [test x"${enable_unixlib}" = x"yes"],
141  [1],
142  [to indicate RTEMS using RTEMS's unixlib])
143
144RTEMS_CPUOPT([RTEMS_VERSION],
145  [true],
146  ["]_RTEMS_VERSION["],
147  [RTEMS version string])
148
149cat >>cpuopts.tmp <<\_ACEOF
150
151#endif
152_ACEOF
153
154AS_MKDIR_P(score/include/rtems/score)
155AS_IF([test -f score/include/rtems/score/cpuopts.h],
156[
157  AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
158  [
159    AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
160    rm -f cpuopts.tmp
161  ],[
162    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
163    rm -f score/include/rtems/score/cpuopts.h
164    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
165  ])
166],[
167    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
168    rm -f score/include/rtems/score/cpuopts.h
169    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
170])
171
172AC_ENABLE_MULTILIB([Makefile],[..])
173
174# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
175AC_MSG_CHECKING([for assignable stdio])
176AC_COMPILE_IFELSE(
177  [AC_LANG_PROGRAM(
178    [#include <stdio.h>],
179    [stdin = fopen("/tmp", "r")])],
180  [HAVE_ASSIGNABLE_STDIO=yes],
181  [HAVE_ASSIGNABLE_STDIO=no])
182AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
183
184# libmisc/serdbg exploits weak symbols
185AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))],
186[rtems_cv_cc_attribute_weak],[
187  AS_IF([test x"$GCC" = xyes],[
188    save_CFLAGS=$CFLAGS
189    CFLAGS=-Werror])
190
191  AC_COMPILE_IFELSE([
192    AC_LANG_PROGRAM(
193    [void myfunc(char c) __attribute__ ((weak));
194     void myfunc(char c) {}],
195    [])],
196    [rtems_cv_cc_attribute_weak=yes],
197    [rtems_cv_cc_attribute_weak=no])
198
199  AS_IF([test x"$GCC" = xyes],[
200    CFLAGS=$save_CFLAGS])
201])
202
203AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
204AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
205
206AS_IF([test x"$RTEMS_USE_NEWLIB" != x"yes"],[
207## Provide headers only if the host doesn't.
208  AC_CHECK_HEADERS([stdint.h],[NEED_STDINT_H=no],[NEED_STDINT_H=yes])
209  AC_CHECK_HEADERS([inttypes.h],[NEED_INTTYPES_H=no],[NEED_INTTYPES=yes])
210],[
211## Using newlib, we provide sys/cdefs.h
212  NEED_STDINT_H=yes
213  NEED_INTTYPES_H=yes
214])
215
216# FIXME: These checks are only in here to provide
217# configuration-time diagnostics and are not really used.
218AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
219AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
220
221AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],[
222ac_cv_have_decl_XTABS=yes
223ac_cv_have_decl_OLCUC=yes
224## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
225ac_cv_have_decl_ONLRET=yes
226ac_cv_have_decl_ONOCR=yes
227ac_cv_have_decl_TABDLY=yes
228ac_cv_have_decl_OCRNL=yes
229ac_cv_have_decl_IUCLC=yes
230## SUSV3-XSI extension
231ac_cv_have_decl_ECHOPRT=yes
232])
233
234# FIXME: Some cruft to work around portability issues with termios.c
235## Seemingly not covered by any standard.
236AC_CHECK_DECLS([XTABS],,,[#include <termios.h>])
237AC_CHECK_DECLS([OLCUC],,,[#include <termios.h>])
238## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
239AC_CHECK_DECLS([ONLRET],,,[#include <termios.h>])
240AC_CHECK_DECLS([ONOCR],,,[#include <termios.h>])
241AC_CHECK_DECLS([TABDLY],,,[#include <termios.h>])
242AC_CHECK_DECLS([OCRNL],,,[#include <termios.h>])
243AC_CHECK_DECLS([IUCLC],,,[#include <termios.h>])
244## SUSV3-XSI extension
245AC_CHECK_DECLS([ECHOPRT],,,[#include <termios.h>])
246
247## BSD-ism, excluded from POSIX, but available on most platforms
248AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
249
250## Check if libc provides BSD's strlcpy/strlcat
251AC_CHECK_FUNCS(strlcpy strlcat)
252
253
254# ... far too many conditionals ...
255AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
256AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
257AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
258
259AM_CONDITIONAL(INLINE,test x"$enable_rtems_inlines" = x"yes" )
260AM_CONDITIONAL(MACROS,test x"$enable_rtems_inlines" = x"no" )
261AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
262
263AM_CONDITIONAL(HAS_POSIX,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
264AM_CONDITIONAL(HAS_ITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
265AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes")
266
267# FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't!
268AM_CONDITIONAL([LIBSCORECPU],
269[test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"])
270
271AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
272  && test x"$HAS_POSIX_API" = x"yes"])
273
274AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
275AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
276AM_CONDITIONAL([NEED_STDINT_H],[test x"$NEED_STDINT_H" = x"yes"])
277AM_CONDITIONAL([NEED_INTTYPES_H],[test x"$NEED_INTTYPES_H" = x"yes"])
278
279AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
280AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
281
282AC_CONFIG_HEADER(config.h)
283
284# Explicitly list all Makefiles here
285AC_CONFIG_FILES([
286Makefile
287ada/Makefile
288rtems/Makefile
289sapi/Makefile
290score/Makefile
291score/cpu/Makefile
292posix/Makefile
293itron/Makefile
294libblock/Makefile
295libfs/Makefile
296libcsupport/Makefile
297libnetworking/Makefile
298librpc/Makefile
299libmisc/Makefile
300
301wrapup/Makefile
302])
303
304AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.