From e1db47e861766b026e389c1f4a2622b4f2f9f369 Mon Sep 17 00:00:00 2001 From: b-aaz <85005689+b-aaz@users.noreply.github.com> Date: Thu, 10 Jul 2025 22:11:58 +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 | 4 ++++ configure.ac | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index eec9b5d..02e5453 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,6 +20,10 @@ # 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' + SUBDIRS = src man MAINTAINERCLEANFILES = ChangeLog INSTALL .PHONY: ChangeLog INSTALL diff --git a/configure.ac b/configure.ac index e71b40d..715f6d1 100644 --- a/configure.ac +++ b/configure.ac @@ -51,9 +51,12 @@ LT_INIT([disable-static]) AH_TOP([#include "xorg-server.h"]) # Define a configure option for an alternate module directory -AC_ARG_WITH(xorg-module-dir, [ --with-xorg-module-dir=DIR ], - [ moduledir="$withval" ], - [ moduledir="$libdir/xorg/modules" ]) +PKG_PROG_PKG_CONFIG([0.25]) +AC_ARG_WITH(xorg-module-dir, + AS_HELP_STRING([--with-xorg-module-dir=DIR], + [Default xorg module directory]), + [moduledir="$withval"], + [moduledir=`$PKG_CONFIG --variable=moduledir xorg-server`]) AC_SUBST(moduledir) # Store the list of server defined optional extensions in REQUIRED_MODULES