Files
rtems/c/configure.ac
Chris Johns 2afb22b7e1 Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step.  It
copied header files from arbitrary locations into the build tree.  The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

* The make preinstall step itself needs time and disk space.

* Errors in header files show up in the build tree copy.  This makes it
  hard for editors to open the right file to fix the error.

* There is no clear relationship between source and build tree header
  files.  This makes an audit of the build process difficult.

* The visibility of all header files in the build tree makes it
  difficult to enforce API barriers.  For example it is discouraged to
  use BSP-specifics in the cpukit.

* An introduction of a new build system is difficult.

* Include paths specified by the -B option are system headers.  This
  may suppress warnings.

* The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step.   All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc.  Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

* cpukit/include

* cpukit/score/cpu/@RTEMS_CPU@/include

* cpukit/libnetworking

The new BSP include directories are:

* bsps/include

* bsps/@RTEMS_CPU@/include

* bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed.  The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.
2018-01-25 08:45:26 +01:00

93 lines
2.7 KiB
Plaintext

## Process this file with autoconf to produce a configure script.
##
AC_PREREQ([2.69])
AC_INIT([rtems-c],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
AC_CONFIG_SRCDIR([src])
RTEMS_TOP(..)
RTEMS_SOURCE_TOP
RTEMS_BUILD_TOP
RTEMS_CANONICAL_TARGET_CPU
AM_INIT_AUTOMAKE([no-define foreign 1.12.2])
AM_MAINTAINER_MODE
## These options are used within this file.
RTEMS_ENABLE_RTEMSBSP
# Set up rtems_bsp
AS_IF([test x"$enable_rtemsbsp" = x"no"],[
# --disable-rtemsbsp
rtems_bsp=""
],[
AS_IF([test -z "$enable_rtemsbsp"],
[# --enable-rtemsbsp=""
RTEMS_CHECK_BSPS(rtems_bsp)],
[# --enable-rtemsbsp="list"
rtems_bsp="$enable_rtemsbsp"])
])
# 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
_RTEMS_CHECK_CUSTOM_BSP([$_rtems_bsp.cfg],[bsp_cfg])
AS_IF([test -n "$bsp_cfg"],
[
# retrieve bsp_family
RTEMS_BSP_ALIAS([$_rtems_bsp],[rtems_bsp_family])
# Is there a configure script for the BSP?
AS_IF([test -r "$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/$rtems_bsp_family/configure"],
[RTEMS_BSP_LIST="$RTEMS_BSP_LIST $_rtems_bsp"])
])
done
#
# Compose the configuration arguments to be passed to c/src/configure
#
##
## Partially borrowed from autoconf-2.13
##
## Adjust paths
_RTEMS_ADJUST_SRCDIR([rtems_bsp_configure],[src])
rtems_bsp_configure="$rtems_bsp_configure/configure"
RTEMS_CONFIGURE_ARGS_QUOTE([rtems_bsp_configure_args],
[-enable-rtemsbsp=* | --enable-rtemsbsp=* ) ;;])
rtems_bsp_configure="$rtems_bsp_configure $rtems_bsp_configure_args"
rtems_bsp_configure="$rtems_bsp_configure '--with-project-root=../../'"
rtems_bsp_configure="$rtems_bsp_configure '--with-project-top=../../'"
AC_SUBST(rtems_bsp_configure)
AC_SUBST(RTEMS_BSP_LIST)
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile],[
for bsp in : $RTEMS_BSP_LIST; do test "x$bsp" = x: && continue
rtems_source_top=$(cd ${srcdir}/.. && pwd)
cat >> Makefile << BSPEOF
$bsp: src/configure
@set fnord \$(MAKEFLAGS); amf=\[$]\[$]2; \\
echo "Configuring RTEMS_BSP=$bsp"; \\
\$(MKDIR_P) $bsp; \\
( cd $bsp && \\
CONFIG_SHELL=\$(SHELL) RTEMS_BSP=$bsp \$(rtems_bsp_configure) \\
--with-rtems-build-top=\$\${PWD} --with-rtems-source-top=${rtems_source_top} ) \\
|| case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac;
BSPEOF
done
],[RTEMS_BSP_LIST="$RTEMS_BSP_LIST"])
AC_OUTPUT
AS_IF([test -n "$RTEMS_BSP_LIST"],[
echo
echo target architecture: $target_cpu.
echo available BSPs: $RTEMS_BSP_LIST.
echo \'${MAKE} all\' will build the following BSPs: $RTEMS_BSP_LIST.
echo other BSPs can be built with \'${MAKE} RTEMS_BSP=\"bsp1 bsp2 ...\"\'
echo
])