source: rtems/cpukit/configure.ac @ e6b31b27

4.11
Last change on this file since e6b31b27 was e6b31b27, checked in by Joel Sherrill <joel.sherrill@…>, on May 27, 2015 at 3:13:58 PM

Remove use ticks for statistics configure option.

This was obsolete and broken based upon recent time keeping changes.

Thie build option was previously enabled by adding
USE_TICKS_FOR_STATISTICS=1 to the configure command line.

This propagated into the code as preprocessor conditionals
using the RTEMS_USE_TICKS_FOR_STATISTICS conditional.

  • Property mode set to 100644
File size: 14.6 KB
Line 
1## Process this file with autoconf to produce a configure script.
2
3AC_PREREQ([2.69])
4AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
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
19RTEMS_ENABLE_PROFILING
20RTEMS_ENABLE_DRVMGR
21
22RTEMS_ENV_RTEMSCPU
23RTEMS_CHECK_RTEMS_DEBUG
24
25# Is this a supported CPU?
26AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
27if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
28  AC_MSG_RESULT(yes)
29else
30  AC_MSG_ERROR(no)
31fi
32
33RTEMS_PROG_CC_FOR_TARGET
34RTEMS_PROG_CCAS
35RTEMS_CANONICALIZE_TOOLS
36AM_PROG_CC_C_O
37AC_PROG_RANLIB
38
39RTEMS_CHECK_NEWLIB
40
41# BSD-isms, used throughout the sources
42# Not really used by this configure script
43# FIXME: They should be eliminated if possible.
44AC_CHECK_FUNCS([strsep strcasecmp snprintf])
45AC_CHECK_FUNCS([strdup strndup strncasecmp])
46AC_CHECK_FUNCS([bcopy bcmp])
47AC_CHECK_FUNCS([isascii fileno])
48
49# <FIXME>
50#   Check for functions supplied by newlib >= 1.17.0
51# Newlib's posix/ directory
52AC_CHECK_FUNCS([readdir_r isatty])
53AC_CHECK_FUNCS([creat \
54  opendir closedir readdir rewinddir scandir seekdir \
55  sleep \
56  telldir \
57  usleep],,
58  [rtems_missing_func="$ac_func";break])
59AS_IF([test -n "$rtems_missing_func"],
60  AC_MSG_ERROR([Missing function $rtems_missing_func in libc])])
61AC_CHECK_FUNCS([__assert])
62AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
63AC_CHECK_FUNCS([regcomp regexec regerror regfree])
64
65# Mandated by POSIX, decls not present in some versions of newlib
66AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>])
67AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>])
68AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>])
69
70# Newlib proprietary
71AC_CHECK_HEADERS([envlock.h])
72AC_CHECK_DECLS([__env_lock],,,[#include <envlock.h>])
73AC_CHECK_DECLS([__env_unlock],,,[#include <envlock.h>])
74
75# Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME
76AC_CHECK_DECL([CLOCK_PROCESS_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_PROCESS_CPUTIME_ID])],[#include <time.h>])
77AC_CHECK_DECL([CLOCK_THREAD_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_THREAD_CPUTIME_ID])],[#include <time.h>])
78
79# Mandated by POSIX, decls not present in some versions of newlib,
80# some versions stubbed in newlib's rtems crt0
81RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>])
82RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>])
83RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>])
84RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>])
85RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>])
86RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>])
87RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>])
88RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>])
89RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>])
90RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>])
91RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>])
92RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>])
93RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>])
94RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>])
95
96# pthread-functions not declared in some versions of newlib.
97RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
98RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
99RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
100RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
101
102# These are SMP related and were added to newlib by RTEMS.
103RTEMS_CHECK_FUNC([pthread_attr_setaffinity_np],[
104  #define _GNU_SOURCE
105  #include <pthread.h>])
106RTEMS_CHECK_FUNC([pthread_attr_getaffinity_np],[
107  #define _GNU_SOURCE
108  #include <pthread.h>])
109RTEMS_CHECK_FUNC([pthread_setaffinity_np],[
110  #define _GNU_SOURCE
111  #include <pthread.h>])
112RTEMS_CHECK_FUNC([pthread_getaffinity_np],[
113  #define _GNU_SOURCE
114  #include <pthread.h>])
115RTEMS_CHECK_FUNC([pthread_getattr_np],[
116  #define _GNU_SOURCE
117  #include <pthread.h>])
118AC_CHECK_HEADERS([sys/cpuset.h])
119
120# This was added to newlib in August 2014 to improve conformance.
121# Disable use of internal definition if it is present.
122RTEMS_CHECK_FUNC([sigaltstack],[
123  #define _GNU_SOURCE
124  #include <signal.h>])
125
126# Mandated by POSIX, not declared in some versions of newlib.
127AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
128
129# Newlib's unix/ directory
130AC_CHECK_FUNCS([ttyname getcwd])
131# </FIXME>
132
133# Check if the installed toolchain provides these headers
134# and error out if not.
135AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
136  [rtems_missing_header="$ac_header";break])
137AS_IF([test -n "$rtems_missing_header"],
138  AC_MSG_ERROR([Missing required header $rtems_missing_header])])
139
140AC_CHECK_HEADERS([semaphore.h])
141AM_CONDITIONAL([HAVE_SEMAPHORE_H],[test x"$ac_cv_header_semaphore_h" = x"yes"])
142
143## error out if libc doesn't provide stdint.h
144AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
145[AC_MSG_ERROR([Required header stdint.h not found])])
146
147## error out if libc doesn't provide inttypes.h
148AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
149[AC_MSG_ERROR([Required header inttypes.h not found])])
150
151AC_HEADER_STDBOOL
152AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
153[AC_MSG_ERROR([No sufficient stdbool.h found])])
154
155AC_CHECK_TYPES([ uint8_t,  int8_t])
156AC_CHECK_TYPES([uint16_t, int16_t])
157AC_CHECK_TYPES([uint32_t, int32_t])
158AC_CHECK_TYPES([uint64_t, int64_t])
159AC_CHECK_TYPES([uintmax_t, intmax_t])
160AC_CHECK_TYPES([uintptr_t, intptr_t])
161
162# Some toolchain sanity checks and diagnostics
163RTEMS_CHECK_GCC_SANITY
164
165# These are conditionally defined by the toolchain
166# FIXME: we should either conditionally compile those parts in
167# RTEMS depending on them, or abort - For now, simply check.
168AC_CHECK_HEADER([pthread.h],[
169  AC_CHECK_TYPES([pthread_rwlock_t])
170  AC_CHECK_TYPES([pthread_barrier_t])
171  AC_CHECK_TYPES([pthread_spinlock_t])
172  AC_CHECK_TYPES([struct _pthread_cleanup_context],[],[],[#include <pthread.h>])
173])
174
175AC_CHECK_HEADER([signal.h],[
176  AC_CHECK_TYPES([sighandler_t])
177])
178
179RTEMS_CHECK_MULTIPROCESSING
180RTEMS_CHECK_POSIX_API
181RTEMS_CHECK_NETWORKING
182RTEMS_CHECK_SMP
183if test "${RTEMS_HAS_SMP}" = "yes"; then
184  AC_CHECK_HEADERS([stdatomic.h],[],[AC_MSG_ERROR([<stdatomic.h> is required for SMP support])])
185fi
186
187rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
188rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
189rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
190
191_RTEMS_CPUOPT_INIT
192
193RTEMS_CPUOPT([RTEMS_DEBUG],
194  [test x"${enable_rtems_debug}" = x"yes"],
195  [1],
196  [if RTEMS_DEBUG is enabled])
197
198RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
199  [test x"$enable_multiprocessing" = xyes],
200  [1],
201  [if multiprocessing is enabled])
202
203RTEMS_CPUOPT([RTEMS_NEWLIB],
204  [test x"$RTEMS_USE_NEWLIB" = xyes],
205  [1],
206  [if using newlib])
207
208RTEMS_CPUOPT([RTEMS_POSIX_API],
209  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
210  [1],
211  [if posix api is supported])
212
213RTEMS_CPUOPT([RTEMS_SMP],
214  [test x"$RTEMS_HAS_SMP" = xyes],
215  [1],
216  [if SMP is enabled])
217
218RTEMS_CPUOPT([RTEMS_PARAVIRT],
219  [test x"$RTEMS_HAS_PARAVIRT" = xyes],
220  [1],
221  [PARAVIRT is enabled])
222
223RTEMS_CPUOPT([RTEMS_PROFILING],
224  [test x"$RTEMS_HAS_PROFILING" = xyes],
225  [1],
226  [if profiling is enabled])
227
228RTEMS_CPUOPT([RTEMS_NETWORKING],
229  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
230  [1],
231  [if networking is enabled])
232
233RTEMS_CPUOPT([RTEMS_DRVMGR_STARTUP],
234  [test x"$enable_drvmgr" = xyes],
235  [1],
236  [if driver manager api is supported])
237
238RTEMS_CPUOPT([RTEMS_VERSION],
239  [true],
240  ["]_RTEMS_VERSION["],
241  [RTEMS version string])
242
243## Header file differences that need to be known in .h after install
244RTEMS_CPUOPT([__RTEMS_HAVE_SYS_CPUSET_H__],
245  [test x"${ac_cv_header_sys_cpuset_h}" = x"yes"],
246  [1],
247  [indicate if <sys/cpuset.h> is present in toolset])
248
249## Header file differences that need to be known in .h after install
250RTEMS_CPUOPT([__RTEMS_HAVE_DECL_SIGALTSTACK__],
251  [test x"${ac_cv_have_decl_sigaltstack}" = x"yes"],
252  [1],
253  [indicate if <signal.h> in toolset has sigaltstack()])
254
255## This improves both the size and coverage analysis.
256RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
257  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
258  [1],
259  [disable inlining _Thread_Enable_dispatch])
260
261## This improves both the size and coverage analysis.
262RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
263  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
264  [1],
265  [disable inlining _Thread_Enable_dispatch])
266
267## This gives the same behavior as 4.8 and older
268RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
269  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
270  [1],
271  [disable strict order mutex])
272
273## Deactivate ada bindings
274RTEMS_CPUOPT([__RTEMS_ADA__],
275  [test x"${enable_ada}" = x"yes"],
276  [1],
277  [Define to 1 if ada/gnat bindings are built-in])
278
279## Then we propagate a private copy of the value into cpuopts.h
280## so it is always available to the RTEMS header files.
281
282RTEMS_CPUOPT([__RTEMS_MAJOR__],
283  [true],
284  [$rtems_major],
285  [major version portion of an RTEMS release])
286
287RTEMS_CPUOPT([__RTEMS_MINOR__],
288  [true],
289  [$rtems_minor],
290  [minor version portion of an RTEMS release])
291
292RTEMS_CPUOPT([__RTEMS_REVISION__],
293  [true],
294  [$rtems_revision],
295  [revision version portion of an RTEMS release])
296
297_RTEMS_CPUOPT_FINI
298
299AC_ENABLE_MULTILIB([Makefile],[..])
300
301# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
302AC_MSG_CHECKING([for assignable stdio])
303AC_COMPILE_IFELSE(
304  [AC_LANG_PROGRAM(
305    [#include <stdio.h>],
306    [stdin = fopen("/tmp", "r")])],
307  [HAVE_ASSIGNABLE_STDIO=yes],
308  [HAVE_ASSIGNABLE_STDIO=no])
309AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
310
311# libmisc/serdbg exploits weak symbols
312RTEMS_CHECK_GCC_WEAK
313
314# FIXME: These checks are only in here to provide
315# configuration-time diagnostics and are not really used.
316AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
317AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
318
319# FIXME: We should get rid of this.
320# So far, only used in libfs/src/nfsclient/src/dirutils.c
321AC_CHECK_SIZEOF([mode_t])
322AC_CHECK_SIZEOF([off_t])
323
324# FIXME: We should get rid of this. It's a cludge.
325AC_CHECK_SIZEOF([time_t])
326
327AC_CHECK_SIZEOF([size_t])
328
329# FIXME: Mandatory in SUSv4, optional in SUSv3.
330#   Not implemented in GCC/newlib, so far.
331AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
332AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
333
334## BSD-ism, excluded from POSIX, but available on most platforms
335AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
336AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
337
338## Check if libc provides BSD's strlcpy/strlcat
339AC_CHECK_FUNCS(strlcpy strlcat)
340
341## Check if libc provides decl of utime
342## FIXME: utime has been deprecated in SUSv4.
343##        and is likely to be removed in future versions.
344## FIXME (BUG in newlib): SUSv4 saids including <utime.h> should be sufficient.
345AC_CHECK_DECLS([utime],,,[#include <sys/types.h>
346#include <utime.h>])
347## Check if libc provides decl of utimes
348AC_CHECK_DECLS([utimes],,,[#include <sys/time.h>])
349
350# ... far too many conditionals ...
351AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
352AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
353
354AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
355AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
356
357AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
358AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
359
360AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
361AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
362AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
363&& test x"$enable_ada" = x"yes"])
364
365AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
366
367AM_CONDITIONAL([LIBDOSFS],[dnl
368test x"$ac_cv_type_uint8_t" = xyes \
369&& test x"$ac_cv_type_uint16_t" = xyes])
370
371AC_CONFIG_HEADER(config.h)
372
373## These are needed by the NFS Client
374AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
375AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
376&& test -n "$AWK" \
377&& test "$enable_rpcgen" = yes])
378
379# Filter dynamic loading to only build for architectures that have
380# reloc backends
381AC_MSG_CHECKING([whether CPU supports libdl])
382case $RTEMS_CPU in
383  arm | i386 | m32r | m68k | mips | \
384  moxie | powerpc | sparc)
385   HAVE_LIBDL=yes ;;
386  # bfin has an issue to resolve with libdl. See ticket #2252
387  bfin)
388   HAVE_LIBDL=no ;;
389  # h8300 has an issue to resolve with libdl. See ticket #2284
390  h8300)
391   HAVE_LIBDL=no ;;
392  # lm32 has an issue to resolve with libdl. See ticket #2283
393  lm32)
394   HAVE_LIBDL=no ;;
395  # v850 has an issue to resolve with libdl. See ticket #2260
396  v850)
397   HAVE_LIBDL=no ;;
398  *)
399   HAVE_LIBDL=no ;;
400esac
401AM_CONDITIONAL(LIBDL,[test x"$HAVE_LIBDL" = x"yes"])
402AC_MSG_RESULT([$HAVE_LIBDL])
403
404AC_MSG_CHECKING([whether CPU supports SHA])
405case $RTEMS_CPU in
406  m32c)
407   HAVE_SHA=no ;;
408  *)
409   HAVE_SHA=yes ;;
410esac
411AM_CONDITIONAL(SHA,[test x"$HAVE_SHA" = x"yes"])
412AC_MSG_RESULT([$HAVE_SHA])
413
414# Filter libpci to only build for architectures that have support for it
415AC_MSG_CHECKING([whether CPU supports libpci])
416case $RTEMS_CPU in
417  sparc)
418   HAVE_LIBPCI=yes ;;
419  *)
420   HAVE_LIBPCI=no ;;
421esac
422AM_CONDITIONAL(LIBPCI,[test x"$HAVE_LIBPCI" = x"yes"])
423AC_MSG_RESULT([$HAVE_LIBPCI])
424
425# Filter libdrvmgr to only build for architectures that have support for it
426AC_MSG_CHECKING([whether CPU supports libdrvmgr])
427case $RTEMS_CPU in
428  sparc)
429   HAVE_LIBDRVMGR=yes ;;
430  *)
431   HAVE_LIBDRVMGR=no ;;
432esac
433AM_CONDITIONAL(LIBDRVMGR,[test x"$HAVE_LIBDRVMGR" = x"yes"])
434AC_MSG_RESULT([$HAVE_LIBDRVMGR])
435
436
437RTEMS_AMPOLISH3
438
439# Explicitly list all Makefiles here
440AC_CONFIG_FILES([
441Doxyfile
442Makefile
443dev/Makefile
444rtems/Makefile
445sapi/Makefile
446score/Makefile
447score/cpu/Makefile
448score/cpu/arm/Makefile
449score/cpu/bfin/Makefile
450score/cpu/avr/Makefile
451score/cpu/epiphany/Makefile
452score/cpu/h8300/Makefile
453score/cpu/i386/Makefile
454score/cpu/lm32/Makefile
455score/cpu/m68k/Makefile
456score/cpu/m32c/Makefile
457score/cpu/m32r/Makefile
458score/cpu/mips/Makefile
459score/cpu/moxie/Makefile
460score/cpu/nios2/Makefile
461score/cpu/or1k/Makefile
462score/cpu/powerpc/Makefile
463score/cpu/sh/Makefile
464score/cpu/sparc/Makefile
465score/cpu/sparc64/Makefile
466score/cpu/v850/Makefile
467score/cpu/no_cpu/Makefile
468posix/Makefile
469libblock/Makefile
470libdrvmgr/Makefile
471libfs/Makefile
472libfs/src/nfsclient/Makefile
473libgnat/Makefile
474libcrypt/Makefile
475libcsupport/Makefile
476libnetworking/Makefile
477libpci/Makefile
478librpc/Makefile
479libmisc/Makefile
480libi2c/Makefile
481libmd/Makefile
482libdl/Makefile
483zlib/Makefile
484ftpd/Makefile
485telnetd/Makefile
486pppd/Makefile
487mghttpd/Makefile
488wrapup/Makefile])
489
490AC_CONFIG_COMMANDS([preinstall-stamp],
491[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
492[MAKE=${MAKE}
493with_multisubdir="$with_multisubdir"])
494
495AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.