pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/58668: gettext fails to build if base compiler is clang



>Number:         58668
>Category:       pkg
>Synopsis:       gettext fails to build if base compiler is clang
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 09 06:45:00 +0000 2024
>Originator:     Luca De Pandis
>Release:        NetBSD 10_STABLE/pkgsrc HEAD
>Organization:
>Environment:
NetBSD netbsd.ldep.local 10.0_STABLE NetBSD 10.0_STABLE (GENERIC64.20240908181017Z) #0: Mon Sep  9 01:40:40 CEST 2024  ldepandis@Lucas-MacBook-Air.local:/Users/ldepandis/netbsd/build/obj/sys/arch/evbarm/compile/GENERIC64 evbarm
>Description:
When the base compiler is clang, gettext-lib fails to build when it tries to run configure for libasprintf, because it tries to check for the C/C++ preprocessor.
It tries to search for /usr/bin/cpp, but it isn't installed as the preprocessor in a base environement built with clang is /usr/bin/clang-cpp.

I tried to set CPP and CXXCPP in /etc/mk.conf but it sorts not effect.
Patching devel/gettext Makefile.common fixed the problem.

>How-To-Repeat:
Compile NetBSD with clang as the base compiler, set /etc/mk.conf with the following parameters:

PKGSRC_COMPILER=clang
CLANGBASE=	/usr

and then try to compile devel/gettext-lib.
>Fix:
Index: ./devel/gettext/Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/devel/gettext/Makefile.common,v
retrieving revision 1.27
diff -u -r1.27 Makefile.common
--- ./devel/gettext/Makefile.common	25 Feb 2024 15:42:05 -0000	1.27
+++ ./devel/gettext/Makefile.common	9 Sep 2024 06:41:59 -0000
@@ -33,3 +33,12 @@
 CPPFLAGS+=		-D_UCONTEXT_T=1
 CPPFLAGS+=		-D_UCONTEXT64_T=1
 .endif
+
+# When base compiler is clang, gettext fails to build
+# because it tries to use /usr/bin/cpp as the system
+# preprocessor, but there is no cpp in base as clang
+# uses /usr/bin/clang-cpp
+.if ${PKGSRC_COMPILER} == "clang"
+CPP=			/usr/bin/clang-cpp
+CXXCPP=			/usr/bin/clang-cpp
+.endif


Home | Main Index | Thread Index | Old Index