cc/gcc: Add Fortran support for Baremetal build
authorZhenqiang Chen <zhenqiang.chen@linaro.org>
Tue Nov 19 14:44:02 2013 +0800 (2013-11-19)
changeset 3254e2e0f34eab6c
parent 3253 15c6976026f3
child 3255 4f3536b12be5
cc/gcc: Add Fortran support for Baremetal build

Signed-off-by: Zhenqiang Chen <zhenqiang.chen@linaro.org>
[yann.morin.1998@free.fr: fix damage due to mailer]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <CACgzC7D5HCVS-qX=ydcQphNFH=VGgJzTdZWQWaLKAv-CdE8crA@mail.gmail.com>
Patchwork-Id: 292703
config/cc.in
scripts/build/cc/gcc.sh
     1.1 --- a/config/cc.in	Sun Dec 08 12:53:14 2013 +0100
     1.2 +++ b/config/cc.in	Tue Nov 19 14:44:02 2013 +0800
     1.3 @@ -46,8 +46,6 @@
     1.4        Only select this if you know that your specific version of the
     1.5        compiler supports this language.
     1.6  
     1.7 -if ! BARE_METAL
     1.8 -
     1.9  config CC_LANG_FORTRAN
    1.10      bool
    1.11      prompt "Fortran"
    1.12 @@ -58,6 +56,8 @@
    1.13        Only select this if you know that your specific version of the
    1.14        compiler supports this language.
    1.15  
    1.16 +if ! BARE_METAL
    1.17 +
    1.18  config CC_LANG_JAVA
    1.19      bool
    1.20      prompt "Java"
     2.1 --- a/scripts/build/cc/gcc.sh	Sun Dec 08 12:53:14 2013 +0100
     2.2 +++ b/scripts/build/cc/gcc.sh	Tue Nov 19 14:44:02 2013 +0800
     2.3 @@ -164,6 +164,7 @@
     2.4  #   lang_list           : the list of languages to build            : string    : (empty)
     2.5  #   build_libgcc        : build libgcc or not                       : bool      : no
     2.6  #   build_libstdcxx     : build libstdc++ or not                    : bool      : no
     2.7 +#   build_libgfortran   : build libgfortran or not                  : bool      : no
     2.8  #   build_staticlinked  : build statically linked or not            : bool      : no
     2.9  #   build_manuals       : whether to build manuals or not           : bool      : no
    2.10  #   cflags              : cflags to use                             : string    : (empty)
    2.11 @@ -173,6 +174,7 @@
    2.12      local mode
    2.13      local build_libgcc=no
    2.14      local build_libstdcxx=no
    2.15 +    local build_libgfortran=no
    2.16      local build_staticlinked=no
    2.17      local build_manuals=no
    2.18      local host
    2.19 @@ -457,6 +459,12 @@
    2.20          core_targets+=( target-libstdc++-v3 )
    2.21      fi
    2.22  
    2.23 +    if [    "${build_libgfortran}" = "yes"    \
    2.24 +         -a "${CT_CC_LANG_FORTRAN}"  = "y"    \
    2.25 +       ]; then
    2.26 +        core_targets+=( target-libgfortran )
    2.27 +    fi
    2.28 +
    2.29      CT_DoLog EXTRA "Building gcc"
    2.30      CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/all-}"
    2.31  
    2.32 @@ -521,6 +529,7 @@
    2.33          build_final_opts+=( "mode=baremetal" )
    2.34          build_final_opts+=( "build_libgcc=yes" )
    2.35          build_final_opts+=( "build_libstdcxx=yes" )
    2.36 +        build_final_opts+=( "build_libgfortran=yes" )
    2.37          if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
    2.38              build_final_opts+=( "build_staticlinked=yes" )
    2.39          fi
    2.40 @@ -557,6 +566,7 @@
    2.41          final_opts+=( "mode=baremetal" )
    2.42          final_opts+=( "build_libgcc=yes" )
    2.43          final_opts+=( "build_libstdcxx=yes" )
    2.44 +        final_opts+=( "build_libgfortran=yes" )
    2.45          if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
    2.46              final_opts+=( "build_staticlinked=yes" )
    2.47          fi