Bug 162178 - [bsd.port.mk] Add bsd.clang.mk with Clang/LLVM support
Summary: [bsd.port.mk] Add bsd.clang.mk with Clang/LLVM support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-30 22:50 UTC by kamikaze
Modified: 2014-01-23 17:12 UTC (History)
0 users

See Also:


Attachments
file.shar (7.37 KB, text/plain)
2011-10-30 22:50 UTC, kamikaze
no flags Details
patch-ports-Mk-bsd.clang.mk.txt (546 bytes, patch)
2011-10-30 23:01 UTC, kamikaze
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kamikaze 2011-10-30 22:50:10 UTC
This adds Clang/LLVM support to ports/Mk/.

For port users:
	PREFER_CLANG	Defining this results in the use of Clang/LLVM if a
			port defines CLANG_SAFE
	FORCE_CLANG	Defining this results in the use of Clang/LLVM unless
			a port defines CLANG_UNSAFE

Note that setting PREFER_CLANG or FORCE_CLANG only has an effect if clang is
available.

For port developers:
	CLANG_PREFERRED	Defining this results in the use of clang if available
	CLANG_SAFE	Defining this allows the use of clang if the user
			defines PREFER_CLANG
	CLANG_UNSAFE	Defining this prohibits the use of clang even if the
			user defined FORCE_CLANG
	USE_CLANG	Defining this results in the use of clang and a build
			dependency if clang is not available from the base
			system

CLANG_* and USE_CLANG should be set to a version string. Each macro only
has an effect if the available version of clang matches the string.

Fix: --- ports/Mk.orig/bsd.port.mk	2011-10-30 15:18:11.000000000 +0100
+++ ports/Mk/bsd.port.mk	2011-10-30 16:54:58.000000000 +0100
@@ -1686,6 +1686,11 @@
 .include "${PORTSDIR}/Mk/bsd.gcc.mk"
 .endif
 
+.if defined(USE_CLANG) || defined(CLANG_PREFERRED) \
+	|| defined(PREFER_CLANG) || defined(FORCE_CLANG)
+.include "${PORTSDIR}/Mk/bsd.clang.mk"
+.endif
+
 .if defined(USE_BINUTILS) && !defined(DISABLE_BINUTILS)
 BUILD_DEPENDS+=	${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
 BINUTILS?=	ADDR2LINE AR AS CPPFILT GPROF LD NM OBJCOPY OBJDUMP RANLIB \


Patch attached with submission follows:
Comment 1 kamikaze 2011-10-30 23:01:10 UTC
Add bsd.port.mk inclusion patch, because it didn't trigger the GNATS magic
in the OP.

-- 
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail? 
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2011-11-02 02:21:55 UTC
State Changed
From-To: open->suspended

portmgr territory. This should be discussed on the mailing list prior to 
reopening it. Thanks for looking into this. I'm sure portmgr will have a 
lot more to say - I know they did with my version of a similar patch ;) 


Comment 3 Eitan Adler freebsd_committer freebsd_triage 2011-11-02 02:21:55 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

portmgr territory. This should be discussed on the mailing list prior to 
reopening it. Thanks for looking into this. I'm sure portmgr will have a 
lot more to say - I know they did with my version of a similar patch ;)
Comment 4 baptiste.daroussin 2013-12-28 23:43:40 UTC
We now have compiler.mk, do we still need bsd.clang.mk

regards,
Bapt
Comment 5 kamikaze 2013-12-29 13:56:59 UTC
On 29/12/2013 00:43, Baptiste Daroussin wrote:
> We now have compiler.mk, do we still need bsd.clang.mk

Due to the deployment of cc=clang in FreeBSD 10 it's obsolete, as
far as I'm concerned.

Regards

-- 
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Comment 6 Martin Wilke freebsd_committer freebsd_triage 2014-01-23 17:12:35 UTC
State Changed
From-To: suspended->closed

close by submitter request.