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