libc/newlib: add a config option allowing to disable builtin syscalls
authorKévin PETIT <kpet@free.fr>
Sun Aug 28 20:12:26 2011 +0200 (2011-08-28)
changeset 2647cb0f31fe2535
parent 2646 e5078db4bd2c
child 2648 6eb0189d7225
libc/newlib: add a config option allowing to disable builtin syscalls

Allows to choose if one wants to keep or not the syscalls that are provided with
newlib. It passes the --disable-newlib-supplied-syscalls or
--enable-newlib-supplied-syscalls to the configure script. If one chooses to
disable the builtin syscalls, he/she will have to write his/her own. This can
be usefull to port newlib to a new platform/board.

Signed-off-by: Kévin PETIT <kpet@free.fr>
config/libc/newlib.in.2
scripts/build/libc/newlib.sh
     1.1 --- a/config/libc/newlib.in.2	Fri Aug 26 00:07:51 2011 +0200
     1.2 +++ b/config/libc/newlib.in.2	Sun Aug 28 20:12:26 2011 +0200
     1.3 @@ -25,3 +25,13 @@
     1.4      depends on LIBC_NEWLIB_IO_FLOAT
     1.5      help
     1.6        Enable support for IOs on long doubles.
     1.7 +
     1.8 +config LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS
     1.9 +    bool
    1.10 +    prompt "Disable the syscalls supplied with newlib"
    1.11 +    help
    1.12 +      Disable the syscalls that come with newlib. You
    1.13 +	  will have to implement your own _sbrk, _read,
    1.14 +	  _write... If you plan to port newlib to a new
    1.15 +	  platform/board, say Yes.
    1.16 +
     2.1 --- a/scripts/build/libc/newlib.sh	Fri Aug 26 00:07:51 2011 +0200
     2.2 +++ b/scripts/build/libc/newlib.sh	Sun Aug 28 20:12:26 2011 +0200
     2.3 @@ -79,6 +79,11 @@
     2.4          newlib_opts+=( "--disable-newlib-io-float" )
     2.5          newlib_opts+=( "--disable-newlib-io-long-double" )
     2.6      fi
     2.7 +    if [ "${CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS}" = "y" ]; then
     2.8 +        newlib_opts+=( "--disable-newlib-supplied-syscalls" )
     2.9 +    else
    2.10 +        newlib_opts+=( "--enable-newlib-supplied-syscalls" )
    2.11 +    fi
    2.12  
    2.13      # Note: newlib handles the build/host/target a little bit differently
    2.14      # than one would expect: