source: rtems/cpukit/configure.ac @ 5803f37

5
Last change on this file since 5803f37 was a6e39d4a, checked in by Sebastian Huber <sebastian.huber@…>, on 02/27/19 at 06:22:54

Update Doxyfile to Doxygen 1.8.15

Generate Doxygen output in doc and ignore this directory in Git. Add
RTEMS logo. The Doxygen documentation is now built using the source
tree. Just invoke "doxygen" in the top-level source directory.

The Doxyfile works also with at least Doxygen 1.8.13 and Doxygen 1.8.14.

Update #3705.

  • Property mode set to 100644
File size: 11.1 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([..],[])
7RTEMS_SOURCE_TOP
8RTEMS_BUILD_TOP
9
10RTEMS_CANONICAL_TARGET_CPU
11
12AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.12.2])
13AM_MAINTAINER_MODE
14
15RTEMS_ENABLE_MULTIPROCESSING
16RTEMS_ENABLE_POSIX
17RTEMS_ENABLE_RTEMS_DEBUG
18RTEMS_ENABLE_NETWORKING
19RTEMS_ENABLE_PARAVIRT
20RTEMS_ENABLE_PROFILING
21RTEMS_ENABLE_DRVMGR
22
23RTEMS_ENV_RTEMSCPU
24RTEMS_CHECK_RTEMS_DEBUG
25
26AC_DEFUN([RTEMS_TOOL_CHAIN_ERROR],AC_MSG_ERROR([please update your tool chain via the RSB <https://docs.rtems.org/branches/master/rsb/quick-start.html>]))
27
28# Is this a supported CPU?
29AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
30if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
31  AC_MSG_RESULT(yes)
32else
33  AC_MSG_ERROR(no)
34fi
35
36RTEMS_PROG_CC_FOR_TARGET
37AM_PROG_CC_C_O
38RTEMS_CANONICALIZE_TOOLS
39RTEMS_PROG_CCAS
40AC_PROG_RANLIB
41
42AC_MSG_CHECKING([for a need to avoid a long argument list])
43
44hack_to_avoid_long_arg_list=no
45case "${build_os}" in
46  *cygwin*|*mingw*|*msys*)
47     hack_to_avoid_long_arg_list=yes
48     ;;
49   *)
50     ;;
51esac
52
53AC_MSG_RESULT([${hack_to_avoid_long_arg_list}])
54AM_CONDITIONAL([HACK_TO_AVOID_LONG_ARG_LIST], [test "${hack_to_avoid_long_arg_list}" = yes])
55
56RTEMS_CHECK_NEWLIB
57
58# Newlib proprietary
59AC_CHECK_MEMBER([struct _Thread_queue_Queue._name],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <sys/lock.h>])
60
61# pthread-functions not declared in some versions of newlib.
62RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
63RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
64RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
65RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
66
67# These are SMP related and were added to newlib by RTEMS.
68RTEMS_CHECK_FUNC([pthread_attr_setaffinity_np],[
69  #define _GNU_SOURCE
70  #include <pthread.h>])
71RTEMS_CHECK_FUNC([pthread_attr_getaffinity_np],[
72  #define _GNU_SOURCE
73  #include <pthread.h>])
74RTEMS_CHECK_FUNC([pthread_setaffinity_np],[
75  #define _GNU_SOURCE
76  #include <pthread.h>])
77RTEMS_CHECK_FUNC([pthread_getaffinity_np],[
78  #define _GNU_SOURCE
79  #include <pthread.h>])
80RTEMS_CHECK_FUNC([pthread_getattr_np],[
81  #define _GNU_SOURCE
82  #include <pthread.h>])
83
84AC_LANG_PUSH(C)
85AC_MSG_CHECKING([for mprotect(const void *, ...)])
86AC_COMPILE_IFELSE([AC_LANG_SOURCE([
87#include <sys/mman.h>
88int mprotect(const void *, size_t, int);
89])],[
90AC_MSG_RESULT([yes])
91AC_DEFINE(HAVE_MPROTECT_CONST, [], [mprotect(const void *, ...)])
92],[
93AC_MSG_RESULT([no])
94])
95AC_MSG_CHECKING([for pthread_mutex_getprioceiling(const pthread_mutex_t *, ...)])
96AC_COMPILE_IFELSE([AC_LANG_SOURCE([
97#include <pthread.h>
98int pthread_mutex_getprioceiling(const pthread_mutex_t *__restrict, int *);
99])],[
100AC_MSG_RESULT([yes])
101AC_DEFINE(HAVE_PTHREAD_MUTEX_GETCEILING_CONST, [], [pthread_mutex_getprioceiling(const pthread_mutex_t *, ...)])
102],[
103AC_MSG_RESULT([no])
104])
105AC_MSG_CHECKING([for pthread_setschedparam(..., const struct sched_param *)])
106AC_COMPILE_IFELSE([AC_LANG_SOURCE([
107#include <pthread.h>
108int pthread_setschedparam(pthread_t, int, const struct sched_param *);
109])],[
110AC_MSG_RESULT([yes])
111AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM_CONST, [], [pthread_setschedparam(..., const struct sched_param *)])
112],[
113AC_MSG_RESULT([no])
114])
115AC_LANG_POP(C)
116
117# Some toolchain sanity checks and diagnostics
118RTEMS_CHECK_GCC_SANITY
119
120# These are conditionally defined by the toolchain
121# FIXME: we should either conditionally compile those parts in
122# RTEMS depending on them, or abort - For now, simply check.
123AC_CHECK_HEADER([pthread.h],[
124  AC_CHECK_TYPES([pthread_rwlock_t])
125  AC_CHECK_TYPES([pthread_barrier_t])
126  AC_CHECK_TYPES([pthread_spinlock_t])
127  AC_CHECK_TYPES([struct _pthread_cleanup_context],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <pthread.h>])
128  AC_CHECK_TYPES([struct _Priority_Node],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <pthread.h>])
129])
130
131RTEMS_CHECK_MULTIPROCESSING
132RTEMS_CHECK_POSIX_API
133RTEMS_CHECK_NETWORKING
134RTEMS_CHECK_SMP
135if test "${RTEMS_HAS_SMP}" = "yes"; then
136  AC_CHECK_HEADERS([stdatomic.h],[],[RTEMS_TOOL_CHAIN_ERROR])
137fi
138
139rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
140rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
141rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
142
143_RTEMS_CPUOPT_INIT
144
145RTEMS_CPUOPT([RTEMS_DEBUG],
146  [test x"${enable_rtems_debug}" = x"yes"],
147  [1],
148  [if RTEMS_DEBUG is enabled])
149
150RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
151  [test x"$enable_multiprocessing" = xyes],
152  [1],
153  [if multiprocessing is enabled])
154
155RTEMS_CPUOPT([RTEMS_NEWLIB],
156  [test x"$RTEMS_USE_NEWLIB" = xyes],
157  [1],
158  [if using newlib])
159
160RTEMS_CPUOPT([RTEMS_POSIX_API],
161  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
162  [1],
163  [if posix api is supported])
164
165RTEMS_CPUOPT([RTEMS_SMP],
166  [test x"$RTEMS_HAS_SMP" = xyes],
167  [1],
168  [if SMP is enabled])
169
170RTEMS_CPUOPT([RTEMS_PARAVIRT],
171  [test x"$RTEMS_HAS_PARAVIRT" = xyes],
172  [1],
173  [PARAVIRT is enabled])
174
175RTEMS_CPUOPT([RTEMS_PROFILING],
176  [test x"$RTEMS_HAS_PROFILING" = xyes],
177  [1],
178  [if profiling is enabled])
179
180RTEMS_CPUOPT([RTEMS_NETWORKING],
181  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
182  [1],
183  [if networking is enabled])
184
185RTEMS_CPUOPT([RTEMS_DRVMGR_STARTUP],
186  [test x"$enable_drvmgr" = xyes],
187  [1],
188  [if driver manager api is supported])
189
190RTEMS_CPUOPT([RTEMS_VERSION],
191  [true],
192  ["]_RTEMS_VERSION["],
193  [RTEMS version string])
194
195## Header file differences that need to be known in .h after install
196
197## Deactivate ada bindings
198RTEMS_CPUOPT([__RTEMS_ADA__],
199  [test x"${enable_ada}" = x"yes"],
200  [1],
201  [Define to 1 if ada/gnat bindings are built-in])
202
203# These are used to provide <rtems/inttypes.h
204AC_CHECK_SIZEOF([mode_t])
205AC_CHECK_SIZEOF([off_t])
206AC_CHECK_SIZEOF([time_t])
207AC_CHECK_SIZEOF([size_t])
208AC_CHECK_SIZEOF([blksize_t])
209AC_CHECK_SIZEOF([blkcnt_t])
210
211## Provide sizeof(mode_t) information via cpuopts.h
212RTEMS_CPUOPT([__RTEMS_SIZEOF_MODE_T__],
213  [true],
214  [${ac_cv_sizeof_mode_t}],
215  [sizeof(mode_t)])
216
217## Provide sizeof(off_t) information via cpuopts.h
218RTEMS_CPUOPT([__RTEMS_SIZEOF_OFF_T__],
219  [true],
220  [${ac_cv_sizeof_off_t}],
221  [sizeof(off_t)])
222
223## Provide sizeof(time_t) information via cpuopts.h
224RTEMS_CPUOPT([__RTEMS_SIZEOF_TIME_T__],
225  [true],
226  [${ac_cv_sizeof_time_t}],
227  [sizeof(time_t)])
228
229## Provide sizeof(blksize_t) information via cpuopts.h
230RTEMS_CPUOPT([__RTEMS_SIZEOF_BLKSIZE_T__],
231  [true],
232  [${ac_cv_sizeof_blksize_t}],
233  [sizeof(blksize_t)])
234
235## Provide sizeof(blkcnt_t) information via cpuopts.h
236RTEMS_CPUOPT([__RTEMS_SIZEOF_BLKCNT_T__],
237  [true],
238  [${ac_cv_sizeof_blkcnt_t}],
239  [sizeof(blkcnt_t)])
240
241## Then we propagate a private copy of the value into cpuopts.h
242## so it is always available to the RTEMS header files.
243
244RTEMS_CPUOPT([__RTEMS_MAJOR__],
245  [true],
246  [$rtems_major],
247  [major version portion of an RTEMS release])
248
249RTEMS_CPUOPT([__RTEMS_MINOR__],
250  [true],
251  [$rtems_minor],
252  [minor version portion of an RTEMS release])
253
254RTEMS_CPUOPT([__RTEMS_REVISION__],
255  [true],
256  [$rtems_revision],
257  [revision version portion of an RTEMS release])
258
259_RTEMS_CPUOPT_FINI
260
261AC_ENABLE_MULTILIB([Makefile],[..])
262
263# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
264AC_MSG_CHECKING([for assignable stdio])
265AC_COMPILE_IFELSE(
266  [AC_LANG_PROGRAM(
267    [#include <stdio.h>],
268    [stdin = fopen("/tmp", "r")])],
269  [HAVE_ASSIGNABLE_STDIO=yes],
270  [HAVE_ASSIGNABLE_STDIO=no])
271AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
272
273# libmisc/serdbg exploits weak symbols
274RTEMS_CHECK_GCC_WEAK
275
276# Used by legacy network stack
277AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
278
279# Ensure that Newlib does not provide things now in <machine/_timecounter.h>
280AC_CHECK_DECLS([_Timecounter_Time_second],[RTEMS_TOOL_CHAIN_ERROR],,[#include <sys/time.h>])
281
282# ... far too many conditionals ...
283AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
284
285AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
286AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
287
288AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
289AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
290
291AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
292AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
293AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
294&& test x"$enable_ada" = x"yes"])
295
296AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
297
298AC_CONFIG_HEADER(config.h)
299
300## These are needed by the NFS Client
301AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
302AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
303&& test -n "$AWK" \
304&& test "$enable_rpcgen" = yes])
305
306# Filter dynamic loading to only build for architectures that have
307# reloc backends
308AC_MSG_CHECKING([whether CPU supports libdl])
309case $RTEMS_CPU in
310  arm | i386 | m68k | mips | moxie | powerpc | sparc)
311   HAVE_LIBDL=yes ;;
312  # bfin has an issue to resolve with libdl. See ticket #2252
313  bfin)
314   HAVE_LIBDL=no ;;
315  # lm32 has an issue to resolve with libdl. See ticket #2283
316  lm32)
317   HAVE_LIBDL=no ;;
318  # v850 has an issue to resolve with libdl. See ticket #2260
319  v850)
320   HAVE_LIBDL=no ;;
321  *)
322   HAVE_LIBDL=no ;;
323esac
324AM_CONDITIONAL(LIBDL,[test x"$HAVE_LIBDL" = x"yes"])
325AC_MSG_RESULT([$HAVE_LIBDL])
326
327# Filter debugger to only build for architectures that have a target backend
328AC_MSG_CHECKING([whether CPU supports libdebugger])
329case $RTEMS_CPU in
330  arm | i386)
331   HAVE_LIBDEBUGGER=yes ;;
332  *)
333   HAVE_LIBDEBUGGER=no ;;
334esac
335AM_CONDITIONAL(LIBDEBUGGER,[test x"$HAVE_LIBDEBUGGER" = x"yes"])
336AC_MSG_RESULT([$HAVE_LIBDEBUGGER])
337
338# Filter libpci to only build for architectures that have support for it
339AC_MSG_CHECKING([whether CPU supports libpci])
340case $RTEMS_CPU in
341  sparc)
342   HAVE_LIBPCI=yes ;;
343  *)
344   HAVE_LIBPCI=no ;;
345esac
346AM_CONDITIONAL(LIBPCI,[test x"$HAVE_LIBPCI" = x"yes"])
347AC_MSG_RESULT([$HAVE_LIBPCI])
348
349# Filter libdrvmgr to only build for architectures that have support for it
350AC_MSG_CHECKING([whether CPU supports libdrvmgr])
351case $RTEMS_CPU in
352  riscv | sparc)
353   HAVE_LIBDRVMGR=yes ;;
354  *)
355   HAVE_LIBDRVMGR=no ;;
356esac
357AM_CONDITIONAL(LIBDRVMGR,[test x"$HAVE_LIBDRVMGR" = x"yes"])
358AC_MSG_RESULT([$HAVE_LIBDRVMGR])
359
360AM_CONDITIONAL([CPU_ARM],[test $RTEMS_CPU = "arm"])
361AM_CONDITIONAL([CPU_BFIN],[test $RTEMS_CPU = "bfin"])
362AM_CONDITIONAL([CPU_EPIPHANY],[test $RTEMS_CPU = "epiphany"])
363AM_CONDITIONAL([CPU_I386],[test $RTEMS_CPU = "i386"])
364AM_CONDITIONAL([CPU_LM32],[test $RTEMS_CPU = "lm32"])
365AM_CONDITIONAL([CPU_M68K],[test $RTEMS_CPU = "m68k"])
366AM_CONDITIONAL([CPU_MIPS],[test $RTEMS_CPU = "mips"])
367AM_CONDITIONAL([CPU_MOXIE],[test $RTEMS_CPU = "moxie"])
368AM_CONDITIONAL([CPU_NIOS2],[test $RTEMS_CPU = "nios2"])
369AM_CONDITIONAL([CPU_NO_CPU],[test $RTEMS_CPU = "no_cpu"])
370AM_CONDITIONAL([CPU_OR1K],[test $RTEMS_CPU = "or1k"])
371AM_CONDITIONAL([CPU_POWERPC],[test $RTEMS_CPU = "powerpc"])
372AM_CONDITIONAL([CPU_RISCV],[test $RTEMS_CPU = "riscv"])
373AM_CONDITIONAL([CPU_SH],[test $RTEMS_CPU = "sh"])
374AM_CONDITIONAL([CPU_SPARC64],[test $RTEMS_CPU = "sparc64"])
375AM_CONDITIONAL([CPU_SPARC],[test $RTEMS_CPU = "sparc"])
376AM_CONDITIONAL([CPU_V850],[test $RTEMS_CPU = "v850"])
377AM_CONDITIONAL([CPU_X86_64],[test $RTEMS_CPU = "x86_64"])
378
379# Explicitly list all Makefiles here
380AC_CONFIG_FILES([Makefile])
381
382AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.