source: rtems/cpukit/configure.ac @ 6ffaeb28

4.11
Last change on this file since 6ffaeb28 was 6ffaeb28, checked in by Philipp Eppelt <philipp.eppelt@…>, on Nov 27, 2013 at 6:00:20 PM

add --enable-paravirt in cpukit configure scripts

  • Property mode set to 100644
File size: 11.8 KB
Line 
1## Process this file with autoconf to produce a configure script.
2
3AC_PREREQ([2.69])
4AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
5AC_CONFIG_SRCDIR([score])
6RTEMS_TOP([..],[])
7
8RTEMS_CANONICAL_TARGET_CPU
9
10AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.12.2])
11AM_MAINTAINER_MODE
12
13RTEMS_ENABLE_MULTILIB
14RTEMS_ENABLE_MULTIPROCESSING
15RTEMS_ENABLE_POSIX
16RTEMS_ENABLE_RTEMS_DEBUG
17RTEMS_ENABLE_NETWORKING
18RTEMS_ENABLE_PARAVIRT
19
20RTEMS_ENV_RTEMSCPU
21RTEMS_CHECK_RTEMS_DEBUG
22
23# Is this a supported CPU?
24AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
25if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
26  AC_MSG_RESULT(yes)
27else
28  AC_MSG_ERROR(no)
29fi
30
31RTEMS_PROG_CC_FOR_TARGET
32RTEMS_PROG_CCAS
33RTEMS_CANONICALIZE_TOOLS
34AM_PROG_CC_C_O
35AC_PROG_RANLIB
36
37RTEMS_CHECK_NEWLIB
38
39# BSD-isms, used throughout the sources
40# Not really used by this configure script
41# FIXME: They should be eliminated if possible.
42AC_CHECK_FUNCS([strsep strcasecmp snprintf])
43AC_CHECK_FUNCS([strdup strndup strncasecmp])
44AC_CHECK_FUNCS([bcopy bcmp])
45AC_CHECK_FUNCS([isascii fileno])
46
47# <FIXME>
48#   Check for functions supplied by newlib >= 1.17.0
49# Newlib's posix/ directory
50AC_CHECK_FUNCS([readdir_r isatty])
51AC_CHECK_FUNCS([creat \
52  opendir closedir readdir rewinddir scandir seekdir \
53  sleep \
54  telldir \
55  usleep],,
56  [rtems_missing_func="$ac_func";break])
57AS_IF([test -n "$rtems_missing_func"],
58  AC_MSG_ERROR([Missing function $rtems_missing_func in libc])])
59AC_CHECK_FUNCS([__assert])
60AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
61AC_CHECK_FUNCS([regcomp regexec regerror regfree])
62
63# Mandated by POSIX, decls not present in some versions of newlib
64AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>])
65AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>])
66AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>])
67
68# Newlib proprietary
69AC_CHECK_HEADERS([envlock.h])
70AC_CHECK_DECLS([__env_lock],,,[#include <envlock.h>])
71AC_CHECK_DECLS([__env_unlock],,,[#include <envlock.h>])
72
73# Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME
74AC_CHECK_DECL([CLOCK_PROCESS_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_PROCESS_CPUTIME_ID])],[#include <time.h>])
75AC_CHECK_DECL([CLOCK_THREAD_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_THREAD_CPUTIME_ID])],[#include <time.h>])
76
77# Mandated by POSIX, decls not present in some versions of newlib,
78# some versions stubbed in newlib's rtems crt0
79RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>])
80RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>])
81RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>])
82RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>])
83RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>])
84RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>])
85RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>])
86RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>])
87RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>])
88RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>])
89RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>])
90RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>])
91RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>])
92RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>])
93
94# pthread-functions not declared in some versions of newlib.
95RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
96RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
97RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
98RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
99
100# Mandated by POSIX, not declared in some versions of newlib.
101AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
102
103# Newlib's unix/ directory
104AC_CHECK_FUNCS([ttyname getcwd])
105# </FIXME>
106
107# Check if the installed toolchain provides these headers
108# and error out if not.
109AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
110  [rtems_missing_header="$ac_header";break])
111AS_IF([test -n "$rtems_missing_header"],
112  AC_MSG_ERROR([Missing required header $rtems_missing_header])])
113
114## error out if libc doesn't provide stdint.h
115AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
116[AC_MSG_ERROR([Required header stdint.h not found])])
117
118## error out if libc doesn't provide inttypes.h
119AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
120[AC_MSG_ERROR([Required header inttypes.h not found])])
121
122AC_HEADER_STDBOOL
123AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
124[AC_MSG_ERROR([No sufficient stdbool.h found])])
125
126AC_CHECK_TYPES([ uint8_t,  int8_t])
127AC_CHECK_TYPES([uint16_t, int16_t])
128AC_CHECK_TYPES([uint32_t, int32_t])
129AC_CHECK_TYPES([uint64_t, int64_t])
130AC_CHECK_TYPES([uintmax_t, intmax_t])
131AC_CHECK_TYPES([uintptr_t, intptr_t])
132
133# Some toolchain sanity checks and diagnostics
134RTEMS_CHECK_GCC_SANITY
135
136# These are conditionally defined by the toolchain
137# FIXME: we should either conditionally compile those parts in
138# RTEMS depending on them, or abort - For now, simply check.
139AC_CHECK_HEADER([pthread.h],[
140  AC_CHECK_TYPES([pthread_rwlock_t])
141  AC_CHECK_TYPES([pthread_barrier_t])
142  AC_CHECK_TYPES([pthread_spinlock_t])
143])
144
145AC_CHECK_HEADER([signal.h],[
146  AC_CHECK_TYPES([sighandler_t])
147])
148
149RTEMS_CHECK_MULTIPROCESSING
150RTEMS_CHECK_POSIX_API
151RTEMS_CHECK_NETWORKING
152RTEMS_CHECK_SMP
153RTEMS_CHECK_ATOMIC
154
155rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
156rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
157rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
158
159_RTEMS_CPUOPT_INIT
160
161RTEMS_CPUOPT([RTEMS_DEBUG],
162  [test x"${enable_rtems_debug}" = x"yes"],
163  [1],
164  [if RTEMS_DEBUG is enabled])
165
166RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
167  [test x"$enable_multiprocessing" = xyes],
168  [1],
169  [if multiprocessing is enabled])
170
171RTEMS_CPUOPT([RTEMS_NEWLIB],
172  [test x"$RTEMS_USE_NEWLIB" = xyes],
173  [1],
174  [if using newlib])
175
176RTEMS_CPUOPT([RTEMS_POSIX_API],
177  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
178  [1],
179  [if posix api is supported])
180
181RTEMS_CPUOPT([RTEMS_SMP],
182  [test x"$RTEMS_HAS_SMP" = xyes],
183  [1],
184  [if SMP is enabled])
185
186RTEMS_CPUOPT([RTEMS_PARAVIRT],
187  [test x"$RTEMS_HAS_PARAVIRT" = xyes],
188  [1],
189  [PARAVIRT is enabled])
190
191RTEMS_CPUOPT([RTEMS_NETWORKING],
192  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
193  [1],
194  [if networking is enabled])
195
196RTEMS_CPUOPT([RTEMS_ATOMIC],
197  [test x"$rtems_cv_ATOMIC" = xyes],
198  [1],
199  [if cpu supports atomic operations])
200
201RTEMS_CPUOPT([RTEMS_VERSION],
202  [true],
203  ["]_RTEMS_VERSION["],
204  [RTEMS version string])
205
206RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
207  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
208  [1],
209  [disable nanosecond granularity for statistics])
210
211## This improves both the size and coverage analysis.
212RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
213  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
214  [1],
215  [disable inlining _Thread_Enable_dispatch])
216
217## This improves both the size and coverage analysis.
218RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
219  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = 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_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
225  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
226  [1],
227  [disable inlining _Thread_queue_Enqueue_priority])
228
229## This gives the same behavior as 4.8 and older
230RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
231  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
232  [1],
233  [disable strict order mutex])
234
235## Deactivate ada bindings
236RTEMS_CPUOPT([__RTEMS_ADA__],
237  [test x"${enable_ada}" = x"yes"],
238  [1],
239  [Define to 1 if ada/gnat bindings are built-in])
240
241## Then we propagate a private copy of the value into cpuopts.h
242## so it is always available to the RTEMS header files.
243
244RTEMS_CPUOPT([__RTEMS_MAJOR__],
245  [true],
246  [$rtems_major],
247  [major version portion of an RTEMS release])
248
249RTEMS_CPUOPT([__RTEMS_MINOR__],
250  [true],
251  [$rtems_minor],
252  [minor version portion of an RTEMS release])
253
254RTEMS_CPUOPT([__RTEMS_REVISION__],
255  [true],
256  [$rtems_revision],
257  [revision version portion of an RTEMS release])
258
259_RTEMS_CPUOPT_FINI
260
261AC_ENABLE_MULTILIB([Makefile],[..])
262
263# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
264AC_MSG_CHECKING([for assignable stdio])
265AC_COMPILE_IFELSE(
266  [AC_LANG_PROGRAM(
267    [#include <stdio.h>],
268    [stdin = fopen("/tmp", "r")])],
269  [HAVE_ASSIGNABLE_STDIO=yes],
270  [HAVE_ASSIGNABLE_STDIO=no])
271AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
272
273# libmisc/serdbg exploits weak symbols
274RTEMS_CHECK_GCC_WEAK
275
276# FIXME: These checks are only in here to provide
277# configuration-time diagnostics and are not really used.
278AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
279AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
280
281# FIXME: We should get rid of this.
282# So far, only used in libfs/src/nfsclient/src/dirutils.c
283AC_CHECK_SIZEOF([mode_t])
284AC_CHECK_SIZEOF([off_t])
285
286# FIXME: We should get rid of this. It's a cludge.
287AC_CHECK_SIZEOF([time_t])
288
289AC_CHECK_SIZEOF([size_t])
290
291# FIXME: Mandatory in SUSv4, optional in SUSv3.
292#   Not implemented in GCC/newlib, so far.
293AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
294AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
295
296## BSD-ism, excluded from POSIX, but available on most platforms
297AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
298AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
299
300## Check if libc provides BSD's strlcpy/strlcat
301AC_CHECK_FUNCS(strlcpy strlcat)
302
303## Check if libc provides decl of utime
304## FIXME: utime has been deprecated in SUSv4.
305##        and is likely to be removed in future versions.
306## FIXME (BUG in newlib): SUSv4 saids including <utime.h> should be sufficient.
307AC_CHECK_DECLS([utime],,,[#include <sys/types.h>
308#include <utime.h>])
309## Check if libc provides decl of utimes
310AC_CHECK_DECLS([utimes],,,[#include <sys/time.h>])
311
312# ... far too many conditionals ...
313AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
314AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
315
316AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
317AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
318
319AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
320AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
321AM_CONDITIONAL([ATOMIC],[test x"$rtems_cv_ATOMIC" = x"yes"])
322
323AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
324AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
325AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
326&& test x"$enable_ada" = x"yes"])
327
328AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
329
330AM_CONDITIONAL([LIBDOSFS],[dnl
331test x"$ac_cv_type_uint8_t" = xyes \
332&& test x"$ac_cv_type_uint16_t" = xyes])
333
334AC_CONFIG_HEADER(config.h)
335
336## These are needed by the NFS Client
337AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
338AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
339&& test -n "$AWK" \
340&& test "$enable_rpcgen" = yes])
341
342RTEMS_AMPOLISH3
343
344# Explicitly list all Makefiles here
345AC_CONFIG_FILES([
346Doxyfile
347Makefile
348rtems/Makefile
349sapi/Makefile
350score/Makefile
351score/cpu/Makefile
352score/cpu/arm/Makefile
353score/cpu/bfin/Makefile
354score/cpu/avr/Makefile
355score/cpu/h8300/Makefile
356score/cpu/i386/Makefile
357score/cpu/lm32/Makefile
358score/cpu/m68k/Makefile
359score/cpu/m32c/Makefile
360score/cpu/m32r/Makefile
361score/cpu/mips/Makefile
362score/cpu/moxie/Makefile
363score/cpu/nios2/Makefile
364score/cpu/powerpc/Makefile
365score/cpu/sh/Makefile
366score/cpu/sparc/Makefile
367score/cpu/sparc64/Makefile
368score/cpu/v850/Makefile
369score/cpu/no_cpu/Makefile
370posix/Makefile
371libblock/Makefile
372libfs/Makefile
373libfs/src/nfsclient/Makefile
374libgnat/Makefile
375libcsupport/Makefile
376libnetworking/Makefile
377librpc/Makefile
378libmisc/Makefile
379libi2c/Makefile
380libmd/Makefile
381zlib/Makefile
382ftpd/Makefile
383telnetd/Makefile
384pppd/Makefile
385mghttpd/Makefile
386wrapup/Makefile])
387
388AC_CONFIG_COMMANDS([preinstall-stamp],
389[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
390[MAKE=${MAKE}
391with_multisubdir="$with_multisubdir"])
392
393AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.