Saturday, May 25, 2019

Re: Move lang/pcc to lang/pcc/pcc, update to 20190521 and add lang/pcc/pcc-libs

On 5/25/19 11:58 AM, Leonid Bobrov wrote:
> On Thu, May 23, 2019 at 12:58:48PM -0400, Brian Callahan wrote:
>>
>> On 5/23/19 8:35 AM, Leonid Bobrov wrote:
>>> In do-test target replace "./cc/cc/pcc" with "./cc/cc/cc".
>> I don't understand this test target at all to be perfectly honest. All it
>> does it make sure the driver program can spit out a single line of text. It
>> doesn't initiate the preprocessor or the actual compiler, and ignores the
>> tests that actually ship with pcc.
>>
>> There are preprocessor tests that ship with the pcc tree that could be run
>> with
>> do-test:
>>         cd ${WRKBUILD}/cc/cpp && ${MAKE_PROGRAM} test
>>
>> There are additional tests for pcc that live in a separate pcc cvs
>> repository. Doesn't seem necessary to grab them for the port. We should
>> either run the cpp tests or not bother with tests at all.
>>
>>> Also p++ is not a C++ compiler, it can't even compile hello world in C++
>>> :(
>> Correct. The way to skip building cxxcom is to edit
>> ${WRKBUILD}/cc/Makefile.in and remove cxxcom from ALL_SUBDIRS. And remove
>> p++ from DRIVERS in cc/cc/Makefile.in so as to not install the p++ driver.
>>
>> Additionally, the port Makefile for pcc should have the environment variable
>> YACC set to yacc (or /usr/bin/yacc), otherwise configure will silently pick
>> up bison if bison is installed.
>>
>> ~Brian
>>
> Ok, I prefer not bothering with cpp tests. Also actually configure
> environment needs YACC. And yeah, this time no cxxcom and p++:
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/lang/pcc/Makefile,v
> retrieving revision 1.17
> diff -u -p -r1.17 Makefile
> --- Makefile 3 May 2019 16:59:10 -0000 1.17
> +++ Makefile 25 May 2019 15:51:13 -0000
> @@ -1,33 +1,7 @@
> # $OpenBSD: Makefile,v 1.17 2019/05/03 16:59:10 danj Exp $
>
> -COMMENT = portable C compiler
> +SUBDIR =
> +SUBDIR += pcc
> +SUBDIR += pcc-libs
>
> -PCCVER = 1.0.0
> -DISTNAME = pcc-${PCCVER}
> -REVISION = 14
> -EXTRACT_SUFX = .tgz
> -
> -CATEGORIES = lang
> -
> -HOMEPAGE = http://pcc.ludd.ltu.se/
> -
> -# Other architectures not fully supported yet
> -ONLY_FOR_ARCHS = i386 amd64
> -
> -# BSD
> -PERMIT_PACKAGE_CDROM = Yes
> -
> -WANTLIB += c
> -
> -MASTER_SITES = http://pcc.ludd.ltu.se/ftp/pub/pcc-releases/ \
> - ftp://pcc.ludd.ltu.se/pub/pcc-releases/
> -
> -CONFIGURE_STYLE = gnu
> -
> -CONFIG = ${MACHINE_ARCH:S/amd64/x86_64/}-unknown-openbsd${OSREV}
> -SUBST_VARS = PCCVER CONFIG
> -
> -do-test:
> - cd ${WRKBUILD} && ./cc/cc/pcc --version
> -
> -.include <bsd.port.mk>
> +.include <bsd.port.subdir.mk>
> Index: Makefile.inc
> ===================================================================
> RCS file: Makefile.inc
> diff -N Makefile.inc
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ Makefile.inc 25 May 2019 15:51:13 -0000
> @@ -0,0 +1,17 @@
> +# $OpenBSD: Makefile,v 1.17 2019/05/03 16:59:10 danj Exp $
> +
> +ONLY_FOR_ARCHS = i386 amd64 sparc64 mips64 mips64el powerpc

How did you come up with this list? Either it should be all archs with
backend code in pcc (in which case you're missing some archs) or it
should be all archs that are known to build (that would be amd64 i386
mips64 mips64el) or it should be all archs that are known to build and
actually work (amd64 i386). You should use the build and actually work list.

> +
> +V = 20190521
> +EXTRACT_SUFX = .tgz
> +
> +CATEGORIES ?= lang
> +
> +HOMEPAGE ?= http://pcc.ludd.ltu.se/
> +
> +# BSD
> +PERMIT_PACKAGE_CDROM = Yes
> +
> +CONFIGURE_STYLE =gnu
> +
> +NO_TEST ?= Yes
> Index: distinfo
> ===================================================================
> RCS file: distinfo
> diff -N distinfo
> --- distinfo 18 Jan 2015 03:14:19 -0000 1.2
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,2 +0,0 @@
> -SHA256 (pcc-1.0.0.tgz) = WALbukbW6j+brapVuQRKBBa7QQAgwkpcKoouqvQRVss=
> -SIZE (pcc-1.0.0.tgz) = 652308
> Index: pcc/Makefile
> ===================================================================
> RCS file: pcc/Makefile
> diff -N pcc/Makefile
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pcc/Makefile 25 May 2019 15:51:13 -0000
> @@ -0,0 +1,21 @@
> +# $OpenBSD: Makefile,v 1.17 2019/05/03 16:59:10 danj Exp $
> +
> +COMMENT = portable C compiler
> +
> +DISTNAME = pcc-${V}

This would make PKGNAME=pcc-${V}, which isn't ok. Likewise, the PKGNAME
for pcc-libs is pcc-libs-${V} which also isn't ok.

~Brian

> +
> +CATEGORIES = lang
> +
> +# BSD
> +PERMIT_PACKAGE_CDROM = Yes
> +
> +WANTLIB += c
> +
> +RUN_DEPENDS = lang/pcc/pcc-libs
> +
> +MASTER_SITES = http://pcc.ludd.ltu.se/ftp/pub/pcc/ \
> + ftp://pcc.ludd.ltu.se/pub/pcc/
> +
> +CONFIGURE_ENV = YACC=/usr/bin/yacc
> +
> +.include <bsd.port.mk>
> Index: pcc/distinfo
> ===================================================================
> RCS file: pcc/distinfo
> diff -N pcc/distinfo
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pcc/distinfo 25 May 2019 15:51:13 -0000
> @@ -0,0 +1,2 @@
> +SHA256 (pcc-20190521.tgz) = Ndw5lkx8zbJnr+al/oIkdVaIpZavfzQLgPiy/n1BD1g=
> +SIZE (pcc-20190521.tgz) = 943299
> Index: pcc/patches/patch-cc_Makefile_in
> ===================================================================
> RCS file: pcc/patches/patch-cc_Makefile_in
> diff -N pcc/patches/patch-cc_Makefile_in
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pcc/patches/patch-cc_Makefile_in 25 May 2019 15:51:13 -0000
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: cc/Makefile.in
> +--- cc/Makefile.in.orig
> ++++ cc/Makefile.in
> +@@ -5,7 +5,7 @@
> +
> + @SET_MAKE@
> +
> +-ALL_SUBDIRS= cc cpp ccom cxxcom
> ++ALL_SUBDIRS= cc cpp ccom
> + DIST_SUBDIRS= $(ALL_SUBDIRS) driver
> +
> + all install clean:
> Index: pcc/patches/patch-cc_cc_Makefile_in
> ===================================================================
> RCS file: pcc/patches/patch-cc_cc_Makefile_in
> diff -N pcc/patches/patch-cc_cc_Makefile_in
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pcc/patches/patch-cc_cc_Makefile_in 25 May 2019 15:51:13 -0000
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: cc/cc/Makefile.in
> +--- cc/cc/Makefile.in.orig
> ++++ cc/cc/Makefile.in
> +@@ -45,7 +45,7 @@ MDIR=$(top_srcdir)/arch/$(TARGMACHDIR)
> + COMMONDIR=$(top_srcdir)/common
> +
> + DEST=cc$(EXEEXT)
> +-DRIVERS=pcc pcpp p++
> ++DRIVERS=pcc pcpp
> +
> + all: $(DEST)
> +
> Index: pcc/pkg/DESCR
> ===================================================================
> RCS file: pcc/pkg/DESCR
> diff -N pcc/pkg/DESCR
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pcc/pkg/DESCR 25 May 2019 15:51:13 -0000
> @@ -0,0 +1,19 @@
> +The compiler is based on the original Portable C Compiler by S. C.
> +Johnson, written in the late 70's. Even though much of the compiler has
> +been rewritten, some of the basics still remain.
> +
> +The intention is to write a C99 compiler while still keeping it small,
> +simple, fast and understandable. Think of it as if it shall be able to
> +compile and run on PDP11 (even if it may not happen in reality). But
> +with this in mind it becomes important to think twice about what
> +algorithms are used.
> +
> +The compiler is conceptually structured in two parts; pass1 which is
> +language-dependent, does parsing, typechecking and build trees, and
> +pass2 which is mostly language-independent.
> +
> +About 50% of the frontend code and 80% of the backend code has been
> +rewritten. Most stuff is written by Anders Magnusson, with the
> +exception of the data-flow analysis part and the SSA conversion code
> +which is written by Peter A Jonsson, and the Mips port that were written
> +as part of a project by undergraduate students at LTU.
> Index: pcc/pkg/PLIST
> ===================================================================
> RCS file: pcc/pkg/PLIST
> diff -N pcc/pkg/PLIST
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pcc/pkg/PLIST 25 May 2019 15:51:13 -0000
> @@ -0,0 +1,9 @@
> +@comment $OpenBSD: PLIST,v$
> +@bin bin/pcc
> +@bin bin/pcpp
> +@bin libexec/ccom
> +@bin libexec/cpp
> +@man man/man1/ccom.1
> +@man man/man1/cpp.1
> +@man man/man1/pcc.1
> +@man man/man1/pcpp.1
> Index: pkg/DESCR
> ===================================================================
> RCS file: pkg/DESCR
> diff -N pkg/DESCR
> --- pkg/DESCR 19 Apr 2012 14:47:17 -0000 1.1.1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,19 +0,0 @@
> -The compiler is based on the original Portable C Compiler by S. C.
> -Johnson, written in the late 70's. Even though much of the compiler has
> -been rewritten, some of the basics still remain.
> -
> -The intention is to write a C99 compiler while still keeping it small,
> -simple, fast and understandable. Think of it as if it shall be able to
> -compile and run on PDP11 (even if it may not happen in reality). But
> -with this in mind it becomes important to think twice about what
> -algorithms are used.
> -
> -The compiler is conceptually structured in two parts; pass1 which is
> -language-dependent, does parsing, typechecking and build trees, and
> -pass2 which is mostly language-independent.
> -
> -About 50% of the frontend code and 80% of the backend code has been
> -rewritten. Most stuff is written by Anders Magnusson, with the
> -exception of the data-flow analysis part and the SSA conversion code
> -which is written by Peter A Jonsson, and the Mips port that were written
> -as part of a project by undergraduate students at LTU.
> Index: pkg/PLIST
> ===================================================================
> RCS file: pkg/PLIST
> diff -N pkg/PLIST
> --- pkg/PLIST 19 Apr 2012 14:47:17 -0000 1.1.1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,12 +0,0 @@
> -@comment $OpenBSD: PLIST,v 1.1.1.1 2012/04/19 14:47:17 okan Exp $
> -@bin bin/pcc
> -lib/pcc/
> -lib/pcc/${CONFIG}/
> -lib/pcc/${CONFIG}/${PCCVER}.RELEASE/
> -lib/pcc/${CONFIG}/${PCCVER}.RELEASE/include/
> -lib/pcc/${CONFIG}/${PCCVER}.RELEASE/lib/
> -@bin libexec/ccom
> -@bin libexec/cpp
> -@man man/man1/ccom.1
> -@man man/man1/cpp.1
> -@man man/man1/pcc.1

No comments:

Post a Comment