[eb299afc] | 1 | dnl Override the set of BSPs to be built. |
---|
| 2 | dnl used by the toplevel configure script |
---|
| 3 | dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list) |
---|
[3959276e] | 4 | AC_DEFUN([RTEMS_ENABLE_RTEMSBSP], |
---|
[eb299afc] | 5 | [ |
---|
[314a962] | 6 | AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP]) |
---|
[eb299afc] | 7 | AC_ARG_ENABLE(rtemsbsp, |
---|
[72896de] | 8 | [AS_HELP_STRING([--enable-rtemsbsp="bsp1 bsp2 .."], |
---|
[e1664027] | 9 | [BSPs to include in build, required for SMP and MP builds])], |
---|
[9078e097] | 10 | [case "${enable_rtemsbsp}" in |
---|
| 11 | yes ) enable_rtemsbsp="" ;; |
---|
| 12 | no ) enable_rtemsbsp="no" ;; |
---|
[7ff743d] | 13 | *) enable_rtemsbsp="$enable_rtemsbsp" |
---|
| 14 | srctop=${srcdir} |
---|
| 15 | while test x${srctop} != x/ |
---|
| 16 | do |
---|
| 17 | if test -d ${srctop}/cpukit -a -d ${srctop}/c/src/lib/libbsp; then |
---|
| 18 | break |
---|
| 19 | fi |
---|
| 20 | srctop=$(dirname ${srctop}) |
---|
| 21 | done |
---|
| 22 | if test x${srctop} = x/; then |
---|
| 23 | AC_MSG_ERROR([Cannot find the top of source tree, please report to devel@rtems.org]) |
---|
| 24 | fi |
---|
| 25 | target_arch=$(echo ${target_alias} | sed -e "s/\-.*//g") |
---|
[adb85dd] | 26 | libbsp=${srctop}/bsps |
---|
[7ff743d] | 27 | libbsp_e=$(echo ${libbsp} | sed -e 's/\//\\\//g') |
---|
[adb85dd] | 28 | cfg_list=$(LANG=C LC_COLLATE=C find ${libbsp} -mindepth 1 -name \*.cfg) |
---|
[7ff743d] | 29 | for bsp in ${enable_rtemsbsp}; |
---|
| 30 | do |
---|
| 31 | found=no |
---|
| 32 | for bsp_path in ${cfg_list}; |
---|
| 33 | do |
---|
| 34 | cfg_bsp=$(echo ${bsp_path} | sed -e "s/.*\///" -e 's/\.cfg//') |
---|
| 35 | if test x$bsp = x$cfg_bsp; then |
---|
| 36 | cfg_arch=$(echo ${bsp_path} | sed -e "s/${libbsp_e}*\///" -e 's/\/.*//') |
---|
[d542af2e] | 37 | case ${cfg_arch} in |
---|
| 38 | ${target_arch$}* ) |
---|
| 39 | ;; |
---|
| 40 | * ) |
---|
| 41 | AC_MSG_ERROR([BSP '$bsp' architecture does not match the --target architecture, run 'rtems-bsp' (in the top of the source tree) for a valid BSP list]) |
---|
| 42 | ;; |
---|
| 43 | esac |
---|
[7ff743d] | 44 | found=yes |
---|
| 45 | break |
---|
| 46 | fi |
---|
| 47 | done |
---|
| 48 | if test $found = no; then |
---|
| 49 | AC_MSG_ERROR([BSP '$bsp' not found, run 'rtems-bsp' (in the top of the source tree) for a valid BSP list]) |
---|
| 50 | fi |
---|
| 51 | done |
---|
| 52 | ;; |
---|
[9078e097] | 53 | esac],[enable_rtemsbsp=""]) |
---|
[eb299afc] | 54 | ]) |
---|