public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: newlib@sourceware.org
Subject: [PATCH 7/8] newlib: iconv: autogenerate iconv define list
Date: Mon, 17 Jan 2022 23:47:40 -0500	[thread overview]
Message-ID: <20220118044741.21027-8-vapier@gentoo.org> (raw)
In-Reply-To: <20220118044741.21027-1-vapier@gentoo.org>

The list of iconv to/from defines is hand maintained in newlib.hin.
Lets leverage mkdeps.pl to generate this list automatically from the
list of known encodings.  The newlib.hin list is up-to-date, so the
list in iconv.m4 matches the list already generated.
---
 newlib/Makefile.in              |   4 +-
 newlib/aclocal.m4               |   1 +
 newlib/configure                | 521 +++++++++++++++++++++++++++++++-
 newlib/configure.ac             |   9 +-
 newlib/iconv.m4                 | 305 +++++++++++++++++++
 newlib/libc/iconv/ces/mkdeps.pl |  39 +++
 newlib/newlib.hin               | 204 ++++++++++++-
 7 files changed, 1055 insertions(+), 28 deletions(-)
 create mode 100644 newlib/iconv.m4

diff --git a/newlib/configure.ac b/newlib/configure.ac
index 4942aceae7b1..cb65cdd78778 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -588,9 +588,9 @@ if test "x${iconv_encodings}" != "x" \
   dnl Enable appropriate option in newlib.h
   for encoding in ${iconv_encodings}; do
       opt=_ICONV_TO_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-      AC_DEFINE_UNQUOTED($opt,1)
+      eval "$opt=1"
       opt=_ICONV_FROM_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-      AC_DEFINE_UNQUOTED($opt,1)
+      eval "$opt=1"
   done
 
   dnl iconv_to_encodings
@@ -607,7 +607,7 @@ if test "x${iconv_encodings}" != "x" \
   dnl Enable appropriate option in newlib.h
   for encoding in ${iconv_to_encodings}; do
       opt=_ICONV_TO_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-      AC_DEFINE_UNQUOTED($opt,1)
+      eval "$opt=1"
   done
 
   dnl iconv_from_encodings
@@ -624,9 +624,10 @@ if test "x${iconv_encodings}" != "x" \
   dnl Enable appropriate option in newlib.h
   for encoding in ${iconv_from_encodings}; do
       opt=_ICONV_FROM_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-      AC_DEFINE_UNQUOTED($opt,1)
+      eval "$opt=1"
   done
 fi;
