source: rtems/cpukit/configure.ac @ e25acd8

5
Last change on this file since e25acd8 was bfcf1473, checked in by Sebastian Huber <sebastian.huber@…>, on 11/08/18 at 15:21:48

m32c: Remove this target

Update #3599.

  • Property mode set to 100644
File size: 11.1 KB
RevLine 
[66387986]1## Process this file with autoconf to produce a configure script.
[eb299afc]2
[0f77281]3AC_PREREQ([2.69])
[12072880]4AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
[66387986]5AC_CONFIG_SRCDIR([score])
[2f4c86f]6RTEMS_TOP([..],[])
[2afb22b]7RTEMS_SOURCE_TOP
8RTEMS_BUILD_TOP
[eb299afc]9
10RTEMS_CANONICAL_TARGET_CPU
11
[bb2b825]12AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.12.2])
[eb299afc]13AM_MAINTAINER_MODE
[04e6f7bf]14
[eb299afc]15RTEMS_ENABLE_MULTIPROCESSING
16RTEMS_ENABLE_POSIX
[39607984]17RTEMS_ENABLE_RTEMS_DEBUG
[3e39b47]18RTEMS_ENABLE_NETWORKING
[6ffaeb28]19RTEMS_ENABLE_PARAVIRT
[eafb040]20RTEMS_ENABLE_PROFILING
[e7fade3]21RTEMS_ENABLE_DRVMGR
[eb299afc]22
[04e6f7bf]23RTEMS_ENV_RTEMSCPU
[39607984]24RTEMS_CHECK_RTEMS_DEBUG
[eb299afc]25
[1772a04]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
[5b2e199]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
[955c499d]36RTEMS_PROG_CC_FOR_TARGET
[e7d110ba]37AM_PROG_CC_C_O
[9a4eca5]38RTEMS_CANONICALIZE_TOOLS
39RTEMS_PROG_CCAS
[e73e576]40AC_PROG_RANLIB
[eb299afc]41
[9d1f17a9]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
[eb299afc]56RTEMS_CHECK_NEWLIB
57
[b317c391]58# Newlib proprietary
[1772a04]59AC_CHECK_MEMBER([struct _Thread_queue_Queue._name],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <sys/lock.h>])
[b317c391]60
[199296db]61# pthread-functions not declared in some versions of newlib.
[e76a477]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>])
[199296db]66
[801a1fc6]67# These are SMP related and were added to newlib by RTEMS.
[57997d8]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>])
[801a1fc6]83
[77fbbd6]84AC_LANG_PUSH(C)
[aac36d15]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])
[77fbbd6]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
[72e975e]117# Some toolchain sanity checks and diagnostics
118RTEMS_CHECK_GCC_SANITY
[161016b]119
[9a673dba]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])
[1772a04]127  AC_CHECK_TYPES([struct _pthread_cleanup_context],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <pthread.h>])
[e46a075]128  AC_CHECK_TYPES([struct _Priority_Node],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <pthread.h>])
[9a673dba]129])
[bfe2fd3]130
[c43981b]131RTEMS_CHECK_MULTIPROCESSING
[8d4b5cf]132RTEMS_CHECK_POSIX_API
133RTEMS_CHECK_NETWORKING
[06dcaf0]134RTEMS_CHECK_SMP
[8a9568d2]135if test "${RTEMS_HAS_SMP}" = "yes"; then
[1772a04]136  AC_CHECK_HEADERS([stdatomic.h],[],[RTEMS_TOOL_CHAIN_ERROR])
[8a9568d2]137fi
[91fadb3]138
[ea35fdc6]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
[b4dca71]143_RTEMS_CPUOPT_INIT
[3da33bf8]144
[926e856a]145RTEMS_CPUOPT([RTEMS_DEBUG],
146  [test x"${enable_rtems_debug}" = x"yes"],
147  [1],
148  [if RTEMS_DEBUG is enabled])
149
[3da33bf8]150RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
[28caa1d]151  [test x"$enable_multiprocessing" = xyes],
[3da33bf8]152  [1],
153  [if multiprocessing is enabled])
154
155RTEMS_CPUOPT([RTEMS_NEWLIB],
[28caa1d]156  [test x"$RTEMS_USE_NEWLIB" = xyes],
[3da33bf8]157  [1],
158  [if using newlib])
159
160RTEMS_CPUOPT([RTEMS_POSIX_API],
[28caa1d]161  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
[3da33bf8]162  [1],
163  [if posix api is supported])
164
[06dcaf0]165RTEMS_CPUOPT([RTEMS_SMP],
166  [test x"$RTEMS_HAS_SMP" = xyes],
167  [1],
168  [if SMP is enabled])
169
[6ffaeb28]170RTEMS_CPUOPT([RTEMS_PARAVIRT],
171  [test x"$RTEMS_HAS_PARAVIRT" = xyes],
172  [1],
173  [PARAVIRT is enabled])
174
[eafb040]175RTEMS_CPUOPT([RTEMS_PROFILING],
176  [test x"$RTEMS_HAS_PROFILING" = xyes],
177  [1],
178  [if profiling is enabled])
179
[28caa1d]180RTEMS_CPUOPT([RTEMS_NETWORKING],
181  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
182  [1],
183  [if networking is enabled])
184
[e7fade3]185RTEMS_CPUOPT([RTEMS_DRVMGR_STARTUP],
186  [test x"$enable_drvmgr" = xyes],
187  [1],
188  [if driver manager api is supported])
189
[3da33bf8]190RTEMS_CPUOPT([RTEMS_VERSION],
191  [true],
[1bcbe41]192  ["]_RTEMS_VERSION["],
[3da33bf8]193  [RTEMS version string])
194
[5787188]195## Header file differences that need to be known in .h after install
196
[7f5a245d]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
[d420b67]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])
[438ca2f]208AC_CHECK_SIZEOF([blksize_t])
209AC_CHECK_SIZEOF([blkcnt_t])
[d420b67]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
[438ca2f]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
[263ab4b]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
[ea35fdc6]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
[e0627c69]254RTEMS_CPUOPT([__RTEMS_REVISION__],
[ea35fdc6]255  [true],
256  [$rtems_revision],
257  [revision version portion of an RTEMS release])
258
[b4dca71]259_RTEMS_CPUOPT_FINI
[3da33bf8]260
[8217c40]261AC_ENABLE_MULTILIB([Makefile],[..])
262
[e30210ea]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(
[ae5fe7e6]267    [#include <stdio.h>],
[e30210ea]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
[d71ab7fd]274RTEMS_CHECK_GCC_WEAK
[f7952533]275
[6da1bb0]276# Used by legacy network stack
[396b80e]277AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
[07da959]278
[b225aa1]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
[07da959]282# ... far too many conditionals ...
283AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
[b422de6c]284
[1bcbe41]285AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
[06dcaf0]286AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
[b422de6c]287
[2d80c75]288AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
[6e46fa73]289AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
[b422de6c]290
[720633c]291AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
[e30210ea]292AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
[5cad5bf]293AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
294&& test x"$enable_ada" = x"yes"])
[e30210ea]295
[91404de]296AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
297
[3da33bf8]298AC_CONFIG_HEADER(config.h)
299
[58d38a0]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
[ae5fe7e6]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
[f5201df]310  arm | i386 | m68k | mips | moxie | powerpc | sparc)
[ae5fe7e6]311   HAVE_LIBDL=yes ;;
[9bef63e]312  # bfin has an issue to resolve with libdl. See ticket #2252
313  bfin)
314   HAVE_LIBDL=no ;;
[a726ca64]315  # lm32 has an issue to resolve with libdl. See ticket #2283
316  lm32)
317   HAVE_LIBDL=no ;;
[1d061ee]318  # v850 has an issue to resolve with libdl. See ticket #2260
319  v850)
320   HAVE_LIBDL=no ;;
[ae5fe7e6]321  *)
322   HAVE_LIBDL=no ;;
323esac
324AM_CONDITIONAL(LIBDL,[test x"$HAVE_LIBDL" = x"yes"])
325AC_MSG_RESULT([$HAVE_LIBDL])
326
[a0d4e99]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
[a31845f7]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
[4f09060]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  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
[637546a]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"])
[4f09060]378
[ada8d531]379RTEMS_AMPOLISH3
380
[70810dc]381# Explicitly list all Makefiles here
[b422de6c]382AC_CONFIG_FILES([
[5060d4f]383Doxyfile
[2548d14]384Makefile])
[28caa1d]385
[66387986]386AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.