[d7aecdc] | 1 | ## Process this file with autoconf to produce a configure script. |
---|
| 2 | ## |
---|
| 3 | ## $Id$ |
---|
| 4 | |
---|
[ba2c04f] | 5 | AC_PREREQ(2.60) |
---|
[fcb0cd46] | 6 | AC_INIT([rtems-c-src],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla]) |
---|
[02ccf4a] | 7 | AC_CONFIG_SRCDIR([optman]) |
---|
[d7aecdc] | 8 | RTEMS_TOP(../..) |
---|
| 9 | |
---|
| 10 | RTEMS_ENABLE_CXX |
---|
| 11 | RTEMS_ENABLE_NETWORKING |
---|
| 12 | |
---|
| 13 | RTEMS_CANONICAL_TARGET_CPU |
---|
| 14 | |
---|
[ba2c04f] | 15 | AM_INIT_AUTOMAKE([no-define subdir-objects no-exeext foreign 1.10]) |
---|
[d7aecdc] | 16 | AM_MAINTAINER_MODE |
---|
| 17 | |
---|
| 18 | RTEMS_ENABLE_MULTILIB |
---|
[02ccf4a] | 19 | RTEMS_ENABLE_MULTIPROCESSING |
---|
[d7aecdc] | 20 | RTEMS_ENV_RTEMSBSP |
---|
[51d35b2] | 21 | |
---|
[d7aecdc] | 22 | RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) |
---|
| 23 | |
---|
| 24 | RTEMS_CHECK_NETWORKING(RTEMS_BSP) |
---|
[4108ae8] | 25 | RTEMS_CHECK_POSIX_API(RTEMS_BSP) |
---|
| 26 | |
---|
[f0d7515] | 27 | AC_MSG_NOTICE([setting up make/custom]) |
---|
| 28 | |
---|
| 29 | AS_MKDIR_P([make/custom]) |
---|
[9bb5b9d] | 30 | AM_SET_DEPDIR |
---|
| 31 | test -d ${DEPDIR} || mkdir ${DEPDIR} |
---|
| 32 | |
---|
| 33 | rm -f ${DEPDIR}/cfg.P |
---|
| 34 | echo "# Do not edit - automatically generated by" > ${DEPDIR}/cfg.P |
---|
| 35 | echo "# $0" >> ${DEPDIR}/cfg.P |
---|
[f0d7515] | 36 | |
---|
| 37 | # Collect and copy the BSP's make/custom/*.cfg files from the toplevel make |
---|
| 38 | # directory into the build tree's <bsp>/make/custom subdirectories |
---|
[9bb5b9d] | 39 | CUSTOM_CFG_FILES= |
---|
[f0d7515] | 40 | f="${RTEMS_BSP}.cfg" |
---|
| 41 | while test -n "$f"; do |
---|
[9bb5b9d] | 42 | cfg_file= |
---|
| 43 | _RTEMS_CHECK_CUSTOM_BSP([$f],cfg_file) |
---|
| 44 | if test -n "${cfg_file}"; then |
---|
| 45 | cp ${cfg_file} make/custom/$f |
---|
| 46 | echo "make/custom/$f: ${cfg_file}" >> ${DEPDIR}/cfg.P |
---|
| 47 | echo " cp ${cfg_file} make/custom/$f" >> ${DEPDIR}/cfg.P |
---|
[f0d7515] | 48 | CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f" |
---|
[9bb5b9d] | 49 | f=`grep "^include.*make/custom" ${cfg_file} \ |
---|
[f0d7515] | 50 | | sed \ |
---|
| 51 | -e 's%^.*custom\/%%' \ |
---|
| 52 | -e s%\$\(RTEMS_HOST\)%${RTEMS_HOST}% \ |
---|
| 53 | -e 's%default\.cfg%%'`; |
---|
| 54 | else break; fi; |
---|
| 55 | done |
---|
| 56 | cp ${srcdir}/make/custom/default.cfg.in make/custom/default.cfg |
---|
| 57 | |
---|
| 58 | AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache]) |
---|
[f21ccd2] | 59 | ${MAKE-make} -f ${srcdir}/make/bsp.mak \ |
---|
| 60 | RTEMS_BSP=${RTEMS_BSP} \ |
---|
[67bfd9a6] | 61 | RTEMS_HOST=${RTEMS_HOST} \ |
---|
[f0d7515] | 62 | RTEMS_ROOT=. make/${RTEMS_BSP}.cache |
---|
| 63 | |
---|
| 64 | # Read back the cache |
---|
[9346df0] | 65 | AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL], |
---|
[da499ad] | 66 | [. ./make/${RTEMS_BSP}.cache]) |
---|
[9346df0] | 67 | RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL |
---|
[028792e8] | 68 | AC_SUBST(RTEMS_CPU_MODEL) |
---|
[d4181d5] | 69 | test -n "${RTEMS_CPU_MODEL}" && \ |
---|
| 70 | ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'" |
---|
[028792e8] | 71 | |
---|
[9346df0] | 72 | AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY], |
---|
[da499ad] | 73 | [. ./make/${RTEMS_BSP}.cache]) |
---|
[9346df0] | 74 | RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY |
---|
[028792e8] | 75 | AC_SUBST(RTEMS_BSP_FAMILY) |
---|
[d4181d5] | 76 | test -n "${RTEMS_BSP_FAMILY}" && \ |
---|
| 77 | ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'" |
---|
[028792e8] | 78 | |
---|
[9346df0] | 79 | AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS], |
---|
[da499ad] | 80 | [. ./make/${RTEMS_BSP}.cache]) |
---|
[9346df0] | 81 | CPU_CFLAGS=$ac_cv_env_CPU_CFLAGS |
---|
[028792e8] | 82 | |
---|
[9346df0] | 83 | AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V], |
---|
[da499ad] | 84 | [. ./make/${RTEMS_BSP}.cache]) |
---|
[9346df0] | 85 | CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V |
---|
[f8235c07] | 86 | |
---|
| 87 | CFLAGS="${CFLAGS-${CPU_CFLAGS} ${CFLAGS_OPTIMIZE_V}}" |
---|
| 88 | AS_IF([test x"${CFLAGS}" != x" "],[ |
---|
| 89 | ac_configure_args="$ac_configure_args 'CFLAGS=${CFLAGS}'"]) |
---|
[028792e8] | 90 | |
---|
[9346df0] | 91 | RTEMS_PROG_CC_FOR_TARGET |
---|
[d844a182] | 92 | AM_PROG_CC_C_O |
---|
[033f0686] | 93 | RTEMS_PROG_CCAS |
---|
[9346df0] | 94 | RTEMS_CANONICALIZE_TOOLS |
---|
[382e1eb3] | 95 | |
---|
[d71ab7fd] | 96 | RTEMS_CHECK_GCC_WEAK |
---|
| 97 | |
---|
[f0d7515] | 98 | AC_SUBST(CUSTOM_CFG_FILES) |
---|
| 99 | AC_SUBST(cfg_dir) |
---|
| 100 | |
---|
[e7495ae] | 101 | RTEMS_CHECK_MULTIPROCESSING |
---|
| 102 | |
---|
[789694a1] | 103 | BSP_SUBDIRS= |
---|
[a03c1ab] | 104 | ## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled |
---|
[789694a1] | 105 | RTEMS_BSP_CONFIG_SUBDIR( |
---|
| 106 | [cpukit],[../../cpukit], |
---|
[850c88d] | 107 | ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \ |
---|
[cdf41b07] | 108 | '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \ |
---|
[ea3f559] | 109 | '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \ |
---|
[6c2b5324] | 110 | ], |
---|
[259c516] | 111 | [test x"$multilib" = xno]) |
---|
[02ccf4a] | 112 | |
---|
[94f4a9ba] | 113 | ## Note: the order of the directories below is essential |
---|
| 114 | AC_CONFIG_SUBDIRS([make]) |
---|
[85a8933] | 115 | BSP_SUBDIRS="$BSP_SUBDIRS make" |
---|
[dd984c0] | 116 | |
---|
| 117 | RTEMS_CPU_SUBDIRS(lib/libcpu) |
---|
[539e266e] | 118 | if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then |
---|
[dd984c0] | 119 | libcpu_cpu_subdir="${RTEMS_CPU}" |
---|
| 120 | else |
---|
| 121 | libcpu_cpu_subdir= |
---|
| 122 | fi |
---|
| 123 | AC_SUBST(libcpu_cpu_subdir) |
---|
| 124 | |
---|
| 125 | # Is there code where there should be for this BSP? |
---|
| 126 | # The bare bsp is a special case as it is not under the RTEMS_CPU path |
---|
[259c516] | 127 | if test "$RTEMS_BSP_FAMILY" = bare ; then |
---|
[dd984c0] | 128 | AC_CONFIG_SUBDIRS([lib/libbsp/bare]) |
---|
| 129 | AC_SUBST(libbsp_cpu_subdir,bare) |
---|
| 130 | else |
---|
| 131 | RTEMS_CPU_SUBDIRS([lib/libbsp]) |
---|
| 132 | AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU) |
---|
| 133 | fi |
---|
| 134 | |
---|
[539e266e] | 135 | BSP_SUBDIRS="$BSP_SUBDIRS lib" |
---|
[4108ae8] | 136 | BSP_SUBDIRS="$BSP_SUBDIRS libchip" |
---|
[832bed1] | 137 | |
---|
[94f4a9ba] | 138 | AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[ |
---|
[4db904ec] | 139 | AC_CONFIG_SUBDIRS([librtems++]) |
---|
[85a8933] | 140 | BSP_SUBDIRS="$BSP_SUBDIRS librtems++" |
---|
[94f4a9ba] | 141 | ]) |
---|
[d7aecdc] | 142 | |
---|
[db3e91f2] | 143 | BSP_SUBDIRS="$BSP_SUBDIRS support" |
---|
[aea8e66] | 144 | BSP_SUBDIRS="$BSP_SUBDIRS ada" |
---|
[85a8933] | 145 | BSP_SUBDIRS="$BSP_SUBDIRS wrapup" |
---|
[a456af96] | 146 | |
---|
[ee950a33] | 147 | BSP_SUBDIRS="$BSP_SUBDIRS optman" |
---|
| 148 | |
---|
[54508fd] | 149 | AC_ARG_ENABLE([ada], |
---|
[a03c1ab] | 150 | [AS_HELP_STRING(--enable-ada,enable ada support)], |
---|
[54508fd] | 151 | [case "${enable_ada}" in |
---|
| 152 | yes) ;; |
---|
| 153 | no) ;; |
---|
| 154 | *) AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;; |
---|
| 155 | esac],[enable_ada=no]) |
---|
| 156 | |
---|
[259c516] | 157 | RTEMS_BSP_CONFIG_SUBDIR( |
---|
| 158 | [ada-tests],[ada-tests], |
---|
| 159 | ['--enable-rtems-root=../' \ |
---|
[a4a40dac] | 160 | '--enable-project-root=${with_project_root}../$RTEMS_BSP' \ |
---|
[259c516] | 161 | '--with-project-top=${with_project_top}../' \ |
---|
| 162 | '--enable-rtemsbsp=$RTEMS_BSP' \ |
---|
| 163 | ], |
---|
| 164 | [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes]) |
---|
[a456af96] | 165 | |
---|
[3f74676] | 166 | # HACK ALERT! |
---|
| 167 | |
---|
| 168 | # FIXME: Assume multilib implies in-source-tree multilibs |
---|
| 169 | # Build testsuites multilibbed |
---|
[789694a1] | 170 | RTEMS_BSP_CONFIG_SUBDIR( |
---|
| 171 | [testsuites],[../../testsuites], |
---|
[850c88d] | 172 | ['--enable-rtems-root=../' \ |
---|
[3f74676] | 173 | '--enable-project-root=${with_project_root}../$RTEMS_BSP' \ |
---|
| 174 | '--with-project-top=${with_project_top}../' \ |
---|
| 175 | '--enable-rtemsbsp=$RTEMS_BSP' \ |
---|
[3136ff03] | 176 | '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \ |
---|
| 177 | '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \ |
---|
[3f74676] | 178 | ], |
---|
| 179 | [test x"$enable_tests" != x"no" && test x"$multilib" = xno]) |
---|
| 180 | |
---|
| 181 | # Build testsuites non-multilibbed |
---|
| 182 | RTEMS_BSP_CONFIG_SUBDIR( |
---|
| 183 | [testsuites],[../../testsuites], |
---|
| 184 | ['--enable-rtems-root=../' \ |
---|
| 185 | '--enable-cpukit-root=${with_project_root}..' \ |
---|
| 186 | '--enable-project-root=${with_project_root}../$RTEMS_BSP' \ |
---|
[850c88d] | 187 | '--with-project-top=${with_project_top}../' \ |
---|
[789694a1] | 188 | '--enable-rtemsbsp=$RTEMS_BSP' \ |
---|
[3136ff03] | 189 | '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \ |
---|
| 190 | '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \ |
---|
[6c2b5324] | 191 | ], |
---|
[3f74676] | 192 | [test x"$enable_tests" != x"no" && test x"$multilib" = xyes]) |
---|
[41fc78d] | 193 | |
---|
[85a8933] | 194 | AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS]) |
---|
[d7aecdc] | 195 | |
---|
[259c516] | 196 | AS_IF([test "$host_cpu" = sparc],[ |
---|
[babba25a] | 197 | AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1], |
---|
| 198 | [whether to enable ipalignment work-around]) |
---|
| 199 | ]) |
---|
| 200 | |
---|
[67bfd9a6] | 201 | AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"]) |
---|
[832bed1] | 202 | |
---|
[4108ae8] | 203 | AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes") |
---|
[67bfd9a6] | 204 | |
---|
| 205 | # The posix bsp doesn't support libchip |
---|
| 206 | # FIXME: We should use a feature based check, here |
---|
| 207 | AM_CONDITIONAL([LIBCHIP],[test "$RTEMS_BSP_FAMILY" != "posix"]) |
---|
[94f4a9ba] | 208 | |
---|
| 209 | # The bare bsp doesn't have libbsp.a |
---|
| 210 | # FIXME: We should use a feature based check, here |
---|
[6184265d] | 211 | AM_CONDITIONAL([HAS_LIBBSP],[test "$RTEMS_BSP_FAMILY" != "bare"]) |
---|
[12b0ada] | 212 | |
---|
[94f4a9ba] | 213 | AM_CONDITIONAL([MULTILIB],[test x"${enable_multilib}" = x"yes"]) |
---|
| 214 | |
---|
[aea8e66] | 215 | AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \ |
---|
| 216 | && test x"$rtems_cv_HAS_POSIX_API" = x"yes"]) |
---|
| 217 | |
---|
[d7aecdc] | 218 | RTEMS_PROJECT_ROOT |
---|
[b826c3a] | 219 | |
---|
[d7aecdc] | 220 | # Explicitly list all Makefiles here |
---|
[f0d7515] | 221 | AC_CONFIG_FILES([Makefile], |
---|
| 222 | [${MAKE} make/${RTEMS_BSP}.cache], |
---|
| 223 | [RTEMS_BSP=${RTEMS_BSP} |
---|
| 224 | MAKE=${MAKE}]) |
---|
| 225 | |
---|
[babba25a] | 226 | AC_CONFIG_FILES([ |
---|
| 227 | support/Makefile |
---|
[4108ae8] | 228 | |
---|
[babba25a] | 229 | libchip/Makefile |
---|
[6fcf4571] | 230 | |
---|
[babba25a] | 231 | optman/Makefile |
---|
[6fcf4571] | 232 | |
---|
[539e266e] | 233 | lib/Makefile |
---|
| 234 | |
---|
[dd984c0] | 235 | lib/libcpu/Makefile |
---|
| 236 | |
---|
| 237 | lib/libbsp/Makefile |
---|
| 238 | |
---|
[aea8e66] | 239 | ada/Makefile |
---|
| 240 | |
---|
[babba25a] | 241 | wrapup/Makefile |
---|
| 242 | ]) |
---|
[94f4a9ba] | 243 | |
---|
[d7aecdc] | 244 | AC_OUTPUT |
---|