source: rtems/cpukit/configure.ac @ 801a1fc6

4.115
Last change on this file since 801a1fc6 was 801a1fc6, checked in by Joel Sherrill <joel.sherrill@…>, on 12/09/13 at 20:22:33

cpukit/configure.ac: Probe for SMP affinity methods

  • Property mode set to 100644
File size: 12.3 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
[801a1fc6]100# These are SMP related and were added to newlib by RTEMS.
101RTEMS_CHECK_FUNC([pthread_attr_setaffinity_np],[#include <pthread.h>])
102RTEMS_CHECK_FUNC([pthread_attr_getaffinity_np],[#include <pthread.h>])
103RTEMS_CHECK_FUNC([pthread_setaffinity_np],[#include <pthread.h>])
104RTEMS_CHECK_FUNC([pthread_getaffinity_np],[#include <pthread.h>])
105RTEMS_CHECK_FUNC([pthread_getattr_np],[#include <pthread.h>])
106AC_CHECK_HEADERS([cpuset.h])
107
[6649644]108# Mandated by POSIX, not declared in some versions of newlib.
109AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
110
[f4cc6c5]111# Newlib's unix/ directory
112AC_CHECK_FUNCS([ttyname getcwd])
[e83a477]113# </FIXME>
[f4cc6c5]114
[36d9f42f]115# Check if the installed toolchain provides these headers
116# and error out if not.
117AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
118  [rtems_missing_header="$ac_header";break])
119AS_IF([test -n "$rtems_missing_header"],
120  AC_MSG_ERROR([Missing required header $rtems_missing_header])])
[bffdb82]121
[85c429b]122## error out if libc doesn't provide stdint.h
[52a634e9]123AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
124[AC_MSG_ERROR([Required header stdint.h not found])])
[d62a2e0]125
[85c429b]126## error out if libc doesn't provide inttypes.h
[d62a2e0]127AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
128[AC_MSG_ERROR([Required header inttypes.h not found])])
[ec75ddc]129
[17ed18c0]130AC_HEADER_STDBOOL
[19b9991]131AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
132[AC_MSG_ERROR([No sufficient stdbool.h found])])
[17ed18c0]133
[bfe2fd3]134AC_CHECK_TYPES([ uint8_t,  int8_t])
135AC_CHECK_TYPES([uint16_t, int16_t])
136AC_CHECK_TYPES([uint32_t, int32_t])
[7b6d1b5]137AC_CHECK_TYPES([uint64_t, int64_t])
[9a673dba]138AC_CHECK_TYPES([uintmax_t, intmax_t])
139AC_CHECK_TYPES([uintptr_t, intptr_t])
140
[72e975e]141# Some toolchain sanity checks and diagnostics
142RTEMS_CHECK_GCC_SANITY
[161016b]143
[9a673dba]144# These are conditionally defined by the toolchain
145# FIXME: we should either conditionally compile those parts in
146# RTEMS depending on them, or abort - For now, simply check.
147AC_CHECK_HEADER([pthread.h],[
148  AC_CHECK_TYPES([pthread_rwlock_t])
149  AC_CHECK_TYPES([pthread_barrier_t])
150  AC_CHECK_TYPES([pthread_spinlock_t])
[927a0a1]151  AC_CHECK_TYPES([struct _pthread_cleanup_context],[],[],[#include <pthread.h>])
[9a673dba]152])
[bfe2fd3]153
[57e278d]154AC_CHECK_HEADER([signal.h],[
155  AC_CHECK_TYPES([sighandler_t])
156])
157
[c43981b]158RTEMS_CHECK_MULTIPROCESSING
[8d4b5cf]159RTEMS_CHECK_POSIX_API
160RTEMS_CHECK_NETWORKING
[06dcaf0]161RTEMS_CHECK_SMP
[2e7f5798]162RTEMS_CHECK_ATOMIC
[91fadb3]163
[ea35fdc6]164rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
165rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
166rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
167
[b4dca71]168_RTEMS_CPUOPT_INIT
[3da33bf8]169
[926e856a]170RTEMS_CPUOPT([RTEMS_DEBUG],
171  [test x"${enable_rtems_debug}" = x"yes"],
172  [1],
173  [if RTEMS_DEBUG is enabled])
174
[3da33bf8]175RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
[28caa1d]176  [test x"$enable_multiprocessing" = xyes],
[3da33bf8]177  [1],
178  [if multiprocessing is enabled])
179
180RTEMS_CPUOPT([RTEMS_NEWLIB],
[28caa1d]181  [test x"$RTEMS_USE_NEWLIB" = xyes],
[3da33bf8]182  [1],
183  [if using newlib])
184
185RTEMS_CPUOPT([RTEMS_POSIX_API],
[28caa1d]186  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
[3da33bf8]187  [1],
188  [if posix api is supported])
189
[06dcaf0]190RTEMS_CPUOPT([RTEMS_SMP],
191  [test x"$RTEMS_HAS_SMP" = xyes],
192  [1],
193  [if SMP is enabled])
194
[6ffaeb28]195RTEMS_CPUOPT([RTEMS_PARAVIRT],
196  [test x"$RTEMS_HAS_PARAVIRT" = xyes],
197  [1],
198  [PARAVIRT is enabled])
199
[28caa1d]200RTEMS_CPUOPT([RTEMS_NETWORKING],
201  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
202  [1],
203  [if networking is enabled])
204
[2e7f5798]205RTEMS_CPUOPT([RTEMS_ATOMIC],
206  [test x"$rtems_cv_ATOMIC" = xyes],
207  [1],
208  [if cpu supports atomic operations])
209
[3da33bf8]210RTEMS_CPUOPT([RTEMS_VERSION],
211  [true],
[1bcbe41]212  ["]_RTEMS_VERSION["],
[3da33bf8]213  [RTEMS version string])
214
[c6f7e060]215RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
216  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
217  [1],
218  [disable nanosecond granularity for statistics])
219
[e2ba62d1]220## This improves both the size and coverage analysis.
[5603b5a6]221RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
222  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
223  [1],
[b4dca71]224  [disable inlining _Thread_Enable_dispatch])
[5603b5a6]225
[e2ba62d1]226## This improves both the size and coverage analysis.
227RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
228  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
229  [1],
[b4dca71]230  [disable inlining _Thread_Enable_dispatch])
[e2ba62d1]231
[3a08272]232## This improves both the size and coverage analysis.
233RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
234  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
235  [1],
236  [disable inlining _Thread_queue_Enqueue_priority])
237
[e2ba62d1]238## This gives the same behavior as 4.8 and older
[66a9239a]239RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
[a5de1ef]240  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
[fd84982]241  [1],
[b4dca71]242  [disable strict order mutex])
[fd84982]243
[7f5a245d]244## Deactivate ada bindings
245RTEMS_CPUOPT([__RTEMS_ADA__],
246  [test x"${enable_ada}" = x"yes"],
247  [1],
248  [Define to 1 if ada/gnat bindings are built-in])
249
[263ab4b]250## Then we propagate a private copy of the value into cpuopts.h
251## so it is always available to the RTEMS header files.
252
[ea35fdc6]253RTEMS_CPUOPT([__RTEMS_MAJOR__],
254  [true],
255  [$rtems_major],
256  [major version portion of an RTEMS release])
257
258RTEMS_CPUOPT([__RTEMS_MINOR__],
259  [true],
260  [$rtems_minor],
261  [minor version portion of an RTEMS release])
262
263RTEMS_CPUOPT([__RTEMS_REVISION__],
264  [true],
265  [$rtems_revision],
266  [revision version portion of an RTEMS release])
267
[b4dca71]268_RTEMS_CPUOPT_FINI
[3da33bf8]269
[8217c40]270AC_ENABLE_MULTILIB([Makefile],[..])
271
[e30210ea]272# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
273AC_MSG_CHECKING([for assignable stdio])
274AC_COMPILE_IFELSE(
275  [AC_LANG_PROGRAM(
276    [#include <stdio.h>],
277    [stdin = fopen("/tmp", "r")])],
278  [HAVE_ASSIGNABLE_STDIO=yes],
279  [HAVE_ASSIGNABLE_STDIO=no])
280AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
281
282# libmisc/serdbg exploits weak symbols
[d71ab7fd]283RTEMS_CHECK_GCC_WEAK
[f7952533]284
[07da959]285# FIXME: These checks are only in here to provide
286# configuration-time diagnostics and are not really used.
287AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
288AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
[21d9736]289
290# FIXME: We should get rid of this.
291# So far, only used in libfs/src/nfsclient/src/dirutils.c
292AC_CHECK_SIZEOF([mode_t])
293AC_CHECK_SIZEOF([off_t])
294
[ad9eaf26]295# FIXME: We should get rid of this. It's a cludge.
296AC_CHECK_SIZEOF([time_t])
297
[91404de]298AC_CHECK_SIZEOF([size_t])
299
[da0475f]300# FIXME: Mandatory in SUSv4, optional in SUSv3.
301#   Not implemented in GCC/newlib, so far.
302AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
303AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
[07da959]304
305## BSD-ism, excluded from POSIX, but available on most platforms
306AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
[396b80e]307AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
[07da959]308
309## Check if libc provides BSD's strlcpy/strlcat
310AC_CHECK_FUNCS(strlcpy strlcat)
311
[74bfa2e4]312## Check if libc provides decl of utime
313## FIXME: utime has been deprecated in SUSv4.
314##        and is likely to be removed in future versions.
315## FIXME (BUG in newlib): SUSv4 saids including <utime.h> should be sufficient.
316AC_CHECK_DECLS([utime],,,[#include <sys/types.h>
317#include <utime.h>])
318## Check if libc provides decl of utimes
319AC_CHECK_DECLS([utimes],,,[#include <sys/time.h>])
320
[07da959]321# ... far too many conditionals ...
[f9f51d0]322AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
[07da959]323AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
[b422de6c]324
[1bcbe41]325AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
[06dcaf0]326AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
[b422de6c]327
[2d80c75]328AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
[6e46fa73]329AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
[2e7f5798]330AM_CONDITIONAL([ATOMIC],[test x"$rtems_cv_ATOMIC" = x"yes"])
[b422de6c]331
[720633c]332AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
[e30210ea]333AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
[5cad5bf]334AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
335&& test x"$enable_ada" = x"yes"])
[e30210ea]336
[91404de]337AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
338
[9f62936]339AM_CONDITIONAL([LIBDOSFS],[dnl
[720633c]340test x"$ac_cv_type_uint8_t" = xyes \
[9f62936]341&& test x"$ac_cv_type_uint16_t" = xyes])
342
[3da33bf8]343AC_CONFIG_HEADER(config.h)
344
[58d38a0]345## These are needed by the NFS Client
346AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
347AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
348&& test -n "$AWK" \
349&& test "$enable_rpcgen" = yes])
350
[ada8d531]351RTEMS_AMPOLISH3
352
[70810dc]353# Explicitly list all Makefiles here
[b422de6c]354AC_CONFIG_FILES([
[5060d4f]355Doxyfile
[b422de6c]356Makefile
[1896a650]357rtems/Makefile
358sapi/Makefile
[eb299afc]359score/Makefile
360score/cpu/Makefile
[e9d90764]361score/cpu/arm/Makefile
[b78d94d]362score/cpu/bfin/Makefile
[05f3270]363score/cpu/avr/Makefile
[e9d90764]364score/cpu/h8300/Makefile
365score/cpu/i386/Makefile
[15e44fd]366score/cpu/lm32/Makefile
[e9d90764]367score/cpu/m68k/Makefile
[0c34b176]368score/cpu/m32c/Makefile
[5365e60]369score/cpu/m32r/Makefile
[e9d90764]370score/cpu/mips/Makefile
[48fc25f]371score/cpu/moxie/Makefile
[7a28ac8]372score/cpu/nios2/Makefile
[e9d90764]373score/cpu/powerpc/Makefile
374score/cpu/sh/Makefile
375score/cpu/sparc/Makefile
[ecbbd968]376score/cpu/sparc64/Makefile
[2d7ae960]377score/cpu/v850/Makefile
[6b400fed]378score/cpu/no_cpu/Makefile
[b422de6c]379posix/Makefile
380libblock/Makefile
381libfs/Makefile
[58d38a0]382libfs/src/nfsclient/Makefile
[db27544]383libgnat/Makefile
[07da959]384libcsupport/Makefile
[b422de6c]385libnetworking/Makefile
[da0fc5d]386librpc/Makefile
[b422de6c]387libmisc/Makefile
[6339f467]388libi2c/Makefile
[a70b07b]389libmd/Makefile
[fa645f6]390zlib/Makefile
[f26145b]391ftpd/Makefile
[8280caa4]392telnetd/Makefile
[c5bb2a4e]393pppd/Makefile
[ba955609]394mghttpd/Makefile
[28caa1d]395wrapup/Makefile])
396
397AC_CONFIG_COMMANDS([preinstall-stamp],
398[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
399[MAKE=${MAKE}
400with_multisubdir="$with_multisubdir"])
[92ed8c2]401
[66387986]402AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.