diff options
author | brooks <brooks@FreeBSD.org> | 2009-10-25 07:30:19 +0800 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2009-10-25 07:30:19 +0800 |
commit | 9771dc9ce6ae0974a158f4eb1177ed0a741d4f66 (patch) | |
tree | f2496d81ac9380527e641d179e3ed421af869725 /lang/clang/Makefile | |
parent | 6b03a854e9799addbf65aecb6f52d4c637d4fe19 (diff) | |
download | freebsd-ports-gnome-9771dc9ce6ae0974a158f4eb1177ed0a741d4f66.tar.gz freebsd-ports-gnome-9771dc9ce6ae0974a158f4eb1177ed0a741d4f66.tar.zst freebsd-ports-gnome-9771dc9ce6ae0974a158f4eb1177ed0a741d4f66.zip |
Add a port of the clang C, Objective-C, and (soon) C++ compiler version
2.6.
NOTE: this port is slightly evil and both depends on llvm and builds all
of it. We hope to find the correct make string to fix this, but wanted
make clang available now.
Diffstat (limited to 'lang/clang/Makefile')
-rw-r--r-- | lang/clang/Makefile | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/lang/clang/Makefile b/lang/clang/Makefile new file mode 100644 index 000000000000..6fa882432464 --- /dev/null +++ b/lang/clang/Makefile @@ -0,0 +1,116 @@ +# New ports collection makefile for: clang +# Date created: 24 Oct 2009 +# Whom: Brooks Davis +# +# $FreeBSD$ +# + +PORTNAME= clang +PORTVERSION= 2.6 +CATEGORIES= devel lang +MASTER_SITES= http://llvm.org/releases/${PORTVERSION}/ +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ + ${LLVM_SOURCE} +EXTRACT_ONLY= ${LLVM_SOURCE} + +MAINTAINER= brooks@FreeBSD.org +COMMENT= C, Objective-C, and (soon) C++ compiler + +CLANG_NAME= clang-${PORTVERSION} +CLANG_SOURCE= ${CLANG_NAME}${EXTRACT_SUFX} +LLVM_NAME= llvm-${PORTVERSION} +LLVM_SOURCE= ${LLVM_NAME}${EXTRACT_SUFX} + +WRKSRC= ${WRKDIR}/${LLVM_NAME} +INSTALL_WRKSRC= ${WRKSRC}/tools/clang + +BUILD_DEPENDS+= llvm=2.6:${PORTSDIR}/devel/llvm +RUN_DEPENDS+= llvm=2.6:${PORTSDIR}/devel/llvm +.if defined(PACKAGE_BUILDING) || defined(MAINTAINER_MODE) +BUILD_DEPENDS+= runtest:${PORTSDIR}/misc/dejagnu +.endif +.if defined(MAINTAINER_MODE) +BUILD_DEPENDS+= f2c:${PORTSDIR}/lang/f2c +.endif + +GNU_CONFIGURE= yes +USE_GMAKE= yes +USE_PERL5_BUILD=yes +MAKE_JOBS_SAFE= yes + +.if defined(MAINTAINER_MODE) +CONFIGURE_ARGS+= --with-f2c=${LOCALBASE} +.else +CONFIGURE_ARGS+= --enable-optimized +.endif + +.if defined(NOPORTDOCS) +DOCSRCDIR= +.else +DOCSRCDIR= docs +.endif + +MAN1= clang.1 + +.include <bsd.port.pre.mk> + +.if ${ARCH} == "sparc64" +BROKEN= Does not compile on sparc64 +.endif + +post-extract: + cd ${WRKSRC}/tools && \ + tar xf ${DISTDIR}/${CLANG_SOURCE} && \ + ${MV} ${CLANG_NAME} clang + +post-patch: + ${REINPLACE_CMD} -e 's|\(PROJ_docsdir.*:=\).*$$|\1${DOCSDIR}|g' \ + ${WRKSRC}/Makefile.config.in + ${REINPLACE_CMD} -e 's|\(PROJ_mandir.*:=\).*$$|\1${MANPREFIX}/man|g' \ + ${WRKSRC}/Makefile.config.in + ${REINPLACE_CMD} -e 's|%%DOCSRCDIR%%|${DOCSRCDIR}|' \ + ${WRKSRC}/Makefile + ${REINPLACE_CMD} -e 's|/usr/bin/env perl|${PERL}|' \ + ${WRKSRC}/tools/clang/utils/ccc-analyzer \ + ${WRKSRC}/tools/clang/utils/scan-build + +post-install: + @${INSTALL_SCRIPT} ${WRKSRC}/tools/clang/utils/ccc-analyzer \ + ${PREFIX}/bin + @${INSTALL_SCRIPT} ${WRKSRC}/tools/clang/utils/scan-build \ + ${PREFIX}/bin + @${MKDIR} ${DATADIR} + @${INSTALL_DATA} ${WRKSRC}/tools/clang/utils/scanview.css ${DATADIR} + @${INSTALL_DATA} ${WRKSRC}/tools/clang/utils/sorttable.js ${DATADIR} + +TEST_CMD= '(cd ${WRKSRC}/test; ${SETENV} ${MAKE_ENV} ${GMAKE} check)' +regression-test: ${BUILD_COOKIE} + if [ `${ID} -u` = 0 ]; then \ + ${CHOWN} -R nobody ${WRKSRC}/test; \ + su -m nobody -c ${TEST_CMD}; \ + else \ + ${SH} -c ${TEST_CMD}; \ + fi + +PLIST_FILE_LIST= bin/ccc-analyzer \ + bin/clang \ + bin/scan-build \ + libexec/clang-cc +PLIST_DIR_LIST= lib/clang +build-plist: + ${RM} -f ${PLIST} + cd ${PREFIX} && \ + (ls ${PLIST_FILE_LIST}; ${FIND} ${PLIST_DIR_LIST} -type f) | \ + ${SORT} >> ${PLIST} + ${FIND} ${DATADIR} ${DOCSDIR} -type f | \ + ${SED} -e 's|${DATADIR}|%%DATADIR%%|' \ + -e 's|${DOCSDIR}|%%PORTDOCS%%%%DOCSDIR%%|' | ${SORT} >> ${PLIST} + cd ${PREFIX} && \ + ${FIND} ${PLIST_DIR_LIST} -type d | \ + ${SORT} -r | ${SED} -e 's|^|@dirrm |' >> ${PLIST} + ${FIND} ${DOCSDIR} -type d | ${SORT} -r | \ + ${SED} -e 's|${DATADIR}|%%DATADIR%%|' \ + -e 's|${DOCSDIR}|%%DOCSDIR%%|' \ + -e 's|^|%%PORTDOCS%%@dirrm |' >> ${PLIST} + +.include <bsd.port.post.mk> |