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

4.104.114.84.95
Last change on this file since 58ce601 was c9cb640e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/28/03 at 13:28:51

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
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
[7660ccd8]48RTEMS_CPU_SUBDIRS([score/cpu])
[85956f9]49
[85eb57e7]50AS_IF([test x"$HAS_NETWORKING" = x"yes"],[
51## FIXME: Should better use a feature-based test
[e336882]52AC_MSG_CHECKING([whether CPU supports librpc])
[85eb57e7]53  case "$RTEMS_CPU" in
54  c4x )  LIBRPC=no;;
55  or32 ) LIBRPC=no;;
56  * )    LIBRPC=yes;;
57  esac
[e336882]58AC_MSG_RESULT([$LIBRPC])
[2a582aa5]59])
[07da959]60
[965c49b2]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
[c0394d4b]69# HACK: We should use a feature-based configuration.
[8217c40]70AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
71# HACK: silently accept --enable-unixlib
[64b1f81]72  test -n "${enable_unixlib}" || enable_unixlib="yes"
[8217c40]73])
74
[b422de6c]75# BSD-isms, used throughout the sources
76# Not really used by this configure script
77# FIXME: They should be eliminated if possible.
[85956f9]78AC_CHECK_FUNCS([strsep strcasecmp snprintf])
[b422de6c]79AC_CHECK_FUNCS([bcopy bcmp])
80AC_CHECK_FUNCS([isascii fileno])
[f31a078]81
[1bcbe41]82cat >>cpuopts.tmp <<\_ACEOF
[3da33bf8]83/* target cpu dependent options file */
84/* automatically generated -- DO NOT EDIT!! */
85#ifndef __CPU_OPTIONS_h
86#define __CPU_OPTIONS_h
[1bcbe41]87_ACEOF
[3da33bf8]88
[926e856a]89RTEMS_CPUOPT([RTEMS_DEBUG],
90  [test x"${enable_rtems_debug}" = x"yes"],
91  [1],
92  [if RTEMS_DEBUG is enabled])
93
[dcfba35]94RTEMS_CPUOPT([RTEMS_INLINES],
95  [test x"${enable_rtems_inlines}" = x"yes"],
[3da33bf8]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],
[1bcbe41]110  [test x"$enable_multiprocessing" = x"yes"],
[3da33bf8]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],
[1bcbe41]120  [test x"$rtems_cv_HAS_POSIX_API" = x"yes"],
[3da33bf8]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],
[1bcbe41]136  ["]_RTEMS_VERSION["],
[3da33bf8]137  [RTEMS version string])
138
[1bcbe41]139cat >>cpuopts.tmp <<\_ACEOF
140
141#endif
142_ACEOF
[3da33bf8]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
[f31a078]160])
[e0ba3e8]161
[8217c40]162AC_ENABLE_MULTILIB([Makefile],[..])
163
[e30210ea]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])
[f7952533]192
[62f0829]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
[07da959]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 ...
[b422de6c]245AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
246AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
[07da959]247AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
[b422de6c]248
[dcfba35]249AM_CONDITIONAL(INLINE,test x"$enable_rtems_inlines" = x"yes" )
250AM_CONDITIONAL(MACROS,test x"$enable_rtems_inlines" = x"no" )
[1bcbe41]251AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
[b422de6c]252
[1bcbe41]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")
[b422de6c]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
[92ed8c2]261AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
262  && test x"$HAS_POSIX_API" = x"yes"])
263
[07da959]264AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
[62f0829]265AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
[07da959]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
[e30210ea]269AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
270AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
271
[3da33bf8]272AC_CONFIG_HEADER(config.h)
273
[70810dc]274# Explicitly list all Makefiles here
[b422de6c]275AC_CONFIG_FILES([
276Makefile
277ada/Makefile
[1896a650]278rtems/Makefile
279sapi/Makefile
[eb299afc]280score/Makefile
281score/cpu/Makefile
[b422de6c]282posix/Makefile
283itron/Makefile
284libblock/Makefile
285libfs/Makefile
[07da959]286libcsupport/Makefile
[b422de6c]287libnetworking/Makefile
[da0fc5d]288librpc/Makefile
[b422de6c]289libmisc/Makefile
[e30210ea]290
[b422de6c]291wrapup/Makefile
292])
[92ed8c2]293
[66387986]294AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.