Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

24
lang/gpc/DESCR Normal file
View File

@@ -0,0 +1,24 @@
GNU Pascal is the free 32/64-bit Pascal compiler of the GNU Compiler
Collection (GNU CC or GCC). It combines a Pascal front-end with the
proven GCC back-end for code generation and optimization. Unlike
utilities such as p2c, this is a true compiler, not just a converter.
The purpose of the GNU Pascal project is to produce a Pascal compiler
(called GNU Pascal or GPC) which
* combines the clarity of Pascal with powerful tools suitable for
real-life programming,
* supports both the Pascal standard and the Extended Pascal standard
as defined by ISO, ANSI and IEEE (ISO 7185:1990, ISO/IEC
10206:1991, ANSI/IEEE 770X3.160-1989),
* supports other Pascal standards (UCSD Pascal, Borland Pascal,
parts of Borland Delphi and Pascal-SC) in so far as this serves the
goal of clarity and usability,
* may be distributed under GNU license conditions, and
* can generate code for and run on any computer for which the GNU C
compiler can generate code and run on.
The current release implements Standard Pascal (ISO 7185, levels 0 and
1), a large subset of Extended Pascal (ISO 10206, aiming for full
compliance), is highly compatible to Borland Pascal (version 7.0) with
some Delphi extensions, and provides a lot of useful GNU extensions.

78
lang/gpc/Makefile Normal file
View File

