#! /bin/sh
[ -z "$GWXROOT" ] && {
  echo "ERROR: GWXROOT not set"
  exit 1
}

[ -z "$GWXDIST" ] && {
  echo "ERROR: GWXDIST not set"
  exit 1
}

[ -e $GWXDIST/usr/include/openssl/opensslv.h ] || {
  echo "ERROR: OpenSSL not installed in $GWXDIST"
  exit 1
}

[ -e gwxcfg.h ] || ln -s ../gwxcfg.h .
[ -e gwxoscfg.h ] || ln -s ../osr5.os.h gwxoscfg.h

CC=gcc CFLAGS="-DFD_SETSIZE=11000 -O6 -march=i586 -mcpu=i686 -fomit-frame-pointer" CXXFLAGS="$CFLAGS" ../configure --build=i586-pc-sco3.2v5.0 \
  --prefix=/usr \
  --sysconfdir=/etc \
  --sbindir=/etc \
  --datadir=/usr/lib \
  --with-localeprefix=/usr/gnu \
  --with-infodir=/usr/gnu/info \
  --with-aclocaldir=/usr/gnu/share/aclocal \
  --x-includes=/usr/include \
  --x-libraries=/usr/lib \
  --with-reentrancy \
  --with-openssl=$GWXDIST/usr \
  --with-egd-socket=/etc/egd-pool \
  --cache-file=config.cache
