From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id C41EF3858D35; Thu, 20 Jan 2022 01:57:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C41EF3858D35 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Frysinger To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib: move version defines out of the config headers X-Act-Checkin: newlib-cygwin X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: 850e08fedbc6fcd15b6db3ea44aaeafb14fb5490 X-Git-Newrev: 21fb1b461c29b61faf199ec2362ff9a53d6f01e6 Message-Id: <20220120015734.C41EF3858D35@sourceware.org> Date: Thu, 20 Jan 2022 01:57:34 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2022 01:57:34 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D21fb1b461c2= 9b61faf199ec2362ff9a53d6f01e6 commit 21fb1b461c29b61faf199ec2362ff9a53d6f01e6 Author: Mike Frysinger Date: Mon Jan 17 21:17:54 2022 -0500 newlib: move version defines out of the config headers =20 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. Diff: --- newlib/Makefile.in | 4 ++++ newlib/_newlib_version.hin | 16 +++++++++++----- newlib/configure | 16 ++++++---------- newlib/configure.ac | 10 ++++++---- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/newlib/Makefile.in b/newlib/Makefile.in index 1af918059..267db9019 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -315,6 +315,10 @@ MAINT =3D @MAINT@ MAKEINFO =3D @MAKEINFO@ MKDIR_P =3D @MKDIR_P@ NEWLIB_CFLAGS =3D @NEWLIB_CFLAGS@ +NEWLIB_MAJOR_VERSION =3D @NEWLIB_MAJOR_VERSION@ +NEWLIB_MINOR_VERSION =3D @NEWLIB_MINOR_VERSION@ +NEWLIB_PATCHLEVEL_VERSION =3D @NEWLIB_PATCHLEVEL_VERSION@ +NEWLIB_VERSION =3D @NEWLIB_VERSION@ NM =3D @NM@ NMEDIT =3D @NMEDIT@ NO_INCLUDE_LIST =3D @NO_INCLUDE_LIST@ diff --git a/newlib/_newlib_version.hin b/newlib/_newlib_version.hin index 03d4e3d47..077b81ecf 100644 --- a/newlib/_newlib_version.hin +++ b/newlib/_newlib_version.hin @@ -2,10 +2,16 @@ #ifndef _NEWLIB_VERSION_H__ #define _NEWLIB_VERSION_H__ 1 =20 -#undef _NEWLIB_VERSION -#undef __NEWLIB__ -#undef __NEWLIB_MINOR__ -#undef __NEWLIB_PATCHLEVEL__ +/* The newlib version in string format. */ +#define _NEWLIB_VERSION "@NEWLIB_VERSION@" =20 -#endif /* !_NEWLIB_VERSION_H__ */ +/* The newlib major version number. */ +#define __NEWLIB__ @NEWLIB_MAJOR_VERSION@ + +/* The newlib minor version number. */ +#define __NEWLIB_MINOR__ @NEWLIB_MINOR_VERSION@ =20 +/* The newlib patch level. */ +#define __NEWLIB_PATCHLEVEL__ @NEWLIB_PATCHLEVEL_VERSION@ + +#endif /* !_NEWLIB_VERSION_H__ */ diff --git a/newlib/configure b/newlib/configure index 624ec89af..2be0a6c33 100755 --- a/newlib/configure +++ b/newlib/configure @@ -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=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11973 "configure" +#line 11977 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -12076,7 +12080,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12079 "configure" +#line 12083 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -12572,16 +12576,8 @@ _ACEOF =20 =20 =20 -$as_echo "#define _NEWLIB_VERSION \"4.2.0\"" >>confdefs.h =20 =20 -$as_echo "#define __NEWLIB__ 4" >>confdefs.h - - -$as_echo "#define __NEWLIB_MINOR__ 2" >>confdefs.h - - -$as_echo "#define __NEWLIB_PATCHLEVEL__ 0" >>confdefs.h =20 =20 if test "${multilib}" =3D "yes"; then diff --git a/newlib/configure.ac b/newlib/configure.ac index 35d94666a..e1fb2ad0e 100644 --- a/newlib/configure.ac +++ b/newlib/configure.ac @@ -477,10 +477,12 @@ if test "${newlib_mb}" =3D "yes"; then fi AC_DEFINE_UNQUOTED(_MB_LEN_MAX, $_mb_len_max, [Multibyte max length.]) =20 -AC_DEFINE(_NEWLIB_VERSION, "NEWLIB_VERSION", [The newlib version in string= format.]) -AC_DEFINE(__NEWLIB__, NEWLIB_MAJOR_VERSION, [The newlib major version numb= er.]) -AC_DEFINE(__NEWLIB_MINOR__, NEWLIB_MINOR_VERSION, [The newlib minor versio= n number.]) -AC_DEFINE(__NEWLIB_PATCHLEVEL__, NEWLIB_PATCHLEVEL_VERSION, [The newlib pa= tch 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]) =20 if test "${multilib}" =3D "yes"; then multilib_arg=3D"--enable-multilib"