diff options
author | Chris Johns <chrisj@rtems.org> | 2017-12-23 18:18:56 +1100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-01-25 08:45:26 +0100 |
commit | 2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch) | |
tree | 44759efe9374f13200a97e96d91bd9a2b7e5ce2a /cpukit/aclocal | |
parent | 9704efb4ec088a472842cbc9bc46392685ebc806 (diff) |
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.
Diffstat (limited to 'cpukit/aclocal')
-rw-r--r-- | cpukit/aclocal/check-networking.m4 | 4 | ||||
-rw-r--r-- | cpukit/aclocal/prog-cc.m4 | 5 | ||||
-rw-r--r-- | cpukit/aclocal/rtems-bsp-includes.m4 | 13 | ||||
-rw-r--r-- | cpukit/aclocal/rtems-build-top.m4 | 12 | ||||
-rw-r--r-- | cpukit/aclocal/rtems-includes.m4 | 23 | ||||
-rw-r--r-- | cpukit/aclocal/rtems-source-top.m4 | 8 |
6 files changed, 61 insertions, 4 deletions
diff --git a/cpukit/aclocal/check-networking.m4 b/cpukit/aclocal/check-networking.m4 index e15cf05aca..72730d2084 100644 --- a/cpukit/aclocal/check-networking.m4 +++ b/cpukit/aclocal/check-networking.m4 @@ -3,6 +3,7 @@ AC_DEFUN([RTEMS_CHECK_NETWORKING], [dnl AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl AC_REQUIRE([RTEMS_ENABLE_NETWORKING])dnl +AC_REQUIRE([RTEMS_INCLUDES])dnl AC_CACHE_CHECK([whether CPU supports networking], rtems_cv_HAS_NETWORKING, @@ -23,7 +24,8 @@ AC_CACHE_CHECK([whether CPU supports networking], && test x"$ac_cv_type_uint32_t" = xyes \ && test x"$ac_cv_type_int64_t" = xyes \ && test x"$ac_cv_type_uint64_t" = xyes], - [rtems_cv_HAS_NETWORKING=yes], + [rtems_cv_HAS_NETWORKING=yes + RTEMS_CPPFLAGS="${RTEMS_CPPFLAGS} -I${RTEMS_SOURCE_ROOT}/cpukit/libnetworking"], [rtems_cv_HAS_NETWORKING=no]) ],[ rtems_cv_HAS_NETWORKING=disabled diff --git a/cpukit/aclocal/prog-cc.m4 b/cpukit/aclocal/prog-cc.m4 index 659a682558..9006e0e53a 100644 --- a/cpukit/aclocal/prog-cc.m4 +++ b/cpukit/aclocal/prog-cc.m4 @@ -29,11 +29,10 @@ test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe" AS_IF([test "$GCC" = yes && test "$rtems_cv_CFLAGS_set" != set], [CFLAGS="$CFLAGS -Wall -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs"]) -RTEMS_CPPFLAGS="-I\$(top_builddir) -I\$(PROJECT_INCLUDE)" -AC_SUBST(RTEMS_CPPFLAGS) - AS_IF([test "$GCC" = yes],[ RTEMS_RELLDFLAGS="-qnolinkcmds -nostdlib -r" ]) AC_SUBST(RTEMS_RELLDFLAGS) + +RTEMS_INCLUDES ]) diff --git a/cpukit/aclocal/rtems-bsp-includes.m4 b/cpukit/aclocal/rtems-bsp-includes.m4 new file mode 100644 index 0000000000..2248211192 --- /dev/null +++ b/cpukit/aclocal/rtems-bsp-includes.m4 @@ -0,0 +1,13 @@ +dnl +dnl RTEMS Include paths. +dnl +AC_DEFUN([RTEMS_BSP_INCLUDES], +[ +AC_REQUIRE([RTEMS_SOURCE_TOP]) +AC_REQUIRE([RTEMS_BUILD_TOP]) +RTEMS_BSP_CPPFLAGS="-I${RTEMS_BUILD_ROOT}/lib/libbsp/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/include \ +-I${RTEMS_SOURCE_ROOT}/bsps/include \ +-I${RTEMS_SOURCE_ROOT}/bsps/\$(RTEMS_CPU)/include \ +-I${RTEMS_SOURCE_ROOT}/bsps/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/include" +AC_SUBST([RTEMS_BSP_CPPFLAGS]) +]) diff --git a/cpukit/aclocal/rtems-build-top.m4 b/cpukit/aclocal/rtems-build-top.m4 new file mode 100644 index 0000000000..5708119c14 --- /dev/null +++ b/cpukit/aclocal/rtems-build-top.m4 @@ -0,0 +1,12 @@ +dnl +dnl RTEMS_BUILD_TOP($1) +dnl +AC_DEFUN([RTEMS_BUILD_TOP], +[dnl +# +# This is a copy of the horrible hack in rtems-top.m4 and it is simpler to +# copy it that attempt to clean this crap up. +# +RTEMS_BUILD_ROOT="${with_rtems_build_top}" +AC_SUBST([RTEMS_BUILD_ROOT]) +])dnl diff --git a/cpukit/aclocal/rtems-includes.m4 b/cpukit/aclocal/rtems-includes.m4 new file mode 100644 index 0000000000..ca4ebed581 --- /dev/null +++ b/cpukit/aclocal/rtems-includes.m4 @@ -0,0 +1,23 @@ +dnl +dnl RTEMS Include paths. +dnl +AC_DEFUN([RTEMS_INCLUDES], +[ +AC_REQUIRE([RTEMS_SOURCE_TOP]) +AC_REQUIRE([RTEMS_BUILD_TOP]) + +# Was CFLAGS set? +rtems_cv_CFLAGS_set="${CFLAGS+set}" + +RTEMS_INCLUDE_CPUKIT="-I${RTEMS_SOURCE_ROOT}/cpukit/include" +RTEMS_INCLUDE_CPUKIT_ARCH="-I${RTEMS_SOURCE_ROOT}/cpukit/score/cpu/\$(RTEMS_CPU)/include" + +RTEMS_CPUKIT_INCLUDE="${RTEMS_INCLUDE_CPUKIT} ${RTEMS_INCLUDE_CPUKIT_ARCH}" +RTEMS_BUILD_INCLUDE="-I\$(top_builddir) -I${RTEMS_BUILD_ROOT}/include" + +RTEMS_INCLUDE="${RTEMS_BUILD_INCLUDE} ${RTEMS_CPUKIT_INCLUDE}" + +RTEMS_CPPFLAGS="${RTEMS_INCLUDE}" + +AC_SUBST([RTEMS_CPPFLAGS]) +]) diff --git a/cpukit/aclocal/rtems-source-top.m4 b/cpukit/aclocal/rtems-source-top.m4 new file mode 100644 index 0000000000..d1460ae82d --- /dev/null +++ b/cpukit/aclocal/rtems-source-top.m4 @@ -0,0 +1,8 @@ +dnl +dnl RTEMS_SOURCE_TOP +dnl +AC_DEFUN([RTEMS_SOURCE_TOP], +[dnl +RTEMS_SOURCE_ROOT="${with_rtems_source_top}" +AC_SUBST([RTEMS_SOURCE_ROOT]) +])dnl |