source: rtems/cpukit/configure.ac @ b31b35f

4.104.114.84.95
Last change on this file since b31b35f was b31b35f, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 8, 2003 at 7:03:07 AM

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

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