AC_INIT(Makefile.in)

dnl AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CC

TOP=`pwd`
AC_SUBST(TOP)

dnl m4_include(compiler.in)

################
dnl flags for compiler

if test "$CC" = ""; then
if test "$GCC" = "yes"; then
CC=gcc
else
CC=cc
fi
fi
if test "$LD" = ""; then
LD=$CC
fi
AC_SUBST(CC)
AC_SUBST(LD)

DEPFLAGS="-MD"
MAPFLAGS="-Wl,-cref -Wl,-Map -Wl,@OUTFILE@.map"
ARFLAGS="rcsu"

AC_ARG_ENABLE(mwcc,build with mwcc,
[if test "$CC" = ""; then
CC="mwcc";
fi
CFLAGS="-inline all $CFLAGS"
DEPFLAGS="-MD"
if test "$LD" = ""; then
LD="gcc";
MAPFLAGS="-Wl,-cref -Wl,-Map -Wl,@OUTFILE@.map"
ARFLAGS="rcsu"
fi
dnl LIBS="$LIBS -L. -lmwcc-2.4 -L/usr/lib/i586-metrowerks-linux/mwcc-2.4"
dnl LIBS="$LIBS -L/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66"
],)

AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
AC_SUBST(DEFS)
AC_SUBST(DEPFLAGS)
AC_SUBST(MAPFLAGS)
AC_SUBST(ARFLAGS)
##########

AC_PROG_INSTALL
AC_CONFIG_SUBDIRS(source)

AC_OUTPUT(Makefile)
