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

4.104.115
Last change on this file since 2aa8014 was 89ddf516, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/15/09 at 08:36:13

2009-04-15 Ralf Corsepius <ralf.corsepius@…>

  • configure.ac: Disable LIBSHELL for unix targets.
  • Property mode set to 100644
File size: 10.1 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 gives the same behavior as 4.8 and older
236RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
237  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
238  [1],
239  [disable strict order mutex])
240
241## Deactivate ada bindings
242RTEMS_CPUOPT([__RTEMS_ADA__],
243  [test x"${enable_ada}" = x"yes"],
244  [1],
245  [Define to 1 if ada/gnat bindings are built-in])
246
247RTEMS_CPUOPT([__RTEMS_MAJOR__],
248  [true],
249  [$rtems_major],
250  [major version portion of an RTEMS release])
251
252RTEMS_CPUOPT([__RTEMS_MINOR__],
253  [true],
254  [$rtems_minor],
255  [minor version portion of an RTEMS release])
256
257RTEMS_CPUOPT([__RTEMS_REVISION__],
258  [true],
259  [$rtems_revision],
260  [revision version portion of an RTEMS release])
261
262_RTEMS_CPUOPT_FINI
263
264AC_ENABLE_MULTILIB([Makefile],[..])
265
266# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
267AC_MSG_CHECKING([for assignable stdio])
268AC_COMPILE_IFELSE(
269  [AC_LANG_PROGRAM(
270    [#include <stdio.h>],
271    [stdin = fopen("/tmp", "r")])],
272  [HAVE_ASSIGNABLE_STDIO=yes],
273  [HAVE_ASSIGNABLE_STDIO=no])
274AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
275
276# libmisc/serdbg exploits weak symbols
277RTEMS_CHECK_GCC_WEAK
278
279AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
280AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
281
282# FIXME: These checks are only in here to provide
283# configuration-time diagnostics and are not really used.
284AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
285AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
286
287## BSD-ism, excluded from POSIX, but available on most platforms
288AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
289
290## Check if libc provides BSD's strlcpy/strlcat
291AC_CHECK_FUNCS(strlcpy strlcat)
292
293
294# ... far too many conditionals ...
295AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
296AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
297AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
298
299AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
300
301AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
302AM_CONDITIONAL(LIBPOSIX,test x"${RTEMS_CPU}" != x"unix")
303AM_CONDITIONAL(LIBITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
304AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
305
306AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
307AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
308
309AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes" \
310&& test x"${RTEMS_CPU}" != x"unix"])
311AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
312AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
313&& test x"$enable_ada" = x"yes"])
314
315AM_CONDITIONAL([LIBDOSFS],[dnl
316test x"${RTEMS_CPU}" != x"unix" \
317&& test x"$ac_cv_type_uint8_t" = xyes \
318&& test x"$ac_cv_type_uint16_t" = xyes])
319
320AC_CONFIG_HEADER(config.h)
321
322## These are needed by the NFS Client
323AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
324AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
325&& test -n "$AWK" \
326&& test "$enable_rpcgen" = yes])
327
328RTEMS_AMPOLISH3
329
330# Explicitly list all Makefiles here
331AC_CONFIG_FILES([
332Doxyfile
333Makefile
334rtems/Makefile
335sapi/Makefile
336score/Makefile
337score/cpu/Makefile
338score/cpu/arm/Makefile
339score/cpu/bfin/Makefile
340score/cpu/avr/Makefile
341score/cpu/c4x/Makefile
342score/cpu/h8300/Makefile
343score/cpu/i386/Makefile
344score/cpu/lm32/Makefile
345score/cpu/m68k/Makefile
346score/cpu/m32c/Makefile
347score/cpu/m32r/Makefile
348score/cpu/mips/Makefile
349score/cpu/nios2/Makefile
350score/cpu/powerpc/Makefile
351score/cpu/sh/Makefile
352score/cpu/sparc/Makefile
353score/cpu/unix/Makefile
354score/cpu/no_cpu/Makefile
355posix/Makefile
356itron/Makefile
357libblock/Makefile
358libfs/Makefile
359libfs/src/nfsclient/Makefile
360libgnat/Makefile
361libcsupport/Makefile
362libnetworking/Makefile
363librpc/Makefile
364libmisc/Makefile
365libi2c/Makefile
366libmd/Makefile
367zlib/Makefile
368httpd/Makefile
369ftpd/Makefile
370telnetd/Makefile
371pppd/Makefile
372shttpd/Makefile
373wrapup/Makefile])
374
375AC_CONFIG_COMMANDS([preinstall-stamp],
376[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
377[MAKE=${MAKE}
378with_multisubdir="$with_multisubdir"])
379
380AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.