+NEWLIB_ICONV_DEFINES
 
 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
 	       libc_cv_initfinit_array, [dnl
diff --git a/newlib/iconv.m4 b/newlib/iconv.m4
new file mode 100644
index 000000000000..696b93a45f1e
--- /dev/null
+++ b/newlib/iconv.m4
@@ -0,0 +1,305 @@
+/*
+ * This file was automatically generated mkdeps.pl script. Don't edit.
+ */
+AC_DEFUN([NEWLIB_ICONV_DEFINES],[dnl
+  if test "$_ICONV_TO_ENCODING_BIG5" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_BIG5, 1, [Support big5 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_BIG5" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_BIG5, 1, [Support big5 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP775" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP775, 1, [Support cp775 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP775" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP775, 1, [Support cp775 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP850" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP850, 1, [Support cp850 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP850" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP850, 1, [Support cp850 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP852" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP852, 1, [Support cp852 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP852" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP852, 1, [Support cp852 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP855" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP855, 1, [Support cp855 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP855" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP855, 1, [Support cp855 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP866" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP866, 1, [Support cp866 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP866" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP866, 1, [Support cp866 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_EUC_JP" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_EUC_JP, 1, [Support euc_jp output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_EUC_JP" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_EUC_JP, 1, [Support euc_jp input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_EUC_KR" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_EUC_KR, 1, [Support euc_kr output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_EUC_KR" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_EUC_KR, 1, [Support euc_kr input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_EUC_TW" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_EUC_TW, 1, [Support euc_tw output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_EUC_TW" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_EUC_TW, 1, [Support euc_tw input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_1" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_1, 1, [Support iso_8859_1 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_1" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_1, 1, [Support iso_8859_1 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_10" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_10, 1, [Support iso_8859_10 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_10" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_10, 1, [Support iso_8859_10 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_11" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_11, 1, [Support iso_8859_11 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_11" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_11, 1, [Support iso_8859_11 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_13" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_13, 1, [Support iso_8859_13 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_13" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_13, 1, [Support iso_8859_13 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_14" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_14, 1, [Support iso_8859_14 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_14" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_14, 1, [Support iso_8859_14 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_15" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_15, 1, [Support iso_8859_15 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_15" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_15, 1, [Support iso_8859_15 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_2" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_2, 1, [Support iso_8859_2 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_2" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_2, 1, [Support iso_8859_2 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_3" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_3, 1, [Support iso_8859_3 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_3" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_3, 1, [Support iso_8859_3 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_4" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_4, 1, [Support iso_8859_4 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_4" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_4, 1, [Support iso_8859_4 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_5" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_5, 1, [Support iso_8859_5 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_5" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_5, 1, [Support iso_8859_5 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_6" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_6, 1, [Support iso_8859_6 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_6" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_6, 1, [Support iso_8859_6 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_7" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_7, 1, [Support iso_8859_7 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_7" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_7, 1, [Support iso_8859_7 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_8" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_8, 1, [Support iso_8859_8 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_8" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_8, 1, [Support iso_8859_8 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_9" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_9, 1, [Support iso_8859_9 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_9" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_9, 1, [Support iso_8859_9 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_IR_111" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_IR_111, 1, [Support iso_ir_111 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_IR_111" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_IR_111, 1, [Support iso_ir_111 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_KOI8_R" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_KOI8_R, 1, [Support koi8_r output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_KOI8_R" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_KOI8_R, 1, [Support koi8_r input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_KOI8_RU" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_KOI8_RU, 1, [Support koi8_ru output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_KOI8_RU" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_KOI8_RU, 1, [Support koi8_ru input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_KOI8_U" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_KOI8_U, 1, [Support koi8_u output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_KOI8_U" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_KOI8_U, 1, [Support koi8_u input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_KOI8_UNI" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_KOI8_UNI, 1, [Support koi8_uni output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_KOI8_UNI" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_KOI8_UNI, 1, [Support koi8_uni input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_2" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_2, 1, [Support ucs_2 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_2" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_2, 1, [Support ucs_2 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_2_INTERNAL" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_2_INTERNAL, 1, [Support ucs_2_internal output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_2_INTERNAL" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_2_INTERNAL, 1, [Support ucs_2_internal input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_2BE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_2BE, 1, [Support ucs_2be output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_2BE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_2BE, 1, [Support ucs_2be input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_2LE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_2LE, 1, [Support ucs_2le output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_2LE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_2LE, 1, [Support ucs_2le input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_4" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_4, 1, [Support ucs_4 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_4" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_4, 1, [Support ucs_4 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_4_INTERNAL" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_4_INTERNAL, 1, [Support ucs_4_internal output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_4_INTERNAL" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_4_INTERNAL, 1, [Support ucs_4_internal input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_4BE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_4BE, 1, [Support ucs_4be output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_4BE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_4BE, 1, [Support ucs_4be input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_4LE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_4LE, 1, [Support ucs_4le output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_4LE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_4LE, 1, [Support ucs_4le input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_US_ASCII" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_US_ASCII, 1, [Support us_ascii output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_US_ASCII" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_US_ASCII, 1, [Support us_ascii input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UTF_16" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UTF_16, 1, [Support utf_16 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UTF_16" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UTF_16, 1, [Support utf_16 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UTF_16BE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UTF_16BE, 1, [Support utf_16be output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UTF_16BE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UTF_16BE, 1, [Support utf_16be input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UTF_16LE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UTF_16LE, 1, [Support utf_16le output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UTF_16LE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UTF_16LE, 1, [Support utf_16le input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UTF_8" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UTF_8, 1, [Support utf_8 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UTF_8" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UTF_8, 1, [Support utf_8 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1250" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1250, 1, [Support win_1250 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1250" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1250, 1, [Support win_1250 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1251" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1251, 1, [Support win_1251 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1251" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1251, 1, [Support win_1251 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1252" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1252, 1, [Support win_1252 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1252" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1252, 1, [Support win_1252 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1253" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1253, 1, [Support win_1253 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1253" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1253, 1, [Support win_1253 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1254" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1254, 1, [Support win_1254 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1254" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1254, 1, [Support win_1254 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1255" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1255, 1, [Support win_1255 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1255" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1255, 1, [Support win_1255 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1256" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1256, 1, [Support win_1256 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1256" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1256, 1, [Support win_1256 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1257" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1257, 1, [Support win_1257 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1257" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1257, 1, [Support win_1257 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1258" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1258, 1, [Support win_1258 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1258" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1258, 1, [Support win_1258 input encoding.])
+  fi
+])
diff --git a/newlib/libc/iconv/ces/mkdeps.pl b/newlib/libc/iconv/ces/mkdeps.pl
index 4e648694a72f..b279fd4e8c05 100755
--- a/newlib/libc/iconv/ces/mkdeps.pl
+++ b/newlib/libc/iconv/ces/mkdeps.pl
@@ -334,6 +334,9 @@ sub process_section_encodings($)
   # Generate ccsnames.h header file
   generate_ccsnames_h (\%ccsenc);
 
+  # Generate iconv.m4 file
+  my @encodings = sort keys %encalias;
+  generate_iconv_m4 (\@encodings);
 }
 
 # ==============================================================================
@@ -928,3 +931,39 @@ sub generate_ccsnames_h($)
   print CCSNAMES_H "\n#endif /* !__CCSNAMES_H__ */\n\n";
   close CCSNAMES_H or err "Error while closing ../ccs/ccsnames.h file.";
 }
+
+# ==============================================================================
+#
+# Generate iconv.m4 file.
+#
+# Parameter 1 (input): array reference with encoding names
+#
+# ==============================================================================
+sub generate_iconv_m4($)
+{
+  my @encodings = @{$_[0]};
+
+  print "Debug: create \"../../../iconv.m4\" file.\n" if $verbose;
+  open (ICONV_M4, '>', "../../../iconv.m4")
+  or err "Can't create \"../../../iconv.m4\" file for writing.\nSystem error message: $!.\n";
+
+  print ICONV_M4 "$comment_automatic\n";
+  print ICONV_M4 "AC_DEFUN([NEWLIB_ICONV_DEFINES],[dnl\n";
+  foreach my $encoding (@encodings)
+  {
+    my $ucencoding = uc $encoding;
+
+    my $tovar = "_ICONV_TO_ENCODING_$ucencoding";
+    print ICONV_M4 "  if test \"\$$tovar\" = 1; then\n";
+    print ICONV_M4 "    AC_DEFINE($tovar, 1, [Support $encoding output encoding.])\n";
+    print ICONV_M4 "  fi\n";
+
+    my $fromvar = "_ICONV_FROM_ENCODING_$ucencoding";
+    print ICONV_M4 "  if test \"\$$fromvar\" = 1; then\n";
+    print ICONV_M4 "    AC_DEFINE($fromvar, 1, [Support $encoding input encoding.])\n";
+    print ICONV_M4 "  fi\n";
+  }
+  print ICONV_M4 "])\n";
+
+  close ICONV_M4 or err "Error while closing ../../../iconv.m4 file.";
+}
diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index 2b7b8d0d8ea6..15543f4030a4 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -36,112 +36,304 @@
 /* Enable ICONV external CCS files loading capabilities. */
 #undef _ICONV_ENABLE_EXTERNAL_CCS
 
-/*
- * Iconv encodings enabled ("from" direction)
- */
+/* Support big5 input encoding. */
 #undef _ICONV_FROM_ENCODING_BIG5
+
+/* Support cp775 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP775
+
+/* Support cp850 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP850
+
+/* Support cp852 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP852
+
+/* Support cp855 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP855
+
+/* Support cp866 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP866
+
+/* Support euc_jp input encoding. */
 #undef _ICONV_FROM_ENCODING_EUC_JP
+
+/* Support euc_kr input encoding. */
 #undef _ICONV_FROM_ENCODING_EUC_KR
+
+/* Support euc_tw input encoding. */
 #undef _ICONV_FROM_ENCODING_EUC_TW
+
+/* Support iso_8859_1 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_1
+
+/* Support iso_8859_10 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_10
+
+/* Support iso_8859_11 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_11
+
+/* Support iso_8859_13 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_13
+
+/* Support iso_8859_14 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_14
+
+/* Support iso_8859_15 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_15
+
+/* Support iso_8859_2 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_2
+
+/* Support iso_8859_3 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_3
+
+/* Support iso_8859_4 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_4
+
+/* Support iso_8859_5 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_5
+
+/* Support iso_8859_6 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_6
+
+/* Support iso_8859_7 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_7
+
+/* Support iso_8859_8 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_8
+
+/* Support iso_8859_9 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_9
+
+/* Support iso_ir_111 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_IR_111
+
+/* Support koi8_r input encoding. */
 #undef _ICONV_FROM_ENCODING_KOI8_R
+
+/* Support koi8_ru input encoding. */
 #undef _ICONV_FROM_ENCODING_KOI8_RU
+
+/* Support koi8_u input encoding. */
 #undef _ICONV_FROM_ENCODING_KOI8_U
+
+/* Support koi8_uni input encoding. */
 #undef _ICONV_FROM_ENCODING_KOI8_UNI
+
+/* Support ucs_2 input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_2
+
+/* Support ucs_2be input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_2BE
+
+/* Support ucs_2le input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_2LE
+
+/* Support ucs_2_internal input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_2_INTERNAL
+
+/* Support ucs_4 input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_4
+
+/* Support ucs_4be input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_4BE
+
+/* Support ucs_4le input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_4LE
+
+/* Support ucs_4_internal input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_4_INTERNAL
+
+/* Support us_ascii input encoding. */
 #undef _ICONV_FROM_ENCODING_US_ASCII
+
+/* Support utf_16 input encoding. */
 #undef _ICONV_FROM_ENCODING_UTF_16
+
+/* Support utf_16be input encoding. */
 #undef _ICONV_FROM_ENCODING_UTF_16BE
+
+/* Support utf_16le input encoding. */
 #undef _ICONV_FROM_ENCODING_UTF_16LE
+
+/* Support utf_8 input encoding. */
 #undef _ICONV_FROM_ENCODING_UTF_8
+
+/* Support win_1250 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1250
+
+/* Support win_1251 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1251
+
+/* Support win_1252 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1252
+
+/* Support win_1253 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1253
+
+/* Support win_1254 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1254
+
+/* Support win_1255 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1255
+
+/* Support win_1256 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1256
+
+/* Support win_1257 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1257
+
+/* Support win_1258 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1258
 
-/*
- * Iconv encodings enabled ("to" direction)
- */
+/* Support big5 output encoding. */
 #undef _ICONV_TO_ENCODING_BIG5
+
+/* Support cp775 output encoding. */
 #undef _ICONV_TO_ENCODING_CP775
+
+/* Support cp850 output encoding. */
 #undef _ICONV_TO_ENCODING_CP850
+
+/* Support cp852 output encoding. */
 #undef _ICONV_TO_ENCODING_CP852
+
+/* Support cp855 output encoding. */
 #undef _ICONV_TO_ENCODING_CP855
+
+/* Support cp866 output encoding. */
 #undef _ICONV_TO_ENCODING_CP866
+
+/* Support euc_jp output encoding. */
 #undef _ICONV_TO_ENCODING_EUC_JP
+
+/* Support euc_kr output encoding. */
 #undef _ICONV_TO_ENCODING_EUC_KR
+
+/* Support euc_tw output encoding. */
 #undef _ICONV_TO_ENCODING_EUC_TW
+
+/* Support iso_8859_1 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_1
+
+/* Support iso_8859_10 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_10
+
+/* Support iso_8859_11 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_11
+
+/* Support iso_8859_13 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_13
+
+/* Support iso_8859_14 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_14
+
+/* Support iso_8859_15 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_15
+
+/* Support iso_8859_2 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_2
+
+/* Support iso_8859_3 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_3
+
+/* Support iso_8859_4 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_4
+
+/* Support iso_8859_5 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_5
+
+/* Support iso_8859_6 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_6
+
+/* Support iso_8859_7 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_7
+
+/* Support iso_8859_8 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_8
+
+/* Support iso_8859_9 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_9
+
+/* Support iso_ir_111 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_IR_111
+
+/* Support koi8_r output encoding. */
 #undef _ICONV_TO_ENCODING_KOI8_R
+
+/* Support koi8_ru output encoding. */
 #undef _ICONV_TO_ENCODING_KOI8_RU
+
+/* Support koi8_u output encoding. */
 #undef _ICONV_TO_ENCODING_KOI8_U
+
+/* Support koi8_uni output encoding. */
 #undef _ICONV_TO_ENCODING_KOI8_UNI
+
+/* Support ucs_2 output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_2
+
+/* Support ucs_2be output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_2BE
+
+/* Support ucs_2le output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_2LE
+
+/* Support ucs_2_internal output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_2_INTERNAL
+
+/* Support ucs_4 output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_4
+
+/* Support ucs_4be output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_4BE
+
+/* Support ucs_4le output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_4LE
+
+/* Support ucs_4_internal output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_4_INTERNAL
+
+/* Support us_ascii output encoding. */
 #undef _ICONV_TO_ENCODING_US_ASCII
+
+/* Support utf_16 output encoding. */
 #undef _ICONV_TO_ENCODING_UTF_16
+
+/* Support utf_16be output encoding. */
 #undef _ICONV_TO_ENCODING_UTF_16BE
+
+/* Support utf_16le output encoding. */
 #undef _ICONV_TO_ENCODING_UTF_16LE
+
+/* Support utf_8 output encoding. */
 #undef _ICONV_TO_ENCODING_UTF_8
+
+/* Support win_1250 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1250
+
+/* Support win_1251 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1251
+
+/* Support win_1252 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1252
+
+/* Support win_1253 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1253
+
+/* Support win_1254 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1254
+
+/* Support win_1255 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1255
+
+/* Support win_1256 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1256
+
+/* Support win_1257 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1257
+
+/* Support win_1258 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1258
 
 /* Define if the platform long double type is equal to double. */
-- 
2.33.0


  parent reply	other threads:[~2022-01-18  4:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
2022-01-18  4:47 ` [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY Mike Frysinger
     [not found]   ` <DM3P110MB0522248DFEE102BB37B43A8F9A589@DM3P110MB0522.NAMP110.PROD.OUTLOOK.COM>
2022-01-18 16:10     ` Fw: " C Howland
2022-01-19  0:53       ` Mike Frysinger
2022-01-19  2:39         ` C Howland
2022-01-19  3:44           ` Mike Frysinger
2022-01-19 23:50           ` Mike Frysinger
2022-01-18  4:47 ` [PATCH 2/8] newlib: merge acconfig.h changes into newlib.hin Mike Frysinger
2022-01-18  4:47 ` [PATCH 3/8] newlib: clean up autoheader templates Mike Frysinger
2022-01-18  4:47 ` [PATCH 4/8] newlib: sort newlib.h output Mike Frysinger
2022-01-18  4:47 ` [PATCH 5/8] newlib: move version defines out of the config headers Mike Frysinger
2022-01-18  4:47 ` [PATCH 6/8] newlib: add missing _NANO_MALLOC to newlib.hin Mike Frysinger
2022-01-18  4:47 ` Mike Frysinger [this message]
2022-01-18  4:47 ` [PATCH 8/8] newlib: switch newlib.h to autoheader Mike Frysinger
2022-01-19 14:51 ` [PATCH 0/8] newlib: convert " Corinna Vinschen

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=20220118044741.21027-8-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=newlib@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).