Skip to content

Commit ecf79c0

Browse files
committed
fpc-cross-m68k-*: add new subports
Add a series of cross compilers for m68k cpus, which require corresponding binutils.
1 parent 40f4598 commit ecf79c0

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

cross/m68k-binutils/Portfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2+
3+
PortSystem 1.0
4+
PortGroup crossbinutils 1.0
5+
6+
name m68k-binutils
7+
version 2.46.0
8+
revision 1
9+
maintainers {@kamischi web.de:karl-michael.schindler} \
10+
openmaintainer
11+
12+
if {$subport eq $name} {
13+
# Download sources and install docs for all subports
14+
crossbinutils.setup m68k ${version}
15+
depends_build
16+
depends_lib
17+
platforms any
18+
supported_archs noarch
19+
use_configure no
20+
build {}
21+
destroot {}
22+
}
23+
24+
# tried, but not working targets: amigaos atari openbsd
25+
# freepascal probably needs palm binutils from here:
26+
# https://github.com/chainq/prc-tools-remix
27+
foreach ostarget {linux freebsd netbsd} {
28+
subport m68k-${ostarget}-binutils {
29+
crossbinutils.setup m68k-${ostarget} ${version}
30+
# Depend on base package for installing the docs
31+
depends_lib-append port:$name
32+
configure.args-append --disable-werror
33+
if {${ostarget} eq "linux"} {
34+
depends_build-append port:bison
35+
}
36+
# Delete docs since already installed by the base package
37+
# Resolves clash about identical docs from each subport
38+
post-destroot {
39+
delete ${destroot}${prefix}/share/doc/m68k-binutils
40+
}
41+
}
42+
}
43+
44+
subport m68k-embedded-binutils {
45+
crossbinutils.setup m68k-embedded ${version}
46+
depends_lib-append port:$name
47+
configure.args-append \
48+
--target=m68k-unknown-elf \
49+
--disable-werror
50+
51+
post-destroot {
52+
# See comment above about deleting docs
53+
delete ${destroot}${prefix}/share/doc/m68k-binutils
54+
file rename ${destroot}${prefix}/m68k-unknown-elf/bin \
55+
${destroot}${prefix}/m68k-embedded
56+
file rename ${destroot}${prefix}/m68k-unknown-elf/lib \
57+
${destroot}${prefix}/m68k-embedded
58+
file delete ${destroot}${prefix}/m68k-unknown-elf
59+
}
60+
}

lang/fpc/Portfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,44 @@ foreach ostarget {linux netbsd} {
390390
}
391391
}
392392

393+
# may also support: amiga atari MacOSClassic palmos
394+
foreach ostarget {linux netbsd embedded} {
395+
subport "${name}-cross-m68k-$ostarget" {
396+
revision 3
397+
categories-append cross
398+
supported_archs noarch
399+
worksrcdir fpcbuild-${version}/fpcsrc
400+
use_parallel_build no
401+
use_configure no
402+
# depends_build-append port:${name} port:${name}-cross port:m68k-${ostarget}-binutils
403+
build.target rtl packages
404+
destroot.target rtl_install packages_install
405+
test.target
406+
407+
# target specifics
408+
description FPC cross-compiler for m68k-$ostarget
409+
long_description \
410+
This Pascal crosscompiler produces m68k executables, \
411+
which run natively on m68k-$ostarget systems. \n \
412+
Get help with: \n \
413+
fpc -h \n \
414+
Compile and link a Pascal file with: \n \
415+
\n \
416+
fpc -Pm68k -T$ostarget FILENAME
417+
418+
build.args PP=ppc68k CPU_TARGET=m68k OS_TARGET=$ostarget \
419+
OPT="-ap -v0"
420+
destroot.args CPU_TARGET=m68k OS_TARGET=$ostarget CROSSINSTALL=1 \
421+
INSTALL_PREFIX=${destroot}${prefix}/libexec/fpc/
422+
423+
# remove duplicate doc and bin files
424+
post-destroot {
425+
file delete -force ${destroot}${prefix}/libexec/fpc/share
426+
file delete -force ${destroot}${prefix}/libexec/fpc/bin
427+
}
428+
}
429+
}
430+
393431
if {${subport} eq "${name}"} {
394432
revision 3
395433

0 commit comments

Comments
 (0)