Skip to content

Commit

Permalink
bsps: Move make/custom/* files to bsps
Browse files Browse the repository at this point in the history
Adjust various build files.  Remove automatic generation of the
c/src/lib/libbsp/*/acinclude.m4 files from bootstrap script.

This patch is a part of the BSP source reorganization.

Update #3285.
  • Loading branch information
sebhub committed Apr 23, 2018
1 parent 37dc047 commit adb85dd
Show file tree
Hide file tree
Showing 276 changed files with 37 additions and 63 deletions.
12 changes: 7 additions & 5 deletions aclocal/bsp-alias.m4
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
dnl _RTEMS_BSP_ALIAS(BSP_ALIAS,RTEMS_BSP_FAMILY)
dnl Internal subroutine to RTEMS_BSP_ALIAS
AC_DEFUN([_RTEMS_BSP_ALIAS],
[# account for "aliased" bsps which share source code
for bsp_cfgs in `ls "$srcdir"/"$RTEMS_TOPdir"/c/src/lib/libbsp/"$RTEMS_CPU"/*/"make/custom/$1.cfg" 2>/dev/null`; do
AC_DEFUN([_RTEMS_BSP_ALIAS],[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
AC_REQUIRE([RTEMS_SOURCE_TOP])
# account for "aliased" bsps which share source code
for bsp_cfgs in `ls "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}"/*/"config/$1.cfg" 2>/dev/null`; do
$2=`echo "$bsp_cfgs" | sed \
-e "s,^$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/,," \
-e "s,/make/custom/.*\.cfg$,,"`
-e "s,^${RTEMS_SOURCE_ROOT}/bsps/$RTEMS_CPU/,," \
-e "s,/config/.*\.cfg$,,"`
break
done
])
Expand Down
12 changes: 6 additions & 6 deletions aclocal/check-bsps.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ dnl RTEMS_CHECK_BSPS(bsp_list)
AC_DEFUN([RTEMS_CHECK_BSPS],
[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl sets RTEMS_CPU, target
AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
AC_REQUIRE([RTEMS_SOURCE_TOP])dnl sets RTEMS_SOURCE_ROOT
AC_MSG_CHECKING([for available BSPs])
$1=
for bsp_make in `echo "$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU"/*/make 2>/dev/null`; do
for bsp_make in `echo "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}"/*/config 2>/dev/null`; do
bsp_family=`echo "$bsp_make" | sed \
-e "s,^$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/,," \
-e "s,/make$,,"`
for bsp_cfgs in `ls "$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/$bsp_family/make/custom/"*.cfg 2>/dev/null`; do
-e "s,^${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/,," \
-e "s,/config$,,"`
for bsp_cfgs in `ls "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/$bsp_family/config/"*.cfg 2>/dev/null`; do
bsp_cfg=`echo "$bsp_cfgs" | sed \
-e "s,^$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/$bsp_family/make/custom/,," \
-e "s,^${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/$bsp_family/config/,," \
-e "s,\.cfg$,,"`
$1="[$]$1 $bsp_cfg"
done
Expand Down
9 changes: 6 additions & 3 deletions aclocal/check-custom-bsp.m4
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
AC_DEFUN([_RTEMS_CHECK_CUSTOM_BSP],[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl sets RTEMS_CPU, target
AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
AC_REQUIRE([RTEMS_SOURCE_TOP])dnl sets RTEMS_SOURCE_ROOT
$2=
for i in \
`ls "${srcdir}/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}"/*/make/custom/$1 2>/dev/null`;
`ls "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}"/*/config/$1 2>/dev/null`;
do
AS_IF([test -r $i],[
$2="$i"
Expand All @@ -13,5 +13,8 @@ AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
])

AC_DEFUN([RTEMS_CHECK_CUSTOM_BSP],[
_RTEMS_CHECK_CUSTOM_BSP([[$]$1],[BSP_FOUND])
_RTEMS_CHECK_CUSTOM_BSP([[$]$1.cfg],[BSP_FOUND])
AS_IF([test -z "$BSP_FOUND"],[
AC_MSG_ERROR([missing [$]$1.cfg])
])
])
4 changes: 2 additions & 2 deletions aclocal/enable-rtemsbsp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ AC_ARG_ENABLE(rtemsbsp,
AC_MSG_ERROR([Cannot find the top of source tree, please report to [email protected]])
fi
target_arch=$(echo ${target_alias} | sed -e "s/\-.*//g")
libbsp=${srctop}/c/src/lib/libbsp
libbsp=${srctop}/bsps
libbsp_e=$(echo ${libbsp} | sed -e 's/\//\\\//g')
cfg_list=$(LANG=C LC_COLLATE=C find ${libbsp} -mindepth 5 -name \*.cfg)
cfg_list=$(LANG=C LC_COLLATE=C find ${libbsp} -mindepth 1 -name \*.cfg)
for bsp in ${enable_rtemsbsp};
do
found=no
Expand Down
34 changes: 0 additions & 34 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,6 @@ usage()
exit 1
}

generate_bspdir_acinclude()
{
cat << EOF > acinclude.m4~
# RTEMS_CHECK_BSPDIR(RTEMS_BSP_FAMILY)
AC_DEFUN([RTEMS_CHECK_BSPDIR],
[
case "\$1" in
EOF

for i in `echo */make | tr " " "\n" | LANG=C LC_COLLATE=C sort`; do
d=`dirname $i`
cat << EOF >> acinclude.m4~
$d )
AC_CONFIG_SUBDIRS([$d]);;
EOF
done
cat << EOF >> acinclude.m4~
*)
AC_MSG_ERROR([Invalid BSP]);;
esac
])
EOF
if cmp -s acinclude.m4 acinclude.m4~ 2>/dev/null; then
echo "acinclude.m4 is unchanged"
else
cp acinclude.m4~ acinclude.m4
fi
rm -f acinclude.m4~
}

if test ! -f $top_srcdir/aclocal/version.m4; then
echo "${progname}:"
echo " Installation problem: Can't find file aclocal/version.m4"
Expand Down Expand Up @@ -209,8 +179,6 @@ generate)
configure=`basename $i`
( test "$quiet" = "true" || echo "$dir"
cd $dir
test -n "`grep RTEMS_CHECK_BSPDIR ${configure}`" && \
generate_bspdir_acinclude
pat="s,\$(RTEMS_TOPdir),${aclocal_dir},g"
aclocal_args=`grep '^[ ]*ACLOCAL_AMFLAGS' Makefile.am | \
sed -e 's%.*ACLOCAL_AMFLAGS.*\=[ ]*%%g' -e $pat `
Expand Down Expand Up @@ -241,8 +209,6 @@ autoreconf)
configure=`basename $i`
( test "$quiet" = "true" || echo "$dir"
cd $dir
test -n "`grep RTEMS_CHECK_BSPDIR ${configure}`" && \
generate_bspdir_acinclude
${AUTORECONF} -i --no-recursive $verbose
test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
&& echo timestamp > stamp-h.in
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion c/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AC_PREREQ([2.69])
AC_INIT([rtems-c],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
AC_CONFIG_SRCDIR([src])
RTEMS_TOP(..)
with_rtems_source_top=$(cd ${srcdir}/.. && pwd)
RTEMS_SOURCE_TOP
RTEMS_BUILD_TOP

Expand All @@ -30,7 +31,7 @@ AS_IF([test x"$enable_rtemsbsp" = x"no"],[

# Check sanity of BSPs in $rtems_bsp
for _rtems_bsp in : $rtems_bsp; do test "x$_rtems_bsp" = x: && continue
# make sure there is a make/custom file for the bsp
# make sure there is a config/*.cfg file for the bsp
_RTEMS_CHECK_CUSTOM_BSP([$_rtems_bsp.cfg],[bsp_cfg])

AS_IF([test -n "$bsp_cfg"],
Expand Down
12 changes: 7 additions & 5 deletions c/src/aclocal/bsp-alias.m4
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
dnl _RTEMS_BSP_ALIAS(BSP_ALIAS,RTEMS_BSP_FAMILY)
dnl Internal subroutine to RTEMS_BSP_ALIAS
AC_DEFUN([_RTEMS_BSP_ALIAS],
[# account for "aliased" bsps which share source code
for bsp_cfgs in `ls "$srcdir"/"$RTEMS_TOPdir"/c/src/lib/libbsp/"$RTEMS_CPU"/*/"make/custom/$1.cfg" 2>/dev/null`; do
AC_DEFUN([_RTEMS_BSP_ALIAS],[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
AC_REQUIRE([RTEMS_SOURCE_TOP])
# account for "aliased" bsps which share source code
for bsp_cfgs in `ls "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}"/*/"config/$1.cfg" 2>/dev/null`; do
$2=`echo "$bsp_cfgs" | sed \
-e "s,^$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/,," \
-e "s,/make/custom/.*\.cfg$,,"`
-e "s,^${RTEMS_SOURCE_ROOT}/bsps/$RTEMS_CPU/,," \
-e "s,/config/.*\.cfg$,,"`
break
done
])
Expand Down
6 changes: 3 additions & 3 deletions c/src/aclocal/check-custom-bsp.m4
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
AC_DEFUN([_RTEMS_CHECK_CUSTOM_BSP],[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl sets RTEMS_CPU, target
AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
AC_REQUIRE([RTEMS_SOURCE_TOP])dnl sets RTEMS_SOURCE_ROOT
$2=
for i in \
`ls "${srcdir}/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}"/*/make/custom/$1 2>/dev/null`;
`ls "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}"/*/config/$1 2>/dev/null`;
do
AS_IF([test -r $i],[
$2="$i"
break
break;
])
done
])
Expand Down
6 changes: 3 additions & 3 deletions rtems-bsps
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#! /bin/sh

top=$(dirname $0)
base="${top}/c/src/lib/libbsp"
base="${top}/bsps"
base_e=$(echo ${base} | sed -e 's/\//\\\//g')

last_arch=""

cfg_list=$(LANG=C LC_COLLATE=C find ${base} -mindepth 5 -name \*.cfg | sort)
cfg_list=$(LANG=C LC_COLLATE=C find ${base} -mindepth 3 -name \*.cfg | sort)

max_bsp_len=0
arch_count=0
Expand Down Expand Up @@ -37,7 +37,7 @@ for bsp_path in ${cfg_list};
do
arch=$(echo ${bsp_path} | sed -e "s/${base_e}*\///" -e 's/\/.*//')
bsp=$(echo ${bsp_path} | sed -e "s/.*\///" -e 's/\.cfg//')
path=$(echo ${bsp_path} | sed -e "s/\/make.*//")
path=$(echo ${bsp_path} | sed -e "s/\/config.*//")
if test "${last_arch}" != "${arch}"; then
echo "${arch}:"
last_arch=${arch}
Expand Down
2 changes: 1 addition & 1 deletion testsuites/aclocal/rtems-test-check.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AC_DEFUN([RTEMS_TEST_CHECK],
AC_MSG_CHECKING([${RTEMS_CPU}/${RTEMS_BSP} $1 test])
tcheck="${RTEMS_SOURCE_ROOT}/tools/build/rtems-test-check-py"
tdata="${RTEMS_BSP}-testsuite.tcfg"
tincludes="${RTEMS_SOURCE_ROOT}/c/src/lib/libbsp/${RTEMS_CPU}/${RTEMS_BSP_FAMILY}/make/custom:${RTEMS_SOURCE_ROOT}/testsuites"
tincludes="${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/${RTEMS_BSP_FAMILY}/config:${RTEMS_SOURCE_ROOT}/testsuites"
if test -f $tcheck; then
check_result=`$tcheck exclude ${RTEMS_BSP} $tdata $tincludes $1`
else
Expand Down

0 comments on commit adb85dd

Please sign in to comment.