diff --git a/Makefile.am b/Makefile.am index 5c1a368..4993a83 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,4 +21,8 @@ # Author: Paulo Zanoni # +# 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 diff --git a/configure.ac b/configure.ac index f5be789..58eb8fd 100644 --- a/configure.ac +++ b/configure.ac @@ -43,9 +43,12 @@ XORG_DEFAULT_OPTIONS LT_INIT([disable-static]) # 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)