source: rtems/cpukit/configure.ac @ fa73ccb

4.104.114.84.95
Last change on this file since fa73ccb was fa73ccb, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/08/05 at 04:04:46

2005-02-08 Ralf Corsepius <ralf.corsepius@…>

  • configure.ac: Add new header guard to cpuopts.h.
  • Makefile.am: Add libfs, libblock, ftpd header install rules.
  • libfs/Makefile.am, libblock/Makefile.am, ftpd/Makefile.am: Remove header install rules.
  • Property mode set to 100644
File size: 8.1 KB
RevLine 
[66387986]1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
[eb299afc]4
[810720b6]5AC_PREREQ(2.59)
[7dcc3fe]6AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
[66387986]7AC_CONFIG_SRCDIR([score])
[2f4c86f]8RTEMS_TOP([..],[])
[eb299afc]9
10RTEMS_CANONICAL_TARGET_CPU
11
[97891e5e]12AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.9])
[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
[e7ab8899]34RTEMS_PROG_CC_FOR_TARGET([-fasm])
[10ae124c]35RTEMS_PROG_CCAS
[eb299afc]36RTEMS_CANONICALIZE_TOOLS
[e7d110ba]37AM_PROG_CC_C_O
[e73e576]38AC_PROG_RANLIB
[eb299afc]39
[92ed8c2]40# FIXME: For the moment, no reason to check for ada
41# RTEMS_PROG_GNAT
42
[eb299afc]43RTEMS_CHECK_NEWLIB
44
[27f9f12]45RTEMS_CHECK_MULTIPROCESSING
46RTEMS_CHECK_POSIX_API
47RTEMS_CHECK_ITRON_API
[3e39b47]48RTEMS_CHECK_NETWORKING
[1896a650]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],
[35d9b418]62[AS_HELP_STRING(--enable-ada,enable ada support)],
[965c49b2]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
[f8284c95]69AC_ARG_ENABLE([deprecated],
70[AS_HELP_STRING(--enable-deprecated,allow using deprecated files)],
71[case "${enable_deprecated}" in
72  yes) ;;
73  no) ;;
74  *) enable_deprecated=yes ;;
75esac],[enable_deprecated=yes])
76AM_CONDITIONAL([DEPRECATED],[test "$enable_deprecated" = "yes"])
77
[c0394d4b]78# HACK: We should use a feature-based configuration.
[8217c40]79AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
80# HACK: silently accept --enable-unixlib
[64b1f81]81  test -n "${enable_unixlib}" || enable_unixlib="yes"
[8217c40]82])
83
[b422de6c]84# BSD-isms, used throughout the sources
85# Not really used by this configure script
86# FIXME: They should be eliminated if possible.
[85956f9]87AC_CHECK_FUNCS([strsep strcasecmp snprintf])
[b422de6c]88AC_CHECK_FUNCS([bcopy bcmp])
89AC_CHECK_FUNCS([isascii fileno])
[f31a078]90
[a5777f0]91## Check if the installed toolchain has these headers
[bffdb82]92AC_CHECK_HEADER([stdint.h])
93AC_CHECK_HEADER([inttypes.h])
[9d0e65ed]94AC_CHECK_HEADER([tar.h])
[bffdb82]95
96## if using newlib, we provide stdint.h and inttypes.h
97AM_CONDITIONAL([RTEMS_PROVIDES_STDINT_H],[test x"${RTEMS_USE_NEWLIB}" = xyes])
98AM_CONDITIONAL([RTEMS_PROVIDES_INTTYPES_H],[test x"${RTEMS_USE_NEWLIB}" = xyes])
[a5777f0]99
[bffdb82]100## if using newlib, force using stdint.h
101AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
102[RTEMS_USES_STDINT_H=yes],
103[RTEMS_USES_STDINT_H=$ac_cv_header_stdint_h])
[ec75ddc]104
[9d0e65ed]105AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
106[RTEMS_USES_TAR_H=yes],
107[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
108
[10ae124c]109AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
[e9d90764]110## FIXME: This check is doubtful
111AS_IF([test "$HAS_MP" = "yes"],
112  [RTEMS_CHECK_SYSV_UNIX])
113
[10ae124c]114## The code fragment below had been used in tools/cpu/unix/gensize.c.
115## FIXME:
116## * The pad very likely is not necessary.
117AC_CHECK_SIZEOF([CPU_CONTEXT],[],[
118#include <stdio.h>
119#include <setjmp.h>
120
121typedef struct {
122  jmp_buf     regs;
123  int         isr_level;
124  int         pad[4]; /* just in case */
125} CPU_CONTEXT;
126])
127])
128
[1bcbe41]129cat >>cpuopts.tmp <<\_ACEOF
[07a984b]130/**
131 * @file rtems/score/cpuopts.h
132 */
[3da33bf8]133/* target cpu dependent options file */
134/* automatically generated -- DO NOT EDIT!! */
[fa73ccb]135#ifndef _CPU_OPTIONS_H
136#define _CPU_OPTIONS_H
[1bcbe41]137_ACEOF
[3da33bf8]138
[926e856a]139RTEMS_CPUOPT([RTEMS_DEBUG],
140  [test x"${enable_rtems_debug}" = x"yes"],
141  [1],
142  [if RTEMS_DEBUG is enabled])
143
[dcfba35]144RTEMS_CPUOPT([RTEMS_INLINES],
145  [test x"${enable_rtems_inlines}" = x"yes"],
[3da33bf8]146  [1],
147  [if using inlines])
148
149RTEMS_CPUOPT([RTEMS_ITRON_API],
150  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
151  [1],
152  [if itron api is supported])
153
154RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
[1bcbe41]155  [test x"$enable_multiprocessing" = x"yes"],
[3da33bf8]156  [1],
157  [if multiprocessing is enabled])
158
159RTEMS_CPUOPT([RTEMS_NEWLIB],
160  [test x"$RTEMS_USE_NEWLIB" = x"yes"],
161  [1],
162  [if using newlib])
163
164RTEMS_CPUOPT([RTEMS_POSIX_API],
[1bcbe41]165  [test x"$rtems_cv_HAS_POSIX_API" = x"yes"],
[3da33bf8]166  [1],
167  [if posix api is supported])
168
169RTEMS_CPUOPT([RTEMS_UNIX],
170  [test x"$RTEMS_CPU" = x"unix"],
171  [1],
172  [to indicate RTEMS unix])
173
174RTEMS_CPUOPT([RTEMS_UNIXLIB],
175  [test x"${enable_unixlib}" = x"yes"],
176  [1],
177  [to indicate RTEMS using RTEMS's unixlib])
178
[a5777f0]179RTEMS_CPUOPT([RTEMS_USES_STDINT_H],
180  [test x"${RTEMS_USES_STDINT_H}" = x"yes"],
181  [1],
182  [if RTEMS uses stdint.h])
183
[9d0e65ed]184RTEMS_CPUOPT([RTEMS_USES_TAR_H],
185  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
186  [1],
187  [if RTEMS uses tar.h])
188
[3da33bf8]189RTEMS_CPUOPT([RTEMS_VERSION],
190  [true],
[1bcbe41]191  ["]_RTEMS_VERSION["],
[3da33bf8]192  [RTEMS version string])
193
[10ae124c]194RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
195  [test x"$RTEMS_CPU" = x"unix"],
196  [$ac_cv_sizeof_CPU_CONTEXT],
197  [The size of a 'CPU_CONTEXT', as computed by sizeof])
198
[1bcbe41]199cat >>cpuopts.tmp <<\_ACEOF
200
201#endif
202_ACEOF
[3da33bf8]203
204AS_MKDIR_P(score/include/rtems/score)
205AS_IF([test -f score/include/rtems/score/cpuopts.h],
206[
207  AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
208  [
209    AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
210    rm -f cpuopts.tmp
211  ],[
212    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
213    rm -f score/include/rtems/score/cpuopts.h
214    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
215  ])
216],[
217    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
218    rm -f score/include/rtems/score/cpuopts.h
219    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
[f31a078]220])
[e0ba3e8]221
[8217c40]222AC_ENABLE_MULTILIB([Makefile],[..])
223
[e30210ea]224# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
225AC_MSG_CHECKING([for assignable stdio])
226AC_COMPILE_IFELSE(
227  [AC_LANG_PROGRAM(
228    [#include <stdio.h>],
229    [stdin = fopen("/tmp", "r")])],
230  [HAVE_ASSIGNABLE_STDIO=yes],
231  [HAVE_ASSIGNABLE_STDIO=no])
232AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
233
234# libmisc/serdbg exploits weak symbols
[d71ab7fd]235RTEMS_CHECK_GCC_WEAK
[f7952533]236
[62f0829]237AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
238AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
239
[07da959]240# FIXME: These checks are only in here to provide
241# configuration-time diagnostics and are not really used.
242AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
243AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
244
245## BSD-ism, excluded from POSIX, but available on most platforms
246AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
247
248## Check if libc provides BSD's strlcpy/strlcat
249AC_CHECK_FUNCS(strlcpy strlcat)
250
251
252# ... far too many conditionals ...
[b422de6c]253AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"])
254AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
[07da959]255AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
[b422de6c]256
[dcfba35]257AM_CONDITIONAL(INLINE,test x"$enable_rtems_inlines" = x"yes" )
258AM_CONDITIONAL(MACROS,test x"$enable_rtems_inlines" = x"no" )
[1bcbe41]259AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
[b422de6c]260
[1bcbe41]261AM_CONDITIONAL(HAS_POSIX,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
262AM_CONDITIONAL(HAS_ITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
[b422de6c]263AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes")
264
265# FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't!
266AM_CONDITIONAL([LIBSCORECPU],
267[test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"])
268
[92ed8c2]269AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
270  && test x"$HAS_POSIX_API" = x"yes"])
271
[07da959]272AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
[62f0829]273AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
[07da959]274
[e30210ea]275AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
276AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
277
[3da33bf8]278AC_CONFIG_HEADER(config.h)
279
[70810dc]280# Explicitly list all Makefiles here
[b422de6c]281AC_CONFIG_FILES([
282Makefile
283ada/Makefile
[1896a650]284rtems/Makefile
285sapi/Makefile
[eb299afc]286score/Makefile
287score/cpu/Makefile
[e9d90764]288score/cpu/arm/Makefile
[05f3270]289score/cpu/avr/Makefile
[e9d90764]290score/cpu/c4x/Makefile
291score/cpu/h8300/Makefile
292score/cpu/i386/Makefile
293score/cpu/m68k/Makefile
294score/cpu/mips/Makefile
295score/cpu/or32/Makefile
296score/cpu/powerpc/Makefile
297score/cpu/sh/Makefile
298score/cpu/sparc/Makefile
299score/cpu/unix/Makefile
[6b400fed]300score/cpu/no_cpu/Makefile
[b422de6c]301posix/Makefile
302itron/Makefile
303libblock/Makefile
304libfs/Makefile
[07da959]305libcsupport/Makefile
[b422de6c]306libnetworking/Makefile
[da0fc5d]307librpc/Makefile
[b422de6c]308libmisc/Makefile
[be4bd26]309httpd/Makefile
[f26145b]310ftpd/Makefile
[b422de6c]311wrapup/Makefile
312])
[92ed8c2]313
[66387986]314AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.