@@ -0,0 +1,78 @@
# $NetBSD: Makefile,v 1.35 2013/04/06 20:27:22 rodent Exp $
DISTNAME= gpc-2.1
PKGREVISION= 5
CATEGORIES= lang
MASTER_SITES= http://www.gnu-pascal.de/stable/
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
DISTFILES+= gcc-2.95.3.tar.gz
SITES.gcc-2.95.3.tar.gz=${MASTER_SITE_GNU:=gcc/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.gnu-pascal.de/gpc/h-index.html
COMMENT= GNU Pascal Compiler
PATCH_SITES= ${MASTER_SITE_LOCAL}
PATCHFILES= gcc-2.95.3-diff-2002-08-29.gz
NOT_FOR_PLATFORM+= Interix-*-* *-*-x86_64
WRKSRC= ${WRKDIR}/gcc-2.95.3
USE_TOOLS+= gmake gsed
USE_NCURSES= yes
PLIST_SRC= PLIST
.include "../../mk/bsd.prefs.mk"
GCC_REQD+= 2.95.3
.if ${OPSYS} == "NetBSD"
CFLAGS+= -DNETBSD_NATIVE
GPC_PREFIX= ${PREFIX}
GPC_SUBPREFIX=
PLIST_SRC+= PLIST.netbsd
.else
GPC_PREFIX= ${_GCC_PREFIX}
GPC_SUBPREFIX= ${_GCC_SUBPREFIX}/
.endif
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT= ${WRKSRC}/configure
CONFIGURE_ARGS+= --host=${MACHINE_GNU_PLATFORM:Q}
CONFIGURE_ARGS+= --prefix=${GPC_PREFIX:Q}
CONFIGURE_ARGS+= --infodir=${PREFIX:Q}/${PKGINFODIR:Q}
CONFIGURE_ARGS+= --mandir=${PREFIX:Q}/${PKGMANDIR:Q}
CONFIGURE_ARGS+= --enable-shared
CONFIGURE_ARGS+= --enable-languages=pascal
PLIST_SUBST+= GPC_SUBPREFIX=${GPC_SUBPREFIX:Q}
CONFIGURE_DIRS= ${WRKDIR}/objdir
BUILD_DIRS= ${CONFIGURE_DIRS}
INSTALL_DIRS= ${BUILD_DIRS}/gcc
INSTALL_TARGET= pascal.install
INFO_FILES= yes
post-extract:
${MKDIR} ${WRKSRC}
${CP} ${.CURDIR}/../gcc/files/xm-netbsd.h ${WRKSRC}/gcc/config
${CP} ${.CURDIR}/../gcc/files/xm-target64.h ${WRKSRC}/gcc/config
for file in ${.CURDIR}/../gcc/files/*_* ; do \
arch=`${BASENAME} $${file} | ${SED} -e "s/_.*//"`; \
dest=`${BASENAME} $${file} | ${SED} -e "s/$${arch}_//"`; \
${MKDIR} ${WRKSRC}/gcc/config/$${arch}; \
${CP} $${file} ${WRKSRC}/gcc/config/$${arch}/$${dest}; \
done
${RM} ${WRKSRC}/gcc/config/alpha/netbsd-elf.h
${RM} ${WRKSRC}/gcc/config/arm/t-netbsd
${RM} ${WRKSRC}/gcc/config/mips/x-netbsd
pre-patch:
${MV} -f ${WRKDIR}/gpc-20020510/p ${WRKDIR}/gcc-2.95.3/gcc/
pre-configure:
${MKDIR} ${BUILD_DIRS}
.include "../../mk/bsd.pkg.mk"

307
lang/gpc/PLIST Normal file
View File

@@ -0,0 +1,307 @@
@comment $NetBSD: PLIST,v 1.6 2009/06/14 18:03:33 joerg Exp $
${GPC_SUBPREFIX}bin/gpc
${GPC_SUBPREFIX}bin/gpc-run
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/collect2
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/gpc1
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/gpcpp
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/include/gpc-in-c.h
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/libgpc.a
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/crt.inc
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/crt.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/crtc.c
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/crtc.h
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/crtdjgpp.h
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/crtlinux386.h
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/crtx.c
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/dos.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/dosunix.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/fileutils.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/gmp.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/gmpc.c
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/gpc-bp.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/gpc.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/gpcutil.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/heapmon.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/intl.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/intlc.c
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/md5.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/overlay.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/pipe.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/pipec.c
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/ports.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/printer.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/regex.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/regexc.c
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/rts-config.inc
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/strings.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/stringutils.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/system.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/trap.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/trapc.c
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/turbo3.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/wincrt.pas
${GPC_SUBPREFIX}lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/units/windos.pas
info/gpc.info
info/gpcs-de.info
info/gpcs-hr.info
info/gpcs.info
man/man1/gpc.1
share/doc/gpc/AUTHORS
share/doc/gpc/BUGS
share/doc/gpc/COPYING
share/doc/gpc/COPYING.LIB
share/doc/gpc/FAQ
share/doc/gpc/INSTALL
share/doc/gpc/NEWS
share/doc/gpc/README
share/doc/gpc/demos/README
share/doc/gpc/demos/absdemo.pas
share/doc/gpc/demos/arrayslicedemo.pas
share/doc/gpc/demos/bigmemdemo.pas
share/doc/gpc/demos/bigsetsdemo.pas
share/doc/gpc/demos/binobjdemo.pas
share/doc/gpc/demos/c_gpc.pas
share/doc/gpc/demos/c_gpc_c.c
share/doc/gpc/demos/conformantdemo.pas
share/doc/gpc/demos/crtdemo.pas
share/doc/gpc/demos/crtscreen.c
share/doc/gpc/demos/datetimedemo.pas
share/doc/gpc/demos/demoproc.pas
share/doc/gpc/demos/dosunixdemo.pas
share/doc/gpc/demos/dynamicarraydemo.pas
share/doc/gpc/demos/endiandemo.pas
share/doc/gpc/demos/factorial.pas
share/doc/gpc/demos/fexpanddemo.pas
share/doc/gpc/demos/fibonacci.pas
share/doc/gpc/demos/filebuf1demo.pas
share/doc/gpc/demos/filebuf2demo.pas
share/doc/gpc/demos/filelockdemo.pas
share/doc/gpc/demos/findfilesdemo.pas
share/doc/gpc/demos/formattimedemo.pas
share/doc/gpc/demos/getoptdemo.pas
share/doc/gpc/demos/gettextdemo.pas
share/doc/gpc/demos/gpc_c_c.c
share/doc/gpc/demos/gpc_c_pas.pas
share/doc/gpc/demos/gpc_c_unit.pas
share/doc/gpc/demos/gradient.pas
share/doc/gpc/demos/hello.pas
share/doc/gpc/demos/initvardemo.pas
share/doc/gpc/demos/intfiledemo.pas
share/doc/gpc/demos/iteratordemo.pas
share/doc/gpc/demos/localedemo.pas
share/doc/gpc/demos/mandelbrot.pas
share/doc/gpc/demos/md5demo.pas
share/doc/gpc/demos/packdemo.pas
share/doc/gpc/demos/parserdemo.pas
share/doc/gpc/demos/pexecutedemo.pas
share/doc/gpc/demos/pi.pas
share/doc/gpc/demos/pipedemo.pas
share/doc/gpc/demos/portdemo.pas
share/doc/gpc/demos/power.pas
share/doc/gpc/demos/procvardemo.pas
share/doc/gpc/demos/readdirdemo.pas
share/doc/gpc/demos/realpower.pas
share/doc/gpc/demos/regexdemo.pas
share/doc/gpc/demos/returnvardemo.pas
share/doc/gpc/demos/rwstringdemo.pas
share/doc/gpc/demos/schemademo.pas
share/doc/gpc/demos/statfsdemo.pas
share/doc/gpc/demos/stringhashdemo.pas
share/doc/gpc/demos/stringschemademo.pas
share/doc/gpc/demos/trapdemo.pas
share/doc/gpc/demos/variantdemo.pas
share/doc/gpc/docdemos/README
share/doc/gpc/docdemos/absdemo.pas
share/doc/gpc/docdemos/absolutedemo.pas
share/doc/gpc/docdemos/addrdemo.pas
share/doc/gpc/docdemos/alignofdemo.pas
share/doc/gpc/docdemos/alldemo.pas
share/doc/gpc/docdemos/allmodule.pas
share/doc/gpc/docdemos/and_thendemo.pas
share/doc/gpc/docdemos/andbug.pas
share/doc/gpc/docdemos/anddemo.pas
share/doc/gpc/docdemos/andoperatordemo.pas
share/doc/gpc/docdemos/andproceduredemo.pas
share/doc/gpc/docdemos/andthendemo.pas
share/doc/gpc/docdemos/ansichardemo.pas
share/doc/gpc/docdemos/appenddemo.pas
share/doc/gpc/docdemos/arctandemo.pas
share/doc/gpc/docdemos/argdemo.pas
share/doc/gpc/docdemos/arraydemo.pas
share/doc/gpc/docdemos/asmnamedemo.pas
share/doc/gpc/docdemos/assigneddemo.pas
share/doc/gpc/docdemos/assigntextdemo.pas
share/doc/gpc/docdemos/begindemo.pas
share/doc/gpc/docdemos/bindingdemo.pas
share/doc/gpc/docdemos/bitoperatorproceduredemo.pas
share/doc/gpc/docdemos/bitsizeofdemo.pas
share/doc/gpc/docdemos/booleandemo.pas
share/doc/gpc/docdemos/bpabsolutedemo.pas
share/doc/gpc/docdemos/bparrayinitdemo.pas
share/doc/gpc/docdemos/bpepbasedemo.pas
share/doc/gpc/docdemos/bpinitvardemo.pas
share/doc/gpc/docdemos/bpvariantrecorddemo.pas
share/doc/gpc/docdemos/breakdemo.pas
share/doc/gpc/docdemos/bytebooldemo.pas
share/doc/gpc/docdemos/bytecarddemo.pas
share/doc/gpc/docdemos/bytedemo.pas
share/doc/gpc/docdemos/byteintdemo.pas
share/doc/gpc/docdemos/callc.c
share/doc/gpc/docdemos/callc.h
share/doc/gpc/docdemos/callcdemo.pas
share/doc/gpc/docdemos/callcudemo.pas
share/doc/gpc/docdemos/callcunit.pas
share/doc/gpc/docdemos/carddemo.pas
share/doc/gpc/docdemos/cardinaldemo.pas
share/doc/gpc/docdemos/casedemo.pas
share/doc/gpc/docdemos/caseotherwisedemo.pas
share/doc/gpc/docdemos/chardemo.pas
share/doc/gpc/docdemos/chdirdemo.pas
share/doc/gpc/docdemos/chrdemo.pas
share/doc/gpc/docdemos/cmplxdemo.pas
share/doc/gpc/docdemos/commandlineargumentsdemo.pas
share/doc/gpc/docdemos/compdemo.pas
share/doc/gpc/docdemos/complexdemo.pas
share/doc/gpc/docdemos/complexoperationsdemo.pas
share/doc/gpc/docdemos/concatdemo.pas
share/doc/gpc/docdemos/conjugatedemo.pas
share/doc/gpc/docdemos/continuedemo.pas
share/doc/gpc/docdemos/copydemo.pas
share/doc/gpc/docdemos/cosdemo.pas
share/doc/gpc/docdemos/cstringdemo.pas
share/doc/gpc/docdemos/decdemo.pas
share/doc/gpc/docdemos/demomod2.pas
share/doc/gpc/docdemos/demomod3.pas
share/doc/gpc/docdemos/demomodule.pas
share/doc/gpc/docdemos/demounit.pas
share/doc/gpc/docdemos/directaccessfiledemo.pas
share/doc/gpc/docdemos/doubledemo.pas
share/doc/gpc/docdemos/dpmidemo.pas
share/doc/gpc/docdemos/elsedemo.pas
share/doc/gpc/docdemos/enddemo.pas
share/doc/gpc/docdemos/enumsubrangedemo.pas
share/doc/gpc/docdemos/eparrayinitdemo.pas
share/doc/gpc/docdemos/epbasedemo.pas
share/doc/gpc/docdemos/epvariantrecorddemo.pas
share/doc/gpc/docdemos/exitdemo.pas
share/doc/gpc/docdemos/expdemo.pas
share/doc/gpc/docdemos/extenddemo.pas
share/doc/gpc/docdemos/extendeddemo.pas
share/doc/gpc/docdemos/fardemo.pas
share/doc/gpc/docdemos/foo.pas
share/doc/gpc/docdemos/fordemo.pas
share/doc/gpc/docdemos/getmemdemo.pas
share/doc/gpc/docdemos/getmemfunctiondemo.pas
share/doc/gpc/docdemos/haltdemo.pas
share/doc/gpc/docdemos/highdemo.pas
share/doc/gpc/docdemos/ifdemo.pas
share/doc/gpc/docdemos/imdemo.pas
share/doc/gpc/docdemos/incdecdemo.pas
share/doc/gpc/docdemos/incdemo.pas
share/doc/gpc/docdemos/inittypedemo.pas
share/doc/gpc/docdemos/inlinedemo.pas
share/doc/gpc/docdemos/integerdemo.pas
share/doc/gpc/docdemos/integersizedemo.pas
share/doc/gpc/docdemos/integertypesdemo.pas
share/doc/gpc/docdemos/lndemo.pas
share/doc/gpc/docdemos/localproceduralparameterdemo.pas
share/doc/gpc/docdemos/longbooldemo.pas
share/doc/gpc/docdemos/longcarddemo.pas
share/doc/gpc/docdemos/longestbooldemo.pas
share/doc/gpc/docdemos/longestcarddemo.pas
share/doc/gpc/docdemos/longestintdemo.pas
share/doc/gpc/docdemos/longestrealdemo.pas
share/doc/gpc/docdemos/longestworddemo.pas
share/doc/gpc/docdemos/longintdemo.pas
share/doc/gpc/docdemos/longrealdemo.pas
share/doc/gpc/docdemos/longworddemo.pas
share/doc/gpc/docdemos/lowdemo.pas
share/doc/gpc/docdemos/macrodemo.pas
share/doc/gpc/docdemos/medbooldemo.pas
share/doc/gpc/docdemos/medcarddemo.pas
share/doc/gpc/docdemos/medintdemo.pas
share/doc/gpc/docdemos/medrealdemo.pas
share/doc/gpc/docdemos/medworddemo.pas
share/doc/gpc/docdemos/mkdirdemo.pas
share/doc/gpc/docdemos/moddemo2.pas
share/doc/gpc/docdemos/moduledemo.pas
share/doc/gpc/docdemos/neardemo.pas
share/doc/gpc/docdemos/nildemo.pas
share/doc/gpc/docdemos/nulldemo.pas
share/doc/gpc/docdemos/objectdemo.pas
share/doc/gpc/docdemos/odddemo.pas
share/doc/gpc/docdemos/operatordemo.pas
share/doc/gpc/docdemos/optimizationdemo.pas
share/doc/gpc/docdemos/or_elsedemo.pas
share/doc/gpc/docdemos/orbug.pas
share/doc/gpc/docdemos/ordemo.pas
share/doc/gpc/docdemos/orelsedemo.pas
share/doc/gpc/docdemos/packeddemo.pas
share/doc/gpc/docdemos/packedsubrangedemo.pas
share/doc/gpc/docdemos/pansichardemo.pas
share/doc/gpc/docdemos/paramcountdemo.pas
share/doc/gpc/docdemos/partialfreememdemo.pas
share/doc/gpc/docdemos/pchardemo.pas
share/doc/gpc/docdemos/pointerarithmeticdemo.pas
share/doc/gpc/docdemos/pointerdemo.pas
share/doc/gpc/docdemos/preddemo.pas
share/doc/gpc/docdemos/procptrdemo.pas
share/doc/gpc/docdemos/prog.pas
share/doc/gpc/docdemos/ptrcarddemo.pas
share/doc/gpc/docdemos/ptrdifftypedemo.pas
share/doc/gpc/docdemos/ptrintdemo.pas
share/doc/gpc/docdemos/ptrworddemo.pas
share/doc/gpc/docdemos/pxscoperatordemo.pas
share/doc/gpc/docdemos/realdemo.pas
share/doc/gpc/docdemos/recorddemo.pas
share/doc/gpc/docdemos/redemo.pas
share/doc/gpc/docdemos/repeatdemo.pas
share/doc/gpc/docdemos/resetdemo.pas
share/doc/gpc/docdemos/restricteddemo.pas
share/doc/gpc/docdemos/rewritedemo.pas
share/doc/gpc/docdemos/rmdirdemo.pas
share/doc/gpc/docdemos/rounddemo.pas
share/doc/gpc/docdemos/schema1demo.pas
share/doc/gpc/docdemos/schema2demo.pas
share/doc/gpc/docdemos/schema3demo.pas
share/doc/gpc/docdemos/schemaexoticdemo.pas
share/doc/gpc/docdemos/schemawithdemo.pas
share/doc/gpc/docdemos/setlengthdemo.pas
share/doc/gpc/docdemos/settypedemo.pas
share/doc/gpc/docdemos/shldemo.pas
share/doc/gpc/docdemos/shortbooldemo.pas
share/doc/gpc/docdemos/shortcarddemo.pas
share/doc/gpc/docdemos/shortintdemo.pas
share/doc/gpc/docdemos/shortrealdemo.pas
share/doc/gpc/docdemos/shortworddemo.pas
share/doc/gpc/docdemos/shrdemo.pas
share/doc/gpc/docdemos/sindemo.pas
share/doc/gpc/docdemos/sizeofdemo.pas
share/doc/gpc/docdemos/sizetypedemo.pas
share/doc/gpc/docdemos/slicewritedemo.pas
share/doc/gpc/docdemos/smallintdemo.pas
share/doc/gpc/docdemos/sqrdemo.pas
share/doc/gpc/docdemos/sqrtdemo.pas
share/doc/gpc/docdemos/staticdemo.pas
share/doc/gpc/docdemos/stderrdemo.pas
share/doc/gpc/docdemos/stringdemo.pas
share/doc/gpc/docdemos/stringslicedemo.pas
share/doc/gpc/docdemos/subrangedemo.pas
share/doc/gpc/docdemos/substrdemo.pas
share/doc/gpc/docdemos/succdemo.pas
share/doc/gpc/docdemos/syscall.pas
share/doc/gpc/docdemos/textdemo.pas
share/doc/gpc/docdemos/thendemo.pas
share/doc/gpc/docdemos/trapsoftypecastsdemo.pas
share/doc/gpc/docdemos/truncdemo.pas
share/doc/gpc/docdemos/typecastdemo.pas
share/doc/gpc/docdemos/typecst2demo.pas
share/doc/gpc/docdemos/typedemo.pas
share/doc/gpc/docdemos/typeofdemo.pas
share/doc/gpc/docdemos/typevarinitdemo.pas
share/doc/gpc/docdemos/vardemo.pas
share/doc/gpc/docdemos/voiddemo.pas
share/doc/gpc/docdemos/whiledemo.pas
share/doc/gpc/docdemos/wordbooldemo.pas
share/doc/gpc/docdemos/worddemo.pas
share/doc/gpc/docdemos/xordemo.pas

2
lang/gpc/PLIST.netbsd Normal file
View File

@@ -0,0 +1,2 @@
@comment $NetBSD: PLIST.netbsd,v 1.2 2009/06/14 18:03:33 joerg Exp $
lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3/specs

22
lang/gpc/distinfo Normal file
View File

@@ -0,0 +1,22 @@
$NetBSD: distinfo,v 1.6 2010/02/14 06:58:25 dholland Exp $
SHA1 (gpc-2.1.tar.gz) = fd4c1b6ab70483d8e38c78c3052868c9fde81f13
RMD160 (gpc-2.1.tar.gz) = 67e998a1dfc50debae3617a08c270ab31642b78e
Size (gpc-2.1.tar.gz) = 2954007 bytes
SHA1 (gcc-2.95.3.tar.gz) = 535d27038d161c0e7c2662702e11a48aa97ef622
RMD160 (gcc-2.95.3.tar.gz) = 2c506b7e80cb2b4d9953f4f9753d581cb885f610
Size (gcc-2.95.3.tar.gz) = 12911721 bytes
SHA1 (gcc-2.95.3-diff-2002-08-29.gz) = 9e54a31e78070cba3f6840275350bd0cbf20fe84
RMD160 (gcc-2.95.3-diff-2002-08-29.gz) = cdfa97ed33ad01b5b33f745bdfacf26ec2568b53
Size (gcc-2.95.3-diff-2002-08-29.gz) = 564720 bytes
SHA1 (patch-aa) = 6900465e5c35ebd9b1bb8b9c7e66122fdaffc2de
SHA1 (patch-ab) = 1f6daca7e6abe4c29987f1360d2c77e4c344b6d1
SHA1 (patch-ac) = f42b5ab389c3a51991e61cdb7533875003308001
SHA1 (patch-ad) = 2fb8cda55220bd202a4b7948277d00f293718caf
SHA1 (patch-ae) = b9721d3e89a93736b926e1efcfb9d0fb4904277f
SHA1 (patch-af) = e6cd722650db952555d72564e35b2700565ded3d
SHA1 (patch-ag) = 72d27bfecb2633a1f184cfe9cc8b1194c0d57dfe
SHA1 (patch-ah) = bb4d84561d20d2379a71a442b8711b2c54cf4bf2
SHA1 (patch-ai) = e6b56c677faed4ccc4d2b4f71101227329d32cc7
SHA1 (patch-aj) = 90dbf012c664b93317c5c28249d39b2fdd34497e
SHA1 (patch-ak) = b02fc35f47b5d3cef7fd00605d14fd991c1ca75b

16
lang/gpc/patches/patch-aa Normal file
View File

@@ -0,0 +1,16 @@
$NetBSD: patch-aa,v 1.1.1.1 2003/02/17 18:47:25 jtb Exp $
--- ../gcc-2.95.3/gcc/p/config-lang.in.orig Fri Apr 26 22:15:55 2002
+++ ../gcc-2.95.3/gcc/p/config-lang.in Fri Jan 17 21:58:29 2003
@@ -100,9 +100,9 @@
echo "*** $0 detected GCC version $mainversion." >&2
echo "*** GPC 2.1 requires a patch to GCC to build with version $mainversion." >&2
echo "*** This patch will now be applied." >&2
- echo "*** Press ENTER to continue, Ctrl-C to abort." >&2
+# echo "*** Press ENTER to continue, Ctrl-C to abort." >&2
echo "***" >&2
- read junk
+# read junk
cur_dir="`pwd`"
cd $srcdir

21
lang/gpc/patches/patch-ab Normal file
View File

@@ -0,0 +1,21 @@
$NetBSD: patch-ab,v 1.1.1.1 2003/02/17 18:47:25 jtb Exp $
from revision 1.5 of patch-ae:
Hand edit the alpha/netbsd.h patch. -current gcc relies on a new linker script
which only differs in setting the entry point. Let this use the default
linker script for alpha but force the entry point so this will work on older
NetBSD installs for alpha.
--- ../gcc-2.95.3/gcc/config/alpha/netbsd.h.orig Sun Aug 11 19:38:42 2002
+++ ../gcc-2.95.3/gcc/config/alpha/netbsd.h
@@ -59,7 +59,8 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#define LINK_SPEC \
- "-m elf64alpha_nbsd \
+ "-m elf64alpha \
+ -e __start \
%{O*:-O3} %{!O*:-O1} \
%{assert*} %{R*} \
%{shared:-shared} \

13
lang/gpc/patches/patch-ac Normal file
View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ac,v 1.1.1.1 2003/02/17 18:47:25 jtb Exp $
--- ../gcc-2.95.3/libiberty/Makefile.in.orig Thu Aug 29 20:05:50 2002
+++ ../gcc-2.95.3/libiberty/Makefile.in
@@ -57,7 +57,7 @@ CFLAGS = @CFLAGS@
LIBCFLAGS = $(CFLAGS)
RANLIB = @RANLIB@
-PICFLAG =
+PICFLAG = -fPIC -DPIC
MAKEOVERRIDES =

View File

@@ -0,0 +1,7 @@
$NetBSD: patch-ad,v 1.1.1.1 2003/02/17 18:47:25 jtb Exp $
--- ../gcc-2.95.3/config/mh-sparcpic.orig Thu Feb 5 19:33:03 1998
+++ ../gcc-2.95.3/config/mh-sparcpic
@@ -1 +1 @@
-PICFLAG=`case "${LIBCFLAGS} ${LIBCXXFLAGS}" in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac`
+PICFLAG=`case '${LIBCFLAGS} ${LIBCXXFLAGS}' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac`

View File

@@ -0,0 +1,7 @@
$NetBSD: patch-ae,v 1.1.1.1 2003/02/17 18:47:24 jtb Exp $
--- ../gcc-2.95.3/config/mt-sparcpic.orig Thu Feb 5 19:33:04 1998
+++ ../gcc-2.95.3/config/mt-sparcpic
@@ -1 +1 @@
-PICFLAG_FOR_TARGET=`case "${LIBCFLAGS} ${LIBCXXFLAGS}" in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac`
+PICFLAG_FOR_TARGET=`case '${LIBCFLAGS} ${LIBCXXFLAGS}' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac`

297
lang/gpc/patches/patch-af Normal file
View File

@@ -0,0 +1,297 @@
$NetBSD: patch-af,v 1.2 2010/02/14 06:58:25 dholland Exp $
--- ../gcc-2.95.3/gcc/p/Make-lang.in.orig 2002-05-09 13:50:30.000000000 -0400
+++ ../gcc-2.95.3/gcc/p/Make-lang.in 2010-02-14 01:24:23.000000000 -0500
@@ -44,9 +44,9 @@
# - define the names for selecting the language in LANGUAGES.
GPC_GCC_VERSION_OBJS=
-GPC_GCC_VERSION_OBJS=choose-temp.o pexecute.o # gcc-2.8.1-ONLY
+#GPC_GCC_VERSION_OBJS=choose-temp.o pexecute.o # gcc-2.8.1-ONLY
GPC_GCC_VERSION_MAN1DIR_SUFFIX=man1
-GPC_GCC_VERSION_MAN1DIR_SUFFIX= # gcc-2.8.1-ONLY
+#GPC_GCC_VERSION_MAN1DIR_SUFFIX= # gcc-2.8.1-ONLY
RTSSRCDIR=$(srcdir)/p/rts
@@ -78,8 +78,8 @@ GPC_EXTRA_INSTALL_LIBS=
PASCAL_INSTALL_DOC=pascal.real-install-doc
# Where to install the documentation and demos (relative to the prefix)
-DOC_DIR=doc/gpc
-docdir=$(prefix)/$(DOC_DIR)
+DOC_DIR=share/doc/gpc
+docdir=$(PREFIX)/$(DOC_DIR)
demodir=$(docdir)/demos
docdemodir=$(docdir)/docdemos
@@ -651,72 +651,71 @@ man1dir=$(mandir)/$(GPC_GCC_VERSION_MAN1
pascal.install-info-man-dirs:
for directory in $(infodir) $(man1dir); do \
- $(srcdir)/p/script/mkdir-p -m a+rx $$directory || exit 1; \
+ $(srcdir)/p/script/mkdir-p -m a+rx $(DESTDIR)$$directory || exit 1; \
done
pascal.install-dir:
for directory in $(prefix) $(bindir) $(unitsubdir) $(libsubdir)/include \
$(infodir) $(docdir) $(demodir) $(docdemodir) $(man1dir); do \
- $(srcdir)/p/script/mkdir-p -m a+rx $$directory || exit 1; \
+ $(srcdir)/p/script/mkdir-p -m a+rx $(DESTDIR)$$directory || exit 1; \
done
install-gpcpp: pascal.install-dir gpcpp$(exeext)
- rm -f $(libsubdir)/gpcpp$(exeext)
- $(INSTALL_PROGRAM) gpcpp$(exeext) $(libsubdir)/gpcpp$(exeext)
+ rm -f $(DESTDIR)$(libsubdir)/gpcpp$(exeext)
+ $(INSTALL_PROGRAM) gpcpp$(exeext) $(DESTDIR)$(libsubdir)/gpcpp$(exeext)
# Install the driver program as $(target)-gpc
# and also as either gpc (if native) or $(tooldir)/bin/gpc.
pascal.install-common: pascal.install-dir
if [ -f gpc-cross$(exeext) ]; then \
- rm -f $(bindir)/$(GPC_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) gpc-cross$(exeext) $(bindir)/$(GPC_CROSS_NAME)$(exeext) && \
- chmod a+x $(bindir)/$(GPC_CROSS_NAME)$(exeext); \
+ rm -f $(DESTDIR)$(bindir)/$(GPC_CROSS_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) gpc-cross$(exeext) $(DESTDIR)$(bindir)/$(GPC_CROSS_NAME)$(exeext) && \
+ chmod a+x $(DESTDIR)$(bindir)/$(GPC_CROSS_NAME)$(exeext); \
else \
- rm -f $(bindir)/$(GPC_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) xgpc$(exeext) $(bindir)/$(GPC_INSTALL_NAME)$(exeext) && \
- chmod a+x $(bindir)/$(GPC_INSTALL_NAME)$(exeext); \
+ rm -f $(DESTDIR)$(bindir)/$(GPC_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) xgpc$(exeext) $(DESTDIR)$(bindir)/$(GPC_INSTALL_NAME)$(exeext) && \
+ chmod a+x $(DESTDIR)$(bindir)/$(GPC_INSTALL_NAME)$(exeext); \
fi
- rm -f $(bindir)/gpc-run
- $(INSTALL_PROGRAM) $(srcdir)/p/script/gpc-run $(bindir)/gpc-run
- chmod a+x $(bindir)/gpc-run
+ rm -f $(DESTDIR)$(bindir)/gpc-run
+ $(BSD_INSTALL_SCRIPT) $(srcdir)/p/script/gpc-run $(DESTDIR)$(bindir)/gpc-run
pascal.install-lib: pascal.install-dir pascal.rts
if [ -f libgpc.a ]; then \
- rm -f $(libsubdir)/libgpc.a; \
+ rm -f $(DESTDIR)$(libsubdir)/libgpc.a; \
if $(RANLIB_TEST_FOR_TARGET); then \
$(RANLIB_FOR_TARGET) libgpc.a || exit 1; \
fi; \
- $(INSTALL_DATA) libgpc.a $(libsubdir)/libgpc.a && \
- chmod a-x $(libsubdir)/libgpc.a || exit 1; \
+ $(INSTALL_DATA) libgpc.a $(DESTDIR)$(libsubdir)/libgpc.a && \
+ chmod a-x $(DESTDIR)$(libsubdir)/libgpc.a || exit 1; \
fi
for f in .. $(GPC_EXTRA_INSTALL_LIBS); do \
if [ x"$$f" != x.. ]; then \
- $(INSTALL_DATA) "$$f" "$(libsubdir)/`echo "$$f" | sed -e 's,.*/,,'`" || exit 1; \
+ $(INSTALL_DATA) "$$f" $(DESTDIR)"$(libsubdir)/`echo "$$f" | sed -e 's,.*/,,'`" || exit 1; \
fi; \
done
if [ x$(WITH_SHARED) = xyes ] && [ -f $(GPCSOLIBNAME) ]; then \
- $(srcdir)/p/script/mkdir-p -m a+rx $(prefix)/$(GPCSOLIBDIR) && \
- rm -f $(libsubdir)/$(GPCSOLIBSHORTNAME) $(prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME); \
- $(INSTALL_DATA) $(GPCSOLIBNAME) $(prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME) && \
- chmod a-x $(prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME) && \
- $(SYMLINK) $(real_prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME) $(libsubdir)/$(GPCSOLIBSHORTNAME); \
+ $(srcdir)/p/script/mkdir-p -m a+rx $(DESTDIR)$(prefix)/$(GPCSOLIBDIR) && \
+ rm -f $(libsubdir)/$(GPCSOLIBSHORTNAME) $(DESTDIR)$(prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME); \
+ $(INSTALL_DATA) $(GPCSOLIBNAME) $(DESTDIR)$(prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME) && \
+ chmod a-x $(DESTDIR)$(prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME) && \
+ $(SYMLINK) $(real_prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME) $(DESTDIR)$(libsubdir)/$(GPCSOLIBSHORTNAME); \
else \
true; \
fi
pascal.install-units: pascal.install-dir $(srcdir)/p/units/crtc.h $(RTSSRCDIR)/gpc.pas
- $(INSTALL_DATA) p/rts/rts-config.inc $(unitsubdir)/rts-config.inc
- $(INSTALL_DATA) $(RTSSRCDIR)/gpc.pas $(unitsubdir)/gpc.pas
- chmod a-x $(unitsubdir)/rts-config.inc $(unitsubdir)/gpc.pas
+ $(INSTALL_DATA) p/rts/rts-config.inc $(DESTDIR)$(unitsubdir)/rts-config.inc
+ $(INSTALL_DATA) $(RTSSRCDIR)/gpc.pas $(DESTDIR)$(unitsubdir)/gpc.pas
+ chmod a-x $(DESTDIR)$(unitsubdir)/rts-config.inc $(DESTDIR)$(unitsubdir)/gpc.pas
for f in `cd $(srcdir)/p/units && echo *`; do \
if [ $$f = gpc-in-c.h ]; then \
- rm -f $(libsubdir)/include/$$f; \
- $(INSTALL_DATA) $(srcdir)/p/units/$$f $(libsubdir)/include/$$f || exit 1; \
- chmod a-x $(libsubdir)/include/$$f; \
+ rm -f $(DESTDIR)$(libsubdir)/include/$$f; \
+ $(INSTALL_DATA) $(srcdir)/p/units/$$f $(DESTDIR)$(libsubdir)/include/$$f || exit 1; \
+ chmod a-x $(DESTDIR)$(libsubdir)/include/$$f; \
elif [ $$f != CVS ]; then \
- rm -f $(unitsubdir)/$$f; \
- $(INSTALL_DATA) $(srcdir)/p/units/$$f $(unitsubdir)/$$f || exit 1; \
- chmod a-x $(unitsubdir)/$$f; \
+ rm -f $(DESTDIR)$(unitsubdir)/$$f; \
+ $(INSTALL_DATA) $(srcdir)/p/units/$$f $(DESTDIR)$(unitsubdir)/$$f || exit 1; \
+ chmod a-x $(DESTDIR)$(unitsubdir)/$$f; \
fi; \
done
@@ -728,45 +727,45 @@ pascal.real-install-doc: pascal.install-
$(srcdir)/p/NEWS $(srcdir)/p/FAQ $(srcdir)/p/AUTHORS \
$(srcdir)/p/COPYING $(srcdir)/p/COPYING.LIB $(srcdir)/p/test/README pascal.docdemos
for f in README NEWS INSTALL FAQ AUTHORS COPYING COPYING.LIB; do \
- rm -f "$(docdir)/$$f"; \
- $(INSTALL_DATA) "$(srcdir)/p/$$f" "$(docdir)/$$f" || exit 1; \
- chmod a-x "$(docdir)/$$f"; \
+ rm -f "$(DESTDIR)$(docdir)/$$f"; \
+ $(INSTALL_DATA) "$(srcdir)/p/$$f" "$(DESTDIR)$(docdir)/$$f" || exit 1; \
+ chmod a-x "$(DESTDIR)$(docdir)/$$f"; \
done
- rm -f "$(docdir)/BUGS"
- $(INSTALL_DATA) "$(srcdir)/p/test/README" "$(docdir)/BUGS"
+ rm -f "$(DESTDIR)$(docdir)/BUGS"
+ $(INSTALL_DATA) "$(srcdir)/p/test/README" "$(DESTDIR)$(docdir)/BUGS"
for f in `cd "$(srcdir)/p/demos" && echo *`; do \
if [ "$$f" != CVS ]; then \
- rm -f "$(demodir)/$$f"; \
- $(INSTALL_DATA) "$(srcdir)/p/demos/$$f" "$(demodir)/$$f" || exit 1; \
+ rm -f "$(DESTDIR)$(demodir)/$$f"; \
+ $(INSTALL_DATA) "$(srcdir)/p/demos/$$f" "$(DESTDIR)$(demodir)/$$f" || exit 1; \
fi \
done
- chmod a-x "$(docdir)/BUGS" "$(demodir)"/*
+ chmod a-x "$(DESTDIR)$(docdir)/BUGS" "$(DESTDIR)$(demodir)"/*
if [ "`cd p/docdemos && echo a*`" != "a*" ]; then \
- (cd "$(docdemodir)"; for f in *; do rm -f "$$f"; done) && \
+ (cd "$(DESTDIR)$(docdemodir)"; for f in *; do rm -f "$$f"; done) && \
for f in `cd p/docdemos && echo *`; do \
- rm -f "$(docdemodir)/$$f"; \
- $(INSTALL_DATA) "p/docdemos/$$f" "$(docdemodir)/$$f" && \
- chmod a-x "$(docdemodir)/$$f" || exit 1; \
+ rm -f "$(DESTDIR)$(docdemodir)/$$f"; \
+ $(INSTALL_DATA) "p/docdemos/$$f" "$(DESTDIR)$(docdemodir)/$$f" && \
+ chmod a-x "$(DESTDIR)$(docdemodir)/$$f" || exit 1; \
done; \
fi
pascal.install-info: pascal.install-info-man-dirs pascal.info
- rm -f $(infodir)/gpc.info* $(infodir)/gpcs.info* $(infodir)/gpcs-de.info* $(infodir)/gpcs-hr.info*
+ rm -f $(DESTDIR)$(infodir)/gpc.info* $(DESTDIR)$(infodir)/gpcs.info* $(DESTDIR)$(infodir)/gpcs-de.info* $(DESTDIR)$(infodir)/gpcs-hr.info*
for f in `cd $(srcdir)/p/doc/info && echo gpc.info* gpcs*.info*`; do \
- $(INSTALL_DATA) $(srcdir)/p/doc/info/$$f $(infodir)/$$f || exit 1; \
+ $(INSTALL_DATA) $(srcdir)/p/doc/info/$$f $(DESTDIR)$(infodir)/$$f || exit 1; \
done
- chmod a-x $(infodir)/gpc.info* $(infodir)/gpcs.info* $(infodir)/gpcs-de.info* $(infodir)/gpcs-hr.info*
+ chmod a-x $(DESTDIR)$(infodir)/gpc.info* $(DESTDIR)$(infodir)/gpcs.info* $(DESTDIR)$(infodir)/gpcs-de.info* $(DESTDIR)$(infodir)/gpcs-hr.info*
pascal.install-man: pascal.install-info-man-dirs $(srcdir)/p/doc/en/gpc.1
-if [ -f gpc1$(exeext) ]; then \
if [ -f gpc-cross$(exeext) ]; then \
- rm -f $(man1dir)/$(GPC_CROSS_NAME)$(manext); \
- $(INSTALL_DATA) $(srcdir)/p/doc/en/gpc.1 $(man1dir)/$(GPC_CROSS_NAME)$(manext); \
- chmod a-x $(man1dir)/$(GPC_CROSS_NAME)$(manext); \
+ rm -f $(DESTDIR)$(man1dir)/$(GPC_CROSS_NAME)$(manext); \
+ $(INSTALL_DATA) $(srcdir)/p/doc/en/gpc.1 $(DESTDIR)$(man1dir)/$(GPC_CROSS_NAME)$(manext); \
+ chmod a-x $(DESTDIR)$(man1dir)/$(GPC_CROSS_NAME)$(manext); \
else \
- rm -f $(man1dir)/$(GPC_INSTALL_NAME)$(manext); \
- $(INSTALL_DATA) $(srcdir)/p/doc/en/gpc.1 $(man1dir)/$(GPC_INSTALL_NAME)$(manext); \
- chmod a-x $(man1dir)/$(GPC_INSTALL_NAME)$(manext); \
+ rm -f $(DESTDIR)$(man1dir)/$(GPC_INSTALL_NAME)$(manext); \
+ $(INSTALL_DATA) $(srcdir)/p/doc/en/gpc.1 $(DESTDIR)$(man1dir)/$(GPC_INSTALL_NAME)$(manext); \
+ chmod a-x $(DESTDIR)$(man1dir)/$(GPC_INSTALL_NAME)$(manext); \
fi; \
else \
true; \
@@ -775,22 +774,22 @@ pascal.install-man: pascal.install-info-
pascal.install-hr: pascal.install-info-hr pascal.install-man-hr
pascal.install-info-hr: pascal.install-info-man-dirs pascal.info
- rm -f $(infodir)/gpc-hr.info* $(infodir)/gpcs-hr.info*
+ rm -f $(DESTDIR)$(infodir)/gpc-hr.info* $(DESTDIR)$(infodir)/gpcs-hr.info*
for f in `cd $(srcdir)/p/doc/info && echo gpc-hr.info* gpcs-hr.info*`; do \
- $(INSTALL_DATA) $(srcdir)/p/doc/info/$$f $(infodir)/$$f || exit 1; \
+ $(INSTALL_DATA) $(srcdir)/p/doc/info/$$f $(DESTDIR)$(infodir)/$$f || exit 1; \
done
- chmod a-x $(infodir)/gpc-hr.info* $(infodir)/gpcs-hr.info*
+ chmod a-x $(DESTDIR)$(infodir)/gpc-hr.info* $(DESTDIR)$(infodir)/gpcs-hr.info*
pascal.install-man-hr: pascal.install-info-man-dirs $(srcdir)/p/doc/hr/gpc.1
-if [ -f gpc1$(exeext) ]; then \
if [ -f gpc-cross$(exeext) ]; then \
- rm -f $(man1dir)/$(GPC_CROSS_NAME)-hr$(manext); \
- $(INSTALL_DATA) $(srcdir)/p/doc/hr/gpc.1 $(man1dir)/$(GPC_CROSS_NAME)-hr$(manext); \
- chmod a-x $(man1dir)/$(GPC_CROSS_NAME)-hr$(manext); \
+ rm -f $(DESTDIR)$(man1dir)/$(GPC_CROSS_NAME)-hr$(manext); \
+ $(INSTALL_DATA) $(srcdir)/p/doc/hr/gpc.1 $(DESTDIR)$(man1dir)/$(GPC_CROSS_NAME)-hr$(manext); \
+ chmod a-x $(DESTDIR)$(man1dir)/$(GPC_CROSS_NAME)-hr$(manext); \
else \
- rm -f $(man1dir)/$(GPC_INSTALL_NAME)-hr$(manext); \
- $(INSTALL_DATA) $(srcdir)/p/doc/en/gpc.1 $(man1dir)/$(GPC_INSTALL_NAME)-hr$(manext); \
- chmod a-x $(man1dir)/$(GPC_INSTALL_NAME)-hr$(manext); \
+ rm -f $(DESTDIR)$(man1dir)/$(GPC_INSTALL_NAME)-hr$(manext); \
+ $(INSTALL_DATA) $(srcdir)/p/doc/en/gpc.1 $(DESTDIR)$(man1dir)/$(GPC_INSTALL_NAME)-hr$(manext); \
+ chmod a-x $(DESTDIR)$(man1dir)/$(GPC_INSTALL_NAME)-hr$(manext); \
fi; \
else \
true; \
@@ -801,25 +800,25 @@ pascal.install-man-hr: pascal.install-in
pascal.install-compiler: pascal.install-dir pascal
for file in gpc1$(exeext); do \
if [ -f $$file ]; then \
- rm -f $(libsubdir)/$$file; \
- $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file || exit 1; \
+ rm -f $(DESTDIR)$(libsubdir)/$$file; \
+ $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libsubdir)/$$file || exit 1; \
fi; \
done; exit 0
for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
- if [ x"$$file" != x.. ] && [ ! -f $(libsubdir)/$$file ]; then \
- $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file || exit 1; \
+ if [ x"$$file" != x.. ] && [ ! -f $(DESTDIR)$(libsubdir)/$$file ]; then \
+ $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libsubdir)/$$file || exit 1; \
fi; \
done; exit 0
for file in $(EXTRA_PARTS) ..; do \
- if [ x"$$file" != x.. ] && [ ! -f $(libsubdir)/$$file ]; then \
- $(INSTALL_DATA) $$file $(libsubdir)/$$file && \
- chmod a-x $(libsubdir)/$$file || exit 1; \
+ if [ x"$$file" != x.. ] && [ ! -f $(DESTDIR)$(libsubdir)/$$file ]; then \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(libsubdir)/$$file && \
+ chmod a-x $(DESTDIR)$(libsubdir)/$$file || exit 1; \
fi; \
done; exit 0
# Don't mess with specs if it doesn't exist yet.
- if [ -f specs ] && [ ! -f $(libsubdir)/specs ]; then \
- $(INSTALL_DATA) specs $(libsubdir)/specs && \
- chmod a-x $(libsubdir)/specs || exit 1; \
+ if [ -f specs ] && [ ! -f $(DESTDIR)$(libsubdir)/specs ]; then \
+ $(INSTALL_DATA) specs $(DESTDIR)$(libsubdir)/specs && \
+ chmod a-x $(DESTDIR)$(libsubdir)/specs || exit 1; \
fi; exit 0
pascal.install-normal: pascal.install-common pascal.install-compiler \
@@ -837,23 +836,23 @@ pascal.install-with-gcc: $(INSTALL_HEADE
for file in cc1$(exeext) cpp$(exeext) cpp0$(exeext); do \
if [ -f $$file ]; then \
rm -f $(libsubdir)/$$file; \
- $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file || exit 1; \
+ $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libsubdir)/$$file || exit 1; \
fi; \
done; exit 0
# Install libgcc.a @@FIXME: doesn't handle multilib (multiple libgcc.a)
- if [ -f libgcc.a ] && [ ! -f $(libsubdir)/libgcc.a ]; then \
+ if [ -f libgcc.a ] && [ ! -f $(DESTDIR)$(libsubdir)/libgcc.a ]; then \
if $(RANLIB_TEST_FOR_TARGET); then \
$(RANLIB_FOR_TARGET) libgcc.a || exit 1; \
fi; \
- $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a && \
- chmod a-x $(libsubdir)/libgcc.a || exit 1; \
+ $(INSTALL_DATA) libgcc.a $(DESTDIR)$(libsubdir)/libgcc.a && \
+ chmod a-x $(DESTDIR)$(libsubdir)/libgcc.a || exit 1; \
fi; exit 0
pascal.uninstall:
- -rm -rf $(bindir)/$(GPC_INSTALL_NAME)$(exeext)
- -rm -rf $(bindir)/$(GPC_CROSS_NAME)$(exeext)
- -rm -rf $(man1dir)/$(GPC_INSTALL_NAME)$(manext)
- -rm -rf $(man1dir)/$(GPC_CROSS_NAME)$(manext)
+ -rm -rf $(DESTDIR)$(bindir)/$(GPC_INSTALL_NAME)$(exeext)
+ -rm -rf $(DESTDIR)$(bindir)/$(GPC_CROSS_NAME)$(exeext)
+ -rm -rf $(DESTDIR)$(man1dir)/$(GPC_INSTALL_NAME)$(manext)
+ -rm -rf $(DESTDIR)$(man1dir)/$(GPC_CROSS_NAME)$(manext)
pascal.bindist: pascal
tmp_base=`pwd`/tmp && \

161
lang/gpc/patches/patch-ag Normal file
View File

@@ -0,0 +1,161 @@
$NetBSD: patch-ag,v 1.1 2003/07/12 11:39:52 jtb Exp $
--- ../gcc-2.95.3/gcc/config/netbsd.h
+++ ../gcc-2.95.3/gcc/config/netbsd.h.orig
@@ -36,10 +36,13 @@
/* Provide a CPP_SPEC appropriate for NetBSD. Current we just deal with
- the GCC option `-posix'. */
+ the GCC option `-posix'. We also deal with -pthread, which is required
+ for the 2.95.3 STL to work. */
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC \
+ "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
+ %{pthread:-D_REENTRANT -D_PTHREADS}"
/* Provide an ASM_SPEC appropriate for NetBSD. Currently we only deal
with the options for generating PIC code. */
@@ -54,7 +57,8 @@
#undef LIB_SPEC
#define LIB_SPEC \
- "%{posix:%{!p:%{!pg:-lposix}}%{p:-lposix_p}%{pg:-lposix_p}} \
+ "%{pthread:%{!p:%{!pg:-lpthread}}%{p:-lpthread_p}%{pg:-lpthread_p}} \
+ %{posix:%{!p:%{!pg:-lposix}}%{p:-lposix_p}%{pg:-lposix_p}} \
%{!shared:%{!symbolic:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}}"
/* Provide a LIBGCC_SPEC appropriate for NetBSD. We also want to exclude
@@ -64,7 +68,7 @@
#ifdef NETBSD_NATIVE
#define LIBGCC_SPEC "%{!symbolic:%{!shared:%{!p:%{!pg:-lgcc}}}%{shared:-lgcc_pic}%{p:-lgcc_p}%{pg:-lgcc_p}}"
#else
-#define LIBGCC_SPEC "%{!shared:%{!symbolic:-lgcc}}"
+#define LIBGCC_SPEC "%{!symbolic:%{!shared:-lgcc}%{shared:-lgcc_pic}}"
#endif
/* #ifdef NETBSD_AOUT */
@@ -147,6 +151,96 @@
#define ASM_DECLARE_RESULT(FILE, RESULT)
#endif
+/* NetBSD a.out support begins here. */
+
+#ifndef NETBSD_ELF
+
+#undef DWARF_DEBUGGING_INFO /* XXX */
+#undef DWARF2_DEBUGGING_INFO /* XXX */
+
+/* Write the extra assembler code needed to declare a function properly.
+ Some svr4 assemblers need to also have something extra said about the
+ function's return value. We allow for that here. */
+
+#undef ASM_DECLARE_FUNCTION_NAME
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
+ do { \
+ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ putc (',', FILE); \
+ fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
+ putc ('\n', FILE); \
+ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
+ ASM_OUTPUT_LABEL(FILE, NAME); \
+ } while (0)
+
+/* Write the extra assembler code needed to declare an object properly. */
+
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
+ do { \
+ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ putc (',', FILE); \
+ fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
+ putc ('\n', FILE); \
+ size_directive_output = 0; \
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
+ { \
+ size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
+ } \
+ ASM_OUTPUT_LABEL(FILE, NAME); \
+ } while (0)
+
+/* Output the size directive for a decl in rest_of_decl_compilation
+ in the case where we did not do so before the initializer.
+ Once we find the error_mark_node, we know that the value of
+ size_directive_output was set
+ by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+
+#undef ASM_FINISH_DECLARE_OBJECT
+#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
+do { \
+ char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
+ && ! AT_END && TOP_LEVEL \
+ && DECL_INITIAL (DECL) == error_mark_node \
+ && !size_directive_output) \
+ { \
+ size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, name); \
+ fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
+ } \
+ } while (0)
+
+/* This is how to declare the size of a function. */
+
+#undef ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
+ do { \
+ if (!flag_inhibit_size_directive) \
+ { \
+ char label[256]; \
+ static int labelno; \
+ labelno++; \
+ ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, (FNAME)); \
+ fprintf (FILE, ","); \
+ assemble_name (FILE, label); \
+ fprintf (FILE, "-"); \
+ assemble_name (FILE, (FNAME)); \
+ putc ('\n', FILE); \
+ } \
+ } while (0)
+
+#endif
+
/* NetBSD ELF support begins here. */
#ifdef NETBSD_ELF
@@ -167,6 +261,7 @@
%{!pg: \
%{p:gcrt0%O%s} \
%{!p:crt0%O%s}}} \
+ %:if-exists(crti%O%s) \
%{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}"
/* Provide an ENDFILE_SPEC appropriate for NetBSD ELF targets. Here we
@@ -175,13 +270,14 @@
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
- "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+ "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \
+ %:if-exists(crtn%O%s)"
/* Provide a LINK_SPEC appropriate for a NetBSD ELF target. */
#undef LINK_SPEC
#define LINK_SPEC \
- "%{assert*} \
+ "%{assert*} %{R*} \
%{shared:-shared} \
%{!shared: \
-dc -dp \

361
lang/gpc/patches/patch-ah Normal file
View File

@@ -0,0 +1,361 @@
$NetBSD: patch-ah,v 1.1 2003/07/12 11:39:52 jtb Exp $
--- ../gcc-2.95.3/gcc/gcc.c.orig
+++ ../gcc-2.95.3/gcc/gcc.c
@@ -189,9 +189,13 @@
static void clear_failure_queue PROTO((void));
static int check_live_switch PROTO((int, int));
static const char *handle_braces PROTO((const char *));
+static const struct spec_function *lookup_spec_function PROTO((const char *));
+static const char *eval_spec_function PROTO((const char *, const char *));
+static const char *handle_spec_function PROTO((const char *));
static char *save_string PROTO((const char *, int));
extern int do_spec PROTO((const char *));
static int do_spec_1 PROTO((const char *, int, const char *));
+static int do_spec_2 PROTO((const char *));
static const char *find_file PROTO((const char *));
static int is_directory PROTO((const char *, const char *, int));
static void validate_switches PROTO((const char *));
@@ -216,6 +220,7 @@
static void process_command PROTO ((int, char **));
static int execute PROTO ((void));
static void unused_prefix_warnings PROTO ((struct path_prefix *));
+static void alloc_args PROTO ((void));
static void clear_args PROTO ((void));
static void fatal_error PROTO ((int));
@@ -231,6 +236,8 @@
/* Number of extra output files that lang_specific_pre_link may generate. */
extern int lang_specific_extra_outfiles;
+static const char *if_exists_spec_function PROTO ((int, const char **));
+
/* Specs are strings containing lines, each of which (if not blank)
is made up of a program name, and arguments separated by spaces.
The program name must be exact and start from root, since no path
@@ -335,6 +342,12 @@
%* substitute the variable part of a matched option. (See below.)
Note that each comma in the substituted string is replaced by
a single space.
+ %:function(args)
+ Call the named function FUNCTION, passing it ARGS. ARGS is
+ first processed as a nested spec string, then split into an
+ argument vector in the usual fashion. The function returns
+ a string which is processed as if it had appeared literally
+ as part of the current spec.
%{S} substitutes the -S switch, if that switch was given to CC.
If that switch was not specified, this substitutes nothing.
Here S is a metasyntactic variable.
@@ -1162,6 +1175,24 @@
static struct spec_list *specs = (struct spec_list *)0;
+/* The mapping of a spec function name to the C function that
+ implements it. */
+struct spec_function
+{
+ const char *name;
+ const char *(*func) PROTO ((int, const char **));
+};
+
+/* List of static spec functions. */
+
+static const struct spec_function static_spec_functions[] =
+{
+ { "if-exists", if_exists_spec_function },
+ { 0, 0 }
+};
+
+static int processing_spec_function;
+
/* Initialize the specs lookup routines. */
static void
@@ -1404,6 +1435,15 @@
static const char *multilib_dir;
+/* Allocate the argument vector. */
+
+static void
+alloc_args ()
+{
+ argbuf_length = 10;
+ argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
+}
+
/* Clear out the vector of arguments (after a command is executed). */
static void
@@ -2211,6 +2251,9 @@
struct command *commands; /* each command buffer with above info. */
+ if (processing_spec_function)
+ abort ();
+
/* Count # of piped commands. */
for (n_commands = 1, i = 0; i < argbuf_index; i++)
if (strcmp (argbuf[i], "|") == 0)
@@ -3360,14 +3403,7 @@
{
int value;
- clear_args ();
- arg_going = 0;
- delete_this_arg = 0;
- this_is_output_file = 0;
- this_is_library_file = 0;
- input_from_pipe = 0;
-
- value = do_spec_1 (spec, 0, NULL_PTR);
+ value = do_spec_2 (spec);
/* Force out any unfinished command.
If -pipe, this forces out the last command if it ended in `|'. */
@@ -3383,6 +3419,20 @@
return value;
}
+static int
+do_spec_2 (spec)
+ const char *spec;
+{
+ clear_args ();
+ arg_going = 0;
+ delete_this_arg = 0;
+ this_is_output_file = 0;
+ this_is_library_file = 0;
+ input_from_pipe = 0;
+
+ return do_spec_1 (spec, 0, NULL_PTR);
+}
+
/* Process the sub-spec SPEC as a portion of a larger spec.
This is like processing a whole spec except that we do
not initialize at the beginning and we do not supply a
@@ -4068,6 +4118,12 @@
return -1;
break;
+ case ':':
+ p = handle_spec_function (p);
+ if (p == 0)
+ return -1;
+ break;
+
case '%':
obstack_1grow (&obstack, '%');
break;
@@ -4222,7 +4278,173 @@
arg_going = 1;
}
- return 0; /* End of string */
+ /* End of string. If we are processing a spec function, we need to
+ end any pending argument. */
+ if (processing_spec_function && arg_going)
+ {
+ obstack_1grow (&obstack, 0);
+ string = obstack_finish (&obstack);
+ if (this_is_library_file)
+ string = find_file (string);
+ store_arg (string, delete_this_arg, this_is_output_file);
+ if (this_is_output_file)
+ outfiles[input_file_number] = string;
+ arg_going = 0;
+ }
+
+ return 0;
+}
+
+/* Look up a spec function. */
+
+static const struct spec_function *
+lookup_spec_function (name)
+ const char *name;
+{
+ static const struct spec_function * const spec_function_tables[] =
+ {
+ static_spec_functions,
+ };
+ const struct spec_function *sf;
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE (spec_function_tables); i++)
+ {
+ for (sf = spec_function_tables[i]; sf->name != NULL; sf++)
+ if (strcmp (sf->name, name) == 0)
+ return sf;
+ }
+
+ return NULL;
+}
+
+/* Evaluate a spec function. */
+
+static const char *
+eval_spec_function (func, args)
+ const char *func, *args;
+{
+ const struct spec_function *sf;
+ const char *funcval;
+
+ /* Saved spec processing context. */
+ int save_argbuf_index;
+ int save_argbuf_length;
+ char **save_argbuf;
+
+ int save_arg_going;
+ int save_delete_this_arg;
+ int save_this_is_output_file;
+ int save_this_is_library_file;
+ int save_input_from_pipe;
+
+
+ sf = lookup_spec_function (func);
+ if (sf == NULL)
+ fatal ("unknown spec function `%s'", func);
+
+ /* Push the spec processing context. */
+ save_argbuf_index = argbuf_index;
+ save_argbuf_length = argbuf_length;
+ save_argbuf = argbuf;
+
+ save_arg_going = arg_going;
+ save_delete_this_arg = delete_this_arg;
+ save_this_is_output_file = this_is_output_file;
+ save_this_is_library_file = this_is_library_file;
+ save_input_from_pipe = input_from_pipe;
+
+ /* Create a new spec processing context, and build the function
+ arguments. */
+
+ alloc_args ();
+ if (do_spec_2 (args) < 0)
+ fatal ("error in args to spec function `%s'", func);
+
+ /* argbuf_index is an index for the next argument to be inserted, and
+ so contains the count of the args already inserted. */
+
+ funcval = (*sf->func) (argbuf_index, (const char **) argbuf);
+
+ /* Pop the spec processing context. */
+ argbuf_index = save_argbuf_index;
+ argbuf_length = save_argbuf_length;
+ free (argbuf);
+ argbuf = save_argbuf;
+
+ arg_going = save_arg_going;
+ delete_this_arg = save_delete_this_arg;
+ this_is_output_file = save_this_is_output_file;
+ this_is_library_file = save_this_is_library_file;
+ input_from_pipe = save_input_from_pipe;
+
+ return funcval;
+}
+
+/* Handle a spec function call of the form:
+
+ %:function(args)
+
+ ARGS is processed as a spec in a separate context and split into an
+ argument vector in the normal fashion. The function returns a string
+ containing a spec which we then process in the caller's context, or
+ NULL if no processing is required. */
+
+static const char *
+handle_spec_function (p)
+ const char *p;
+{
+ char *func, *args;
+ const char *endp, *funcval;
+ int count;
+
+ processing_spec_function++;
+
+ /* Get the function name. */
+ for (endp = p; *endp != '\0'; endp++)
+ {
+ if (*endp == '(') /* ) */
+ break;
+ /* Only allow [A-Za-z0-9], -, and _ in function names. */
+ if (!ISALNUM (*endp) && !(*endp == '-' || *endp == '_'))
+ fatal ("malformed spec function name");
+ }
+ if (*endp != '(') /* ) */
+ fatal ("no arguments for spec function");
+ func = save_string (p, endp - p);
+ p = ++endp;
+
+ /* Get the arguments. */
+ for (count = 0; *endp != '\0'; endp++)
+ {
+ /* ( */
+ if (*endp == ')')
+ {
+ if (count == 0)
+ break;
+ count--;
+ }
+ else if (*endp == '(') /* ) */
+ count++;
+ }
+ /* ( */
+ if (*endp != ')')
+ fatal ("malformed spec function arguments");
+ args = save_string (p, endp - p);
+ p = ++endp;
+
+ /* p now points to just past the end of the spec function expression. */
+
+ funcval = eval_spec_function (func, args);
+ if (funcval != NULL && do_spec_1 (funcval, 0, NULL) < 0)
+ p = NULL;
+
+ free (func);
+ free (args);
+
+ processing_spec_function--;
+
+ return p;
}
/* Return 0 if we call do_spec_1 and that returns -1. */
@@ -4674,8 +4896,8 @@
signal (SIGPIPE, fatal_error);
#endif
- argbuf_length = 10;
- argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
+ /* Allocate the argument vector. */
+ alloc_args ();
obstack_init (&obstack);
@@ -5846,3 +6068,25 @@
++p;
}
}
+
+/* if-exists built-in spec function.
+
+ Checks to see if the file specified by the absolute pathname in
+ ARGS exists. Returns that pathname if found.
+
+ The usual use for this function is to check for a library file
+ (whose name has been expanded with %s). */
+
+#define IS_ABSOLUTE_PATHNAME(cp) ((cp)[0] == '/')
+
+static const char *
+if_exists_spec_function (argc, argv)
+ int argc;
+ const char **argv;
+{
+ /* Must have only one argument. */
+ if (argc == 1 && IS_ABSOLUTE_PATHNAME (argv[0]) && ! access (argv[0], R_OK))
+ return argv[0];
+
+ return NULL;
+}

