#! /bin/sh
if test -z "$GWXDIST" ; then
  echo "ERROR: GWXDIST not set"
  exit 1
fi

CC=gcc CFLAGS="-DFD_SETSIZE=11000 -O6 -march=i586 -mcpu=i686 -fomit-frame-pointer -I${GWXDIST}/usr/include" CXXFLAGS="$CFLAGS" LDFLAGS="-L${GWXDIST}/usr/lib" ../configure --prefix=/usr \
 --sysconfdir=/etc \
 --infodir=/usr/gnu/info \
 --libexecdir=/usr/lib \
 --datadir=/usr/lib \
 --localstatedir=/usr/lib/openldap \
 --sbindir=/usr/bin \
 --enable-syslog \
 --enable-proctitle \
 --enable-referals \
 --enable-local \
 --with-cyrus-sasl \
 --with-readline \
 --with-tls \
 --enable-slapd \
  --enable-crypt \
  --enable-dynamic \
  --enable-spasswd \
  --enable-modules \
  --enable-rewrite \
  --enable-rlookups \
  --enable-slp \
  --enable-bdb --with-bdb-module=dynamic \
  --enable-dnssrv --with-dnssrv-module=dynamic \
  --enable-ldap --with-ldap-module=dynamic \
  --enable-ldbm --with-ldbm-module=dynamic \
  --enable-meta --with-meta-module=dynamic \
  --enable-monitor --with-monitor-module=dynamic \
  --enable-null --with-null-module=dynamic \
  --enable-passwd --with-passwd-module=dynamic \
  --enable-perl --with-perl-module=dynamic \
  --enable-shell --with-shell-module=dynamic \
 --enable-slurpd \
 --disable-static \
 --cache-file=config.cache \
 --build=i586-pc-sco3.2v5.0 --host=i586-pc-sco3.2v5.0

 sed -e 's/-lgen//' -e 's/-lnsl//' -e 's/-lnsl_s//' config.status > foo
 mv -f foo config.status
 sh ./config.status
