git: b5e26678495d - main - devel/tbb: Fix symlink creation during build

From: Ganael LAPLANCHE <martymac_at_FreeBSD.org>
Date: Thu, 12 May 2022 10:38:14 UTC
The branch main has been updated by martymac:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b5e26678495d795d8596874e19790076e09c1c91

commit b5e26678495d795d8596874e19790076e09c1c91
Author:     Sean Champ <lab+bsd@thinkum.space>
AuthorDate: 2022-05-12 10:33:23 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2022-05-12 10:33:23 +0000

    devel/tbb: Fix symlink creation during build
    
    Temporary variable CC_BASENAME may not reflect actual COMPILER_TYPE on
    environments that modify CC or COMPILER_TYPE through included files,
    leading to creating a wrong symlink.
    
    Evaluating CC in the post-extract target ensures it is up to date and
    in line with COMPILER_TYPE.
    
    PR:     263851
    Reported by:    Sean Champ <lab+bsd@thinkum.space>
    MFH:    2022Q2
---
 devel/tbb/Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/devel/tbb/Makefile b/devel/tbb/Makefile
index 990317db3009..31403f36d786 100644
--- a/devel/tbb/Makefile
+++ b/devel/tbb/Makefile
@@ -37,14 +37,13 @@ DOCS_BUILD_DEPENDS=	doxygen:devel/doxygen \
 USE_LDCONFIG=	yes
 ALL_TARGET=	default
 
-CC_BASENAME=	${CC:C,^.*/,,}
-
 .include <bsd.port.pre.mk>
 
 post-extract:
-.if ${CC_BASENAME} != ${COMPILER_TYPE}
-	@${LN} -sf FreeBSD.${COMPILER_TYPE}.inc ${WRKSRC}/build/FreeBSD.${CC_BASENAME}.inc
-.endif
+	@if [ "${COMPILER_TYPE}" != "${CC:T}" ]; then \
+	   ${LN} -sf FreeBSD.${COMPILER_TYPE}.inc \
+	     ${WRKSRC}/build/FreeBSD.${CC:T}.inc; \
+	 fi
 	@${CP} ${FILESDIR}/version_info_FreeBSD.sh ${WRKSRC}/build/
 
 post-patch: