AC_INIT(ghttp.h)

AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)
GHTTP_MAJOR_VERSION=1
GHTTP_MINOR_VERSION=0
GHTTP_MICRO_VERSION=9
GHTTP_VERSION=$GHTTP_MAJOR_VERSION.$GHTTP_MINOR_VERSION.$GHTTP_MICRO_VERSION
AC_DIVERT_POP()

AC_SUBST(GHTTP_MAJOR_VERSION)
AC_SUBST(GHTTP_MINOR_VERSION)
AC_SUBST(GHTTP_MICRO_VERSION)
AC_SUBST(GHTTP_VERSION)

VERSION=$GHTTP_VERSION

AC_DEFINE_UNQUOTED(GHTTP_MAJOR_VERSION, $GHTTP_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(GHTTP_MINOR_VERSION, $GHTTP_MINOR_VERSION)
AC_DEFINE_UNQUOTED(GHTTP_MICRO_VERSION, $GHTTP_MICRO_VERSION)

AM_INIT_AUTOMAKE(libghttp, $VERSION)

GHTTP_LIBDIR='-L${libdir}'
GHTTP_INCLUDEDIR='-I${includedir}'
GHTTP_LIBS="-lghttp"

AM_MAINTAINER_MODE

AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_ARG_PROGRAM
AM_PROG_LIBTOOL

AC_CANONICAL_HOST
case $host in
*-*-solaris*)
	GHTTP_LIBDIR="${GHTTP_LIBDIR} -R${libdir}"
	GHTTP_LIBS="${GHTTP_LIBS} -lsocket -lnsl"
	;;
esac

AC_SUBST(GHTTP_LIBDIR)
AC_SUBST(GHTTP_LIBS)
AC_SUBST(GHTTP_INCLUDEDIR)
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

AC_OUTPUT([
libghttp.spec
Makefile])
