lbutils: portable options in Makefile

add options for building with urandom+openat and
arc4+openat. useful for emulating a bsd / old linux
environment in modern linux distros, for portability
testing.

these options are not recommended for everyday use.
just use make without any special options, and the
code has build-time OS detection for features like
randomisation/openat2.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-04-01 13:03:30 +01:00
parent 4e72555ac7
commit 229a283604
+15
View File
@@ -14,6 +14,12 @@ DESTDIR =
PREFIX = /usr/local PREFIX = /usr/local
INSTALL = install INSTALL = install
# used for portability testing on linux:
#
PORT_OPENAT = -DUSE_OPENAT=1
PORT_ARC4 = -DUSE_ARC4=1
PORT_URANDOM = -DUSE_URANDOM=1
.SUFFIXES: .c .o .SUFFIXES: .c .o
LDIR = LDIR =
@@ -149,3 +155,12 @@ distclean: clean
strict: strict:
$(MAKE) CFLAGS="$(CFLAGS) $(HELLFLAGS)" CC_MODE="$(HELLCC)" $(MAKE) CFLAGS="$(CFLAGS) $(HELLFLAGS)" CC_MODE="$(HELLCC)"
# BSD-like portability test (openat + arc4random)
portable-bsd:
$(MAKE) CFLAGS="$(CFLAGS) $(PORT_OPENAT) $(PORT_ARC4)" CC_MODE="$(CC)"
# fallback portability test (openat + urandom -- old linux mostly)
portable-urandom:
$(MAKE) CFLAGS="$(CFLAGS) $(PORT_OPENAT) $(PORT_URANDOM)" \
CC_MODE="$(CC)"