libc/newlib/configure.in
Jeff Johnston 1a4f1aef1f 2004-01-27 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* configure.in: Add support to generate iconv converter flags
	for newlib.h
	* newlib.hin: Add iconv converter flags.
	* configure: Regenerated.
	* libc/Makefile.in: Ditto.
	* libc/configure.in: Moved iconv converter parsing logic to
	top level newlib configure.in.
	* libc/configure: Regenerated.
	* libc/iconv/Makefile.in: Ditto.
	* libc/iconv/README.TODO
	* libc/iconv/charset.aliases: Remove wrong BE aliases for
	UCS2/UCS4/UTF8.
	* libc/iconv/ccs/Makefile.am: Remove C flag setting now that
	newlib.h can be used.
	* libc/iconv/ces/Makefile.am: Ditto.
	* libc/iconv/lib/Makefile.am: Ditto.
	* libc/iconv/ccs/Makefile.in: Regenerated.
	* libc/iconv/ces/Makefile.in: Ditto.
	* libc/iconv/lib/Makefile.in: Ditto.
	* libc/iconv/ccs/README.CCS.SOURCES: Updated.
	* libc/iconv/ccs/iconv_mktbl: Don't write junk strings to binaries.
	* libc/iconv/ccs/big5.c: Switch to use new underscored flags
	defined in newlib.h.
	* libc/iconv/ccs/cns11643_plane1.c: Ditto.
	* libc/iconv/ccs/cns11643_plane14.c: Ditto.
	* libc/iconv/ccs/cns11643_plane2.c: Ditto.
	* libc/iconv/ccs/cp775.c: Ditto.
	* libc/iconv/ccs/cp850.c: Ditto.
	* libc/iconv/ccs/cp852.c: Ditto.
	* libc/iconv/ccs/cp855.c: Ditto.
	* libc/iconv/ccs/cp866.c: Ditto.
	* libc/iconv/ccs/gb_2312_80.c: Ditto.
	* libc/iconv/ccs/iso_8859_1.c: Ditto.
	* libc/iconv/ccs/iso_8859_15.c: Ditto.
	* libc/iconv/ccs/iso_8859_2.c: Ditto.
	* libc/iconv/ccs/iso_8859_4.c: Ditto.
	* libc/iconv/ccs/iso_8859_5.c: Ditto.
	* libc/iconv/ccs/jis_x0201.c: Ditto.
	* libc/iconv/ccs/jis_x0208_1983.c: Ditto.
	* libc/iconv/ccs/jis_x0212_1990.c: Ditto.
	* libc/iconv/ccs/koi8_r.c: Ditto.
	* libc/iconv/ccs/koi8_u.c: Ditto.
	* libc/iconv/ccs/ksx1001.c: Ditto.
	* libc/iconv/ccs/shift_jis.c: Ditto.
	* libc/iconv/ccs/us_ascii.c: Ditto.
	* libc/iconv/ccs/binary/big5.cct: Newly generated.
	* libc/iconv/ccs/binary/cns11643_plane1.cct: Ditto.
	* libc/iconv/ccs/binary/cns11643_plane14.cct: Ditto.
	* libc/iconv/ccs/binary/cns11643_plane2.cct: Ditto.
	* libc/iconv/ccs/binary/cp775.cct: Ditto.
	* libc/iconv/ccs/binary/cp850.cct: Ditto.
	* libc/iconv/ccs/binary/cp852.cct: Ditto.
	* libc/iconv/ccs/binary/cp855.cct: Ditto.
	* libc/iconv/ccs/binary/cp866.cct: Ditto.
	* libc/iconv/ccs/binary/gb_2312_80.cct: Ditto.
	* libc/iconv/ccs/binary/iso_8859_1.cct: Ditto.
	* libc/iconv/ccs/binary/iso_8859_15.cct: Ditto.
	* libc/iconv/ccs/binary/iso_8859_2.cct: Ditto.
	* libc/iconv/ccs/binary/iso_8859_4.cct: Ditto.
	* libc/iconv/ccs/binary/iso_8859_5.cct: Ditto.
	* libc/iconv/ccs/binary/jis_x0201.cct: Ditto.
	* libc/iconv/ccs/binary/jis_x0208_1983.cct: Ditto.
	* libc/iconv/ccs/binary/jis_x0212_1990.cct: Ditto.
	* libc/iconv/ccs/binary/koi8_r.cct: Ditto.
	* libc/iconv/ccs/binary/koi8_u.cct: Ditto.
	* libc/iconv/ccs/binary/ksx1001.cct: Ditto.
	* libc/iconv/ccs/binary/shift_jis.cct: Ditto.
	* libc/iconv/ccs/binary/us_ascii.cct: Ditto.
	* libc/iconv/lib/bialiasesi.c: Sync with charset.aliases.
	* libc/iconv/ces/euc-jp.c: Use newlib.h macros.
	* libc/iconv/ces/euc-kr.c: Ditto.
	* libc/iconv/ces/euc-tw.c: Ditto.
	* libc/iconv/ces/gb2312.c: Ditto.
	* libc/iconv/ces/iso-10646-ucs-2.c: Ditto.
	* libc/iconv/ces/iso-10646-ucs-4.c: Ditto.
	* libc/iconv/ces/ucs-2-internal.c: Ditto.
	* libc/iconv/ces/ucs-4-internal.c: Ditto.
	* libc/iconv/ces/utf-16.c: Ditto.
	* libc/iconv/ces/utf-8.c: Ditto.
	* libc/iconv/lib/aliases.c: Ditto.
	* libc/iconv/lib/biccs.c: Ditto.
	* libc/iconv/lib/bices.c: Ditto.
	* libc/iconv/lib/ccs.c: Ditto.
	* libc/iconv/lib/ces.c: Ditto.
	* libc/iconv/lib/ces_euc.c: Ditto.
	* libc/iconv/lib/ces_iso2022.c: Ditto.
	* libc/iconv/lib/ces_table.c: Ditto.
	* libc/iconv/lib/converter.c: Ditto.
	* libc/iconv/lib/deps.h: Ditto.
	* libc/iconv/lib/endian.h: Ditto.
	* libc/iconv/lib/iconv.c: Ditto.
	* libc/iconv/lib/loaddata.c: Ditto.
	* libc/iconv/lib/local.h: Include newlib.h.
	* libc/argz/Makefile.in: Regenerated.
	* libc/ctype/Makefile.in: Ditto.
	* libc/errno/Makefile.in: Ditto.
	* libc/iconv/ccs/binary/Makefile.in: Ditto.
	* libc/locale/Makefile.in: Ditto.
	* libc/misc/Makefile.in: Ditto.
	* libc/posix/Makefile.in: Ditto.
	* libc/reent/Makefile.in: Ditto.
	* libc/search/Makefile.in: Ditto.
	* libc/signal/Makefile.in: Ditto.
	* libc/stdio/Makefile.in: Ditto.
	* libc/stdio64/Makefile.in: Ditto.
	* libc/stdlib/Makefile.in: Ditto.
	* libc/string/Makefile.in: Ditto.
	* libc/syscalls/Makefile.in: Ditto.
	* libc/time/Makefile.in: Ditto.
	* libc/unix/Makefile.in: Ditto.
	* testsuite/newlib.iconv/iconv.exp: New file.
	* testsuite/newlib.iconv/iconvjp.c: Ditto.
	* testsuite/newlib.iconv/iconvnm.c: Ditto.
	* testsuite/newlib.iconv/iconvru.c: Ditto.
2004-01-29 17:12:36 +00:00

215 lines
6 KiB
Plaintext

dnl This is the newlib configure.in file.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.13)
AC_INIT(libc)
AM_CONFIG_HEADER(newlib.h:newlib.hin)
dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
AC_CONFIG_AUX_DIR(..)
dnl Support --enable-newlib-io-pos-args
dnl This option is actually read in libc/configure.in. It is repeated
dnl here so that it shows up in the help text.
AC_ARG_ENABLE(newlib-io-pos-args,
[ --enable-newlib-io-pos-args enable printf-family positional arg support],
[case "${enableval}" in
yes) newlib_io_pos_args=yes ;;
no) newlib_io_pos_args=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-io-pos-args option) ;;
esac], [newlib_io_pos_args=no])dnl
NEWLIB_CONFIGURE(.)
dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
dnl line of the macro which fail because appropriate LDFLAGS are not set.
if test "${use_libtool}" = "yes"; then
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_PROG_AWK
fi
configdirs="libc libm"
AC_ARG_ENABLE(newlib_hw_fp,
[ --enable-newlib-hw-fp Turn on hardware floating point math],
[case "${enableval}" in
yes) newlib_hw_fp=true ;;
no) newlib_hw_fp=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-newlib-hw-fp) ;;
esac],[newlib_hw_fp=false])
AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp = xtrue)
if test -z "${with_multisubdir}"; then
configdirs="${configdirs} doc"
have_doc=yes
else
have_doc=
fi
AM_CONDITIONAL(HAVE_DOC, test x$have_doc = xyes)
EXTRA_DIRS=
case $host in
i[[34567]]86-pc-linux-*)
configdirs="${configdirs} iconvdata"
EXTRA_DIRS=iconvdata
;;
esac
AC_SUBST(EXTRA_DIRS)
# These get added in the top-level configure.in, except in the case where
# newlib is being built natively.
LIBC_INCLUDE_GREP=`echo ${CC} | grep \/libc\/include`
abs_newlib_basedir=`cd ${newlib_basedir} && pwd`
if test -z "${LIBC_INCLUDE_GREP}"; then
CC_FOR_NEWLIB="${CC} -I$PWD/targ-include -I${abs_newlib_basedir}/libc/include"
else
CC_FOR_NEWLIB="${CC}"
fi
AC_SUBST(CC_FOR_NEWLIB)
AC_CONFIG_SUBDIRS(${configdirs})
CRT0=
CRT0_DIR=
if test -n "${sys_dir}"; then
CRT0=crt0.o
CRT0_DIR=libc/
fi
AC_SUBST(CRT0)
AC_SUBST(CRT0_DIR)
CRT1=${crt1}
CRT1_DIR=
if test -n "${crt1_dir}"; then
CRT1_DIR=${crt1_dir}/
fi
AC_SUBST(CRT1)
AC_SUBST(CRT1_DIR)
if test -n "${libm_machine_dir}"; then
LIBM_MACHINE_OBJECTLIST=libm/machine/${libm_machine_dir}/objectlist.awk.in
fi
AC_SUBST(LIBM_MACHINE_OBJECTLIST)
if test -n "${machine_dir}"; then
MACHINE_OBJECTLIST=libc/machine/${machine_dir}/objectlist.awk.in
fi
AC_SUBST(MACHINE_OBJECTLIST)
if test -n "${sys_dir}"; then
SYS_OBJECTLIST=libc/sys/${sys_dir}/objectlist.awk.in
fi
AC_SUBST(SYS_OBJECTLIST)
if test "${have_sys_mach_dir}" = "yes"; then
SYS_MACH_OBJECTLIST=libc/sys/${sys_dir}/machine/${machine_dir}/objectlist.awk.in
fi
AC_SUBST(SYS_MACH_OBJECTLIST)
if test -n "${posix_dir}"; then
POSIX_OBJECTLIST=libc/${posix_dir}/objectlist.awk.in
fi
AC_SUBST(POSIX_OBJECTLIST)
if test -n "${signal_dir}"; then
SIGNAL_OBJECTLIST=libc/${signal_dir}/objectlist.awk.in
fi
AC_SUBST(SIGNAL_OBJECTLIST)
if test -n "${syscall_dir}"; then
SYSCALL_OBJECTLIST=libc/${syscall_dir}/objectlist.awk.in
fi
AC_SUBST(SYSCALL_OBJECTLIST)
if test -n "${unix_dir}"; then
UNIX_OBJECTLIST=libc/${unix_dir}/objectlist.awk.in
fi
AC_SUBST(UNIX_OBJECTLIST)
if test -n "${stdio64_dir}"; then
STDIO64_OBJECTLIST=libc/${stdio64_dir}/objectlist.awk.in
fi
AC_SUBST(STDIO64_OBJECTLIST)
# Put a plausible default for CC_FOR_BUILD in Makefile.
if test -z "$CC_FOR_BUILD"; then
CC_FOR_BUILD=gcc
fi
AC_SUBST(CC_FOR_BUILD)
if test "${newlib_elix_level}" -gt "0"; then
AC_DEFINE_UNQUOTED(_ELIX_LEVEL,${newlib_elix_level})
fi
if test "${newlib_mb}" = "yes"; then
AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8)
else
AC_DEFINE_UNQUOTED(_MB_LEN_MAX,1)
fi
AC_DEFINE_UNQUOTED(_NEWLIB_VERSION,"$VERSION")
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"
else
multilib_arg=
fi
if test "${newlib_iconv}" = "yes"; then
AC_DEFINE_UNQUOTED(_ICONV_ENABLED,1)
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}/libc/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}/libc/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 Enable appropriate option in newlib.h
for converter in ${builtin_converters}; do
opt=_ICONV_CONVERTER_`echo "${converter}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
AC_DEFINE_UNQUOTED($opt,1)
done
fi;
AC_OUTPUT(Makefile,
[if test -n "$CONFIG_FILES"; then
unset ac_file
. ${newlib_basedir}/../config-ml.in
fi],
srcdir=${srcdir}
host=${host}
target=${target}
with_multisubdir=${with_multisubdir}
ac_configure_args="${multilib_arg} ${ac_configure_args}"
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
newlib_basedir=${newlib_basedir}
CC="${CC}"
LDFLAGS="${LDFLAGS}"
)