Building NetSurf for ZETA (cross build from a Mac + native C++ on ZETA)
=======================================================================

You need
  * a Mac with clang (Xcode command line tools), llvm (for llvm-ar), pkgconf, perl,
    python3, re2c, lemon, make 3.81+
  * a copy of ZETA's headers: /boot/develop/headers/{posix,be,...} copied to a
    CASE-SENSITIVE volume (e.g. a case-sensitive APFS sparsebundle)
  * a ZETA machine with the developer tools (gcc 2.95), reachable by ssh/sshd

Upstream sources (not included, download the exact versions)
  see docs/THIRD-PARTY.txt for URLs and versions.
  For JavaScript you also need the host tool nsgenbind 0.9 (built for the Mac with NetSurf's
  buildsystem, plus bison >= 3 and flex) on PATH, and libsvgtiny for SVG.

Outline (the scripts are in source/tools/scripts, patches in source/tools/patches)
  1. tc/zns-cc, zns-ar: the clang wrapper and archiver (edit paths at the top).
     hdr-overlay/ holds our stdint/inttypes/iconv.h and zns_prefix.h (force-included).
  2. scripts/build_ns_libs.sh   - NetSurf's own libraries via NetSurf's build system
                                 (libwapcaplet libparserutils libhubbub libcss libnsutils libnspsl
                                  libdom libnsgif libnsbmp libsvgtiny)
     scripts/build_misc_libs.sh - zlib, libpng, libjpeg, expat, utf8proc
     scripts/build_tls_curl.sh  - mbedTLS
     scripts/build_curl.sh      - curl (with compat/curl_config.h)
  3. Unpack netsurf-3.11-src, run:  python3 patches/apply_fe_patches.py <netsurf dir>
     (or just use source/netsurf-3.11-zeta, which is already patched).
  4. Compile the core C objects:
       make -k TARGET=beos HOST=beos PREFIX=<prefix> CC=tc/zns-cc CXX=tc/zns-skipcxx AR=tc/zns-ar
     (the .cpp files "fail" on the Mac on purpose; they are built on ZETA)
  5. Copy the objects, the static libraries and the frontend sources to ZETA.
     On ZETA: scripts/dell_compile_fe.sh (g++), scripts/dell_link.sh (link),
     compat/mkrsrc.cpp + xres (resources), mimeset -f.
  scripts/deploy.sh and scripts/ship_objs.sh automate steps 4-5 for the author's setup
  (hard-coded host names/paths - adapt them).

The final link line (ZETA):
  g++ -o NetSurf <objects> -L<prefix>/lib -lcurl -lmbedtls -lmbedx509 -lmbedcrypto \
      -lsvgtiny -ldom -lcss -lhubbub -lparserutils -lwapcaplet -lnsbmp -lnsgif -lnspsl -lnsutils \
      -lutf8proc -lexpat -ljpeg -lpng -lz -lbe -lzeta -ltranslation -ltracker -lsocket \
      -lbind -liconv -lstdc++.r4 -lroot