420
lang/gpc/patches/patch-ai Normal file
View File

@@ -0,0 +1,420 @@
$NetBSD: patch-ai,v 1.1 2003/07/12 11:39:53 jtb Exp $
--- ../gcc-2.95.3/gcc/p/gpc.c.orig
+++ ../gcc-2.95.3/gcc/p/gpc.c
@@ -245,9 +245,13 @@
static void clear_failure_queue PROTO((void));
static int check_live_switch PROTO((int, int));
static const char *handle_braces PROTO((const char *));
+static const struct spec_function *lookup_spec_function PROTO((const char *));
+static const char *eval_spec_function PROTO((const char *, const char *));
+static const char *handle_spec_function PROTO((const char *));
static char *save_string PROTO((const char *, int));
extern int do_spec PROTO((const char *));
static int do_spec_1 PROTO((const char *, int, const char *));
+static int do_spec_2 PROTO((const char *));
static const char *find_file PROTO((const char *));
static int is_directory PROTO((const char *, const char *, int));
static void validate_switches PROTO((const char *));
@@ -280,6 +284,7 @@
static void process_command PROTO ((int, char **));
static int execute PROTO ((void));
static void unused_prefix_warnings PROTO ((struct path_prefix *));
+static void alloc_args PROTO ((void));
static void clear_args PROTO ((void));
static void fatal_error PROTO ((int));
@@ -290,6 +295,9 @@
extern char *xrealloc PROTO((void *, size_t));
#endif
+
+static const char *if_exists_spec_function PROTO ((int, const char **));
+
/* Specs are strings containing lines, each of which (if not blank)
is made up of a program name, and arguments separated by spaces.
The program name must be exact and start from root, since no path
@@ -373,6 +381,12 @@
%* substitute the variable part of a matched option. (See below.)
Note that each comma in the substituted string is replaced by
a single space.
+ %:function(args)
+ Call the named function FUNCTION, passing it ARGS. ARGS is
+ first processed as a nested spec string, then split into an
+ argument vector in the usual fashion. The function returns
+ a string which is processed as if it had appeared literally
+ as part of the current spec.
%{S} substitutes the -S switch, if that switch was given to CC.
If that switch was not specified, this substitutes nothing.
Here S is a metasyntactic variable.
@@ -1370,6 +1384,24 @@
static struct spec_list *specs = (struct spec_list *)0;
+/* The mapping of a spec function name to the C function that
+ implements it. */
+struct spec_function
+{
+ const char *name;
+ const char *(*func) PROTO ((int, const char **));
+};
+
+/* List of static spec functions. */
+
+static const struct spec_function static_spec_functions[] =
+{
+ { "if-exists", if_exists_spec_function },
+ { 0, 0 }
+};
+
+static int processing_spec_function;
+
/* Initialize the specs lookup routines. */
static void
@@ -1598,6 +1630,15 @@
static char *multilib_dir;
+/* Allocate the argument vector. */
+
+static void
+alloc_args ()
+{
+ argbuf_length = 10;
+ argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
+}
+
#ifdef GPC
/* Print a help screen and exit */
static void print_message_and_exit PROTO((void));
@@ -2482,6 +2523,9 @@
struct command *commands; /* each command buffer with above info. */
+ if (processing_spec_function)
+ abort ();
+
/* Count # of piped commands. */
for (n_commands = 1, i = 0; i < argbuf_index; i++)
if (strcmp (argbuf[i], "|") == 0)
@@ -2665,6 +2709,11 @@
static int n_infiles;
+/* This counts the number of libraries added by lang_specific_driver, so that
+ we can tell if there were any user supplied any files or libraries. */
+
+static int added_libraries;
+
/* And a vector of corresponding output files is made up later. */
static const char **outfiles;
@@ -2851,7 +2900,7 @@
strncpy (nstore, startp, endp-startp);
if (endp == startp)
strcpy (nstore, concat (".", dir_separator_str, NULL_PTR));
- else if (endp[-1] != '/' && endp[-1] != DIR_SEPARATOR)
+ else if (!IS_DIR_SEPARATOR (endp[-1]))
{
nstore[endp-startp] = DIR_SEPARATOR;
nstore[endp-startp+1] = 0;
@@ -2882,7 +2931,7 @@
strncpy (nstore, startp, endp-startp);
if (endp == startp)
strcpy (nstore, concat (".", dir_separator_str, NULL_PTR));
- else if (endp[-1] != '/' && endp[-1] != DIR_SEPARATOR)
+ else if (!IS_DIR_SEPARATOR (endp[-1]))
{
nstore[endp-startp] = DIR_SEPARATOR;
nstore[endp-startp+1] = 0;
@@ -2915,7 +2964,7 @@
strncpy (nstore, startp, endp-startp);
if (endp == startp)
strcpy (nstore, concat (".", dir_separator_str, NULL_PTR));
- else if (endp[-1] != '/' && endp[-1] != DIR_SEPARATOR)
+ else if (!IS_DIR_SEPARATOR (endp[-1]))
{
nstore[endp-startp] = DIR_SEPARATOR;
nstore[endp-startp+1] = 0;
@@ -3518,14 +3567,7 @@
{
int value;
- clear_args ();
- arg_going = 0;
- delete_this_arg = 0;
- this_is_output_file = 0;
- this_is_library_file = 0;
- input_from_pipe = 0;
-
- value = do_spec_1 (spec, 0, NULL_PTR);
+ value = do_spec_2 (spec);
/* Force out any unfinished command.
If -pipe, this forces out the last command if it ended in `|'. */
@@ -3541,6 +3583,20 @@
return value;
}
+static int
+do_spec_2 (spec)
+ const char *spec;
+{
+ clear_args ();
+ arg_going = 0;
+ delete_this_arg = 0;
+ this_is_output_file = 0;
+ this_is_library_file = 0;
+ input_from_pipe = 0;
+
+ return do_spec_1 (spec, 0, NULL_PTR);
+}
+
/* Process the sub-spec SPEC as a portion of a larger spec.
This is like processing a whole spec except that we do
not initialize at the beginning and we do not supply a
@@ -4258,6 +4314,12 @@
return -1;
break;
+ case ':':
+ p = handle_spec_function (p);
+ if (p == 0)
+ return -1;
+ break;
+
case '%':
obstack_1grow (&obstack, '%');
break;
@@ -4414,7 +4476,173 @@
arg_going = 1;
}
- return 0; /* End of string */
+ /* End of string. If we are processing a spec function, we need to
+ end any pending argument. */
+ if (processing_spec_function && arg_going)
+ {
+ obstack_1grow (&obstack, 0);
+ string = obstack_finish (&obstack);
+ if (this_is_library_file)
+ string = find_file (string);
+ store_arg (string, delete_this_arg, this_is_output_file);
+ if (this_is_output_file)
+ outfiles[input_file_number] = string;
+ arg_going = 0;
+ }
+
+ return 0;
+}
+
+/* Look up a spec function. */
+
+static const struct spec_function *
+lookup_spec_function (name)
+ const char *name;
+{
+ static const struct spec_function * const spec_function_tables[] =
+ {
+ static_spec_functions,
+ };
+ const struct spec_function *sf;
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE (spec_function_tables); i++)
+ {
+ for (sf = spec_function_tables[i]; sf->name != NULL; sf++)
+ if (strcmp (sf->name, name) == 0)
+ return sf;
+ }
+
+ return NULL;
+}
+
+/* Evaluate a spec function. */
+
+static const char *
+eval_spec_function (func, args)
+ const char *func, *args;
+{
+ const struct spec_function *sf;
+ const char *funcval;
+
+ /* Saved spec processing context. */
+ int save_argbuf_index;
+ int save_argbuf_length;
+ char **save_argbuf;
+
+ int save_arg_going;
+ int save_delete_this_arg;
+ int save_this_is_output_file;
+ int save_this_is_library_file;
+ int save_input_from_pipe;
+
+
+ sf = lookup_spec_function (func);
+ if (sf == NULL)
+ fatal ("unknown spec function `%s'", func);
+
+ /* Push the spec processing context. */
+ save_argbuf_index = argbuf_index;
+ save_argbuf_length = argbuf_length;
+ save_argbuf = argbuf;
+
+ save_arg_going = arg_going;
+ save_delete_this_arg = delete_this_arg;
+ save_this_is_output_file = this_is_output_file;
+ save_this_is_library_file = this_is_library_file;
+ save_input_from_pipe = input_from_pipe;
+
+ /* Create a new spec processing context, and build the function
+ arguments. */
+
+ alloc_args ();
+ if (do_spec_2 (args) < 0)
+ fatal ("error in args to spec function `%s'", func);
+
+ /* argbuf_index is an index for the next argument to be inserted, and
+ so contains the count of the args already inserted. */
+
+ funcval = (*sf->func) (argbuf_index, (const char **) argbuf);
+
+ /* Pop the spec processing context. */
+ argbuf_index = save_argbuf_index;
+ argbuf_length = save_argbuf_length;
+ free (argbuf);
+ argbuf = save_argbuf;
+
+ arg_going = save_arg_going;
+ delete_this_arg = save_delete_this_arg;
+ this_is_output_file = save_this_is_output_file;
+ this_is_library_file = save_this_is_library_file;
+ input_from_pipe = save_input_from_pipe;
+
+ return funcval;
+}
+
+/* Handle a spec function call of the form:
+
+ %:function(args)
+
+ ARGS is processed as a spec in a separate context and split into an
+ argument vector in the normal fashion. The function returns a string
+ containing a spec which we then process in the caller's context, or
+ NULL if no processing is required. */
+
+static const char *
+handle_spec_function (p)
+ const char *p;
+{
+ char *func, *args;
+ const char *endp, *funcval;
+ int count;
+
+ processing_spec_function++;
+
+ /* Get the function name. */
+ for (endp = p; *endp != '\0'; endp++)
+ {
+ if (*endp == '(') /* ) */
+ break;
+ /* Only allow [A-Za-z0-9], -, and _ in function names. */
+ if (!ISALNUM (*endp) && !(*endp == '-' || *endp == '_'))
+ fatal ("malformed spec function name");
+ }
+ if (*endp != '(') /* ) */
+ fatal ("no arguments for spec function");
+ func = save_string (p, endp - p);
+ p = ++endp;
+
+ /* Get the arguments. */
+ for (count = 0; *endp != '\0'; endp++)
+ {
+ /* ( */
+ if (*endp == ')')
+ {
+ if (count == 0)
+ break;
+ count--;
+ }
+ else if (*endp == '(') /* ) */
+ count++;
+ }
+ /* ( */
+ if (*endp != ')')
+ fatal ("malformed spec function arguments");
+ args = save_string (p, endp - p);
+ p = ++endp;
+
+ /* p now points to just past the end of the spec function expression. */
+
+ funcval = eval_spec_function (func, args);
+ if (funcval != NULL && do_spec_1 (funcval, 0, NULL) < 0)
+ p = NULL;
+
+ free (func);
+ free (args);
+
+ processing_spec_function--;
+
+ return p;
}
/* Return 0 if we call do_spec_1 and that returns -1. */
@@ -5146,7 +5374,8 @@
#endif /* GPC */
p = argv[0] + strlen (argv[0]);
- while (p != argv[0] && p[-1] != '/' && p[-1] != DIR_SEPARATOR) --p;
+ while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
+ --p;
programname = p;
#ifdef GPC
@@ -5166,8 +5395,8 @@
signal (SIGPIPE, fatal_error);
#endif
- argbuf_length = 10;
- argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
+ /* Allocate the argument vector. */
+ alloc_args ();
obstack_init (&obstack);
@@ -5469,7 +5698,7 @@
#endif
}
- if (n_infiles == 0)
+ if (n_infiles == added_libraries)
fatal ("No input files");
/* Make a place to record the compiler output file names
@@ -6380,3 +6609,25 @@
++p;
}
}
+
+/* if-exists built-in spec function.
+
+ Checks to see if the file specified by the absolute pathname in
+ ARGS exists. Returns that pathname if found.
+
+ The usual use for this function is to check for a library file
+ (whose name has been expanded with %s). */
+
+#define IS_ABSOLUTE_PATHNAME(cp) ((cp)[0] == '/')
+
+static const char *
+if_exists_spec_function (argc, argv)
+ int argc;
+ const char **argv;
+{
+ /* Must have only one argument. */
+ if (argc == 1 && IS_ABSOLUTE_PATHNAME (argv[0]) && ! access (argv[0], R_OK))
+ return argv[0];
+
+ return NULL;
+}

