[PATCH 3/8] newlib: clean up autoheader templates

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Sync these back from newlib.hin to configure.ac, and touchup some of
the forms to be consistent (like being full sentences).  Also use the
AC_DEFINE-vs-AC_DEFINE_UNQUOTED macros correctly.  This will make it
easier to re-enable autoheader for managing newlib.hin.
---
 newlib/configure    | 147 +++++++++++++++++---------------------------
 newlib/configure.ac |  76 +++++++++++------------
 newlib/newlib.hin   |  65 ++++++++++----------
 3 files changed, 127 insertions(+), 161 deletions(-)

diff --git a/newlib/configure.ac b/newlib/configure.ac
index 4dbed8e029ac..01fb2caf1eb4 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -435,56 +435,54 @@ fi
 AC_SUBST(EXEEXT_FOR_BUILD)
 
 if test "${newlib_elix_level}" -gt "0"; then
-AC_DEFINE_UNQUOTED(_ELIX_LEVEL,${newlib_elix_level})
+  AC_DEFINE_UNQUOTED(_ELIX_LEVEL, ${newlib_elix_level}, [EL/IX level])
 fi
 
 if test "${newlib_reent_check_verify}" = "yes"; then
-AC_DEFINE_UNQUOTED(_REENT_CHECK_VERIFY)
+  AC_DEFINE(_REENT_CHECK_VERIFY, 1, [Verify _REENT_CHECK macros allocate memory successfully.])
 fi
 
 if test "${newlib_io_c99_formats}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_IO_C99_FORMATS)
+  AC_DEFINE(_WANT_IO_C99_FORMATS, 1, [Enable C99 formats support (e.g. %a, %zu, ...) in IO functions like printf/scanf.])
 fi
 
 if test "${newlib_register_fini}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_REGISTER_FINI)
+  AC_DEFINE(_WANT_REGISTER_FINI, 1, [Register application finalization function using atexit.])
 fi
 
 if test "${newlib_io_long_long}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_IO_LONG_LONG)
+  AC_DEFINE(_WANT_IO_LONG_LONG, 1, [Define to enable long long type support in IO functions like printf/scanf.])
 fi
 
 if test "${newlib_io_long_double}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_IO_LONG_DOUBLE)
+  AC_DEFINE(_WANT_IO_LONG_DOUBLE, 1, [Define to enable long double type support in IO functions like printf/scanf.])
 fi
 
 if test "${newlib_io_pos_args}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_IO_POS_ARGS)
+  AC_DEFINE(_WANT_IO_POS_ARGS, 1, [Positional argument support in printf functions enabled.])
 fi
 
 if test "${newlib_reent_small}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_REENT_SMALL)
+  AC_DEFINE(_WANT_REENT_SMALL, 1, [Optional reentrant struct support.  Used mostly on platforms with very restricted storage.])
 fi
 
 if test "${newlib_global_stdio_streams}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_REENT_GLOBAL_STDIO_STREAMS)
+  AC_DEFINE(_WANT_REENT_GLOBAL_STDIO_STREAMS, 1,
+	    [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.])
 fi
 
+_mb_len_max=1
 if test "${newlib_mb}" = "yes"; then
-AC_DEFINE_UNQUOTED(_MB_CAPABLE)
-AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8)
-else
-AC_DEFINE_UNQUOTED(_MB_LEN_MAX,1)
-fi
-
-if test "${newlib_iconv_external_ccs}" = "yes"; then
-AC_DEFINE_UNQUOTED(_ICONV_ENABLE_EXTERNAL_CCS)
+  AC_DEFINE(_MB_CAPABLE, 1, [Multibyte supported.])
+  _mb_len_max=8
 fi
+AC_DEFINE_UNQUOTED(_MB_LEN_MAX, $_mb_len_max, [Multibyte max length.])
 
-AC_DEFINE(_NEWLIB_VERSION,"NEWLIB_VERSION","The newlib version in string format.")
-AC_DEFINE(__NEWLIB__,NEWLIB_MAJOR_VERSION,"The newlib major version number.")
-AC_DEFINE(__NEWLIB_MINOR__,NEWLIB_MINOR_VERSION,"The newlib minor version number.")
-AC_DEFINE(__NEWLIB_PATCHLEVEL__,NEWLIB_PATCHLEVEL_VERSION,"The newlib patch level.")
+AC_DEFINE(_NEWLIB_VERSION, "NEWLIB_VERSION", [The newlib version in string format.])
+AC_DEFINE(__NEWLIB__, NEWLIB_MAJOR_VERSION, [The newlib major version number.])
+AC_DEFINE(__NEWLIB_MINOR__, NEWLIB_MINOR_VERSION, [The newlib minor version number.])
+AC_DEFINE(__NEWLIB_PATCHLEVEL__, NEWLIB_PATCHLEVEL_VERSION, [The newlib patch level.])
 
 if test "${multilib}" = "yes"; then
   multilib_arg="--enable-multilib"
@@ -493,62 +491,62 @@ else
 fi
 
 if test "${newlib_iconv}" = "yes"; then
