summaryrefslogtreecommitdiff
path: root/devel/bcc
diff options
context:
space:
mode:
authortsarna <tsarna@pkgsrc.org>1998-07-17 04:39:19 +0000
committertsarna <tsarna@pkgsrc.org>1998-07-17 04:39:19 +0000
commitea68d45471aa5b7de4cdf1b847cf4e2452b1e946 (patch)
tree5c03e67e94b1d6a260bc0db6fcc5cdba481eb0f5 /devel/bcc
parent02b8d9c8d61e02cede71e2a721b8a9462d00b674 (diff)
downloadpkgsrc-ea68d45471aa5b7de4cdf1b847cf4e2452b1e946.tar.gz
Add pkg for bcc, a 16-bit x86 compiler
Diffstat (limited to 'devel/bcc')
-rw-r--r--devel/bcc/Makefile11
-rw-r--r--devel/bcc/files/Makefile.bcc20
-rw-r--r--devel/bcc/files/as86.1158
-rw-r--r--devel/bcc/files/bcc-cc1.1128
-rw-r--r--devel/bcc/files/bcc.1233
-rw-r--r--devel/bcc/files/ld86.1138
-rw-r--r--devel/bcc/files/md51
-rw-r--r--devel/bcc/patches/patch-aa66
-rw-r--r--devel/bcc/patches/patch-ab75
-rw-r--r--devel/bcc/patches/patch-ac41
-rw-r--r--devel/bcc/patches/patch-ad14
-rw-r--r--devel/bcc/patches/patch-ae11
-rw-r--r--devel/bcc/patches/patch-af45
-rw-r--r--devel/bcc/patches/patch-ag11
-rw-r--r--devel/bcc/patches/patch-ah13
-rw-r--r--devel/bcc/patches/patch-ai13
-rw-r--r--devel/bcc/patches/patch-aj11
-rw-r--r--devel/bcc/patches/patch-ak34
-rw-r--r--devel/bcc/patches/patch-al11
-rw-r--r--devel/bcc/patches/patch-am11
-rw-r--r--devel/bcc/patches/patch-an40
-rw-r--r--devel/bcc/pkg/COMMENT1
-rw-r--r--devel/bcc/pkg/DESCR15
-rw-r--r--devel/bcc/pkg/PLIST10
-rwxr-xr-xdevel/bcc/scripts/configure50
25 files changed, 1161 insertions, 0 deletions
diff --git a/devel/bcc/Makefile b/devel/bcc/Makefile
new file mode 100644
index 00000000000..e7814b5cc29
--- /dev/null
+++ b/devel/bcc/Makefile
@@ -0,0 +1,11 @@
+# $NetBSD: Makefile,v 1.1 1998/07/17 04:39:19 tsarna Exp $
+# FreeBSD Id: Makefile,v 1.6 1996/11/18 11:22:35 asami Exp
+#
+
+DISTNAME= bcc
+PKGNAME= bcc-95.3.12
+CATEGORIES= devel
+
+MAINTAINER= tsarna@netbsd.org
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/devel/bcc/files/Makefile.bcc b/devel/bcc/files/Makefile.bcc
new file mode 100644
index 00000000000..f49176f7c44
--- /dev/null
+++ b/devel/bcc/files/Makefile.bcc
@@ -0,0 +1,20 @@
+.include "../Makefile.inc"
+
+.PATH: ../bcc-cc1
+
+CFLAGS = -DNSIG=32
+CFLAGS += -Wall
+CFLAGS += -DLOCALPREFIX=\"${LOCALPREFIX}\"
+LDFLAGS =
+
+
+SRCS = bcc.c
+
+PROG = bcc
+
+BINDIR = ${LOCALPREFIX}/bin
+MANDIR = ${LOCALPREFIX}/man
+
+WARNS = 0
+
+.include <bsd.prog.mk>
diff --git a/devel/bcc/files/as86.1 b/devel/bcc/files/as86.1
new file mode 100644
index 00000000000..e4441d3fa89
--- /dev/null
+++ b/devel/bcc/files/as86.1
@@ -0,0 +1,158 @@
+.\"
+.\" This manual page has been assembled after Bruce's original bcc.doc
+.\" file by Jörg Wunsch <joerg@FreeBSD.org>.
+.\" It is redistributed under the same conditions as the whole bcc
+.\" package itself.
+.\"
+.Dd March 26, 1995
+.Os
+.Dt AS86 1
+.Sh NAME
+.Nm as86
+.Nd assembler for 8086/80386
+.Sh SYNOPSIS
+.Nm as86
+.Op Fl 03agjuw
+.Op Fl b Op Ar bin
+.Op Fl lm Op Ar list
+.Op Fl n Ar name
+.Op Fl o Ar obj
+.Op Fl s Ar sym
+.Ar src
+.Sh DESCRIPTION
+
+.Ss Overview
+.Nm As86
+is an assembler for 8086 or 80386 CPUs. Its syntax resembles rather
+the usual 8086 assembler syntax than the AT&T-like syntax as used by
+the system's assembler
+.Xr as 1 .
+
+It can also be compiled to support the Motorola 6809 CPU. The name
+.Nm as86
+has only been chosen to make it distinct from the system's assembler.
+
+.Ss Options
+
+.Bl -tag -width indent -compact
+
+.It Fl 0
+.Pq the digit 0
+start with 16-bit code segment
+
+.It Fl 3
+start with 32-bit code segment
+
+.It Fl a
+enable partial compatibility with asld
+
+.It Fl b
+produce binary file, filename may follow
+.Pq obsolete
+
+.It Fl g
+only put global symbols in object file
+
+.It Fl j
+force all jumps to be long
+
+.It Fl l
+produce list file, filename may follow
+
+.It Fl m
+print macro expansions in listing
+
+.It Fl n
+name of module follows
+.Pq goes in object instead of source name
+
+.It Fl o
+produce object file, filename follows
+
+.It Fl s
+produce symbol file, filename follows
+.Pq obsolete
+
+.It Fl u
+take undefined symbols as imported-with-unspecified segment
+
+.It Fl w
+don't print warnings
+
+.El
+
+The 6809 version does not support
+.Fl 0 ,
+.Fl 3 ,
+.Fl a
+or
+.Fl j .
+
+
+.Ss Defaults
+Off or none except for these; no output is produced without a flag:
+
+.Bl -tag -width indenct -compact
+
+.It Fl 0 | Fl 3
+native, i.\& e. 80386
+
+.It Ar list
+stdout
+.Pq beware of clobbering next arg
+
+.It Ar name
+basename of the source name
+
+.El
+
+.Ss Input syntax
+
+The following lists all acceptable names except the CPU instructions:
+
+.Bl -tag -width "XXXXXXX" -compact -offset indent
+
+.It Register names
+
+bp, bx, di, si, eax, ebp, ecx, edi, edx, esi, esp,
+ax, cx, dx, sp, ah, al, bh, bl, ch, cl, dh, dl,
+cs, ds, es, fs, gs, ss, cr0, cr2, cr3, dr0, dr1,
+dr3, dr6, dr7, tr3, tr4, tr5, tr6, tr7, st.
+
+.It Type sizes
+
+byte, dword, fword, far, ptr, pword, qword, tbyte, word.
+
+.It Pseudo-operations
+
+else, elseif, elseifc, endif, if, ifc;
+\&.align, .ascii, .blkb, .blkw, block, .bss, .byte, comm, .comm,
+\&.data, .data1, .data2, .data4, db, dd, .define, dw, end, endb,
+enter, entry, equ, .even, export, extern, .extern, extrn, fail, .fail,
+fcb, fcc, fdb, get, .globl, ident, import, include, lcomm, .lcomm,
+\&.list, loc, .long, .maclist, macro, .map, org, .org, public,
+rmb, .rom, .sect, set, setdp, .short, .space, .text, use16,
+use32, .warn, .word, .zero.
+
+.El
+.Sh SEE ALSO
+
+.Xr as 1 ;
+.Xr ld86 1 ,
+.Xr bcc 1 .
+
+.Sh AUTHORS
+
+This program has been developed by Bruce Evans.
+
+.Sh BUGS
+
+The
+.Fl u
+and
+.Fl w
+options are perhaps back to front because they are needed for cc1
+output and Minix's make does the wrong thing with .s files left
+around. However, all assembler code not written by compilers should
+assemble with them turned off.
+
diff --git a/devel/bcc/files/bcc-cc1.1 b/devel/bcc/files/bcc-cc1.1
new file mode 100644
index 00000000000..ff9ffa5c0c9
--- /dev/null
+++ b/devel/bcc/files/bcc-cc1.1
@@ -0,0 +1,128 @@
+.\"
+.\" This manual page has been assembled after Bruce's original bcc.doc
+.\" file by Jörg Wunsch <joerg@FreeBSD.org>.
+.\" It is redistributed under the same conditions as the whole bcc
+.\" package itself.
+.\"
+.Dd March 26, 1995
+.Os
+.Dt BCC-CC1 1
+.Sh NAME
+.Nm bcc-cc1
+.Nd C compiler backend
+.Sh SYNOPSIS
+.Nm bcc-cc1
+.Op Fl 03EPcdfltw Ns Op -
+.Op Fl D Ns Ar define
+.Op Fl I Ns Ar include_dir
+.Op Fl U Ns Ar undef
+.Op Fl o Ar outfile
+.Op Ar infile
+
+.Sh DESCRIPTION
+
+.Nm Bcc-cc1
+is the backend for the
+.Xr bcc 1
+C compiler.
+
+It understands the following options:
+
+.Bl -tag -width indent -compact
+
+.It Fl 0
+.Pq the digit 0
+8086 target
+.Pq works even on 80386 host
+
+.It Fl 3
+80386 target
+.Pq works even on 8086 host
+
+.It Fl D
+define
+
+.It Fl E
+produce preprocessor output
+
+.It Fl I
+include search path
+
+.It Fl P
+produce preprocessor output with no line numbers
+
+.It Fl c
+produce code with caller saving regs before function calls
+
+.It Fl d
+print debugging information in assembly output
+
+.It Fl f
+produce code with 1st argument passed in a register
+
+.It Fl l
+produce code for 2 3 1 0 long byte order
+.Pq only works in 16-bit versions
+
+.It Fl o
+assembler output file name follows
+
+.It Fl p
+produce
+.Pq almost
+position-independent code
+
+.It Fl t
+print source code in assembly output
+
+.It Fl w
+print what cc1 thinks is the location counter in assembly output
+
+.El
+
+All the options except
+.Fl D ,
+.Fl I
+and
+.Fl o
+may be turned off by following the
+option letter by a
+.Sq - .
+Options are processed left to right so the last setting has precedence.
+
+The following is defined before option processing:
+
+.Bd -literal
+__BCC__ 1
+.Ed
+
+The following may be defined after option processing:
+
+.Bd -literal
+__AS09__ 1 if 6809 version
+__AS386_16__ 1 if -0 option on 80*86
+__AS386_32__ 1 if -3 option on 80*86
+__CALLER_SAVES__ 1 if -c option
+__FIRST_ARG_IN_AX__ 1 if -f option on 80*86
+__FIRST_ARG_IN_X__ 1 if -f option on 6809
+__LONG_BIG_ENDIAN__ 1 if -l option
+__POS_INDEPENDENT__ 1 if -p option on 6809
+.Ed
+
+The following are standard builtins:
+
+.Bd
+__FILE__ stringized name of current input file
+__LINE__ current line number
+.Ed
+
+.Sh FILES
+.Pa /usr/local/lib/bcc/bcc-cc1
+
+.Sh SEE ALSO
+
+.Xr bcc 1 .
+
+.Sh AUTHORS
+
+This program has been written by Bruce Evans.
diff --git a/devel/bcc/files/bcc.1 b/devel/bcc/files/bcc.1
new file mode 100644
index 00000000000..c1ee9a9ac6f
--- /dev/null
+++ b/devel/bcc/files/bcc.1
@@ -0,0 +1,233 @@
+.\"
+.\" This manual page has been assembled after Bruce's original bcc.doc
+.\" file by Jörg Wunsch <joerg@FreeBSD.org>.
+.\" It is redistributed under the same conditions as the whole bcc
+.\" package itself.
+.\"
+.Dd March 26, 1995
+.Os
+.Dt BCC 1
+.Sh NAME
+.Nm bcc
+.Nd Bruce's C compiler
+.Sh SYNOPSIS
+.Nm bcc
+.Op Fl 03EGOPSVcegv
+.Op Fl A Ns Ar as_option
+.Op Fl B Ns Ar executable_prefix
+.Op Fl C Ns Ar cc1_option
+.Op Fl D Ns Ar define
+.Op Fl I Ns Ar include_dir
+.Op Fl L Ns Ar ld_option
+.Op Fl Q Ns Ar c386_option
+.Op Fl T Ns Ar tmpdir
+.Op Fl U Ns Ar undef
+.Op Fl o Ar outfile
+.Op Fl fpt Ar error
+.Op ld_options
+.Op Ar infiles
+
+.Sh DESCRIPTION
+
+.Ss Overview
+
+.Nm Bcc
+is a simple C compiler suitable for generating 8086 or 80386 code.
+It basically understands the old K&R C input syntax, with some
+restrictions on bit fields. It interacts with the programs
+.Xr as86 1
+and
+.Xr ld86 1 .
+
+As a compile-time option, it is also possible to convince
+.Nm bcc
+to generate code for the Motorola 6809 CPU.
+
+.Ss Options
+
+.Bl -tag -width indent -compact
+
+.It Fl 0
+.Pq the digit 0
+8086 target
+.Pq works even on 80386 host
+
+.It Fl 3
+80386 target
+.Pq works even on 8086 host
+
+.It Fl A
+pass remainder of option to assembler; e.\& g.
+.Ql -A-l -Alistfile
+for a listing
+
+.It Fl B
+prefix for executable search path; the search order is all paths
+specified using
+.Fl B ,
+in order, then the path given in the environment variable
+.Ev BCC_EXEC_PREFIX
+if that is set, then the compiled-in defaults
+.Pa /usr/local/lib/bcc ,
+followed by
+.Pa /usr/local/bin
+
+.It Fl C
+pass remainder of option to bcc-cc1; e.\& g.
+.Ql -C-c
+for caller-saves
+
+.It Fl D
+define
+
+.It Fl E
+produce preprocessor output
+
+.It Fl G
+produce gnu-Minix objects
+.Pq link with gnu ld
+
+.It Fl I
+include search path
+
+.It Fl L
+pass remainder of option to linker
+
+.It Fl O
+optimize
+.Pq does nothing
+
+.It Fl P
+produce preprocessor output with no line numbers
+
+.It Fl Q
+pass full option to c386
+
+.It Fl S
+produce assembler file
+
+.It Fl T
+temporary directory;
+overrides previous value and default; default is
+from the environment variable
+.Ev TMPDIR
+if that is set, otherwise
+.Pa /tmp
+
+.It Fl U
+undefine
+
+.It Fl V
+print names of files being compiled
+
+.It Fl c
+produce object file
+
+.It Fl e
+run the preprocess pass separately. This takes less memory, and may
+help or harm by giving more traditional semantics like token pasting
+with
+.Ql /**/
+\&.
+
+.It Fl f
+error
+.Pq float emulation not supported
+
+.It Fl g
+produce debugging info
+.Pq does nothing
+
+.It Fl o
+output file name follows
+.Pq assembler, object or executable
+
+.It Fl p
+error
+.Pq profiling not supported
+
+.It Fl t
+error
+.Pq substitution of some cc passes not supported
+
+.It Fl v
+print names and args of subprocesses being run.
+.Pp
+Two or more
+.Fl v
+\&'s: print names of files being unlinked.
+.Pp
+Three or more
+.Fl v
+\&'s: print names of paths being searched.
+
+.El
+
+The 6809 version does not support
+.Fl 0 ,
+.Fl 3
+or
+.Fl G.
+
+Only the c386 version supports
+.Fl Q .
+
+.Ss Defaults
+Off or none except for these:
+
+.Bl -tag -width indent -compact
+
+.It Fl 0 | Fl 3
+native, i.\& e. 80386
+
+.It Ar outfile
+stdout for preprocessor output
+.Pp
+.Pa somewhere/file.[ci]
+\&->
+.Pa file.s
+for compiler output
+.Pp
+.Pa somewhere/file.[cis]
+\&->
+.Pa file.o
+for assembler output
+.Pp
+.Pa a.out
+for ld output
+
+.El
+
+Other options are passed to the linker, in particular
+.Fl i- ,
+.Fl l Ns Ar x ,
+.Fl M ,
+.Fl m ,
+.Fl s .
+The
+.Fl i
+option is always passed to the linker but can be cancelled using
+.Fl i- .
+
+.Sh ENVIRONMENT
+
+.Bl -tag -width indent -compact
+
+.It Ev BCC_EXEC_PREFIX
+directory to search for compiler passes
+
+.It Ev TMPDIR
+where to place temporary files
+
+.El
+
+.Sh SEE ALSO
+
+.Xr as86 1 ,
+.Xr ld86 1 ,
+.Xr bcc-cc1 1 ;
+.Xr cc 1 .
+
+.Sh AUTHORS
+
+This program has been written by Bruce Evans.
diff --git a/devel/bcc/files/ld86.1 b/devel/bcc/files/ld86.1
new file mode 100644
index 00000000000..914be158c8e
--- /dev/null
+++ b/devel/bcc/files/ld86.1
@@ -0,0 +1,138 @@
+.\"
+.\" This manual page has been assembled after Bruce's original bcc.doc
+.\" file by Jörg Wunsch <joerg@FreeBSD.org>.
+.\" It is redistributed under the same conditions as the whole bcc
+.\" package itself.
+.\"
+.Dd March 26, 1995
+.Os
+.Dt LD86 1
+.Sh NAME
+.Nm ld86
+.Nd loader for as86
+.Sh SYNOPSIS
+.Nm ld86
+.Op Fl 03Mimrstz Ns Op -
+.Op Fl l Ns Ar lib_extension
+.Op Fl o outfile
+.Op Fl C crtfile
+.Op Fl L Ns libdir
+.Op Fl O Ns libfile
+.Op Fl T textaddr
+.Ar infile
+.Op Ar ...
+.Sh DESCRIPTION
+
+.Ss Overview
+
+.Nm Ld86
+is the loader that understands how to link the output of
+.Xr as86 1
+together.
+
+.Ss Options
+
+.Bl -tag -width indent -compact
+
+.It Fl 0
+.Pq the digit 0
+produce header with 16-bit magic and use library subdir
+.Pa i86
+for
+.Fl l Ns Ar x
+
+.It Fl 3
+produce header with 32-bit magic and use library subdir
+.Pa i386
+for
+.Fl l Ns Ar x
+
+.It Fl C Ns Ar x
+add file
+.Pa libdir-from-search/crt Ns Ar x Ns \&.o
+to list of files linked
+
+.It Fl L Ns Ar x
+add dir name
+.Ar x
+to the head of the list of library dirs searched
+
+.It Fl M
+print symbols linked on stdout
+
+.It Fl O Ns Ar x
+add library
+.Pa libdir-from-search/ Ns Ar x
+to list of files linked
+
+.It Fl T
+text base address follows
+.Pq in format suitable for strtoul
+
+.It Fl i
+separate I&D output
+
+.It Fl l Ns Ar x
+add library
+.Pa libdir-from-search/lib Ns Ar x Ns \&.a
+to list of files linked
+
+.It Fl m
+print modules linked on stdout
+
+.It Fl o
+output file name follows
+
+.It Fl r
+produce output suitable for further relocation
+
+.It Fl s
+strip symbols
+
+.It Fl t
+trace modules being looked at on stdout
+
+.It Fl z
+produce
+.Dq unmapped zero page
+executables
+
+
+.El
+
+The 6809 version does not support -i or -r.
+
+All the options not taking an argument may be turned off by following the
+option letter by a
+.Sq \&- ,
+as for bcc-cc1.
+
+.Ss Defaults
+
+Off or none except for these:
+
+.Bl -tag -width indent -compact
+
+.It Fl 0 | Fl 3
+native, i.\& e. 80386
+
+.It Fl L Ns Pa /usr/local/lib/bcc/ Ns Ar m/
+.Po
+.Ar m
+is machine dependent
+.Pc
+
+.It Ar outfile
+.Pa a.out
+
+.El
+
+.Sh SEE ALSO
+
+.Xr as86 1 ,
+.Xr bcc 1 .
+
+.Sh AUTHORS
+
+This programm has been written by Bruce Evans.
+
diff --git a/devel/bcc/files/md5 b/devel/bcc/files/md5
new file mode 100644
index 00000000000..14cf819e0fe
--- /dev/null
+++ b/devel/bcc/files/md5
@@ -0,0 +1 @@
+MD5 (bcc.tar.gz) = b372eb6c6c709f1fba62098def3d4096
diff --git a/devel/bcc/patches/patch-aa b/devel/bcc/patches/patch-aa
new file mode 100644
index 00000000000..68ea8c7b310
--- /dev/null
+++ b/devel/bcc/patches/patch-aa
@@ -0,0 +1,66 @@
+*** ld/Makefile.orig Sat Feb 19 23:32:12 1994
+--- ld/Makefile Sun Mar 26 12:31:37 1995
+***************
+*** 1,18 ****
+! CFLAGS =-O -DBSD_A_OUT -DSTANDARD_GNU_A_OUT
+! LDFLAGS =-N -s
+
+! OBJS =dumps.o io.o ld.o readobj.o table.o typeconv.o writebin.o
+
+! ld: $(OBJS)
+! $(CC) $(LDFLAGS) $(OBJS) -o $@
+
+! clean:
+! rm -f $(OBJS) ld
+!
+! dumps.o: dumps.c const.h config.h obj.h type.h globvar.h
+! io.o: io.c const.h config.h obj.h type.h globvar.h
+! ld.o: ld.c const.h config.h byteord.h type.h globvar.h
+! readobj.o: readobj.c const.h config.h byteord.h obj.h type.h globvar.h
+! table.o: table.c const.h config.h align.h obj.h type.h globvar.h
+! typeconv.o: typeconv.c const.h config.h type.h globvar.h
+! writebin.o: writebin.c const.h config.h obj.h type.h globvar.h
+--- 1,18 ----
+! .include "../Makefile.inc"
+
+! CFLAGS +=-DBSD_A_OUT -DSTANDARD_GNU_A_OUT
+! CFLAGS +=-Wall
+! LDFLAGS =
+
+! SRCS =dumps.c io.c ld.c readobj.c table.c typeconv.c writebin.c
+
+! PROG =ld86
+!
+! BINDIR =${LOCALPREFIX}/bin
+! MANDIR =${LOCALPREFIX}/man
+!
+! beforeinstall:
+! -mkdir -p ${BINDIR}
+! -mkdir -p ${MANDIR}1
+!
+! .include <bsd.prog.mk>
+*** ld/ld.c.orig Sat Feb 19 23:36:05 1994
+--- ld/ld.c Sun Mar 26 11:59:47 1995
+***************
+*** 3,9 ****
+ /* Copyright (C) 1994 Bruce Evans */
+
+ #include "const.h"
+- #include "byteord.h"
+ #include "type.h"
+ #include "globvar.h"
+
+--- 3,8 ----
+***************
+*** 25,30 ****
+--- 24,33 ----
+ #undef NULL
+ #include <unistd.h>
+ #endif
++
++ /* BSD #defines this in <machine/endian.h>, but with another sense */
++ #undef BIG_ENDIAN
++ #include "byteord.h"
+
+ #define MAX_LIBS (NR_STDLIBS + 5)
+ #define NR_STDLIBS 1
diff --git a/devel/bcc/patches/patch-ab b/devel/bcc/patches/patch-ab
new file mode 100644
index 00000000000..d0f0443b421
--- /dev/null
+++ b/devel/bcc/patches/patch-ab
@@ -0,0 +1,75 @@
+*** as/Makefile.orig Thu Apr 23 06:04:42 1992
+--- as/Makefile Sun Mar 26 12:31:17 1995
+***************
+*** 1,27 ****
+! CFLAGS =-O
+ LDFLAGS =
+
+! OBJS =as.o assemble.o error.o express.o \
+! genbin.o genlist.o genobj.o gensym.o \
+! macro.o mops.o pops.o readsrc.o \
+! scan.o table.o typeconv.o
+!
+! as: $(OBJS)
+! $(CC) $(LDFLAGS) $(OBJS) -o as
+! chmem =182000 as
+!
+! as.o: const.h type.h byteord.h macro.h file.h flag.h globvar.h
+! assemble.o: const.h type.h address.h globvar.h opcode.h scan.h
+! error.o: const.h type.h
+! express.o: const.h type.h address.h globvar.h scan.h source.h
+! genbin.o: const.h type.h address.h file.h globvar.h
+! genlist.o: const.h type.h address.h flag.h file.h globvar.h macro.h scan.h \
+! source.h
+! genobj.o: const.h type.h address.h file.h globvar.h
+! gensym.o: const.h type.h flag.h file.h globvar.h
+! macro.o: const.h type.h globvar.h scan.h macro.h
+! mops.o: const.h type.h globvar.h opcode.h scan.h address.h
+! pops.o: const.h type.h address.h flag.h globvar.h opcode.h scan.h
+! readsrc.o: const.h type.h flag.h file.h globvar.h macro.h scan.h source.h
+! scan.o: const.h type.h globvar.h scan.h
+! table.o: const.h type.h globvar.h opcode.h scan.h
+--- 1,18 ----
+! .include "../Makefile.inc"
+! .PATH: ../ld
+!
+! CFLAGS +=-Wall
+ LDFLAGS =
+
+! SRCS =as.c assemble.c error.c express.c \
+! genbin.c genlist.c genobj.c gensym.c \
+! macro.c mops.c pops.c readsrc.c \
+! scan.c table.c typeconv.c
+!
+! PROG =as86
+!
+! BINDIR = ${LOCALPREFIX}/bin
+! MANDIR = ${LOCALPREFIX}/man
+!
+!
+! .include <bsd.prog.mk>
+*** as/as.c.orig Sat Jul 10 21:03:52 1993
+--- as/as.c Sun Mar 26 12:11:09 1995
+***************
+*** 7,13 ****
+
+ #include "const.h"
+ #include "type.h"
+- #include "byteord.h"
+ #include "macro.h"
+ #undef EXTERN
+ #define EXTERN
+--- 7,12 ----
+***************
+*** 36,41 ****
+--- 35,44 ----
+ #include <fcntl.h>
+ #include <unistd.h>
+ #endif
++
++ /* BSD #defines this in <machine/endian.h>, but with another sense */
++ #undef BIG_ENDIAN
++ #include "byteord.h"
+
+ PUBLIC char hexdigit[] = "0123456789ABCDEF"; /* XXX - ld uses lower case */
+
diff --git a/devel/bcc/patches/patch-ac b/devel/bcc/patches/patch-ac
new file mode 100644
index 00000000000..eb08cc655a2
--- /dev/null
+++ b/devel/bcc/patches/patch-ac
@@ -0,0 +1,41 @@
+*** bcc/Makefile.orig Thu Mar 9 11:43:29 1995
+--- bcc/Makefile Sun Mar 26 12:23:06 1995
+***************
+*** 1,14 ****
+! CFLAGS =-O -DNSIG=32
+ LDFLAGS =
+
+! bcc: bcc.c
+! $(CC) $(CFLAGS) $(LDFLAGS) $@.c -o $@
+
+! bcc09: bcc.c
+! $(CC) -DMC6809 $(CFLAGS) $(LDFLAGS) bcc.c -o $@
+
+! ccc: bcc.c
+! $(CC) -DCCC $(CFLAGS) $(LDFLAGS) bcc.c -o $@
+
+! clean:
+! rm -f bcc bcc09 ccc
+--- 1,22 ----
+! .include "../Makefile.inc"
+!
+! CFLAGS +=-DNSIG=32
+! #CFLAGS +=-Wall # too many warnings
+ LDFLAGS =
+
+! PROG =bcc-cc1
+!
+! SRCS =assign.c declare.c gencode.c label.c preserve.c type.c \
+! bcc-cc1.c express.c genloads.c loadexp.c scan.c \
+! exptree.c glogcode.c longop.c softop.c codefrag.c \
+! floatop.c hardop.c output.c state.c debug.c function.c \
+! input.c preproc.c table.c
+!
+
+! BINDIR = ${LOCALPREFIX}/lib/bcc
+! MANDIR = ${LOCALPREFIX}/man
+
+! beforeinstall:
+! -mkdir -p ${LOCALPREFIX}/lib/bcc
+
+! .include <bsd.prog.mk>
diff --git a/devel/bcc/patches/patch-ad b/devel/bcc/patches/patch-ad
new file mode 100644
index 00000000000..efbea50ab54
--- /dev/null
+++ b/devel/bcc/patches/patch-ad
@@ -0,0 +1,14 @@
+$NetBSD: patch-ad,v 1.1 1998/07/17 04:45:57 tsarna Exp $
+
+bin86 uses BIG_ENDIAN in silly ways.
+
+--- ld/readobj.c.orig Thu Jul 16 14:13:12 1998
++++ ld/readobj.c Thu Jul 16 14:13:21 1998
+@@ -15,6 +15,7 @@
+ unsigned long strtoul P((const char *s, char **endptr, int base));
+ #else
+ #undef NULL
++#undef BIG_ENDIAN
+ #include <stdlib.h>
+ #include <string.h>
+ #endif
diff --git a/devel/bcc/patches/patch-ae b/devel/bcc/patches/patch-ae
new file mode 100644
index 00000000000..c7a69f52717
--- /dev/null
+++ b/devel/bcc/patches/patch-ae
@@ -0,0 +1,11 @@
+--- ld/table.c.orig Thu Jul 16 14:14:41 1998
++++ ld/table.c Thu Jul 16 14:14:54 1998
+@@ -48,7 +48,7 @@
+ char *name;
+ {
+ struct symstruct **hashptr;
+- struct symstruct *oldsymptr;
++ struct symstruct *oldsymptr = NULL;
+ struct symstruct *symptr;
+
+ hashptr = gethashptr(name);
diff --git a/devel/bcc/patches/patch-af b/devel/bcc/patches/patch-af
new file mode 100644
index 00000000000..0c4e488a4be
--- /dev/null
+++ b/devel/bcc/patches/patch-af
@@ -0,0 +1,45 @@
+--- ld/writebin.c.orig Sat Feb 19 16:37:23 1994
++++ ld/writebin.c Thu Jul 16 16:57:56 1998
+@@ -12,6 +12,7 @@
+ #else
+ # ifdef BSD_A_OUT
+ # ifdef STANDARD_GNU_A_OUT
++# include <sys/types.h>
+ # include <a.out.h>
+ # define RELOC_INFO_SIZE 8 /* unportable bitfields - bcc doesn't pack */
+ # else
+@@ -174,7 +175,7 @@
+ linkrefs(symptr->modptr);
+ needlink = FALSE;
+ {
+- struct redlist *prlptr;
++ struct redlist *prlptr = NULL;
+ struct redlist *rlptr;
+
+ for (rlptr = redfirst; rlptr != NULL;
+@@ -478,11 +479,11 @@
+ extsym.n_was_sclass = C_EXT;
+ else
+ extsym.n_was_sclass = C_STAT;
+- if (!(flags & I_MASK) ||
++ if (!(flags & I_MASK) || (
+ #ifdef BSD_A_OUT
+ !reloc_output &&
+ #endif
+- flags & C_MASK)
++ flags & C_MASK))
+ switch (flags & (A_MASK | SEGM_MASK))
+ {
+ case 0:
+@@ -918,7 +919,11 @@
+ #ifdef N_SET_MAGIC
+ N_SET_MAGIC(header, OMAGIC);
+ #else
++#ifdef N_SETMAGIC
++ N_SETMAGIC(header,OMAGIC,MID_I386,0);
++#else
+ *(unsigned short *) &header.a_magic = OMAGIC; /* XXX - works for 386BSD */
++#endif
+ #endif
+ #else
+ header.a_magic[0] = A_MAGIC0;
diff --git a/devel/bcc/patches/patch-ag b/devel/bcc/patches/patch-ag
new file mode 100644
index 00000000000..e76e993bbc6
--- /dev/null
+++ b/devel/bcc/patches/patch-ag
@@ -0,0 +1,11 @@
+--- as/as.c.orig Thu Jul 16 17:18:03 1998
++++ as/as.c Thu Jul 16 17:18:13 1998
+@@ -160,7 +160,7 @@
+ {
+ char *arg;
+ bool_t isnextarg;
+- char *nextarg;
++ char *nextarg = NULL;
+
+ if (argc <= 1)
+ usage();
diff --git a/devel/bcc/patches/patch-ah b/devel/bcc/patches/patch-ah
new file mode 100644
index 00000000000..d43473a2852
--- /dev/null
+++ b/devel/bcc/patches/patch-ah
@@ -0,0 +1,13 @@
+--- as/genlist.c.orig Thu Jul 16 18:38:43 1998
++++ as/genlist.c Thu Jul 16 19:56:53 1998
+@@ -186,8 +186,8 @@
+ {
+ if (!listpre)
+ {
+- if (errcount || list.current && (!macflag || mcount != 0) ||
+- macflag && maclist.current)
++ if (errcount || (list.current && (!macflag || mcount != 0)) ||
++ (macflag && maclist.current))
+ list1(lstfil);
+ if (errcount)
+ {
diff --git a/devel/bcc/patches/patch-ai b/devel/bcc/patches/patch-ai
new file mode 100644
index 00000000000..2521085e656
--- /dev/null
+++ b/devel/bcc/patches/patch-ai
@@ -0,0 +1,13 @@
+--- as/genobj.c.orig Thu Jul 16 20:00:49 1998
++++ as/genobj.c Thu Jul 16 20:01:38 1998
+@@ -385,8 +385,8 @@
+ do
+ {
+ if ((symptr->type & EXPBIT || symptr->data & IMPBIT) ||
+- !globals_only_in_obj && symptr->name[0] != '.' &&
+- !(symptr->type & (MNREGBIT | MACBIT | VARBIT)))
++ (!globals_only_in_obj && symptr->name[0] != '.' &&
++ !(symptr->type & (MNREGBIT | MACBIT | VARBIT))))
+ {
+ if (copyptr >= (struct sym_s **) heapend)
+ {
diff --git a/devel/bcc/patches/patch-aj b/devel/bcc/patches/patch-aj
new file mode 100644
index 00000000000..2083781cc31
--- /dev/null
+++ b/devel/bcc/patches/patch-aj
@@ -0,0 +1,11 @@
+--- as/macro.c.orig Thu Jul 16 20:03:05 1998
++++ as/macro.c Thu Jul 16 20:03:15 1998
+@@ -95,7 +95,7 @@
+ {
+ bool_t saving;
+ bool_t savingc;
+- struct sym_s *symptr;
++ struct sym_s *symptr = NULL;
+
+ saving = /* prepare for bad macro */
+ savingc = FALSE; /* normally don't save comments */
diff --git a/devel/bcc/patches/patch-ak b/devel/bcc/patches/patch-ak
new file mode 100644
index 00000000000..7648da1e9d5
--- /dev/null
+++ b/devel/bcc/patches/patch-ak
@@ -0,0 +1,34 @@
+--- as/mops.c.orig Thu Jul 16 20:03:35 1998
++++ as/mops.c Thu Jul 16 20:05:45 1998
+@@ -547,7 +547,7 @@
+ mcount += asize;
+ }
+ else if (lastexp.offset != 0x0 ||
+- eap->base == BPREG && eap->index == NOREG ||
++ (eap->base == BPREG && eap->index == NOREG) ||
+ eap->base == EBPREG)
+ {
+ postb |= MEM1_MOD;
+@@ -917,8 +917,8 @@
+ if (!(lastexp.data & UNDBIT) && lastexp.offset != 0x1)
+ {
+ if (eap->base <= MAX16BITINDREG ||
+- lastexp.offset != 0x2 && lastexp.offset != 0x4 &&
+- lastexp.offset != 0x8)
++ (lastexp.offset != 0x2 && lastexp.offset != 0x4 &&
++ lastexp.offset != 0x8))
+ error(ILL_SCALE);
+ else
+ {
+@@ -1589,9 +1589,9 @@
+ {
+ if (target.indcount == 0x0 && (target.base == ALREG ||
+ target.base == AXREG ||
+- target.base == EAXREG &&
++ (target.base == EAXREG &&
+ (source.displ.data & (FORBIT | RELBIT | UNDBIT) ||
+- !is8bitsignedoffset(source.displ.offset))))
++ !is8bitsignedoffset(source.displ.offset)))))
+ {
+ opcode |= 0x04 | segword;
+ buildimm(&source, FALSE);
diff --git a/devel/bcc/patches/patch-al b/devel/bcc/patches/patch-al
new file mode 100644
index 00000000000..1a121747c34
--- /dev/null
+++ b/devel/bcc/patches/patch-al
@@ -0,0 +1,11 @@
+--- as/pops.c.orig Thu Jul 16 20:24:45 1998
++++ as/pops.c Thu Jul 16 20:25:42 1998
+@@ -72,7 +72,7 @@
+ register struct sym_s *symptr;
+ {
+ if ((symptr->type & LABIT ||
+- symptr->data & IMPBIT && !(symptr->data & UNDBIT)) &&
++ (symptr->data & IMPBIT && !(symptr->data & UNDBIT))) &&
+ ((symptr->data ^ lcdata) & (RELBIT | SEGM)))
+ {
+ error(SEGREL);
diff --git a/devel/bcc/patches/patch-am b/devel/bcc/patches/patch-am
new file mode 100644
index 00000000000..a66fcc2ccea
--- /dev/null
+++ b/devel/bcc/patches/patch-am
@@ -0,0 +1,11 @@
+--- as/readsrc.c.orig Thu Jul 16 20:28:47 1998
++++ as/readsrc.c Thu Jul 16 22:30:18 1998
+@@ -220,7 +220,7 @@
+ char *oldbufptr;
+ struct schain_s *parameters;
+ char paramnum;
+- unsigned char remaining; /* space remaining in line + 2 */
++ unsigned short remaining; /* space remaining in line + 2 */
+ /* value 0 not used except for temp predec */
+ /* value 1 means error already gen */
+ /* values 1 and 2 mean no space */
diff --git a/devel/bcc/patches/patch-an b/devel/bcc/patches/patch-an
new file mode 100644
index 00000000000..3acd0f060d0
--- /dev/null
+++ b/devel/bcc/patches/patch-an
@@ -0,0 +1,40 @@
+--- bcc/bcc.c.orig Sat Jul 17 07:49:49 1993
++++ bcc/bcc.c Thu Jul 16 22:45:40 1998
+@@ -27,20 +27,20 @@
+ #define P(x) ()
+ #endif
+
+-#define AS "as"
++#define AS "as86"
+ #define BAS86
+ #define BCC86
+-#define CC1 "cc1"
++#define CC1 "bcc-cc1"
+ #define CC1_MINUS_O_BROKEN FALSE
+-#define CPP "cpp" /* normally a link to /usr/bin/bcc-cc1 */
++#define CPP "bcc-cc1" /* normally a link to /usr/bin/bcc-cc1 */
+ #define CPPFLAGS "-E"
+ #define CRT0 "crt0.o"
+ #define GCC "gcc"
+-#define LD "ld"
+-#define STANDARD_CRT0_0_PREFIX "/usr/local/lib/i86/"
+-#define STANDARD_CRT0_3_PREFIX "/usr/local/lib/i386/"
+-#define STANDARD_EXEC_PREFIX "/usr/local/libexec/i386/bcc/"
+-#define STANDARD_EXEC_PREFIX_2 "/usr/bin/"
++#define LD "ld86"
++#define STANDARD_CRT0_0_PREFIX LOCALPREFIX "/lib/bcc/i86/"
++#define STANDARD_CRT0_3_PREFIX LOCALPREFIX "/lib/bcc/i386/"
++#define STANDARD_EXEC_PREFIX LOCALPREFIX "/lib/bcc/"
++#define STANDARD_EXEC_PREFIX_2 LOCALPREFIX "/bin/"
+
+ #ifdef CCC
+ #undef BCC86
+@@ -553,7 +553,7 @@
+ {
+ arg = ldargs.argv[argc];
+ if (arg[0] == '-' && arg[1] == 'i'
+- && (arg[2] == 0 || arg[2] == '-' && arg[3] == 0))
++ && (arg[2] == 0 || (arg[2] == '-' && arg[3] == 0)))
+ {
+ --ldargs.argc;
+ memmove(ldargs.argv + argc, ldargs.argv + argc + 1,
diff --git a/devel/bcc/pkg/COMMENT b/devel/bcc/pkg/COMMENT
new file mode 100644
index 00000000000..fa648cb6df4
--- /dev/null
+++ b/devel/bcc/pkg/COMMENT
@@ -0,0 +1 @@
+Bruce Evans' C compiler (with as and ld); can do 16-bit code
diff --git a/devel/bcc/pkg/DESCR b/devel/bcc/pkg/DESCR
new file mode 100644
index 00000000000..4f32b841d28
--- /dev/null
+++ b/devel/bcc/pkg/DESCR
@@ -0,0 +1,15 @@
+This is Bruce Evans' C compiler and binutils package.
+
+It is able to generate 16-bit code. Hence it's possible to compile BIOS
+and DOS code under unix.
+
+The C compiler understands K&R1 syntax, with a few restrictions
+regarding bitfields. See the file bcc/bcc-cc1/bcc.bugs in the
+${DISTFILE} for Bruce's bug list.
+
+The binutils (assembler and loader) have been renamed to as86 and ld86
+to not conflict with the system's assembler and loader, but they are
+also available in the regular BINDIR (normally /usr/local/bin).
+
+It's also possible to generate MC 6809 code with bcc/as. (This is a
+compile-time option however, and not supported by this package.
diff --git a/devel/bcc/pkg/PLIST b/devel/bcc/pkg/PLIST
new file mode 100644
index 00000000000..36d6a60af3e
--- /dev/null
+++ b/devel/bcc/pkg/PLIST
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST,v 1.1 1998/07/17 04:41:55 tsarna Exp $
+bin/as86
+bin/ld86
+bin/bcc
+lib/bcc/bcc-cc1
+@dirrm lib/bcc
+man/man1/as86.1.gz
+man/man1/bcc.1.gz
+man/man1/bcc-cc1.1.gz
+man/man1/ld86.1.gz
diff --git a/devel/bcc/scripts/configure b/devel/bcc/scripts/configure
new file mode 100755
index 00000000000..3e64d7dea4e
--- /dev/null
+++ b/devel/bcc/scripts/configure
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# $NetBSD: configure,v 1.1 1998/07/17 04:43:25 tsarna Exp $
+# FreeBSD Id: configure,v 1.1.1.1 1995/03/26 18:08:54 joerg Exp
+#
+# Author: Jörg Wunsch <joerg@FreeBSD.org>
+# Date of creation: Mar 26, 1995
+#
+
+# we don't need Bruce's symlink, since bmake knows about .PATH
+
+rm -f ${WRKSRC}/as/typeconv.o
+
+# since we like the ease of BSD's fancy .include <> files, we wish to
+# have an own directory for the compiler driver
+
+mv ${WRKSRC}/bcc ${WRKSRC}/bcc-cc1
+mkdir ${WRKSRC}/bcc
+cp -p ${FILESDIR}/Makefile.bcc ${WRKSRC}/bcc/Makefile
+
+# i wrote some man pages after Bruce's bcc.doc
+cp -p ${FILESDIR}/ld86.1 ${WRKSRC}/ld/
+cp -p ${FILESDIR}/as86.1 ${WRKSRC}/as/
+cp -p ${FILESDIR}/bcc.1 ${WRKSRC}/bcc/
+cp -p ${FILESDIR}/bcc-cc1.1 ${WRKSRC}/bcc-cc1/
+
+# create a Makefile.inc to pass the local prefix down to
+# the build stage:
+
+cat > ${WRKSRC}/Makefile.inc <<*EOF*
+#
+# Makefile.inc
+#
+# This file has been created by the "configure" script; DO NOT EDIT.
+#
+# Edit the port's Makefile \${PREFIX} variable should you wish to
+# override this, and reconfigure.
+#
+
+LOCALPREFIX = ${PREFIX}
+*EOF*
+
+# a simple Makefile to make all the subdirs
+
+cat > ${WRKSRC}/Makefile <<*EOF*
+
+SUBDIR = ld as bcc-cc1 bcc
+
+.include <bsd.subdir.mk>
+*EOF*