public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Add --enable-newlib-global-stdio-streams
Date: Fri, 30 Jun 2017 05:47:00 -0000	[thread overview]
Message-ID: <20170630054752.89133.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a254c82486fd405623f1655383ee67e96216a883

commit a254c82486fd405623f1655383ee67e96216a883
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Thu Jun 29 07:28:08 2017 +0200

    Add --enable-newlib-global-stdio-streams
    
    Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>

Diff:
---
 newlib/README                    |  6 ++++++
 newlib/configure                 | 24 ++++++++++++++++++++++--
 newlib/configure.in              | 13 +++++++++++++
 newlib/libc/include/sys/config.h |  6 ++++++
 newlib/newlib.hin                |  5 +++++
 5 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/newlib/README b/newlib/README
index ed8fb35..78f4de8 100644
--- a/newlib/README
+++ b/newlib/README
@@ -297,6 +297,12 @@ One feature can be enabled by specifying `--enable-FEATURE=yes' or
      is not referenced.
      Disabled by default.
 
+`--enable-newlib-global-stdio-streams'
+     Enable to move the stdio stream FILE objects out of struct _reent and make
+     them global.  The stdio stream pointers of struct _reent are initialized
+     to point to the global stdio FILE stream objects.
+     Disabled by default.
+
 `--enable-newlib-reent-small'
      Enable small reentrant struct support.
      Disabled by default.
diff --git a/newlib/configure b/newlib/configure
index de28c25..b2f0b33 100755
--- a/newlib/configure
+++ b/newlib/configure
@@ -795,6 +795,7 @@ enable_newlib_iconv_external_ccs
 enable_newlib_atexit_dynamic_alloc
 enable_newlib_global_atexit
 enable_newlib_reent_small
+enable_newlib_global_stdio_streams
 enable_newlib_fvwrite_in_streamio
 enable_newlib_fseek_optimization
 enable_newlib_wide_orient
@@ -1467,6 +1468,7 @@ Optional Features:
   --disable-newlib-atexit-dynamic-alloc    disable dynamic allocation of atexit entries
   --enable-newlib-global-atexit	enable atexit data structure as global
   --enable-newlib-reent-small   enable small reentrant struct support
+  --enable-newlib-global-stdio-streams   enable global stdio streams
   --disable-newlib-fvwrite-in-streamio    disable iov in streamio
   --disable-newlib-fseek-optimization    disable fseek optimization
   --disable-newlib-wide-orient    Turn off wide orientation in streamio
@@ -2387,6 +2389,17 @@ else
   newlib_reent_small=
 fi
 
+# Check whether --enable-newlib-global-stdio-streams was given.
+if test "${enable_newlib_global_stdio_streams+set}" = set; then :
+  enableval=$enable_newlib_global_stdio_streams; case "${enableval}" in
+  yes) newlib_global_stdio_streams=yes;;
+  no)  newlib_global_stdio_streams=no ;;
+  *)   as_fn_error $? "bad value ${enableval} for newlib-global-stdio-streams option" "$LINENO" 5 ;;
+ esac
+else
+  newlib_global_stdio_streams=
+fi
+
 # Check whether --enable-newlib-fvwrite-in-streamio was given.
 if test "${enable_newlib_fvwrite_in_streamio+set}" = set; then :
   enableval=$enable_newlib_fvwrite_in_streamio; if test "${newlib_fvwrite_in_streamio+set}" != set; then
@@ -11794,7 +11807,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11797 "configure"
+#line 11810 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11900,7 +11913,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11903 "configure"
+#line 11916 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12347,6 +12360,13 @@ _ACEOF
 
 fi
 
+if test "${newlib_global_stdio_streams}" = "yes"; then
+cat >>confdefs.h <<_ACEOF
+#define _WANT_REENT_GLOBAL_STDIO_STREAMS 1
+_ACEOF
+
+fi
+
 if test "${newlib_mb}" = "yes"; then
 cat >>confdefs.h <<_ACEOF
 #define _MB_CAPABLE 1
diff --git a/newlib/configure.in b/newlib/configure.in
index 354c07c..5b86ee8 100644
--- a/newlib/configure.in
+++ b/newlib/configure.in
@@ -136,6 +136,15 @@ AC_ARG_ENABLE(newlib-reent-small,
   no)  newlib_reent_small=no ;;
   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-reent-small option) ;;
  esac], [newlib_reent_small=])dnl
+
+dnl Support --enable-newlib-global-stdio-streams
+AC_ARG_ENABLE(newlib-global-stdio-streams,
+[  --enable-newlib-global-stdio-streams   enable global stdio streams],
+[case "${enableval}" in
+  yes) newlib_global_stdio_streams=yes;;
+  no)  newlib_global_stdio_streams=no ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for newlib-global-stdio-streams option) ;;
+ esac], [newlib_global_stdio_streams=])dnl
  
 dnl Support --disable-newlib-fvwrite-in-streamio
 AC_ARG_ENABLE(newlib-fvwrite-in-streamio,
@@ -400,6 +409,10 @@ if test "${newlib_reent_small}" = "yes"; then
 AC_DEFINE_UNQUOTED(_WANT_REENT_SMALL)
 fi
 
+if test "${newlib_global_stdio_streams}" = "yes"; then
+AC_DEFINE_UNQUOTED(_WANT_REENT_GLOBAL_STDIO_STREAMS)
+fi
+
 if test "${newlib_mb}" = "yes"; then
 AC_DEFINE_UNQUOTED(_MB_CAPABLE)
 AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8)
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index ae8caff..e45aa54 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -276,6 +276,12 @@
 #endif
 #endif
 
+#ifdef _WANT_REENT_GLOBAL_STDIO_STREAMS
+#ifndef _REENT_GLOBAL_STDIO_STREAMS
+#define _REENT_GLOBAL_STDIO_STREAMS
+#endif
+#endif
+
 /* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended
    charsets.  The extended charsets add a few functions and a couple
    of tables of a few K each. */
diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index 397bc9b..45c6831 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -79,6 +79,11 @@
 /* Define if declare atexit data as global.  */
 #undef _REENT_GLOBAL_ATEXIT
 
+/* Define to move the stdio stream FILE objects out of struct _reent and make
+   them global.  The stdio stream pointers of struct _reent are initialized to
+   point to the global stdio FILE stream objects. */
+#undef _WANT_REENT_GLOBAL_STDIO_STREAMS
+
 /* Define if small footprint nano-formatted-IO implementation used.  */
 #undef _NANO_FORMATTED_IO


                 reply	other threads:[~2017-06-30  5:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170630054752.89133.qmail@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).