dnl
dnl

AC_PREREQ(2.50)

AC_INIT(org.eclipse.ptp.proxy, [6.0.2.201209212233])
AC_CONFIG_SRCDIR(src/proxy.c)
AC_CONFIG_HEADERS(config.h)

AM_INIT_AUTOMAKE

AC_CANONICAL_BUILD

dnl
dnl Eclipse adds version number to end of package when deploying via update site
dnl

VERSION="_$PACKAGE_VERSION"
if test `expr "$VERSION" : "_@@<:@^@@:>@*@"` -gt 0; then
	VERSION=
fi
UTILS="`echo ../org.eclipse.ptp.utils${VERSION}`"
if test ! -d $UTILS; then
	UTILS="`echo ../../core/org.eclipse.ptp.utils${VERSION}`"
	if test ! -d $UTILS; then
		AC_MSG_ERROR([utils directory not found])
	fi
fi

dnl
dnl Check for programs.
dnl

AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB

os=`uname -s`
if test "x$os" = "xAIX" ; then
	CFLAGS="$CFLAGS -qinfo=gen -qcpluscmt -I$UTILS/include"
else
	CFLAGS="$CFLAGS -Wall -I$UTILS/include"
fi
LIBS="$LIBS -L$UTILS"

dnl
dnl Check for libraries.
dnl

AC_CHECK_LIB(utils, bitset_new)

AH_VERBATIM([DEBUG],
[#ifdef DEBUG
#define DEBUG_PRINT(format, ...)	printf(format, __VA_ARGS__); fflush(stdout)
#else /* DEBUG */
#define DEBUG_PRINT(format, ...)
#endif /* DEBUG */])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT
