From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id E28943858015 for ; Tue, 18 Jan 2022 04:48:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E28943858015 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 3D441342DA8; Tue, 18 Jan 2022 04:48:45 +0000 (UTC) From: Mike Frysinger 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 Message-Id: <20220118044741.21027-6-vapier@gentoo.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220118044741.21027-1-vapier@gentoo.org> References: <20220118044741.21027-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2022 04:48:47 -0000 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