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