-AC_DEFINE_UNQUOTED(_ICONV_ENABLED,1)
+  AC_DEFINE(_ICONV_ENABLED, 1, [ICONV enabled.])
 fi
 
 if test "x${newlib_iconv_external_ccs}" = "xyes"; then
   if test "x${newlib_iconv}" = "x"; then
       AC_MSG_ERROR(--enable-newlib-iconv-external-ccs option can't be used if iconv library is disabled, use --enable-newlib-iconv to enable it.)
   fi
-  AC_DEFINE_UNQUOTED(_ICONV_ENABLE_EXTERNAL_CCS,1)
+  AC_DEFINE(_ICONV_ENABLE_EXTERNAL_CCS, 1, [Enable ICONV external CCS files loading capabilities.])
 fi
 
 if test "${newlib_atexit_dynamic_alloc}" = "yes"; then
-AC_DEFINE_UNQUOTED(_ATEXIT_DYNAMIC_ALLOC)
+  AC_DEFINE(_ATEXIT_DYNAMIC_ALLOC, 1, [If atexit() may dynamically allocate space for cleanup functions.])
 fi
 
 if test "${newlib_global_atexit}" = "yes"; then
-AC_DEFINE_UNQUOTED(_REENT_GLOBAL_ATEXIT)
+  AC_DEFINE(_REENT_GLOBAL_ATEXIT, 1, [Define if declare atexit data as global.])
 fi
 
 if test "${newlib_fvwrite_in_streamio}" = "yes"; then
-AC_DEFINE_UNQUOTED(_FVWRITE_IN_STREAMIO)
+  AC_DEFINE(_FVWRITE_IN_STREAMIO, 1, [Define if ivo supported in streamio.])
 fi
 
 if test "${newlib_fseek_optimization}" = "yes"; then
-AC_DEFINE_UNQUOTED(_FSEEK_OPTIMIZATION)
+  AC_DEFINE(_FSEEK_OPTIMIZATION, 1, [Define if fseek functions support seek optimization.])
 fi
 
 if test "${newlib_wide_orient}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WIDE_ORIENT)
+  AC_DEFINE(_WIDE_ORIENT, 1, [Define if wide char orientation is supported.])
 fi
 
 if test "${newlib_nano_malloc}" = "yes"; then
-AC_DEFINE_UNQUOTED(_NANO_MALLOC)
+  AC_DEFINE(_NANO_MALLOC, 1, [nano version of malloc is used.])
 fi
 
 if test "${newlib_unbuf_stream_opt}" = "yes"; then
-AC_DEFINE_UNQUOTED(_UNBUF_STREAM_OPT)
+  AC_DEFINE(_UNBUF_STREAM_OPT, 1, [Define if unbuffered stream file optimization is supported.])
 fi
 
 if test "${lite_exit}" = "yes"; then
-AC_DEFINE_UNQUOTED(_LITE_EXIT)
+  AC_DEFINE(_LITE_EXIT, 1, [Define if lite version of exit supported.])
 fi
 
 if test "${newlib_nano_formatted_io}" = "yes"; then
-AC_DEFINE_UNQUOTED(_NANO_FORMATTED_IO)
+  AC_DEFINE(_NANO_FORMATTED_IO, 1, [Define if small footprint nano-formatted-IO implementation used.])
 fi
 
 if test "${newlib_retargetable_locking}" = "yes"; then
-AC_DEFINE_UNQUOTED(_RETARGETABLE_LOCKING)
+  AC_DEFINE(_RETARGETABLE_LOCKING, 1, [Define if using retargetable functions for default lock routines.])
 fi
 
 if test "${newlib_long_time_t}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_USE_LONG_TIME_T)
+  AC_DEFINE(_WANT_USE_LONG_TIME_T, 1, [Define to use type long for time_t.])
 fi
 
 if test "${newlib_use_gdtoa}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_USE_GDTOA)
+  AC_DEFINE(_WANT_USE_GDTOA, 1, [Define if using gdtoa rather than legacy ldtoa.])
 fi
 
 dnl
@@ -650,7 +648,7 @@ fi
 rm -f conftest*])
 AC_SUBST(libc_cv_initfinit_array)
 if test $libc_cv_initfinit_array = yes; then
-  AC_DEFINE_UNQUOTED(_HAVE_INITFINI_ARRAY)
+  AC_DEFINE(_HAVE_INITFINI_ARRAY, 1, [Define if the linker supports .preinit_array/.init_array/.fini_array sections.])
 fi
 
 AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \
@@ -668,7 +666,7 @@ then
 fi
 rm -f conftest*])
 if test $libc_cv_cc_loop_to_function = yes; then
-  AC_DEFINE(_HAVE_CC_INHIBIT_LOOP_TO_LIBCALL)
+  AC_DEFINE(_HAVE_CC_INHIBIT_LOOP_TO_LIBCALL, 1, [Define if compiler supports -fno-tree-loop-distribute-patterns.])
 fi
 AC_SUBST(libc_cv_cc_loop_to_function)
 
@@ -702,7 +700,7 @@ else
 fi
 rm -f conftest*])
 if test $acnewlib_cv_type_long_double = yes; then
