Project renamed from message_api → fpc-msgbase. Folder, README title, docs, build.sh, fpc.cfg, and test banners all updated for consistency with the planned remote at kjgr.io:2222/kenjreno/fpc-msgbase.git. Also scrubbed claims that backends were "ported from Allfix" or "match Allfix's msgutil/domsg" — none of this code was ported from Allfix; it was implemented from FTSC documents and the original format authors' published specs (jam.txt, squish.doc, pcboard.doc, EzyCom reference, WildCat 4 SDK headers). Author credits live in docs/ftsc-compliance.md. Real interop facts that mention Allfix-the-product stay documented: the PCB Extra2 sent-bit ($40) Allfix sets when tossing, and the FTSC-registered product code $EB. These describe external software behavior we interoperate with, not provenance. docs/format-notes/hudson.md removed — stale planning doc that predates the working ma.fmt.hudson backend.
149 lines
3.9 KiB
Bash
Executable File
149 lines
3.9 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# build.sh — build fpc-msgbase units for every supported target.
|
|
#
|
|
# Targets:
|
|
# x86_64-linux native
|
|
# i386-go32v2 DOS / DPMI
|
|
# i386-os2 OS/2
|
|
# i386-win32 Windows 32-bit
|
|
# i386-linux Linux 32-bit
|
|
# i386-freebsd FreeBSD 32-bit
|
|
#
|
|
# Usage: ./build.sh [target ...]
|
|
# (no args -> build everything)
|
|
|
|
set -e
|
|
|
|
FPCBASE=/opt/fpcup/fpc
|
|
FPCNATIVE=$FPCBASE/bin/x86_64-linux/fpc
|
|
PPCROSS386=$FPCBASE/bin/x86_64-linux/ppcross386
|
|
|
|
# Units we actually want to build. When new public units land in src/,
|
|
# add them here (in dependency order).
|
|
UNITS=(
|
|
src/ma.types.pas
|
|
src/ma.events.pas
|
|
src/ma.lock.pas
|
|
src/ma.paths.pas
|
|
src/ma.api.pas
|
|
src/formats/ma.fmt.hudson.pas
|
|
src/formats/ma.fmt.hudson.uni.pas
|
|
src/formats/ma.fmt.jam.pas
|
|
src/formats/ma.fmt.jam.uni.pas
|
|
src/formats/ma.fmt.squish.pas
|
|
src/formats/ma.fmt.squish.uni.pas
|
|
src/formats/ma.fmt.msg.pas
|
|
src/formats/ma.fmt.msg.uni.pas
|
|
src/formats/ma.fmt.pkt.pas
|
|
src/formats/ma.fmt.pkt.uni.pas
|
|
src/formats/ma.fmt.pcboard.pas
|
|
src/formats/ma.fmt.pcboard.uni.pas
|
|
src/formats/ma.fmt.ezycom.pas
|
|
src/formats/ma.fmt.ezycom.uni.pas
|
|
src/formats/ma.fmt.goldbase.pas
|
|
src/formats/ma.fmt.goldbase.uni.pas
|
|
src/formats/ma.fmt.wildcat.pas
|
|
src/formats/ma.fmt.wildcat.uni.pas
|
|
src/ma.batch.pas
|
|
examples/example_read.pas
|
|
examples/example_write.pas
|
|
)
|
|
|
|
ALL_TARGETS=(
|
|
x86_64-linux
|
|
i386-go32v2
|
|
i386-os2
|
|
i386-win32
|
|
i386-linux
|
|
i386-freebsd
|
|
)
|
|
|
|
if [ $# -eq 0 ]; then
|
|
TARGETS=("${ALL_TARGETS[@]}")
|
|
else
|
|
TARGETS=("$@")
|
|
fi
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
for tgt in "${TARGETS[@]}"; do
|
|
cpu="${tgt%%-*}"
|
|
os="${tgt##*-}"
|
|
|
|
case "$cpu" in
|
|
x86_64) compiler=$FPCNATIVE ;;
|
|
i386) compiler=$PPCROSS386 ;;
|
|
*) echo "unknown CPU $cpu"; exit 1 ;;
|
|
esac
|
|
|
|
mkdir -p "units/$tgt" "exe/$tgt"
|
|
|
|
# Per-target binutils directories so cross-linking finds the
|
|
# right ld / as / etc.
|
|
BINUTILS=()
|
|
case "$tgt" in
|
|
x86_64-linux)
|
|
: ;;
|
|
i386-linux)
|
|
BINUTILS+=("-FD/opt/fpcup/cross/bin/i386-linux"
|
|
"-XPi386-linux-"
|
|
"-Fl/opt/fpcup/cross/lib/i386-linux") ;;
|
|
i386-freebsd)
|
|
BINUTILS+=("-FD/opt/fpcup/cross/bin/i386-freebsd"
|
|
"-XPi386-freebsd12-"
|
|
"-Fl/opt/fpcup/cross/lib/i386-freebsd") ;;
|
|
x86_64-freebsd)
|
|
BINUTILS+=("-FD/opt/fpcup/cross/bin/x86_64-freebsd"
|
|
"-XPx86_64-freebsd12-"
|
|
"-Fl/opt/fpcup/cross/lib/x86_64-freebsd") ;;
|
|
i386-go32v2|i386-win32)
|
|
BINUTILS+=("-FD/opt/fpcup/cross/bin" "-XP$tgt-") ;;
|
|
i386-os2)
|
|
# EMX a.out linker needs entry point at TEXT_BASE (0x10000).
|
|
BINUTILS+=(
|
|
"-FD/opt/fpcup/cross/i386-pc-os2-emx"
|
|
"-XPi386-emx-"
|
|
"-k-e" "-k0x10000"
|
|
) ;;
|
|
esac
|
|
|
|
# Build search paths (rtl always present; the rest are optional).
|
|
SEARCH=(
|
|
"-Fu/opt/fpcup/fpc/units/$tgt/rtl"
|
|
)
|
|
for sub in fcl-base rtl-objpas regexpr; do
|
|
if [ -d "/opt/fpcup/fpc/units/$tgt/$sub" ]; then
|
|
SEARCH+=("-Fu/opt/fpcup/fpc/units/$tgt/$sub")
|
|
fi
|
|
done
|
|
|
|
# Library source roots
|
|
SEARCH+=(
|
|
"-Fusrc"
|
|
"-Fusrc/formats"
|
|
"-Fusrc/wc_sdk"
|
|
)
|
|
|
|
echo "=== $tgt ==="
|
|
for u in "${UNITS[@]}"; do
|
|
printf ' %-30s ' "$(basename "$u")"
|
|
if "$compiler" -Mobjfpc -Sh -Sgic -T"$os" \
|
|
"${BINUTILS[@]}" \
|
|
"${SEARCH[@]}" \
|
|
-FUunits/"$tgt" -FEexe/"$tgt" \
|
|
"$u" >/tmp/ma_build.$$.log 2>&1; then
|
|
echo "OK"
|
|
else
|
|
echo "FAIL"
|
|
cat /tmp/ma_build.$$.log | sed 's/^/ /'
|
|
rm -f /tmp/ma_build.$$.log
|
|
exit 1
|
|
fi
|
|
done
|
|
rm -f /tmp/ma_build.$$.log
|
|
done
|
|
|
|
echo
|
|
echo "All targets built."
|