source: rtems/cpukit/configure.ac @ 2c0450cb

4.104.11
Last change on this file since 2c0450cb was 2c0450cb, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 12, 2010 at 6:27:18 AM

2010-04-12 Ralf Corsépius <ralf.corsepius@…>

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