[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) |
---|
[8217c40] | 48 | AM_CONDITIONAL(INLINE,test x"$INLINEdir" = x"inline" ) |
---|
| 49 | AM_CONDITIONAL(MACROS,test x"$INLINEdir" = x"macros" ) |
---|
| 50 | AM_CONDITIONAL(HAS_MP,test x"$HAS_MP" = x"yes" ) |
---|
[1896a650] | 51 | |
---|
[490a605] | 52 | AC_DEFINE(RTEMS_VERSION,["rtems-][_RTEMS_VERSION]["],[RTEMS version string]) |
---|
[1896a650] | 53 | |
---|
[8217c40] | 54 | AM_CONDITIONAL(HAS_POSIX,test x"$HAS_POSIX_API" = x"yes") |
---|
| 55 | AM_CONDITIONAL(HAS_ITRON,test x"$HAS_ITRON_API" = x"yes") |
---|
[3e39b47] | 56 | AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes") |
---|
[eb299afc] | 57 | |
---|
[8217c40] | 58 | AS_IF([test x"$HAS_POSIX_API" = x"yes"], |
---|
| 59 | [AC_CONFIG_SUBDIRS([posix])] |
---|
| 60 | ) |
---|
| 61 | AS_IF([test x"$HAS_ITRON_API" = x"yes"], |
---|
| 62 | [AC_CONFIG_SUBDIRS(itron)] |
---|
| 63 | ) |
---|
[7660ccd8] | 64 | RTEMS_CPU_SUBDIRS([score/cpu]) |
---|
[2a582aa5] | 65 | # FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't! |
---|
| 66 | AM_CONDITIONAL([LIBSCORECPU], |
---|
| 67 | [test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"]) |
---|
[eb299afc] | 68 | |
---|
[90926129] | 69 | AC_CONFIG_SUBDIRS([libcsupport]) |
---|
[35cd6ae] | 70 | AC_CONFIG_SUBDIRS([libfs]) |
---|
[85eb57e7] | 71 | AS_IF([test x"$HAS_NETWORKING" = x"yes"],[ |
---|
| 72 | AC_CONFIG_SUBDIRS(libnetworking) |
---|
| 73 | ## FIXME: Should better use a feature-based test |
---|
[e336882] | 74 | AC_MSG_CHECKING([whether CPU supports librpc]) |
---|
[85eb57e7] | 75 | case "$RTEMS_CPU" in |
---|
| 76 | c4x ) LIBRPC=no;; |
---|
| 77 | or32 ) LIBRPC=no;; |
---|
| 78 | * ) LIBRPC=yes;; |
---|
| 79 | esac |
---|
[e336882] | 80 | AC_MSG_RESULT([$LIBRPC]) |
---|
| 81 | AS_IF([test "$LIBRPC" = "yes"], |
---|
[85eb57e7] | 82 | [AC_CONFIG_SUBDIRS([librpc]) |
---|
[2a582aa5] | 83 | ]) |
---|
| 84 | ]) |
---|
| 85 | AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"]) |
---|
[90926129] | 86 | |
---|
[965c49b2] | 87 | AC_ARG_ENABLE([ada], |
---|
| 88 | [AC_HELP_STRING([--enable-ada],[enable ada support])], |
---|
| 89 | [case "${enable_ada}" in |
---|
| 90 | yes) ;; |
---|
| 91 | no) ;; |
---|
| 92 | *) AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;; |
---|
| 93 | esac],[enable_ada=no]) |
---|
| 94 | |
---|
[b8a30d07] | 95 | RTEMS_DEFINE_POSIX_API |
---|
| 96 | RTEMS_DEFINE_ITRON_API |
---|
| 97 | RTEMS_DEFINE_MULTIPROCESSING |
---|
| 98 | |
---|
[c0394d4b] | 99 | # HACK: We should use a feature-based configuration. |
---|
[8217c40] | 100 | AS_IF([test x"${RTEMS_CPU}" = x"unix"],[ |
---|
[64b1f81] | 101 | AC_DEFINE_UNQUOTED([RTEMS_UNIX],[1],[to indicate RTEMS unix]) |
---|
[8217c40] | 102 | # HACK: silently accept --enable-unixlib |
---|
[64b1f81] | 103 | test -n "${enable_unixlib}" || enable_unixlib="yes" |
---|
[8217c40] | 104 | ]) |
---|
| 105 | |
---|
[35cd6ae] | 106 | AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"]) |
---|
| 107 | |
---|
[8217c40] | 108 | AS_IF([test x"${enable_unixlib}" = x"yes"], |
---|
[64b1f81] | 109 | [AC_DEFINE_UNQUOTED([RTEMS_UNIXLIB],[1], |
---|
[8217c40] | 110 | [to indicate RTEMS using RTEMS's unixlib])] |
---|
| 111 | ) |
---|
[c0394d4b] | 112 | |
---|
[f31a078] | 113 | |
---|
| 114 | AM_CONFIG_HEADER([score/include/rtems/score/cpuopts-tmp.h],[ |
---|
| 115 | echo "/* target cpu dependent options file */" >$tmp/config.h |
---|
| 116 | echo "/* automatically generated -- DO NOT EDIT!! */" >>$tmp/config.h |
---|
| 117 | echo >>$tmp/config.h |
---|
| 118 | echo "#ifndef __CPU_OPTIONS_h" >>$tmp/config.h |
---|
| 119 | echo "#define __CPU_OPTIONS_h" >>$tmp/config.h |
---|
| 120 | echo >>$tmp/config.h |
---|
| 121 | sed -e '/.*PACKAGE.*/d' score/include/rtems/score/cpuopts-tmp.h >> $tmp/config.h |
---|
| 122 | echo >>$tmp/config.h |
---|
| 123 | echo "#endif" >>$tmp/config.h |
---|
| 124 | AS_IF([cmp -s score/include/rtems/score/cpuopts.h $tmp/config.h 2>/dev/null], |
---|
| 125 | [AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged]) |
---|
| 126 | rm -f $tmp/config.h], |
---|
| 127 | [AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) |
---|
| 128 | rm -f score/include/rtems/score/cpuopts.h |
---|
| 129 | mv $tmp/config.h score/include/rtems/score/cpuopts.h]) |
---|
| 130 | ]) |
---|
[e0ba3e8] | 131 | |
---|
[8217c40] | 132 | AC_ENABLE_MULTILIB([Makefile],[..]) |
---|
| 133 | |
---|
[64b1f81] | 134 | ## HACK: Add a define to cpuopts.h to indicate using multilibs |
---|
| 135 | ## Can be applied to produce compiler errors if using |
---|
| 136 | ## multilib-incompatible settings somewhere else (eg. bspopts.h). |
---|
| 137 | AS_IF([test x"${enable_multilib}" = x"yes"],[ |
---|
| 138 | AC_DEFINE_UNQUOTED([RTEMS_MULTILIBS],[1],[using multilib'ed RTEMS]) |
---|
| 139 | ]) |
---|
| 140 | |
---|
[f7952533] | 141 | AC_CONFIG_SUBDIRS([libmisc]) |
---|
| 142 | |
---|
[92ed8c2] | 143 | AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \ |
---|
| 144 | && test x"$HAS_POSIX_API" = x"yes"]) |
---|
| 145 | |
---|
[70810dc] | 146 | # Explicitly list all Makefiles here |
---|
[66387986] | 147 | AC_CONFIG_FILES([Makefile |
---|
[8217c40] | 148 | include/Makefile |
---|
[1896a650] | 149 | rtems/Makefile |
---|
| 150 | sapi/Makefile |
---|
[eb299afc] | 151 | score/Makefile |
---|
| 152 | score/cpu/Makefile |
---|
[66387986] | 153 | ]) |
---|
[92ed8c2] | 154 | |
---|
[9483fbf] | 155 | AC_CONFIG_FILES([libblock/Makefile]) |
---|
[92ed8c2] | 156 | AC_CONFIG_FILES([ada/Makefile]) |
---|
[9483fbf] | 157 | AC_CONFIG_FILES([wrapup/Makefile]) |
---|
[92ed8c2] | 158 | |
---|
[66387986] | 159 | AC_OUTPUT |
---|