-  AC_DEFINE_UNQUOTED(_HAVE_LONG_DOUBLE)
+  AC_DEFINE(_HAVE_LONG_DOUBLE, 1, [Define if the platform supports long double type.])
 fi
 AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$acnewlib_cv_type_long_double" = x"yes")
 
@@ -726,7 +724,7 @@ else
 fi
 rm -f conftest*])
 if test $newlib_cv_ldbl_eq_dbl = yes; then
-  AC_DEFINE_UNQUOTED(_LDBL_EQ_DBL)
+  AC_DEFINE(_LDBL_EQ_DBL, 1, [Define if the platform long double type is equal to double.])
 fi
 
 AC_SUBST(CFLAGS)
diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index db344649204f..f1198577c452 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -12,91 +12,92 @@
 /* Newlib version */
 #include <_newlib_version.h>
 
-/* C99 formats support (such as %a, %zu, ...) in IO functions like
- * printf/scanf enabled */
+/* Enable C99 formats support (e.g. %a, %zu, ...) in IO functions like
+   printf/scanf. */
 #undef _WANT_IO_C99_FORMATS
 
-/* long long type support in IO functions like printf/scanf enabled */
+/* Define to enable long long type support in IO functions like printf/scanf.
+   */
 #undef _WANT_IO_LONG_LONG
 
 /* Register application finalization function using atexit. */
 #undef _WANT_REGISTER_FINI
 
-/* long double type support in IO functions like printf/scanf enabled */
+/* Define to enable long double type support in IO functions like
+   printf/scanf. */
 #undef _WANT_IO_LONG_DOUBLE
 
-/* Positional argument support in printf functions enabled.  */
+/* Positional argument support in printf functions enabled. */
 #undef _WANT_IO_POS_ARGS
 
-/* Optional reentrant struct support.  Used mostly on platforms with
-   very restricted storage.  */
+/* Optional reentrant struct support. Used mostly on platforms with very
+   restricted storage. */
 #undef _WANT_REENT_SMALL
 
 /* Verify _REENT_CHECK macros allocate memory successfully. */
 #undef _REENT_CHECK_VERIFY
 
-/* Multibyte supported */
+/* Multibyte supported. */
 #undef _MB_CAPABLE
 
-/* MB_LEN_MAX */
+/* Multibyte max length. */
 #undef _MB_LEN_MAX
 
-/* ICONV enabled */
+/* ICONV enabled. */
 #undef _ICONV_ENABLED
 
-/* Enable ICONV external CCS files loading capabilities */
+/* Enable ICONV external CCS files loading capabilities. */
 #undef _ICONV_ENABLE_EXTERNAL_CCS
 
 /* Define if the linker supports .preinit_array/.init_array/.fini_array
- * sections.  */
+   sections. */
 #undef _HAVE_INITFINI_ARRAY
 
-/* True if atexit() may dynamically allocate space for cleanup
-   functions.  */
-#undef  _ATEXIT_DYNAMIC_ALLOC
+/* If atexit() may dynamically allocate space for cleanup functions. */
+#undef _ATEXIT_DYNAMIC_ALLOC
 
-/* Define if the platform supports long double type.  */
-#undef  _HAVE_LONG_DOUBLE
+/* Define if the platform supports long double type. */
+#undef _HAVE_LONG_DOUBLE
 
 /* Define if compiler supports -fno-tree-loop-distribute-patterns. */
-#undef  _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
+#undef _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
 
-/* Define if the platform long double type is equal to double.  */
-#undef  _LDBL_EQ_DBL
+/* Define if the platform long double type is equal to double. */
+#undef _LDBL_EQ_DBL
  
-/* Define if ivo supported in streamio.  */
+/* Define if ivo supported in streamio. */
 #undef _FVWRITE_IN_STREAMIO
 
-/* Define if fseek functions support seek optimization.  */
+/* Define if fseek functions support seek optimization. */
 #undef _FSEEK_OPTIMIZATION
 
-/* Define if wide char orientation is supported.  */
-#undef  _WIDE_ORIENT
+/* Define if wide char orientation is supported. */
+#undef _WIDE_ORIENT
 
-/* Define if unbuffered stream file optimization is supported.  */
+/* Define if unbuffered stream file optimization is supported. */
 #undef _UNBUF_STREAM_OPT
 
-/* Define if lite version of exit supported.  */
+/* Define if lite version of exit supported. */
 #undef _LITE_EXIT
 
-/* Define if declare atexit data as global.  */
+/* 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
+   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.  */
+/* Define if small footprint nano-formatted-IO implementation used. */
 #undef _NANO_FORMATTED_IO
 
-/* Define if using retargetable functions for default lock routines.  */
+/* Define if using retargetable functions for default lock routines. */
 #undef _RETARGETABLE_LOCKING
 
-/* Define to use type long for time_t.  */
+/* Define to use type long for time_t. */
 #undef _WANT_USE_LONG_TIME_T
 
-/* Define if using gdtoa rather than legacy ldtoa.  */
+/* Define if using gdtoa rather than legacy ldtoa. */
 #undef _WANT_USE_GDTOA
 
 /*
-- 
2.33.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.