13
lang/gpc/patches/patch-aj Normal file
View File

@@ -0,0 +1,13 @@
$NetBSD: patch-aj,v 1.1 2006/10/22 20:27:22 rillig Exp $
--- gcc/p/diffs/mkdiff.orig 2001-06-01 14:22:26.000000000 +0200
+++ gcc/p/diffs/mkdiff 2006-10-22 22:25:16.000000000 +0200
@@ -5,7 +5,7 @@
# Russ Whitaker <russ@ashlandhome.net>
# Last modified 28 May 2001
-if [ $1x == x ]; then
+if [ $1x = x ]; then
echo
echo "usage: $0 <GCC version number>"
echo

33
lang/gpc/patches/patch-ak Normal file
View File

@@ -0,0 +1,33 @@
$NetBSD: patch-ak,v 1.1 2008/02/17 10:07:59 rillig Exp $
bitfields cannot be updated via an lvalue cast assigment.
--- gcc/p/module.c.orig 2002-04-26 20:25:38.000000000 +0000
+++ gcc/p/module.c 2007-12-01 12:37:20.000000000 +0000
@@ -2548,7 +2548,7 @@ itab_check_gpi_checksum (interface_name,
itab->gpi_checksum = gpi_checksum;
/* @@ misuse of TREE_LIST and TREE_TYPE(1) */
t = build_tree_list (itab->module_name, itab->interface_name);
- TREE_CODE (t) = INTERFACE_NAME_NODE;
+ TREE_SET_CODE (t, INTERFACE_NAME_NODE);
TREE_TYPE (t) = (tree) itab;
itab->interface_name_node = t;
return 1;
@@ -2636,7 +2636,7 @@ load_node ()
free (id);
/* @@ misuse of TREE_LIST */
t = build_tree_list (m, i);
- TREE_CODE (t) = INTERFACE_NAME_NODE;
+ TREE_SET_CODE (t, INTERFACE_NAME_NODE);
assert (mark_node_loaded (t, uid) == t);
LOAD_ANY (gpi_checksum);
get_interface_table (i, m, 1);
@@ -3718,7 +3718,7 @@ gpi_open (interface_name, name, source,
{
tree new_import = build_tree_list (NULL_TREE, interface);
/* @@ misuse of TREE_LIST and TREE_TYPE(2) */
- TREE_CODE (new_import) = INTERFACE_NAME_NODE;
+ TREE_SET_CODE (new_import, INTERFACE_NAME_NODE);
TREE_TYPE (new_import) = (tree) checksum;
import_list = chainon (import_list, new_import);
}