source: rtems/cpukit/configure.ac @ 8ee3775

4.115
Last change on this file since 8ee3775 was 8ee3775, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/02/11 at 15:01:43

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

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