source: rtems/cpukit/configure.ac @ 632e4306

4.104.115
Last change on this file since 632e4306 was 3a08272, checked in by Joel Sherrill <joel.sherrill@…>, on 07/10/09 at 20:32:48

2009-07-10 Joel Sherrill <joel.sherrill@…>

  • configure.ac, score/src/threadqenqueuepriority.c: Add RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY to give user ability to disable the loop in _Thread_queue_Enqueue_priority from being unrolled. This reduces code size and makes coverage analysis easier.
  • Property mode set to 100644
File size: 10.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([-fasm])
34RTEMS_PROG_CCAS
35RTEMS_CANONICALIZE_TOOLS
36AM_PROG_CC_C_O
37AC_PROG_RANLIB
38
39RTEMS_CHECK_NEWLIB
40
41# HACK: We should use a feature-based configuration.
42AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
43# HACK: silently accept --enable-unixlib
44  test -n "${enable_unixlib}" || enable_unixlib="yes"
45])
46
47# BSD-isms, used throughout the sources
48# Not really used by this configure script
49# FIXME: They should be eliminated if possible.
50AC_CHECK_FUNCS([strsep strcasecmp snprintf])
51AC_CHECK_FUNCS([strdup strndup strncasecmp])
52AC_CHECK_FUNCS([bcopy bcmp])
53AC_CHECK_FUNCS([isascii fileno])
54
55# <FIXME>
56#   Check for functions supplied by newlib >= 1.17.0
57# Newlib's posix/ directory
58AC_CHECK_FUNCS([sleep usleep \
59  opendir closedir readdir readdir_r \
60  rewinddir scandir seekdir telldir isatty])
61AC_CHECK_FUNCS([creat])
62AC_CHECK_FUNCS([__assert])
63AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
64AC_CHECK_FUNCS([regcomp regexec regerror regfree])
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])
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
85AC_HEADER_STDBOOL
86AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
87[AC_MSG_ERROR([No sufficient stdbool.h found])])
88
89AC_CHECK_TYPES([ uint8_t,  int8_t])
90AC_CHECK_TYPES([uint16_t, int16_t])
91AC_CHECK_TYPES([uint32_t, int32_t])
92AC_CHECK_TYPES([uint64_t, int64_t])
93AC_CHECK_TYPES([uintmax_t, intmax_t])
94AC_CHECK_TYPES([uintptr_t, intptr_t])
95
96AC_CACHE_CHECK([if PRIxPTR works],
97[rtems_cv_PRIxPTR],[
98  AS_IF([test x"$GCC" = xyes],[
99    save_CFLAGS=$CFLAGS
100    CFLAGS=-Werror])
101
102  AC_COMPILE_IFELSE([
103    AC_LANG_PROGRAM([
104      #include <inttypes.h>
105      #include <stdio.h>
106    ],[
107      void *ptr;
108      printf("%" PRIxPTR "\n", (intptr_t) ptr);
109    ])],
110    [rtems_cv_PRIxPTR=yes],
111    [rtems_cv_PRIxPTR=no])
112
113  AS_IF([test x"$GCC" = xyes],[
114    CFLAGS=$save_CFLAGS])
115])
116
117# These are conditionally defined by the toolchain
118# FIXME: we should either conditionally compile those parts in
119# RTEMS depending on them, or abort - For now, simply check.
120AC_CHECK_HEADER([pthread.h],[
121  AC_CHECK_TYPES([pthread_rwlock_t])
122  AC_CHECK_TYPES([pthread_barrier_t])
123  AC_CHECK_TYPES([pthread_spinlock_t])
124])
125
126RTEMS_CHECK_MULTIPROCESSING
127RTEMS_CHECK_POSIX_API
128RTEMS_CHECK_ITRON_API
129RTEMS_CHECK_NETWORKING
130
131AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
132[RTEMS_USES_TAR_H=yes],
133[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
134
135AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
136## FIXME: This check is doubtful
137AS_IF([test "$HAS_MP" = "yes"],
138  [RTEMS_CHECK_SYSV_UNIX])
139
140## The code fragment below had been used in tools/cpu/unix/gensize.c.
141AC_CHECK_SIZEOF([CPU_CONTEXT],[],[
142#include <stdio.h>
143#include <setjmp.h>
144
145typedef struct {
146  jmp_buf     regs;
147  int         isr_level;
148} CPU_CONTEXT;
149])
150])
151
152rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
153rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
154rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
155
156_RTEMS_CPUOPT_INIT
157
158RTEMS_CPUOPT([RTEMS_DEBUG],
159  [test x"${enable_rtems_debug}" = x"yes"],
160  [1],
161  [if RTEMS_DEBUG is enabled])
162
163RTEMS_CPUOPT([RTEMS_ITRON_API],
164  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
165  [1],
166  [if itron api is supported])
167
168RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
169  [test x"$enable_multiprocessing" = xyes],
170  [1],
171  [if multiprocessing is enabled])
172
173RTEMS_CPUOPT([RTEMS_NEWLIB],
174  [test x"$RTEMS_USE_NEWLIB" = xyes],
175  [1],
176  [if using newlib])
177
178RTEMS_CPUOPT([RTEMS_POSIX_API],
179  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
180  [1],
181  [if posix api is supported])
182
183RTEMS_CPUOPT([RTEMS_NETWORKING],
184  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
185  [1],
186  [if networking is enabled])
187
188RTEMS_CPUOPT([RTEMS_UNIX],
189  [test x"$RTEMS_CPU" = xunix],
190  [1],
191  [to indicate RTEMS unix])
192
193RTEMS_CPUOPT([RTEMS_UNIXLIB],
194  [test x"${enable_unixlib}" = xyes],
195  [1],
196  [to indicate RTEMS using RTEMS's unixlib])
197
198RTEMS_CPUOPT([RTEMS_USES_TAR_H],
199  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
200  [1],
201  [if RTEMS uses tar.h])
202
203RTEMS_CPUOPT([RTEMS_VERSION],
204  [true],
205  ["]_RTEMS_VERSION["],
206  [RTEMS version string])
207
208RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
209  [test x"$RTEMS_CPU" = x"unix"],
210  [$ac_cv_sizeof_CPU_CONTEXT],
211  [The size of a 'CPU_CONTEXT', as computed by sizeof])
212
213RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
214  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
215  [1],
216  [disable nanosecond granularity for cpu usage statistics])
217
218RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
219  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
220  [1],
221  [disable nanosecond granularity for period statistics])
222
223## This improves both the size and coverage analysis.
224RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
225  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
226  [1],
227  [disable inlining _Thread_Enable_dispatch])
228
229## This improves both the size and coverage analysis.
230RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
231  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
232  [1],
233  [disable inlining _Thread_Enable_dispatch])
234
235## This improves both the size and coverage analysis.
236RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
237  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
238  [1],
239  [disable inlining _Thread_queue_Enqueue_priority])
240
241## This gives the same behavior as 4.8 and older
242RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
243  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
244  [1],
245  [disable strict order mutex])
246
247## Deactivate ada bindings
248RTEMS_CPUOPT([__RTEMS_ADA__],
249  [test x"${enable_ada}" = x"yes"],
250  [1],
251  [Define to 1 if ada/gnat bindings are built-in])
252
253RTEMS_CPUOPT([__RTEMS_MAJOR__],
254  [true],
255  [$rtems_major],
256  [major version portion of an RTEMS release])
257
258RTEMS_CPUOPT([__RTEMS_MINOR__],
259  [true],
260  [$rtems_minor],
261  [minor version portion of an RTEMS release])
262
263RTEMS_CPUOPT([__RTEMS_REVISION__],
264  [true],
265  [$rtems_revision],
266  [revision version portion of an RTEMS release])
267
268_RTEMS_CPUOPT_FINI
269
270AC_ENABLE_MULTILIB([Makefile],[..])
271
272# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
273AC_MSG_CHECKING([for assignable stdio])
274AC_COMPILE_IFELSE(
275  [AC_LANG_PROGRAM(
276    [#include <stdio.h>],
277    [stdin = fopen("/tmp", "r")])],
278  [HAVE_ASSIGNABLE_STDIO=yes],
279  [HAVE_ASSIGNABLE_STDIO=no])
280AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
281
282# libmisc/serdbg exploits weak symbols
283RTEMS_CHECK_GCC_WEAK
284
285AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
286AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
287
288# FIXME: These checks are only in here to provide
289# configuration-time diagnostics and are not really used.
290AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
291AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
292
293## BSD-ism, excluded from POSIX, but available on most platforms
294AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
295
296## Check if libc provides BSD's strlcpy/strlcat
297AC_CHECK_FUNCS(strlcpy strlcat)
298
299
300# ... far too many conditionals ...
301AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
302AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
303AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
304
305AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
306
307AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
308AM_CONDITIONAL(LIBPOSIX,test x"${RTEMS_CPU}" != x"unix")
309AM_CONDITIONAL(LIBITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
310AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
311
312AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
313AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
314
315AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes" \
316&& test x"${RTEMS_CPU}" != x"unix"])
317AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
318AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
319&& test x"$enable_ada" = x"yes"])
320
321AM_CONDITIONAL([LIBDOSFS],[dnl
322test x"${RTEMS_CPU}" != x"unix" \
323&& test x"$ac_cv_type_uint8_t" = xyes \
324&& test x"$ac_cv_type_uint16_t" = xyes])
325
326AC_CONFIG_HEADER(config.h)
327
328## These are needed by the NFS Client
329AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
330AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
331&& test -n "$AWK" \
332&& test "$enable_rpcgen" = yes])
333
334RTEMS_AMPOLISH3
335
336# Explicitly list all Makefiles here
337AC_CONFIG_FILES([
338Doxyfile
339Makefile
340rtems/Makefile
341sapi/Makefile
342score/Makefile
343score/cpu/Makefile
344score/cpu/arm/Makefile
345score/cpu/bfin/Makefile
346score/cpu/avr/Makefile
347score/cpu/c4x/Makefile
348score/cpu/h8300/Makefile
349score/cpu/i386/Makefile
350score/cpu/lm32/Makefile
351score/cpu/m68k/Makefile
352score/cpu/m32c/Makefile
353score/cpu/m32r/Makefile
354score/cpu/mips/Makefile
355score/cpu/nios2/Makefile
356score/cpu/powerpc/Makefile
357score/cpu/sh/Makefile
358score/cpu/sparc/Makefile
359score/cpu/unix/Makefile
360score/cpu/no_cpu/Makefile
361posix/Makefile
362itron/Makefile
363libblock/Makefile
364libfs/Makefile
365libfs/src/nfsclient/Makefile
366libgnat/Makefile
367libcsupport/Makefile
368libnetworking/Makefile
369librpc/Makefile
370libmisc/Makefile
371libi2c/Makefile
372libmd/Makefile
373zlib/Makefile
374httpd/Makefile
375ftpd/Makefile
376telnetd/Makefile
377pppd/Makefile
378shttpd/Makefile
379wrapup/Makefile])
380
381AC_CONFIG_COMMANDS([preinstall-stamp],
382[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
383[MAKE=${MAKE}
384with_multisubdir="$with_multisubdir"])
385
386AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.