diff options
author | B. Watson <yalhcru@gmail.com> | 2018-07-16 18:06:48 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-07-17 07:15:42 +0700 |
commit | 19e983380bc6420cbe0cbebe79d60afb12bd5007 (patch) | |
tree | 232766582038a1d87e6ab1f1499abdc42c709585 /development/z88dk | |
parent | 07d87cae3936741f4a5a8940e742fd04a198c090 (diff) |
development/z88dk: Added (C cross compiler targetting the Z80).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'development/z88dk')
-rw-r--r-- | development/z88dk/README | 12 | ||||
-rw-r--r-- | development/z88dk/man/appmake.1 | 272 | ||||
-rw-r--r-- | development/z88dk/man/copt.1 | 79 | ||||
-rw-r--r-- | development/z88dk/man/z80asm.1 | 92 | ||||
-rw-r--r-- | development/z88dk/man/z88dk.1 | 42 | ||||
-rw-r--r-- | development/z88dk/man/zcc.1 | 255 | ||||
-rw-r--r-- | development/z88dk/slack-desc | 19 | ||||
-rw-r--r-- | development/z88dk/z88dk.SlackBuild | 119 | ||||
-rw-r--r-- | development/z88dk/z88dk.info | 10 |
9 files changed, 900 insertions, 0 deletions
diff --git a/development/z88dk/README b/development/z88dk/README new file mode 100644 index 0000000000000..a6f364f9876eb --- /dev/null +++ b/development/z88dk/README @@ -0,0 +1,12 @@ +z88dk (C cross compiler targetting the Z80) + +z88dk is a z80 C cross compiler supplied with an assembler/linker and +a set of libraries implementing the C standard library for a number of +different z80 based machines. The name z88dk originates from the time when +the project was founded and targetted only the Cambridge z88 portable. + +Very little documentation is shipped with z88dk, and what's present is +often outdated. For more extensive and updated docs, see the z88dk wikis: + +https://github.com/z88dk/z88dk/wiki +https://www.z88dk.org/wiki/doku.php diff --git a/development/z88dk/man/appmake.1 b/development/z88dk/man/appmake.1 new file mode 100644 index 0000000000000..e2c7cc41bacdf --- /dev/null +++ b/development/z88dk/man/appmake.1 @@ -0,0 +1,272 @@ +.\"Text automatically generated by txt2man +.TH appmake 1 "01 December 2009" "" "z88 Development Kit" +.SH NAME +\fBappmake \fP- The z88dk application generator +.SH SYSNOPIS +appmake [+target] [options] +.SH DESCRIPIONS +This manual page documents briefly the z88dk tools. This manual page +was written for the Debian GNU/Linux distribution (but may be used +by others), because the original program does not have a manual page. +.PP +Please refer to the z88dk documentation in /usr/share/doc/z88dk-doc/ for the complete description of the system. +If /usr/share/doc/z88dk-doc not exists, please install the package z88dk-doc. +.PP +This program is used to produce files which are suitable for use in +emulators or on the real hardware. +.SH OPTIONS +Options used in all targets: +.TP +.B +\fB-h\fP +\fB--help\fP Display help +.TP +.B +\fB-b\fP +\fB--binfile\fP [file] Linked binary file +.TP +.B +\fB-o\fP +\fB--output\fP [name] Name of output file +.RE +.PP + +.RS +.TP +.B ++[target] +generate file for target machine. +Targets with additional options are: +.RS +.TP +.B +abc80 +.TP +.B +ace +Generates a .byt file suitable for loading into emulators +.TP +.B +acetap +Generates a .TAP for the Ace32 emulator +.TP +.B +aquarius +Creates a BASIC loader file and binary stored in variable array format +.TP +.B +cpc +Gegerates file for Amstrad CPC +.PP +Additional options: +.RS +.TP +.B +\fB-c\fP +\fB--crt0file\fP [file] crt0 file used in linking +.RS +.TP +.B +\fB--exec\fP [nnnn] +Location address to start execution +.TP +.B +\fB--org\fP [nnnn] +Origin of the binary +.RE +.RE +.TP +.B +hex +Creates an intel hex record suitable for embedded devices +.PP +Additional options: +.RS +.TP +.B +\fB--org\fP [nnnn] +Origin of the binary +.RE +.TP +.B +msx +Adds a file header to enable the program to be loaded using 'bload "file.bin",r +.TP +.B +mz +.TP +.B +nas +Generates a .NAS file suitable for use by emulators +.PP +Additional options: +.RS +.TP +.B +\fB--org\fP [nnnn] +Origin of the binary +.RE +.TP +.B +rex +.PP +Additional options: +.RS +.TP +.B +\fB-n\fP +\fB--appname\fP [name] Application Name +.TP +.B +\fB-c\fP +\fB--comment\fP [text] Application Comment +.RS +.TP +.B +\fB--nt\fP +Don't pad out to 8k addin +.RE +.RE +.TP +.B +ti82 +Creates a .82p file +.PP +Additional options: +.RS +.TP +.B +\fB--comment\fP [text] +File comment (42 chars) +.RE +.TP +.B +ti83 +Creates a .83p file +.PP +Additional options: +.RS +.TP +.B +\fB--comment\fP [text] +File comment (42 chars) +.RE +.TP +.B +ti8x +Creates a .8xp file +.PP +Additional options: +.RS +.TP +.B +\fB--comment\fP [text] +File comment (42 chars) +.RE +.TP +.B +ti85 +Creates a .85p file +.PP +Additional options: +.RS +.TP +.B +\fB--comment\fP [text] +File comment (42 chars) +.RE +.TP +.B +ti86 +Creates a .86p file +.PP +Additional options: +.RS +.TP +.B +\fB--comment\fP [text] +File comment (42 chars) +.RE +.TP +.B +ti86s +Creates a .86s file +.PP +Additional options: +.RS +.TP +.B +\fB--comment\fP [text] +File comment (42 chars) +.RE +.TP +.B +svi +Creates a .cas file loadable with the SVI emulator +.TP +.B +z88 +Generates .63 and .62 files suitable for burning to EPROM +.PP +Additional options: +.RS +.TP +.B +\fB-c\fP +\fB--crt0file\fP [file] crt0 file used in linking +.RS +.TP +.B +\fB--nt\fP +Do not truncate bank 63 +.RE +.RE +.TP +.B +z88shell +Patches the header to ensure that the program is recognised by the shell +.PP +Additional options: +.RS +.TP +.B +\fB-c\fP +\fB--crt0file\fP [file] crt0 file used in linking +.RE +.TP +.B +zxvgs +Creates a zxvgs application file +.PP +Additional options: +.RS +.TP +.B +\fB-c\fP +\fB--crt0file\fP [file] crt0 file used in linking +.RE +.TP +.B +zx +Generates a .TAP file complete with BASIC header +.PP +Additional options: +.RS +.TP +.B +\fB-c\fP +\fB--crt0file\fP [file] crt0 file used in linking +.RS +.TP +.B +\fB--org\fP [nnnn] +Origin of the binary +.TP +.B +\fB--blockname\fP [name] +Name of the code block in tap file +.SH SEE ALSO +\fBz88dk\fP(1), \fBz88dk-zcc\fP(1), \fBz88dk-z80asm\fP(1), \fBz88dk-appmake\fP(1), \fBz88dk-copt\fP(1). +.SH AUTHOR +z88dk was written by Dominic Morris <dom@z88dk.org>, and others. +This manual page was written by Krystian Wlosek <tygrys@waw.pdi.net> using exists documentation, for the Debian GNU/Linux system. diff --git a/development/z88dk/man/copt.1 b/development/z88dk/man/copt.1 new file mode 100644 index 0000000000000..dae4281766901 --- /dev/null +++ b/development/z88dk/man/copt.1 @@ -0,0 +1,79 @@ +.\"Text automatically generated by txt2man +.TH copt 1 "01 December 2009" "" "z88 Development Kit" +.SH NAME +\fBcopt \fP- peephole optimizer +.SH SYSNOPIS +copt file \.\.\. +.SH DESCRIPTION +copt is a general-purpose peephole optimizer. It reads +code from its standard input and writes an improved version to its standard output. +copy reads the named files for its optimizations, which are encoded as follows: +.PP +.nf +.fam C + <pattern for input line 1> + <pattern for input line 2> + \.\.\. + <pattern for input line n> + = + <pattern for output line 1> + <pattern for output line 2> + \.\.\. + <pattern for output line m> + <blank line> + +.fam T +.fi +Pattern matching uses literal string comparison, with one +exception: ``%%'' matches the ``%'' character, and ``%'' +followed by a digit matches everything up to the next +occurrence of the next pattern character, though all +occurrences of %\fIn\fP must denote the same string. For example, +the pattern ``%1=%1.'' matches exactly those strings +that begin with a string X, followed by a ``='' (the +first), followed by a second occurrence of X, followed by +a period. In this way, the input/output pattern +.PP +.nf +.fam C + mov $%1,r%2 + mov *r%2,r%2 + = + mov %1,r%2 + +.fam T +.fi +commands copt to replace runs like +.PP +.nf +.fam C + mov $_a,r3 + mov *r3,r3 + +.fam T +.fi +with +.PP +.nf +.fam C + mov _a,r3 + +.fam T +.fi +Note that a tab or newline can terminate a %\fBn\fP variable. +.PP +copt compares each run of input patterns with the current +input instruction and its predecessors. If no match is +found, it advances to the next input instruction and tries +again. Otherwise, it replaces the input instructions with +the corresponding output patterns, pattern variables +instantiated,and resumes its search with the \fIfirst\fP +instruction of the replacement. copt matches input patterns +in reverse order to cascade optimizations without +backing up. +.SH BUGS +Errors in optimization files are always possible. +.SH SEE ALSO +\fBz88dk\fP(1), \fBz88dk-zcc\fP(1), \fBz88dk-z80asm\fP(1), \fBz88dk-appmake\fP(1), \fBz88dk-copt\fP(1). +.SH AUTHOR +z88dk was written by Dominic Morris <dom@z88dk.org>, and others. diff --git a/development/z88dk/man/z80asm.1 b/development/z88dk/man/z80asm.1 new file mode 100644 index 0000000000000..d993446e1e337 --- /dev/null +++ b/development/z88dk/man/z80asm.1 @@ -0,0 +1,92 @@ +.\"Text automatically generated by txt2man +.TH z80asm 1 "01 December 2009" "" "z88 Development Kit" +.SH NAME +\fBz88dk-z80asm \fP- Z80 assembler compiler. +.SH SYSNOPIS +z88dk-z80asm [options] [ @<modulefile> | {<filename>} ] +.SH DESCRIPTION +This manual page documents briefly the z88dk tools. This manual page +was written for the Debian GNU/Linux distribution (but may be used +by others), because the original program does not have a manual page. +.PP +z88dk-z80asm is a Z80 assembler cross compiler. +.PP +Please refer to the z88dk documentation in /usr/share/doc/z88dk-doc/ for the complete description of the system. +If /usr/share/doc/z88dk-doc not exists, please install the package z88dk-doc. +.SH OPTIONS +.TP +.B +\fB-h\fP +display help +.TP +.B +\fB-n\fP +defines option to be turned OFF (except \fB-r\fP \fB-R\fP \fB-i\fP \fB-x\fP \fB-D\fP \fB-t\fP \fB-o\fP) +.TP +.B +\fB-v\fP +verbose +.TP +.B +\fB-l\fP +listing file +.TP +.B +\fB-s\fP +symbol table, +.TP +.B +\fB-m\fP +map listing file +.TP +.B +\fB-r\fP<ORG> +Explicit relocation <ORG> defined in hex (ignore ORG in first module) +.TP +.B +\fB-plus\fP +Interpret 'Invoke' as RST 28h +.TP +.B +\fB-R\fP +Generate relocatable code (Automatical relocation before execution) +.TP +.B +\fB-D\fP<symbol> +define symbol as logically TRUE (used for conditional assembly) +.TP +.B +\fB-b\fP +assemble files & link to ORG address. \fB-c\fP split code in 16K banks +.TP +.B +\fB-d\fP +date stamp control, assemble only if source file > object file +\fB-a\fP: \fB-b\fP & \fB-d\fP (assemble only updated source files, then link & relocate) +.TP +.B +\fB-o\fP<bin filename> +expl. output filename, \fB-g\fP XDEF reloc. addr. from all modules +.TP +.B +\fB-i\fP<library> +include <library> LIB modules with .obj modules during linking +.TP +.B +\fB-x\fP<library> +create library from specified modules ( e.g. with @<modules> ) +.TP +.B +\fB-t\fP<n> +tabulator width for .map, .def, .sym files. Column width is 4 times \fB-t\fP +.PP +Default options: \fB-nv\fP \fB-nd\fP \fB-nb\fP \fB-nl\fP \fB-s\fP \fB-m\fP \fB-ng\fP \fB-nc\fP \fB-nR\fP \fB-t8\fP +.SH SEE ALSO +\fBz88dk\fP(1), \fBz88dk-zcc\fP(1), \fBz88dk-z80asm\fP(1), \fBz88dk-appmake\fP(1), \fBz88dk-copt\fP(1). +.RE +.PP + +.SH AUTHOR +z88dk was written by Dominic Morris <dom@z88dk.org>, and others. +z80asm was written by Gunther Strube <gbs@image.dk>. +This manual page was written by Krystian Wlosek <tygrys@waw.pdi.net> using exists documentation, for the Debian GNU/Linux system. diff --git a/development/z88dk/man/z88dk.1 b/development/z88dk/man/z88dk.1 new file mode 100644 index 0000000000000..cef95b9206428 --- /dev/null +++ b/development/z88dk/man/z88dk.1 @@ -0,0 +1,42 @@ +.\"Text automatically generated by txt2man +.TH z88dk 1 "01 December 2009" "" "z88 Development Kit" +.SH NAME +\fBz88dk \fP- The z88 Development Kit. +\fB +.SH DESCRIPTION + +The z88 Development Kit (hereafter known as z88dk) is an advanced set +of tools allowing the production of complex programs for z80 based +computers in either C or assembly language. +The name z88dk originates from the time when the project was founded and targetted only the Cambridge z88 portable. +.RE +.PP +The compiler featured in z88dk is much enhanced Small C compiler, the compiler accepts many features +of ANSI C and is only deficient in a few areas where implementation on a z80 processor might prove +inefficient. The compiler performs simple optimizations, but the bulk of the optimization is done by +a set of peep-hole rules, which will typically reduce the size of a large project by up to a third. +.RS +.PP +The libraries supplied with z88dk are designed to be as generic as possible, indeed it is possible +to port to a new machine simply by supplying two library routines and some startup code. It is hoped +that one day z88dk will support as many z80 based machines as there is information available and sufficient interest in. +.PP +z88dk contains usable tools: +.IP \(bu 3 +zcc - the frontend of z88dk is called zcc, it is this that you should call if you want to do any compilations. +.IP \(bu 3 +z80asm - Z80 assembler compiler +.IP \(bu 3 +copt - Z80 asm optimizer code +.IP \(bu 3 +appmake - produce files which are suitable for use in emulators or on the real hardware +.IP \(bu 3 +sccz80 - Small-C/Plus compiler +.SH SEE ALSO +\fBz88dk\fP(1), \fBz88dk-zcc\fP(1), \fBz88dk-z80asm\fP(1), \fBz88dk-appmake\fP(1), \fBz88dk-copt\fP(1). +.RE +.PP + +.SH AUTHOR +z88dk was written by Dominic Morris <dom@z88dk.org>, and others. +This manual page was written by Krystian Wlosek <tygrys@waw.pdi.net> using exists documentation, for the Debian GNU/Linux system. diff --git a/development/z88dk/man/zcc.1 b/development/z88dk/man/zcc.1 new file mode 100644 index 0000000000000..723b084119455 --- /dev/null +++ b/development/z88dk/man/zcc.1 @@ -0,0 +1,255 @@ +.\"Text automatically generated by txt2man +.TH zcc 1 "01 December 2009" "" "z88 Development Kit" +.SH NAME +\fBzcc \fP- The frontend of z88dk +.SH SYSNOPIS +zcc [flags] [files to be compiled/linked] +.SH DESCRIPTION +This manual page documents briefly the z88dk tools. This manual page +was written for the Debian GNU/Linux distribution (but may be used +by others), because the original program does not have a manual page. +.RE +.PP + +.RS +Please refer to the z88dk documentation in /usr/share/doc/z88dk-doc for the complete description of the system. +If /usr/share/doc/z88dk-doc not exists, please install the package z88dk-doc. +.PP +The frontend of z88dk is called zcc, it is this that you should call +if you want to do any compilations. +.PP +The files can be either C files (.c), preprocessed C \fBfiles\fP(.i), +compiled C files (.asm), optimised compiled file (.opt) or assembled +files (.obj), any combination of them can be mixed together and the +relevant processed done on them. +.PP +Processing of a file list is done on each file in turn (i.e. preprocess, +compile, optimise, assemble) at the end all files may be linked into +a single executable if desired. +.SH OPTIONS +Options to control the action of the frontend: +.TP +.B ++[file] +Name of alternate config file (must be the first argument). +.PP +.nf +.fam C + Predefined alternate configs: + abc80 ABC80 + aceansi Jupiter ACE, using VT-ANSI engine + cpm CP/M + msx MSX 1 + mz Sharp MZ + mzansi Sharp MZ, using VT-ANSI + nc Amstrad NC100 + rex REX 6000 + sam Sam Coupe + svi Spectravideo SVI + m5 SORD M5 + ti82 Ti82, using ROM text routines + ti82ansi Ti82, using VT-ANSI + ti83 Ti83, using ROM text routines + ti83ansi Ti83, using VT-ANSI + ti85 Ti85, using ROM text routines + ti85ansi Ti85, using VT-ANSI + ti86 Ti86, using ROM text routines + ti86ansi Ti86, using VT-ANSI + ti8x Ti83+, using ROM text routines + [ti8xansi] Ti83+, using VT-ANSI + vz VZ / Laser 200 + vzansi VZ / Laser 200, using VT-ANSI + z88 Cambridge Z88 + z88ansi Cambridge Z88, using VT-ANSI + z88net Cambridge Z88 with TCP/IP + zx ZX Spectrum + zx81 ZX 81 + zx81ansi ZX 81, using VT-ANSI + zxansi ZX Spectrum, using VT-ANSI + +.fam T +.fi +.TP +.B +\fB-a\fP +Produce .asm (or .opt) file only +.TP +.B +\fB-c\fP +Do not link object files +.TP +.B +\fB-E\fP +Preprocess files only, leave output in .i file +.TP +.B +\fB-o\fP [file] +Specify output file for binary (default is a.bas for BASIC programs and a.bin for application binaries) +.TP +.B +\fB-On\fP +Optimize compiler output (to .opt file) n can be either 0 (none) 1,2,3, level 2 is recommended. Level 3 is suitable for large programs (includes certain lib functions to reduce size of \fBcode\fP(!)) +.TP +.B +\fB-v\fP +Verbose - echo commands as they are executed +.TP +.B +\fB-vn\fP +Don't be verbose +.RE +.PP + + +.RS +Options to control library usage: +.TP +.B +\fB-l\fP[name] +Link in a library - supply just the name (after placing them in the correct directory). +.PP +.nf +.fam C + The 'name' are: + farz88 Z88 far support + gfx Z88 BASIC graphics lib + gfxapp Z88 application graphics lib + m Generic math routines + malloc Generic near malloc routine + mz OZ's math routines + ndos Fake file-routines, return errors only + net Z88 socket routines for ZSock + netdev Z88 socket routines for devices + p3 +3 file support library + tigray82 Ti82 graylib routines + tigray83 Ti83 graylib routines + tigray83p Ti83+ graylib routines + tigray85 Ti85 graylib routines + tigray86 Ti86 graylib routines + z88 Some Z88 application routines, like mailboxing + zxmath ZX Spectrum ROM based math routines + zxvgs ZXVGS hardware support + +.fam T +.fi +.TP +.B +\fB-m\fP +Generate .map files when assembling/linking +.RE +.PP + + +.RS +Options to control the type code produced: +.TP +.B +\fB-unsigned\fP +Implicitly define everything as unsigned unless explicitly told otherwise. +.TP +.B +\fB-create-app\fP +Create an application image (i.e. bank 63,62 etc) +.TP +.B +\fB-make-app\fP +(App) Notify the compiler that you're trying to make an application +.TP +.B +\fB-reqpag\fP= +(App) Number of 256 byte pages required for bad application +.TP +.B +\fB-zorg\fP= +(App) Origin for a Z88 application +.TP +.B +\fB-safedata\fP= +(App) Amount of safedata required by your code +.TP +.B +\fB-defvars\fP= +(App) Where static variables should be dropped (only valid for single file compilations, but see later) +.TP +.B +\fB-expandz88\fP +(App) Expanded z88 required +\fB-no-expandz88\fP (App) Expanded z88 not required (these two flags toggle some startup code to check for an expanded machine) +.TP +.B +\fB-startup\fP=3 +Produce standalone code that can be run from a set address from BASIC. Use \fB-zorg\fP= to change the address +.TP +.B +\fB-R\fP +(Use with above) produces relocatable code that can be loaded into a DIM'd BASIC array. +.TP +.B +\fB-smartpf\fP +Intelligent printf routine handling +.TP +.B +\fB-no-smartpf\fP +Turn off the intelligent printf handling +.TP +.B +\fB-make-lib\fP +Shortcut to generate .o files from library .c files +.TP +.B +\fB-stackoffset\fP +Sets the stack offset for shared libs (see package.txt for details) +.RE +.PP + + +.RS +Miscellaneous options: +.TP +.B +\fB-z80-verb\fP +Allow z80asm to be verbose, this tends to generate a lot +of output to the screen so may not be desired. +.TP +.B +\fB-cc\fP +Intersperse C code as comments in the assembler output, warning: +this *will* clobber some optimizations. +.TP +.B +\fB-Wall\fP +Turn on all the compiler warnings +.TP +.B +\fB-Wnone\fP +Turn off all compiler warnings +.TP +.B +\fB-Wn\fP[num] +Turn off the compiler warning [num] +.TP +.B +\fB-W\fP[num] +Turn on the compiler warning [num] +.TP +.B +\fB-asxx\fP +Cause the compiler to emit asxx compatible code +.TP +.B +\fB-Cp\fP[option] +Pass an option through to the pre-processor +.TP +.B +\fB-Ca\fP[option] +Pass an option through to the assembler +.PP +In addition, the flags, \fB-D\fP, \fB-I\fP, \fB-U\fP are passed through to the preprocessor. +.SH SEE ALSO +\fBz88dk\fP(1), \fBz88dk-zcc\fP(1), \fBz88dk-z80asm\fP(1), \fBz88dk-appmake\fP(1), \fBz88dk-copt\fP(1). +.RE +.PP + +.SH AUTHOR +z88dk was written by Dominic Morris <dom@z88dk.org>, and others. +This manual page was written by Krystian Wlosek <tygrys@waw.pdi.net> using exists documentation, for the Debian GNU/Linux system. diff --git a/development/z88dk/slack-desc b/development/z88dk/slack-desc new file mode 100644 index 0000000000000..b1db15c9ae107 --- /dev/null +++ b/development/z88dk/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +z88dk: z88dk (C cross compiler targetting the Z80) +z88dk: +z88dk: z88dk is a z80 C cross compiler supplied with an assembler/linker +z88dk: and a set of libraries implementing the C standard library for a +z88dk: number of different z80 based machines. The name z88dk originates +z88dk: from the time when the project was founded and targetted only the +z88dk: Cambridge z88 portable. +z88dk: +z88dk: +z88dk: +z88dk: diff --git a/development/z88dk/z88dk.SlackBuild b/development/z88dk/z88dk.SlackBuild new file mode 100644 index 0000000000000..f1e4eb3605ee5 --- /dev/null +++ b/development/z88dk/z88dk.SlackBuild @@ -0,0 +1,119 @@ +#!/bin/sh + +# Slackware build script for z88dk + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# TODO: someday include the zsdcc stuff. Probably sometime after z88dk's +# 2.0 release. If no 2.0 release exists by, say, the start of 2019, I'll +# probably change this build so it works with a git snapshot instead +# of a release. I'll admit, my motivation for that will be that I want +# to have a C compiler that targets Pac-Man arcade hardware (the 1.99B +# release doesn't, current git does). + +PRGNAM=z88dk +VERSION=${VERSION:-1.99B} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM +unzip $CWD/$PRGNAM-src-$VERSION.zip +cd $PRGNAM + +# Upstream permissions are bad. Please don't replace with "find . -L +# ..." boilerplate. +find . -name CVS -print0 | xargs -0 rm -rf +find . -type f -print0 | xargs -0 chmod 0644 +find . -type d -print0 | xargs -0 chmod 0755 +chmod +x *.sh + +# Sneaky ways to inject CFLAGS. +sed -i "s/CC=gcc/CC='gcc $SLKCFLAGS'/" build.sh +export CXX="g++ $SLKCFLAGS" + +# Default prefix. +sed -i "s,/usr/local,/usr," Makefile + +# Upstream seems to be in the middle of migrating from /usr/lib to +# /usr/share or vice versa. The compiler looks for stuff in lib that's +# actually installed to share, if I don't do this: +sed -i '/^prefix_share/s,/share,/lib,' Makefile + +# Note to well-intentioned maintainers: please don't try to move +# this stuff to /usr/lib64 on 64-bit systems. There's no native code +# (no ELF executables, no shared or static libraries full of x86_64 +# code). Everthing in /usr/lib/z88dk is either headers, source, or +# z88dk's own .lib format for z80 object code. From Linux's point +# of view, it's just data. It's no different from Pat keeping udev +# rules in /lib/udev on 64-bit. + +# Parallel make of the compiler itself works OK, but not of the +# z80 native libraries. +sed -i '/^\$MAKE *-e/aexport MAKEFLAGS="-j1"' build.sh + +./build.sh + +# install-libs doesn't seem to support DESTDIR. +make install prefix=$PKG/usr +make install-libs prefix=$PKG/usr + +# 'make install' doesn't install everything the compiler needs... +# Trying to build the examples I got "sh: zpragma: command not found". +cp -a bin/* $PKG/usr/bin/ + +# strip strips everything but chokes on the perl script. +strip $PKG/usr/bin/* 2>/dev/null || true + +# man pages from Debian: +# http://http.debian.net/debian/pool/main/z/z88dk/z88dk_1.8.ds1-10.debian.tar.gz +# They're for an older version of z88dk, and there's not a complete +# set of them, but it's better than nothing I hope. +mkdir -p $PKG/usr/man/man1 +for i in $CWD/man/*.1; do + gzip -9c < $i > $PKG/usr/man/man1/$( basename $i ).gz +done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README* LICENSE EXTENSIONS doc examples support \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/development/z88dk/z88dk.info b/development/z88dk/z88dk.info new file mode 100644 index 0000000000000..e8bed2a8febcc --- /dev/null +++ b/development/z88dk/z88dk.info @@ -0,0 +1,10 @@ +PRGNAM="z88dk" +VERSION="1.99B" +HOMEPAGE="https://www.z88dk.org/forum/" +DOWNLOAD="http://downloads.sourceforge.net/project/z88dk/z88dk/1.99B/z88dk-src-1.99B.zip" +MD5SUM="6412a730d1b38a8ecf393683981a33ae" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" |