#!/bin/sh

ZLIB=-1

while `[ "$1" != "" ]`; do
	case "$1" in
		--help)
			echo "Usage: $0 [options]"
			echo "Options: [defaults in brackets]"
			echo "Features and packages:"
			echo "  --with-zlib		Use Zlib compression"
			exit
			;;
		--without-zlib)
			ZLIB=0
			;;
		--with-zlib)
			ZLIB=1
			;;
	esac
	shift
done

if [ "$ZLIB" -eq "-1" ]; then
	echo -n "Checking for zlib.h ... "
	if [ -e /usr/include/zlib.h ]; then
		ZLIB=1
	else
		ZLIB=0
		echo "not "
	fi
	echo "found."
fi



if [ "$ZLIB" = 1 ]; then
	ZLIB="s/@ZLIB@//g"
else
	ZLIB="s/@ZLIB@/#/g"
fi

sed -e $ZLIB Makefile.in > Makefile
