source: rtems/cpukit/configure.ac @ cd001e5

4.104.115
Last change on this file since cd001e5 was cd001e5, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/14/09 at 12:30:10

Remove enable-unixlib.

  • 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# 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
60# Newlib's unix/ directory
61AC_CHECK_FUNCS([ttyname getcwd])
62# </FIXME>
63
64## Check if the installed toolchain has these headers
65AC_CHECK_HEADERS([tar.h errno.h])
66
67## error out if libc doesn't provide stdint.h
68AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
69[AC_MSG_ERROR([Required header stdint.h not found])])
70
71## error out if libc doesn't provide inttypes.h
72AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
73[AC_MSG_ERROR([Required header inttypes.h not found])])
74
75## error out if libc doesn't provide errno.h
76AS_IF([test x"${ac_cv_header_errno_h}" != xyes],
77[AC_MSG_ERROR([Required header errno.h not found])])
78
79AC_HEADER_STDBOOL
80AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
81[AC_MSG_ERROR([No sufficient stdbool.h found])])
82
83AC_CHECK_TYPES([ uint8_t,  int8_t])
84AC_CHECK_TYPES([uint16_t, int16_t])
85AC_CHECK_TYPES([uint32_t, int32_t])
86AC_CHECK_TYPES([uint64_t, int64_t])
87AC_CHECK_TYPES([uintmax_t, intmax_t])
88AC_CHECK_TYPES([uintptr_t, intptr_t])
89
90AC_CACHE_CHECK([if PRIxPTR works],
91[rtems_cv_PRIxPTR],[
92  AS_IF([test x"$GCC" = xyes],[
93    save_CFLAGS=$CFLAGS
94    CFLAGS=-Werror])
95
96  AC_COMPILE_IFELSE([
97    AC_LANG_PROGRAM([
98      #include <inttypes.h>
99      #include <stdio.h>
100    ],[
101      void *ptr;
102      printf("%" PRIxPTR "\n", (intptr_t) ptr);
103    ])],
104    [rtems_cv_PRIxPTR=yes],
105    [rtems_cv_PRIxPTR=no])
106
107  AS_IF([test x"$GCC" = xyes],[
108    CFLAGS=$save_CFLAGS])
109])
110
111# These are conditionally defined by the toolchain
112# FIXME: we should either conditionally compile those parts in
113# RTEMS depending on them, or abort - For now, simply check.
114AC_CHECK_HEADER([pthread.h],[
115  AC_CHECK_TYPES([pthread_rwlock_t])
116  AC_CHECK_TYPES([pthread_barrier_t])
117  AC_CHECK_TYPES([pthread_spinlock_t])
118])
119
120RTEMS_CHECK_MULTIPROCESSING
121RTEMS_CHECK_POSIX_API
122RTEMS_CHECK_ITRON_API
123RTEMS_CHECK_NETWORKING
124
125AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
126[RTEMS_USES_TAR_H=yes],
127[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
128
129AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
130## FIXME: This check is doubtful
131AS_IF([test "$HAS_MP" = "yes"],
132  [RTEMS_CHECK_SYSV_UNIX])
133
134## The code fragment below had been used in tools/cpu/unix/gensize.c.
135AC_CHECK_SIZEOF([CPU_CONTEXT],[],[
136#include <stdio.h>
137#include <setjmp.h>
138
139typedef struct {
140  jmp_buf     regs;
141  int         isr_level;
142} CPU_CONTEXT;
143])
144])
145
146rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
147rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
148rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
149
150_RTEMS_CPUOPT_INIT
151
152RTEMS_CPUOPT([RTEMS_DEBUG],
153  [test x"${enable_rtems_debug}" = x"yes"],
154  [1],
155  [if RTEMS_DEBUG is enabled])
156
157RTEMS_CPUOPT([RTEMS_ITRON_API],
158  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
159  [1],
160  [if itron api is supported])
161
162RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
163  [test x"$enable_multiprocessing" = xyes],
164  [1],
165  [if multiprocessing is enabled])
166
167RTEMS_CPUOPT([RTEMS_NEWLIB],
168  [test x"$RTEMS_USE_NEWLIB" = xyes],
169  [1],
170  [if using newlib])
171
172RTEMS_CPUOPT([RTEMS_POSIX_API],
173  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
174  [1],
175  [if posix api is supported])
176
177RTEMS_CPUOPT([RTEMS_NETWORKING],
178  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
179  [1],
180  [if networking is enabled])
181
182RTEMS_CPUOPT([RTEMS_UNIX],
183  [test x"$RTEMS_CPU" = xunix],
184  [1],
185  [to indicate RTEMS unix])
186
187RTEMS_CPUOPT([RTEMS_UNIXLIB],
188  [test x"${enable_unixlib}" = xyes],
189  [1],
190  [to indicate RTEMS using RTEMS's unixlib])
191
192RTEMS_CPUOPT([RTEMS_USES_TAR_H],
193  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
194  [1],
195  [if RTEMS uses tar.h])
196
197RTEMS_CPUOPT([RTEMS_VERSION],
198  [true],
199  ["]_RTEMS_VERSION["],
200  [RTEMS version string])
201
202RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
203  [test x"$RTEMS_CPU" = x"unix"],
204  [$ac_cv_sizeof_CPU_CONTEXT],
205  [The size of a 'CPU_CONTEXT', as computed by sizeof])
206
207RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
208  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
209  [1],
210  [disable nanosecond granularity for cpu usage statistics])
211
212RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
213  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
214  [1],
215  [disable nanosecond granularity for period statistics])
216
217## This improves both the size and coverage analysis.
218RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
219  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
220  [1],
221  [disable inlining _Thread_Enable_dispatch])
222
223## This improves both the size and coverage analysis.
224RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
225  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = 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_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
231  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
232  [1],
233  [disable inlining _Thread_queue_Enqueue_priority])
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/no_cpu/Makefile
354posix/Makefile
355itron/Makefile
356libblock/Makefile
357libfs/Makefile
358libfs/src/nfsclient/Makefile
359libgnat/Makefile
360libcsupport/Makefile
361libnetworking/Makefile
362librpc/Makefile
363libmisc/Makefile
364libi2c/Makefile
365libmd/Makefile
366zlib/Makefile
367httpd/Makefile
368ftpd/Makefile
369telnetd/Makefile
370pppd/Makefile
371shttpd/Makefile
372wrapup/Makefile])
373
374AC_CONFIG_COMMANDS([preinstall-stamp],
375[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
376[MAKE=${MAKE}
377with_multisubdir="$with_multisubdir"])
378
379AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.