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