From 1b8f420ec8852355580dd925c0316798d4fa7449 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 3 Jul 2025 19:32:12 -0700
Subject: [PATCH] configure.ac: Add knob to define base sbindir

This helps when distros use converged directories with usrmerge
set --with-base-sbindir=DIR accordingly so it respects the
distro policy

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 configure.ac | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 9a2f5ff..ce2c853 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,7 +186,14 @@ AC_SYS_LARGEFILE
 AC_PREFIX_DEFAULT([/usr])
 test "x$prefix" = "xNONE" && prefix="/usr"
 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"
-AC_SUBST([root_sbindir], [/sbin])
+
+AC_ARG_WITH([base-sbindir],
+    [AS_HELP_STRING([--with-base-sbindir=DIR],
+        [specify root system binary directory @<:@default=/sbin@:>@])],
+    [root_sbindir="$withval"],
+    [root_sbindir="/sbin"])
+
+AC_SUBST([root_sbindir])
 AC_SUBST([sbindir], [${exec_prefix}/sbin])
 AC_SUBST([sysconfdir], [/etc])
 AC_SUBST([localstatedir], [/var])
