]dnl Process this file with autoconf to produce a configure script.
AC_INIT(configure.in)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(akaxiso, 2.-1.2)
AM_CONFIG_HEADER(akaxiso/config.h)
if test "x$CXXFLAGS" == "x"
then
  CXXFLAGS="-g"
fi

dnl convert SJIS source to euc.

SJISSOURCES="yggdrasil/ygg_test.cpp yggdrasil/ygg.cpp yggdrasil/ygg.h yggdrasil/test.sox yggdrasil/test.xml yggdrasil/csv.sox"

for SOURCE in $SJISSOURCES
do
  if ! test -f ${SOURCE}_ ; then
    mv $SOURCE ${SOURCE}_
    echo "File ${SOURCE}_ is created."
    fi
    nkf --unix ${SOURCE}_ > ${SOURCE}
done

dnl Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL
AC_DISABLE_SHARED
AC_PROG_LIBTOOL

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

if test "z$XERCESCROOT" != "z"; then
  AM_CONDITIONAL(USE_XERCESC, true)
  AKAXISO_INCLUDES="-I$XERCESCROOT/include"
  AKAXISO_LIBS="-L$XERCESCROOT/lib -lxerces-c"
  CXXFLAGS="$CXXFLAGS -DUSE_XERCESC"
else
  AM_CONDITIONAL(USE_XERCESC, false)
fi

AC_SUBST(AKAXISO_INCLUDES)
AC_SUBST(AKAXISO_LIBS)

dnl Checks for library functions.

AC_OUTPUT(
	Makefile
	yggdrasil/Makefile
	akaxiso/Makefile
	akaxiso/xerces/Makefile
	akaxiso/yggdrasil/Makefile
	akaxiso/parser/Makefile
	akaxiso/classes/Makefile
	akaxiso_sample/Makefile
	osixaka/Makefile
	osixaka_sample/Makefile
	tutorial/Makefile
	tests/Makefile
)
