summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/global/paths.in8
-rw-r--r--scripts/build/binutils/binutils.sh14
-rw-r--r--scripts/build/cc/gcc.sh19
-rw-r--r--scripts/build/debug/300-gdb.sh6
-rw-r--r--scripts/build/libc/glibc-eglibc.sh-common12
5 files changed, 57 insertions, 2 deletions
diff --git a/config/global/paths.in b/config/global/paths.in
index f7766da..ed26dfc 100644
--- a/config/global/paths.in
+++ b/config/global/paths.in
@@ -90,6 +90,14 @@ config REMOVE_DOCS
Remove the installed documentation (man and info pages).
Gains around 8MiB for a uClibc-based, C and C++ compiler.
+config BUILD_MANUALS
+ bool
+ prompt "Build the manuals"
+ depends on ! REMOVE_DOCS
+ help
+ Build the PDF and HTML manuals for the main components such as
+ binutils, GCC, GDB, and the C library.
+
config INSTALL_DIR_RO
bool
prompt "Render the toolchain read-only"
diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh
index e082590..2861cef 100644
--- a/scripts/build/binutils/binutils.sh
+++ b/scripts/build/binutils/binutils.sh
@@ -20,6 +20,8 @@ do_binutils() {
local -a extra_config
local -a extra_make_flags
local -a binutils_tools
+ local -a manuals_for
+ local -a manuals_install
mkdir -p "${CT_BUILD_DIR}/build-binutils"
cd "${CT_BUILD_DIR}/build-binutils"
@@ -90,6 +92,18 @@ do_binutils() {
CT_DoLog EXTRA "Installing binutils"
CT_DoExecLog ALL make install
+ if [ "${CT_BUILD_MANUALS}" = "y" ]; then
+ CT_DoLog EXTRA "Building and installing the binutils manuals"
+ manuals_for=( gas binutils ld gprof )
+ if [ "${CT_BINUTILS_LINKER_GOLD}" = "y" ]; then
+ manuals_for+=( gold )
+ fi
+ manuals_install=( "${manuals_for[@]/#/install-pdf-}" )
+ manuals_install+=( "${manuals_for[@]/#/install-html-}" )
+ CT_DoExecLog ALL make ${JOBSFLAGS} pdf html
+ CT_DoExecLog ALL make "${manuals_install[@]}"
+ fi
+
# Install the wrapper if needed
if [ "${CT_BINUTILS_LD_WRAPPER}" = "y" ]; then
CT_DoLog EXTRA "Installing ld wrapper"
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index 05df729..aebaa9f 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -79,9 +79,9 @@ do_cc_core_pass_2() {
case "${CT_BARE_METAL},${CT_CANADIAN},${CT_THREADS}" in
y,*,*)
if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
- do_cc_core mode=baremetal build_libgcc=yes build_libstdcxx=yes build_staticlinked=yes
+ do_cc_core mode=baremetal build_libgcc=yes build_libstdcxx=yes build_staticlinked=yes build_manuals=yes
else
- do_cc_core mode=baremetal build_libgcc=yes build_libstdcxx=yes
+ do_cc_core mode=baremetal build_libgcc=yes build_libstdcxx=yes build_manuals=yes
fi
;;
,y,*) ;;
@@ -114,6 +114,7 @@ do_cc_core() {
local build_libgcc=no
local build_libstdcxx=no
local build_staticlinked=no
+ local build_manuals=no
local core_prefix_dir
local lang_opt
local tmp
@@ -381,6 +382,13 @@ do_cc_core() {
CT_DoLog EXTRA "Installing ${mode} core C compiler"
CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/install-}"
+ if [ "${CT_BUILD_MANUALS}" = "y" -a "${build_manuals}" = "yes" ]; then
+ CT_DoLog EXTRA "Building the GCC manuals"
+ CT_DoExecLog ALL make pdf html
+ CT_DoLog EXTRA "Installing the GCC manuals"
+ CT_DoExecLog ALL make install-{pdf,html}-gcc
+ fi
+
# Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
# to call the C compiler with the same, somewhat canonical name.
# check whether compiler has an extension
@@ -625,6 +633,13 @@ do_cc() {
CT_DoLog EXTRA "Installing final compiler"
CT_DoExecLog ALL make ${JOBSFLAGS} install
+ if [ "${CT_BUILD_MANUALS}" = "y" ]; then
+ CT_DoLog EXTRA "Building the GCC manuals"
+ CT_DoExecLog ALL make ${JOBSFLAGS} pdf html
+ CT_DoLog EXTRA "Installing the GCC manuals"
+ CT_DoExecLog ALL make install-{pdf,html}-gcc
+ fi
+
# Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
# to call the C compiler with the same, somewhat canonical name.
# check whether compiler has an extension
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index 7c4731b..b1d2529 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -155,6 +155,12 @@ do_debug_gdb_build() {
CT_DoLog EXTRA "Installing cross-gdb"
CT_DoExecLog ALL make install
+ if [ "${CT_BUILD_MANUALS}" = "y" ]; then
+ CT_DoLog EXTRA "Building and installing the cross-GDB manuals"
+ CT_DoExecLog ALL make ${JOBSFLAGS} pdf html
+ CT_DoExecLog ALL make install-{pdf,html}-gdb
+ fi
+
if [ "${CT_GDB_INSTALL_GDBINIT}" = "y" ]; then
CT_DoLog EXTRA "Install '.gdbinit' template"
# See in scripts/build/internals.sh for why we do this
diff --git a/scripts/build/libc/glibc-eglibc.sh-common b/scripts/build/libc/glibc-eglibc.sh-common
index 8929f5c..b128187 100644
--- a/scripts/build/libc/glibc-eglibc.sh-common
+++ b/scripts/build/libc/glibc-eglibc.sh-common
@@ -303,6 +303,18 @@ do_libc_backend() {
install_root="${CT_SYSROOT_DIR}" \
install
+ if [ "${CT_BUILD_MANUALS}" = "y" ]; then
+ CT_DoLog EXTRA "Building and installing the C library manual"
+ # Omit JOBSFLAGS as GLIBC has problems building the
+ # manuals in parallel
+ CT_DoExecLog ALL make pdf html
+ # EGLIBC doesn't have a install-{pdf.html} and leaves the manuals
+ # in the source directory
+ CT_DoExecLog ALL mkdir -p ${CT_PREFIX_DIR}/share/doc
+ CT_DoExecLog ALL cp -av ${src_dir}/manual/*.pdf ${src_dir}/manual/libc \
+ ${CT_PREFIX_DIR}/share/doc
+ fi
+
if [ "${CT_LIBC_LOCALES}" = "y" ]; then
do_libc_locales
fi