source: rtems/cpukit/configure.ac @ 58ce601

4.104.114.84.9
Last change on this file since 58ce601 was c9cb640e, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 28, 2003 at 1:28:51 PM

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

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