freebsd-ports/Mk/Uses/objc.mk
David Chisnall 3f627ab4ce Move Objective-C ports to the v2 GNUstep ABI.
* Bump the LLVM revision used for GNUstep to 7, the minimum to support
   the new ABI.
 * GNUstep-back does not work with lld, so mark it to use Gold (BFD LD
   doesn't seem able to link Objective-C things).
 * Turn off some annoying debug logs in GNUstep back, which generate
   several messages per second when you move the mouse.  These should
   never have been enabled in a release build anyway.
 * Downgrade Cenon to 4.0.2.  This was the last version to actually work
   with GNUstep (the later ones use XCode >= 5 .xib files, which GNUstep
   can't parse).
 * Update gorm to git head. The current release doesn't work with the
   new Objective-C ABI, but -head has the patches to fix it.
 * Update PikoPixel and add it to the gnustep-app meta-package.
 * Update the three core GNUstep packages to the latest release.
 * Update gnumail and pantomime to the latest release and fix a linking
   error with the new ABI.
 * Update GNUstep FTP to the latest version.

Reviewed by:	bapt (previous version)
2019-02-03 15:37:58 +00:00

83 lines
2.2 KiB
Makefile

# $FreeBSD$
#
# Objective C support
#
# Feature: objc
# Usage: USES=objc
#
# MAINTAINER: objc@FreeBSD.org
.if !defined(_INCLUDE_USES_OBJC_MK)
_INCLUDE_USES_OBJC_MK= yes
OBJC_CLANG_VERSION=70
objc_ARGS?=
.if !empty(objc_ARGS) && ! ${objc_ARGS:Mcompiler}
IGNORE= USES=objc only accepts no arguments or 'compiler'
.endif
_CC_hash:= ${CC:hash}
.if defined(_OBJC_CCVERSION_${_CC_hash})
_CCVERSION= ${_OBJC_CCVERSION_${_CC_hash}}
.else
_CCVERSION!= ${CC} --version
_OBJC_CCVERSION_${_CC_hash}= ${_CCVERSION}
PORTS_ENV_VARS+= _OBJC_CCVERSION_${_CC_hash}
.endif
COMPILER_VERSION= ${_CCVERSION:M[0-9].[0-9]*:tW: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= none
.if defined(_OBJC_ALTCCVERSION_${_CC_hash})
_ALTCCVERSION= ${_OBJC_ALTCCVERSION_${_CC_hash}}
.else
.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
_OBJC_ALTCCVERSION_${_CC_hash}= ${_ALTCCVERSION}
PORTS_ENV_VARS+= _OBJC_ALTCCVERSION_${_CC_hash}
.endif
ALT_COMPILER_VERSION= ${_ALTCCVERSION:M[0-9].[0-9]*:tW: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 and prefer a recent version
.if (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < ${OBJC_CLANG_VERSION}) || ${COMPILER_TYPE} != clang
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= ${OBJC_CLANG_VERSION}
CC= /usr/bin/clang
CPP= /usr/bin/clang-cpp
CXX= /usr/bin/clang++
OBJC_LLD= lld
.else
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang${OBJC_CLANG_VERSION}:devel/llvm${OBJC_CLANG_VERSION}
CPP= ${LOCALBASE}/bin/clang-cpp${OBJC_CLANG_VERSION}
CC= ${LOCALBASE}/bin/clang${OBJC_CLANG_VERSION}
CXX= ${LOCALBASE}/bin/clang++${OBJC_CLANG_VERSION}
OBJC_LLD= lld${OBJC_CLANG_VERSION}
.endif
.endif
.if ! ${objc_ARGS:Mcompiler}
LIB_DEPENDS+= libobjc.so.4.6:lang/libobjc2
OBJCFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
.endif
CONFIGURE_ENV+= OBJC="${CC}" OBJCFLAGS="${OBJCFLAGS}"
MAKE_ENV+= OBJC="${CC}" OBJCFLAGS="${OBJCFLAGS}"
.endif