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

4.115
Last change on this file since 6ffaeb28 was 6ffaeb28, checked in by Philipp Eppelt <philipp.eppelt@…>, on 11/27/13 at 18:00:20

add --enable-paravirt in cpukit configure scripts

  • Property mode set to 100644
File size: 11.8 KB
RevLine 
[66387986]1## Process this file with autoconf to produce a configure script.
[eb299afc]2
[0f77281]3AC_PREREQ([2.69])
[fcb0cd46]4AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
[66387986]5AC_CONFIG_SRCDIR([score])
[2f4c86f]6RTEMS_TOP([..],[])
[eb299afc]7
8RTEMS_CANONICAL_TARGET_CPU
9
[bb2b825]10AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.12.2])
[eb299afc]11AM_MAINTAINER_MODE
[04e6f7bf]12
13RTEMS_ENABLE_MULTILIB
[eb299afc]14RTEMS_ENABLE_MULTIPROCESSING
15RTEMS_ENABLE_POSIX
[39607984]16RTEMS_ENABLE_RTEMS_DEBUG
[3e39b47]17RTEMS_ENABLE_NETWORKING
[6ffaeb28]18RTEMS_ENABLE_PARAVIRT
[eb299afc]19
[04e6f7bf]20RTEMS_ENV_RTEMSCPU
[39607984]21RTEMS_CHECK_RTEMS_DEBUG
[eb299afc]22
[5b2e199]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
[955c499d]31RTEMS_PROG_CC_FOR_TARGET
[10ae124c]32RTEMS_PROG_CCAS
[eb299afc]33RTEMS_CANONICALIZE_TOOLS
[e7d110ba]34AM_PROG_CC_C_O
[e73e576]35AC_PROG_RANLIB
[eb299afc]36
37RTEMS_CHECK_NEWLIB
38
[b422de6c]39# BSD-isms, used throughout the sources
40# Not really used by this configure script
41# FIXME: They should be eliminated if possible.
[85956f9]42AC_CHECK_FUNCS([strsep strcasecmp snprintf])
[31903f07]43AC_CHECK_FUNCS([strdup strndup strncasecmp])
[b422de6c]44AC_CHECK_FUNCS([bcopy bcmp])
45AC_CHECK_FUNCS([isascii fileno])
[f31a078]46
[e83a477]47# <FIXME>
48#   Check for functions supplied by newlib >= 1.17.0
49# Newlib's posix/ directory
[f154804]50AC_CHECK_FUNCS([readdir_r isatty])
[0111c50]51AC_CHECK_FUNCS([creat \
[f154804]52  opendir closedir readdir rewinddir scandir seekdir \
53  sleep \
54  telldir \
55  usleep],,
[bbc1a10]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])])
[d020f6f]59AC_CHECK_FUNCS([__assert])
[e83a477]60AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
61AC_CHECK_FUNCS([regcomp regexec regerror regfree])
[8682da39]62
63# Mandated by POSIX, decls not present in some versions of newlib
[2c0450cb]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>])
[f4cc6c5]67
[b317c391]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
[7383b644]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
[2f797d0]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>])
[8682da39]93
[199296db]94# pthread-functions not declared in some versions of newlib.
[e76a477]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>])
[199296db]99
[6649644]100# Mandated by POSIX, not declared in some versions of newlib.
101AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
102
[f4cc6c5]103# Newlib's unix/ directory
104AC_CHECK_FUNCS([ttyname getcwd])
[e83a477]105# </FIXME>
[f4cc6c5]106
[36d9f42f]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])])
[bffdb82]113
[85c429b]114## error out if libc doesn't provide stdint.h
[52a634e9]115AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
116[AC_MSG_ERROR([Required header stdint.h not found])])
[d62a2e0]117
[85c429b]118## error out if libc doesn't provide inttypes.h
[d62a2e0]119AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
120[AC_MSG_ERROR([Required header inttypes.h not found])])
[ec75ddc]121
[17ed18c0]122AC_HEADER_STDBOOL
[19b9991]123AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
124[AC_MSG_ERROR([No sufficient stdbool.h found])])
[17ed18c0]125
[bfe2fd3]126AC_CHECK_TYPES([ uint8_t,  int8_t])
127AC_CHECK_TYPES([uint16_t, int16_t])
128AC_CHECK_TYPES([uint32_t, int32_t])
[7b6d1b5]129AC_CHECK_TYPES([uint64_t, int64_t])
[9a673dba]130AC_CHECK_TYPES([uintmax_t, intmax_t])
131AC_CHECK_TYPES([uintptr_t, intptr_t])
132
[72e975e]133# Some toolchain sanity checks and diagnostics
134RTEMS_CHECK_GCC_SANITY
[161016b]135
[9a673dba]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])
[bfe2fd3]144
[57e278d]145AC_CHECK_HEADER([signal.h],[
146  AC_CHECK_TYPES([sighandler_t])
147])
148
[c43981b]149RTEMS_CHECK_MULTIPROCESSING
[8d4b5cf]150RTEMS_CHECK_POSIX_API
151RTEMS_CHECK_NETWORKING
[06dcaf0]152RTEMS_CHECK_SMP
[2e7f5798]153RTEMS_CHECK_ATOMIC
[91fadb3]154
[ea35fdc6]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
[b4dca71]159_RTEMS_CPUOPT_INIT
[3da33bf8]160
[926e856a]161RTEMS_CPUOPT([RTEMS_DEBUG],
162  [test x"${enable_rtems_debug}" = x"yes"],
163  [1],
164  [if RTEMS_DEBUG is enabled])
165
[3da33bf8]166RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
[28caa1d]167  [test x"$enable_multiprocessing" = xyes],
[3da33bf8]168  [1],
169  [if multiprocessing is enabled])
170
171RTEMS_CPUOPT([RTEMS_NEWLIB],
[28caa1d]172  [test x"$RTEMS_USE_NEWLIB" = xyes],
[3da33bf8]173  [1],
174  [if using newlib])
175
176RTEMS_CPUOPT([RTEMS_POSIX_API],
[28caa1d]177  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
[3da33bf8]178  [1],
179  [if posix api is supported])
180
[06dcaf0]181RTEMS_CPUOPT([RTEMS_SMP],
182  [test x"$RTEMS_HAS_SMP" = xyes],
183  [1],
184  [if SMP is enabled])
185
[6ffaeb28]186RTEMS_CPUOPT([RTEMS_PARAVIRT],
187  [test x"$RTEMS_HAS_PARAVIRT" = xyes],
188  [1],
189  [PARAVIRT is enabled])
190
[28caa1d]191RTEMS_CPUOPT([RTEMS_NETWORKING],
192  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
193  [1],
194  [if networking is enabled])
195
[2e7f5798]196RTEMS_CPUOPT([RTEMS_ATOMIC],
197  [test x"$rtems_cv_ATOMIC" = xyes],
198  [1],
199  [if cpu supports atomic operations])
200
[3da33bf8]201RTEMS_CPUOPT([RTEMS_VERSION],
202  [true],
[1bcbe41]203  ["]_RTEMS_VERSION["],
[3da33bf8]204  [RTEMS version string])
205
[c6f7e060]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
[e2ba62d1]211## This improves both the size and coverage analysis.
[5603b5a6]212RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
213  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
214  [1],
[b4dca71]215  [disable inlining _Thread_Enable_dispatch])
[5603b5a6]216
[e2ba62d1]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],
[b4dca71]221  [disable inlining _Thread_Enable_dispatch])
[e2ba62d1]222
[3a08272]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
[e2ba62d1]229## This gives the same behavior as 4.8 and older
[66a9239a]230RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
[a5de1ef]231  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
[fd84982]232  [1],
[b4dca71]233  [disable strict order mutex])
[fd84982]234
[7f5a245d]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
[263ab4b]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
[ea35fdc6]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
[b4dca71]259_RTEMS_CPUOPT_FINI
[3da33bf8]260
[8217c40]261AC_ENABLE_MULTILIB([Makefile],[..])
262
[e30210ea]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
[d71ab7fd]274RTEMS_CHECK_GCC_WEAK
[f7952533]275
[07da959]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>])
[21d9736]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
[ad9eaf26]286# FIXME: We should get rid of this. It's a cludge.
287AC_CHECK_SIZEOF([time_t])
288
[91404de]289AC_CHECK_SIZEOF([size_t])
290
[da0475f]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>])
[07da959]295
296## BSD-ism, excluded from POSIX, but available on most platforms
297AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
[396b80e]298AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
[07da959]299
300## Check if libc provides BSD's strlcpy/strlcat
301AC_CHECK_FUNCS(strlcpy strlcat)
302
[74bfa2e4]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
[07da959]312# ... far too many conditionals ...
[f9f51d0]313AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
[07da959]314AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
[b422de6c]315
[1bcbe41]316AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
[06dcaf0]317AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
[b422de6c]318
[2d80c75]319AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
[6e46fa73]320AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
[2e7f5798]321AM_CONDITIONAL([ATOMIC],[test x"$rtems_cv_ATOMIC" = x"yes"])
[b422de6c]322
[720633c]323AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
[e30210ea]324AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
[5cad5bf]325AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
326&& test x"$enable_ada" = x"yes"])
[e30210ea]327
[91404de]328AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
329
[9f62936]330AM_CONDITIONAL([LIBDOSFS],[dnl
[720633c]331test x"$ac_cv_type_uint8_t" = xyes \
[9f62936]332&& test x"$ac_cv_type_uint16_t" = xyes])
333
[3da33bf8]334AC_CONFIG_HEADER(config.h)
335
[58d38a0]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
[ada8d531]342RTEMS_AMPOLISH3
343
[70810dc]344# Explicitly list all Makefiles here
[b422de6c]345AC_CONFIG_FILES([
[5060d4f]346Doxyfile
[b422de6c]347Makefile
[1896a650]348rtems/Makefile
349sapi/Makefile
[eb299afc]350score/Makefile
351score/cpu/Makefile
[e9d90764]352score/cpu/arm/Makefile
[b78d94d]353score/cpu/bfin/Makefile
[05f3270]354score/cpu/avr/Makefile
[e9d90764]355score/cpu/h8300/Makefile
356score/cpu/i386/Makefile
[15e44fd]357score/cpu/lm32/Makefile
[e9d90764]358score/cpu/m68k/Makefile
[0c34b176]359score/cpu/m32c/Makefile
[5365e60]360score/cpu/m32r/Makefile
[e9d90764]361score/cpu/mips/Makefile
[48fc25f]362score/cpu/moxie/Makefile
[7a28ac8]363score/cpu/nios2/Makefile
[e9d90764]364score/cpu/powerpc/Makefile
365score/cpu/sh/Makefile
366score/cpu/sparc/Makefile
[ecbbd968]367score/cpu/sparc64/Makefile
[2d7ae960]368score/cpu/v850/Makefile
[6b400fed]369score/cpu/no_cpu/Makefile
[b422de6c]370posix/Makefile
371libblock/Makefile
372libfs/Makefile
[58d38a0]373libfs/src/nfsclient/Makefile
[db27544]374libgnat/Makefile
[07da959]375libcsupport/Makefile
[b422de6c]376libnetworking/Makefile
[da0fc5d]377librpc/Makefile
[b422de6c]378libmisc/Makefile
[6339f467]379libi2c/Makefile
[a70b07b]380libmd/Makefile
[fa645f6]381zlib/Makefile
[f26145b]382ftpd/Makefile
[8280caa4]383telnetd/Makefile
[c5bb2a4e]384pppd/Makefile
[ba955609]385mghttpd/Makefile
[28caa1d]386wrapup/Makefile])
387
388AC_CONFIG_COMMANDS([preinstall-stamp],
389[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
390[MAKE=${MAKE}
391with_multisubdir="$with_multisubdir"])
[92ed8c2]392
[66387986]393AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.