source: rtems/cpukit/configure.ac @ 07da959

4.104.114.84.95
Last change on this file since 07da959 was 07da959, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/08/03 at 15:27:02

2003-07-08 Ralf Corsepius <corsepiu@…>

  • configure.ac: Merge-in libcsupport/configure.ac.
  • Makefile.am: Add libcsupport to SUBDIRS.
  • Property mode set to 100644
File size: 8.1 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@OARcorp.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
26RTEMS_CHECK_CPU
27RTEMS_CANONICAL_HOST
28
29RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
30RTEMS_CANONICALIZE_TOOLS
31AC_PROG_RANLIB
32
33# FIXME: For the moment, no reason to check for ada
34# RTEMS_PROG_GNAT
35
36RTEMS_CHECK_NEWLIB
37
38RTEMS_CHECK_MULTIPROCESSING
39RTEMS_CHECK_POSIX_API
40RTEMS_CHECK_ITRON_API
41RTEMS_CHECK_NETWORKING
42
43# If RTEMS macros are enabled, then use them.  Otherwise, use inlines.
44AS_IF([test "$RTEMS_USE_MACROS" = "yes"],
45  [INLINEdir="macros"],
46  [INLINEdir="inline"])
47AC_SUBST(INLINEdir)
48AC_DEFINE(RTEMS_VERSION,["][_RTEMS_VERSION]["],[RTEMS version string])
49
50RTEMS_CPU_SUBDIRS([score/cpu])
51
52AS_IF([test x"$HAS_NETWORKING" = x"yes"],[
53## FIXME: Should better use a feature-based test
54AC_MSG_CHECKING([whether CPU supports librpc])
55  case "$RTEMS_CPU" in
56  c4x )  LIBRPC=no;;
57  or32 ) LIBRPC=no;;
58  * )    LIBRPC=yes;;
59  esac
60AC_MSG_RESULT([$LIBRPC])
61  AS_IF([test "$LIBRPC" = "yes"],
62    [AC_CONFIG_SUBDIRS([librpc])
63  ])
64])
65
66AC_ARG_ENABLE([ada],
67[AC_HELP_STRING([--enable-ada],[enable ada support])],
68[case "${enable_ada}" in
69  yes) ;;
70  no) ;;
71  *)  AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;;
72esac],[enable_ada=no])
73
74RTEMS_DEFINE_POSIX_API
75RTEMS_DEFINE_ITRON_API
76RTEMS_DEFINE_MULTIPROCESSING
77
78# HACK: We should use a feature-based configuration.
79AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
80  AC_DEFINE_UNQUOTED([RTEMS_UNIX],[1],[to indicate RTEMS unix])
81# HACK: silently accept --enable-unixlib
82  test -n "${enable_unixlib}" || enable_unixlib="yes"
83])
84
85AS_IF([test x"${enable_unixlib}" = x"yes"],
86  [AC_DEFINE_UNQUOTED([RTEMS_UNIXLIB],[1],
87    [to indicate RTEMS using RTEMS's unixlib])]
88)
89
90# BSD-isms, used throughout the sources
91# Not really used by this configure script
92# FIXME: They should be eliminated if possible.
93AC_CHECK_FUNCS([strsep strcasecmp snprintf])
94AC_CHECK_FUNCS([bcopy bcmp])
95AC_CHECK_FUNCS([isascii fileno])
96
97AM_CONFIG_HEADER([score/include/rtems/score/cpuopts-tmp.h],[
98echo "/* target cpu dependent options file */"         >$tmp/config.h
99echo "/* automatically generated -- DO NOT EDIT!! */" >>$tmp/config.h
100echo                                                  >>$tmp/config.h
101echo "#ifndef __CPU_OPTIONS_h"                        >>$tmp/config.h
102echo "#define __CPU_OPTIONS_h"                        >>$tmp/config.h
103echo                                                  >>$tmp/config.h
104sed -e '/.*PACKAGE.*/d' score/include/rtems/score/cpuopts-tmp.h >> $tmp/config.h
105echo                                                  >>$tmp/config.h
106echo "#endif"                                         >>$tmp/config.h
107AS_IF([cmp -s score/include/rtems/score/cpuopts.h $tmp/config.h 2>/dev/null],
108  [AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
109   rm -f $tmp/config.h],
110  [AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
111   rm -f score/include/rtems/score/cpuopts.h
112   mv $tmp/config.h score/include/rtems/score/cpuopts.h])
113])
114
115AC_ENABLE_MULTILIB([Makefile],[..])
116
117## HACK: Add a define to cpuopts.h to indicate using multilibs
118## Can be applied to produce compiler errors if using
119## multilib-incompatible settings somewhere else (eg. bspopts.h).
120AS_IF([test x"${enable_multilib}" = x"yes"],[
121  AC_DEFINE_UNQUOTED([RTEMS_MULTILIBS],[1],[using multilib'ed RTEMS])
122])
123
124# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
125AC_MSG_CHECKING([for assignable stdio])
126AC_COMPILE_IFELSE(
127  [AC_LANG_PROGRAM(
128    [#include <stdio.h>],
129    [stdin = fopen("/tmp", "r")])],
130  [HAVE_ASSIGNABLE_STDIO=yes],
131  [HAVE_ASSIGNABLE_STDIO=no])
132AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
133
134# libmisc/serdbg exploits weak symbols
135AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))],
136[rtems_cv_cc_attribute_weak],[
137  AS_IF([test x"$GCC" = xyes],[
138    save_CFLAGS=$CFLAGS
139    CFLAGS=-Werror])
140
141  AC_COMPILE_IFELSE([
142    AC_LANG_PROGRAM(
143    [void myfunc(char c) __attribute__ ((weak));
144     void myfunc(char c) {}],
145    [])],
146    [rtems_cv_cc_attribute_weak=yes],
147    [rtems_cv_cc_attribute_weak=no])
148
149  AS_IF([test x"$GCC" = xyes],[
150    CFLAGS=$save_CFLAGS])
151])
152
153AS_IF([test x"$RTEMS_USE_NEWLIB" != x"yes"],[
154## Provide headers only if the host doesn't.
155  AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
156  AC_CHECK_HEADERS([stdint.h],[NEED_STDINT_H=no],[NEED_STDINT_H=yes])
157  AC_CHECK_HEADERS([inttypes.h],[NEED_INTTYPES_H=no],[NEED_INTTYPES=yes])
158],[
159## Using newlib, we provide sys/cdefs.h
160  NEED_SYS_CDEFS_H=yes
161  NEED_STDINT_H=yes
162  NEED_INTTYPES_H=yes
163])
164
165# FIXME: These checks are only in here to provide
166# configuration-time diagnostics and are not really used.
167AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
168AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
169
170AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],[
171ac_cv_have_decl_XTABS=yes
172ac_cv_have_decl_OLCUC=yes
173## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
174ac_cv_have_decl_ONLRET=yes
175ac_cv_have_decl_ONOCR=yes
176ac_cv_have_decl_TABDLY=yes
177ac_cv_have_decl_OCRNL=yes
178ac_cv_have_decl_IUCLC=yes
179## SUSV3-XSI extension
180ac_cv_have_decl_ECHOPRT=yes
181])
182
183# FIXME: Some cruft to work around portability issues with termios.c
184## Seemingly not covered by any standard.
185AC_CHECK_DECLS([XTABS],,,[#include <termios.h>])
186AC_CHECK_DECLS([OLCUC],,,[#include <termios.h>])
187## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD)
188AC_CHECK_DECLS([ONLRET],,,[#include <termios.h>])
189AC_CHECK_DECLS([ONOCR],,,[#include <termios.h>])
190AC_CHECK_DECLS([TABDLY],,,[#include <termios.h>])
191AC_CHECK_DECLS([OCRNL],,,[#include <termios.h>])
192AC_CHECK_DECLS([IUCLC],,,[#include <termios.h>])
193## SUSV3-XSI extension
194AC_CHECK_DECLS([ECHOPRT],,,[#include <termios.h>])
195
196## BSD-ism, excluded from POSIX, but available on most platforms
197AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
198
199## Check if libc provides BSD's strlcpy/strlcat
200AC_CHECK_FUNCS(strlcpy strlcat)
201
202
203# ... far too many conditionals ...
204AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
205AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
206AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
207
208AM_CONDITIONAL(INLINE,test x"$INLINEdir" = x"inline" )
209AM_CONDITIONAL(MACROS,test x"$INLINEdir" = x"macros" )
210AM_CONDITIONAL(HAS_MP,test x"$HAS_MP" = x"yes" )
211
212AM_CONDITIONAL(HAS_POSIX,test x"$HAS_POSIX_API" = x"yes")
213AM_CONDITIONAL(HAS_ITRON,test x"$HAS_ITRON_API" = x"yes")
214AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes")
215
216# FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't!
217AM_CONDITIONAL([LIBSCORECPU],
218[test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"])
219
220AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
221  && test x"$HAS_POSIX_API" = x"yes"])
222
223AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
224AM_CONDITIONAL([NEED_STDINT_H],[test x"$NEED_STDINT_H" = x"yes"])
225AM_CONDITIONAL([NEED_INTTYPES_H],[test x"$NEED_INTTYPES_H" = x"yes"])
226
227AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
228AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
229
230# Explicitly list all Makefiles here
231AC_CONFIG_FILES([
232Makefile
233include/Makefile
234ada/Makefile
235rtems/Makefile
236sapi/Makefile
237score/Makefile
238score/cpu/Makefile
239posix/Makefile
240itron/Makefile
241libblock/Makefile
242libfs/Makefile
243libfs/src/Makefile
244libfs/src/imfs/Makefile
245libfs/src/dosfs/Makefile
246libcsupport/Makefile
247libnetworking/Makefile
248libnetworking/lib/Makefile
249libnetworking/libc/Makefile
250libnetworking/wrapup/Makefile
251libmisc/Makefile
252libmisc/cpuuse/Makefile
253libmisc/shell/Makefile
254libmisc/devnull/Makefile
255libmisc/dummy/Makefile
256libmisc/dumpbuf/Makefile
257libmisc/monitor/Makefile
258libmisc/rtmonuse/Makefile
259libmisc/serdbg/Makefile
260libmisc/stackchk/Makefile
261libmisc/capture/Makefile
262libmisc/untar/Makefile
263libmisc/mw-fb/Makefile
264libmisc/wrapup/Makefile
265
266wrapup/Makefile
267])
268
269AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.