From a1af1a366579892fa07e20d5bad8fcd3c700b31a 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 | 4 ++++ configure.ac | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index d14ed8f9..5f815325 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,6 +18,10 @@ # 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' + SUBDIRS = src man conf MAINTAINERCLEANFILES = ChangeLog INSTALL diff --git a/configure.ac b/configure.ac index 5d84f208..82af192c 100644 --- a/configure.ac +++ b/configure.ac @@ -57,11 +57,12 @@ fi AH_TOP([#include "xorg-server.h"]) # Define a configure option for an alternate 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`]) # Store the list of server defined optional extensions in REQUIRED_MODULES XORG_DRIVER_CHECK_EXT(RANDR, randrproto)