AC_INIT(main.cpp)
AC_CONFIG_HEADER(config.h)


AC_PROG_CC

CFLAGS="-g"
AC_SUBST(CFLAGS)
AC_ARG_WITH(debug, [ --with-debug debug mode ], [ CFLAGS="$CFLAGS -DDEBUG" ])

AC_MSG_CHECKING(OperatingSystem)
if test `uname -s` = "SunOS"; then
    echo "Solaris"

    AC_DEFINE(__SOLARIS__, 1)
elif test `uname -s` = "FreeBSD"; then
    echo "FreeBSD"

    AC_DEFINE(__FREEBSD__, 1)
elif test `uname -s | sed -e 's/\(.*\)-\(.*\)/\1/'` = "CYGWIN_NT"; then
    echo "CYGWIN_NT"
elif test `uname -s` = "Darwin"; then
    echo "Darwin"

    AC_DEFINE(__DARWIN__, 1)
else
    echo "Linux"

    AC_DEFINE(__LINUX__, 1)
fi

AC_OUTPUT(Makefile)

