[{"data":1,"prerenderedAt":24},["ShallowReactive",2],{"project-libsurface-building":3},{"page":4,"others":20},{"slug":5,"src":6,"title":7,"source":8,"toc":9,"html":19},"building","BUILDING.md","Building libsurface","https:\u002F\u002Fgithub.com\u002FFreeMixer\u002Flibsurface\u002Fblob\u002Fa1f337eaafad7faa65f2331027ef2f6aea44d556\u002FBUILDING.md",[10,13,16],{"id":11,"title":12},"tests","Tests",{"id":14,"title":15},"the-diginet-module","The DigiNet module",{"id":17,"title":18},"the-mackie-module","The Mackie module","\u003Ch1 id=\"building-libsurface\">Building libsurface\u003C\u002Fh1>\n\u003Cp>A hand-kept Makefile, no build system to configure. You need a C11 compiler and \u003Ccode>make\u003C\u002Fcode>.\nNothing else: no library outside libc and libm.\u003C\u002Fp>\n\u003Cpre>\u003Ccode>make                          # libsurface.a\nmake test                     # the unit suite, the same command CI runs\nmake shared                   # libsurface.so, as the packages build it\nmake install PREFIX=\u002Fusr\u002Flocal [DESTDIR=...]\nmake clean\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>The code is plain C11 built with \u003Ccode>-Wall -Wextra -Werror\u003C\u002Fcode>, so a warning is a build failure.\n\u003Ccode>CC\u003C\u002Fcode> and \u003Ccode>CFLAGS\u003C\u002Fcode> can be overridden on the command line; the warning flags are kept even then.\u003C\u002Fp>\n\u003Cp>\u003Ccode>make install\u003C\u002Fcode> copies the header to \u003Ccode>$(PREFIX)\u002Finclude\u002Fsurface\u002F\u003C\u002Fcode>, the archive to\n\u003Ccode>$(PREFIX)\u002Flib\u003C\u002Fcode> (\u003Ccode>LIBDIR=\u003C\u002Fcode> to change it) and a pkg-config file, so a consumer builds with:\u003C\u002Fp>\n\u003Cpre>\u003Ccode>cc app.c $(pkg-config --cflags --libs libsurface)\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>(\u003Ccode>--static\u003C\u002Fcode> adds libm for a link against the archive.)\u003C\u002Fp>\n\u003Ch2 id=\"tests\">Tests\u003C\u002Fh2>\n\u003Cp>Every test runs through \u003Ccode>tests\u002Frun-test.sh\u003C\u002Fcode>, which gives it a timeout: a hang is a failure,\nnever a stalled build. A test that exits 77 proved this machine cannot host it and is reported\nas SKIP, never as a pass.\u003C\u002Fp>\n\u003Cp>The suites need no device. \u003Ccode>tests\u002Fharness.h\u003C\u002Fcode> is a fake backend that records every write, a\nfake host that answers the surface's moves the way a console does (echoing at once, lagging,\nor refusing), and a virtual clock that runs the surface's timers in order:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>test_motor\u003C\u002Fcode>: the motor policy, case by case as the X-Touch driver's suite proved it;\u003C\u002Fli>\n\u003Cli>\u003Ccode>test_audit\u003C\u002Fcode>: the motor-law audit of 2026-09-25 and the fast-throw round trip;\u003C\u002Fli>\n\u003Cli>\u003Ccode>test_bank\u003C\u002Fcode>: the bank window;\u003C\u002Fli>\n\u003Cli>\u003Ccode>test_meter\u003C\u002Fcode>: meter ballistics, ring rendering, and the step law against\n\u003Ccode>tests\u002Fgolden\u002Fmeter-steps.txt\u003C\u002Fcode>, vectors generated once from the TypeScript law and fixed;\u003C\u002Fli>\n\u003Cli>\u003Ccode>test_c24\u003C\u002Fcode>: the Control|24's rules: release debounce, set-point echo, the replay on every\nsession.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>The script checks: \u003Ccode>constants-check.sh\u003C\u002Fcode> (each timing constant declared once, in the header),\n\u003Ccode>conformance-packaging.sh\u003C\u002Fcode> (the version and soname agree in every packaging copy),\n\u003Ccode>test_install.sh\u003C\u002Fcode> (a consumer builds against an installed tree through pkg-config alone),\n\u003Ccode>test_workflows.sh\u003C\u002Fcode> (the workflows parse), and \u003Ccode>public-sources-check.sh\u003C\u002Fcode> with its own test.\u003C\u002Fp>\n\u003Ch2 id=\"the-diginet-module\">The DigiNet module\u003C\u002Fh2>\n\u003Cp>\u003Ccode>libsurface-diginet\u003C\u002Fcode> and \u003Ccode>tools\u002Fsurface-c24\u003C\u002Fcode> need libdiginet with the desk mux\n(\u003Ccode>diginet\u002Ftransport\u002Fdiginet_mux.h\u003C\u002Fcode>, libdiginet 0.1.4 and later). \u003Ccode>DIGINET\u003C\u002Fcode> says what to do:\u003C\u002Fp>\n\u003Cpre>\u003Ccode>make                                   # DIGINET=auto: the module when libdiginet is found, else a SKIP line\nmake DIGINET=yes                       # the module, or a failed build (the packages)\nmake DIGINET=no                        # the core alone\nmake DIGINET_SRC=..\u002Flibdiginet         # libdiginet from a built source tree instead of pkg-config\nmake DIGINET_SRC=..\u002Flibdiginet test    # + the module's tests\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>A source tree is linked from its archives, into the shared library too: that is for working on\nthe two together, never for a package. \u003Ccode>make shared\u003C\u002Fcode> adds \u003Ccode>libsurface-diginet.so\u003C\u002Fcode> (its own soname,\n\u003Ccode>SURFACE_DIGINET_ABI\u003C\u002Fcode>) and \u003Ccode>surface-c24\u003C\u002Fcode> linked to it; \u003Ccode>make install\u003C\u002Fcode> adds the header,\n\u003Ccode>libsurface-diginet.pc\u003C\u002Fcode> and the tool.\u003C\u002Fp>\n\u003Cp>\u003Ccode>surface-c24\u003C\u002Fcode>'s default helper is \u003Ccode>DIGINET_SRC\u003C\u002Fcode>'s \u003Ccode>tools\u002Fdiginet-packet-helper\u003C\u002Fcode>, else\n\u003Ccode>diginet-packet-helper\u003C\u002Fcode> in PATH (\u003Ccode>SURFACE_C24_HELPER=\u003C\u002Fcode> builds it to look in PATH always, as the\npackages do; \u003Ccode>--helper PATH\u003C\u002Fcode> overrides either at run time). The helper needs\n\u003Ccode>setcap cap_net_raw+ep\u003C\u002Fcode> (libdiginet's \u003Ccode>docs\u002Fdiginet-packet-helper.1\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Cp>The module's tests, in \u003Ccode>tests\u002Fdiginet\u002F\u003C\u002Fcode>, run after the core's:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>test_diginet\u003C\u002Fcode>: the module against libdiginet's desk emulator, in process, on a virtual clock:\nthe board replayed on every ONLINE; each report of a touched cap echoed as its set-point, and\nonce more at the release with no snap; a host move on an untouched cap and never on a touched\none; the inputs; a deaf desk and a foreign session as warnings; the repaint after a desk\nrestart and at the first announce after a host restart; a desk that goes and comes back;\u003C\u002Fli>\n\u003Cli>\u003Ccode>test_c24_tool\u003C\u002Fcode>: \u003Ccode>surface-c24\u003C\u002Fcode> itself, unprivileged, its socket from \u003Ccode>diginet-packet-helper\u003C\u002Fcode>,\nagainst the emulator on a veth pair in a user and network namespace of the test's own. SKIP\nwith no helper or no such namespace;\u003C\u002Fli>\n\u003Cli>\u003Ccode>test_install.sh\u003C\u002Fcode>: the module installed, a consumer built through pkg-config alone;\u003C\u002Fli>\n\u003Cli>\u003Ccode>emu-sync-check.sh\u003C\u002Fcode>: libdiginet installs no test code, so its emulator is copied into\n\u003Ccode>tests\u002Fdiginet\u002F\u003C\u002Fcode> (\u003Ccode>tests\u002Fdiginet\u002FSOURCE\u003C\u002Fcode>); this holds the copies to the \u003Ccode>DIGINET_SRC\u003C\u002Fcode> tree.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"the-mackie-module\">The Mackie module\u003C\u002Fh2>\n\u003Cp>\u003Ccode>libsurface-mackie\u003C\u002Fcode> is built when libmackie is found: through pkg-config, or from a built tree with\n\u003Ccode>MACKIE_SRC=..\u002Flibmackie\u003C\u002Fcode>. \u003Ccode>MACKIE=auto\u003C\u002Fcode> (the default) builds it when found, \u003Ccode>MACKIE=yes\u003C\u002Fcode> stops the\nbuild when not, \u003Ccode>MACKIE=no\u003C\u002Fcode> never builds it. \u003Ccode>make test\u003C\u002Fcode> runs \u003Ccode>tests\u002Fmackie\u002Ftest_mackie\u003C\u002Fcode> when it is\nbuilt, and says SKIP when it is not.\u003C\u002Fp>\n",[21],{"slug":22,"title":23},"","libsurface",1793954996263]