aboutsummaryrefslogtreecommitdiff
path: root/devel/antlr/Makefile
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2012-06-12 06:44:14 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2012-06-12 06:44:14 +0000
commit954c1faffa55fcd3510c0a9967b8ac3001df353f (patch)
tree1c9b8a5b68b507ef2c36d35139fd2f7f6ca62eec /devel/antlr/Makefile
parentdb910bd9bb965021951c265e586776e2b4123879 (diff)
downloadports-954c1faffa55fcd3510c0a9967b8ac3001df353f.tar.gz
ports-954c1faffa55fcd3510c0a9967b8ac3001df353f.zip
Convert to new options framework
Notes
Notes: svn path=/head/; revision=299094
Diffstat (limited to 'devel/antlr/Makefile')
-rw-r--r--devel/antlr/Makefile22
1 files changed, 10 insertions, 12 deletions
diff --git a/devel/antlr/Makefile b/devel/antlr/Makefile
index 32836b5184ca..b5f5e35e81d9 100644
--- a/devel/antlr/Makefile
+++ b/devel/antlr/Makefile
@@ -21,7 +21,7 @@ USE_GMAKE= yes
USE_JAVA= yes
JAVA_VERSION= 1.5+
-OPTIONS= PYTHON "Include Python runtime support" off
+OPTIONS_DEFINE= PYTHON DOCS
HAS_CONFIGURE= yes
CONFIGURE_ENV= JAVAC="${JAVAC}" JAR="${JAR}" JAVA="${JAVA}" CLASSPATH="${PORT_CLASSPATH}"
@@ -29,8 +29,9 @@ CONFIGURE_ARGS= --disable-csharp --prefix=${PREFIX}
PORT_CLASSPATH= ${WRKSRC}/antlrall.jar:.
+.include <bsd.port.options.mk>
EXAMPLES= cpp java
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
PORTDOCS= ANTLRException.gif closure.gif cpp-runtime.html \
csharp-runtime.html err.html glossary.html hidden.stream.gif \
index.html inheritance.html j-guru-blue.jpg jguru-logo.gif \
@@ -41,13 +42,10 @@ PORTDOCS= ANTLRException.gif closure.gif cpp-runtime.html \
vocab.html
.endif
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
-.if defined(WITH_PYTHON)
+.if ${PORT_OPTIONS:MPYTHON}
USE_PYTHON= 2.2+
-# we need to manually include this, because USE_PYTHON is defined
-# after including bsd.port.pre.mk
-.include "${PORTSDIR}/Mk/bsd.python.mk"
PORTDOCS+= python-runtime.html
ANTLR_PYTHON= ${WRKSRC}/lib/python
PLIST_SUB+= WITH_PYTHON=""
@@ -62,7 +60,7 @@ post-configure:
${SED} -e 's|%%JAVAJARDIR%%|${JAVAJARDIR}|' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|' \
-e 's|%%JAVA_VERSION%%|${JAVA_VERSION}|' ${FILESDIR}/antlr.sh > ${WRKDIR}/antlr.sh
-.if defined(WITH_PYTHON)
+.if ${PORT_OPTIONS:MPYTHON}
(cd ${ANTLR_PYTHON} && ${PYTHON_CMD} setup.py config)
.endif
@@ -72,7 +70,7 @@ pre-build:
(cd ${WRKSRC} && ${JAVA} -classpath "${PORT_CLASSPATH}" antlr.build.Tool jar)
.endif
-.if defined(WITH_PYTHON)
+.if ${PORT_OPTIONS:MPYTHON}
post-build:
(cd ${ANTLR_PYTHON} && ${PYTHON_CMD} setup.py build && \
${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${ANTLR_PYTHON})
@@ -89,16 +87,16 @@ do-install:
@${ECHO_MSG} ">> Installing native files..."
@(cd ${WRKSRC}/lib/cpp && ${GMAKE} install)
@${ECHO_MSG} " [ DONE ]"
-.if defined(WITH_PYTHON)
+.if ${PORT_OPTIONS:MPYTHON}
@${ECHO_MSG} -n ">> Installing Python runtime files..."
@(cd ${ANTLR_PYTHON} && ${PYTHON_CMD} setup.py install)
@${ECHO_MSG} " [ DONE ]"
.endif
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
@${ECHO_MSG} -n ">> Installing documentation in ${DOCSDIR}..."
@${MKDIR} ${DOCSDIR}
@cd ${WRKSRC}/doc && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}/
@${ECHO_MSG} " [ DONE ]"
.endif
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>