source: rtems/cpukit/configure.ac @ eafb040

4.115
Last change on this file since eafb040 was eafb040, checked in by Sebastian Huber <sebastian.huber@…>, on 03/04/14 at 12:44:21

score: Add --enable-profiling configure option

  • Property mode set to 100644
File size: 12.7 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
[eafb040]19RTEMS_ENABLE_PROFILING
[eb299afc]20
[04e6f7bf]21RTEMS_ENV_RTEMSCPU
[39607984]22RTEMS_CHECK_RTEMS_DEBUG
[eb299afc]23
[5b2e199]24# Is this a supported CPU?
25AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
26if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
27  AC_MSG_RESULT(yes)
28else
29  AC_MSG_ERROR(no)
30fi
31
[955c499d]32RTEMS_PROG_CC_FOR_TARGET
[10ae124c]33RTEMS_PROG_CCAS
[eb299afc]34RTEMS_CANONICALIZE_TOOLS
[e7d110ba]35AM_PROG_CC_C_O
[e73e576]36AC_PROG_RANLIB
[eb299afc]37
38RTEMS_CHECK_NEWLIB
39
[b422de6c]40# BSD-isms, used throughout the sources
41# Not really used by this configure script
42# FIXME: They should be eliminated if possible.
[85956f9]43AC_CHECK_FUNCS([strsep strcasecmp snprintf])
[31903f07]44AC_CHECK_FUNCS([strdup strndup strncasecmp])
[b422de6c]45AC_CHECK_FUNCS([bcopy bcmp])
46AC_CHECK_FUNCS([isascii fileno])
[f31a078]47
[e83a477]48# <FIXME>
49#   Check for functions supplied by newlib >= 1.17.0
50# Newlib's posix/ directory
[f154804]51AC_CHECK_FUNCS([readdir_r isatty])
[0111c50]52AC_CHECK_FUNCS([creat \
[f154804]53  opendir closedir readdir rewinddir scandir seekdir \
54  sleep \
55  telldir \
56  usleep],,
[bbc1a10]57  [rtems_missing_func="$ac_func";break])
58AS_IF([test -n "$rtems_missing_func"],
59  AC_MSG_ERROR([Missing function $rtems_missing_func in libc])])
[d020f6f]60AC_CHECK_FUNCS([__assert])
[e83a477]61AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
62AC_CHECK_FUNCS([regcomp regexec regerror regfree])
[8682da39]63
64# Mandated by POSIX, decls not present in some versions of newlib
[2c0450cb]65AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>])
66AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>])
67AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>])
[f4cc6c5]68
[b317c391]69# Newlib proprietary
70AC_CHECK_HEADERS([envlock.h])
71AC_CHECK_DECLS([__env_lock],,,[#include <envlock.h>])
72AC_CHECK_DECLS([__env_unlock],,,[#include <envlock.h>])
73
[7383b644]74# Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME
75AC_CHECK_DECL([CLOCK_PROCESS_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_PROCESS_CPUTIME_ID])],[#include <time.h>])
76AC_CHECK_DECL([CLOCK_THREAD_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_THREAD_CPUTIME_ID])],[#include <time.h>])
77
[2f797d0]78# Mandated by POSIX, decls not present in some versions of newlib,
79# some versions stubbed in newlib's rtems crt0
80RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>])
81RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>])
82RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>])
83RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>])
84RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>])
85RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>])
86RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>])
87RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>])
88RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>])
89RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>])
90RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>])
91RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>])
92RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>])
93RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>])
[8682da39]94
[199296db]95# pthread-functions not declared in some versions of newlib.
[e76a477]96RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
97RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
98RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
99RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
[199296db]100
[801a1fc6]101# These are SMP related and were added to newlib by RTEMS.
[57997d8]102RTEMS_CHECK_FUNC([pthread_attr_setaffinity_np],[
103  #define _GNU_SOURCE
104  #include <pthread.h>])
105RTEMS_CHECK_FUNC([pthread_attr_getaffinity_np],[
106  #define _GNU_SOURCE
107  #include <pthread.h>])
108RTEMS_CHECK_FUNC([pthread_setaffinity_np],[
109  #define _GNU_SOURCE
110  #include <pthread.h>])
111RTEMS_CHECK_FUNC([pthread_getaffinity_np],[
112  #define _GNU_SOURCE
113  #include <pthread.h>])
114RTEMS_CHECK_FUNC([pthread_getattr_np],[
115  #define _GNU_SOURCE
116  #include <pthread.h>])
117AC_CHECK_HEADERS([sys/cpuset.h])
[801a1fc6]118
[6649644]119# Mandated by POSIX, not declared in some versions of newlib.
120AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
121
[f4cc6c5]122# Newlib's unix/ directory
123AC_CHECK_FUNCS([ttyname getcwd])
[e83a477]124# </FIXME>
[f4cc6c5]125
[36d9f42f]126# Check if the installed toolchain provides these headers
127# and error out if not.
128AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
129  [rtems_missing_header="$ac_header";break])
130AS_IF([test -n "$rtems_missing_header"],
131  AC_MSG_ERROR([Missing required header $rtems_missing_header])])
[bffdb82]132
[85c429b]133## error out if libc doesn't provide stdint.h
[52a634e9]134AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
135[AC_MSG_ERROR([Required header stdint.h not found])])
[d62a2e0]136
[85c429b]137## error out if libc doesn't provide inttypes.h
[d62a2e0]138AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
139[AC_MSG_ERROR([Required header inttypes.h not found])])
[ec75ddc]140
[17ed18c0]141AC_HEADER_STDBOOL
[19b9991]142AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
143[AC_MSG_ERROR([No sufficient stdbool.h found])])
[17ed18c0]144
[bfe2fd3]145AC_CHECK_TYPES([ uint8_t,  int8_t])
146AC_CHECK_TYPES([uint16_t, int16_t])
147AC_CHECK_TYPES([uint32_t, int32_t])
[7b6d1b5]148AC_CHECK_TYPES([uint64_t, int64_t])
[9a673dba]149AC_CHECK_TYPES([uintmax_t, intmax_t])
150AC_CHECK_TYPES([uintptr_t, intptr_t])
151
[72e975e]152# Some toolchain sanity checks and diagnostics
153RTEMS_CHECK_GCC_SANITY
[161016b]154
[9a673dba]155# These are conditionally defined by the toolchain
156# FIXME: we should either conditionally compile those parts in
157# RTEMS depending on them, or abort - For now, simply check.
158AC_CHECK_HEADER([pthread.h],[
159  AC_CHECK_TYPES([pthread_rwlock_t])
160  AC_CHECK_TYPES([pthread_barrier_t])
161  AC_CHECK_TYPES([pthread_spinlock_t])
[927a0a1]162  AC_CHECK_TYPES([struct _pthread_cleanup_context],[],[],[#include <pthread.h>])
[9a673dba]163])
[bfe2fd3]164
[57e278d]165AC_CHECK_HEADER([signal.h],[
166  AC_CHECK_TYPES([sighandler_t])
167])
168
[c43981b]169RTEMS_CHECK_MULTIPROCESSING
[8d4b5cf]170RTEMS_CHECK_POSIX_API
171RTEMS_CHECK_NETWORKING
[06dcaf0]172RTEMS_CHECK_SMP
[8a9568d2]173if test "${RTEMS_HAS_SMP}" = "yes"; then
174  AC_CHECK_HEADERS([stdatomic.h],[],[AC_MSG_ERROR([<stdatomic.h> is required for SMP support])])
175fi
[91fadb3]176
[ea35fdc6]177rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
178rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
179rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
180
[b4dca71]181_RTEMS_CPUOPT_INIT
[3da33bf8]182
[926e856a]183RTEMS_CPUOPT([RTEMS_DEBUG],
184  [test x"${enable_rtems_debug}" = x"yes"],
185  [1],
186  [if RTEMS_DEBUG is enabled])
187
[3da33bf8]188RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
[28caa1d]189  [test x"$enable_multiprocessing" = xyes],
[3da33bf8]190  [1],
191  [if multiprocessing is enabled])
192
193RTEMS_CPUOPT([RTEMS_NEWLIB],
[28caa1d]194  [test x"$RTEMS_USE_NEWLIB" = xyes],
[3da33bf8]195  [1],
196  [if using newlib])
197
198RTEMS_CPUOPT([RTEMS_POSIX_API],
[28caa1d]199  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
[3da33bf8]200  [1],
201  [if posix api is supported])
202
[06dcaf0]203RTEMS_CPUOPT([RTEMS_SMP],
204  [test x"$RTEMS_HAS_SMP" = xyes],
205  [1],
206  [if SMP is enabled])
207
[6ffaeb28]208RTEMS_CPUOPT([RTEMS_PARAVIRT],
209  [test x"$RTEMS_HAS_PARAVIRT" = xyes],
210  [1],
211  [PARAVIRT is enabled])
212
[eafb040]213RTEMS_CPUOPT([RTEMS_PROFILING],
214  [test x"$RTEMS_HAS_PROFILING" = xyes],
215  [1],
216  [if profiling is enabled])
217
[28caa1d]218RTEMS_CPUOPT([RTEMS_NETWORKING],
219  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
220  [1],
221  [if networking is enabled])
222
[3da33bf8]223RTEMS_CPUOPT([RTEMS_VERSION],
224  [true],
[1bcbe41]225  ["]_RTEMS_VERSION["],
[3da33bf8]226  [RTEMS version string])
227
[c6f7e060]228RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
229  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
230  [1],
231  [disable nanosecond granularity for statistics])
232
[57997d8]233## Header file differences that need to be known in .h after install
234RTEMS_CPUOPT([__RTEMS_HAVE_SYS_CPUSET_H__],
235  [test x"${ac_cv_header_sys_cpuset_h}" = x"yes"],
236  [1],
237  [indicate if <sys/cpuset.h> is present in toolset])
238
[e2ba62d1]239## This improves both the size and coverage analysis.
[5603b5a6]240RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
241  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
242  [1],
[b4dca71]243  [disable inlining _Thread_Enable_dispatch])
[5603b5a6]244
[e2ba62d1]245## This improves both the size and coverage analysis.
246RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
247  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
248  [1],
[b4dca71]249  [disable inlining _Thread_Enable_dispatch])
[e2ba62d1]250
[3a08272]251## This improves both the size and coverage analysis.
252RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
253  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
254  [1],
255  [disable inlining _Thread_queue_Enqueue_priority])
256
[e2ba62d1]257## This gives the same behavior as 4.8 and older
[66a9239a]258RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
[a5de1ef]259  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
[fd84982]260  [1],
[b4dca71]261  [disable strict order mutex])
[fd84982]262
[7f5a245d]263## Deactivate ada bindings
264RTEMS_CPUOPT([__RTEMS_ADA__],
265  [test x"${enable_ada}" = x"yes"],
266  [1],
267  [Define to 1 if ada/gnat bindings are built-in])
268
[263ab4b]269## Then we propagate a private copy of the value into cpuopts.h
270## so it is always available to the RTEMS header files.
271
[ea35fdc6]272RTEMS_CPUOPT([__RTEMS_MAJOR__],
273  [true],
274  [$rtems_major],
275  [major version portion of an RTEMS release])
276
277RTEMS_CPUOPT([__RTEMS_MINOR__],
278  [true],
279  [$rtems_minor],
280  [minor version portion of an RTEMS release])
281
282RTEMS_CPUOPT([__RTEMS_REVISION__],
283  [true],
284  [$rtems_revision],
285  [revision version portion of an RTEMS release])
286
[b4dca71]287_RTEMS_CPUOPT_FINI
[3da33bf8]288
[8217c40]289AC_ENABLE_MULTILIB([Makefile],[..])
290
[e30210ea]291# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
292AC_MSG_CHECKING([for assignable stdio])
293AC_COMPILE_IFELSE(
294  [AC_LANG_PROGRAM(
295    [#include <stdio.h>],
296    [stdin = fopen("/tmp", "r")])],
297  [HAVE_ASSIGNABLE_STDIO=yes],
298  [HAVE_ASSIGNABLE_STDIO=no])
299AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
300
301# libmisc/serdbg exploits weak symbols
[d71ab7fd]302RTEMS_CHECK_GCC_WEAK
[f7952533]303
[07da959]304# FIXME: These checks are only in here to provide
305# configuration-time diagnostics and are not really used.
306AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
307AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
[21d9736]308
309# FIXME: We should get rid of this.
310# So far, only used in libfs/src/nfsclient/src/dirutils.c
311AC_CHECK_SIZEOF([mode_t])
312AC_CHECK_SIZEOF([off_t])
313
[ad9eaf26]314# FIXME: We should get rid of this. It's a cludge.
315AC_CHECK_SIZEOF([time_t])
316
[91404de]317AC_CHECK_SIZEOF([size_t])
318
[da0475f]319# FIXME: Mandatory in SUSv4, optional in SUSv3.
320#   Not implemented in GCC/newlib, so far.
321AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
322AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
[07da959]323
324## BSD-ism, excluded from POSIX, but available on most platforms
325AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
[396b80e]326AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
[07da959]327
328## Check if libc provides BSD's strlcpy/strlcat
329AC_CHECK_FUNCS(strlcpy strlcat)
330
[74bfa2e4]331## Check if libc provides decl of utime
332## FIXME: utime has been deprecated in SUSv4.
333##        and is likely to be removed in future versions.
334## FIXME (BUG in newlib): SUSv4 saids including <utime.h> should be sufficient.
335AC_CHECK_DECLS([utime],,,[#include <sys/types.h>
336#include <utime.h>])
337## Check if libc provides decl of utimes
338AC_CHECK_DECLS([utimes],,,[#include <sys/time.h>])
339
[07da959]340# ... far too many conditionals ...
[f9f51d0]341AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
[07da959]342AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
[b422de6c]343
[1bcbe41]344AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
[06dcaf0]345AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
[b422de6c]346
[2d80c75]347AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
[6e46fa73]348AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
[b422de6c]349
[720633c]350AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
[e30210ea]351AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
[5cad5bf]352AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
353&& test x"$enable_ada" = x"yes"])
[e30210ea]354
[91404de]355AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
356
[9f62936]357AM_CONDITIONAL([LIBDOSFS],[dnl
[720633c]358test x"$ac_cv_type_uint8_t" = xyes \
[9f62936]359&& test x"$ac_cv_type_uint16_t" = xyes])
360
[3da33bf8]361AC_CONFIG_HEADER(config.h)
362
[58d38a0]363## These are needed by the NFS Client
364AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
365AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
366&& test -n "$AWK" \
367&& test "$enable_rpcgen" = yes])
368
[ada8d531]369RTEMS_AMPOLISH3
370
[70810dc]371# Explicitly list all Makefiles here
[b422de6c]372AC_CONFIG_FILES([
[5060d4f]373Doxyfile
[b422de6c]374Makefile
[1896a650]375rtems/Makefile
376sapi/Makefile
[eb299afc]377score/Makefile
378score/cpu/Makefile
[e9d90764]379score/cpu/arm/Makefile
[b78d94d]380score/cpu/bfin/Makefile
[05f3270]381score/cpu/avr/Makefile
[e9d90764]382score/cpu/h8300/Makefile
383score/cpu/i386/Makefile
[15e44fd]384score/cpu/lm32/Makefile
[e9d90764]385score/cpu/m68k/Makefile
[0c34b176]386score/cpu/m32c/Makefile
[5365e60]387score/cpu/m32r/Makefile
[e9d90764]388score/cpu/mips/Makefile
[48fc25f]389score/cpu/moxie/Makefile
[7a28ac8]390score/cpu/nios2/Makefile
[e9d90764]391score/cpu/powerpc/Makefile
392score/cpu/sh/Makefile
393score/cpu/sparc/Makefile
[ecbbd968]394score/cpu/sparc64/Makefile
[2d7ae960]395score/cpu/v850/Makefile
[6b400fed]396score/cpu/no_cpu/Makefile
[b422de6c]397posix/Makefile
398libblock/Makefile
399libfs/Makefile
[58d38a0]400libfs/src/nfsclient/Makefile
[db27544]401libgnat/Makefile
[07da959]402libcsupport/Makefile
[b422de6c]403libnetworking/Makefile
[da0fc5d]404librpc/Makefile
[b422de6c]405libmisc/Makefile
[6339f467]406libi2c/Makefile
[a70b07b]407libmd/Makefile
[fa645f6]408zlib/Makefile
[f26145b]409ftpd/Makefile
[8280caa4]410telnetd/Makefile
[c5bb2a4e]411pppd/Makefile
[ba955609]412mghttpd/Makefile
[28caa1d]413wrapup/Makefile])
414
415AC_CONFIG_COMMANDS([preinstall-stamp],
416[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
417[MAKE=${MAKE}
418with_multisubdir="$with_multisubdir"])
[92ed8c2]419
[66387986]420AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.