initial import of cil-1.2.5

--
CIL (C Intermediate Language) is a high-level representation along
with a set of tools that permit easy analysis and source-to-source
transformation of C programs.

CIL is both lower-level than abstract-syntax trees, by clarifying
ambiguous constructs and removing redundant ones, and also higher-level
than typical intermediate languages designed for compilation, by
maintaining types and a close relationship with the source program.
The main advantage of CIL is that it compiles all valid C programs
into a few core constructs with a very clean semantics. Also CIL
has a syntax-directed type system that makes it easy to analyze and
manipulate C programs. Furthermore, the CIL front-end is able to
process not only ANSI-C programs but also those using Microsoft C
or GNU C extensions.
This commit is contained in:
avsm 2004-06-20 16:08:28 +00:00
parent 112bb61d63
commit b613748f78
6 changed files with 172 additions and 0 deletions

55
devel/cil/Makefile Normal file
View File

@ -0,0 +1,55 @@
# $OpenBSD: Makefile,v 1.1.1.1 2004/06/20 16:08:28 avsm Exp $
# until tested on others, even though bytecode is produced
ONLY_FOR_ARCHS= i386 amd64
COMMENT= "framework for analysis and transformation of C"
DISTNAME= cil-1.2.5
CATEGORIES= devel lang
MASTER_SITES= http://manju.cs.berkeley.edu/cil/distrib/
HOMEPAGE= http://manju.cs.berkeley.edu/cil/
MAINTAINER= Anil Madhavapeddy <avsm@openbsd.org>
# BSD license
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MODULES= ocaml
WRKDIST= ${WRKDIR}/cil
CONFIGURE_STYLE= autoconf
AUTOCONF_VERSION= 2.52
USE_GMAKE= yes
ALL_TARGET= setup
P5SITE= libdata/perl5/site_perl
P5INST= ${PREFIX}/${P5SITE}
SUBST_VARS+= P5SITE
GCC=/usr/bin/gcc # cant use CC in case it's set to cilly
pre-fake:
${INSTALL_DATA_DIR} ${PREFIX}/libexec/cil
${INSTALL_DATA_DIR} ${P5INST}/CIL
post-install:
sed -e 's,@CILHOME@/lib,${LOCALBASE}/${P5SITE}/CIL,g' \
-e 's,@CILHOME@,${LOCALBASE},g' \
-e 's,@ARCHOS@,libexec/cil,g' \
-e 's,@CC@,${GCC},g' < \
${WRKSRC}/bin/CilConfig.pm.in > ${P5INST}/CilConfig.pm
${INSTALL_PROGRAM} ${WRKBUILD}/bin/cilly ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKBUILD}/bin/patcher ${PREFIX}/bin
.for i in Cilly KeptFile OutputFile TempFile
${INSTALL_DATA} ${WRKSRC}/lib/${i}.pm ${P5INST}/CIL
.endfor
.for i in machdep.exe cilly.byte.exe cilly.asm.exe
${INSTALL_PROGRAM} ${WRKBUILD}/obj/x86_LINUX/${i} ${PREFIX}/libexec/cil
.endfor
.include <bsd.port.mk>

