Installing & using the NetSurf SDK Cross-compiling for ☑ Atari, ☑ Amiga, ☑ RISC-OS… ☐ NeXT ? NeXT ? François Revol RMLL 2018
References ●
NetSurf website –
●
Developer documentation
RMLL 2014 talk “Free your antiques”
NetSurf’s own toolchains ●
Based on others’ work
●
Primarily used for release & continuous integration
●
NetSurf’s own buildsystem is a bit complex –
●
Many git repos including a ‘buildsystem’ one
SDK itself is self-contained –
⚠ If inside the NetSurf build env :
export -n PREFIX
“Use the Source, Luke!” ●
●
sudo ${pkgman} install ${deps} –
⚠ Debian also need automake1.11 for atari at least
–
Debian deps mentioned, please send a patch for others 😸
sudo mkdir /opt/netsurf && sudo chmod 777 /opt/netsurf –
Default, can be overridden
–
Must be writable by user (yeah, I know…)
●
git clone git://git.netsurf-browser.org/toolchains.git
●
cd toolchains
Patch PendingⓅ ●
Some platforms currently broken in master…
●
Atari –
●
Amiga –
●
git checkout mmu_man/m68k-try-003 git checkout mmu_man/m68k-amiga-fix001
“Allons-y!” ●
t={arm-unknown-riscos,m68k-…} # set target
●
p=/opt/netsurf/$t # prefix shortcut
●
cd $t
●
make # build the cross-compiler itself…
●
cd ../sdk
●
GCCSDK_INSTALL_CROSSBIN=$p/cross/bin GCCSDK_INSTALL_ENV=$p/env make
A little extra… ●
The SDK only builds NetSurf’s dependencies
●
But we want libtiff, ncurses, SDL, SDL{image,ttf}…
●
git checkout mmu_man/sdk-extra
●
cd ../extra
●
GCCSDK_INSTALL_CROSSBIN=/opt/… GCCSDK_INSTALL_ENV=/opt/… make
Ok, C is great, what about $lang ? ●
GCC itself supports more (C++,ObjC…)
●
But runtime libs are usually not ported
●
In theory –
●
sed -i 's/enable-languages=c /enablelanguages=c,c++ /' *-*/Makefile
In practice, not working yet for atari
Hello, World! ●
●
●
●
#include int main(void) { printf("Hello World\n"); return 0; } $ export PATH=/opt/netsurf/m68k-atari-mint/cross/bin":$PATH" $ m68k-atari-mint-gcc -o hello.prg hello.c $ file hello.prg hello.prg: Atari ST M68K contiguous executable…
Minimal setup ●
●
●
export PATH=/opt/netsurf/m68k-atari-mint/cross/bin":$PATH" export PKG_CONFIG_LIBDIR=/opt/netsurf/m68k-atarimint/env/lib/pkgconfig If autotools –
●
./configure --host=m68k-atari-mint
Else –
YMMV
Let’s try it!
QEmacs ●
●
Little Emacs-like (no lisp) editor by Fabrice Bellard (QEMU, FFmpeg…) export PATH=/opt/netsurf/m68k-atarimint/cross/bin":$PATH"
●
./configure --enable-atari
●
make
Grafx2 ●
●
Some patches yet to be upstreamed make ATARICROSS=1 prefix=/opt/netsurf/m68k-atari-mint/e nv CFLAGS='-DMAX_PATH=1024 DPATH_MAX=1024 -I/opt/netsurf/m68katari-mint/cross/m68k-atari-mint/incl ude' NOLUA=1
Powermanga ●
./configure --host=m68k-atari-mint
●
… --disable-sound --disable-pngexport
●
… --with-sdl-prefix=/opt/netsurf/m68k-atari-mint/env
●
error: SDL/SDL.h: No such file or directory –
●
●
Official way is 😒
display.h:68:5: error: expected identifier before numeric constant –
already defines K_INSERT
–
#undef …
Tada \o/
Kinda works…
SchismTracker ●
util.c:143: undefined reference to `_log10f' –
●
“Bad memory protection” –
●
Force to use the double version -Wl,--msuper-memory
CFLAGS='-Dlog10f=log10 -Dpowf=pow' LDFLAGS='Wl,--msuper-memory' ./configure --host=m68katari-mint --with-sdl-prefix=/opt/netsurf/m68katari-mint/env
Wow, it fails fast!
Atari MiNT specifics ●
Fixup default stack size –
●
-Wl,--stack,8k or $t-stack …
Set Supervisor flag (for SDL) –
-Wl,--msuper-memory or $t-flags …
AmigaOS specifics ●
TODO
RISC-OS specifics ●
TODO
Future? ●
LLVM? –
●
At least 2 failed attempts : llvm68k & llvm-m68k
Thanks! ●
Please send patches upstream!