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