3
devel/cil/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (cil-1.2.5.tar.gz) = a58640a11e96756ec687c58ef6ede004
RMD160 (cil-1.2.5.tar.gz) = 367139e90396a1e64cdf70dca055d3057a1a536f
SHA1 (cil-1.2.5.tar.gz) = addce58f5f55a9b284da481143c5f4195c9dafc6

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-bin_cilly,v 1.1.1.1 2004/06/20 16:08:28 avsm Exp $
--- bin/cilly.orig 2004-06-20 16:57:52.000000000 +0100
+++ bin/cilly 2004-06-20 16:58:08.000000000 +0100
@@ -60,7 +60,7 @@ use File::Basename;
use strict;
BEGIN {
@CilCompiler::ISA = qw(Cilly);
- $CilCompiler::base = "$::cilhome/obj/$::archos/cilly";
+ $CilCompiler::base = "$::cilhome/$::archos/cilly";
# Use the most recent version of cilly
$CilCompiler::mtime_asm = int((stat("$CilCompiler::base.asm.exe"))[9]);
$CilCompiler::mtime_byte = int((stat("$CilCompiler::base.byte.exe"))[9]);

View File

@ -0,0 +1,35 @@
$OpenBSD: patch-configure_in,v 1.1.1.1 2004/06/20 16:08:28 avsm Exp $
--- configure.in.orig 2004-04-06 16:51:21.000000000 +0100
+++ configure.in 2004-06-20 16:57:30.000000000 +0100
@@ -219,6 +219,8 @@ AC_MSG_CHECKING([for Perl])
;;
freebsd)
;;
+ openbsd)
+ ;;
darwin) # Mac OS X
;;
*)
@@ -378,6 +380,13 @@ case "$target" in
ARCHOS=x86_LINUX
;;
+ # openbsd
+ *86*openbsd*)
+ AC_MSG_RESULT(configuring for OpenBSD/x86)
+
+ ARCHOS=x86_LINUX
+ ;;
+
# Mac OS X
*powerpc*darwin*)
AC_MSG_RESULT(configuring for powerpc/darwin, which we treat like linux/x86)
@@ -406,7 +415,7 @@ case "$target" in
])
;;
esac
-CILHOME=$CCUREDHOME
+CILHOME=${LOCALBASE}
# We will use substitution variables whose definition contains newlines. The
# problem is that when config.status runs, it wants to break the series of

18
devel/cil/pkg/DESCR Normal file
View File

@ -0,0 +1,18 @@
CIL (C Intermediate Language) is a high-level representation along
with a set of tools that permit easy analysis and source-to-source
transformation of C programs.
CIL is both lower-level than abstract-syntax trees, by clarifying
ambiguous constructs and removing redundant ones, and also higher-level
than typical intermediate languages designed for compilation, by
maintaining types and a close relationship with the source program.
The main advantage of CIL is that it compiles all valid C programs
into a few core constructs with a very clean semantics. Also CIL
has a syntax-directed type system that makes it easy to analyze and
manipulate C programs. Furthermore, the CIL front-end is able to
process not only ANSI-C programs but also those using Microsoft C
or GNU C extensions. If you do not use CIL and want instead to use
just a C parser and analyze programs expressed as abstract-syntax
trees then your analysis will have to handle a lot of ugly corners
of the language (let alone the fact that parsing C itself is not a
trivial task).

49
devel/cil/pkg/PLIST Normal file
View File

@ -0,0 +1,49 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2004/06/20 16:08:28 avsm Exp $
bin/cilly
bin/patcher
lib/cil/cabs2cil.cmi
lib/cil/cabsvisit.cmi
lib/cil/callgraph.cmi
lib/cil/canonicalize.cmi
lib/cil/check.cmi
lib/cil/cil.a
lib/cil/cil.cma
lib/cil/cil.cmi
lib/cil/cil.cmxa
lib/cil/clexer.cmi
lib/cil/clist.cmi
lib/cil/errormsg.cmi
lib/cil/escape.cmi
lib/cil/formatcil.cmi
lib/cil/frontc.cmi
lib/cil/libperfcount.a
lib/cil/logcalls.cmi
lib/cil/mergecil.cmi
lib/cil/olf.cmi
lib/cil/oneret.cmi
lib/cil/patch.cmi
lib/cil/pretty.cmi
lib/cil/ptranal.cmi
lib/cil/rmtmps.cmi
lib/cil/setp.cmi
lib/cil/stats.cmi
lib/cil/steensgaard.cmi
lib/cil/trace.cmi
lib/cil/uref.cmi
lib/cil/util.cmi
${P5SITE}/CIL/Cilly.pm
${P5SITE}/CIL/KeptFile.pm
${P5SITE}/CIL/OutputFile.pm
${P5SITE}/CIL/TempFile.pm
${P5SITE}/CilConfig.pm
libexec/cil/cilly.asm.exe
libexec/cil/cilly.byte.exe
libexec/cil/machdep.exe
@comment share/cil/Cilly.pm
@comment share/cil/KeptFile.pm
@comment share/cil/OutputFile.pm
@comment share/cil/TempFile.pm
@comment @dirrm share/cil
@dirrm libexec/cil
@dirrm ${P5SITE}/CIL
@dirrm lib/cil