[BRLTTY] Problems compiling a barebones BRLTTY for initramfs
Aura Kelloniemi
kaura.dev at sange.fi
Tue Jul 15 20:57:53 UTC 2025
Hi list,
as I said in my previous message, I am building a minimal BRLTTY for a custom
initramfs.
My build fails and it seems to me that I am trying out an untested combination
of configure options.
I am building BRLTTY from git (commit hash
d67864beaff2a4b92949bef260cba23b2db35014) in an Alpine chroot. The configure
flags I used are as follows:
--prefix=/usr --sysconfdir=/etc --localstatedir=/var
--with-tables-directory=/usr/share/brltty --disable-i18n --disable-icu
--disable-iconv --disable-polkit --disable-api --disable-emacs-bindings
--disable-java-bindings --disable-lisp-bindings --disable-lua-bindings
--disable-ocaml-bindings --disable-python-bindings --disable-tcl-bindings
--disable-x --disable-expat --disable-liblouis --disable-gpm
--disable-speech-support --without-curses --without-gui-toolkit
--without-rgx-package --without-bell-package --without-leds-package
--without-pcm-package --without-midi-package --without-fm-package
--without-bluetooth-package --without-libbraille --without-service-package
--with-braille-driver=fs --with-screen-driver=lx --without-dynld-package
--without-pgmprivs-package
The build fails in Programs/file.c with the following messages:
gcc -I. -I. -I./../Programs -I../Programs -I../Headers -I./.. -I.. -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE -DHAVE_CONFIG_H -g -O2 -std=gnu99 -Wall -Werror=format-security -Wno-address-of-packed-member -Wno-stringop-truncation -fPIC -c ./file.c
./file.c:227:30: error: 'HELPERS_DIRECTORY' undeclared here (not in a function); did you mean 'DRIVERS_DIRECTORY'?
227 | char *opt_helpersDirectory = HELPERS_DIRECTORY;
| ^~~~~~~~~~~~~~~~~
| DRIVERS_DIRECTORY
make[1]: *** [Makefile:342: file.o] Error 1
make[1]: Leaving directory '/usr/src/brltty.build/Programs'
make: *** [Makefile:49: all] Error 2
If I manually edit config.h and #define HELPERS_DIRECTORY, I get a build
failure in Drivers/FileViewer/screen.c, because term.h is missing. It seems
BRLTTY cannot be compiled without curses.
If I install ncurses-dev, BRLTTY compiles. I have not tested yet, if it works.
I tried to build BRLTTY (with the same configure flags as above) in a much
more featureful Arch Linux system, and I noticed, that BRLTTY links against
many libraries (like libudev and lkbblkid), and there is no way to disable
this. It is impossible to compile BRLTTY with --enable-standalone-programs on
vanilla Arch system, because BRLTTY tries to link against static versions of
libbluetooth and libudev (for example), but those are not available on an Arch
system.
Can something be done to address all the above issues?
One more question: can I somehow disable external drivers? As I compile BRLTTY
without dynamic loading support (or at least try to), there is no point in
building external drivers anyway. I know --enable-standalone-programs does
this, but it also enables static linking, which I don't want (because musl
will be available on the initramfs).
I will also throw a few ideas into air for future consideration (if somebody
has time/interest). These are very low priority, but would possibly be useful
for initramfs users:
- Opting out of even more features, like config parsing, preferences parsing,
tables parsing, preferences menu, braille typing, serial port support, ...
- Allow embedding config/preferences settings to BRLTTY at compilation time
I am trying to build as minimal early environment as possible, and this
barebones BRLTTY is not going to be used after initramfs has switched to
proper root.
--
Aura
More information about the BRLTTY
mailing list