source: rtems/cpukit/configure.ac @ 87f5e2d

4.115
Last change on this file since 87f5e2d was 87f5e2d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/02/11 at 07:22:25

2011-03-02 Ralf Corsépius <ralf.corsepius@…>

  • configure.ac: Remove unused AM_CONDITIONAL([NEED_SYS_CDEFS_H]). Remove unused AM_CONDITIONAL([NEED_SYS_QUEUE_H]).
  • Property mode set to 100644
File size: 10.9 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ([2.68])
6AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
7AC_CONFIG_SRCDIR([score])
8RTEMS_TOP([..],[])
9
10RTEMS_CANONICAL_TARGET_CPU
11
12AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.11.1])
13AM_MAINTAINER_MODE
14
15RTEMS_ENABLE_MULTILIB
16RTEMS_ENABLE_MULTIPROCESSING
17RTEMS_ENABLE_POSIX
18RTEMS_ENABLE_RTEMS_DEBUG
19RTEMS_ENABLE_NETWORKING
20
21RTEMS_ENV_RTEMSCPU
22RTEMS_CHECK_RTEMS_DEBUG
23
24# Is this a supported CPU?
25AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
26if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
27  AC_MSG_RESULT(yes)
28else
29  AC_MSG_ERROR(no)
30fi
31
32RTEMS_PROG_CC_FOR_TARGET
33RTEMS_PROG_CCAS
34RTEMS_CANONICALIZE_TOOLS
35AM_PROG_CC_C_O
36AC_PROG_RANLIB
37
38RTEMS_CHECK_NEWLIB
39
40# BSD-isms, used throughout the sources
41# Not really used by this configure script
42# FIXME: They should be eliminated if possible.
43AC_CHECK_FUNCS([strsep strcasecmp snprintf])
44AC_CHECK_FUNCS([strdup strndup strncasecmp])
45AC_CHECK_FUNCS([bcopy bcmp])
46AC_CHECK_FUNCS([isascii fileno])
47
48# <FIXME>
49#   Check for functions supplied by newlib >= 1.17.0
50# Newlib's posix/ directory
51AC_CHECK_FUNCS([readdir_r isatty])
52AC_CHECK_FUNCS([creat \
53  opendir closedir readdir rewinddir scandir seekdir \
54  sleep \
55  telldir \
56  usleep],,
57  [rtems_missing_func="$ac_func";break])
58AS_IF([test -n "$rtems_missing_func"],
59  AC_MSG_ERROR([Missing function $rtems_missing_func in libc])])
60AC_CHECK_FUNCS([__assert])
61AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
62AC_CHECK_FUNCS([regcomp regexec regerror regfree])
63
64# Mandated by POSIX, decls not present in some versions of newlib
65AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>])
66AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>])
67AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>])
68
69# Mandated by POSIX, decls not present in some versions of newlib,
70# some versions stubbed in newlib's rtems crt0
71RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>])
72RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>])
73RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>])
74RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>])
75RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>])
76RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>])
77RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>])
78RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>])
79RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>])
80RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>])
81RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>])
82RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>])
83RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>])
84RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>])
85
86# pthread-functions not declared in some versions of newlib.
87RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
88RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
89RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
90RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
91
92# Newlib's unix/ directory
93AC_CHECK_FUNCS([ttyname getcwd])
94# </FIXME>
95
96## Check if the installed toolchain has these headers
97AC_CHECK_HEADERS([tar.h errno.h sched.h])
98
99## error out if libc doesn't provide stdint.h
100AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
101[AC_MSG_ERROR([Required header stdint.h not found])])
102
103## error out if libc doesn't provide inttypes.h
104AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
105[AC_MSG_ERROR([Required header inttypes.h not found])])
106
107## error out if libc doesn't provide errno.h
108AS_IF([test x"${ac_cv_header_errno_h}" != xyes],
109[AC_MSG_ERROR([Required header errno.h not found])])
110
111## error out if libc doesn't provide sched.h
112AS_IF([test x"${ac_cv_header_sched_h}" != xyes],
113[AC_MSG_ERROR([Required header sched.h not found])])
114
115## error out if libc doesn't provide tar.h
116AS_IF([test x"${ac_cv_header_tar_h}" != xyes],
117[AC_MSG_ERROR([Required header tar.h not found])])
118
119AC_HEADER_STDBOOL
120AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
121[AC_MSG_ERROR([No sufficient stdbool.h found])])
122
123AC_CHECK_TYPES([ uint8_t,  int8_t])
124AC_CHECK_TYPES([uint16_t, int16_t])
125AC_CHECK_TYPES([uint32_t, int32_t])
126AC_CHECK_TYPES([uint64_t, int64_t])
127AC_CHECK_TYPES([uintmax_t, intmax_t])
128AC_CHECK_TYPES([uintptr_t, intptr_t])
129
130# Some toolchain sanity checks and diagnostics
131RTEMS_CHECK_GCC_SANITY
132
133# These are conditionally defined by the toolchain
134# FIXME: we should either conditionally compile those parts in
135# RTEMS depending on them, or abort - For now, simply check.
136AC_CHECK_HEADER([pthread.h],[
137  AC_CHECK_TYPES([pthread_rwlock_t])
138  AC_CHECK_TYPES([pthread_barrier_t])
139  AC_CHECK_TYPES([pthread_spinlock_t])
140])
141
142AC_CHECK_HEADER([signal.h],[
143  AC_CHECK_TYPES([sighandler_t])
144])
145
146RTEMS_CHECK_MULTIPROCESSING
147RTEMS_CHECK_POSIX_API
148RTEMS_CHECK_NETWORKING
149
150rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
151rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
152rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
153
154## This is needed to generate the field offsets of the per CPU
155## data structure so they can be accessed from assembly code.
156AC_CHECK_SIZEOF([void *])
157
158_RTEMS_CPUOPT_INIT
159
160RTEMS_CPUOPT([RTEMS_DEBUG],
161  [test x"${enable_rtems_debug}" = x"yes"],
162  [1],
163  [if RTEMS_DEBUG is enabled])
164
165RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
166  [test x"$enable_multiprocessing" = xyes],
167  [1],
168  [if multiprocessing is enabled])
169
170RTEMS_CPUOPT([RTEMS_NEWLIB],
171  [test x"$RTEMS_USE_NEWLIB" = xyes],
172  [1],
173  [if using newlib])
174
175RTEMS_CPUOPT([RTEMS_POSIX_API],
176  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
177  [1],
178  [if posix api is supported])
179
180RTEMS_CPUOPT([RTEMS_NETWORKING],
181  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
182  [1],
183  [if networking is enabled])
184
185RTEMS_CPUOPT([RTEMS_VERSION],
186  [true],
187  ["]_RTEMS_VERSION["],
188  [RTEMS version string])
189
190RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
191  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
192  [1],
193  [disable nanosecond granularity for statistics])
194
195RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
196  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
197  [1],
198  [disable nanosecond granularity for cpu usage statistics])
199
200RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
201  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
202  [1],
203  [disable nanosecond granularity for period statistics])
204
205## This improves both the size and coverage analysis.
206RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
207  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
208  [1],
209  [disable inlining _Thread_Enable_dispatch])
210
211## This improves both the size and coverage analysis.
212RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
213  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
214  [1],
215  [disable inlining _Thread_Enable_dispatch])
216
217## This improves both the size and coverage analysis.
218RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
219  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
220  [1],
221  [disable inlining _Thread_queue_Enqueue_priority])
222
223## This gives the same behavior as 4.8 and older
224RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
225  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
226  [1],
227  [disable strict order mutex])
228
229## Deactivate ada bindings
230RTEMS_CPUOPT([__RTEMS_ADA__],
231  [test x"${enable_ada}" = x"yes"],
232  [1],
233  [Define to 1 if ada/gnat bindings are built-in])
234
235## Then we propagate a private copy of the value into cpuopts.h
236## so it is always available to the RTEMS header files.
237
238RTEMS_CPUOPT([__RTEMS_SIZEOF_VOID_P__],
239  [true],
240  [$ac_cv_sizeof_void_p],
241  [Size of a void * pointer])
242
243RTEMS_CPUOPT([__RTEMS_MAJOR__],
244  [true],
245  [$rtems_major],
246  [major version portion of an RTEMS release])
247
248RTEMS_CPUOPT([__RTEMS_MINOR__],
249  [true],
250  [$rtems_minor],
251  [minor version portion of an RTEMS release])
252
253RTEMS_CPUOPT([__RTEMS_REVISION__],
254  [true],
255  [$rtems_revision],
256  [revision version portion of an RTEMS release])
257
258_RTEMS_CPUOPT_FINI
259
260AC_ENABLE_MULTILIB([Makefile],[..])
261
262# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
263AC_MSG_CHECKING([for assignable stdio])
264AC_COMPILE_IFELSE(
265  [AC_LANG_PROGRAM(
266    [#include <stdio.h>],
267    [stdin = fopen("/tmp", "r")])],
268  [HAVE_ASSIGNABLE_STDIO=yes],
269  [HAVE_ASSIGNABLE_STDIO=no])
270AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
271
272# libmisc/serdbg exploits weak symbols
273RTEMS_CHECK_GCC_WEAK
274
275# FIXME: These checks are only in here to provide
276# configuration-time diagnostics and are not really used.
277AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
278AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
279
280# FIXME: We should get rid of this.
281# So far, only used in libfs/src/nfsclient/src/dirutils.c
282AC_CHECK_SIZEOF([mode_t])
283AC_CHECK_SIZEOF([off_t])
284
285# FIXME: Mandatory in SUSv4, optional in SUSv3.
286#   Not implemented in GCC/newlib, so far.
287AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
288AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
289
290## BSD-ism, excluded from POSIX, but available on most platforms
291AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
292
293## Check if libc provides BSD's strlcpy/strlcat
294AC_CHECK_FUNCS(strlcpy strlcat)
295
296# ... far too many conditionals ...
297AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
298AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
299
300AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
301
302AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
303AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
304
305AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
306AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
307AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
308&& test x"$enable_ada" = x"yes"])
309
310AM_CONDITIONAL([LIBDOSFS],[dnl
311test x"$ac_cv_type_uint8_t" = xyes \
312&& test x"$ac_cv_type_uint16_t" = xyes])
313
314AC_CONFIG_HEADER(config.h)
315
316## These are needed by the NFS Client
317AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
318AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
319&& test -n "$AWK" \
320&& test "$enable_rpcgen" = yes])
321
322RTEMS_AMPOLISH3
323
324# Explicitly list all Makefiles here
325AC_CONFIG_FILES([
326Doxyfile
327Makefile
328rtems/Makefile
329sapi/Makefile
330score/Makefile
331score/cpu/Makefile
332score/cpu/arm/Makefile
333score/cpu/bfin/Makefile
334score/cpu/avr/Makefile
335score/cpu/h8300/Makefile
336score/cpu/i386/Makefile
337score/cpu/lm32/Makefile
338score/cpu/m68k/Makefile
339score/cpu/m32c/Makefile
340score/cpu/m32r/Makefile
341score/cpu/mips/Makefile
342score/cpu/nios2/Makefile
343score/cpu/powerpc/Makefile
344score/cpu/sh/Makefile
345score/cpu/sparc/Makefile
346score/cpu/sparc64/Makefile
347score/cpu/no_cpu/Makefile
348posix/Makefile
349libblock/Makefile
350libfs/Makefile
351libfs/src/nfsclient/Makefile
352libgnat/Makefile
353libcsupport/Makefile
354libnetworking/Makefile
355librpc/Makefile
356libmisc/Makefile
357libi2c/Makefile
358libmd/Makefile
359zlib/Makefile
360ftpd/Makefile
361telnetd/Makefile
362pppd/Makefile
363mghttpd/Makefile
364wrapup/Makefile])
365
366AC_CONFIG_COMMANDS([preinstall-stamp],
367[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
368[MAKE=${MAKE}
369with_multisubdir="$with_multisubdir"])
370
371AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.