Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/configure.in')
-rw-r--r--newlib/libc/configure.in48
1 files changed, 46 insertions, 2 deletions
diff --git a/newlib/libc/configure.in b/newlib/libc/configure.in
index 93b86132c..d2d86770b 100644
--- a/newlib/libc/configure.in
+++ b/newlib/libc/configure.in
@@ -122,7 +122,51 @@ fi
AC_SUBST(LIBC_SYS_LIB)
AC_SUBST(sys_dir)
-LIBC_MACHINE_LIB=
+dnl iconv library will be compiled if --enable-newlib-iconv option is enabled
+if test x${newlib_iconv} != x; then
+ AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test 1 = 1)
+ NEWLIB_CFLAGS="${NEWLIB_CFLAGS} -DENABLE_ICONV"
+fi;
+
+dnl Parse --enable-newlib-builtin-converters option argument
+if test "x${builtin_converters}" != "x"; then
+
+ dnl Check that --enable-newlib-iconv was enabled
+ if test x${newlib_iconv} = x; then
+ AC_MSG_ERROR(--enable-newlib-builtin-converters option can't be used if iconv library is disabled - use --enable-newlib-iconv to enable it)
+ fi
+
+ dnl Normalize converter names and delete commas
+ builtin_converters=`echo "${builtin_converters}" | sed -e 's/,/ /g' -e 's/-/_/g' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+
+ dnl Get the list of available converters excluding comments
+ dnl Join line with previous if the first character is whitespace
+ available_converters=`cat "${srcdir}/iconv/charset.aliases" | sed -e '/#/d' | sed -e 'N; s/\n //;'`
+
+ dnl Check if required converters are supported
+ dnl Convert aliases to "official" names
+ builtin_converters1="${builtin_converters}"
+ builtin_converters=""
+ for converter in ${builtin_converters1}; do
+ result=`echo "${available_converters}" | grep -e "\(^\| \)${converter}\( \|\$\)"`
+ if test $? != "0"; then
+ AC_MSG_ERROR(${converter} is not supported - see ${srcdir}/iconv/charset.aliases file for the list of available converters)
+ fi
+ converter1=`echo "${result}" | sed -e 's/\(^[[^ ]]*\).*$/\1/'`
+ builtin_converters="${builtin_converters} ${converter1}"
+ done
+
+ dnl Define appropriate -D options
+ for converter in ${builtin_converters}; do
+ opt=ICONV_CONVERTER_`echo "${converter}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ NEWLIB_ICONV_CFLAGS="${NEWLIB_ICONV_CFLAGS} -D${opt}"
+ done
+
+else
+ NEWLIB_ICONV_CFLAGS=
+fi;
+AC_SUBST(NEWLIB_ICONV_CFLAGS)
+
if test -n "${machine_dir}"; then
if test "${use_libtool}" = "yes"; then
LIBC_MACHINE_LIB=machine/${machine_dir}/lib${machine_dir}.${aext}
@@ -133,4 +177,4 @@ fi
AC_SUBST(LIBC_MACHINE_LIB)
AC_SUBST(machine_dir)
-AC_OUTPUT(Makefile argz/Makefile ctype/Makefile errno/Makefile locale/Makefile misc/Makefile reent/Makefile search/Makefile stdio/Makefile stdio64/Makefile stdlib/Makefile string/Makefile time/Makefile posix/Makefile signal/Makefile syscalls/Makefile unix/Makefile)
+AC_OUTPUT(Makefile argz/Makefile ctype/Makefile errno/Makefile locale/Makefile misc/Makefile reent/Makefile search/Makefile stdio/Makefile stdio64/Makefile stdlib/Makefile string/Makefile time/Makefile posix/Makefile signal/Makefile syscalls/Makefile unix/Makefile iconv/Makefile iconv/ces/Makefile iconv/ccs/Makefile iconv/ccs/binary/Makefile iconv/lib/Makefile)