From my request at https://github.com/kstenerud/Musashi/pull/31
There was a conflict between Musahi's uint and OpenBSD's uint:
$ cc -o m68kmake m68kmake.c
$ ./m68kmake
$ cc -DM68K_COMPILE_FOR_MAME=0 -c m68kcpu.c
In file included from m68kcpu.c:565:
In file included from /usr/include/stdio.h:46:
/usr/include/sys/types.h:58:22: error: cannot combine with previous 'int'
declaration specifier
typedef unsigned int uint; /* Sys V compatibility */
^
./m68kcpu.h:75:25: note: expanded from macro 'uint'
#define uint unsigned int
^
1 error generated.
The code included <X11/Xfuncproto.h> only for _X_ATTRIBUTE_PRINTF,
which tells some compilers to check the printf format string. Remove
so ACK doesn't need any X11 headers.
Some machines don't have the X11 headers, or they need a flag like
-I/usr/X11R[67]/include to find them.
This changes the BDOS call from CPM_BDOS_CONSOLE_INPUT to
CPN_BDOS_READ_CONSOLE_BUFFER. This allows commands like ^H to delete
characters and ^C to exit to CCP. This is more like how Unix read(2)
uses canonical mode of termios to read a line.
This change has a disadvantage: the user buffer to read(2) must now be
large enough for an entire line. This is because CP/M, unlike Unix,
lacks a kernel buffer to hold the rest of the line. If you use a
buffered input library like stdio to call read(2), then it works; but
if you try to read part of a line or a single character, then it
doesn't work.
Change from `uread(0, c, 1)` to `read(c)`, so input goes through
libpc's buffer. If input is a tty in Unix, this reduces the number of
read(2) system calls from one per character to one per line.
This change will become necessary in CP/M when I enable the line
editor.
Add a variable %{ackldflags} so I can pass `-fp`. This change seems
to cause the build to relink every ackprogram, because the link now
needs to use %{ackldflags} even if the flags are empty.
mandelbrot_c_cpm runs in YAZE-AG; startrek_c_cpm doesn't run because
it doesn't fit in the 16-bit address space.
This drops 124 bytes from the mandelbrot command (from 15015 to 14891
bytes) but has almost no effect on performance; the command takes
about 144 seconds (in YAZE-AG) both before and after optimizing libfp.
Old .o files stop working if they use floating point. One must
recompile those files. Old files don't call libfp in the correct way,
and may use symbols that I removed from libem. I don't keep old
symbols in libem/flp.s, because a program that pulls both libfp and
flp.s would get "multiply defined" errors in the linker.
I teach mach/i80/ncg/table to use libfp by copying or adapting the
patterns from mach/i86/ncg/table. I did not test all the patterns,
but I did use `ack -mcpm -fp -O4` to compile examples/mandelbrot.c,
then I ran it in the emulator YAZE-AG. It worked, but it was slow.