source: rtems/cpukit/configure.ac @ 68cd765

4.115
Last change on this file since 68cd765 was 21d9736, checked in by Ralf Corsepius <ralf.corsepius@…>, on 05/29/10 at 02:31:09

2010-05-29 Ralf Corsépius <ralf.corsepius@…>

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