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