source: rtems/cpukit/configure.ac @ 1908a5f

4.115
Last change on this file since 1908a5f was 1908a5f, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/09/10 at 05:48:04

2010-06-09 Ralf Corsépius <ralf.corsepius@…>

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