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