source: rtems/cpukit/configure.ac @ d0279f6e

4.9
Last change on this file since d0279f6e was 26c4cb4, checked in by Joel Sherrill <joel.sherrill@…>, on 09/10/08 at 15:43:54

2008-09-10 Joel Sherrill <joel.sherrill@…>

  • configure.ac, aclocal/canonical-target-name.m4, score/cpu/Makefile.am: Remove TI C4x and NIOS2 ports from 4.9 branch.
  • Property mode set to 100644
File size: 9.6 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## Check if the installed toolchain has these headers
56AC_CHECK_HEADER([tar.h])
57
58## BSD-ism, should not be used in RTEMS,
59## nevertheless it still is.
60AC_CHECK_HEADER([sys/errno.h],[],
61  [AC_MSG_ERROR([Missing required header sys/errno.h])])
62
63## if libc provides stdint.h, use it.
64AS_IF([test x"${ac_cv_header_stdint_h}" = xyes],
65[RTEMS_USES_STDINT_H=yes],
66[RTEMS_USES_STDINT_H=no])
67
68## error out if libc doesn't at least provide inttypes.h
69AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
70[AC_MSG_ERROR([Required header inttypes.h not found])])
71
72AC_HEADER_STDBOOL
73AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
74[AC_MSG_ERROR([No sufficient stdbool.h found])])
75
76AC_CHECK_TYPES([ uint8_t,  int8_t])
77AC_CHECK_TYPES([uint16_t, int16_t])
78AC_CHECK_TYPES([uint32_t, int32_t])
79AC_CHECK_TYPES([uint64_t, int64_t])
80AC_CHECK_TYPES([uintmax_t, intmax_t])
81AC_CHECK_TYPES([uintptr_t, intptr_t])
82
83AC_CACHE_CHECK([if PRIxPTR works],
84[rtems_cv_PRIxPTR],[
85  AS_IF([test x"$GCC" = xyes],[
86    save_CFLAGS=$CFLAGS
87    CFLAGS=-Werror])
88
89  AC_COMPILE_IFELSE([
90    AC_LANG_PROGRAM([
91      #include <inttypes.h>
92      #include <stdio.h>
93    ],[
94      void *ptr;
95      printf("%" PRIxPTR "\n", (intptr_t) ptr);
96    ])],
97    [rtems_cv_PRIxPTR=yes],
98    [rtems_cv_PRIxPTR=no])
99
100  AS_IF([test x"$GCC" = xyes],[
101    CFLAGS=$save_CFLAGS])
102])
103
104# These are conditionally defined by the toolchain
105# FIXME: we should either conditionally compile those parts in
106# RTEMS depending on them, or abort - For now, simply check.
107AC_CHECK_HEADER([pthread.h],[
108  AC_CHECK_TYPES([pthread_rwlock_t])
109  AC_CHECK_TYPES([pthread_barrier_t])
110  AC_CHECK_TYPES([pthread_spinlock_t])
111])
112
113RTEMS_CHECK_MULTIPROCESSING
114RTEMS_CHECK_POSIX_API
115RTEMS_CHECK_ITRON_API
116RTEMS_CHECK_NETWORKING
117
118AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
119[RTEMS_USES_TAR_H=yes],
120[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
121
122AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
123## FIXME: This check is doubtful
124AS_IF([test "$HAS_MP" = "yes"],
125  [RTEMS_CHECK_SYSV_UNIX])
126
127## The code fragment below had been used in tools/cpu/unix/gensize.c.
128AC_CHECK_SIZEOF([CPU_CONTEXT],[],[
129#include <stdio.h>
130#include <setjmp.h>
131
132typedef struct {
133  jmp_buf     regs;
134  int         isr_level;
135} CPU_CONTEXT;
136])
137])
138
139rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
140rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
141rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
142
143_RTEMS_CPUOPT_INIT
144
145RTEMS_CPUOPT([RTEMS_DEBUG],
146  [test x"${enable_rtems_debug}" = x"yes"],
147  [1],
148  [if RTEMS_DEBUG is enabled])
149
150RTEMS_CPUOPT([RTEMS_ITRON_API],
151  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
152  [1],
153  [if itron api is supported])
154
155RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
156  [test x"$enable_multiprocessing" = xyes],
157  [1],
158  [if multiprocessing is enabled])
159
160RTEMS_CPUOPT([RTEMS_NEWLIB],
161  [test x"$RTEMS_USE_NEWLIB" = xyes],
162  [1],
163  [if using newlib])
164
165RTEMS_CPUOPT([RTEMS_POSIX_API],
166  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
167  [1],
168  [if posix api is supported])
169
170RTEMS_CPUOPT([RTEMS_NETWORKING],
171  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
172  [1],
173  [if networking is enabled])
174
175RTEMS_CPUOPT([RTEMS_UNIX],
176  [test x"$RTEMS_CPU" = xunix],
177  [1],
178  [to indicate RTEMS unix])
179
180RTEMS_CPUOPT([RTEMS_UNIXLIB],
181  [test x"${enable_unixlib}" = xyes],
182  [1],
183  [to indicate RTEMS using RTEMS's unixlib])
184
185RTEMS_CPUOPT([RTEMS_USES_STDINT_H],
186  [test x"${RTEMS_USES_STDINT_H}" = x"yes"],
187  [1],
188  [if RTEMS uses stdint.h])
189
190RTEMS_CPUOPT([RTEMS_USES_TAR_H],
191  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
192  [1],
193  [if RTEMS uses tar.h])
194
195RTEMS_CPUOPT([RTEMS_VERSION],
196  [true],
197  ["]_RTEMS_VERSION["],
198  [RTEMS version string])
199
200RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
201  [test x"$RTEMS_CPU" = x"unix"],
202  [$ac_cv_sizeof_CPU_CONTEXT],
203  [The size of a 'CPU_CONTEXT', as computed by sizeof])
204
205RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
206  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
207  [1],
208  [disable nanosecond granularity for cpu usage statistics])
209
210RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
211  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
212  [1],
213  [disable nanosecond granularity for period statistics])
214
215## This improves both the size and coverage analysis.
216RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
217  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
218  [1],
219  [disable inlining _Thread_Enable_dispatch])
220
221## This improves both the size and coverage analysis.
222RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
223  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
224  [1],
225  [disable inlining _Thread_Enable_dispatch])
226
227## This gives the same behavior as 4.8 and older
228RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
229  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
230  [1],
231  [disable strict order mutex])
232
233## Deactivate ada bindings
234RTEMS_CPUOPT([__RTEMS_ADA__],
235  [test x"${enable_ada}" = x"yes"],
236  [1],
237  [Define to 1 if ada/gnat bindings are built-in])
238
239RTEMS_CPUOPT([__RTEMS_MAJOR__],
240  [true],
241  [$rtems_major],
242  [major version portion of an RTEMS release])
243
244RTEMS_CPUOPT([__RTEMS_MINOR__],
245  [true],
246  [$rtems_minor],
247  [minor version portion of an RTEMS release])
248
249RTEMS_CPUOPT([__RTEMS_REVISION__],
250  [true],
251  [$rtems_revision],
252  [revision version portion of an RTEMS release])
253
254_RTEMS_CPUOPT_FINI
255
256AC_ENABLE_MULTILIB([Makefile],[..])
257
258# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
259AC_MSG_CHECKING([for assignable stdio])
260AC_COMPILE_IFELSE(
261  [AC_LANG_PROGRAM(
262    [#include <stdio.h>],
263    [stdin = fopen("/tmp", "r")])],
264  [HAVE_ASSIGNABLE_STDIO=yes],
265  [HAVE_ASSIGNABLE_STDIO=no])
266AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
267
268# libmisc/serdbg exploits weak symbols
269RTEMS_CHECK_GCC_WEAK
270
271AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
272AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
273
274# FIXME: These checks are only in here to provide
275# configuration-time diagnostics and are not really used.
276AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
277AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
278
279## BSD-ism, excluded from POSIX, but available on most platforms
280AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
281
282## Check if libc provides BSD's strlcpy/strlcat
283AC_CHECK_FUNCS(strlcpy strlcat)
284
285
286# ... far too many conditionals ...
287AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
288AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
289AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
290
291AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
292
293AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
294AM_CONDITIONAL(LIBPOSIX,test x"${RTEMS_CPU}" != x"unix")
295AM_CONDITIONAL(LIBITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
296AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
297
298AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
299AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
300
301AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
302AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
303AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
304&& test x"$enable_ada" = x"yes"])
305
306AM_CONDITIONAL([LIBDOSFS],[dnl
307test x"${RTEMS_CPU}" != x"unix" \
308&& test x"$ac_cv_type_uint8_t" = xyes \
309&& test x"$ac_cv_type_uint16_t" = xyes])
310
311AC_CONFIG_HEADER(config.h)
312
313## These are needed by the NFS Client
314AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
315AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
316&& test -n "$AWK" \
317&& test "$enable_rpcgen" = yes])
318
319RTEMS_AMPOLISH3
320
321# Explicitly list all Makefiles here
322AC_CONFIG_FILES([
323Makefile
324rtems/Makefile
325sapi/Makefile
326score/Makefile
327score/cpu/Makefile
328score/cpu/arm/Makefile
329score/cpu/bfin/Makefile
330score/cpu/avr/Makefile
331score/cpu/h8300/Makefile
332score/cpu/i386/Makefile
333score/cpu/m68k/Makefile
334score/cpu/mips/Makefile
335score/cpu/powerpc/Makefile
336score/cpu/sh/Makefile
337score/cpu/sparc/Makefile
338score/cpu/unix/Makefile
339score/cpu/no_cpu/Makefile
340posix/Makefile
341itron/Makefile
342libblock/Makefile
343libfs/Makefile
344libfs/src/nfsclient/Makefile
345libgnat/Makefile
346libcsupport/Makefile
347libnetworking/Makefile
348librpc/Makefile
349libmisc/Makefile
350libi2c/Makefile
351libmd/Makefile
352zlib/Makefile
353httpd/Makefile
354ftpd/Makefile
355telnetd/Makefile
356pppd/Makefile
357shttpd/Makefile
358wrapup/Makefile])
359
360AC_CONFIG_COMMANDS([preinstall-stamp],
361[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
362[MAKE=${MAKE}
363with_multisubdir="$with_multisubdir"])
364
365AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.