source: rtems/cpukit/acinclude.m4 @ bdd4eb8

Last change on this file since bdd4eb8 was 2afb22b, checked in by Chris Johns <chrisj@…>, on Dec 23, 2017 at 7:18:56 AM

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.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1# RTEMS_CPUOPT(NAME,CONDITION,VALUE,EXPLANATION)
2
3AC_DEFUN([_RTEMS_CPUOPT_INIT],[
4AC_BEFORE([_RTEMS_CPUOPT])
5cat >>cpuopts.tmp <<\_ACEOF
6/**
7 * @file rtems/score/cpuopts.h
8 */
9
10/* target cpu dependent options file */
11/* automatically generated -- DO NOT EDIT!! */
12#ifndef _RTEMS_SCORE_CPUOPTS_H
13#define _RTEMS_SCORE_CPUOPTS_H
14_ACEOF
15])
16
17AC_DEFUN([RTEMS_CPUOPT],[
18AC_REQUIRE([_RTEMS_CPUOPT_INIT])
19AC_BEFORE([_RTEMS_CPUOPT_FINI])
20  if $2; then
21cat >>cpuopts.tmp <<_ACEOF
22
23/* $4 */
24#define $1 $3
25_ACEOF
26## FIXME: Duplicate the define to the autoheader
27## Sanity check - Should be removed in future
28    AC_DEFINE_UNQUOTED([$1],[$3],[$4])
29  else
30cat >>cpuopts.tmp <<\_ACEOF
31
32/* $4 */
33/* #undef $1 */
34_ACEOF
35  fi
36])
37
38AC_DEFUN([_RTEMS_CPUOPT_FINI],[
39AC_REQUIRE([RTEMS_BUILD_TOP])
40cat >>cpuopts.tmp <<\_ACEOF
41
42#endif /* _RTEMS_SCORE_CPUOPTS_H */
43_ACEOF
44
45AS_MKDIR_P(${RTEMS_BUILD_ROOT}/include/rtems/score)
46AS_IF([test -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h],
47[
48  AS_IF([cmp -s ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
49  [
50    AC_MSG_NOTICE([${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h is unchanged])
51    rm -f cpuopts.tmp
52  ],[
53    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h])
54    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
55    mv cpuopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
56  ])
57],[
58    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h])
59    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
60    mv cpuopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
61])
62])
Note: See TracBrowser for help on using the repository browser.