From 762d7650df804b360b6c0ac12261b90be1135237 Mon Sep 17 00:00:00 2001 From: b-aaz <85005689+b-aaz@users.noreply.github.com> Date: Thu, 10 Jul 2025 22:11:57 +0000 Subject: [PATCH] configure: Automatically detect the default xorg-module-dir. The module directory has changed to a per ABI folder in the xlibre-xserver. Now the default value of `xorg-module-dir` will be detected from the `moduledir` variable in xorg-server.pc. Signed-off-by: b-aaz --- Makefile.am | 8 +++++--- configure.ac | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7142485..08e569f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,6 +18,11 @@ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# During distcheck, system locations (as provided by pkg-config) may +# not be writable; provide instead relative locations. +DISTCHECK_CONFIGURE_FLAGS = --with-xorg-module-dir='$${libdir}/xorg/modules' \ + --with-sdkdir='$${includedir}/xorg' + SUBDIRS = include src man MAINTAINERCLEANFILES = ChangeLog INSTALL @@ -34,9 +39,6 @@ ChangeLog: dist-hook: ChangeLog INSTALL -# Provide an sdk location that is writable by this module -DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg' - if LINT # Check source code with tools like lint & sparse lint: diff --git a/configure.ac b/configure.ac index 788223c..2f344fc 100644 --- a/configure.ac +++ b/configure.ac @@ -51,11 +51,12 @@ AC_CHECK_FUNCS([asprintf timingsafe_memcmp]) PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10 xproto >= 7.0.27 inputproto]) # Define a configure option for an alternate input module directory +PKG_PROG_PKG_CONFIG([0.25]) AC_ARG_WITH(xorg-module-dir, AS_HELP_STRING([--with-xorg-module-dir=DIR], - [Default xorg module directory [[default=$libdir/xorg/modules]]]), + [Default xorg module directory]), [moduledir="$withval"], - [moduledir="$libdir/xorg/modules"]) + [moduledir=`$PKG_CONFIG --variable=moduledir xorg-server`]) inputdir=${moduledir}/input AC_SUBST(inputdir)