From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web10.7848.1681475368443548372 for ; Fri, 14 Apr 2023 05:29:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=asxtzTxD; spf=pass (domain: posteo.de, ip: 185.67.36.65, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 922ED2401A2 for ; Fri, 14 Apr 2023 14:29:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1681475366; bh=XtlRxWKXev+6bDKXMBy0KJ6TwriKNCG0aQU/X2hUxck=; h=From:Subject:Date:Cc:To:From; b=asxtzTxD7F9T/2KOUs4m78dASZcauduYQv1EY7MgFNRGhDrSjLclEToJwlGAu72lr 49/vKhsEVfFPhhX5SbNqYFsZvEYPHDawGRByAvIqk49Eyg5Cnz4pDNMrclho1Nw+Dt 4Gmq+6gtXnrZT0W8zduHIovhBFM3FNJpftRO7emuRjpFT2+/URW0ZwtOTV5q1QIShe vZXEVa67g+9T1KNoQ8+/StbWLUFfZA1XrlpaEn5CMauk+jxRnoAXDh+lR7kfY+41pZ 8C7LHybmtlzyvL3SA1YR2RHwOMgjun1buYl3vipBn7dI6ceIEvfDC6oKwK0mTvWx5c W8HxXufZ4yltg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PybNf3whGz9rxN; Fri, 14 Apr 2023 14:29:22 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v4 01/10] BaseTools: add BASETOOLS define Date: Fri, 14 Apr 2023 12:29:21 +0000 Message-Id: <18EC1A6E-8B81-4564-83A5-DA8EC2BA54ED@posteo.de> References: <20230414080250.1357004-2-kraxel@redhat.com> Cc: devel@edk2.groups.io, Pawel Polawski , Dongyan Qian , Sunil V L , Baoqi Zhang , Chao Li , Rebecca Cran , Ard Biesheuvel , Zhiguang Liu , Liming Gao , Yuwei Chen , Leif Lindholm , Michael D Kinney , Daniel Schaefer , Bob Feng , Oliver Steffen In-Reply-To: <20230414080250.1357004-2-kraxel@redhat.com> To: Gerd Hoffmann Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Gerd, Thanks for your effort! Sorry, but I *really* dislike this =E2=80=9CBASETOOLS=E2=80=9D notion. There= might be external tools that also want to use the header (like we do with A= UDK) and also edk2 supports host-based unit tests. Imo the macro name should= be generic, like =E2=80=9CHOST_OS=E2=80=9D or =E2=80=9CUSERLAND=E2=80=9D or= something (I=E2=80=99m bad with names :) ). Speaking of host-based unit tests, why are they not affected by the issue? Best regards, Marvin > On 14. Apr 2023, at 10:03, Gerd Hoffmann wrote: >=20 > =EF=BB=BFAllows for BaseTools-specific tweaks in include files. >=20 > Signed-off-by: Gerd Hoffmann > --- > BaseTools/Source/C/Makefiles/header.makefile | 3 +++ > BaseTools/Source/C/Makefiles/ms.common | 4 ++-- > BaseTools/Source/C/VfrCompile/GNUmakefile | 1 + > 3 files changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Sour= ce/C/Makefiles/header.makefile > index 1bf003523baf..6b743fa297b0 100644 > --- a/BaseTools/Source/C/Makefiles/header.makefile > +++ b/BaseTools/Source/C/Makefiles/header.makefile > @@ -124,6 +124,9 @@ ifeq ($(DARWIN),Darwin) > endif > endif >=20 > +CFLAGS +=3D -D BASETOOLS=3D1 > +CXXFLAGS +=3D -D BASETOOLS=3D1 > + > # keep BUILD_OPTFLAGS last > CFLAGS +=3D $(BUILD_OPTFLAGS) > CXXFLAGS +=3D $(BUILD_OPTFLAGS) > diff --git a/BaseTools/Source/C/Makefiles/ms.common b/BaseTools/Source/C/M= akefiles/ms.common > index 8391f10d5dd2..6fc4c6477847 100644 > --- a/BaseTools/Source/C/Makefiles/ms.common > +++ b/BaseTools/Source/C/Makefiles/ms.common > @@ -57,5 +57,5 @@ LINKER =3D $(LD) >=20 > INC =3D $(INC) -I . -I $(SOURCE_PATH)\Include -I $(ARCH_INCLUDE) -I $(SOUR= CE_PATH)\Common >=20 > -CFLAGS =3D $(CFLAGS) /nologo /Z7 /c /O2 /MT /W4 /WX /D _CRT_SECURE_NO_DEP= RECATE /D _CRT_NONSTDC_NO_DEPRECATE > -CPPFLAGS =3D $(CPPFLAGS) /EHsc /nologo /Z7 /c /O2 /MT /D _CRT_SECURE_NO_D= EPRECATE /D _CRT_NONSTDC_NO_DEPRECATE > +CFLAGS =3D $(CFLAGS) /nologo /Z7 /c /O2 /MT /W4 /WX /D _CRT_SECURE_NO_DEP= RECATE /D _CRT_NONSTDC_NO_DEPRECATE /D BASETOOLS > +CPPFLAGS =3D $(CPPFLAGS) /EHsc /nologo /Z7 /c /O2 /MT /D _CRT_SECURE_NO_D= EPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D BASETOOLS > diff --git a/BaseTools/Source/C/VfrCompile/GNUmakefile b/BaseTools/Source/= C/VfrCompile/GNUmakefile > index 7d5976649dba..f1abed11376e 100644 > --- a/BaseTools/Source/C/VfrCompile/GNUmakefile > +++ b/BaseTools/Source/C/VfrCompile/GNUmakefile > @@ -24,6 +24,7 @@ VFR_CPPFLAGS =3D -DPCCTS_USE_NAMESPACE_STD $(CPPFLAGS) > endif > # keep BUILD_OPTFLAGS last > VFR_CXXFLAGS =3D $(BUILD_OPTFLAGS) > +VFR_CXXFLAGS +=3D -D BASETOOLS=3D1 >=20 > # keep EXTRA_LDFLAGS last > VFR_LFLAGS =3D $(EXTRA_LDFLAGS) > --=20 > 2.39.2 >=20