#!/bin/sh
LIBS=
rm -f Makefile config.h
if [ -f /usr/include/netinet/ip6.h ]; then
  echo "#define USE_IPV6" >> config.h
  echo "ipv6 includes found."
fi
if [ -f /usr/include/openssl/ssl.h ]; then
  echo "#define USE_SSL" >> config.h
  echo "openssl includes found."
  LIBS="$LIBS -lssl -lcrypto"
fi
sed "s/#LIBS#/$LIBS/g" < Makefile.in > Makefile