source: rtems/cpukit/configure.ac @ ad9eaf26

4.115
Last change on this file since ad9eaf26 was ad9eaf26, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/30/11 at 13:08:45

2011-09-30 Ralf Corsépius <ralf.corsepius@…>

  • configure.ac: Check for size of time_t.
  • Property mode set to 100644
File size: 11.2 KB
RevLine 
[66387986]1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
[eb299afc]4
[8ee3775]5AC_PREREQ([2.68])
[fcb0cd46]6AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
[66387986]7AC_CONFIG_SRCDIR([score])
[2f4c86f]8RTEMS_TOP([..],[])
[eb299afc]9
10RTEMS_CANONICAL_TARGET_CPU
11
[8ee3775]12AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.11.1])
[eb299afc]13AM_MAINTAINER_MODE
[04e6f7bf]14
15RTEMS_ENABLE_MULTILIB
[eb299afc]16RTEMS_ENABLE_MULTIPROCESSING
17RTEMS_ENABLE_POSIX
[39607984]18RTEMS_ENABLE_RTEMS_DEBUG
[3e39b47]19RTEMS_ENABLE_NETWORKING
[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
[7383b644]69# Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME
70AC_CHECK_DECL([CLOCK_PROCESS_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_PROCESS_CPUTIME_ID])],[#include <time.h>])
71AC_CHECK_DECL([CLOCK_THREAD_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_THREAD_CPUTIME_ID])],[#include <time.h>])
72
[2f797d0]73# Mandated by POSIX, decls not present in some versions of newlib,
74# some versions stubbed in newlib's rtems crt0
75RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>])
76RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>])
77RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>])
78RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>])
79RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>])
80RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>])
81RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>])
82RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>])
83RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>])
84RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>])
85RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>])
86RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>])
87RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>])
88RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>])
[8682da39]89
[199296db]90# pthread-functions not declared in some versions of newlib.
[e76a477]91RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
92RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
93RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
94RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
[199296db]95
[f4cc6c5]96# Newlib's unix/ directory
97AC_CHECK_FUNCS([ttyname getcwd])
[e83a477]98# </FIXME>
[f4cc6c5]99
[36d9f42f]100# Check if the installed toolchain provides these headers
101# and error out if not.
102AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
103  [rtems_missing_header="$ac_header";break])
104AS_IF([test -n "$rtems_missing_header"],
105  AC_MSG_ERROR([Missing required header $rtems_missing_header])])
[bffdb82]106
[85c429b]107## error out if libc doesn't provide stdint.h
[52a634e9]108AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
109[AC_MSG_ERROR([Required header stdint.h not found])])
[d62a2e0]110
[85c429b]111## error out if libc doesn't provide inttypes.h
[d62a2e0]112AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
113[AC_MSG_ERROR([Required header inttypes.h not found])])
[ec75ddc]114
[17ed18c0]115AC_HEADER_STDBOOL
[19b9991]116AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
117[AC_MSG_ERROR([No sufficient stdbool.h found])])
[17ed18c0]118
[bfe2fd3]119AC_CHECK_TYPES([ uint8_t,  int8_t])
120AC_CHECK_TYPES([uint16_t, int16_t])
121AC_CHECK_TYPES([uint32_t, int32_t])
[7b6d1b5]122AC_CHECK_TYPES([uint64_t, int64_t])
[9a673dba]123AC_CHECK_TYPES([uintmax_t, intmax_t])
124AC_CHECK_TYPES([uintptr_t, intptr_t])
125
[72e975e]126# Some toolchain sanity checks and diagnostics
127RTEMS_CHECK_GCC_SANITY
[161016b]128
[9a673dba]129# These are conditionally defined by the toolchain
130# FIXME: we should either conditionally compile those parts in
131# RTEMS depending on them, or abort - For now, simply check.
132AC_CHECK_HEADER([pthread.h],[
133  AC_CHECK_TYPES([pthread_rwlock_t])
134  AC_CHECK_TYPES([pthread_barrier_t])
135  AC_CHECK_TYPES([pthread_spinlock_t])
136])
[bfe2fd3]137
[57e278d]138AC_CHECK_HEADER([signal.h],[
139  AC_CHECK_TYPES([sighandler_t])
140])
141
[c43981b]142RTEMS_CHECK_MULTIPROCESSING
[8d4b5cf]143RTEMS_CHECK_POSIX_API
144RTEMS_CHECK_NETWORKING
[06dcaf0]145RTEMS_CHECK_SMP
[91fadb3]146
[ea35fdc6]147rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
148rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
149rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
150
[263ab4b]151## This is needed to generate the field offsets of the per CPU
152## data structure so they can be accessed from assembly code.
153AC_CHECK_SIZEOF([void *])
154
[b4dca71]155_RTEMS_CPUOPT_INIT
[3da33bf8]156
[926e856a]157RTEMS_CPUOPT([RTEMS_DEBUG],
158  [test x"${enable_rtems_debug}" = x"yes"],
159  [1],
160  [if RTEMS_DEBUG is enabled])
161
[3da33bf8]162RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
[28caa1d]163  [test x"$enable_multiprocessing" = xyes],
[3da33bf8]164  [1],
165  [if multiprocessing is enabled])
166
167RTEMS_CPUOPT([RTEMS_NEWLIB],
[28caa1d]168  [test x"$RTEMS_USE_NEWLIB" = xyes],
[3da33bf8]169  [1],
170  [if using newlib])
171
172RTEMS_CPUOPT([RTEMS_POSIX_API],
[28caa1d]173  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
[3da33bf8]174  [1],
175  [if posix api is supported])
176
[06dcaf0]177RTEMS_CPUOPT([RTEMS_SMP],
178  [test x"$RTEMS_HAS_SMP" = xyes],
179  [1],
180  [if SMP is enabled])
181
[28caa1d]182RTEMS_CPUOPT([RTEMS_NETWORKING],
183  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
184  [1],
185  [if networking is enabled])
186
[3da33bf8]187RTEMS_CPUOPT([RTEMS_VERSION],
188  [true],
[1bcbe41]189  ["]_RTEMS_VERSION["],
[3da33bf8]190  [RTEMS version string])
191
[c6f7e060]192RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
193  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
194  [1],
195  [disable nanosecond granularity for statistics])
196
[c3330a8]197RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
198  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
199  [1],
[b4dca71]200  [disable nanosecond granularity for cpu usage statistics])
[c3330a8]201
202RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
203  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
204  [1],
[b4dca71]205  [disable nanosecond granularity for period statistics])
[c3330a8]206
[e2ba62d1]207## This improves both the size and coverage analysis.
[5603b5a6]208RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
209  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
210  [1],
[b4dca71]211  [disable inlining _Thread_Enable_dispatch])
[5603b5a6]212
[e2ba62d1]213## This improves both the size and coverage analysis.
214RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
215  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
216  [1],
[b4dca71]217  [disable inlining _Thread_Enable_dispatch])
[e2ba62d1]218
[3a08272]219## This improves both the size and coverage analysis.
220RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
221  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
222  [1],
223  [disable inlining _Thread_queue_Enqueue_priority])
224
[e2ba62d1]225## This gives the same behavior as 4.8 and older
[66a9239a]226RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
[a5de1ef]227  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
[fd84982]228  [1],
[b4dca71]229  [disable strict order mutex])
[fd84982]230
[7f5a245d]231## Deactivate ada bindings
232RTEMS_CPUOPT([__RTEMS_ADA__],
233  [test x"${enable_ada}" = x"yes"],
234  [1],
235  [Define to 1 if ada/gnat bindings are built-in])
236
[263ab4b]237## Then we propagate a private copy of the value into cpuopts.h
238## so it is always available to the RTEMS header files.
239
240RTEMS_CPUOPT([__RTEMS_SIZEOF_VOID_P__],
241  [true],
242  [$ac_cv_sizeof_void_p],
243  [Size of a void * pointer])
244
[ea35fdc6]245RTEMS_CPUOPT([__RTEMS_MAJOR__],
246  [true],
247  [$rtems_major],
248  [major version portion of an RTEMS release])
249
250RTEMS_CPUOPT([__RTEMS_MINOR__],
251  [true],
252  [$rtems_minor],
253  [minor version portion of an RTEMS release])
254
255RTEMS_CPUOPT([__RTEMS_REVISION__],
256  [true],
257  [$rtems_revision],
258  [revision version portion of an RTEMS release])
259
[b4dca71]260_RTEMS_CPUOPT_FINI
[3da33bf8]261
[8217c40]262AC_ENABLE_MULTILIB([Makefile],[..])
263
[e30210ea]264# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
265AC_MSG_CHECKING([for assignable stdio])
266AC_COMPILE_IFELSE(
267  [AC_LANG_PROGRAM(
268    [#include <stdio.h>],
269    [stdin = fopen("/tmp", "r")])],
270  [HAVE_ASSIGNABLE_STDIO=yes],
271  [HAVE_ASSIGNABLE_STDIO=no])
272AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
273
274# libmisc/serdbg exploits weak symbols
[d71ab7fd]275RTEMS_CHECK_GCC_WEAK
[f7952533]276
[07da959]277# FIXME: These checks are only in here to provide
278# configuration-time diagnostics and are not really used.
279AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
280AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
[21d9736]281
282# FIXME: We should get rid of this.
283# So far, only used in libfs/src/nfsclient/src/dirutils.c
284AC_CHECK_SIZEOF([mode_t])
285AC_CHECK_SIZEOF([off_t])
286
[ad9eaf26]287# FIXME: We should get rid of this. It's a cludge.
288AC_CHECK_SIZEOF([time_t])
289
[da0475f]290# FIXME: Mandatory in SUSv4, optional in SUSv3.
291#   Not implemented in GCC/newlib, so far.
292AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
293AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
[07da959]294
295## BSD-ism, excluded from POSIX, but available on most platforms
296AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
297
298## Check if libc provides BSD's strlcpy/strlcat
299AC_CHECK_FUNCS(strlcpy strlcat)
300
301# ... far too many conditionals ...
[f9f51d0]302AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
[07da959]303AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
[b422de6c]304
[1bcbe41]305AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
[06dcaf0]306AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
[b422de6c]307
[2d80c75]308AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
[6e46fa73]309AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
[b422de6c]310
[720633c]311AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
[e30210ea]312AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
[5cad5bf]313AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
314&& test x"$enable_ada" = x"yes"])
[e30210ea]315
[9f62936]316AM_CONDITIONAL([LIBDOSFS],[dnl
[720633c]317test x"$ac_cv_type_uint8_t" = xyes \
[9f62936]318&& test x"$ac_cv_type_uint16_t" = xyes])
319
[3da33bf8]320AC_CONFIG_HEADER(config.h)
321
[58d38a0]322## These are needed by the NFS Client
323AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
324AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
325&& test -n "$AWK" \
326&& test "$enable_rpcgen" = yes])
327
[ada8d531]328RTEMS_AMPOLISH3
329
[70810dc]330# Explicitly list all Makefiles here
[b422de6c]331AC_CONFIG_FILES([
[5060d4f]332Doxyfile
[b422de6c]333Makefile
[1896a650]334rtems/Makefile
335sapi/Makefile
[eb299afc]336score/Makefile
337score/cpu/Makefile
[e9d90764]338score/cpu/arm/Makefile
[b78d94d]339score/cpu/bfin/Makefile
[05f3270]340score/cpu/avr/Makefile
[e9d90764]341score/cpu/h8300/Makefile
342score/cpu/i386/Makefile
[15e44fd]343score/cpu/lm32/Makefile
[e9d90764]344score/cpu/m68k/Makefile
[0c34b176]345score/cpu/m32c/Makefile
[5365e60]346score/cpu/m32r/Makefile
[e9d90764]347score/cpu/mips/Makefile
[7a28ac8]348score/cpu/nios2/Makefile
[e9d90764]349score/cpu/powerpc/Makefile
350score/cpu/sh/Makefile
351score/cpu/sparc/Makefile
[ecbbd968]352score/cpu/sparc64/Makefile
[6b400fed]353score/cpu/no_cpu/Makefile
[b422de6c]354posix/Makefile
355libblock/Makefile
356libfs/Makefile
[58d38a0]357libfs/src/nfsclient/Makefile
[db27544]358libgnat/Makefile
[07da959]359libcsupport/Makefile
[b422de6c]360libnetworking/Makefile
[da0fc5d]361librpc/Makefile
[b422de6c]362libmisc/Makefile
[6339f467]363libi2c/Makefile
[a70b07b]364libmd/Makefile
[fa645f6]365zlib/Makefile
[f26145b]366ftpd/Makefile
[8280caa4]367telnetd/Makefile
[c5bb2a4e]368pppd/Makefile
[ba955609]369mghttpd/Makefile
[28caa1d]370wrapup/Makefile])
371
372AC_CONFIG_COMMANDS([preinstall-stamp],
373[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
374[MAKE=${MAKE}
375with_multisubdir="$with_multisubdir"])
[92ed8c2]376
[66387986]377AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.