2000-02-18 03:39:52 +08:00
|
|
|
dnl This provides configure definitions used by all the newlib
|
|
|
|
dnl configure.in files.
|
|
|
|
|
2020-11-18 05:47:35 +08:00
|
|
|
AC_DEFUN([DEF_NEWLIB_MAJOR_VERSION],m4_define([NEWLIB_MAJOR_VERSION],[4]))
|
2024-01-01 01:00:18 +08:00
|
|
|
AC_DEFUN([DEF_NEWLIB_MINOR_VERSION],m4_define([NEWLIB_MINOR_VERSION],[4]))
|
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_DEFUN([DEF_NEWLIB_PATCHLEVEL_VERSION],m4_define([NEWLIB_PATCHLEVEL_VERSION],[0]))
|
|
|
|
AC_DEFUN([DEF_NEWLIB_VERSION],m4_define([NEWLIB_VERSION],[NEWLIB_MAJOR_VERSION.NEWLIB_MINOR_VERSION.NEWLIB_PATCHLEVEL_VERSION]))
|
2006-04-14 03:56:32 +08:00
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
dnl Basic newlib configury. This calls basic introductory stuff,
|
|
|
|
dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs
|
|
|
|
dnl configure.host. The only argument is the relative path to the top
|
|
|
|
dnl newlib directory.
|
|
|
|
|
2006-04-12 03:02:16 +08:00
|
|
|
AC_DEFUN([NEWLIB_CONFIGURE],
|
2006-05-11 23:49:52 +08:00
|
|
|
[AC_REQUIRE([DEF_NEWLIB_VERSION])
|
2000-02-18 03:39:52 +08:00
|
|
|
dnl Support --enable-target-optspace
|
|
|
|
AC_ARG_ENABLE(target-optspace,
|
|
|
|
[ --enable-target-optspace optimize for space],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) target_optspace=yes ;;
|
|
|
|
no) target_optspace=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
|
|
|
|
esac], [target_optspace=])dnl
|
|
|
|
|
2001-04-21 09:17:33 +08:00
|
|
|
dnl Support --enable-malloc-debugging - currently only supported for Cygwin
|
|
|
|
AC_ARG_ENABLE(malloc-debugging,
|
|
|
|
[ --enable-malloc-debugging indicate malloc debugging requested],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) malloc_debugging=yes ;;
|
|
|
|
no) malloc_debugging=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;;
|
|
|
|
esac], [malloc_debugging=])dnl
|
|
|
|
|
2002-05-09 04:35:16 +08:00
|
|
|
dnl Support --enable-newlib-multithread
|
|
|
|
AC_ARG_ENABLE(newlib-multithread,
|
|
|
|
[ --enable-newlib-multithread enable support for multiple threads],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) newlib_multithread=yes ;;
|
|
|
|
no) newlib_multithread=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;;
|
|
|
|
esac], [newlib_multithread=yes])dnl
|
|
|
|
|
2004-06-30 05:53:35 +08:00
|
|
|
dnl Support --enable-newlib-iconv
|
|
|
|
AC_ARG_ENABLE(newlib-iconv,
|
|
|
|
[ --enable-newlib-iconv enable iconv library support],
|
|
|
|
[if test "${newlib_iconv+set}" != set; then
|
|
|
|
case "${enableval}" in
|
|
|
|
yes) newlib_iconv=yes ;;
|
|
|
|
no) newlib_iconv=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for newlib-iconv option) ;;
|
|
|
|
esac
|
|
|
|
fi], [newlib_iconv=${newlib_iconv}])dnl
|
|
|
|
|
2002-08-27 02:56:09 +08:00
|
|
|
dnl Support --enable-newlib-elix-level
|
|
|
|
AC_ARG_ENABLE(newlib-elix-level,
|
|
|
|
[ --enable-newlib-elix-level supply desired elix library level (1-4)],
|
|
|
|
[case "${enableval}" in
|
|
|
|
0) newlib_elix_level=0 ;;
|
|
|
|
1) newlib_elix_level=1 ;;
|
|
|
|
2) newlib_elix_level=2 ;;
|
|
|
|
3) newlib_elix_level=3 ;;
|
|
|
|
4) newlib_elix_level=4 ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for newlib-elix-level option) ;;
|
|
|
|
esac], [newlib_elix_level=0])dnl
|
|
|
|
|
2002-02-28 07:56:24 +08:00
|
|
|
dnl Support --disable-newlib-io-float
|
|
|
|
AC_ARG_ENABLE(newlib-io-float,
|
|
|
|
[ --disable-newlib-io-float disable printf/scanf family float support],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) newlib_io_float=yes ;;
|
|
|
|
no) newlib_io_float=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;;
|
|
|
|
esac], [newlib_io_float=yes])dnl
|
|
|
|
|
2003-02-08 12:30:58 +08:00
|
|
|
dnl Support --disable-newlib-supplied-syscalls
|
|
|
|
AC_ARG_ENABLE(newlib-supplied-syscalls,
|
|
|
|
[ --disable-newlib-supplied-syscalls disable newlib from supplying syscalls],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) newlib_may_supply_syscalls=yes ;;
|
|
|
|
no) newlib_may_supply_syscalls=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;;
|
|
|
|
esac], [newlib_may_supply_syscalls=yes])dnl
|
|
|
|
|
|
|
|
AM_CONDITIONAL(MAY_SUPPLY_SYSCALLS, test x[$]{newlib_may_supply_syscalls} = xyes)
|
2002-02-28 07:56:24 +08:00
|
|
|
|
2018-09-01 00:44:33 +08:00
|
|
|
dnl Support --disable-newlib-fno-builtin
|
|
|
|
AC_ARG_ENABLE(newlib-fno-builtin,
|
|
|
|
[ --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) newlib_fno_builtin=yes ;;
|
|
|
|
no) newlib_fno_builtin=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for newlib-fno-builtin option) ;;
|
|
|
|
esac], [newlib_fno_builtin=])dnl
|
|
|
|
|
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
dnl We may get other options which we don't document:
|
|
|
|
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
|
|
|
|
|
|
|
|
test -z "[$]{with_target_subdir}" && with_target_subdir=.
|
|
|
|
|
|
|
|
if test "[$]{srcdir}" = "."; then
|
|
|
|
if test "[$]{with_target_subdir}" != "."; then
|
|
|
|
newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
|
|
|
|
else
|
|
|
|
newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
newlib_basedir="[$]{srcdir}/$1"
|
|
|
|
fi
|
|
|
|
AC_SUBST(newlib_basedir)
|
|
|
|
|
2022-01-28 08:17:04 +08:00
|
|
|
abs_newlib_basedir=`cd "${newlib_basedir}" && pwd`
|
|
|
|
AC_SUBST(abs_newlib_basedir)
|
|
|
|
|
2006-04-14 03:56:32 +08:00
|
|
|
AC_CANONICAL_HOST
|
2000-02-18 03:39:52 +08:00
|
|
|
|
2022-03-01 12:36:27 +08:00
|
|
|
AM_INIT_AUTOMAKE([foreign no-installinfo no-dist no-define subdir-objects 1.15.1])
|
2022-03-01 12:32:12 +08:00
|
|
|
AM_MAINTAINER_MODE
|
2021-12-31 03:03:30 +08:00
|
|
|
AM_SILENT_RULES(yes)
|
2000-02-18 03:39:52 +08:00
|
|
|
|
2022-02-05 14:05:06 +08:00
|
|
|
AC_NO_EXECUTABLES
|
|
|
|
|
2022-02-05 14:14:50 +08:00
|
|
|
AC_REQUIRE([AC_PROG_CC])dnl
|
2022-02-05 14:05:06 +08:00
|
|
|
AC_REQUIRE([AC_PROG_CPP])dnl
|
2022-02-05 14:43:41 +08:00
|
|
|
AC_REQUIRE([AM_PROG_AS])dnl
|
2022-01-29 15:41:03 +08:00
|
|
|
AC_REQUIRE([AM_PROG_AR])dnl
|
2022-02-05 15:22:54 +08:00
|
|
|
AC_PROG_RANLIB
|
2006-08-01 07:01:28 +08:00
|
|
|
AC_CHECK_TOOL(READELF, readelf, :)
|
2000-02-18 03:39:52 +08:00
|
|
|
|
2022-01-18 02:14:06 +08:00
|
|
|
dnl We need these programs, but so does Automake. Require the macros to avoid
|
|
|
|
dnl expanding them multiple times.
|
|
|
|
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_AWK])dnl
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
. [$]{newlib_basedir}/configure.host
|
|
|
|
|
|
|
|
NEWLIB_CFLAGS=${newlib_cflags}
|
|
|
|
AC_SUBST(NEWLIB_CFLAGS)
|
|
|
|
|
2011-01-13 06:24:06 +08:00
|
|
|
NO_INCLUDE_LIST=${noinclude}
|
|
|
|
AC_SUBST(NO_INCLUDE_LIST)
|
|
|
|
|
2002-08-27 02:56:09 +08:00
|
|
|
AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} = x0)
|
|
|
|
AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} = x1)
|
|
|
|
AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} = x2)
|
|
|
|
AM_CONDITIONAL(ELIX_LEVEL_3, test x[$]{newlib_elix_level} = x3)
|
|
|
|
AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4)
|
|
|
|
|
2018-04-14 03:42:37 +08:00
|
|
|
# Emit any target-specific warnings.
|
|
|
|
if test "x${newlib_msg_warn}" != "x"; then
|
|
|
|
AC_MSG_WARN([${newlib_msg_warn}])
|
|
|
|
fi
|
|
|
|
|
2002-06-08 05:59:57 +08:00
|
|
|
# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we
|
|
|
|
# use oext, which is set in configure.host based on the target platform.
|
2022-02-07 18:25:19 +08:00
|
|
|
OBJEXT=o
|
2002-06-08 05:59:57 +08:00
|
|
|
|
|
|
|
AC_SUBST(OBJEXT)
|
2006-04-12 03:02:16 +08:00
|
|
|
AC_SUBST(lpfx)
|
2001-12-14 07:50:11 +08:00
|
|
|
|
|
|
|
AC_SUBST(libm_machine_dir)
|
2000-02-18 03:39:52 +08:00
|
|
|
AC_SUBST(machine_dir)
|
2021-03-24 17:32:50 +08:00
|
|
|
AC_SUBST(shared_machine_dir)
|
2000-02-18 03:39:52 +08:00
|
|
|
AC_SUBST(sys_dir)
|
|
|
|
])
|