[66387986] | 1 | ## Process this file with autoconf to produce a configure script. |
---|
| 2 | ## |
---|
| 3 | ## $Id$ |
---|
[eb299afc] | 4 | |
---|
[9b353a5] | 5 | AC_PREREQ(2.57) |
---|
[f31a078] | 6 | AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) |
---|
[66387986] | 7 | AC_CONFIG_SRCDIR([score]) |
---|
[51b4875] | 8 | RTEMS_TOP(..) |
---|
[eb299afc] | 9 | |
---|
| 10 | RTEMS_CANONICAL_TARGET_CPU |
---|
| 11 | |
---|
[33e6983] | 12 | AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.7.2]) |
---|
[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 | |
---|
| 26 | RTEMS_CHECK_CPU |
---|
| 27 | RTEMS_CANONICAL_HOST |
---|
| 28 | |
---|
[53c3a2c6] | 29 | RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) |
---|
[eb299afc] | 30 | RTEMS_CANONICALIZE_TOOLS |
---|
[e73e576] | 31 | AC_PROG_RANLIB |
---|
[eb299afc] | 32 | |
---|
[92ed8c2] | 33 | # FIXME: For the moment, no reason to check for ada |
---|
| 34 | # RTEMS_PROG_GNAT |
---|
| 35 | |
---|
[eb299afc] | 36 | RTEMS_CHECK_NEWLIB |
---|
| 37 | |
---|
[27f9f12] | 38 | RTEMS_CHECK_MULTIPROCESSING |
---|
| 39 | RTEMS_CHECK_POSIX_API |
---|
| 40 | RTEMS_CHECK_ITRON_API |
---|
[3e39b47] | 41 | RTEMS_CHECK_NETWORKING |
---|
[1896a650] | 42 | |
---|
[eb299afc] | 43 | # If RTEMS macros are enabled, then use them. Otherwise, use inlines. |
---|
[8217c40] | 44 | AS_IF([test "$RTEMS_USE_MACROS" = "yes"], |
---|
| 45 | [INLINEdir="macros"], |
---|
| 46 | [INLINEdir="inline"]) |
---|
[120e9fb] | 47 | AC_SUBST(INLINEdir) |
---|
[85956f9] | 48 | AC_DEFINE(RTEMS_VERSION,["][_RTEMS_VERSION]["],[RTEMS version string]) |
---|
[1896a650] | 49 | |
---|
[7660ccd8] | 50 | RTEMS_CPU_SUBDIRS([score/cpu]) |
---|
[85956f9] | 51 | |
---|
[85eb57e7] | 52 | AS_IF([test x"$HAS_NETWORKING" = x"yes"],[ |
---|
| 53 | ## FIXME: Should better use a feature-based test |
---|
[e336882] | 54 | AC_MSG_CHECKING([whether CPU supports librpc]) |
---|
[85eb57e7] | 55 | case "$RTEMS_CPU" in |
---|
| 56 | c4x ) LIBRPC=no;; |
---|
| 57 | or32 ) LIBRPC=no;; |
---|
| 58 | * ) LIBRPC=yes;; |
---|
| 59 | esac |
---|
[e336882] | 60 | AC_MSG_RESULT([$LIBRPC]) |
---|
[2a582aa5] | 61 | ]) |
---|
[07da959] | 62 | |
---|
[965c49b2] | 63 | AC_ARG_ENABLE([ada], |
---|
| 64 | [AC_HELP_STRING([--enable-ada],[enable ada support])], |
---|
| 65 | [case "${enable_ada}" in |
---|
| 66 | yes) ;; |
---|
| 67 | no) ;; |
---|
| 68 | *) AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;; |
---|
| 69 | esac],[enable_ada=no]) |
---|
| 70 | |
---|
[b8a30d07] | 71 | RTEMS_DEFINE_POSIX_API |
---|
| 72 | RTEMS_DEFINE_ITRON_API |
---|
| 73 | RTEMS_DEFINE_MULTIPROCESSING |
---|
| 74 | |
---|
[c0394d4b] | 75 | # HACK: We should use a feature-based configuration. |
---|
[8217c40] | 76 | AS_IF([test x"${RTEMS_CPU}" = x"unix"],[ |
---|
[64b1f81] | 77 | AC_DEFINE_UNQUOTED([RTEMS_UNIX],[1],[to indicate RTEMS unix]) |
---|
[8217c40] | 78 | # HACK: silently accept --enable-unixlib |
---|
[64b1f81] | 79 | test -n "${enable_unixlib}" || enable_unixlib="yes" |
---|
[8217c40] | 80 | ]) |
---|
| 81 | |
---|
| 82 | AS_IF([test x"${enable_unixlib}" = x"yes"], |
---|
[64b1f81] | 83 | [AC_DEFINE_UNQUOTED([RTEMS_UNIXLIB],[1], |
---|
[8217c40] | 84 | [to indicate RTEMS using RTEMS's unixlib])] |
---|
| 85 | ) |
---|
[c0394d4b] | 86 | |
---|
[b422de6c] | 87 | # BSD-isms, used throughout the sources |
---|
| 88 | # Not really used by this configure script |
---|
| 89 | # FIXME: They should be eliminated if possible. |
---|
[85956f9] | 90 | AC_CHECK_FUNCS([strsep strcasecmp snprintf]) |
---|
[b422de6c] | 91 | AC_CHECK_FUNCS([bcopy bcmp]) |
---|
| 92 | AC_CHECK_FUNCS([isascii fileno]) |
---|
[f31a078] | 93 | |
---|
| 94 | AM_CONFIG_HEADER([score/include/rtems/score/cpuopts-tmp.h],[ |
---|
| 95 | echo "/* target cpu dependent options file */" >$tmp/config.h |
---|
| 96 | echo "/* automatically generated -- DO NOT EDIT!! */" >>$tmp/config.h |
---|
| 97 | echo >>$tmp/config.h |
---|
| 98 | echo "#ifndef __CPU_OPTIONS_h" >>$tmp/config.h |
---|
| 99 | echo "#define __CPU_OPTIONS_h" >>$tmp/config.h |
---|
| 100 | echo >>$tmp/config.h |
---|
| 101 | sed -e '/.*PACKAGE.*/d' score/include/rtems/score/cpuopts-tmp.h >> $tmp/config.h |
---|
| 102 | echo >>$tmp/config.h |
---|
| 103 | echo "#endif" >>$tmp/config.h |
---|
| 104 | AS_IF([cmp -s score/include/rtems/score/cpuopts.h $tmp/config.h 2>/dev/null], |
---|
| 105 | [AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged]) |
---|
| 106 | rm -f $tmp/config.h], |
---|
| 107 | [AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) |
---|
| 108 | rm -f score/include/rtems/score/cpuopts.h |
---|
| 109 | mv $tmp/config.h score/include/rtems/score/cpuopts.h]) |
---|
| 110 | ]) |
---|
[e0ba3e8] | 111 | |
---|
[8217c40] | 112 | AC_ENABLE_MULTILIB([Makefile],[..]) |
---|
| 113 | |
---|
[64b1f81] | 114 | ## HACK: Add a define to cpuopts.h to indicate using multilibs |
---|
| 115 | ## Can be applied to produce compiler errors if using |
---|
| 116 | ## multilib-incompatible settings somewhere else (eg. bspopts.h). |
---|
| 117 | AS_IF([test x"${enable_multilib}" = x"yes"],[ |
---|
| 118 | AC_DEFINE_UNQUOTED([RTEMS_MULTILIBS],[1],[using multilib'ed RTEMS]) |
---|
| 119 | ]) |
---|
| 120 | |
---|
[e30210ea] | 121 | # libmisc/shell/* wants to assign file descriptors to stdio file descriptors. |
---|
| 122 | AC_MSG_CHECKING([for assignable stdio]) |
---|
| 123 | AC_COMPILE_IFELSE( |
---|
| 124 | [AC_LANG_PROGRAM( |
---|
| 125 | [#include <stdio.h>], |
---|
| 126 | [stdin = fopen("/tmp", "r")])], |
---|
| 127 | [HAVE_ASSIGNABLE_STDIO=yes], |
---|
| 128 | [HAVE_ASSIGNABLE_STDIO=no]) |
---|
| 129 | AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO]) |
---|
| 130 | |
---|
| 131 | # libmisc/serdbg exploits weak symbols |
---|
| 132 | AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))], |
---|
| 133 | [rtems_cv_cc_attribute_weak],[ |
---|
| 134 | AS_IF([test x"$GCC" = xyes],[ |
---|
| 135 | save_CFLAGS=$CFLAGS |
---|
| 136 | CFLAGS=-Werror]) |
---|
| 137 | |
---|
| 138 | AC_COMPILE_IFELSE([ |
---|
| 139 | AC_LANG_PROGRAM( |
---|
| 140 | [void myfunc(char c) __attribute__ ((weak)); |
---|
| 141 | void myfunc(char c) {}], |
---|
| 142 | [])], |
---|
| 143 | [rtems_cv_cc_attribute_weak=yes], |
---|
| 144 | [rtems_cv_cc_attribute_weak=no]) |
---|
| 145 | |
---|
| 146 | AS_IF([test x"$GCC" = xyes],[ |
---|
| 147 | CFLAGS=$save_CFLAGS]) |
---|
| 148 | ]) |
---|
[f7952533] | 149 | |
---|
[07da959] | 150 | AS_IF([test x"$RTEMS_USE_NEWLIB" != x"yes"],[ |
---|
| 151 | ## Provide headers only if the host doesn't. |
---|
| 152 | AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes]) |
---|
| 153 | AC_CHECK_HEADERS([stdint.h],[NEED_STDINT_H=no],[NEED_STDINT_H=yes]) |
---|
| 154 | AC_CHECK_HEADERS([inttypes.h],[NEED_INTTYPES_H=no],[NEED_INTTYPES=yes]) |
---|
| 155 | ],[ |
---|
| 156 | ## Using newlib, we provide sys/cdefs.h |
---|
| 157 | NEED_SYS_CDEFS_H=yes |
---|
| 158 | NEED_STDINT_H=yes |
---|
| 159 | NEED_INTTYPES_H=yes |
---|
| 160 | ]) |
---|
| 161 | |
---|
| 162 | # FIXME: These checks are only in here to provide |
---|
| 163 | # configuration-time diagnostics and are not really used. |
---|
| 164 | AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>]) |
---|
| 165 | AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>]) |
---|
| 166 | |
---|
| 167 | AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],[ |
---|
| 168 | ac_cv_have_decl_XTABS=yes |
---|
| 169 | ac_cv_have_decl_OLCUC=yes |
---|
| 170 | ## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD) |
---|
| 171 | ac_cv_have_decl_ONLRET=yes |
---|
| 172 | ac_cv_have_decl_ONOCR=yes |
---|
| 173 | ac_cv_have_decl_TABDLY=yes |
---|
| 174 | ac_cv_have_decl_OCRNL=yes |
---|
| 175 | ac_cv_have_decl_IUCLC=yes |
---|
| 176 | ## SUSV3-XSI extension |
---|
| 177 | ac_cv_have_decl_ECHOPRT=yes |
---|
| 178 | ]) |
---|
| 179 | |
---|
| 180 | # FIXME: Some cruft to work around portability issues with termios.c |
---|
| 181 | ## Seemingly not covered by any standard. |
---|
| 182 | AC_CHECK_DECLS([XTABS],,,[#include <termios.h>]) |
---|
| 183 | AC_CHECK_DECLS([OLCUC],,,[#include <termios.h>]) |
---|
| 184 | ## SUSV3, but seemingly not available on some platforms (reportedly FreeBSD) |
---|
| 185 | AC_CHECK_DECLS([ONLRET],,,[#include <termios.h>]) |
---|
| 186 | AC_CHECK_DECLS([ONOCR],,,[#include <termios.h>]) |
---|
| 187 | AC_CHECK_DECLS([TABDLY],,,[#include <termios.h>]) |
---|
| 188 | AC_CHECK_DECLS([OCRNL],,,[#include <termios.h>]) |
---|
| 189 | AC_CHECK_DECLS([IUCLC],,,[#include <termios.h>]) |
---|
| 190 | ## SUSV3-XSI extension |
---|
| 191 | AC_CHECK_DECLS([ECHOPRT],,,[#include <termios.h>]) |
---|
| 192 | |
---|
| 193 | ## BSD-ism, excluded from POSIX, but available on most platforms |
---|
| 194 | AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>]) |
---|
| 195 | |
---|
| 196 | ## Check if libc provides BSD's strlcpy/strlcat |
---|
| 197 | AC_CHECK_FUNCS(strlcpy strlcat) |
---|
| 198 | |
---|
| 199 | |
---|
| 200 | # ... far too many conditionals ... |
---|
[b422de6c] | 201 | AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"]) |
---|
| 202 | AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"]) |
---|
[07da959] | 203 | AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes") |
---|
[b422de6c] | 204 | |
---|
| 205 | AM_CONDITIONAL(INLINE,test x"$INLINEdir" = x"inline" ) |
---|
| 206 | AM_CONDITIONAL(MACROS,test x"$INLINEdir" = x"macros" ) |
---|
| 207 | AM_CONDITIONAL(HAS_MP,test x"$HAS_MP" = x"yes" ) |
---|
| 208 | |
---|
| 209 | AM_CONDITIONAL(HAS_POSIX,test x"$HAS_POSIX_API" = x"yes") |
---|
| 210 | AM_CONDITIONAL(HAS_ITRON,test x"$HAS_ITRON_API" = x"yes") |
---|
| 211 | AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes") |
---|
| 212 | |
---|
| 213 | # FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't! |
---|
| 214 | AM_CONDITIONAL([LIBSCORECPU], |
---|
| 215 | [test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"]) |
---|
| 216 | |
---|
[92ed8c2] | 217 | AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \ |
---|
| 218 | && test x"$HAS_POSIX_API" = x"yes"]) |
---|
| 219 | |
---|
[07da959] | 220 | AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"]) |
---|
| 221 | AM_CONDITIONAL([NEED_STDINT_H],[test x"$NEED_STDINT_H" = x"yes"]) |
---|
| 222 | AM_CONDITIONAL([NEED_INTTYPES_H],[test x"$NEED_INTTYPES_H" = x"yes"]) |
---|
| 223 | |
---|
[e30210ea] | 224 | AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"]) |
---|
| 225 | AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"]) |
---|
| 226 | |
---|
[70810dc] | 227 | # Explicitly list all Makefiles here |
---|
[b422de6c] | 228 | AC_CONFIG_FILES([ |
---|
| 229 | Makefile |
---|
[8217c40] | 230 | include/Makefile |
---|
[b422de6c] | 231 | ada/Makefile |
---|
[1896a650] | 232 | rtems/Makefile |
---|
| 233 | sapi/Makefile |
---|
[eb299afc] | 234 | score/Makefile |
---|
| 235 | score/cpu/Makefile |
---|
[b422de6c] | 236 | posix/Makefile |
---|
| 237 | itron/Makefile |
---|
| 238 | libblock/Makefile |
---|
| 239 | libfs/Makefile |
---|
[e604ab6] | 240 | libfs/src/Makefile |
---|
| 241 | libfs/src/imfs/Makefile |
---|
[b422de6c] | 242 | libfs/src/dosfs/Makefile |
---|
[07da959] | 243 | libcsupport/Makefile |
---|
[b422de6c] | 244 | libnetworking/Makefile |
---|
[85956f9] | 245 | libnetworking/lib/Makefile |
---|
| 246 | libnetworking/libc/Makefile |
---|
[b422de6c] | 247 | libnetworking/wrapup/Makefile |
---|
[da0fc5d] | 248 | librpc/Makefile |
---|
| 249 | librpc/include/Makefile |
---|
| 250 | librpc/src/Makefile |
---|
| 251 | librpc/src/xdr/Makefile |
---|
| 252 | librpc/src/rpc/Makefile |
---|
[b422de6c] | 253 | libmisc/Makefile |
---|
[e30210ea] | 254 | libmisc/cpuuse/Makefile |
---|
| 255 | libmisc/shell/Makefile |
---|
| 256 | libmisc/devnull/Makefile |
---|
| 257 | libmisc/dummy/Makefile |
---|
| 258 | libmisc/dumpbuf/Makefile |
---|
| 259 | libmisc/monitor/Makefile |
---|
| 260 | libmisc/rtmonuse/Makefile |
---|
| 261 | libmisc/serdbg/Makefile |
---|
| 262 | libmisc/stackchk/Makefile |
---|
| 263 | libmisc/capture/Makefile |
---|
| 264 | libmisc/untar/Makefile |
---|
| 265 | libmisc/mw-fb/Makefile |
---|
[b31b35f] | 266 | libmisc/fsmount/Makefile |
---|
[e30210ea] | 267 | libmisc/wrapup/Makefile |
---|
| 268 | |
---|
[b422de6c] | 269 | wrapup/Makefile |
---|
| 270 | ]) |
---|
[92ed8c2] | 271 | |
---|
[66387986] | 272 | AC_OUTPUT |
---|