--- a/configure.ac
+++ b/configure.ac
@@ -175,6 +175,7 @@ dnl ---------------------------------------------------------------------------
CK_BACKEND=""
KVM_LIBS=""
+X11_DIR="/usr/bin"
case "$host" in
*-*-freebsd*)
CK_BACKEND="freebsd"
@@ -189,11 +190,13 @@ case "$host" in
;;
*-*-solaris*)
CK_BACKEND="solaris"
+ X11_DIR="/usr/X11/bin"
;;
*)
AC_MSG_ERROR([No sysdeps back-end implemented for host $host])
;;
esac
+AC_SUBST(X11_DIR)
AC_SUBST(KVM_LIBS)
Can you figure out X11_DIR from pkg-config?
That would only work for Xorg, but you could do something like this:
X11_DIR=`$PKG_CONFIG --variable=bindir xorg-server 2>/dev/null`
if test "x$X11_DIR" = x; then
AC_PATH_PROGS([XSERVER], [Xorg X],,[$PATH:/usr/X11/bin:/usr/bin])
test "x$XSERVER" != x && X11_DIR=`dirname "$XSERVER"`
fi
test "x$X11_DIR" = x && X11_DIR=$bindir
AC_SUBST([X11_DIR])
But, wouldn't it be better to just get the name of the server itself
and let the user specify it if they want?
AC_ARG_WITH([xserver],
[AS_HELP_STRING([--with-xserver=X], [specify X server to use])],
[XSERVER=$withval])
if test "x$XSERVER" = x; then
AC_PATH_PROGS([XSERVER], [Xorg X], [/usr/bin/X],
[$PATH:/usr/X11/bin:/usr/bin])
test "x$XSERVER" = x && AC_MSG_ERROR([no X server found])
fi
AC_SUBST([XSERVER])
I'd imagine any distro/vendor would specify what they want, and anyone
doing fancy things like multiseat will be editing the configuration
files anyway.