if [ -x ./configure ]; then
  CONFIGURE="./configure"
elif [ -x ./autogen.sh ]; then
  CONFIGURE="./autogen.sh"
else
  echo "ERROR: neither ./configure nor ./autogen.sh found."
  sleep 5
  exit 1
fi
CFLAGS=$SLKCFLAGS \
CXXFLAGS=$SLKCFLAGS \
$CONFIGURE \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --infodir=/usr/info \
  --mandir=/usr/man \
  --docdir=/usr/doc/${PKGNAME}-${MODULAR_PACKAGE_VERSION} \
  --with-udev-rules-dir=/lib/udev/rules.d \
  --disable-static \
  --enable-year2038 \
  --build=$ARCH-slackware-linux

# Kludge this for 32-bit:
if [ "$ARCH" = "i686" ]; then
  sed -i "s/-Werror=int-to-pointer-cast//g" src/Makefile
fi
