# $Id$

PortSystem 1.0

name          	pccts
set		major_version	1
set		minor_version	33
version       	${major_version}.${minor_version}
revision	2
categories    	devel lang
license       	public-domain
maintainers   	nomaintainer
description   	Purdue Compiler-Construction Tool Set (parser-generator)
long_description \
        The Purdue Compiler-Compiler Tool Set (PCCTS) is a set of public \
        domain software tools designed to facilitate the implementation of \
        compilers and other translation systems.  These tools currently \
        include antlr, dlg and support code.  In many ways, PCCTS is similar \
        to a highly integrated version of YACC and LEX\; where antlr (ANother \
        Tool for Language Recognition) corresponds to YACC and dlg (DFA-based \
        Lexical analyzer Generator) functions like LEX.  However, PCCTS has \
        many additional features which make it easier to use for a wider range \
        of translation problems.
homepage      	http://www.polhode.com/pccts.html
platforms     	darwin
master_sites  	http://www.polhode.com
use_zip       	yes
distname      	${name}${major_version}${minor_version}mr
checksums     	sha1 5b3417efd5f537434b568114bcda853b4975d851
worksrcdir    	${name}
patch		{
	reinplace "s|#COPT=-O2|COPT=-DPCCTS_USE_STDARG -O2|g" \
		"${workpath}/${worksrcdir}/makefile"
}
use_configure  	no
build.target

variant universal {
	build.args-append	CC="${configure.cc} ${configure.universal_cflags}"
}

destroot	{
	xinstall -m 755 ${worksrcpath}/bin/antlr ${destroot}${prefix}/bin
	xinstall -m 755 ${worksrcpath}/bin/dlg ${destroot}${prefix}/bin
	xinstall -m 755 ${worksrcpath}/bin/genmk ${destroot}${prefix}/bin
	xinstall -m 755 ${worksrcpath}/bin/sor ${destroot}${prefix}/bin
	xinstall -m 644 ${worksrcpath}/dlg/dlg.1 \
	        ${destroot}${prefix}/share/man/man1
	xinstall -m 644 ${worksrcpath}/antlr/antlr.1 \
	        ${destroot}${prefix}/share/man/man1
        xinstall -d ${destroot}${prefix}/include/${name}
        xinstall -m 644 -v -W ${worksrcpath}/h \
		AParser.cpp \
		AParser.h \
		ASTBase.cpp \
		ASTBase.h \
		ATokPtr.h \
		ATokPtrImpl.h \
		ATokenBuffer.cpp \
		AToken.h \
		ATokenBuffer.h \
		ATokenStream.h \
		BufFileInput.cpp \
		BufFileInput.h \
		DLG_stream_input.h \
		DLexer.h \
		DLexerBase.cpp \
		DLexerBase.h \
		PBlackBox.h \
		PCCTSAST.cpp \
		PCCTSAST.h \
		SList.h \
		antlr.h \
		ast.c \
		ast.h \
		charbuf.h \
		charptr.c \
		charptr.h \
		config.h \
		dlgdef.h \
		dlgauto.h \
		err.h \
		int.h \
		pccts_assert.h \
		pccts_iostream.h \
		pccts_istream.h \
		pccts_setjmp.h \
		pccts_stdarg.h \
		pccts_stdio.h \
		pccts_stdlib.h \
		pccts_string.h \
		pcctscfg.h \
		slist.cpp \
                ${destroot}${prefix}/include/${name}
}
livecheck.type		regex
livecheck.url		${homepage}
livecheck.regex		"downloading PCCTS (\\d+(?:\\.\\d+)*)MR"