[66387986] | 1 | ## Process this file with autoconf to produce a configure script. |
---|
| 2 | ## |
---|
| 3 | ## $Id$ |
---|
[eb299afc] | 4 | |
---|
[ce1bdb08] | 5 | AC_PREREQ(2.60) |
---|
[7dcc3fe] | 6 | AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[rtems-bugs@rtems.com]) |
---|
[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 | |
---|
[e7ab8899] | 33 | RTEMS_PROG_CC_FOR_TARGET([-fasm]) |
---|
[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 | |
---|
[27f9f12] | 41 | RTEMS_CHECK_MULTIPROCESSING |
---|
| 42 | RTEMS_CHECK_POSIX_API |
---|
| 43 | RTEMS_CHECK_ITRON_API |
---|
[3e39b47] | 44 | RTEMS_CHECK_NETWORKING |
---|
[1896a650] | 45 | |
---|
[85eb57e7] | 46 | AS_IF([test x"$HAS_NETWORKING" = x"yes"],[ |
---|
| 47 | ## FIXME: Should better use a feature-based test |
---|
[e336882] | 48 | AC_MSG_CHECKING([whether CPU supports librpc]) |
---|
[85eb57e7] | 49 | case "$RTEMS_CPU" in |
---|
| 50 | c4x ) LIBRPC=no;; |
---|
| 51 | * ) LIBRPC=yes;; |
---|
| 52 | esac |
---|
[e336882] | 53 | AC_MSG_RESULT([$LIBRPC]) |
---|
[2a582aa5] | 54 | ]) |
---|
[07da959] | 55 | |
---|
[f8284c95] | 56 | AC_ARG_ENABLE([deprecated], |
---|
| 57 | [AS_HELP_STRING(--enable-deprecated,allow using deprecated files)], |
---|
| 58 | [case "${enable_deprecated}" in |
---|
| 59 | yes) ;; |
---|
| 60 | no) ;; |
---|
[f321fdc8] | 61 | *) enable_deprecated=no ;; |
---|
| 62 | esac],[enable_deprecated=no]) |
---|
[f8284c95] | 63 | AM_CONDITIONAL([DEPRECATED],[test "$enable_deprecated" = "yes"]) |
---|
| 64 | |
---|
[28caa1d] | 65 | AS_IF([ test "$enable_deprecated" = "yes" ],[ |
---|
| 66 | AC_DEFINE_UNQUOTED([RTEMS_DEPRECATED_TYPES],[1], |
---|
| 67 | [whether to support deprecated types]) |
---|
| 68 | ]) |
---|
| 69 | |
---|
[c0394d4b] | 70 | # HACK: We should use a feature-based configuration. |
---|
[8217c40] | 71 | AS_IF([test x"${RTEMS_CPU}" = x"unix"],[ |
---|
| 72 | # HACK: silently accept --enable-unixlib |
---|
[64b1f81] | 73 | test -n "${enable_unixlib}" || enable_unixlib="yes" |
---|
[8217c40] | 74 | ]) |
---|
| 75 | |
---|
[b422de6c] | 76 | # BSD-isms, used throughout the sources |
---|
| 77 | # Not really used by this configure script |
---|
| 78 | # FIXME: They should be eliminated if possible. |
---|
[85956f9] | 79 | AC_CHECK_FUNCS([strsep strcasecmp snprintf]) |
---|
[b422de6c] | 80 | AC_CHECK_FUNCS([bcopy bcmp]) |
---|
| 81 | AC_CHECK_FUNCS([isascii fileno]) |
---|
[f31a078] | 82 | |
---|
[a5777f0] | 83 | ## Check if the installed toolchain has these headers |
---|
[9d0e65ed] | 84 | AC_CHECK_HEADER([tar.h]) |
---|
[bffdb82] | 85 | |
---|
[5f7d9d0e] | 86 | ## BSD-ism, should not be used in RTEMS, |
---|
| 87 | ## nevertheless it still is. |
---|
| 88 | AC_CHECK_HEADER([sys/errno.h],[], |
---|
| 89 | [AC_MSG_ERROR([Missing required header sys/errno.h])]) |
---|
| 90 | |
---|
[d62a2e0] | 91 | ## if libc provides stdint.h, use it. |
---|
| 92 | AS_IF([test x"${ac_cv_header_stdint_h}" = xyes], |
---|
[bffdb82] | 93 | [RTEMS_USES_STDINT_H=yes], |
---|
[d62a2e0] | 94 | [RTEMS_USES_STDINT_H=no]) |
---|
| 95 | |
---|
| 96 | ## error out if libc doesn't at least provide inttypes.h |
---|
| 97 | AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes], |
---|
| 98 | [AC_MSG_ERROR([Required header inttypes.h not found])]) |
---|
[ec75ddc] | 99 | |
---|
[9d0e65ed] | 100 | AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes], |
---|
| 101 | [RTEMS_USES_TAR_H=yes], |
---|
| 102 | [RTEMS_USES_TAR_H=$ac_cv_header_tar_h]) |
---|
| 103 | |
---|
[10ae124c] | 104 | AS_IF([test x"${RTEMS_CPU}" = x"unix"],[ |
---|
[e9d90764] | 105 | ## FIXME: This check is doubtful |
---|
| 106 | AS_IF([test "$HAS_MP" = "yes"], |
---|
| 107 | [RTEMS_CHECK_SYSV_UNIX]) |
---|
| 108 | |
---|
[10ae124c] | 109 | ## The code fragment below had been used in tools/cpu/unix/gensize.c. |
---|
| 110 | ## FIXME: |
---|
| 111 | ## * The pad very likely is not necessary. |
---|
| 112 | AC_CHECK_SIZEOF([CPU_CONTEXT],[],[ |
---|
| 113 | #include <stdio.h> |
---|
| 114 | #include <setjmp.h> |
---|
| 115 | |
---|
| 116 | typedef struct { |
---|
| 117 | jmp_buf regs; |
---|
| 118 | int isr_level; |
---|
| 119 | int pad[4]; /* just in case */ |
---|
| 120 | } CPU_CONTEXT; |
---|
| 121 | ]) |
---|
| 122 | ]) |
---|
| 123 | |
---|
[1bcbe41] | 124 | cat >>cpuopts.tmp <<\_ACEOF |
---|
[07a984b] | 125 | /** |
---|
| 126 | * @file rtems/score/cpuopts.h |
---|
| 127 | */ |
---|
[3da33bf8] | 128 | /* target cpu dependent options file */ |
---|
| 129 | /* automatically generated -- DO NOT EDIT!! */ |
---|
[3a805b2] | 130 | #ifndef _RTEMS_SCORE_CPUOPTS_H |
---|
| 131 | #define _RTEMS_SCORE_CPUOPTS_H |
---|
[1bcbe41] | 132 | _ACEOF |
---|
[3da33bf8] | 133 | |
---|
[926e856a] | 134 | RTEMS_CPUOPT([RTEMS_DEBUG], |
---|
| 135 | [test x"${enable_rtems_debug}" = x"yes"], |
---|
| 136 | [1], |
---|
| 137 | [if RTEMS_DEBUG is enabled]) |
---|
| 138 | |
---|
[3da33bf8] | 139 | RTEMS_CPUOPT([RTEMS_ITRON_API], |
---|
| 140 | [test x"$rtems_cv_HAS_ITRON_API" = x"yes"], |
---|
| 141 | [1], |
---|
| 142 | [if itron api is supported]) |
---|
| 143 | |
---|
| 144 | RTEMS_CPUOPT([RTEMS_MULTIPROCESSING], |
---|
[28caa1d] | 145 | [test x"$enable_multiprocessing" = xyes], |
---|
[3da33bf8] | 146 | [1], |
---|
| 147 | [if multiprocessing is enabled]) |
---|
| 148 | |
---|
| 149 | RTEMS_CPUOPT([RTEMS_NEWLIB], |
---|
[28caa1d] | 150 | [test x"$RTEMS_USE_NEWLIB" = xyes], |
---|
[3da33bf8] | 151 | [1], |
---|
| 152 | [if using newlib]) |
---|
| 153 | |
---|
| 154 | RTEMS_CPUOPT([RTEMS_POSIX_API], |
---|
[28caa1d] | 155 | [test x"$rtems_cv_HAS_POSIX_API" = xyes], |
---|
[3da33bf8] | 156 | [1], |
---|
| 157 | [if posix api is supported]) |
---|
| 158 | |
---|
[28caa1d] | 159 | RTEMS_CPUOPT([RTEMS_NETWORKING], |
---|
| 160 | [test x"$rtems_cv_HAS_NETWORKING" = xyes], |
---|
| 161 | [1], |
---|
| 162 | [if networking is enabled]) |
---|
| 163 | |
---|
[3da33bf8] | 164 | RTEMS_CPUOPT([RTEMS_UNIX], |
---|
[28caa1d] | 165 | [test x"$RTEMS_CPU" = xunix], |
---|
[3da33bf8] | 166 | [1], |
---|
| 167 | [to indicate RTEMS unix]) |
---|
| 168 | |
---|
| 169 | RTEMS_CPUOPT([RTEMS_UNIXLIB], |
---|
[28caa1d] | 170 | [test x"${enable_unixlib}" = xyes], |
---|
[3da33bf8] | 171 | [1], |
---|
| 172 | [to indicate RTEMS using RTEMS's unixlib]) |
---|
| 173 | |
---|
[a5777f0] | 174 | RTEMS_CPUOPT([RTEMS_USES_STDINT_H], |
---|
| 175 | [test x"${RTEMS_USES_STDINT_H}" = x"yes"], |
---|
| 176 | [1], |
---|
| 177 | [if RTEMS uses stdint.h]) |
---|
| 178 | |
---|
[9d0e65ed] | 179 | RTEMS_CPUOPT([RTEMS_USES_TAR_H], |
---|
| 180 | [test x"${RTEMS_USES_TAR_H}" = x"yes"], |
---|
| 181 | [1], |
---|
| 182 | [if RTEMS uses tar.h]) |
---|
| 183 | |
---|
[3da33bf8] | 184 | RTEMS_CPUOPT([RTEMS_VERSION], |
---|
| 185 | [true], |
---|
[1bcbe41] | 186 | ["]_RTEMS_VERSION["], |
---|
[3da33bf8] | 187 | [RTEMS version string]) |
---|
| 188 | |
---|
[10ae124c] | 189 | RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT], |
---|
| 190 | [test x"$RTEMS_CPU" = x"unix"], |
---|
| 191 | [$ac_cv_sizeof_CPU_CONTEXT], |
---|
| 192 | [The size of a 'CPU_CONTEXT', as computed by sizeof]) |
---|
| 193 | |
---|
[1bcbe41] | 194 | cat >>cpuopts.tmp <<\_ACEOF |
---|
| 195 | |
---|
[3a805b2] | 196 | #endif /* _RTEMS_SCORE_CPUOPTS_H */ |
---|
[1bcbe41] | 197 | _ACEOF |
---|
[3da33bf8] | 198 | |
---|
| 199 | AS_MKDIR_P(score/include/rtems/score) |
---|
| 200 | AS_IF([test -f score/include/rtems/score/cpuopts.h], |
---|
| 201 | [ |
---|
| 202 | AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null], |
---|
| 203 | [ |
---|
| 204 | AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged]) |
---|
| 205 | rm -f cpuopts.tmp |
---|
| 206 | ],[ |
---|
| 207 | AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) |
---|
| 208 | rm -f score/include/rtems/score/cpuopts.h |
---|
| 209 | mv cpuopts.tmp score/include/rtems/score/cpuopts.h |
---|
| 210 | ]) |
---|
| 211 | ],[ |
---|
| 212 | AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) |
---|
| 213 | rm -f score/include/rtems/score/cpuopts.h |
---|
| 214 | mv cpuopts.tmp score/include/rtems/score/cpuopts.h |
---|
[f31a078] | 215 | ]) |
---|
[e0ba3e8] | 216 | |
---|
[8217c40] | 217 | AC_ENABLE_MULTILIB([Makefile],[..]) |
---|
| 218 | |
---|
[e30210ea] | 219 | # libmisc/shell/* wants to assign file descriptors to stdio file descriptors. |
---|
| 220 | AC_MSG_CHECKING([for assignable stdio]) |
---|
| 221 | AC_COMPILE_IFELSE( |
---|
| 222 | [AC_LANG_PROGRAM( |
---|
| 223 | [#include <stdio.h>], |
---|
| 224 | [stdin = fopen("/tmp", "r")])], |
---|
| 225 | [HAVE_ASSIGNABLE_STDIO=yes], |
---|
| 226 | [HAVE_ASSIGNABLE_STDIO=no]) |
---|
| 227 | AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO]) |
---|
| 228 | |
---|
| 229 | # libmisc/serdbg exploits weak symbols |
---|
[d71ab7fd] | 230 | RTEMS_CHECK_GCC_WEAK |
---|
[f7952533] | 231 | |
---|
[62f0829] | 232 | AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes]) |
---|
| 233 | AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes]) |
---|
| 234 | |
---|
[07da959] | 235 | # FIXME: These checks are only in here to provide |
---|
| 236 | # configuration-time diagnostics and are not really used. |
---|
| 237 | AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>]) |
---|
| 238 | AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>]) |
---|
| 239 | |
---|
| 240 | ## BSD-ism, excluded from POSIX, but available on most platforms |
---|
| 241 | AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>]) |
---|
| 242 | |
---|
| 243 | ## Check if libc provides BSD's strlcpy/strlcat |
---|
| 244 | AC_CHECK_FUNCS(strlcpy strlcat) |
---|
| 245 | |
---|
| 246 | |
---|
| 247 | # ... far too many conditionals ... |
---|
[b422de6c] | 248 | AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"]) |
---|
| 249 | AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"]) |
---|
[07da959] | 250 | AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes") |
---|
[b422de6c] | 251 | |
---|
[1bcbe41] | 252 | AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" ) |
---|
[b422de6c] | 253 | |
---|
[1bcbe41] | 254 | AM_CONDITIONAL(HAS_POSIX,test x"$rtems_cv_HAS_POSIX_API" = x"yes") |
---|
| 255 | AM_CONDITIONAL(HAS_ITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes") |
---|
[b422de6c] | 256 | AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes") |
---|
| 257 | |
---|
[07da959] | 258 | AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"]) |
---|
[62f0829] | 259 | AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"]) |
---|
[07da959] | 260 | |
---|
[e30210ea] | 261 | AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"]) |
---|
| 262 | AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"]) |
---|
| 263 | |
---|
[068cf700] | 264 | RTEMS_AMPOLISH3 |
---|
[b1f1bfbb] | 265 | |
---|
[3da33bf8] | 266 | AC_CONFIG_HEADER(config.h) |
---|
| 267 | |
---|
[70810dc] | 268 | # Explicitly list all Makefiles here |
---|
[b422de6c] | 269 | AC_CONFIG_FILES([ |
---|
| 270 | Makefile |
---|
[1896a650] | 271 | rtems/Makefile |
---|
| 272 | sapi/Makefile |
---|
[eb299afc] | 273 | score/Makefile |
---|
| 274 | score/cpu/Makefile |
---|
[e9d90764] | 275 | score/cpu/arm/Makefile |
---|
[b78d94d] | 276 | score/cpu/bfin/Makefile |
---|
[05f3270] | 277 | score/cpu/avr/Makefile |
---|
[e9d90764] | 278 | score/cpu/c4x/Makefile |
---|
| 279 | score/cpu/h8300/Makefile |
---|
| 280 | score/cpu/i386/Makefile |
---|
| 281 | score/cpu/m68k/Makefile |
---|
| 282 | score/cpu/mips/Makefile |
---|
[60eae27d] | 283 | score/cpu/nios2/Makefile |
---|
[e9d90764] | 284 | score/cpu/powerpc/Makefile |
---|
| 285 | score/cpu/sh/Makefile |
---|
| 286 | score/cpu/sparc/Makefile |
---|
| 287 | score/cpu/unix/Makefile |
---|
[6b400fed] | 288 | score/cpu/no_cpu/Makefile |
---|
[b422de6c] | 289 | posix/Makefile |
---|
| 290 | itron/Makefile |
---|
| 291 | libblock/Makefile |
---|
| 292 | libfs/Makefile |
---|
[07da959] | 293 | libcsupport/Makefile |
---|
[b422de6c] | 294 | libnetworking/Makefile |
---|
[da0fc5d] | 295 | librpc/Makefile |
---|
[b422de6c] | 296 | libmisc/Makefile |
---|
[6339f467] | 297 | libi2c/Makefile |
---|
[fa645f6] | 298 | zlib/Makefile |
---|
[be4bd26] | 299 | httpd/Makefile |
---|
[f26145b] | 300 | ftpd/Makefile |
---|
[8280caa4] | 301 | telnetd/Makefile |
---|
[c5bb2a4e] | 302 | pppd/Makefile |
---|
[28caa1d] | 303 | wrapup/Makefile]) |
---|
| 304 | |
---|
| 305 | AC_CONFIG_COMMANDS([preinstall-stamp], |
---|
| 306 | [test -z "$with_multisubdir" && ${MAKE} preinstall-stamp], |
---|
| 307 | [MAKE=${MAKE} |
---|
| 308 | with_multisubdir="$with_multisubdir"]) |
---|
[92ed8c2] | 309 | |
---|
[66387986] | 310 | AC_OUTPUT |
---|