From f03931201b848fae6a21f44cd151e6f4af6e6988 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 | 5 ++++- configure.ac | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index a447d61..cdcc414 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,10 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg' +# 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 = src include man test MAINTAINERCLEANFILES = ChangeLog INSTALL diff --git a/configure.ac b/configure.ac index 965b8a4..9699bad 100644 --- a/configure.ac +++ b/configure.ac @@ -115,11 +115,12 @@ LIBS=$OLD_LIBS CFLAGS=$OLD_CFLAGS # Define a configure option for an alternate input module directory +PKG_PROG_PKG_CONFIG([0.25]) AC_ARG_WITH(xorg-module-dir, - AC_HELP_STRING([--with-xorg-module-dir=DIR], - [Default xorg module directory [[default=$libdir/xorg/modules]]]), + AS_HELP_STRING([--with-xorg-module-dir=DIR], + [Default xorg module directory]), [moduledir="$withval"], - [moduledir="$libdir/xorg/modules"]) + [moduledir=`$PKG_CONFIG --variable=moduledir xorg-server`]) inputdir=${moduledir}/input AC_SUBST(inputdir)