[66387986] | 1 | ## Process this file with autoconf to produce a configure script. |
---|
[eb299afc] | 2 | |
---|
[0f77281] | 3 | AC_PREREQ([2.69]) |
---|
[12072880] | 4 | AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[https://devel.rtems.org/newticket]) |
---|
[66387986] | 5 | AC_CONFIG_SRCDIR([score]) |
---|
[2f4c86f] | 6 | RTEMS_TOP([..],[]) |
---|
[2afb22b] | 7 | RTEMS_SOURCE_TOP |
---|
| 8 | RTEMS_BUILD_TOP |
---|
[eb299afc] | 9 | |
---|
| 10 | RTEMS_CANONICAL_TARGET_CPU |
---|
| 11 | |
---|
[bb2b825] | 12 | AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.12.2]) |
---|
[eb299afc] | 13 | AM_MAINTAINER_MODE |
---|
[04e6f7bf] | 14 | |
---|
[eb299afc] | 15 | RTEMS_ENABLE_MULTIPROCESSING |
---|
| 16 | RTEMS_ENABLE_POSIX |
---|
[39607984] | 17 | RTEMS_ENABLE_RTEMS_DEBUG |
---|
[3e39b47] | 18 | RTEMS_ENABLE_NETWORKING |
---|
[6ffaeb28] | 19 | RTEMS_ENABLE_PARAVIRT |
---|
[eafb040] | 20 | RTEMS_ENABLE_PROFILING |
---|
[e7fade3] | 21 | RTEMS_ENABLE_DRVMGR |
---|
[eb299afc] | 22 | |
---|
[04e6f7bf] | 23 | RTEMS_ENV_RTEMSCPU |
---|
[39607984] | 24 | RTEMS_CHECK_RTEMS_DEBUG |
---|
[eb299afc] | 25 | |
---|
[1772a04] | 26 | AC_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? |
---|
| 29 | AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported]) |
---|
| 30 | if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then |
---|
| 31 | AC_MSG_RESULT(yes) |
---|
| 32 | else |
---|
| 33 | AC_MSG_ERROR(no) |
---|
| 34 | fi |
---|
| 35 | |
---|
[955c499d] | 36 | RTEMS_PROG_CC_FOR_TARGET |
---|
[e7d110ba] | 37 | AM_PROG_CC_C_O |
---|
[9a4eca5] | 38 | RTEMS_CANONICALIZE_TOOLS |
---|
| 39 | RTEMS_PROG_CCAS |
---|
[e73e576] | 40 | AC_PROG_RANLIB |
---|
[eb299afc] | 41 | |
---|
| 42 | RTEMS_CHECK_NEWLIB |
---|
| 43 | |
---|
[b422de6c] | 44 | # BSD-isms, used throughout the sources |
---|
| 45 | # Not really used by this configure script |
---|
| 46 | # FIXME: They should be eliminated if possible. |
---|
[85956f9] | 47 | AC_CHECK_FUNCS([strsep strcasecmp snprintf]) |
---|
[31903f07] | 48 | AC_CHECK_FUNCS([strdup strndup strncasecmp]) |
---|
[b422de6c] | 49 | AC_CHECK_FUNCS([bcopy bcmp]) |
---|
| 50 | AC_CHECK_FUNCS([isascii fileno]) |
---|
[f31a078] | 51 | |
---|
[e83a477] | 52 | # <FIXME> |
---|
| 53 | # Check for functions supplied by newlib >= 1.17.0 |
---|
| 54 | # Newlib's posix/ directory |
---|
[f154804] | 55 | AC_CHECK_FUNCS([readdir_r isatty]) |
---|
[0111c50] | 56 | AC_CHECK_FUNCS([creat \ |
---|
[f154804] | 57 | opendir closedir readdir rewinddir scandir seekdir \ |
---|
| 58 | sleep \ |
---|
| 59 | telldir \ |
---|
| 60 | usleep],, |
---|
[1772a04] | 61 | [RTEMS_TOOL_CHAIN_ERROR]) |
---|
[d020f6f] | 62 | AC_CHECK_FUNCS([__assert]) |
---|
[e83a477] | 63 | AC_CHECK_FUNCS([execl execlp execle execv execvp execve]) |
---|
| 64 | AC_CHECK_FUNCS([regcomp regexec regerror regfree]) |
---|
[8682da39] | 65 | |
---|
| 66 | # Mandated by POSIX, decls not present in some versions of newlib |
---|
[2c0450cb] | 67 | AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>]) |
---|
| 68 | AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>]) |
---|
| 69 | AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>]) |
---|
[f4cc6c5] | 70 | |
---|
[b317c391] | 71 | # Newlib proprietary |
---|
[1772a04] | 72 | AC_CHECK_MEMBER([struct _Thread_queue_Queue._name],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <sys/lock.h>]) |
---|
[b317c391] | 73 | |
---|
[7383b644] | 74 | # Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME |
---|
[1772a04] | 75 | AC_CHECK_DECL([CLOCK_PROCESS_CPUTIME_ID],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <time.h>]) |
---|
| 76 | AC_CHECK_DECL([CLOCK_THREAD_CPUTIME_ID],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <time.h>]) |
---|
[7383b644] | 77 | |
---|
[2f797d0] | 78 | # Mandated by POSIX, decls not present in some versions of newlib, |
---|
| 79 | # some versions stubbed in newlib's rtems crt0 |
---|
| 80 | RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>]) |
---|
| 81 | RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>]) |
---|
| 82 | RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>]) |
---|
| 83 | RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>]) |
---|
| 84 | RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>]) |
---|
| 85 | RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>]) |
---|
| 86 | RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>]) |
---|
| 87 | RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>]) |
---|
| 88 | RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>]) |
---|
| 89 | RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>]) |
---|
| 90 | RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>]) |
---|
| 91 | RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>]) |
---|
| 92 | RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>]) |
---|
| 93 | RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>]) |
---|
[8682da39] | 94 | |
---|
[199296db] | 95 | # pthread-functions not declared in some versions of newlib. |
---|
[e76a477] | 96 | RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>]) |
---|
| 97 | RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>]) |
---|
| 98 | RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>]) |
---|
| 99 | RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>]) |
---|
[199296db] | 100 | |
---|
[801a1fc6] | 101 | # These are SMP related and were added to newlib by RTEMS. |
---|
[57997d8] | 102 | RTEMS_CHECK_FUNC([pthread_attr_setaffinity_np],[ |
---|
| 103 | #define _GNU_SOURCE |
---|
| 104 | #include <pthread.h>]) |
---|
| 105 | RTEMS_CHECK_FUNC([pthread_attr_getaffinity_np],[ |
---|
| 106 | #define _GNU_SOURCE |
---|
| 107 | #include <pthread.h>]) |
---|
| 108 | RTEMS_CHECK_FUNC([pthread_setaffinity_np],[ |
---|
| 109 | #define _GNU_SOURCE |
---|
| 110 | #include <pthread.h>]) |
---|
| 111 | RTEMS_CHECK_FUNC([pthread_getaffinity_np],[ |
---|
| 112 | #define _GNU_SOURCE |
---|
| 113 | #include <pthread.h>]) |
---|
| 114 | RTEMS_CHECK_FUNC([pthread_getattr_np],[ |
---|
| 115 | #define _GNU_SOURCE |
---|
| 116 | #include <pthread.h>]) |
---|
[801a1fc6] | 117 | |
---|
[77fbbd6] | 118 | AC_LANG_PUSH(C) |
---|
[aac36d15] | 119 | AC_MSG_CHECKING([for mprotect(const void *, ...)]) |
---|
| 120 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([ |
---|
| 121 | #include <sys/mman.h> |
---|
| 122 | int mprotect(const void *, size_t, int); |
---|
| 123 | ])],[ |
---|
| 124 | AC_MSG_RESULT([yes]) |
---|
| 125 | AC_DEFINE(HAVE_MPROTECT_CONST, [], [mprotect(const void *, ...)]) |
---|
| 126 | ],[ |
---|
| 127 | AC_MSG_RESULT([no]) |
---|
| 128 | ]) |
---|
[77fbbd6] | 129 | AC_MSG_CHECKING([for pthread_mutex_getprioceiling(const pthread_mutex_t *, ...)]) |
---|
| 130 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([ |
---|
| 131 | #include <pthread.h> |
---|
| 132 | int pthread_mutex_getprioceiling(const pthread_mutex_t *__restrict, int *); |
---|
| 133 | ])],[ |
---|
| 134 | AC_MSG_RESULT([yes]) |
---|
| 135 | AC_DEFINE(HAVE_PTHREAD_MUTEX_GETCEILING_CONST, [], [pthread_mutex_getprioceiling(const pthread_mutex_t *, ...)]) |
---|
| 136 | ],[ |
---|
| 137 | AC_MSG_RESULT([no]) |
---|
| 138 | ]) |
---|
| 139 | AC_MSG_CHECKING([for pthread_setschedparam(..., const struct sched_param *)]) |
---|
| 140 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([ |
---|
| 141 | #include <pthread.h> |
---|
| 142 | int pthread_setschedparam(pthread_t, int, const struct sched_param *); |
---|
| 143 | ])],[ |
---|
| 144 | AC_MSG_RESULT([yes]) |
---|
| 145 | AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM_CONST, [], [pthread_setschedparam(..., const struct sched_param *)]) |
---|
| 146 | ],[ |
---|
| 147 | AC_MSG_RESULT([no]) |
---|
| 148 | ]) |
---|
| 149 | AC_LANG_POP(C) |
---|
| 150 | |
---|
[6649644] | 151 | # Mandated by POSIX, not declared in some versions of newlib. |
---|
| 152 | AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h]) |
---|
| 153 | |
---|
[f4cc6c5] | 154 | # Newlib's unix/ directory |
---|
| 155 | AC_CHECK_FUNCS([ttyname getcwd]) |
---|
[e83a477] | 156 | # </FIXME> |
---|
[f4cc6c5] | 157 | |
---|
[36d9f42f] | 158 | # Check if the installed toolchain provides these headers |
---|
| 159 | # and error out if not. |
---|
[dc703190] | 160 | AC_CHECK_HEADERS([errno.h sched.h semaphore.h sys/cdefs.h sys/queue.h tar.h threads.h],, |
---|
[1772a04] | 161 | [RTEMS_TOOL_CHAIN_ERROR]) |
---|
[bffdb82] | 162 | |
---|
[85c429b] | 163 | ## error out if libc doesn't provide stdint.h |
---|
[52a634e9] | 164 | AS_IF([test x"${ac_cv_header_stdint_h}" != xyes], |
---|
[1772a04] | 165 | [RTEMS_TOOL_CHAIN_ERROR]) |
---|
[d62a2e0] | 166 | |
---|
[85c429b] | 167 | ## error out if libc doesn't provide inttypes.h |
---|
[d62a2e0] | 168 | AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes], |
---|
[1772a04] | 169 | [RTEMS_TOOL_CHAIN_ERROR]) |
---|
[ec75ddc] | 170 | |
---|
[17ed18c0] | 171 | AC_HEADER_STDBOOL |
---|
[19b9991] | 172 | AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes], |
---|
[1772a04] | 173 | [RTEMS_TOOL_CHAIN_ERROR]) |
---|
[17ed18c0] | 174 | |
---|
[bfe2fd3] | 175 | AC_CHECK_TYPES([ uint8_t, int8_t]) |
---|
| 176 | AC_CHECK_TYPES([uint16_t, int16_t]) |
---|
| 177 | AC_CHECK_TYPES([uint32_t, int32_t]) |
---|
[7b6d1b5] | 178 | AC_CHECK_TYPES([uint64_t, int64_t]) |
---|
[9a673dba] | 179 | AC_CHECK_TYPES([uintmax_t, intmax_t]) |
---|
| 180 | AC_CHECK_TYPES([uintptr_t, intptr_t]) |
---|
| 181 | |
---|
[72e975e] | 182 | # Some toolchain sanity checks and diagnostics |
---|
| 183 | RTEMS_CHECK_GCC_SANITY |
---|
[161016b] | 184 | |
---|
[9a673dba] | 185 | # These are conditionally defined by the toolchain |
---|
| 186 | # FIXME: we should either conditionally compile those parts in |
---|
| 187 | # RTEMS depending on them, or abort - For now, simply check. |
---|
| 188 | AC_CHECK_HEADER([pthread.h],[ |
---|
| 189 | AC_CHECK_TYPES([pthread_rwlock_t]) |
---|
| 190 | AC_CHECK_TYPES([pthread_barrier_t]) |
---|
| 191 | AC_CHECK_TYPES([pthread_spinlock_t]) |
---|
[1772a04] | 192 | AC_CHECK_TYPES([struct _pthread_cleanup_context],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <pthread.h>]) |
---|
[e46a075] | 193 | AC_CHECK_TYPES([struct _Priority_Node],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <pthread.h>]) |
---|
[9a673dba] | 194 | ]) |
---|
[bfe2fd3] | 195 | |
---|
[57e278d] | 196 | AC_CHECK_HEADER([signal.h],[ |
---|
| 197 | AC_CHECK_TYPES([sighandler_t]) |
---|
| 198 | ]) |
---|
| 199 | |
---|
[ac5f2442] | 200 | if test x"$RTEMS_USE_NEWLIB" = xyes ; then |
---|
[1772a04] | 201 | AC_CHECK_DECLS([__getreent],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <sys/reent.h>]) |
---|
[ac5f2442] | 202 | fi |
---|
| 203 | |
---|
[c43981b] | 204 | RTEMS_CHECK_MULTIPROCESSING |
---|
[8d4b5cf] | 205 | RTEMS_CHECK_POSIX_API |
---|
| 206 | RTEMS_CHECK_NETWORKING |
---|
[06dcaf0] | 207 | RTEMS_CHECK_SMP |
---|
[8a9568d2] | 208 | if test "${RTEMS_HAS_SMP}" = "yes"; then |
---|
[1772a04] | 209 | AC_CHECK_HEADERS([stdatomic.h],[],[RTEMS_TOOL_CHAIN_ERROR]) |
---|
[8a9568d2] | 210 | fi |
---|
[91fadb3] | 211 | |
---|
[ea35fdc6] | 212 | rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"` |
---|
| 213 | rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"` |
---|
| 214 | rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"` |
---|
| 215 | |
---|
[b4dca71] | 216 | _RTEMS_CPUOPT_INIT |
---|
[3da33bf8] | 217 | |
---|
[926e856a] | 218 | RTEMS_CPUOPT([RTEMS_DEBUG], |
---|
| 219 | [test x"${enable_rtems_debug}" = x"yes"], |
---|
| 220 | [1], |
---|
| 221 | [if RTEMS_DEBUG is enabled]) |
---|
| 222 | |
---|
[3da33bf8] | 223 | RTEMS_CPUOPT([RTEMS_MULTIPROCESSING], |
---|
[28caa1d] | 224 | [test x"$enable_multiprocessing" = xyes], |
---|
[3da33bf8] | 225 | [1], |
---|
| 226 | [if multiprocessing is enabled]) |
---|
| 227 | |
---|
| 228 | RTEMS_CPUOPT([RTEMS_NEWLIB], |
---|
[28caa1d] | 229 | [test x"$RTEMS_USE_NEWLIB" = xyes], |
---|
[3da33bf8] | 230 | [1], |
---|
| 231 | [if using newlib]) |
---|
| 232 | |
---|
| 233 | RTEMS_CPUOPT([RTEMS_POSIX_API], |
---|
[28caa1d] | 234 | [test x"$rtems_cv_HAS_POSIX_API" = xyes], |
---|
[3da33bf8] | 235 | [1], |
---|
| 236 | [if posix api is supported]) |
---|
| 237 | |
---|
[06dcaf0] | 238 | RTEMS_CPUOPT([RTEMS_SMP], |
---|
| 239 | [test x"$RTEMS_HAS_SMP" = xyes], |
---|
| 240 | [1], |
---|
| 241 | [if SMP is enabled]) |
---|
| 242 | |
---|
[6ffaeb28] | 243 | RTEMS_CPUOPT([RTEMS_PARAVIRT], |
---|
| 244 | [test x"$RTEMS_HAS_PARAVIRT" = xyes], |
---|
| 245 | [1], |
---|
| 246 | [PARAVIRT is enabled]) |
---|
| 247 | |
---|
[eafb040] | 248 | RTEMS_CPUOPT([RTEMS_PROFILING], |
---|
| 249 | [test x"$RTEMS_HAS_PROFILING" = xyes], |
---|
| 250 | [1], |
---|
| 251 | [if profiling is enabled]) |
---|
| 252 | |
---|
[28caa1d] | 253 | RTEMS_CPUOPT([RTEMS_NETWORKING], |
---|
| 254 | [test x"$rtems_cv_HAS_NETWORKING" = xyes], |
---|
| 255 | [1], |
---|
| 256 | [if networking is enabled]) |
---|
| 257 | |
---|
[e7fade3] | 258 | RTEMS_CPUOPT([RTEMS_DRVMGR_STARTUP], |
---|
| 259 | [test x"$enable_drvmgr" = xyes], |
---|
| 260 | [1], |
---|
| 261 | [if driver manager api is supported]) |
---|
| 262 | |
---|
[3da33bf8] | 263 | RTEMS_CPUOPT([RTEMS_VERSION], |
---|
| 264 | [true], |
---|
[1bcbe41] | 265 | ["]_RTEMS_VERSION["], |
---|
[3da33bf8] | 266 | [RTEMS version string]) |
---|
| 267 | |
---|
[5787188] | 268 | ## Header file differences that need to be known in .h after install |
---|
| 269 | |
---|
[7f5a245d] | 270 | ## Deactivate ada bindings |
---|
| 271 | RTEMS_CPUOPT([__RTEMS_ADA__], |
---|
| 272 | [test x"${enable_ada}" = x"yes"], |
---|
| 273 | [1], |
---|
| 274 | [Define to 1 if ada/gnat bindings are built-in]) |
---|
| 275 | |
---|
[d420b67] | 276 | # These are used to provide <rtems/inttypes.h |
---|
| 277 | AC_CHECK_SIZEOF([mode_t]) |
---|
| 278 | AC_CHECK_SIZEOF([off_t]) |
---|
| 279 | AC_CHECK_SIZEOF([time_t]) |
---|
| 280 | AC_CHECK_SIZEOF([size_t]) |
---|
[438ca2f] | 281 | AC_CHECK_SIZEOF([blksize_t]) |
---|
| 282 | AC_CHECK_SIZEOF([blkcnt_t]) |
---|
[d420b67] | 283 | |
---|
| 284 | ## Provide sizeof(mode_t) information via cpuopts.h |
---|
| 285 | RTEMS_CPUOPT([__RTEMS_SIZEOF_MODE_T__], |
---|
| 286 | [true], |
---|
| 287 | [${ac_cv_sizeof_mode_t}], |
---|
| 288 | [sizeof(mode_t)]) |
---|
| 289 | |
---|
| 290 | ## Provide sizeof(off_t) information via cpuopts.h |
---|
| 291 | RTEMS_CPUOPT([__RTEMS_SIZEOF_OFF_T__], |
---|
| 292 | [true], |
---|
| 293 | [${ac_cv_sizeof_off_t}], |
---|
| 294 | [sizeof(off_t)]) |
---|
| 295 | |
---|
| 296 | ## Provide sizeof(time_t) information via cpuopts.h |
---|
| 297 | RTEMS_CPUOPT([__RTEMS_SIZEOF_TIME_T__], |
---|
| 298 | [true], |
---|
| 299 | [${ac_cv_sizeof_time_t}], |
---|
| 300 | [sizeof(time_t)]) |
---|
| 301 | |
---|
[438ca2f] | 302 | ## Provide sizeof(blksize_t) information via cpuopts.h |
---|
| 303 | RTEMS_CPUOPT([__RTEMS_SIZEOF_BLKSIZE_T__], |
---|
| 304 | [true], |
---|
| 305 | [${ac_cv_sizeof_blksize_t}], |
---|
| 306 | [sizeof(blksize_t)]) |
---|
| 307 | |
---|
| 308 | ## Provide sizeof(blkcnt_t) information via cpuopts.h |
---|
| 309 | RTEMS_CPUOPT([__RTEMS_SIZEOF_BLKCNT_T__], |
---|
| 310 | [true], |
---|
| 311 | [${ac_cv_sizeof_blkcnt_t}], |
---|
| 312 | [sizeof(blkcnt_t)]) |
---|
| 313 | |
---|
[263ab4b] | 314 | ## Then we propagate a private copy of the value into cpuopts.h |
---|
| 315 | ## so it is always available to the RTEMS header files. |
---|
| 316 | |
---|
[ea35fdc6] | 317 | RTEMS_CPUOPT([__RTEMS_MAJOR__], |
---|
| 318 | [true], |
---|
| 319 | [$rtems_major], |
---|
| 320 | [major version portion of an RTEMS release]) |
---|
| 321 | |
---|
| 322 | RTEMS_CPUOPT([__RTEMS_MINOR__], |
---|
| 323 | [true], |
---|
| 324 | [$rtems_minor], |
---|
| 325 | [minor version portion of an RTEMS release]) |
---|
| 326 | |
---|
[e0627c69] | 327 | RTEMS_CPUOPT([__RTEMS_REVISION__], |
---|
[ea35fdc6] | 328 | [true], |
---|
| 329 | [$rtems_revision], |
---|
| 330 | [revision version portion of an RTEMS release]) |
---|
| 331 | |
---|
[b4dca71] | 332 | _RTEMS_CPUOPT_FINI |
---|
[3da33bf8] | 333 | |
---|
[8217c40] | 334 | AC_ENABLE_MULTILIB([Makefile],[..]) |
---|
| 335 | |
---|
[e30210ea] | 336 | # libmisc/shell/* wants to assign file descriptors to stdio file descriptors. |
---|
| 337 | AC_MSG_CHECKING([for assignable stdio]) |
---|
| 338 | AC_COMPILE_IFELSE( |
---|
| 339 | [AC_LANG_PROGRAM( |
---|
[ae5fe7e6] | 340 | [#include <stdio.h>], |
---|
[e30210ea] | 341 | [stdin = fopen("/tmp", "r")])], |
---|
| 342 | [HAVE_ASSIGNABLE_STDIO=yes], |
---|
| 343 | [HAVE_ASSIGNABLE_STDIO=no]) |
---|
| 344 | AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO]) |
---|
| 345 | |
---|
| 346 | # libmisc/serdbg exploits weak symbols |
---|
[d71ab7fd] | 347 | RTEMS_CHECK_GCC_WEAK |
---|
[f7952533] | 348 | |
---|
[07da959] | 349 | # FIXME: These checks are only in here to provide |
---|
| 350 | # configuration-time diagnostics and are not really used. |
---|
| 351 | AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>]) |
---|
| 352 | AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>]) |
---|
[21d9736] | 353 | |
---|
[ae5fe7e6] | 354 | # FIXME: Mandatory in SUSv4, optional in SUSv3. |
---|
[da0475f] | 355 | # Not implemented in GCC/newlib, so far. |
---|
| 356 | AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>]) |
---|
| 357 | AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>]) |
---|
[07da959] | 358 | |
---|
| 359 | ## BSD-ism, excluded from POSIX, but available on most platforms |
---|
| 360 | AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>]) |
---|
[396b80e] | 361 | AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>]) |
---|
[07da959] | 362 | |
---|
| 363 | ## Check if libc provides BSD's strlcpy/strlcat |
---|
| 364 | AC_CHECK_FUNCS(strlcpy strlcat) |
---|
| 365 | |
---|
[74bfa2e4] | 366 | ## Check if libc provides decl of utime |
---|
| 367 | ## FIXME: utime has been deprecated in SUSv4. |
---|
| 368 | ## and is likely to be removed in future versions. |
---|
| 369 | ## FIXME (BUG in newlib): SUSv4 saids including <utime.h> should be sufficient. |
---|
| 370 | AC_CHECK_DECLS([utime],,,[#include <sys/types.h> |
---|
| 371 | #include <utime.h>]) |
---|
| 372 | ## Check if libc provides decl of utimes |
---|
| 373 | AC_CHECK_DECLS([utimes],,,[#include <sys/time.h>]) |
---|
| 374 | |
---|
[b225aa1] | 375 | # Ensure that Newlib does not provide things now in <machine/_timecounter.h> |
---|
| 376 | AC_CHECK_DECLS([_Timecounter_Time_second],[RTEMS_TOOL_CHAIN_ERROR],,[#include <sys/time.h>]) |
---|
| 377 | |
---|
[07da959] | 378 | # ... far too many conditionals ... |
---|
| 379 | AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes") |
---|
[b422de6c] | 380 | |
---|
[1bcbe41] | 381 | AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" ) |
---|
[06dcaf0] | 382 | AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"]) |
---|
[b422de6c] | 383 | |
---|
[2d80c75] | 384 | AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes") |
---|
[6e46fa73] | 385 | AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes") |
---|
[b422de6c] | 386 | |
---|
[720633c] | 387 | AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"]) |
---|
[e30210ea] | 388 | AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"]) |
---|
[5cad5bf] | 389 | AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \ |
---|
| 390 | && test x"$enable_ada" = x"yes"]) |
---|
[e30210ea] | 391 | |
---|
[91404de] | 392 | AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2]) |
---|
| 393 | |
---|
[9f62936] | 394 | AM_CONDITIONAL([LIBDOSFS],[dnl |
---|
[720633c] | 395 | test x"$ac_cv_type_uint8_t" = xyes \ |
---|
[9f62936] | 396 | && test x"$ac_cv_type_uint16_t" = xyes]) |
---|
| 397 | |
---|
[3da33bf8] | 398 | AC_CONFIG_HEADER(config.h) |
---|
| 399 | |
---|
[58d38a0] | 400 | ## These are needed by the NFS Client |
---|
| 401 | AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen) |
---|
| 402 | AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \ |
---|
| 403 | && test -n "$AWK" \ |
---|
| 404 | && test "$enable_rpcgen" = yes]) |
---|
| 405 | |
---|
[ae5fe7e6] | 406 | # Filter dynamic loading to only build for architectures that have |
---|
| 407 | # reloc backends |
---|
| 408 | AC_MSG_CHECKING([whether CPU supports libdl]) |
---|
| 409 | case $RTEMS_CPU in |
---|
[f5201df] | 410 | arm | i386 | m68k | mips | moxie | powerpc | sparc) |
---|
[ae5fe7e6] | 411 | HAVE_LIBDL=yes ;; |
---|
[9bef63e] | 412 | # bfin has an issue to resolve with libdl. See ticket #2252 |
---|
| 413 | bfin) |
---|
| 414 | HAVE_LIBDL=no ;; |
---|
[a726ca64] | 415 | # lm32 has an issue to resolve with libdl. See ticket #2283 |
---|
| 416 | lm32) |
---|
| 417 | HAVE_LIBDL=no ;; |
---|
[1d061ee] | 418 | # v850 has an issue to resolve with libdl. See ticket #2260 |
---|
| 419 | v850) |
---|
| 420 | HAVE_LIBDL=no ;; |
---|
[ae5fe7e6] | 421 | *) |
---|
| 422 | HAVE_LIBDL=no ;; |
---|
| 423 | esac |
---|
| 424 | AM_CONDITIONAL(LIBDL,[test x"$HAVE_LIBDL" = x"yes"]) |
---|
| 425 | AC_MSG_RESULT([$HAVE_LIBDL]) |
---|
| 426 | |
---|
[a0d4e99] | 427 | # Filter debugger to only build for architectures that have a target backend |
---|
| 428 | AC_MSG_CHECKING([whether CPU supports libdebugger]) |
---|
| 429 | case $RTEMS_CPU in |
---|
| 430 | arm | i386) |
---|
| 431 | HAVE_LIBDEBUGGER=yes ;; |
---|
| 432 | *) |
---|
| 433 | HAVE_LIBDEBUGGER=no ;; |
---|
| 434 | esac |
---|
| 435 | AM_CONDITIONAL(LIBDEBUGGER,[test x"$HAVE_LIBDEBUGGER" = x"yes"]) |
---|
| 436 | AC_MSG_RESULT([$HAVE_LIBDEBUGGER]) |
---|
| 437 | |
---|
[77510c7] | 438 | AC_MSG_CHECKING([whether CPU supports SHA]) |
---|
| 439 | case $RTEMS_CPU in |
---|
| 440 | m32c) |
---|
| 441 | HAVE_SHA=no ;; |
---|
| 442 | *) |
---|
| 443 | HAVE_SHA=yes ;; |
---|
| 444 | esac |
---|
| 445 | AM_CONDITIONAL(SHA,[test x"$HAVE_SHA" = x"yes"]) |
---|
| 446 | AC_MSG_RESULT([$HAVE_SHA]) |
---|
| 447 | |
---|
[a31845f7] | 448 | # Filter libpci to only build for architectures that have support for it |
---|
| 449 | AC_MSG_CHECKING([whether CPU supports libpci]) |
---|
| 450 | case $RTEMS_CPU in |
---|
| 451 | sparc) |
---|
| 452 | HAVE_LIBPCI=yes ;; |
---|
| 453 | *) |
---|
| 454 | HAVE_LIBPCI=no ;; |
---|
| 455 | esac |
---|
| 456 | AM_CONDITIONAL(LIBPCI,[test x"$HAVE_LIBPCI" = x"yes"]) |
---|
| 457 | AC_MSG_RESULT([$HAVE_LIBPCI]) |
---|
| 458 | |
---|
[4f09060] | 459 | # Filter libdrvmgr to only build for architectures that have support for it |
---|
| 460 | AC_MSG_CHECKING([whether CPU supports libdrvmgr]) |
---|
| 461 | case $RTEMS_CPU in |
---|
| 462 | sparc) |
---|
| 463 | HAVE_LIBDRVMGR=yes ;; |
---|
| 464 | *) |
---|
| 465 | HAVE_LIBDRVMGR=no ;; |
---|
| 466 | esac |
---|
| 467 | AM_CONDITIONAL(LIBDRVMGR,[test x"$HAVE_LIBDRVMGR" = x"yes"]) |
---|
| 468 | AC_MSG_RESULT([$HAVE_LIBDRVMGR]) |
---|
| 469 | |
---|
| 470 | |
---|
[ada8d531] | 471 | RTEMS_AMPOLISH3 |
---|
| 472 | |
---|
[70810dc] | 473 | # Explicitly list all Makefiles here |
---|
[b422de6c] | 474 | AC_CONFIG_FILES([ |
---|
[5060d4f] | 475 | Doxyfile |
---|
[b422de6c] | 476 | Makefile |
---|
[1896a650] | 477 | rtems/Makefile |
---|
[eb299afc] | 478 | score/Makefile |
---|
| 479 | score/cpu/Makefile |
---|
[e9d90764] | 480 | score/cpu/arm/Makefile |
---|
[b78d94d] | 481 | score/cpu/bfin/Makefile |
---|
[66a5000d] | 482 | score/cpu/epiphany/Makefile |
---|
[e9d90764] | 483 | score/cpu/i386/Makefile |
---|
[15e44fd] | 484 | score/cpu/lm32/Makefile |
---|
[e9d90764] | 485 | score/cpu/m68k/Makefile |
---|
[0c34b176] | 486 | score/cpu/m32c/Makefile |
---|
[e9d90764] | 487 | score/cpu/mips/Makefile |
---|
[48fc25f] | 488 | score/cpu/moxie/Makefile |
---|
[7a28ac8] | 489 | score/cpu/nios2/Makefile |
---|
[94d45f6] | 490 | score/cpu/or1k/Makefile |
---|
[e9d90764] | 491 | score/cpu/powerpc/Makefile |
---|
[11ff3a9] | 492 | score/cpu/riscv/Makefile |
---|
[e9d90764] | 493 | score/cpu/sh/Makefile |
---|
| 494 | score/cpu/sparc/Makefile |
---|
[ecbbd968] | 495 | score/cpu/sparc64/Makefile |
---|
[2d7ae960] | 496 | score/cpu/v850/Makefile |
---|
[76c03152] | 497 | score/cpu/x86_64/Makefile |
---|
[6b400fed] | 498 | score/cpu/no_cpu/Makefile |
---|
[b422de6c] | 499 | libnetworking/Makefile |
---|
| 500 | libmisc/Makefile |
---|
[fa645f6] | 501 | zlib/Makefile |
---|
[8280caa4] | 502 | telnetd/Makefile |
---|
[c5bb2a4e] | 503 | pppd/Makefile |
---|
[28caa1d] | 504 | wrapup/Makefile]) |
---|
| 505 | |
---|
[66387986] | 506 | AC_OUTPUT |
---|