From b010e764c3efa60fd4468827c9900bb3dbd97ad0 Mon Sep 17 00:00:00 2001 From: Adam Weinberger Date: Wed, 30 Jul 2014 14:06:45 +0000 Subject: [PATCH] Stage, unbreak without gcc, and introduce a TEST option. --- lang/hla/Makefile | 57 ++++++++++++++++++++--------------- lang/hla/files/pkg-message.in | 4 +++ 2 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 lang/hla/files/pkg-message.in diff --git a/lang/hla/Makefile b/lang/hla/Makefile index 3050ba034189..bd4e9d5dd13b 100644 --- a/lang/hla/Makefile +++ b/lang/hla/Makefile @@ -8,10 +8,7 @@ MASTER_SITES= http://webster.cs.ucr.edu/AsmTools/HLA/HLAv${PORTVERSION}/:src \ http://www.gahr.ch/FreeBSD/HLA/:extra DISTFILES= ${PORTNAME}src${EXTRACT_SUFX}:src \ bsd.hla.tar.gz:src \ - HLARef_html${EXTRACT_SUFX}:src \ - HLAstdlib_html${EXTRACT_SUFX}:src \ - lex.yy.c:extra \ - hello.hla:extra + lex.yy.c:extra DIST_SUBDIR= ${PORTNAME} EXTRACT_ONLY= ${PORTNAME}src${EXTRACT_SUFX} @@ -24,15 +21,30 @@ WRKSRC= ${WRKDIR}/hlasrc/trunk/trunk MAKEFILE= makefile.bsd ALL_TARGET= hlaparse hla +SUB_FILES= pkg-message + ONLY_FOR_ARCHS= i386 -NO_STAGE= yes +OPTIONS_DEFINE= DOCS TEST + +.include + +.if ${PORT_OPTIONS:MDOCS} || make(makesum) +DISTFILES+= HLARef_html${EXTRACT_SUFX}:src \ + HLAstdlib_html${EXTRACT_SUFX}:src +.endif +.if ${PORT_OPTIONS:MTEST} || make(makesum) +DISTFILES+= hello.hla:extra +.endif + post-extract: ${MKDIR} ${WRKDIR}/stdlib && \ ${TAR} -zxf ${_DISTDIR}/bsd.${PORTNAME}.tar.gz -C ${WRKDIR}/stdlib ${CP} ${_DISTDIR}/lex.yy.c ${WRKSRC} +.if ${PORT_OPTIONS:MTEST} ${CP} ${_DISTDIR}/hello.hla ${WRKSRC} -.if !defined(NOPORTDOCS) +.endif +.if ${PORT_OPTIONS:MDOCS} (${MKDIR} ${WRKDIR}/HLAstdlib && \ ${UNZIP_CMD} -q ${_DISTDIR}/HLAstdlib_html${EXTRACT_SUFX} -d ${WRKDIR}/HLAstdlib \ ) @@ -42,36 +54,33 @@ post-extract: .endif post-patch: - ${REINPLACE_CMD} -e '/flex/d' ${WRKSRC}/makefile.bsd + @${REINPLACE_CMD} -e '/flex/d; s|gcc|${CC}|; s|-O2|${CFLAGS}|; \ + s|-static-libgcc||' ${WRKSRC}/makefile.bsd do-configure: (cd ${WRKSRC} && bison -o hlaparse.c hlaparse.bsn) do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/hla ${PREFIX}/bin - ${INSTALL_PROGRAM} ${WRKSRC}/hlaparse ${PREFIX}/bin - ${INSTALL_DATA} ${WRKDIR}/stdlib/hla/hlalib/hlalib.a ${PREFIX}/lib - ${INSTALL} -d ${PREFIX}/include/hla - (cd ${WRKDIR}/stdlib/hla/include/include && ${COPYTREE_SHARE} \* ${PREFIX}/include/hla) + ${INSTALL_PROGRAM} ${WRKSRC}/hla ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/hlaparse ${STAGEDIR}${PREFIX}/bin + ${INSTALL_DATA} ${WRKDIR}/stdlib/hla/hlalib/hlalib.a ${STAGEDIR}${PREFIX}/lib + @${MKDIR} ${STAGEDIR}${PREFIX}/include/hla + (cd ${WRKDIR}/stdlib/hla/include/include && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/hla) post-install: -.if !defined(NOPORTDOCS) - ${INSTALL} -d ${DOCSDIR}/Reference - ${INSTALL} -d ${DOCSDIR}/stdlib - (cd ${WRKDIR}/HLAReference && ${COPYTREE_SHARE} \* ${DOCSDIR}/Reference) - (cd ${WRKDIR}/HLAstdlib && ${COPYTREE_SHARE} \* ${DOCSDIR}/stdlib) +.if ${PORT_OPTIONS:MDOCS} + @${MKDIR} ${STAGEDIR}${DOCSDIR}/Reference ${STAGEDIR}${DOCSDIR}/stdlib + (cd ${WRKDIR}/HLAReference && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/Reference) + (cd ${WRKDIR}/HLAstdlib && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/stdlib) .endif +.if ${PORT_OPTIONS:MTEST} @${ECHO_MSG} "" @${ECHO_MSG} "Testing HLA installation..." @( \ - hlainc=${PREFIX}/include/hla hlalib=${PREFIX}/lib/hlalib.a \ - ${WRKSRC}/hla ${WRKSRC}/hello.hla && \ + hlainc=${STAGEDIR}${PREFIX}/include/hla hlalib=${STAGEDIR}${PREFIX}/lib/hlalib.a \ + PATH=${PATH}:${STAGEDIR}${PREFIX}/bin ${WRKSRC}/hla ${WRKSRC}/hello.hla && \ ${WRKSRC}/hello \ ) - @${ECHO_MSG} "" - @${ECHO_MSG} "Remember to set the following environment variables:" - @${ECHO_MSG} "hlainc -> ${PREFIX}/include/hla" - @${ECHO_MSG} "hlalib -> ${PREFIX}/lib/hlalib.a" - @${ECHO_MSG} "" +.endif .include diff --git a/lang/hla/files/pkg-message.in b/lang/hla/files/pkg-message.in new file mode 100644 index 000000000000..7a3821e42270 --- /dev/null +++ b/lang/hla/files/pkg-message.in @@ -0,0 +1,4 @@ +Remember to set the following environment variables: + +hlainc=%%PREFIX%%/include/hla +hlalib=%%PREFIX%%/lib/hlalib.c