[PATCH] scripts: add support for building manuals

Yann E. MORIN yann.morin.1998@anciens.enib.fr
Tue Nov 15 23:52:00 GMT 2011


Michael, All,

On Tuesday 15 November 2011 22:07:39 Michael Hope wrote:
> # HG changeset patch
> # User Michael Hope <michael.hope@linaro.org>
> # Date 1321391181 -46800
> # Branch add-manuals
> # Node ID ae6b7b791db59c66639a4eb0aa6dc172c9d399c6
> # Parent  7f305778ab05e60e58722d21e03e5140588a1438
> scripts: add support for building manuals

Woohoo! :-)

> Build the manuals as part of the last GCC build, namely 'cc' for glibc
> based ones and cc_core_pass_2 for baremetal.

Yes, I never managed to build a bare-metal compiler out of the
final gcc build step, so I use the core gcc for this. Sigh...

> Dodgy: always try install the non-existant GOLD manual.  Should really
> check .config to see if GOLD is enabled.

Easy to fix, see below.

> diff -r 7f305778ab05 -r ae6b7b791db5 .hgignore
> --- a/.hgignore	Mon Nov 14 18:12:55 2011 +0100
> +++ b/.hgignore	Wed Nov 16 10:06:21 2011 +1300
> @@ -27,3 +27,4 @@
>  .build/
>  # .. and the legacy location
>  targets/
> +builds/
> \ No newline at end of file

Unrelated local change. Dropped.

> diff -r 7f305778ab05 -r ae6b7b791db5 config/global/paths.in
> --- a/config/global/paths.in	Mon Nov 14 18:12:55 2011 +0100
> +++ b/config/global/paths.in	Wed Nov 16 10:06:21 2011 +1300
> @@ -90,6 +90,14 @@
>        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

> +    default n

"default n" is not needed. 'n' is the kconfig default anyway.

> +    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 -r 7f305778ab05 -r ae6b7b791db5 scripts/build/binutils/binutils.sh
> --- a/scripts/build/binutils/binutils.sh	Mon Nov 14 18:12:55 2011 +0100
> +++ b/scripts/build/binutils/binutils.sh	Wed Nov 16 10:06:21 2011 +1300
> @@ -90,6 +90,12 @@
>      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"
> +        CT_DoExecLog ALL make ${JOBSFLAGS} pdf html
> +        CT_DoExecLog ALL make install-{pdf,html}-{gas,binutils,ld,gold,gprof}
> +    fi

he gold case is realtively easy to fix:

    local -a manuals
    manuals=( gas binutils ld gprof )
    if [ "${CT_BINUTILS_LINKER_GOLD}" ]; then
        manuals+=( gold )
    fi
    manuals=( "${manuals[@]/#/install-pdf-}" "${manuals[@]/#/install-html-}" )
    make "${manuals[@]"

This is a bash script, so we can use the full power of bash expansions...

Prety good, I will apply with that change (but tomorrow, it's 1am here)

Thank you!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list