source: rtems/cpukit/configure.ac @ 2d7ae960

4.11
Last change on this file since 2d7ae960 was 2d7ae960, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 11, 2012 at 6:37:29 PM

v850 port: Initial addition with BSP for simulator in GDB

Port

+ v850 does not have appear to have any optimized bit scan instructions
+ v850 does have single instructions for wap u16 and u32
+ Code path optimization preferences set
+ Add BSP variants for each GCC CPU model flag and a README

  • v850e1 variant does not work (fails during BSP initialization)

BSP for GDB v850 Simulator

+ linkcmds matches defaults in GDB simulator with RTEMS mods
+ crt1.c added from v850 newlib port for main()
+ BSP exits cleanly
+ printk and console I/O work
+ uses clock tick from IDLE task
+ Tests not requiring real clock ISR work

Documentation

+ CPU Supplment chapter for v850 added

  • Property mode set to 100644
File size: 12.0 KB
Line 
1## Process this file with autoconf to produce a configure script.
2
3AC_PREREQ([2.68])
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.11.1])
11AM_MAINTAINER_MODE
12
13RTEMS_ENABLE_MULTILIB
14RTEMS_ENABLE_MULTIPROCESSING
15RTEMS_ENABLE_POSIX
16RTEMS_ENABLE_RTEMS_DEBUG
17RTEMS_ENABLE_NETWORKING
18
19RTEMS_ENV_RTEMSCPU
20RTEMS_CHECK_RTEMS_DEBUG
21
22# Is this a supported CPU?
23AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
24if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
25  AC_MSG_RESULT(yes)
26else
27  AC_MSG_ERROR(no)
28fi
29
30RTEMS_PROG_CC_FOR_TARGET
31RTEMS_PROG_CCAS
32RTEMS_CANONICALIZE_TOOLS
33AM_PROG_CC_C_O
34AC_PROG_RANLIB
35
36RTEMS_CHECK_NEWLIB
37
38# BSD-isms, used throughout the sources
39# Not really used by this configure script
40# FIXME: They should be eliminated if possible.
41AC_CHECK_FUNCS([strsep strcasecmp snprintf])
42AC_CHECK_FUNCS([strdup strndup strncasecmp])
43AC_CHECK_FUNCS([bcopy bcmp])
44AC_CHECK_FUNCS([isascii fileno])
45
46# <FIXME>
47#   Check for functions supplied by newlib >= 1.17.0
48# Newlib's posix/ directory
49AC_CHECK_FUNCS([readdir_r isatty])
50AC_CHECK_FUNCS([creat \
51  opendir closedir readdir rewinddir scandir seekdir \
52  sleep \
53  telldir \
54  usleep],,
55  [rtems_missing_func="$ac_func";break])
56AS_IF([test -n "$rtems_missing_func"],
57  AC_MSG_ERROR([Missing function $rtems_missing_func in libc])])
58AC_CHECK_FUNCS([__assert])
59AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
60AC_CHECK_FUNCS([regcomp regexec regerror regfree])
61
62# Mandated by POSIX, decls not present in some versions of newlib
63AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>])
64AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>])
65AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>])
66
67# Newlib proprietary
68AC_CHECK_HEADERS([envlock.h])
69AC_CHECK_DECLS([__env_lock],,,[#include <envlock.h>])
70AC_CHECK_DECLS([__env_unlock],,,[#include <envlock.h>])
71
72# Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME
73AC_CHECK_DECL([CLOCK_PROCESS_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_PROCESS_CPUTIME_ID])],[#include <time.h>])
74AC_CHECK_DECL([CLOCK_THREAD_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_THREAD_CPUTIME_ID])],[#include <time.h>])
75
76# Mandated by POSIX, decls not present in some versions of newlib,
77# some versions stubbed in newlib's rtems crt0
78RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>])
79RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>])
80RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>])
81RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>])
82RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>])
83RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>])
84RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>])
85RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>])
86RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>])
87RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>])
88RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>])
89RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>])
90RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>])
91RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>])
92
93# pthread-functions not declared in some versions of newlib.
94RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
95RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
96RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
97RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
98
99# Mandated by POSIX, not declared in some versions of newlib.
100AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
101
102# Newlib's unix/ directory
103AC_CHECK_FUNCS([ttyname getcwd])
104# </FIXME>
105
106# Check if the installed toolchain provides these headers
107# and error out if not.
108AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
109  [rtems_missing_header="$ac_header";break])
110AS_IF([test -n "$rtems_missing_header"],
111  AC_MSG_ERROR([Missing required header $rtems_missing_header])])
112
113## error out if libc doesn't provide stdint.h
114AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
115[AC_MSG_ERROR([Required header stdint.h not found])])
116
117## error out if libc doesn't provide inttypes.h
118AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
119[AC_MSG_ERROR([Required header inttypes.h not found])])
120
121AC_HEADER_STDBOOL
122AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
123[AC_MSG_ERROR([No sufficient stdbool.h found])])
124
125AC_CHECK_TYPES([ uint8_t,  int8_t])
126AC_CHECK_TYPES([uint16_t, int16_t])
127AC_CHECK_TYPES([uint32_t, int32_t])
128AC_CHECK_TYPES([uint64_t, int64_t])
129AC_CHECK_TYPES([uintmax_t, intmax_t])
130AC_CHECK_TYPES([uintptr_t, intptr_t])
131
132# Some toolchain sanity checks and diagnostics
133RTEMS_CHECK_GCC_SANITY
134
135# These are conditionally defined by the toolchain
136# FIXME: we should either conditionally compile those parts in
137# RTEMS depending on them, or abort - For now, simply check.
138AC_CHECK_HEADER([pthread.h],[
139  AC_CHECK_TYPES([pthread_rwlock_t])
140  AC_CHECK_TYPES([pthread_barrier_t])
141  AC_CHECK_TYPES([pthread_spinlock_t])
142])
143
144AC_CHECK_HEADER([signal.h],[
145  AC_CHECK_TYPES([sighandler_t])
146])
147
148RTEMS_CHECK_MULTIPROCESSING
149RTEMS_CHECK_POSIX_API
150RTEMS_CHECK_NETWORKING
151RTEMS_CHECK_SMP
152
153rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
154rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
155rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
156
157## This is needed to generate the field offsets of the per CPU
158## data structure so they can be accessed from assembly code.
159AC_CHECK_SIZEOF([void *])
160
161_RTEMS_CPUOPT_INIT
162
163RTEMS_CPUOPT([RTEMS_DEBUG],
164  [test x"${enable_rtems_debug}" = x"yes"],
165  [1],
166  [if RTEMS_DEBUG is enabled])
167
168RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
169  [test x"$enable_multiprocessing" = xyes],
170  [1],
171  [if multiprocessing is enabled])
172
173RTEMS_CPUOPT([RTEMS_NEWLIB],
174  [test x"$RTEMS_USE_NEWLIB" = xyes],
175  [1],
176  [if using newlib])
177
178RTEMS_CPUOPT([RTEMS_POSIX_API],
179  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
180  [1],
181  [if posix api is supported])
182
183RTEMS_CPUOPT([RTEMS_SMP],
184  [test x"$RTEMS_HAS_SMP" = xyes],
185  [1],
186  [if SMP is enabled])
187
188RTEMS_CPUOPT([RTEMS_NETWORKING],
189  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
190  [1],
191  [if networking is enabled])
192
193RTEMS_CPUOPT([RTEMS_VERSION],
194  [true],
195  ["]_RTEMS_VERSION["],
196  [RTEMS version string])
197
198RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__],
199  [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"],
200  [1],
201  [disable nanosecond granularity for statistics])
202
203RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__],
204  [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"],
205  [1],
206  [disable nanosecond granularity for cpu usage statistics])
207
208RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__],
209  [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"],
210  [1],
211  [disable nanosecond granularity for period statistics])
212
213## This improves both the size and coverage analysis.
214RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
215  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
216  [1],
217  [disable inlining _Thread_Enable_dispatch])
218
219## This improves both the size and coverage analysis.
220RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
221  [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"],
222  [1],
223  [disable inlining _Thread_Enable_dispatch])
224
225## This improves both the size and coverage analysis.
226RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__],
227  [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"],
228  [1],
229  [disable inlining _Thread_queue_Enqueue_priority])
230
231## This gives the same behavior as 4.8 and older
232RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
233  [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
234  [1],
235  [disable strict order mutex])
236
237## Deactivate ada bindings
238RTEMS_CPUOPT([__RTEMS_ADA__],
239  [test x"${enable_ada}" = x"yes"],
240  [1],
241  [Define to 1 if ada/gnat bindings are built-in])
242
243## Then we propagate a private copy of the value into cpuopts.h
244## so it is always available to the RTEMS header files.
245
246RTEMS_CPUOPT([__RTEMS_SIZEOF_VOID_P__],
247  [true],
248  [$ac_cv_sizeof_void_p],
249  [Size of a void * pointer])
250
251RTEMS_CPUOPT([__RTEMS_MAJOR__],
252  [true],
253  [$rtems_major],
254  [major version portion of an RTEMS release])
255
256RTEMS_CPUOPT([__RTEMS_MINOR__],
257  [true],
258  [$rtems_minor],
259  [minor version portion of an RTEMS release])
260
261RTEMS_CPUOPT([__RTEMS_REVISION__],
262  [true],
263  [$rtems_revision],
264  [revision version portion of an RTEMS release])
265
266_RTEMS_CPUOPT_FINI
267
268AC_ENABLE_MULTILIB([Makefile],[..])
269
270# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
271AC_MSG_CHECKING([for assignable stdio])
272AC_COMPILE_IFELSE(
273  [AC_LANG_PROGRAM(
274    [#include <stdio.h>],
275    [stdin = fopen("/tmp", "r")])],
276  [HAVE_ASSIGNABLE_STDIO=yes],
277  [HAVE_ASSIGNABLE_STDIO=no])
278AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
279
280# libmisc/serdbg exploits weak symbols
281RTEMS_CHECK_GCC_WEAK
282
283# FIXME: These checks are only in here to provide
284# configuration-time diagnostics and are not really used.
285AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
286AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
287
288# FIXME: We should get rid of this.
289# So far, only used in libfs/src/nfsclient/src/dirutils.c
290AC_CHECK_SIZEOF([mode_t])
291AC_CHECK_SIZEOF([off_t])
292
293# FIXME: We should get rid of this. It's a cludge.
294AC_CHECK_SIZEOF([time_t])
295
296# FIXME: Mandatory in SUSv4, optional in SUSv3.
297#   Not implemented in GCC/newlib, so far.
298AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
299AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
300
301## BSD-ism, excluded from POSIX, but available on most platforms
302AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
303AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
304
305## Check if libc provides BSD's strlcpy/strlcat
306AC_CHECK_FUNCS(strlcpy strlcat)
307
308## Check if libc provides decl of utime
309## FIXME: utime has been deprecated in SUSv4.
310##        and is likely to be removed in future versions.
311## FIXME (BUG in newlib): SUSv4 saids including <utime.h> should be sufficient.
312AC_CHECK_DECLS([utime],,,[#include <sys/types.h>
313#include <utime.h>])
314## Check if libc provides decl of utimes
315AC_CHECK_DECLS([utimes],,,[#include <sys/time.h>])
316
317# ... far too many conditionals ...
318AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
319AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
320
321AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
322AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
323
324AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
325AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
326
327AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
328AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
329AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
330&& test x"$enable_ada" = x"yes"])
331
332AM_CONDITIONAL([LIBDOSFS],[dnl
333test x"$ac_cv_type_uint8_t" = xyes \
334&& test x"$ac_cv_type_uint16_t" = xyes])
335
336AC_CONFIG_HEADER(config.h)
337
338## These are needed by the NFS Client
339AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
340AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
341&& test -n "$AWK" \
342&& test "$enable_rpcgen" = yes])
343
344RTEMS_AMPOLISH3
345
346# Explicitly list all Makefiles here
347AC_CONFIG_FILES([
348Doxyfile
349Makefile
350rtems/Makefile
351sapi/Makefile
352score/Makefile
353score/cpu/Makefile
354score/cpu/arm/Makefile
355score/cpu/bfin/Makefile
356score/cpu/avr/Makefile
357score/cpu/h8300/Makefile
358score/cpu/i386/Makefile
359score/cpu/lm32/Makefile
360score/cpu/m68k/Makefile
361score/cpu/m32c/Makefile
362score/cpu/m32r/Makefile
363score/cpu/mips/Makefile
364score/cpu/nios2/Makefile
365score/cpu/powerpc/Makefile
366score/cpu/sh/Makefile
367score/cpu/sparc/Makefile
368score/cpu/sparc64/Makefile
369score/cpu/v850/Makefile
370score/cpu/no_cpu/Makefile
371posix/Makefile
372libblock/Makefile
373libfs/Makefile
374libfs/src/nfsclient/Makefile
375libgnat/Makefile
376libcsupport/Makefile
377libnetworking/Makefile
378librpc/Makefile
379libmisc/Makefile
380libi2c/Makefile
381libmd/Makefile
382zlib/Makefile
383ftpd/Makefile
384telnetd/Makefile
385pppd/Makefile
386mghttpd/Makefile
387wrapup/Makefile])
388
389AC_CONFIG_COMMANDS([preinstall-stamp],
390[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
391[MAKE=${MAKE}
392with_multisubdir="$with_multisubdir"])
393
394AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.