From owner-svn-ports-head@FreeBSD.ORG Thu May 8 13:32:13 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0601B6D5; Thu, 8 May 2014 13:32:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFE8EFBE; Thu, 8 May 2014 13:32:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48DWCHi020884; Thu, 8 May 2014 13:32:12 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48DWCYJ020883; Thu, 8 May 2014 13:32:12 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201405081332.s48DWCYJ020883@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 8 May 2014 13:32:12 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r353296 - head/Mk/Uses X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 13:32:13 -0000 Author: bapt Date: Thu May 8 13:32:12 2014 New Revision: 353296 URL: http://svnweb.freebsd.org/changeset/ports/353296 QAT: https://qat.redports.org/buildarchive/r353296/ Log: Add a USES to handle objective C (chosing compiler adding the right dependency on the runtime library) Added: head/Mk/Uses/objc.mk (contents, props changed) Added: head/Mk/Uses/objc.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Mk/Uses/objc.mk Thu May 8 13:32:12 2014 (r353296) @@ -0,0 +1,65 @@ +# $FreeBSD$ +# +# Objective C support +# +# Feature: objc +# Usage: USES=objc +# +# MAINTAINER: objc@FreeBSD.org + +.if !defined(_INCLUDE_USES_OBJC_MK) +_INCLUDE_USES_OBJC_MK= yes + +.if defined(objc_ARGS) +IGNORE= USES=objc takes no arguments +.endif + +_CCVERSION!= ${CC} --version +COMPILER_VERSION= ${_CCVERSION:M[0-9].[0-9]*:C/([0-9]).([0-9]).*/\1\2/g} +.if ${_CCVERSION:Mclang} +COMPILER_TYPE= clang +.else +COMPILER_TYPE= gcc +.endif + +ALT_COMPILER_VERSION= 0 +ALT_COMPILER_TYPE= none +_ALTCCVERSION= +.if ${COMPILER_TYPE} == gcc && exists(/usr/bin/clang) +_ALTCCVERSION!= /usr/bin/clang --version +.elif ${COMPILER_TYPE} == clang && exists(/usr/bin/gcc) +_ALTCCVERSION!= /usr/bin/gcc --version +.endif + +ALT_COMPILER_VERSION= ${_ALTCCVERSION:M[0-9].[0-9]*:C/([0-9]).([0-9]).*/\1\2/g} +.if ${_ALTCCVERSION:Mclang} +ALT_COMPILER_TYPE= clang +.elif !empty(_ALTCCVERSION) +ALT_COMPILER_TYPE= gcc +.endif + +# We do always need clang +.if (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 33) || ${COMPILER_TYPE} != clang +.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 33 +CC= /usr/bin/clang +CPP= /usr/bin/clang-cpp +CXX= /usr/bin/clang++ +.else +BUILD_DEPENDS+= ${LOCALBASE}/bin/clang33:${PORTSDIR}/lang/clang33 +CPP= ${LOCALBASE}/bin/clang-cpp33 +CC= ${LOCALBASE}/bin/clang33 +CXX= ${LOCALBASE}/bin/clang++33 +.if ${OSVERSION} < 900033 +USE_BINUTILS= yes +LDFLAGS+= -B${LOCALBASE}/bin +.endif +.endif +.endif + +LIB_DEPENDS+= libobjc.so.4.6:${PORTSDIR}/lang/libobjc2 +OBJCFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +CONFIGURE_ENV+= OBJC="${CC}" OBJCFLAGS="${OBJCFLAGS}" +MAKE_ENV+= OBJC="${CC}" OBJCFLAGS="${OBJCFLAGS}" + +.endif