From: Mike Frysinger <vapier@gentoo.org>
To: newlib@sourceware.org
Subject: [PATCH 5/8] newlib: move version defines out of the config headers
Date: Mon, 17 Jan 2022 23:47:38 -0500 [thread overview]
Message-ID: <20220118044741.21027-6-vapier@gentoo.org> (raw)
In-Reply-To: <20220118044741.21027-1-vapier@gentoo.org>
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.
---
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/_newlib_version.hin b/newlib/_newlib_version.hin
index 03d4e3d471ab..077b81ecf058 100644
--- a/newlib/_newlib_version.hin
+++ b/newlib/_newlib_version.hin
@@ -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@"
-#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@
+/* The newlib patch level. */
+#define __NEWLIB_PATCHLEVEL__ @NEWLIB_PATCHLEVEL_VERSION@
+
+#endif /* !_NEWLIB_VERSION_H__ */
diff --git a/newlib/configure.ac b/newlib/configure.ac
index 01fb2caf1eb4..4942aceae7b1 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -479,10 +479,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"
--
2.33.0
next prev parent reply other threads:[~2022-01-18 4:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-18 4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
2022-01-18 4:47 ` [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY Mike Frysinger
[not found] ` <DM3P110MB0522248DFEE102BB37B43A8F9A589@DM3P110MB0522.NAMP110.PROD.OUTLOOK.COM>
2022-01-18 16:10 ` Fw: " C Howland
2022-01-19 0:53 ` Mike Frysinger
2022-01-19 2:39 ` C Howland
2022-01-19 3:44 ` Mike Frysinger
2022-01-19 23:50 ` Mike Frysinger
2022-01-18 4:47 ` [PATCH 2/8] newlib: merge acconfig.h changes into newlib.hin Mike Frysinger
2022-01-18 4:47 ` [PATCH 3/8] newlib: clean up autoheader templates Mike Frysinger
2022-01-18 4:47 ` [PATCH 4/8] newlib: sort newlib.h output Mike Frysinger
2022-01-18 4:47 ` Mike Frysinger [this message]
2022-01-18 4:47 ` [PATCH 6/8] newlib: add missing _NANO_MALLOC to newlib.hin Mike Frysinger
2022-01-18 4:47 ` [PATCH 7/8] newlib: iconv: autogenerate iconv define list Mike Frysinger
2022-01-18 4:47 ` [PATCH 8/8] newlib: switch newlib.h to autoheader Mike Frysinger
2022-01-19 14:51 ` [PATCH 0/8] newlib: convert " Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220118044741.21027-6-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).