1 | ## Process this file with autoconf to produce a configure script. |
---|
2 | ## |
---|
3 | ## $Id$ |
---|
4 | |
---|
5 | AC_PREREQ(2.59) |
---|
6 | AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[rtems-bugs@rtems.com]) |
---|
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.9]) |
---|
13 | AM_MAINTAINER_MODE |
---|
14 | |
---|
15 | RTEMS_ENABLE_MULTILIB |
---|
16 | RTEMS_ENABLE_MULTIPROCESSING |
---|
17 | RTEMS_ENABLE_POSIX |
---|
18 | RTEMS_ENABLE_ITRON |
---|
19 | RTEMS_ENABLE_INLINES |
---|
20 | RTEMS_ENABLE_RTEMS_DEBUG |
---|
21 | RTEMS_ENABLE_NETWORKING |
---|
22 | |
---|
23 | RTEMS_ENV_RTEMSCPU |
---|
24 | RTEMS_CHECK_RTEMS_DEBUG |
---|
25 | |
---|
26 | # Is this a supported CPU? |
---|
27 | AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported]) |
---|
28 | if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then |
---|
29 | AC_MSG_RESULT(yes) |
---|
30 | else |
---|
31 | AC_MSG_ERROR(no) |
---|
32 | fi |
---|
33 | |
---|
34 | RTEMS_PROG_CC_FOR_TARGET([-fasm]) |
---|
35 | RTEMS_PROG_CCAS |
---|
36 | RTEMS_CANONICALIZE_TOOLS |
---|
37 | AM_PROG_CC_C_O |
---|
38 | AC_PROG_RANLIB |
---|
39 | |
---|
40 | # FIXME: For the moment, no reason to check for ada |
---|
41 | # RTEMS_PROG_GNAT |
---|
42 | |
---|
43 | RTEMS_CHECK_NEWLIB |
---|
44 | |
---|
45 | RTEMS_CHECK_MULTIPROCESSING |
---|
46 | RTEMS_CHECK_POSIX_API |
---|
47 | RTEMS_CHECK_ITRON_API |
---|
48 | RTEMS_CHECK_NETWORKING |
---|
49 | |
---|
50 | AS_IF([test x"$HAS_NETWORKING" = x"yes"],[ |
---|
51 | ## FIXME: Should better use a feature-based test |
---|
52 | AC_MSG_CHECKING([whether CPU supports librpc]) |
---|
53 | case "$RTEMS_CPU" in |
---|
54 | c4x ) LIBRPC=no;; |
---|
55 | or32 ) LIBRPC=no;; |
---|
56 | * ) LIBRPC=yes;; |
---|
57 | esac |
---|
58 | AC_MSG_RESULT([$LIBRPC]) |
---|
59 | ]) |
---|
60 | |
---|
61 | AC_ARG_ENABLE([ada], |
---|
62 | [AS_HELP_STRING(--enable-ada,enable ada support)], |
---|
63 | [case "${enable_ada}" in |
---|
64 | yes) ;; |
---|
65 | no) ;; |
---|
66 | *) AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;; |
---|
67 | esac],[enable_ada=no]) |
---|
68 | |
---|
69 | AC_ARG_ENABLE([deprecated], |
---|
70 | [AS_HELP_STRING(--enable-deprecated,allow using deprecated files)], |
---|
71 | [case "${enable_deprecated}" in |
---|
72 | yes) ;; |
---|
73 | no) ;; |
---|
74 | *) enable_deprecated=yes ;; |
---|
75 | esac],[enable_deprecated=yes]) |
---|
76 | AM_CONDITIONAL([DEPRECATED],[test "$enable_deprecated" = "yes"]) |
---|
77 | |
---|
78 | # HACK: We should use a feature-based configuration. |
---|
79 | AS_IF([test x"${RTEMS_CPU}" = x"unix"],[ |
---|
80 | # HACK: silently accept --enable-unixlib |
---|
81 | test -n "${enable_unixlib}" || enable_unixlib="yes" |
---|
82 | ]) |
---|
83 | |
---|
84 | # BSD-isms, used throughout the sources |
---|
85 | # Not really used by this configure script |
---|
86 | # FIXME: They should be eliminated if possible. |
---|
87 | AC_CHECK_FUNCS([strsep strcasecmp snprintf]) |
---|
88 | AC_CHECK_FUNCS([bcopy bcmp]) |
---|
89 | AC_CHECK_FUNCS([isascii fileno]) |
---|
90 | |
---|
91 | ## Check if the installed toolchain has these headers |
---|
92 | AC_CHECK_HEADER([stdint.h]) |
---|
93 | AC_CHECK_HEADER([inttypes.h]) |
---|
94 | |
---|
95 | ## if using newlib, we provide stdint.h and inttypes.h |
---|
96 | AM_CONDITIONAL([RTEMS_PROVIDES_STDINT_H],[test x"${RTEMS_USE_NEWLIB}" = xyes]) |
---|
97 | AM_CONDITIONAL([RTEMS_PROVIDES_INTTYPES_H],[test x"${RTEMS_USE_NEWLIB}" = xyes]) |
---|
98 | |
---|
99 | ## if using newlib, force using stdint.h |
---|
100 | AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes], |
---|
101 | [RTEMS_USES_STDINT_H=yes], |
---|
102 | [RTEMS_USES_STDINT_H=$ac_cv_header_stdint_h]) |
---|
103 | |
---|
104 | AS_IF([test x"${RTEMS_CPU}" = x"unix"],[ |
---|
105 | ## FIXME: This check is doubtful |
---|
106 | AS_IF([test "$HAS_MP" = "yes"], |
---|
107 | [RTEMS_CHECK_SYSV_UNIX]) |
---|
108 | |
---|
109 | ## The code fragment below had been used in tools/cpu/unix/gensize.c. |
---|
110 | ## FIXME: |
---|
111 | ## * The pad very likely is not necessary. |
---|
112 | AC_CHECK_SIZEOF([CPU_CONTEXT],[],[ |
---|
113 | #include <stdio.h> |
---|
114 | #include <setjmp.h> |
---|
115 | |
---|
116 | typedef struct { |
---|
117 | jmp_buf regs; |
---|
118 | int isr_level; |
---|
119 | int pad[4]; /* just in case */ |
---|
120 | } CPU_CONTEXT; |
---|
121 | ]) |
---|
122 | ]) |
---|
123 | |
---|
124 | cat >>cpuopts.tmp <<\_ACEOF |
---|
125 | /** |
---|
126 | * @file rtems/score/cpuopts.h |
---|
127 | */ |
---|
128 | /* target cpu dependent options file */ |
---|
129 | /* automatically generated -- DO NOT EDIT!! */ |
---|
130 | #ifndef __CPU_OPTIONS_h |
---|
131 | #define __CPU_OPTIONS_h |
---|
132 | _ACEOF |
---|
133 | |
---|
134 | RTEMS_CPUOPT([RTEMS_DEBUG], |
---|
135 | [test x"${enable_rtems_debug}" = x"yes"], |
---|
136 | [1], |
---|
137 | [if RTEMS_DEBUG is enabled]) |
---|
138 | |
---|
139 | RTEMS_CPUOPT([RTEMS_INLINES], |
---|
140 | [test x"${enable_rtems_inlines}" = x"yes"], |
---|
141 | [1], |
---|
142 | [if using inlines]) |
---|
143 | |
---|
144 | RTEMS_CPUOPT([RTEMS_ITRON_API], |
---|
145 | [test x"$rtems_cv_HAS_ITRON_API" = x"yes"], |
---|
146 | [1], |
---|
147 | [if itron api is supported]) |
---|
148 | |
---|
149 | RTEMS_CPUOPT([RTEMS_MULTIPROCESSING], |
---|
150 | [test x"$enable_multiprocessing" = x"yes"], |
---|
151 | [1], |
---|
152 | [if multiprocessing is enabled]) |
---|
153 | |
---|
154 | RTEMS_CPUOPT([RTEMS_NEWLIB], |
---|
155 | [test x"$RTEMS_USE_NEWLIB" = x"yes"], |
---|
156 | [1], |
---|
157 | [if using newlib]) |
---|
158 | |
---|
159 | RTEMS_CPUOPT([RTEMS_POSIX_API], |
---|
160 | [test x"$rtems_cv_HAS_POSIX_API" = x"yes"], |
---|
161 | [1], |
---|
162 | [if posix api is supported]) |
---|
163 | |
---|
164 | RTEMS_CPUOPT([RTEMS_UNIX], |
---|
165 | [test x"$RTEMS_CPU" = x"unix"], |
---|
166 | [1], |
---|
167 | [to indicate RTEMS unix]) |
---|
168 | |
---|
169 | RTEMS_CPUOPT([RTEMS_UNIXLIB], |
---|
170 | [test x"${enable_unixlib}" = x"yes"], |
---|
171 | [1], |
---|
172 | [to indicate RTEMS using RTEMS's unixlib]) |
---|
173 | |
---|
174 | RTEMS_CPUOPT([RTEMS_USES_STDINT_H], |
---|
175 | [test x"${RTEMS_USES_STDINT_H}" = x"yes"], |
---|
176 | [1], |
---|
177 | [if RTEMS uses stdint.h]) |
---|
178 | |
---|
179 | RTEMS_CPUOPT([RTEMS_VERSION], |
---|
180 | [true], |
---|
181 | ["]_RTEMS_VERSION["], |
---|
182 | [RTEMS version string]) |
---|
183 | |
---|
184 | RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT], |
---|
185 | [test x"$RTEMS_CPU" = x"unix"], |
---|
186 | [$ac_cv_sizeof_CPU_CONTEXT], |
---|
187 | [The size of a 'CPU_CONTEXT', as computed by sizeof]) |
---|
188 | |
---|
189 | cat >>cpuopts.tmp <<\_ACEOF |
---|
190 | |
---|
191 | #endif |
---|
192 | _ACEOF |
---|
193 | |
---|
194 | AS_MKDIR_P(score/include/rtems/score) |
---|
195 | AS_IF([test -f score/include/rtems/score/cpuopts.h], |
---|
196 | [ |
---|
197 | AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null], |
---|
198 | [ |
---|
199 | AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged]) |
---|
200 | rm -f cpuopts.tmp |
---|
201 | ],[ |
---|
202 | AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) |
---|
203 | rm -f score/include/rtems/score/cpuopts.h |
---|
204 | mv cpuopts.tmp score/include/rtems/score/cpuopts.h |
---|
205 | ]) |
---|
206 | ],[ |
---|
207 | AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) |
---|
208 | rm -f score/include/rtems/score/cpuopts.h |
---|
209 | mv cpuopts.tmp score/include/rtems/score/cpuopts.h |
---|
210 | ]) |
---|
211 | |
---|
212 | AC_ENABLE_MULTILIB([Makefile],[..]) |
---|
213 | |
---|
214 | # libmisc/shell/* wants to assign file descriptors to stdio file descriptors. |
---|
215 | AC_MSG_CHECKING([for assignable stdio]) |
---|
216 | AC_COMPILE_IFELSE( |
---|
217 | [AC_LANG_PROGRAM( |
---|
218 | [#include <stdio.h>], |
---|
219 | [stdin = fopen("/tmp", "r")])], |
---|
220 | [HAVE_ASSIGNABLE_STDIO=yes], |
---|
221 | [HAVE_ASSIGNABLE_STDIO=no]) |
---|
222 | AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO]) |
---|
223 | |
---|
224 | # libmisc/serdbg exploits weak symbols |
---|
225 | RTEMS_CHECK_GCC_WEAK |
---|
226 | |
---|
227 | AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes]) |
---|
228 | AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes]) |
---|
229 | |
---|
230 | # FIXME: These checks are only in here to provide |
---|
231 | # configuration-time diagnostics and are not really used. |
---|
232 | AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>]) |
---|
233 | AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>]) |
---|
234 | |
---|
235 | ## BSD-ism, excluded from POSIX, but available on most platforms |
---|
236 | AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>]) |
---|
237 | |
---|
238 | ## Check if libc provides BSD's strlcpy/strlcat |
---|
239 | AC_CHECK_FUNCS(strlcpy strlcat) |
---|
240 | |
---|
241 | |
---|
242 | # ... far too many conditionals ... |
---|
243 | AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"]) |
---|
244 | AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"]) |
---|
245 | AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes") |
---|
246 | |
---|
247 | AM_CONDITIONAL(INLINE,test x"$enable_rtems_inlines" = x"yes" ) |
---|
248 | AM_CONDITIONAL(MACROS,test x"$enable_rtems_inlines" = x"no" ) |
---|
249 | AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" ) |
---|
250 | |
---|
251 | AM_CONDITIONAL(HAS_POSIX,test x"$rtems_cv_HAS_POSIX_API" = x"yes") |
---|
252 | AM_CONDITIONAL(HAS_ITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes") |
---|
253 | AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes") |
---|
254 | |
---|
255 | # FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't! |
---|
256 | AM_CONDITIONAL([LIBSCORECPU], |
---|
257 | [test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"]) |
---|
258 | |
---|
259 | AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \ |
---|
260 | && test x"$HAS_POSIX_API" = x"yes"]) |
---|
261 | |
---|
262 | AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"]) |
---|
263 | AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"]) |
---|
264 | |
---|
265 | AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"]) |
---|
266 | AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"]) |
---|
267 | |
---|
268 | AC_CONFIG_HEADER(config.h) |
---|
269 | |
---|
270 | # Explicitly list all Makefiles here |
---|
271 | AC_CONFIG_FILES([ |
---|
272 | Makefile |
---|
273 | ada/Makefile |
---|
274 | rtems/Makefile |
---|
275 | sapi/Makefile |
---|
276 | score/Makefile |
---|
277 | score/cpu/Makefile |
---|
278 | score/cpu/arm/Makefile |
---|
279 | score/cpu/avr/Makefile |
---|
280 | score/cpu/c4x/Makefile |
---|
281 | score/cpu/h8300/Makefile |
---|
282 | score/cpu/i386/Makefile |
---|
283 | score/cpu/m68k/Makefile |
---|
284 | score/cpu/mips/Makefile |
---|
285 | score/cpu/or32/Makefile |
---|
286 | score/cpu/powerpc/Makefile |
---|
287 | score/cpu/sh/Makefile |
---|
288 | score/cpu/sparc/Makefile |
---|
289 | score/cpu/unix/Makefile |
---|
290 | score/cpu/no_cpu/Makefile |
---|
291 | posix/Makefile |
---|
292 | itron/Makefile |
---|
293 | libblock/Makefile |
---|
294 | libfs/Makefile |
---|
295 | libcsupport/Makefile |
---|
296 | libnetworking/Makefile |
---|
297 | librpc/Makefile |
---|
298 | libmisc/Makefile |
---|
299 | httpd/Makefile |
---|
300 | |
---|
301 | wrapup/Makefile |
---|
302 | ]) |
---|
303 | |
---|
304 | AC_OUTPUT |
---|