newlib: move version defines out of the config headers

This will make it easier to move newlib.h to use autoheader directly.
We only want the newlib version defines in our hand curated version
file, _newlib_version.h, not in the template header, newlib.h, so
using AC_DEFINE doesn't make much sense.
This commit is contained in:
Mike Frysinger 2022-01-17 21:17:54 -05:00
parent 850e08fedb
commit 21fb1b461c
4 changed files with 27 additions and 19 deletions

View File

@ -315,6 +315,10 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
NEWLIB_MAJOR_VERSION = @NEWLIB_MAJOR_VERSION@
NEWLIB_MINOR_VERSION = @NEWLIB_MINOR_VERSION@
NEWLIB_PATCHLEVEL_VERSION = @NEWLIB_PATCHLEVEL_VERSION@
NEWLIB_VERSION = @NEWLIB_VERSION@
NM = @NM@
NMEDIT = @NMEDIT@
NO_INCLUDE_LIST = @NO_INCLUDE_LIST@

View File

@ -2,10 +2,16 @@
#ifndef _NEWLIB_VERSION_H__
#define _NEWLIB_VERSION_H__ 1
#undef _NEWLIB_VERSION
#undef __NEWLIB__
#undef __NEWLIB_MINOR__
#undef __NEWLIB_PATCHLEVEL__
/* The newlib version in string format. */
#define _NEWLIB_VERSION "@NEWLIB_VERSION@"
/* The newlib major version number. */
#define __NEWLIB__ @NEWLIB_MAJOR_VERSION@
/* The newlib minor version number. */
#define __NEWLIB_MINOR__ @NEWLIB_MINOR_VERSION@
/* The newlib patch level. */
#define __NEWLIB_PATCHLEVEL__ @NEWLIB_PATCHLEVEL_VERSION@
#endif /* !_NEWLIB_VERSION_H__ */

16
newlib/configure vendored
View File

@ -638,6 +638,10 @@ HAVE_LONG_DOUBLE_FALSE
HAVE_LONG_DOUBLE_TRUE
libc_cv_cc_loop_to_function
libc_cv_initfinit_array
NEWLIB_PATCHLEVEL_VERSION
NEWLIB_MINOR_VERSION
NEWLIB_MAJOR_VERSION
NEWLIB_VERSION
EXEEXT_FOR_BUILD
CC_FOR_BUILD
STDIO64_OBJECTLIST
@ -11970,7 +11974,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11973 "configure"
#line 11977 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12076,7 +12080,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12079 "configure"
#line 12083 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12572,16 +12576,8 @@ _ACEOF
$as_echo "#define _NEWLIB_VERSION \"4.2.0\"" >>confdefs.h
$as_echo "#define __NEWLIB__ 4" >>confdefs.h
$as_echo "#define __NEWLIB_MINOR__ 2" >>confdefs.h
$as_echo "#define __NEWLIB_PATCHLEVEL__ 0" >>confdefs.h
if test "${multilib}" = "yes"; then

View File

@ -477,10 +477,12 @@ if test "${newlib_mb}" = "yes"; then
fi
AC_DEFINE_UNQUOTED(_MB_LEN_MAX, $_mb_len_max, [Multibyte max length.])
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.])
dnl These are AC_SUBST instead of AC_DEFINE as they're hand maintained in a
dnl dedicated _newlib_version.h, and we don't want them in newlib.h.
AC_SUBST([NEWLIB_VERSION])
AC_SUBST([NEWLIB_MAJOR_VERSION])
AC_SUBST([NEWLIB_MINOR_VERSION])
AC_SUBST([NEWLIB_PATCHLEVEL_VERSION])
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"