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

4.11
Last change on this file since 801a1fc6 was 801a1fc6, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 9, 2013 at 8:22:33 PM

cpukit/configure.ac: Probe for SMP affinity methods

  • Property mode set to 100644
File size: 12.3 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# 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
108# Mandated by POSIX, not declared in some versions of newlib.
109AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
110
111# Newlib's unix/ directory
112AC_CHECK_FUNCS([ttyname getcwd])
113# </FIXME>
114
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])])
121
122## error out if libc doesn't provide stdint.h
123AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
124[AC_MSG_ERROR([Required header stdint.h not found])])
125
126## error out if libc doesn't provide inttypes.h
127AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
128[AC_MSG_ERROR([Required header inttypes.h not found])])
129
130AC_HEADER_STDBOOL
131AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
132[AC_MSG_ERROR([No sufficient stdbool.h found])])
133
134AC_CHECK_TYPES([ uint8_t,  int8_t])
135AC_CHECK_TYPES([uint16_t, int16_t])
136AC_CHECK_TYPES([uint32_t, int32_t])
137AC_CHECK_TYPES([uint64_t, int64_t])
138AC_CHECK_TYPES([uintmax_t, intmax_t])
139AC_CHECK_TYPES([uintptr_t, intptr_t])
140
141# Some toolchain sanity checks and diagnostics
142RTEMS_CHECK_GCC_SANITY
143
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])
151  AC_CHECK_TYPES([struct _pthread_cleanup_context],[],[],[#include <pthread.h>])
152])
153
154AC_CHECK_HEADER([signal.h],[
155  AC_CHECK_TYPES([sighandler_t])
156])
157
158RTEMS_CHECK_MULTIPROCESSING
159RTEMS_CHECK_POSIX_API
160RTEMS_CHECK_NETWORKING
161RTEMS_CHECK_SMP
162RTEMS_CHECK_ATOMIC
163
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
168_RTEMS_CPUOPT_INIT
169
170RTEMS_CPUOPT([RTEMS_DEBUG],
171  [test x"${enable_rtems_debug}" = x"yes"],
172  [1],
173  [if RTEMS_DEBUG is enabled])
174
175RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
176  [test x"$enable_multiprocessing" = xyes],
177  [1],
178  [if multiprocessing is enabled])
179
180RTEMS_CPUOPT([RTEMS_NEWLIB],
181  [test x"$RTEMS_USE_NEWLIB" = xyes],
182  [1],
183  [if using newlib])
184
185RTEMS_CPUOPT([RTEMS_POSIX_API],
186  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
187  [1],
188  [if posix api is supported])
189
190RTEMS_CPUOPT([RTEMS_SMP],
191  [test x"$RTEMS_HAS_SMP" = xyes],
192  [1],
193  [if SMP is enabled])
194
195RTEMS_CPUOPT([RTEMS_PARAVIRT],
196  [test x"$RTEMS_HAS_PARAVIRT" = xyes],
197  [1],
198  [PARAVIRT is enabled])
199
200RTEMS_CPUOPT([RTEMS_NETWORKING],
201  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
202  [1],
203  [if networking is enabled])
204
205RTEMS_CPUOPT([RTEMS_ATOMIC],
206  [test x"$rtems_cv_ATOMIC" = xyes],
207  [1],
208  [if cpu supports atomic operations])
209
210RTEMS_CPUOPT([RTEMS_VERSION],
211  [true],
212  ["]_RTEMS_VERSION["],
213  [RTEMS version string])
214
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
220## This improves both the size and coverage analysis.
221RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
222  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
223  [1],
224  [disable inlining _Thread_Enable_dispatch])
225
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],
230  [disable inlining _Thread_Enable_dispatch])
231
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
238## This gives the same behavior as 4.8 and older
239RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
240  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
241  [1],
242  [disable strict order mutex])
243
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
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
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
268_RTEMS_CPUOPT_FINI
269
270AC_ENABLE_MULTILIB([Makefile],[..])
271
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
283RTEMS_CHECK_GCC_WEAK
284
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>])
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
295# FIXME: We should get rid of this. It's a cludge.
296AC_CHECK_SIZEOF([time_t])
297
298AC_CHECK_SIZEOF([size_t])
299
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>])
304
305## BSD-ism, excluded from POSIX, but available on most platforms
306AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
307AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
308
309## Check if libc provides BSD's strlcpy/strlcat
310AC_CHECK_FUNCS(strlcpy strlcat)
311
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
321# ... far too many conditionals ...
322AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
323AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
324
325AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
326AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
327
328AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
329AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
330AM_CONDITIONAL([ATOMIC],[test x"$rtems_cv_ATOMIC" = x"yes"])
331
332AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
333AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
334AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
335&& test x"$enable_ada" = x"yes"])
336
337AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
338
339AM_CONDITIONAL([LIBDOSFS],[dnl
340test x"$ac_cv_type_uint8_t" = xyes \
341&& test x"$ac_cv_type_uint16_t" = xyes])
342
343AC_CONFIG_HEADER(config.h)
344
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
351RTEMS_AMPOLISH3
352
353# Explicitly list all Makefiles here
354AC_CONFIG_FILES([
355Doxyfile
356Makefile
357rtems/Makefile
358sapi/Makefile
359score/Makefile
360score/cpu/Makefile
361score/cpu/arm/Makefile
362score/cpu/bfin/Makefile
363score/cpu/avr/Makefile
364score/cpu/h8300/Makefile
365score/cpu/i386/Makefile
366score/cpu/lm32/Makefile
367score/cpu/m68k/Makefile
368score/cpu/m32c/Makefile
369score/cpu/m32r/Makefile
370score/cpu/mips/Makefile
371score/cpu/moxie/Makefile
372score/cpu/nios2/Makefile
373score/cpu/powerpc/Makefile
374score/cpu/sh/Makefile
375score/cpu/sparc/Makefile
376score/cpu/sparc64/Makefile
377score/cpu/v850/Makefile
378score/cpu/no_cpu/Makefile
379posix/Makefile
380libblock/Makefile
381libfs/Makefile
382libfs/src/nfsclient/Makefile
383libgnat/Makefile
384libcsupport/Makefile
385libnetworking/Makefile
386librpc/Makefile
387libmisc/Makefile
388libi2c/Makefile
389libmd/Makefile
390zlib/Makefile
391ftpd/Makefile
392telnetd/Makefile
393pppd/Makefile
394mghttpd/Makefile
395wrapup/Makefile])
396
397AC_CONFIG_COMMANDS([preinstall-stamp],
398[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
399[MAKE=${MAKE}
400with_multisubdir="$with_multisubdir"])
401
402AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.