From 229a2836045d102423688c3af259aab5dfbf520c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 1 Apr 2026 13:03:30 +0100 Subject: 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 --- util/libreboot-utils/Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'util') diff --git a/util/libreboot-utils/Makefile b/util/libreboot-utils/Makefile index efa0aedc..ada729d8 100644 --- a/util/libreboot-utils/Makefile +++ b/util/libreboot-utils/Makefile @@ -14,6 +14,12 @@ DESTDIR = PREFIX = /usr/local 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 LDIR = @@ -149,3 +155,12 @@ distclean: clean strict: $(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)" -- cgit v1.2.1