summaryrefslogtreecommitdiffstats
path: root/c/src/aclocal
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /c/src/aclocal
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
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 'c/src/aclocal')
-rw-r--r--c/src/aclocal/bsp-configure.m42
-rw-r--r--c/src/aclocal/bsp-linkcmds.m42
-rw-r--r--c/src/aclocal/check-networking.m42
-rw-r--r--c/src/aclocal/prog-cc.m411
-rw-r--r--c/src/aclocal/rtems-bsp-includes.m413
-rw-r--r--c/src/aclocal/rtems-build-top.m412
-rw-r--r--c/src/aclocal/rtems-includes.m423
-rw-r--r--c/src/aclocal/rtems-source-top.m48
8 files changed, 64 insertions, 9 deletions
diff --git a/c/src/aclocal/bsp-configure.m4 b/c/src/aclocal/bsp-configure.m4
index c6ff76319a..6f560fd3f5 100644
--- a/c/src/aclocal/bsp-configure.m4
+++ b/c/src/aclocal/bsp-configure.m4
@@ -8,7 +8,7 @@ AC_DEFUN([RTEMS_BSP_CONFIGURE],
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
- AC_CONFIG_HEADERS([include/bspopts.tmp:include/bspopts.h.in],[
+ AC_CONFIG_HEADERS([include/bspopts.tmp:bspopts.h.in],[
echo "/* BSP dependent options file */" >$tmp/config.h
echo "/* automatically generated -- DO NOT EDIT!! */" >>$tmp/config.h
echo >>$tmp/config.h
diff --git a/c/src/aclocal/bsp-linkcmds.m4 b/c/src/aclocal/bsp-linkcmds.m4
index 397609f6e0..3e40638f88 100644
--- a/c/src/aclocal/bsp-linkcmds.m4
+++ b/c/src/aclocal/bsp-linkcmds.m4
@@ -13,5 +13,5 @@ done
AS_IF([test -z "${LINKCMDS}"],[
AC_MSG_ERROR([can not determine linkcmds])])
-AC_CONFIG_LINKS([startup/linkcmds:${LINKCMDS}])
+AC_CONFIG_LINKS([linkcmds:${LINKCMDS}])
])
diff --git a/c/src/aclocal/check-networking.m4 b/c/src/aclocal/check-networking.m4
index 250d669705..89e53f638e 100644
--- a/c/src/aclocal/check-networking.m4
+++ b/c/src/aclocal/check-networking.m4
@@ -2,6 +2,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 BSP supports networking],
rtems_cv_HAS_NETWORKING,
@@ -21,6 +22,7 @@ AC_CACHE_CHECK([whether BSP supports networking],
esac])
if test "$rtems_cv_HAS_NETWORKING" = "yes"; then
HAS_NETWORKING="yes";
+ RTEMS_CPPFLAGS="${RTEMS_CPPFLAGS} -I${RTEMS_SOURCE_ROOT}/cpukit/libnetworking";
else
HAS_NETWORKING="no";
fi
diff --git a/c/src/aclocal/prog-cc.m4 b/c/src/aclocal/prog-cc.m4
index 44dfd2ddd7..ec33bc9bcf 100644
--- a/c/src/aclocal/prog-cc.m4
+++ b/c/src/aclocal/prog-cc.m4
@@ -29,18 +29,15 @@ dnl check if the compiler supports --specs
RTEMS_GCC_SPECS
AS_IF([test x"$rtems_cv_gcc_specs" = xyes],[
-GCCSPECS="-B\$(PROJECT_ROOT)/lib/ -B\$(PROJECT_ROOT)/$RTEMS_BSP/lib/"
+GCCSPECS="-B\$(RTEMS_SOURCE_ROOT)/c/src/lib/libbsp/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/"
GCCSPECS="${GCCSPECS} -specs bsp_specs -qrtems"])
AC_SUBST(GCCSPECS)
-AS_IF([test x"$rtems_cv_gcc_isystem" = xyes],[
- RTEMS_CPPFLAGS="-isystem \$(PROJECT_INCLUDE)"],[
- RTEMS_CPPFLAGS="-I\$(PROJECT_INCLUDE)"
-])
-AC_SUBST(RTEMS_CPPFLAGS)
-
AS_IF([test "$GCC" = yes],[
RTEMS_RELLDFLAGS="-qnolinkcmds -nostdlib -r"
])
AC_SUBST(RTEMS_RELLDFLAGS)
+
+RTEMS_INCLUDES
+RTEMS_BSP_INCLUDES
])
diff --git a/c/src/aclocal/rtems-bsp-includes.m4 b/c/src/aclocal/rtems-bsp-includes.m4
new file mode 100644
index 0000000000..2248211192
--- /dev/null
+++ b/c/src/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/c/src/aclocal/rtems-build-top.m4 b/c/src/aclocal/rtems-build-top.m4
new file mode 100644
index 0000000000..5708119c14
--- /dev/null
+++ b/c/src/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/c/src/aclocal/rtems-includes.m4 b/c/src/aclocal/rtems-includes.m4
new file mode 100644
index 0000000000..ca4ebed581
--- /dev/null
+++ b/c/src/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/c/src/aclocal/rtems-source-top.m4 b/c/src/aclocal/rtems-source-top.m4
new file mode 100644
index 0000000000..d1460ae82d
--- /dev/null
+++ b/c/src/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