AC_INIT(libbytecode, 0.8.1, [f2j@cs.utk.edu])
AC_REVISION([$Revision: 1.6 $])

AC_CONFIG_SRCDIR(api.c)

AC_PROG_CC(gcc cc ecc xlc)

AC_C_BIGENDIAN

AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar)
AC_SUBST(AR)
AC_PATH_PROG(JAVAC, javac)
AC_SUBST(JAVAC)
AC_PATH_PROG(JAVA, java)
AC_SUBST(JAVA)

if test "x$prefix" != xNONE; then
  F2J_INSTALL_PREFIX=${prefix}
else
  F2J_INSTALL_PREFIX=`pwd`
fi
AC_SUBST(F2J_INSTALL_PREFIX)

AC_ARG_WITH(doxygen,
            [  --with-doxygen=DOXYGEN  doxygen binary name],
            [DOXYGEN="$with_doxygen"],
            [DOXYGEN="doxygen"])

AC_ARG_WITH(debuglevel,
            [  --with-debuglevel=num   0=none, 1=only errors [default], 2=all debugging output],
            [DEBUGLEVEL="$with_debuglevel"],
            [DEBUGLEVEL="1"])

if test "$DEBUGLEVEL" = "1"; then
  CFLAGS="$CFLAGS -DBC_VIEW"
fi

if test "$DEBUGLEVEL" = "2"; then
  CFLAGS="$CFLAGS -DBC_VIEW -DBC_DEBUG"
fi

AC_SUBST(CFLAGS)

AC_SUBST(DOXYGEN)

AC_CONFIG_HEADER(bytecode.h)

AC_OUTPUT(Makefile make.def)
