[rtems commit] Generate an error if a BSP in the --enable-rtemsbsp list is not valid
Chris Johns
chrisj at rtems.org
Wed Apr 11 01:57:49 UTC 2018
Module: rtems
Branch: master
Commit: 7ff743d54970febeedfb7d3ff1c76675c2f9dc9a
Changeset: http://git.rtems.org/rtems/commit/?id=7ff743d54970febeedfb7d3ff1c76675c2f9dc9a
Author: Chris Johns <chrisj at rtems.org>
Date: Tue Apr 10 10:32:25 2018 +1000
Generate an error if a BSP in the --enable-rtemsbsp list is not valid
Also generate an error if the architecure does not match the --target
architecture given to configure's command line.
Close #2641.
---
aclocal/enable-rtemsbsp.m4 | 37 ++++++++++++++++++++++++++++++++++-
c/src/aclocal/enable-rtemsbsp.m4 | 13 ------------
testsuites/aclocal/enable-rtemsbsp.m4 | 14 -------------
3 files changed, 36 insertions(+), 28 deletions(-)
diff --git a/aclocal/enable-rtemsbsp.m4 b/aclocal/enable-rtemsbsp.m4
index 718275e..a6406c3 100644
--- a/aclocal/enable-rtemsbsp.m4
+++ b/aclocal/enable-rtemsbsp.m4
@@ -10,6 +10,41 @@ AC_ARG_ENABLE(rtemsbsp,
[case "${enable_rtemsbsp}" in
yes ) enable_rtemsbsp="" ;;
no ) enable_rtemsbsp="no" ;;
- *) enable_rtemsbsp="$enable_rtemsbsp" ;;
+ *) enable_rtemsbsp="$enable_rtemsbsp"
+ srctop=${srcdir}
+ while test x${srctop} != x/
+ do
+ if test -d ${srctop}/cpukit -a -d ${srctop}/c/src/lib/libbsp; then
+ break
+ fi
+ srctop=$(dirname ${srctop})
+ done
+ if test x${srctop} = x/; then
+ AC_MSG_ERROR([Cannot find the top of source tree, please report to devel at rtems.org])
+ fi
+ target_arch=$(echo ${target_alias} | sed -e "s/\-.*//g")
+ libbsp=${srctop}/c/src/lib/libbsp
+ libbsp_e=$(echo ${libbsp} | sed -e 's/\//\\\//g')
+ cfg_list=$(LANG=C LC_COLLATE=C find ${libbsp} -mindepth 5 -name \*.cfg)
+ for bsp in ${enable_rtemsbsp};
+ do
+ found=no
+ for bsp_path in ${cfg_list};
+ do
+ cfg_bsp=$(echo ${bsp_path} | sed -e "s/.*\///" -e 's/\.cfg//')
+ if test x$bsp = x$cfg_bsp; then
+ cfg_arch=$(echo ${bsp_path} | sed -e "s/${libbsp_e}*\///" -e 's/\/.*//')
+ if test x${target_arch} != x${cfg_arch}; then
+ 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])
+ fi
+ found=yes
+ break
+ fi
+ done
+ if test $found = no; then
+ AC_MSG_ERROR([BSP '$bsp' not found, run 'rtems-bsp' (in the top of the source tree) for a valid BSP list])
+ fi
+ done
+ ;;
esac],[enable_rtemsbsp=""])
])
diff --git a/c/src/aclocal/enable-rtemsbsp.m4 b/c/src/aclocal/enable-rtemsbsp.m4
deleted file mode 100644
index 91c14a9..0000000
--- a/c/src/aclocal/enable-rtemsbsp.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-dnl Override the set of BSPs to be built.
-dnl used by the toplevel configure script
-dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
-AC_DEFUN([RTEMS_ENABLE_RTEMSBSP],
-[
-AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])
-AC_ARG_ENABLE(rtemsbsp,
-[AS_HELP_STRING(--enable-rtemsbsp="bsp1 bsp2 ..",BSPs to include in build)],
-[case "${enableval}" in
- yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp="bsp1 bsp2"]);;
- *) $1=$enableval;;
-esac],[$1=""])
-])
diff --git a/testsuites/aclocal/enable-rtemsbsp.m4 b/testsuites/aclocal/enable-rtemsbsp.m4
deleted file mode 100644
index 60f37ec..0000000
--- a/testsuites/aclocal/enable-rtemsbsp.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl Override the set of BSPs to be built.
-dnl used by the toplevel configure script
-dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
-AC_DEFUN([RTEMS_ENABLE_RTEMSBSP],
-[
-AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])
-AC_ARG_ENABLE(rtemsbsp,
-[AS_HELP_STRING([--enable-rtemsbsp="bsp1 bsp2 .."],
-[BSPs to include in build])],
-[case "${enableval}" in
- yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp="bsp1 bsp2"]);;
- *) $1=$enableval;;
-esac],[$1=""])
-])
More information about the vc
mailing list