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