# Servers to build:
BUILD_SERVERS="--enable-xorg --enable-xvfb --enable-xnest"
SKIP_SERVERS="--disable-xprint --disable-dmx"

MESA_VERSION=${MESA_VERSION:-7.0.3}

# For now, trying to compile with HAL/D-BUS leads to a compile failure
# with a ton of undefined symbols.  Until this is rectified, we will be
# leaving this feature off.  It's not terriby useful IMHO anyway --
# autodetection and configuration of input devices.

CFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
	--libdir=/usr/lib$LIBSUFFIX \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --infodir=/usr/info \
  --mandir=/usr/man \
  --disable-static \
  --enable-xcsecurity \
  --with-pic \
  --with-int10=x86emu \
  --with-default-font-path="/usr/share/fonts/TTF,/usr/share/fonts/OTF,/usr/share/fonts/Type1,/usr/share/fonts/misc,/usr/share/fonts/75dpi/:unscaled" \
  --with-module-dir=/usr/lib$LIBSUFFIX/xorg/modules \
  --with-dri-driver-path=/usr/lib$LIBSUFFIX/xorg/modules/dri \
  --with-os-name="$OSNAME" \
  --with-os-vendor="$OSVENDOR" \
  --with-mesa-source=/tmp/Mesa-${MESA_VERSION} \
  --with-xkb-path=/etc/X11/xkb \
  --with-xkb-output=/var/lib/xkb \
  --disable-config-dbus \
  --disable-config-hal \
  $BUILD_SERVERS \
  $SKIP_SERVERS \
  --build=$ARCH-$DISTRO-linux

# Ugly fixup
sed -i 's#-ldl##' hw/xfree86/Makefile
sed -i 's#-lm#-lm -ldl#' hw/xfree86/Makefile