newlib-cygwin/newlib/libc/machine/msp430/configure.ac

39 lines
1.6 KiB
Plaintext
Raw Normal View History

# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the BSD License. This program is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY expressed or implied,
# including the implied warranties of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. A copy of this license is available at
# http://www.opensource.org/licenses. Any Red Hat trademarks that are
# incorporated in the source code or documentation are not subject to
# the BSD License and may only be used or replicated with the express
# permission of Red Hat, Inc.
dnl This is the newlib/libc/machine/msp430 configure.in file.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([newlib],[NEWLIB_VERSION])
AC_CONFIG_SRCDIR([setjmp.S])
dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
AC_CONFIG_AUX_DIR(../../../..)
Implement reduced code size "tiny" printf and puts "tiny" printf is derived from _vfprintf_r in libc/stdio/nano-vfprintf.c. "tiny" puts has been implemented so that it just calls write, without any other processing. Support for buffering, reentrancy and streams has been removed from these functions to achieve reduced code size. This reduced code size implementation of printf and puts can be enabled in an application by passing "--wrap printf" and "--wrap puts" to the GNU linker. This will replace references to "printf" and "puts" in user code with "__wrap_printf" and "__wrap_puts" respectively. If there is no implementation of these __wrap* functions in user code, these "tiny" printf and puts implementations will be linked into the final executable. The wrapping mechanism is supposed to be invisible to the user: - A GCC wrapper option such as "-mtiny-printf" will be added to alias these wrap commands. - If the user is unaware of the "tiny" implementation, and chooses to implement their own __wrap_printf and __wrap_puts, their own implementation will be automatically chosen over the "tiny" printf and puts from the library. Newlib must be configured with --enable-newlib-nano-formatted-io for the "tiny" printf and puts functions to be built into the library. Code size reduction examples: printf("Hello World\n") baseline - msp430-elf-gcc gcc-8_3_0-release text data bss 5638 214 26 "tiny" puts enabled text data bss 714 90 20 printf("Hello %d\n", a) baseline - msp430-elf-gcc gcc-8_3_0-release text data bss 10916 614 28 "tiny" printf enabled text data bss 4632 280 20
2019-04-12 19:08:22 +08:00
dnl Support --enable-newlib-nano-formatted-io required by tiny-printf.c
dnl and tiny-puts.c
AC_ARG_ENABLE(newlib_nano_formatted_io,
[ --enable-newlib-nano-formatted-io Use small-footprint nano-formatted-IO implementation],
[case "${enableval}" in
yes) newlib_nano_formatted_io=yes ;;
no) newlib_nano_formatted_io=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-nano-formatted-io) ;;
esac],[newlib_nano_formatted_io=no])
AM_CONDITIONAL(NEWLIB_NANO_FORMATTED_IO, test x$newlib_nano_formatted_io = xyes)
NEWLIB_CONFIGURE(../../..)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT