2000-02-18 03:39:52 +08:00
dnl This is the newlib configure.in file.
dnl Process this file with autoconf to produce a configure script.
2006-04-14 03:56:32 +08:00
AC_PREREQ(2.59)
AC_INIT([newlib],[NEWLIB_VERSION])
AC_CONFIG_SRCDIR([libc])
Define the newlib version macros in one place: _newlib_version.h.
Currently, the newlib version information needs to be updated in two places:
- newlib/acinclude.m4
- newlib/libc/include/sys/features.h
The goal of this patch is to:
- supply a single location for defining the newlib version
information: newlib/acinclude.m4
- define __NEWLIB__, __NEWLIB_MINOR__ and __NEWLIB_PATCHLEVEL__
This is in line with what gcc does for its version macros. See:
https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
This patch moves the definition of the _NEWLIB_VERSION, __NEWLIB__
and __NEWLIB_MINOR__ macros from newlib/libc/include/sys/features.h,
to the newly generated newlib/_newlib_version.h file. Additionally,
the __NEWLIB_PATCHLEVEL__ macro was created, for completeness.
In order to stay backwards compatible, newlib/_newlib_version.h gets
included by newlib/newlib.h and newlib/libc/include/sys/features.h.
Note: This patch does _not_ include the modifications to the following
files, as these should all be generated any way.
*Makefile.in,
*aclocal.m4,
*configure
stamp-* files
Signed-off-by: Pieter du Preez <pdupreez@gmail.com>
2016-02-14 18:12:06 +08:00
AC_CONFIG_HEADERS([_newlib_version.h:_newlib_version.hin newlib.h:newlib.hin])
2000-02-18 03:39:52 +08:00
dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
AC_CONFIG_AUX_DIR(..)
2002-08-10 05:12:09 +08:00
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) ;;
2004-05-26 08:19:14 +08:00
esac], [newlib_io_pos_args=])dnl
2002-08-10 05:12:09 +08:00
2007-05-12 04:09:00 +08:00
dnl Support --enable-newlib-io-c99-formats
AC_ARG_ENABLE(newlib-io-c99-formats,
[ --enable-newlib-io-c99-formats enable C99 support in IO functions like printf/scanf],
[case "${enableval}" in
yes) newlib_io_c99_formats=yes;;
no) newlib_io_c99_formats=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-io-c99-formats option) ;;
esac], [newlib_io_c99_formats=])dnl
2010-06-09 02:44:14 +08:00
dnl Support --enable-newlib-register-fini
AC_ARG_ENABLE(newlib-register-fini,
[ --enable-newlib-register-fini enable finalization function registration using atexit],
[case "${enableval}" in
yes) newlib_register_fini=yes;;
no) newlib_register_fini=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-register-fini option) ;;
esac], [newlib_register_fini=])dnl
2004-05-26 08:19:14 +08:00
dnl Support --enable-newlib-io-long-long
AC_ARG_ENABLE(newlib-io-long-long,
[ --enable-newlib-io-long-long enable long long type support in IO functions like printf/scanf],
[case "${enableval}" in
yes) newlib_io_long_long=yes;;
no) newlib_io_long_long=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-io-long-long option) ;;
esac], [newlib_io_long_long=])dnl
dnl Support --enable-newlib-io-long-double
AC_ARG_ENABLE(newlib-io-long-double,
[ --enable-newlib-io-long-double enable long double type support in IO functions printf/scanf],
[case "${enableval}" in
yes) newlib_io_long_double=yes;;
no) newlib_io_long_double=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-io-long-double option) ;;
esac], [newlib_io_long_double=])dnl
2002-09-12 02:36:55 +08:00
2004-06-26 04:33:28 +08:00
dnl If multibyte support is enabled, iconv should be enabled too
dnl Support --enable-newlib-mb
AC_ARG_ENABLE(newlib-mb,
[ --enable-newlib-mb enable multibyte support],
[case "${enableval}" in
2004-06-30 05:53:35 +08:00
yes) newlib_mb=yes;;
2004-06-26 04:33:28 +08:00
no) newlib_mb=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
esac], [newlib_mb=])dnl
2019-10-08 03:29:33 +08:00
dnl Enable verification of successful memory allocation for _REENT_CHECK family of macros
2020-01-22 04:12:34 +08:00
dnl Support --disable-newlib-reent-check-verify
2019-10-08 03:29:33 +08:00
AC_ARG_ENABLE(newlib-reent-check-verify,
2020-01-22 04:12:34 +08:00
[ --disable-newlib-reent-check-verify disable checking of _REENT_CHECK memory allocation],
2019-10-08 03:29:33 +08:00
[case "${enableval}" in
yes) newlib_reent_check_verify=yes;;
no) newlib_reent_check_verify=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-reent-check-verify option) ;;
esac], [newlib_reent_check_verify=])dnl
2004-06-26 04:33:28 +08:00
dnl Support --enable-newlib-iconv-encodings
AC_ARG_ENABLE(newlib-iconv-encodings,
[ --enable-newlib-iconv-encodings enable specific comma-separated list of bidirectional iconv encodings to be built-in],
[if test x${enableval} = x; then
AC_MSG_ERROR(bad value ${enableval} for newlib-iconv-encodings option - use comma-separated encodings list)
fi
iconv_encodings=${enableval}
], [iconv_encodings=])dnl
dnl Support --enable-newlib-iconv-from-encodings
AC_ARG_ENABLE(newlib-iconv-from-encodings,
[ --enable-newlib-iconv-from-encodings enable specific comma-separated list of \"from\" iconv encodings to be built-in],
[if test x${enableval} = x; then
AC_MSG_ERROR(bad value ${enableval} for newlib-iconv-from-encodings option - use comma-separated encodings list)
fi
iconv_from_encodings=${enableval}
], [iconv_from_encodings=])dnl
dnl Support --enable-newlib-iconv-to-encodings
AC_ARG_ENABLE(newlib-iconv-to-encodings,
[ --enable-newlib-iconv-to-encodings enable specific comma-separated list of \"to\" iconv encodings to be built-in],
[if test x${enableval} = x; then
AC_MSG_ERROR(bad value ${enableval} for newlib-iconv-to-encodings option - use comma-separated encodings list)
fi
iconv_to_encodings=${enableval}
], [iconv_to_encodings=])dnl
dnl Support --enable-newlib-iconv-external-ccs
AC_ARG_ENABLE(newlib-iconv-external-ccs,
[ --enable-newlib-iconv-external-ccs enable capabilities to load external CCS files for iconv],
[if test "${newlib_iconv_external_ccs+set}" != set; then
case "${enableval}" in
yes) newlib_iconv_external_ccs=yes ;;
no) newlib_iconv_external_ccs=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-iconv-external-ccs option) ;;
esac
fi], [newlib_iconv_external_ccs=${newlib_iconv_external_ccs}])dnl
2006-03-21 08:57:34 +08:00
dnl Support --disable-newlib-atexit-dynamic-alloc
AC_ARG_ENABLE(newlib-atexit-dynamic-alloc,
2013-05-11 04:14:33 +08:00
[ --disable-newlib-atexit-dynamic-alloc disable dynamic allocation of atexit entries],
2006-03-21 08:57:34 +08:00
[if test "${newlib_atexit_dynamic_alloc+set}" != set; then
case "${enableval}" in
yes) newlib_atexit_dynamic_alloc=yes ;;
no) newlib_atexit_dynamic_alloc=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-atexit-dynamic-alloc option) ;;
esac
2006-03-22 04:02:13 +08:00
fi], [newlib_atexit_dynamic_alloc=${newlib_atexit_dynamic_alloc}])dnl
2006-03-21 08:57:34 +08:00
2013-10-18 16:43:05 +08:00
dnl Support --enable-newlib-global-atexit
dnl Enable atexit data structure as global variables to save memory usage in
dnl _reent.
AC_ARG_ENABLE(newlib-global-atexit,
[ --enable-newlib-global-atexit enable atexit data structure as global],
[if test "${newlib_global_atexit+set}" != set; then
case "${enableval}" in
yes) newlib_global_atexit=yes ;;
no) newlib_global_atexit=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-global-atexit option) ;;
esac
fi], [newlib_global_atexit=no])dnl
2007-03-16 05:32:13 +08:00
dnl Support --enable-newlib-reent-small
AC_ARG_ENABLE(newlib-reent-small,
[ --enable-newlib-reent-small enable small reentrant struct support],
[case "${enableval}" in
yes) newlib_reent_small=yes;;
no) newlib_reent_small=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-reent-small option) ;;
esac], [newlib_reent_small=])dnl
2017-06-29 13:28:08 +08:00
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
2013-03-27 17:38:39 +08:00
dnl Support --disable-newlib-fvwrite-in-streamio
AC_ARG_ENABLE(newlib-fvwrite-in-streamio,
[ --disable-newlib-fvwrite-in-streamio disable iov in streamio],
[if test "${newlib_fvwrite_in_streamio+set}" != set; then
case "${enableval}" in
yes) newlib_fvwrite_in_streamio=yes ;;
no) newlib_fvwrite_in_streamio=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-fvwrite-in-streamio option) ;;
esac
fi], [newlib_fvwrite_in_streamio=yes])dnl
2007-03-16 05:32:13 +08:00
2013-04-11 02:47:46 +08:00
dnl Support --disable-newlib-fseek-optimization
AC_ARG_ENABLE(newlib-fseek-optimization,
[ --disable-newlib-fseek-optimization disable fseek optimization],
[if test "${newlib_fseek_optimization+set}" != set; then
case "${enableval}" in
yes) newlib_fseek_optimization=yes ;;
no) newlib_fseek_optimization=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-fseek-optimization option) ;;
esac
fi], [newlib_fseek_optimization=yes])dnl
2013-04-12 20:05:31 +08:00
dnl Support --enable-newlib-wide-orient
dnl This option is also read in libc/configure.in. It is repeated
dnl here so that it shows up in the help text.
AC_ARG_ENABLE(newlib_wide_orient,
[ --disable-newlib-wide-orient Turn off wide orientation in streamio],
[case "${enableval}" in
yes) newlib_wide_orient=yes ;;
no) newlib_wide_orient=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-wide-orient) ;;
esac],[newlib_wide_orient=yes])
2013-04-11 02:47:46 +08:00
2013-05-29 20:37:59 +08:00
dnl Support --enable-newlib-nano-malloc
dnl This option is also read in libc/configure.in. It is repeated
dnl here so that it shows up in the help text.
AC_ARG_ENABLE(newlib-nano-malloc,
[ --enable-newlib-nano-malloc use small-footprint nano-malloc implementation],
[if test "${newlib_nano_malloc+set}" != set; then
case "${enableval}" in
yes) newlib_nano_malloc=yes ;;
no) newlib_nano_malloc=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-nano-malloc option) ;;
esac
2014-06-10 11:09:35 +08:00
fi], [newlib_nano_malloc=])dnl
2013-05-29 20:37:59 +08:00
2013-06-19 23:58:50 +08:00
dnl Support --disable-newlib-unbuf-stream-opt
AC_ARG_ENABLE(newlib-unbuf-stream-opt,
[ --disable-newlib-unbuf-stream-opt disable unbuffered stream optimization in streamio],
[if test "${newlib_unbuf_stream_opt+set}" != set; then
case "${enableval}" in
yes) newlib_unbuf_stream_opt=yes ;;
no) newlib_unbuf_stream_opt=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-unbuf-stream-opt option) ;;
esac
fi], [newlib_unbuf_stream_opt=yes])dnl
2013-07-03 05:30:57 +08:00
dnl Support --enable-lite-exit
dnl Lite exit is a size-reduced implementation of exit that doesn't invoke
dnl clean-up functions such as _fini or global destructors.
AC_ARG_ENABLE(lite-exit,
[ --enable-lite-exit enable light weight exit],
[if test "${lite_exit+set}" != set; then
case "${enableval}" in
yes) lite_exit=yes ;;
no) lite_exit=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for lite-exit option) ;;
esac
fi], [lite_exit=no])dnl
2014-07-04 Bin Cheng <bin.cheng@arm.com>
* README (--enable-newlib-nano-formatted-io): Describe.
* acconfig.h (_NANO_FORMATTED_IO): Undef.
* newlib.hin (_NANO_FORMATTED_IO): Undef.
* configure.in (--enable-newlib-nano-formatted-io): New option.
* configure: Regenerated.
* libc/configure.in (--enable-newlib-nano-formatted-io): New option.
* libc/configure: Regenerated.
* libc/stdio/Makefile.am (NEWLIB_NANO_FORMATTED_IO): Support new
configuration option.
* libc/stdio/Makefile.in: Regenerated.
* libc/stdio/asnprintf.c (_asniprintf_r, asniprintf): Use
_NANO_FORMATTED_IO to declare alias prototypes.
* libc/stdio/asprintf.c (_asiprintf_r, asiprintf): Ditto.
* libc/stdio/dprintf.c (_diprintf_r, diprintf): Ditto.
* libc/stdio/fprintf.c (_fiprintf_r, fiprintf): Ditto.
* libc/stdio/fscanf.c (fiscanf, _fiscanf_r): Ditto.
* libc/stdio/printf.c (_iprintf_r, iprintf): Ditto.
* libc/stdio/scanf.c (iscanf, _iscanf_r): Ditto.
* libc/stdio/snprintf.c (_sniprintf_r, sniprintf): Ditto.
* libc/stdio/sprintf.c (_siprintf_r, siprintf): Ditto.
* libc/stdio/sscanf.c (siscanf, _siscanf_r): Ditto.
* libc/stdio/vasnprintf.c (_vasniprintf_r, vasniprintf): Ditto.
* libc/stdio/vasprintf.c (vasiprintf, _vasiprintf_r): Ditto.
* libc/stdio/vdprintf.c (_vdiprintf_r, vdiprintf): Ditto.
* libc/stdio/vprintf.c (viprintf, _viprintf_r): Ditto.
* libc/stdio/vscanf.c (viscanf, _viscanf_r): Ditto.
* libc/stdio/vsnprintf.c (vsniprintf, _vsniprintf_r): Ditto.
* libc/stdio/vsprintf.c (vsiprintf, _vsiprintf_r): Ditto.
* libc/stdio/vsscanf.c (vsiscanf, _vsiscanf_r): Ditto.
* libc/stdio/nano-vfprintf.c: New file.
* libc/stdio/nano-vfprintf_float.c: New file.
* libc/stdio/nano-vfprintf_i.c: New file.
* libc/stdio/nano-vfprintf_local.h: New file.
* libc/stdio/nano-vfscanf.c: New file.
* libc/stdio/nano-vfscanf_float.c: New file.
* libc/stdio/nano-vfscanf_i.c: New file.
* libc/stdio/nano-vfscanf_local.h: New file.
2014-07-05 01:21:45 +08:00
dnl Support --enable-newlib-nano-formatted-io
dnl This option is also read in libc/configure.in. It is repeated
dnl here so that it shows up in the help text.
AC_ARG_ENABLE(newlib_nano_formatted_io,
[ --enable-newlib-nano-formatted-io Use nano version formatted IO],
[case "${enableval}" in
yes) newlib_nano_formatted_io=yes ;;
no) newlib_nano_formatted_io=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-nano-formatted-io) ;;
2014-07-07 21:15:55 +08:00
esac],[newlib_nano_formatted_io=no])
2014-07-04 Bin Cheng <bin.cheng@arm.com>
* README (--enable-newlib-nano-formatted-io): Describe.
* acconfig.h (_NANO_FORMATTED_IO): Undef.
* newlib.hin (_NANO_FORMATTED_IO): Undef.
* configure.in (--enable-newlib-nano-formatted-io): New option.
* configure: Regenerated.
* libc/configure.in (--enable-newlib-nano-formatted-io): New option.
* libc/configure: Regenerated.
* libc/stdio/Makefile.am (NEWLIB_NANO_FORMATTED_IO): Support new
configuration option.
* libc/stdio/Makefile.in: Regenerated.
* libc/stdio/asnprintf.c (_asniprintf_r, asniprintf): Use
_NANO_FORMATTED_IO to declare alias prototypes.
* libc/stdio/asprintf.c (_asiprintf_r, asiprintf): Ditto.
* libc/stdio/dprintf.c (_diprintf_r, diprintf): Ditto.
* libc/stdio/fprintf.c (_fiprintf_r, fiprintf): Ditto.
* libc/stdio/fscanf.c (fiscanf, _fiscanf_r): Ditto.
* libc/stdio/printf.c (_iprintf_r, iprintf): Ditto.
* libc/stdio/scanf.c (iscanf, _iscanf_r): Ditto.
* libc/stdio/snprintf.c (_sniprintf_r, sniprintf): Ditto.
* libc/stdio/sprintf.c (_siprintf_r, siprintf): Ditto.
* libc/stdio/sscanf.c (siscanf, _siscanf_r): Ditto.
* libc/stdio/vasnprintf.c (_vasniprintf_r, vasniprintf): Ditto.
* libc/stdio/vasprintf.c (vasiprintf, _vasiprintf_r): Ditto.
* libc/stdio/vdprintf.c (_vdiprintf_r, vdiprintf): Ditto.
* libc/stdio/vprintf.c (viprintf, _viprintf_r): Ditto.
* libc/stdio/vscanf.c (viscanf, _viscanf_r): Ditto.
* libc/stdio/vsnprintf.c (vsniprintf, _vsniprintf_r): Ditto.
* libc/stdio/vsprintf.c (vsiprintf, _vsiprintf_r): Ditto.
* libc/stdio/vsscanf.c (vsiscanf, _vsiscanf_r): Ditto.
* libc/stdio/nano-vfprintf.c: New file.
* libc/stdio/nano-vfprintf_float.c: New file.
* libc/stdio/nano-vfprintf_i.c: New file.
* libc/stdio/nano-vfprintf_local.h: New file.
* libc/stdio/nano-vfscanf.c: New file.
* libc/stdio/nano-vfscanf_float.c: New file.
* libc/stdio/nano-vfscanf_i.c: New file.
* libc/stdio/nano-vfscanf_local.h: New file.
2014-07-05 01:21:45 +08:00
2016-10-26 00:38:19 +08:00
dnl Support --enable-retargetable-locking
dnl This option is also read in libc/configure.in. It is repeated
dnl here so that it shows up in the help text.
AC_ARG_ENABLE(newlib-retargetable-locking,
[ --enable-newlib-retargetable-locking Allow locking routines to be retargeted at link time],
[case "${enableval}" in
yes) newlib_retargetable_locking=yes ;;
no) newlib_retargetable_locking=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-retargetable-locking) ;;
esac],[newlib_retargetable_locking=no])
2017-09-07 14:24:22 +08:00
dnl Support --enable-newlib-long-time_t
AC_ARG_ENABLE(newlib-long-time_t,
[ --enable-newlib-long-time_t define time_t to long],
[if test "${newlib_long_time_t+set}" != set; then
case "${enableval}" in
yes) newlib_long_time_t=yes ;;
no) newlib_long_time_t=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for newlib-long-time_t option) ;;
esac
2017-09-26 16:38:12 +08:00
fi], [newlib_long_time_t=no])dnl
2017-09-07 14:24:22 +08:00
2000-02-18 03:39:52 +08:00
NEWLIB_CONFIGURE(.)
2001-12-14 07:50:11 +08:00
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.
2007-05-25 01:33:42 +08:00
_LT_DECL_SED
2010-02-25 05:00:08 +08:00
_LT_PROG_ECHO_BACKSLASH
2007-05-25 01:33:42 +08:00
AC_PROG_AWK
2001-12-14 07:50:11 +08:00
if test "${use_libtool}" = "yes"; then
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
fi
2012-10-25 05:01:39 +08:00
dnl The following is being disabled because the mathfp library is
dnl not up to standard due to inaccuracies caused by some of the
dnl floating-point algorithms used. If you wish to work on this,
dnl comment out the following line and uncomment out the lines
dnl following it to re-enable the feature.
newlib_hw_fp=false
#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])
2000-02-18 03:39:52 +08:00
AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp = xtrue)
2006-04-12 03:02:16 +08:00
# 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(libc)
AC_CONFIG_SUBDIRS(libm)
2000-02-18 03:39:52 +08:00
if test -z "${with_multisubdir}"; then
2016-12-23 03:50:00 +08:00
have_multisubdir=no
2006-04-12 03:02:16 +08:00
AC_CONFIG_SUBDIRS(doc)
2000-02-18 03:39:52 +08:00
else
2016-12-23 03:50:00 +08:00
have_multisubdir=yes
2000-02-18 03:39:52 +08:00
fi
2016-12-23 03:50:00 +08:00
AM_CONDITIONAL(HAVE_DOC, test x$have_multisubdir = xno)
# Some run-time support libraries provided by GCC (e.g. libgomp) use configure
# checks to detect certain features, e.g. availability of thread-local storage.
# The configure script generates a test program and tries to compile and link
# it. It should use target libraries and startfiles of the build tree if
# available and not random ones from the installation prefix for this
# procedure. The search directories specified by -B are a bit special, see
# for_each_path() in gcc.c of the GCC sources. First a search is performed on
# all search paths with the multilib directory appended (if desired), then a
# second search is performed on demand with the base directory only. For each
# multilib there is a "newlib" subdirectory. This directory is specified by a
# -B option for the support libraries. In order to find the newlib artifacts
# (ctr0.o, libc.a, libg.a and libm.a) they must be located in a proper multilib
# subdirectory withing the build directory.
AM_CONDITIONAL(HAVE_MULTISUBDIR, test x$have_multisubdir = xyes)
2000-02-18 03:39:52 +08:00
2002-10-08 07:10:13 +08:00
EXTRA_DIRS=
2003-05-29 06:04:40 +08:00
case $host in
2003-05-31 05:47:40 +08:00
i[[34567]]86-pc-linux-*)
2006-04-12 03:02:16 +08:00
AC_CONFIG_SUBDIRS(iconvdata)
2003-05-29 06:04:40 +08:00
EXTRA_DIRS=iconvdata
;;
esac
2002-10-08 07:10:13 +08:00
AC_SUBST(EXTRA_DIRS)
2000-02-18 03:39:52 +08:00
CRT0=
CRT0_DIR=
2005-09-01 04:39:43 +08:00
if test "x${have_crt0}" = "xyes"; then
2000-02-18 03:39:52 +08:00
CRT0=crt0.o
2002-04-18 03:13:11 +08:00
CRT0_DIR=libc/
2000-02-18 03:39:52 +08:00
fi
2016-12-23 03:50:00 +08:00
AM_CONDITIONAL(HAVE_CRT0, test x$have_crt0 = xyes)
2000-02-18 03:39:52 +08:00
AC_SUBST(CRT0)
AC_SUBST(CRT0_DIR)
2002-04-05 06:41:11 +08:00
CRT1=${crt1}
2002-04-18 03:13:11 +08:00
CRT1_DIR=
if test -n "${crt1_dir}"; then
CRT1_DIR=${crt1_dir}/
fi
2002-04-05 06:41:11 +08:00
AC_SUBST(CRT1)
AC_SUBST(CRT1_DIR)
2001-12-14 07:50:11 +08:00
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)
2002-04-04 06:46:21 +08:00
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)
2001-12-14 07:50:11 +08:00
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)
2000-02-18 03:39:52 +08:00
2001-12-14 07:50:11 +08:00
if test -n "${unix_dir}"; then
UNIX_OBJECTLIST=libc/${unix_dir}/objectlist.awk.in
fi
AC_SUBST(UNIX_OBJECTLIST)
2000-02-18 03:39:52 +08:00
2002-08-27 02:56:09 +08:00
if test -n "${stdio64_dir}"; then
STDIO64_OBJECTLIST=libc/${stdio64_dir}/objectlist.awk.in
fi
AC_SUBST(STDIO64_OBJECTLIST)
2001-12-14 07:50:11 +08:00
# Put a plausible default for CC_FOR_BUILD in Makefile.
if test -z "$CC_FOR_BUILD"; then
2002-04-26 02:12:38 +08:00
CC_FOR_BUILD=gcc
2001-12-14 07:50:11 +08:00
fi
AC_SUBST(CC_FOR_BUILD)
2000-02-18 03:39:52 +08:00
2002-08-28 04:27:35 +08:00
if test "${newlib_elix_level}" -gt "0"; then
AC_DEFINE_UNQUOTED(_ELIX_LEVEL,${newlib_elix_level})
fi
2019-10-08 03:29:33 +08:00
if test "${newlib_reent_check_verify}" = "yes"; then
AC_DEFINE_UNQUOTED(_REENT_CHECK_VERIFY)
fi
2007-05-12 04:09:00 +08:00
if test "${newlib_io_c99_formats}" = "yes"; then
AC_DEFINE_UNQUOTED(_WANT_IO_C99_FORMATS)
fi
2010-06-09 02:44:14 +08:00
if test "${newlib_register_fini}" = "yes"; then
AC_DEFINE_UNQUOTED(_WANT_REGISTER_FINI)
fi
2004-05-26 08:19:14 +08:00
if test "${newlib_io_long_long}" = "yes"; then
AC_DEFINE_UNQUOTED(_WANT_IO_LONG_LONG)
fi
if test "${newlib_io_long_double}" = "yes"; then
AC_DEFINE_UNQUOTED(_WANT_IO_LONG_DOUBLE)
fi
if test "${newlib_io_pos_args}" = "yes"; then
AC_DEFINE_UNQUOTED(_WANT_IO_POS_ARGS)
fi
2007-03-16 05:32:13 +08:00
if test "${newlib_reent_small}" = "yes"; then
AC_DEFINE_UNQUOTED(_WANT_REENT_SMALL)
fi
2017-06-29 13:28:08 +08:00
if test "${newlib_global_stdio_streams}" = "yes"; then
AC_DEFINE_UNQUOTED(_WANT_REENT_GLOBAL_STDIO_STREAMS)
fi
2002-09-12 02:36:55 +08:00
if test "${newlib_mb}" = "yes"; then
2004-04-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* configure.in: Define _MB_CAPABLE if mb supported.
* configure: Regenerated.
* configure.host: Remove manual setting of MB_CAPABLE compiler
flag.
* newlib.hin: Add _MB_CAPABLE flag.
* libc/ctype/iswalpha.c, libc/ctype/iswblank.c: Include <newlib.h>
and check for _MB_CAPABLE flag instead of MB_CAPABLE.
* libc/ctype/iswcntrl.c, libc/ctype/iswprint.c: Ditto.
* libc/ctype/iswpunct.c, libc/ctype/iswspace.c: Ditto.
* libc/ctype/jp2uc.c: Ditto.
* libc/ctype/towlower.c, libc/ctype/towupper.c: Ditto.
* libc/locale/locale.c: Ditto
* libc/machine/powerpc/vfscanf.c: Ditto
* libc/stdio/vfprintf.c, libc/stdio/vfscanf.c: Ditto
* libc/stdlib/mblen.c: Ditto
* libc/stdlib/mblen_r.c, libc/stdlib/mbrlen.c: Ditto
* libc/stdlib/mbrtowc.c, libc/stdlib/mbsrtowcs.c: Ditto
* libc/stdlib/mbstowcs.c, libc/stdlib/mbtowc.c: Ditto
* libc/stdlib/mbtowc_r.c, libc/stdlib/wcrtomb.c: Ditto
* libc/stdlib/wcsrtombs.c, libc/stdlib/wcstombs.c: Ditto
* libc/stdlib/wctomb.c, libc/sys/linux/intl/dcigettext.c: Ditto
* libc/sys/linux/intl/explodename.c: Ditto
* libc/sys/linux/intl/finddomain.c: Ditto
* libc/sys/linux/intl/l10nflist.c: Ditto
* libc/sys/linux/intl/loadmsgcat.c: Ditto
* libc/sys/linux/intl/localealias.c: Ditto
2004-04-24 05:44:22 +08:00
AC_DEFINE_UNQUOTED(_MB_CAPABLE)
2002-09-12 02:36:55 +08:00
AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8)
2004-01-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* acinclude.m4 (--enable-newlib-iconv): New configuration option.
(--enable-newlib-builtin-converters): Ditto.
* configure.in: Add code to set _ICONV_ENABLED flag.
Set _MB_LEN_MAX to 1 if not mb enabled.
* configure: Regenerated.
* aclocal.m4: Ditto.
* Makefile.in: Ditto.
* newlib.hin: Add _ICONV_ENABLED flag.
* libc/Makefile.am: Add support for iconv.
* libc/configure.in: Ditto.
* libc/Makefile.in: Regenerated.
* libc/aclocal.m4: Ditto.
* libc/configure: Ditto.
* libc/libc.texinfo: Add iconv documentation.
* libc/iconv/AUTHORS, libc/iconv/COPYING, libc/iconv/Makefile.am,
libc/iconv/Makefile.in, libc/iconv/README.ORIGINAL,
libc/iconv/README.TODO, libc/iconv/charset.aliases,
libc/iconv/iconv.tex, libc/iconv/ccs/Makefile.am,
libc/iconv/ccs/Makefile.in, libc/iconv/ccs/README.CCS.SOURCES,
libc/iconv/ccs/big5.c, libc/iconv/ccs/cns11643_plane1.c,
libc/iconv/ccs/cns11643_plane14.c, libc/iconv/ccs/cns11643_plane2.c,
libc/iconv/ccs/cp775.c, libc/iconv/ccs/cp850.c,
libc/iconv/ccs/cp852.c, libc/iconv/ccs/cp855.c,
libc/iconv/ccs/cp866.c, libc/iconv/ccs/gb_2312_80.c,
libc/iconv/ccs/iconv_mktbl, libc/iconv/ccs/iso_8859_1.c,
libc/iconv/ccs/iso_8859_15.c, libc/iconv/ccs/iso_8859_2.c,
libc/iconv/ccs/iso_8859_4.c, libc/iconv/ccs/iso_8859_5.c,
libc/iconv/ccs/jis_x0201.c, libc/iconv/ccs/jis_x0208_1983.c,
libc/iconv/ccs/jis_x0212_1990.c, libc/iconv/ccs/koi8_r.c,
libc/iconv/ccs/koi8_u.c, libc/iconv/ccs/ksx1001.c,
libc/iconv/ccs/shift_jis.c, libc/iconv/ccs/us_ascii.c,
libc/iconv/ccs/binary/Makefile.am, libc/iconv/ccs/binary/Makefile.in,
libc/iconv/ccs/binary/big5.cct,
libc/iconv/ccs/binary/cns11643_plane1.cct,
libc/iconv/ccs/binary/cns11643_plane14.cct,
libc/iconv/ccs/binary/cns11643_plane2.cct,
libc/iconv/ccs/binary/cp775.cct, libc/iconv/ccs/binary/cp850.cct,
libc/iconv/ccs/binary/cp852.cct, libc/iconv/ccs/binary/cp855.cct,
libc/iconv/ccs/binary/cp866.cct, libc/iconv/ccs/binary/gb_2312_80.cct,
libc/iconv/ccs/binary/iso_8859_1.cct,
libc/iconv/ccs/binary/iso_8859_15.cct,
libc/iconv/ccs/binary/iso_8859_2.cct,
libc/iconv/ccs/binary/iso_8859_4.cct,
libc/iconv/ccs/binary/iso_8859_5.cct,
libc/iconv/ccs/binary/jis_x0201.cct,
libc/iconv/ccs/binary/jis_x0208_1983.cct,
libc/iconv/ccs/binary/jis_x0212_1990.cct,
libc/iconv/ccs/binary/koi8_r.cct, libc/iconv/ccs/binary/koi8_u.cct,
libc/iconv/ccs/binary/ksx1001.cct,
libc/iconv/ccs/binary/shift_jis.cct,
libc/iconv/ccs/binary/us_ascii.cct,
libc/iconv/ces/Makefile.am, libc/iconv/ces/Makefile.in,
libc/iconv/ces/euc-jp.c, libc/iconv/ces/euc-kr.c,
libc/iconv/ces/euc-tw.c, libc/iconv/ces/gb2312.c,
libc/iconv/ces/iso-10646-ucs-2.c, libc/iconv/ces/iso-10646-ucs-4.c,
libc/iconv/ces/ucs-2-internal.c, libc/iconv/ces/ucs-4-internal.c,
libc/iconv/ces/utf-16.c, libc/iconv/ces/utf-8.c,
libc/iconv/lib/Makefile.am, libc/iconv/lib/Makefile.in,
libc/iconv/lib/aliases.c, libc/iconv/lib/bialiasesi.c,
libc/iconv/lib/biccs.c, libc/iconv/lib/bices.c,
libc/iconv/lib/ccs.c, libc/iconv/lib/ces.c,
libc/iconv/lib/ces_euc.c, libc/iconv/lib/ces_iso2022.c,
libc/iconv/lib/ces_table.c, libc/iconv/lib/converter.c,
libc/iconv/lib/deps.h, libc/iconv/lib/endian.h,
libc/iconv/lib/iconv.c, libc/iconv/lib/loaddata.c,
libc/iconv/lib/local.h, libc/include/iconv.h: New files.
* libc/sys/linux/include/iconv.h: Ditto.
* libc/include/sys/_types.h (_iconv_t): Added.
* doc/aclocal.m4: Regenerated.
* doc/configure: Ditto.
* doc/Makefile.in: Ditto.
* iconvdata/Makefile.in: Ditto.
* iconvdata/aclocal.m4: Ditto.
* iconvdata/configure: Ditto.
* libc/*aclocal.m4: Ditto.
* libc/*Makefile.in: Ditto.
* libc/*configure: Ditto.
* libm/*aclocal.m4: Ditto.
* libm/*Makefile.in: Ditto.
* libm/*configure: Ditto.
2004-01-24 05:37:46 +08:00
else
AC_DEFINE_UNQUOTED(_MB_LEN_MAX,1)
fi
2004-06-26 04:33:28 +08:00
if test "${newlib_iconv_external_ccs}" = "yes"; then
AC_DEFINE_UNQUOTED(_ICONV_ENABLE_EXTERNAL_CCS)
fi
Define the newlib version macros in one place: _newlib_version.h.
Currently, the newlib version information needs to be updated in two places:
- newlib/acinclude.m4
- newlib/libc/include/sys/features.h
The goal of this patch is to:
- supply a single location for defining the newlib version
information: newlib/acinclude.m4
- define __NEWLIB__, __NEWLIB_MINOR__ and __NEWLIB_PATCHLEVEL__
This is in line with what gcc does for its version macros. See:
https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
This patch moves the definition of the _NEWLIB_VERSION, __NEWLIB__
and __NEWLIB_MINOR__ macros from newlib/libc/include/sys/features.h,
to the newly generated newlib/_newlib_version.h file. Additionally,
the __NEWLIB_PATCHLEVEL__ macro was created, for completeness.
In order to stay backwards compatible, newlib/_newlib_version.h gets
included by newlib/newlib.h and newlib/libc/include/sys/features.h.
Note: This patch does _not_ include the modifications to the following
files, as these should all be generated any way.
*Makefile.in,
*aclocal.m4,
*configure
stamp-* files
Signed-off-by: Pieter du Preez <pdupreez@gmail.com>
2016-02-14 18:12:06 +08:00
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.")
2002-04-26 02:12:38 +08:00
2000-02-18 03:39:52 +08:00
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"
else
multilib_arg=
fi
2004-01-30 01:12:36 +08:00
if test "${newlib_iconv}" = "yes"; then
AC_DEFINE_UNQUOTED(_ICONV_ENABLED,1)
fi
2004-06-26 04:33:28 +08:00
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)
fi
2006-04-12 03:02:16 +08:00
if test "${newlib_atexit_dynamic_alloc}" = "yes"; then
AC_DEFINE_UNQUOTED(_ATEXIT_DYNAMIC_ALLOC)
fi
2013-05-29 20:37:59 +08:00
2013-10-18 16:43:05 +08:00
if test "${newlib_global_atexit}" = "yes"; then
AC_DEFINE_UNQUOTED(_REENT_GLOBAL_ATEXIT)
fi
2013-03-27 17:38:39 +08:00
if test "${newlib_fvwrite_in_streamio}" = "yes"; then
AC_DEFINE_UNQUOTED(_FVWRITE_IN_STREAMIO)
fi
2013-05-29 20:37:59 +08:00
2013-04-11 02:47:46 +08:00
if test "${newlib_fseek_optimization}" = "yes"; then
AC_DEFINE_UNQUOTED(_FSEEK_OPTIMIZATION)
fi
2013-05-29 20:37:59 +08:00
2013-04-12 20:05:31 +08:00
if test "${newlib_wide_orient}" = "yes"; then
AC_DEFINE_UNQUOTED(_WIDE_ORIENT)
fi
2006-04-12 03:02:16 +08:00
2013-05-29 20:37:59 +08:00
if test "${newlib_nano_malloc}" = "yes"; then
AC_DEFINE_UNQUOTED(_NANO_MALLOC)
fi
2013-06-19 23:58:50 +08:00
if test "${newlib_unbuf_stream_opt}" = "yes"; then
AC_DEFINE_UNQUOTED(_UNBUF_STREAM_OPT)
fi
2013-07-03 05:30:57 +08:00
if test "${lite_exit}" = "yes"; then
AC_DEFINE_UNQUOTED(_LITE_EXIT)
fi
2014-07-04 Bin Cheng <bin.cheng@arm.com>
* README (--enable-newlib-nano-formatted-io): Describe.
* acconfig.h (_NANO_FORMATTED_IO): Undef.
* newlib.hin (_NANO_FORMATTED_IO): Undef.
* configure.in (--enable-newlib-nano-formatted-io): New option.
* configure: Regenerated.
* libc/configure.in (--enable-newlib-nano-formatted-io): New option.
* libc/configure: Regenerated.
* libc/stdio/Makefile.am (NEWLIB_NANO_FORMATTED_IO): Support new
configuration option.
* libc/stdio/Makefile.in: Regenerated.
* libc/stdio/asnprintf.c (_asniprintf_r, asniprintf): Use
_NANO_FORMATTED_IO to declare alias prototypes.
* libc/stdio/asprintf.c (_asiprintf_r, asiprintf): Ditto.
* libc/stdio/dprintf.c (_diprintf_r, diprintf): Ditto.
* libc/stdio/fprintf.c (_fiprintf_r, fiprintf): Ditto.
* libc/stdio/fscanf.c (fiscanf, _fiscanf_r): Ditto.
* libc/stdio/printf.c (_iprintf_r, iprintf): Ditto.
* libc/stdio/scanf.c (iscanf, _iscanf_r): Ditto.
* libc/stdio/snprintf.c (_sniprintf_r, sniprintf): Ditto.
* libc/stdio/sprintf.c (_siprintf_r, siprintf): Ditto.
* libc/stdio/sscanf.c (siscanf, _siscanf_r): Ditto.
* libc/stdio/vasnprintf.c (_vasniprintf_r, vasniprintf): Ditto.
* libc/stdio/vasprintf.c (vasiprintf, _vasiprintf_r): Ditto.
* libc/stdio/vdprintf.c (_vdiprintf_r, vdiprintf): Ditto.
* libc/stdio/vprintf.c (viprintf, _viprintf_r): Ditto.
* libc/stdio/vscanf.c (viscanf, _viscanf_r): Ditto.
* libc/stdio/vsnprintf.c (vsniprintf, _vsniprintf_r): Ditto.
* libc/stdio/vsprintf.c (vsiprintf, _vsiprintf_r): Ditto.
* libc/stdio/vsscanf.c (vsiscanf, _vsiscanf_r): Ditto.
* libc/stdio/nano-vfprintf.c: New file.
* libc/stdio/nano-vfprintf_float.c: New file.
* libc/stdio/nano-vfprintf_i.c: New file.
* libc/stdio/nano-vfprintf_local.h: New file.
* libc/stdio/nano-vfscanf.c: New file.
* libc/stdio/nano-vfscanf_float.c: New file.
* libc/stdio/nano-vfscanf_i.c: New file.
* libc/stdio/nano-vfscanf_local.h: New file.
2014-07-05 01:21:45 +08:00
if test "${newlib_nano_formatted_io}" = "yes"; then
AC_DEFINE_UNQUOTED(_NANO_FORMATTED_IO)
fi
2016-10-26 00:38:19 +08:00
if test "${newlib_retargetable_locking}" = "yes"; then
AC_DEFINE_UNQUOTED(_RETARGETABLE_LOCKING)
fi
2017-09-07 14:24:22 +08:00
if test "${newlib_long_time_t}" = "yes"; then
AC_DEFINE_UNQUOTED(_WANT_USE_LONG_TIME_T)
fi
2004-06-26 04:33:28 +08:00
dnl
dnl Parse --enable-newlib-iconv-encodings option argument
dnl
2006-04-12 03:02:16 +08:00
2004-06-26 04:33:28 +08:00
if test "x${iconv_encodings}" != "x" \
|| test "x${iconv_to_encodings}" != "x" \
|| test "x${iconv_from_encodings}" != "x"; then
if test "x${newlib_iconv}" = "x"; then
2006-04-12 03:02:16 +08:00
AC_MSG_ERROR([--enable-newlib-iconv-encodings, --enable-newlib-iconv-from-encodings and --enable-newlib-iconv-to-encodings option can't be used if iconv library is disabled, use --enable-newlib-iconv to enable it.])
2004-01-30 01:12:36 +08:00
fi
2004-06-26 04:33:28 +08:00
dnl Normalize encodings names and delete commas
iconv_encodings=`echo "${iconv_encodings}" | sed -e 's/,/ /g' -e 's/-/_/g' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
iconv_to_encodings=`echo "${iconv_to_encodings}" | sed -e 's/,/ /g' -e 's/-/_/g' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
iconv_from_encodings=`echo "${iconv_from_encodings}" | sed -e 's/,/ /g' -e 's/-/_/g' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
dnl Get the list of available encodings excluding comments
2004-01-30 01:12:36 +08:00
dnl Join line with previous if the first character is whitespace
2004-06-26 04:33:28 +08:00
available_encodings=`cat "${srcdir}/libc/iconv/encoding.aliases" | sed -e '/^#.*/d'`
dnl Check if required encodings are supported
dnl Convert aliases to names
dnl iconv_encodings
iconv_encodings1="${iconv_encodings}"
iconv_encodings=""
for encoding in ${iconv_encodings1}; do
result=`echo "${available_encodings}" | grep -e "\(^\| \)${encoding}\( \|\$\)"`
if test $? != "0"; then
2007-05-12 04:09:00 +08:00
AC_MSG_ERROR(${encoding} is not supported - see ${srcdir}/libc/iconv/encoding.aliases file for the list of available encodings)
2004-06-26 04:33:28 +08:00
fi
encoding1=`echo "${result}" | sed -e 's/\(^[[^ ]]*\).*$/\1/'`
iconv_encodings="${iconv_encodings} ${encoding1}"
done
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)
opt=_ICONV_FROM_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
AC_DEFINE_UNQUOTED($opt,1)
done
dnl iconv_to_encodings
iconv_encodings1="${iconv_to_encodings}"
iconv_to_encodings=""
for encoding in ${iconv_encodings1}; do
result=`echo "${available_encodings}" | grep -e "\(^\| \)${encoding}\( \|\$\)"`
2004-01-30 01:12:36 +08:00
if test $? != "0"; then
2007-05-12 04:09:00 +08:00
AC_MSG_ERROR(${encoding} is not supported - see ${srcdir}/libc/iconv/encoding.aliases file for the list of available encodings)
2004-01-30 01:12:36 +08:00
fi
2004-06-26 04:33:28 +08:00
encoding1=`echo "${result}" | sed -e 's/\(^[[^ ]]*\).*$/\1/'`
iconv_to_encodings="${iconv_to_encodings} ${encoding1}"
done
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)
2004-01-30 01:12:36 +08:00
done
2004-06-26 04:33:28 +08:00
dnl iconv_from_encodings
iconv_encodings1="${iconv_from_encodings}"
iconv_from_encodings=""
for encoding in ${iconv_encodings1}; do
result=`echo "${available_encodings}" | grep -e "\(^\| \)${encoding}\( \|\$\)"`
if test $? != "0"; then
2007-05-12 04:09:00 +08:00
AC_MSG_ERROR(${encoding} is not supported - see ${srcdir}/libc/iconv/encoding.aliases file for the list of available encodings)
2004-06-26 04:33:28 +08:00
fi
encoding1=`echo "${result}" | sed -e 's/\(^[[^ ]]*\).*$/\1/'`
iconv_from_encodings="${iconv_from_encodings} ${encoding1}"
done
2004-01-30 01:12:36 +08:00
dnl Enable appropriate option in newlib.h
2004-06-26 04:33:28 +08:00
for encoding in ${iconv_from_encodings}; do
opt=_ICONV_FROM_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2004-01-30 01:12:36 +08:00
AC_DEFINE_UNQUOTED($opt,1)
done
fi;
2000-02-18 03:39:52 +08:00
2005-01-08 02:04:39 +08:00
AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
libc_cv_initfinit_array, [dnl
cat > conftest.c <<EOF
int _start (void) { return 0; }
int __start (void) { return 0; }
int foo (void) { return 1; }
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
EOF
2009-05-16 00:15:57 +08:00
if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest conftest.c
1>&AS_MESSAGE_LOG_FD])
2005-01-08 02:04:39 +08:00
then
2006-08-01 07:01:28 +08:00
if ${READELF} -S conftest | grep -e INIT_ARRAY > /dev/null; then
2005-01-08 02:04:39 +08:00
libc_cv_initfinit_array=yes
else
libc_cv_initfinit_array=no
fi
else
libc_cv_initfinit_array=no
fi
rm -f conftest*])
AC_SUBST(libc_cv_initfinit_array)
if test $libc_cv_initfinit_array = yes; then
AC_DEFINE_UNQUOTED(HAVE_INITFINI_ARRAY)
fi
2013-12-11 02:57:30 +08:00
AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \
__attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl
cat > conftest.c <<EOF
void
__attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
foo (void) {}
EOF
libc_cv_cc_loop_to_function=no
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c
-fno-tree-loop-distribute-patterns conftest.c])
then
libc_cv_cc_loop_to_function=yes
fi
rm -f conftest*])
if test $libc_cv_cc_loop_to_function = yes; then
AC_DEFINE(_HAVE_CC_INHIBIT_LOOP_TO_LIBCALL)
fi
AC_SUBST(libc_cv_cc_loop_to_function)
2009-05-16 00:15:57 +08:00
dnl Autoconf 2.59 doesn't support the AC_TYPE_LONG_DOUBLE macro. Instead of:
dnl AC_TYPE_LONG_DOUBLE
dnl AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" = x"yes")
dnl we specify our own long double test.
dnl Additionally, ac_cv_objext is broken so that AC_COMPILE_IFELSE cannot be
dnl used, so use AC_TRY_COMMAND instead.
AC_CACHE_CHECK(whether long double type exists,
acnewlib_cv_type_long_double, [dnl
cat > conftest.c <<EOF
/* Check two ways: float.h defines and direct type declaration. */
#include <float.h>
#if defined(LDBL_MANT_DIG)
#define _HAVE_LONG_DOUBLE
#else
#error "LDBL != DBL"
#endif
long double test() {
long double ld = 0.0L;
return ld;
}
EOF
if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c
1>&AS_MESSAGE_LOG_FD])
then
acnewlib_cv_type_long_double=yes;
else
acnewlib_cv_type_long_double=no;
fi
rm -f conftest*])
if test $acnewlib_cv_type_long_double = yes; then
AC_DEFINE_UNQUOTED(_HAVE_LONG_DOUBLE)
fi
AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$acnewlib_cv_type_long_double" = x"yes")
AC_CACHE_CHECK(whether long double equals double,
2009-08-20 03:56:05 +08:00
newlib_cv_ldbl_eq_dbl, [dnl
2009-04-25 06:49:55 +08:00
cat > conftest.c <<EOF
#include <float.h>
#if DBL_MANT_DIG == LDBL_MANT_DIG && LDBL_MIN_EXP == DBL_MIN_EXP && \
LDBL_MAX_EXP == DBL_MAX_EXP
#define _LDBL_EQ_DBL
#else
#error "LDBL != DBL"
#endif
EOF
2009-05-16 00:15:57 +08:00
if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c
1>&AS_MESSAGE_LOG_FD])
2009-04-25 06:49:55 +08:00
then
2009-08-20 03:56:05 +08:00
newlib_cv_ldbl_eq_dbl=yes;
2009-04-25 06:49:55 +08:00
else
2009-08-20 03:56:05 +08:00
newlib_cv_ldbl_eq_dbl=no;
2009-04-25 06:49:55 +08:00
fi
rm -f conftest*])
2009-08-20 03:56:05 +08:00
if test $newlib_cv_ldbl_eq_dbl = yes; then
2009-04-25 06:49:55 +08:00
AC_DEFINE_UNQUOTED(_LDBL_EQ_DBL)
fi
2009-10-21 06:44:28 +08:00
AC_SUBST(CFLAGS)
2006-04-14 03:56:32 +08:00
AC_CONFIG_FILES([Makefile],
2000-02-18 03:39:52 +08:00
[if test -n "$CONFIG_FILES"; then
2002-08-28 04:27:35 +08:00
unset ac_file
2000-02-18 03:39:52 +08:00
. ${newlib_basedir}/../config-ml.in
fi],
srcdir=${srcdir}
host=${host}
with_multisubdir=${with_multisubdir}
ac_configure_args="${multilib_arg} ${ac_configure_args}"
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
newlib_basedir=${newlib_basedir}
CC="${CC}"
2001-12-14 07:50:11 +08:00
LDFLAGS="${LDFLAGS}"
2000-02-18 03:39:52 +08:00
)
2006-04-14 03:56:32 +08:00
AC_OUTPUT