[66387986] | 1 | ## Process this file with autoconf to produce a configure script. |
---|
| 2 | ## |
---|
| 3 | ## $Id$ |
---|
[eb299afc] | 4 | |
---|
[9a673dba] | 5 | AC_PREREQ(2.61) |
---|
[fcb0cd46] | 6 | AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla]) |
---|
[66387986] | 7 | AC_CONFIG_SRCDIR([score]) |
---|
[2f4c86f] | 8 | RTEMS_TOP([..],[]) |
---|
[eb299afc] | 9 | |
---|
| 10 | RTEMS_CANONICAL_TARGET_CPU |
---|
| 11 | |
---|
[ed908735] | 12 | AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.10]) |
---|
[eb299afc] | 13 | AM_MAINTAINER_MODE |
---|
[04e6f7bf] | 14 | |
---|
| 15 | RTEMS_ENABLE_MULTILIB |
---|
[eb299afc] | 16 | RTEMS_ENABLE_MULTIPROCESSING |
---|
| 17 | RTEMS_ENABLE_POSIX |
---|
[352c9b2] | 18 | RTEMS_ENABLE_ITRON |
---|
[39607984] | 19 | RTEMS_ENABLE_RTEMS_DEBUG |
---|
[3e39b47] | 20 | RTEMS_ENABLE_NETWORKING |
---|
[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 |
---|
| 52 | AC_CHECK_FUNCS([sleep usleep \ |
---|
| 53 | opendir closedir readdir readdir_r \ |
---|
| 54 | rewinddir scandir seekdir telldir isatty]) |
---|
[a746013] | 55 | AC_CHECK_FUNCS([creat]) |
---|
[d020f6f] | 56 | AC_CHECK_FUNCS([__assert]) |
---|
[e83a477] | 57 | AC_CHECK_FUNCS([execl execlp execle execv execvp execve]) |
---|
| 58 | AC_CHECK_FUNCS([regcomp regexec regerror regfree]) |
---|
[f4cc6c5] | 59 | |
---|
| 60 | # Newlib's unix/ directory |
---|
| 61 | AC_CHECK_FUNCS([ttyname getcwd]) |
---|
[e83a477] | 62 | # </FIXME> |
---|
[f4cc6c5] | 63 | |
---|
[a5777f0] | 64 | ## Check if the installed toolchain has these headers |
---|
[6e73ca2a] | 65 | AC_CHECK_HEADERS([tar.h errno.h]) |
---|
[bffdb82] | 66 | |
---|
[85c429b] | 67 | ## error out if libc doesn't provide stdint.h |
---|
[52a634e9] | 68 | AS_IF([test x"${ac_cv_header_stdint_h}" != xyes], |
---|
| 69 | [AC_MSG_ERROR([Required header stdint.h not found])]) |
---|
[d62a2e0] | 70 | |
---|
[85c429b] | 71 | ## error out if libc doesn't provide inttypes.h |
---|
[d62a2e0] | 72 | AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes], |
---|
| 73 | [AC_MSG_ERROR([Required header inttypes.h not found])]) |
---|
[ec75ddc] | 74 | |
---|
[85c429b] | 75 | ## error out if libc doesn't provide errno.h |
---|
| 76 | AS_IF([test x"${ac_cv_header_errno_h}" != xyes], |
---|
| 77 | [AC_MSG_ERROR([Required header errno.h not found])]) |
---|
| 78 | |
---|
[17ed18c0] | 79 | AC_HEADER_STDBOOL |
---|
[19b9991] | 80 | AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes], |
---|
| 81 | [AC_MSG_ERROR([No sufficient stdbool.h found])]) |
---|
[17ed18c0] | 82 | |
---|
[bfe2fd3] | 83 | AC_CHECK_TYPES([ uint8_t, int8_t]) |
---|
| 84 | AC_CHECK_TYPES([uint16_t, int16_t]) |
---|
| 85 | AC_CHECK_TYPES([uint32_t, int32_t]) |
---|
[7b6d1b5] | 86 | AC_CHECK_TYPES([uint64_t, int64_t]) |
---|
[9a673dba] | 87 | AC_CHECK_TYPES([uintmax_t, intmax_t]) |
---|
| 88 | AC_CHECK_TYPES([uintptr_t, intptr_t]) |
---|
| 89 | |
---|
[72e975e] | 90 | # Some toolchain sanity checks and diagnostics |
---|
| 91 | RTEMS_CHECK_GCC_SANITY |
---|
[161016b] | 92 | |
---|
[9a673dba] | 93 | # These are conditionally defined by the toolchain |
---|
| 94 | # FIXME: we should either conditionally compile those parts in |
---|
| 95 | # RTEMS depending on them, or abort - For now, simply check. |
---|
| 96 | AC_CHECK_HEADER([pthread.h],[ |
---|
| 97 | AC_CHECK_TYPES([pthread_rwlock_t]) |
---|
| 98 | AC_CHECK_TYPES([pthread_barrier_t]) |
---|
| 99 | AC_CHECK_TYPES([pthread_spinlock_t]) |
---|
| 100 | ]) |
---|
[bfe2fd3] | 101 | |
---|
[8d4b5cf] | 102 | RTEMS_CHECK_MULTIPROCESSING |
---|
| 103 | RTEMS_CHECK_POSIX_API |
---|
| 104 | RTEMS_CHECK_ITRON_API |
---|
| 105 | RTEMS_CHECK_NETWORKING |
---|
[91fadb3] | 106 | |
---|
[9d0e65ed] | 107 | AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes], |
---|
| 108 | [RTEMS_USES_TAR_H=yes], |
---|
| 109 | [RTEMS_USES_TAR_H=$ac_cv_header_tar_h]) |
---|
| 110 | |
---|
[ea35fdc6] | 111 | rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"` |
---|
| 112 | rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"` |
---|
| 113 | rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"` |
---|
| 114 | |
---|
[b4dca71] | 115 | _RTEMS_CPUOPT_INIT |
---|
[3da33bf8] | 116 | |
---|
[926e856a] | 117 | RTEMS_CPUOPT([RTEMS_DEBUG], |
---|
| 118 | [test x"${enable_rtems_debug}" = x"yes"], |
---|
| 119 | [1], |
---|
| 120 | [if RTEMS_DEBUG is enabled]) |
---|
| 121 | |
---|
[3da33bf8] | 122 | RTEMS_CPUOPT([RTEMS_ITRON_API], |
---|
| 123 | [test x"$rtems_cv_HAS_ITRON_API" = x"yes"], |
---|
| 124 | [1], |
---|
| 125 | [if itron api is supported]) |
---|
| 126 | |
---|
| 127 | RTEMS_CPUOPT([RTEMS_MULTIPROCESSING], |
---|
[28caa1d] | 128 | [test x"$enable_multiprocessing" = xyes], |
---|
[3da33bf8] | 129 | [1], |
---|
| 130 | [if multiprocessing is enabled]) |
---|
| 131 | |
---|
| 132 | RTEMS_CPUOPT([RTEMS_NEWLIB], |
---|
[28caa1d] | 133 | [test x"$RTEMS_USE_NEWLIB" = xyes], |
---|
[3da33bf8] | 134 | [1], |
---|
| 135 | [if using newlib]) |
---|
| 136 | |
---|
| 137 | RTEMS_CPUOPT([RTEMS_POSIX_API], |
---|
[28caa1d] | 138 | [test x"$rtems_cv_HAS_POSIX_API" = xyes], |
---|
[3da33bf8] | 139 | [1], |
---|
| 140 | [if posix api is supported]) |
---|
| 141 | |
---|
[28caa1d] | 142 | RTEMS_CPUOPT([RTEMS_NETWORKING], |
---|
| 143 | [test x"$rtems_cv_HAS_NETWORKING" = xyes], |
---|
| 144 | [1], |
---|
| 145 | [if networking is enabled]) |
---|
| 146 | |
---|
[9d0e65ed] | 147 | RTEMS_CPUOPT([RTEMS_USES_TAR_H], |
---|
| 148 | [test x"${RTEMS_USES_TAR_H}" = x"yes"], |
---|
| 149 | [1], |
---|
| 150 | [if RTEMS uses tar.h]) |
---|
| 151 | |
---|
[3da33bf8] | 152 | RTEMS_CPUOPT([RTEMS_VERSION], |
---|
| 153 | [true], |
---|
[1bcbe41] | 154 | ["]_RTEMS_VERSION["], |
---|
[3da33bf8] | 155 | [RTEMS version string]) |
---|
| 156 | |
---|
[c6f7e060] | 157 | RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__], |
---|
| 158 | [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"], |
---|
| 159 | [1], |
---|
| 160 | [disable nanosecond granularity for statistics]) |
---|
| 161 | |
---|
[c3330a8] | 162 | RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__], |
---|
| 163 | [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"], |
---|
| 164 | [1], |
---|
[b4dca71] | 165 | [disable nanosecond granularity for cpu usage statistics]) |
---|
[c3330a8] | 166 | |
---|
| 167 | RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__], |
---|
| 168 | [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"], |
---|
| 169 | [1], |
---|
[b4dca71] | 170 | [disable nanosecond granularity for period statistics]) |
---|
[c3330a8] | 171 | |
---|
[e2ba62d1] | 172 | ## This improves both the size and coverage analysis. |
---|
[5603b5a6] | 173 | RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__], |
---|
| 174 | [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"], |
---|
| 175 | [1], |
---|
[b4dca71] | 176 | [disable inlining _Thread_Enable_dispatch]) |
---|
[5603b5a6] | 177 | |
---|
[e2ba62d1] | 178 | ## This improves both the size and coverage analysis. |
---|
| 179 | RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__], |
---|
| 180 | [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"], |
---|
| 181 | [1], |
---|
[b4dca71] | 182 | [disable inlining _Thread_Enable_dispatch]) |
---|
[e2ba62d1] | 183 | |
---|
[3a08272] | 184 | ## This improves both the size and coverage analysis. |
---|
| 185 | RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__], |
---|
| 186 | [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"], |
---|
| 187 | [1], |
---|
| 188 | [disable inlining _Thread_queue_Enqueue_priority]) |
---|
| 189 | |
---|
[e2ba62d1] | 190 | ## This gives the same behavior as 4.8 and older |
---|
[66a9239a] | 191 | RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__], |
---|
[a5de1ef] | 192 | [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"], |
---|
[fd84982] | 193 | [1], |
---|
[b4dca71] | 194 | [disable strict order mutex]) |
---|
[fd84982] | 195 | |
---|
[7f5a245d] | 196 | ## Deactivate ada bindings |
---|
| 197 | RTEMS_CPUOPT([__RTEMS_ADA__], |
---|
| 198 | [test x"${enable_ada}" = x"yes"], |
---|
| 199 | [1], |
---|
| 200 | [Define to 1 if ada/gnat bindings are built-in]) |
---|
| 201 | |
---|
[ea35fdc6] | 202 | RTEMS_CPUOPT([__RTEMS_MAJOR__], |
---|
| 203 | [true], |
---|
| 204 | [$rtems_major], |
---|
| 205 | [major version portion of an RTEMS release]) |
---|
| 206 | |
---|
| 207 | RTEMS_CPUOPT([__RTEMS_MINOR__], |
---|
| 208 | [true], |
---|
| 209 | [$rtems_minor], |
---|
| 210 | [minor version portion of an RTEMS release]) |
---|
| 211 | |
---|
| 212 | RTEMS_CPUOPT([__RTEMS_REVISION__], |
---|
| 213 | [true], |
---|
| 214 | [$rtems_revision], |
---|
| 215 | [revision version portion of an RTEMS release]) |
---|
| 216 | |
---|
[b4dca71] | 217 | _RTEMS_CPUOPT_FINI |
---|
[3da33bf8] | 218 | |
---|
[8217c40] | 219 | AC_ENABLE_MULTILIB([Makefile],[..]) |
---|
| 220 | |
---|
[e30210ea] | 221 | # libmisc/shell/* wants to assign file descriptors to stdio file descriptors. |
---|
| 222 | AC_MSG_CHECKING([for assignable stdio]) |
---|
| 223 | AC_COMPILE_IFELSE( |
---|
| 224 | [AC_LANG_PROGRAM( |
---|
| 225 | [#include <stdio.h>], |
---|
| 226 | [stdin = fopen("/tmp", "r")])], |
---|
| 227 | [HAVE_ASSIGNABLE_STDIO=yes], |
---|
| 228 | [HAVE_ASSIGNABLE_STDIO=no]) |
---|
| 229 | AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO]) |
---|
| 230 | |
---|
| 231 | # libmisc/serdbg exploits weak symbols |
---|
[d71ab7fd] | 232 | RTEMS_CHECK_GCC_WEAK |
---|
[f7952533] | 233 | |
---|
[62f0829] | 234 | AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes]) |
---|
| 235 | AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes]) |
---|
| 236 | |
---|
[07da959] | 237 | # FIXME: These checks are only in here to provide |
---|
| 238 | # configuration-time diagnostics and are not really used. |
---|
| 239 | AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>]) |
---|
| 240 | AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>]) |
---|
| 241 | |
---|
| 242 | ## BSD-ism, excluded from POSIX, but available on most platforms |
---|
| 243 | AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>]) |
---|
| 244 | |
---|
| 245 | ## Check if libc provides BSD's strlcpy/strlcat |
---|
| 246 | AC_CHECK_FUNCS(strlcpy strlcat) |
---|
| 247 | |
---|
| 248 | |
---|
| 249 | # ... far too many conditionals ... |
---|
[f9f51d0] | 250 | AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"]) |
---|
[07da959] | 251 | AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes") |
---|
[b422de6c] | 252 | |
---|
[1bcbe41] | 253 | AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" ) |
---|
[b422de6c] | 254 | |
---|
[2d80c75] | 255 | AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes") |
---|
[91fadb3] | 256 | AM_CONDITIONAL(LIBITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes") |
---|
[6e46fa73] | 257 | AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes") |
---|
[b422de6c] | 258 | |
---|
[07da959] | 259 | AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"]) |
---|
[62f0829] | 260 | AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"]) |
---|
[07da959] | 261 | |
---|
[720633c] | 262 | AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"]) |
---|
[e30210ea] | 263 | AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"]) |
---|
[5cad5bf] | 264 | AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \ |
---|
| 265 | && test x"$enable_ada" = x"yes"]) |
---|
[e30210ea] | 266 | |
---|
[9f62936] | 267 | AM_CONDITIONAL([LIBDOSFS],[dnl |
---|
[720633c] | 268 | test x"$ac_cv_type_uint8_t" = xyes \ |
---|
[9f62936] | 269 | && test x"$ac_cv_type_uint16_t" = xyes]) |
---|
| 270 | |
---|
[3da33bf8] | 271 | AC_CONFIG_HEADER(config.h) |
---|
| 272 | |
---|
[58d38a0] | 273 | ## These are needed by the NFS Client |
---|
| 274 | AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen) |
---|
| 275 | AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \ |
---|
| 276 | && test -n "$AWK" \ |
---|
| 277 | && test "$enable_rpcgen" = yes]) |
---|
| 278 | |
---|
[ada8d531] | 279 | RTEMS_AMPOLISH3 |
---|
| 280 | |
---|
[70810dc] | 281 | # Explicitly list all Makefiles here |
---|
[b422de6c] | 282 | AC_CONFIG_FILES([ |
---|
[5060d4f] | 283 | Doxyfile |
---|
[b422de6c] | 284 | Makefile |
---|
[1896a650] | 285 | rtems/Makefile |
---|
| 286 | sapi/Makefile |
---|
[eb299afc] | 287 | score/Makefile |
---|
| 288 | score/cpu/Makefile |
---|
[e9d90764] | 289 | score/cpu/arm/Makefile |
---|
[b78d94d] | 290 | score/cpu/bfin/Makefile |
---|
[05f3270] | 291 | score/cpu/avr/Makefile |
---|
[7a28ac8] | 292 | score/cpu/c4x/Makefile |
---|
[e9d90764] | 293 | score/cpu/h8300/Makefile |
---|
| 294 | score/cpu/i386/Makefile |
---|
[15e44fd] | 295 | score/cpu/lm32/Makefile |
---|
[e9d90764] | 296 | score/cpu/m68k/Makefile |
---|
[0c34b176] | 297 | score/cpu/m32c/Makefile |
---|
[5365e60] | 298 | score/cpu/m32r/Makefile |
---|
[e9d90764] | 299 | score/cpu/mips/Makefile |
---|
[7a28ac8] | 300 | score/cpu/nios2/Makefile |
---|
[e9d90764] | 301 | score/cpu/powerpc/Makefile |
---|
| 302 | score/cpu/sh/Makefile |
---|
| 303 | score/cpu/sparc/Makefile |
---|
[6b400fed] | 304 | score/cpu/no_cpu/Makefile |
---|
[b422de6c] | 305 | posix/Makefile |
---|
| 306 | itron/Makefile |
---|
| 307 | libblock/Makefile |
---|
| 308 | libfs/Makefile |
---|
[58d38a0] | 309 | libfs/src/nfsclient/Makefile |
---|
[db27544] | 310 | libgnat/Makefile |
---|
[07da959] | 311 | libcsupport/Makefile |
---|
[b422de6c] | 312 | libnetworking/Makefile |
---|
[da0fc5d] | 313 | librpc/Makefile |
---|
[b422de6c] | 314 | libmisc/Makefile |
---|
[6339f467] | 315 | libi2c/Makefile |
---|
[a70b07b] | 316 | libmd/Makefile |
---|
[fa645f6] | 317 | zlib/Makefile |
---|
[be4bd26] | 318 | httpd/Makefile |
---|
[f26145b] | 319 | ftpd/Makefile |
---|
[8280caa4] | 320 | telnetd/Makefile |
---|
[c5bb2a4e] | 321 | pppd/Makefile |
---|
[31903f07] | 322 | shttpd/Makefile |
---|
[ba955609] | 323 | mghttpd/Makefile |
---|
[28caa1d] | 324 | wrapup/Makefile]) |
---|
| 325 | |
---|
| 326 | AC_CONFIG_COMMANDS([preinstall-stamp], |
---|
| 327 | [test -z "$with_multisubdir" && ${MAKE} preinstall-stamp], |
---|
| 328 | [MAKE=${MAKE} |
---|
| 329 | with_multisubdir="$with_multisubdir"]) |
---|
[92ed8c2] | 330 | |
---|
[66387986] | 331 | AC_OUTPUT |
---|