[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]) |
---|
[90926129] | 51 | AC_CONFIG_SUBDIRS([libcsupport]) |
---|
[85956f9] | 52 | |
---|
[85eb57e7] | 53 | AS_IF([test x"$HAS_NETWORKING" = x"yes"],[ |
---|
| 54 | ## FIXME: Should better use a feature-based test |
---|
[e336882] | 55 | AC_MSG_CHECKING([whether CPU supports librpc]) |
---|
[85eb57e7] | 56 | case "$RTEMS_CPU" in |
---|
| 57 | c4x ) LIBRPC=no;; |
---|
| 58 | or32 ) LIBRPC=no;; |
---|
| 59 | * ) LIBRPC=yes;; |
---|
| 60 | esac |
---|
[e336882] | 61 | AC_MSG_RESULT([$LIBRPC]) |
---|
| 62 | AS_IF([test "$LIBRPC" = "yes"], |
---|
[85eb57e7] | 63 | [AC_CONFIG_SUBDIRS([librpc]) |
---|
[2a582aa5] | 64 | ]) |
---|
| 65 | ]) |
---|
[965c49b2] | 66 | AC_ARG_ENABLE([ada], |
---|
| 67 | [AC_HELP_STRING([--enable-ada],[enable ada support])], |
---|
| 68 | [case "${enable_ada}" in |
---|
| 69 | yes) ;; |
---|
| 70 | no) ;; |
---|
| 71 | *) AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;; |
---|
| 72 | esac],[enable_ada=no]) |
---|
| 73 | |
---|
[b8a30d07] | 74 | RTEMS_DEFINE_POSIX_API |
---|
| 75 | RTEMS_DEFINE_ITRON_API |
---|
| 76 | RTEMS_DEFINE_MULTIPROCESSING |
---|
| 77 | |
---|
[c0394d4b] | 78 | # HACK: We should use a feature-based configuration. |
---|
[8217c40] | 79 | AS_IF([test x"${RTEMS_CPU}" = x"unix"],[ |
---|
[64b1f81] | 80 | AC_DEFINE_UNQUOTED([RTEMS_UNIX],[1],[to indicate RTEMS unix]) |
---|
[8217c40] | 81 | # HACK: silently accept --enable-unixlib |
---|
[64b1f81] | 82 | test -n "${enable_unixlib}" || enable_unixlib="yes" |
---|
[8217c40] | 83 | ]) |
---|
| 84 | |
---|
[35cd6ae] | 85 | |
---|
[8217c40] | 86 | AS_IF([test x"${enable_unixlib}" = x"yes"], |
---|
[64b1f81] | 87 | [AC_DEFINE_UNQUOTED([RTEMS_UNIXLIB],[1], |
---|
[8217c40] | 88 | [to indicate RTEMS using RTEMS's unixlib])] |
---|
| 89 | ) |
---|
[c0394d4b] | 90 | |
---|
[b422de6c] | 91 | # BSD-isms, used throughout the sources |
---|
| 92 | # Not really used by this configure script |
---|
| 93 | # FIXME: They should be eliminated if possible. |
---|
[85956f9] | 94 | AC_CHECK_FUNCS([strsep strcasecmp snprintf]) |
---|
[b422de6c] | 95 | AC_CHECK_FUNCS([bcopy bcmp]) |
---|
| 96 | AC_CHECK_FUNCS([isascii fileno]) |
---|
[f31a078] | 97 | |
---|
| 98 | AM_CONFIG_HEADER([score/include/rtems/score/cpuopts-tmp.h],[ |
---|
| 99 | echo "/* target cpu dependent options file */" >$tmp/config.h |
---|
| 100 | echo "/* automatically generated -- DO NOT EDIT!! */" >>$tmp/config.h |
---|
| 101 | echo >>$tmp/config.h |
---|
| 102 | echo "#ifndef __CPU_OPTIONS_h" >>$tmp/config.h |
---|
| 103 | echo "#define __CPU_OPTIONS_h" >>$tmp/config.h |
---|
| 104 | echo >>$tmp/config.h |
---|
| 105 | sed -e '/.*PACKAGE.*/d' score/include/rtems/score/cpuopts-tmp.h >> $tmp/config.h |
---|
| 106 | echo >>$tmp/config.h |
---|
| 107 | echo "#endif" >>$tmp/config.h |
---|
| 108 | AS_IF([cmp -s score/include/rtems/score/cpuopts.h $tmp/config.h 2>/dev/null], |
---|
| 109 | [AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged]) |
---|
| 110 | rm -f $tmp/config.h], |
---|
| 111 | [AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) |
---|
| 112 | rm -f score/include/rtems/score/cpuopts.h |
---|
| 113 | mv $tmp/config.h score/include/rtems/score/cpuopts.h]) |
---|
| 114 | ]) |
---|
[e0ba3e8] | 115 | |
---|
[8217c40] | 116 | AC_ENABLE_MULTILIB([Makefile],[..]) |
---|
| 117 | |
---|
[64b1f81] | 118 | ## HACK: Add a define to cpuopts.h to indicate using multilibs |
---|
| 119 | ## Can be applied to produce compiler errors if using |
---|
| 120 | ## multilib-incompatible settings somewhere else (eg. bspopts.h). |
---|
| 121 | AS_IF([test x"${enable_multilib}" = x"yes"],[ |
---|
| 122 | AC_DEFINE_UNQUOTED([RTEMS_MULTILIBS],[1],[using multilib'ed RTEMS]) |
---|
| 123 | ]) |
---|
| 124 | |
---|
[e30210ea] | 125 | # libmisc/shell/* wants to assign file descriptors to stdio file descriptors. |
---|
| 126 | AC_MSG_CHECKING([for assignable stdio]) |
---|
| 127 | AC_COMPILE_IFELSE( |
---|
| 128 | [AC_LANG_PROGRAM( |
---|
| 129 | [#include <stdio.h>], |
---|
| 130 | [stdin = fopen("/tmp", "r")])], |
---|
| 131 | [HAVE_ASSIGNABLE_STDIO=yes], |
---|
| 132 | [HAVE_ASSIGNABLE_STDIO=no]) |
---|
| 133 | AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO]) |
---|
| 134 | |
---|
| 135 | # libmisc/serdbg exploits weak symbols |
---|
| 136 | AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))], |
---|
| 137 | [rtems_cv_cc_attribute_weak],[ |
---|
| 138 | AS_IF([test x"$GCC" = xyes],[ |
---|
| 139 | save_CFLAGS=$CFLAGS |
---|
| 140 | CFLAGS=-Werror]) |
---|
| 141 | |
---|
| 142 | AC_COMPILE_IFELSE([ |
---|
| 143 | AC_LANG_PROGRAM( |
---|
| 144 | [void myfunc(char c) __attribute__ ((weak)); |
---|
| 145 | void myfunc(char c) {}], |
---|
| 146 | [])], |
---|
| 147 | [rtems_cv_cc_attribute_weak=yes], |
---|
| 148 | [rtems_cv_cc_attribute_weak=no]) |
---|
| 149 | |
---|
| 150 | AS_IF([test x"$GCC" = xyes],[ |
---|
| 151 | CFLAGS=$save_CFLAGS]) |
---|
| 152 | ]) |
---|
[f7952533] | 153 | |
---|
[b422de6c] | 154 | AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"]) |
---|
| 155 | AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"]) |
---|
| 156 | |
---|
| 157 | AM_CONDITIONAL(INLINE,test x"$INLINEdir" = x"inline" ) |
---|
| 158 | AM_CONDITIONAL(MACROS,test x"$INLINEdir" = x"macros" ) |
---|
| 159 | AM_CONDITIONAL(HAS_MP,test x"$HAS_MP" = x"yes" ) |
---|
| 160 | |
---|
| 161 | AM_CONDITIONAL(HAS_POSIX,test x"$HAS_POSIX_API" = x"yes") |
---|
| 162 | AM_CONDITIONAL(HAS_ITRON,test x"$HAS_ITRON_API" = x"yes") |
---|
| 163 | AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes") |
---|
| 164 | |
---|
| 165 | # FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't! |
---|
| 166 | AM_CONDITIONAL([LIBSCORECPU], |
---|
| 167 | [test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"]) |
---|
| 168 | |
---|
[92ed8c2] | 169 | AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \ |
---|
| 170 | && test x"$HAS_POSIX_API" = x"yes"]) |
---|
| 171 | |
---|
[e30210ea] | 172 | AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"]) |
---|
| 173 | AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"]) |
---|
| 174 | |
---|
[70810dc] | 175 | # Explicitly list all Makefiles here |
---|
[b422de6c] | 176 | AC_CONFIG_FILES([ |
---|
| 177 | Makefile |
---|
[8217c40] | 178 | include/Makefile |
---|
[b422de6c] | 179 | ada/Makefile |
---|
[1896a650] | 180 | rtems/Makefile |
---|
| 181 | sapi/Makefile |
---|
[eb299afc] | 182 | score/Makefile |
---|
| 183 | score/cpu/Makefile |
---|
[b422de6c] | 184 | posix/Makefile |
---|
| 185 | itron/Makefile |
---|
| 186 | libblock/Makefile |
---|
| 187 | libfs/Makefile |
---|
[e604ab6] | 188 | libfs/src/Makefile |
---|
| 189 | libfs/src/imfs/Makefile |
---|
[b422de6c] | 190 | libfs/src/dosfs/Makefile |
---|
| 191 | libnetworking/Makefile |
---|
[85956f9] | 192 | libnetworking/lib/Makefile |
---|
| 193 | libnetworking/libc/Makefile |
---|
[b422de6c] | 194 | libnetworking/wrapup/Makefile |
---|
| 195 | libmisc/Makefile |
---|
[e30210ea] | 196 | libmisc/cpuuse/Makefile |
---|
| 197 | libmisc/shell/Makefile |
---|
| 198 | libmisc/devnull/Makefile |
---|
| 199 | libmisc/dummy/Makefile |
---|
| 200 | libmisc/dumpbuf/Makefile |
---|
| 201 | libmisc/monitor/Makefile |
---|
| 202 | libmisc/rtmonuse/Makefile |
---|
| 203 | libmisc/serdbg/Makefile |
---|
| 204 | libmisc/stackchk/Makefile |
---|
| 205 | libmisc/capture/Makefile |
---|
| 206 | libmisc/untar/Makefile |
---|
| 207 | libmisc/mw-fb/Makefile |
---|
| 208 | libmisc/wrapup/Makefile |
---|
| 209 | |
---|
[b422de6c] | 210 | wrapup/Makefile |
---|
| 211 | ]) |
---|
[92ed8c2] | 212 | |
---|
[66387986] | 213 | AC_OUTPUT |
---|