2008-08-18 17:41:02 +02:00
|
|
|
# New ports collection makefile for: llvm
|
|
|
|
# Date created: 20 Nov 2005
|
|
|
|
# Whom: Hye-Shik Chang
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= llvm
|
2009-02-27 02:34:19 +01:00
|
|
|
DISTVERSION= 2.4.r${SVN_REV}
|
2008-08-18 17:41:02 +02:00
|
|
|
CATEGORIES= devel lang
|
|
|
|
MASTER_SITES= ${MASTER_SITE_LOCAL}
|
|
|
|
MASTER_SITE_SUBDIR= brooks
|
|
|
|
PKGNAMESUFFIX= -devel
|
|
|
|
|
|
|
|
MAINTAINER= brooks@FreeBSD.org
|
|
|
|
COMMENT= Low Level Virtual Machine
|
|
|
|
|
|
|
|
.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
|
|
|
|
|
|
|
|
.if defined(BOOTSTRAP)
|
2009-02-27 02:34:19 +01:00
|
|
|
SVN_REV!= svn info http://llvm.org/svn/llvm-project/ | grep Revision | cut -d' ' -f2
|
2008-08-18 17:41:02 +02:00
|
|
|
.else
|
2009-02-27 02:34:19 +01:00
|
|
|
SVN_REV= 65584
|
2008-08-18 17:41:02 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
GNU_CONFIGURE= yes
|
|
|
|
USE_GMAKE= yes
|
|
|
|
USE_BZIP2= yes
|
2009-02-26 01:04:25 +01:00
|
|
|
USE_PERL5= yes
|
|
|
|
USE_PYTHON_RUN= yes
|
2008-08-18 17:41:02 +02:00
|
|
|
|
|
|
|
.if defined(MAINTAINER_MODE)
|
|
|
|
CONFIGURE_ARGS+= --with-f2c=${LOCALBASE}
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --enable-optimized
|
|
|
|
.endif
|
|
|
|
|
2009-02-17 03:15:37 +01:00
|
|
|
MAN1= bugpoint.1 llc.1 lli.1 llvmc.1 llvm-ar.1 \
|
2008-08-18 17:41:02 +02:00
|
|
|
llvm-as.1 llvm-bcanalyzer.1 llvm-config.1 llvm-db.1 \
|
|
|
|
llvm-dis.1 llvm-extract.1 llvm-ld.1 llvm-link.1 llvm-nm.1 \
|
|
|
|
llvm-prof.1 llvm-ranlib.1 llvmgcc.1 \
|
|
|
|
llvmgxx.1 opt.1 tblgen.1
|
|
|
|
|
2008-09-17 00:15:05 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
.if ${OSVERSION} < 700000 && ${ARCH} == "amd64"
|
|
|
|
BROKEN= does not compile
|
2008-12-10 08:35:19 +01:00
|
|
|
.elif ${ARCH} == "sparc64"
|
|
|
|
BROKEN= Does not compile on sparc64
|
2008-09-17 00:15:05 +02:00
|
|
|
.endif
|
|
|
|
|
2008-08-18 17:41:02 +02:00
|
|
|
.if defined(BOOTSTRAP)
|
|
|
|
FETCH_DEPENDS+= svn:${PORTSDIR}/devel/subversion
|
|
|
|
|
|
|
|
do-fetch:
|
|
|
|
${MKDIR} ${WRKDIR}
|
2009-02-27 02:34:19 +01:00
|
|
|
svn export -r ${SVN_REV} http://llvm.org/svn/llvm-project/llvm/trunk ${WRKSRC}
|
|
|
|
svn export -r ${SVN_REV} http://llvm.org/svn/llvm-project/cfe/trunk ${WRKSRC}/tools/clang
|
2008-08-18 17:41:02 +02:00
|
|
|
cd ${WRKDIR}; tar cvfy ${DISTDIR}/${DISTNAME}.tar.bz2 ${DISTNAME}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
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|%%DATADIR%%|${DATADIR}|g' \
|
|
|
|
${WRKSRC}/tools/clang/utils/scan-build
|
2009-02-26 01:04:25 +01:00
|
|
|
${REINPLACE_CMD} -e 's|/usr/bin/env python|${PYTHON_CMD}|' \
|
|
|
|
${WRKSRC}/tools/clang/tools/ccc/ccc
|
|
|
|
${REINPLACE_CMD} -e 's|/usr/bin/env perl|${PERL}|' \
|
|
|
|
${WRKSRC}/tools/clang/utils/ccc-analyzer \
|
|
|
|
${WRKSRC}/tools/clang/utils/scan-build
|
2008-08-18 17:41:02 +02:00
|
|
|
|
|
|
|
post-install:
|
|
|
|
@${INSTALL_SCRIPT} ${WRKSRC}/tools/clang/utils/ccc-analyzer \
|
|
|
|
${PREFIX}/bin
|
|
|
|
@${INSTALL_SCRIPT} ${WRKSRC}/tools/clang/utils/scan-build \
|
|
|
|
${PREFIX}/bin
|
|
|
|
@${MKDIR} ${DATADIR}
|
2009-02-25 21:49:35 +01:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/tools/clang/utils/scanview.css ${DATADIR}
|
2008-08-18 17:41:02 +02:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/tools/clang/utils/sorttable.js ${DATADIR}
|
|
|
|
|
2008-08-21 16:54:22 +02:00
|
|
|
TEST_CMD= '(cd ${WRKSRC}/test; ${SETENV} ${MAKE_ENV} ${GMAKE} check)'
|
2008-08-18 17:41:02 +02:00
|
|
|
regression-test: ${BUILD_COOKIE}
|
2008-08-21 16:54:22 +02:00
|
|
|
if [ `${ID} -u` = 0 ]; then \
|
|
|
|
${CHOWN} -R nobody ${WRKSRC}/test; \
|
|
|
|
su -m nobody -c ${TEST_CMD}; \
|
|
|
|
else \
|
|
|
|
${SH} -c ${TEST_CMD}; \
|
|
|
|
fi
|
2008-08-18 17:41:02 +02:00
|
|
|
|
2009-02-17 03:15:37 +01:00
|
|
|
MANUAL_BINS= bin/bugpoint \
|
|
|
|
bin/ccc \
|
|
|
|
bin/ccc-analyzer \
|
|
|
|
bin/clang \
|
|
|
|
bin/gccas \
|
|
|
|
bin/gccld \
|
|
|
|
bin/llc \
|
|
|
|
bin/lli \
|
|
|
|
bin/opt \
|
|
|
|
bin/scan-build
|
|
|
|
build-plist:
|
|
|
|
${RM} ${PLIST}
|
|
|
|
cd ${PREFIX} && \
|
|
|
|
(ls ${MANUAL_BINS} bin/llvm* bin/ccclib/* \
|
|
|
|
lib/LLVM* lib/libLLVM* lib/plugin_llvm* lib/libclang* ; \
|
|
|
|
${FIND} include/llvm-c -type f; ${FIND} include/llvm -type f) | \
|
|
|
|
${SORT} >> ${PLIST}
|
|
|
|
${FIND} ${DATADIR} -type f | ${SORT} | \
|
|
|
|
${SED} -e 's|${DATADIR}|%%DATADIR%%|' >> ${PLIST}
|
|
|
|
${FIND} ${DOCSDIR} -type f | ${SORT} | \
|
|
|
|
${SED} -e 's|${DOCSDIR}|%%DOCSDIR%%|' >> ${PLIST}
|
|
|
|
cd ${PREFIX} && \
|
|
|
|
(echo bin/ccclib; \
|
|
|
|
${FIND} include/llvm-c -type d; ${FIND} include/llvm -type d) | \
|
|
|
|
${SORT} -r | ${SED} -e 's|^|@dirrm |' >> ${PLIST}
|
|
|
|
${FIND} ${DATADIR} -type d | ${SORT} -r | \
|
|
|
|
${SED} -e 's|${DATADIR}|%%DATADIR%%|' -e 's|^|@dirrm |' >> ${PLIST}
|
|
|
|
${FIND} ${DOCSDIR} -type d | ${SORT} -r | \
|
|
|
|
${SED} -e 's|${DOCSDIR}|%%DOCSDIR%%|' -e 's|^|@dirrm |' >> ${PLIST}
|
|
|
|
|
2008-09-17 00:15:05 +02:00
|
|
|
.include <bsd.port.post.mk>
|