#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

m4_include([version.ac])[] dnl define clfs_version

AC_PREREQ([2.69])
AC_INIT([cross-lfs-ja], [3.0.0], [matsuand AT users DOT osdn DOT me])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([ctie/ctie.c])
AC_CONFIG_HEADERS([config.h])

m4_include([m4/progs.m4])
m4_include([m4/ax_compare_version.m4])
m4_include([m4/ac_check_docbook_xslt.m4])
m4_include([m4/ac_check_docbook_dtd.m4])
m4_include([m4/ac_check_takaofontdir.m4])

# Checks for programs.
AC_PROG_CC

XSLTPROC_FLAGS='--nonet '
AC_CHECK_DOCBOOK_XSLT
if test "x$HAVE_DOCBOOK_XSLT" = "xno"; then
  AC_MSG_ERROR([Docbook XSLT not found])
fi

XSLTPROC_FLAGS='--nonet '
AC_CHECK_DOCBOOK_DTD([4.5])
if test "x$HAVE_DOCBOOK_DTD_VERS" = "xno"; then
  AC_MSG_ERROR([Docbook DTD 4.5 not found])
fi

AC_PROG_XMLLINT
AC_PROG_TIDY

AC_PROG_LYNX
AC_PROG_FOP
AC_CHECK_TAKAOGFONTDIR

TARGETVER=clfs_version()

ORGDAY=`grep 'ENTITY day ' ${bookdir}/general.ent | gawk '{print $3;}' | sed 's/^[[^\"]]*\"\([[0-9]]*\)\".*$/\1/'`
ORGMONTH=`grep 'ENTITY month ' ${bookdir}/general.ent | gawk '{print $3;}' | sed 's/^[[^\"]]*\"\([[0-9]]*\)\".*$/\1/'`
ORGYEAR=`grep 'ENTITY year' ${bookdir}/general.ent | gawk '{print $3;}' | sed 's/^[[^\"]]*\"\([[0-9]]*\)\".*$/\1/'`

SVNVER=$ORGYEAR$ORGMONTH$ORGDAY
AC_MSG_CHECKING([for the original XML version])
if test ! "GIT-$SVNVER" = "$TARGETVER"; then
  AC_MSG_RESULT([$TARGETVER])
  AC_MSG_ERROR([Version of the original XML not $TARGETVER])
else
  AC_MSG_RESULT([$TARGETVER])
fi
AC_SUBST(SVNVER)


# Checks for libraries.

# Checks for header files.
AC_CHECK_HEADERS([malloc.h stdlib.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL

# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([strerror])

AC_CONFIG_FILES([Makefile
                 ctie/Makefile
                 src/Makefile
                 src/userconfig.xml
                 src/appendices/Makefile
                 src/appendices/dependencies/Makefile
                 src/appendices/ppc/Makefile
                 src/appendices/rationale/Makefile
                 src/boot/Makefile
                 src/boot/64/Makefile
                 src/boot/common/Makefile
                 src/boot/mips/Makefile
                 src/boot/mips64/Makefile
                 src/boot/multilib/Makefile
                 src/boot/ppc/Makefile
                 src/boot/ppc64/Makefile
                 src/boot/ppc64-64/Makefile
                 src/boot/sparc/Makefile
                 src/boot/sparc64/Makefile
                 src/boot/sparc64-64/Makefile
                 src/boot/x86/Makefile
                 src/boot/x86_64/Makefile
                 src/bootable/Makefile
                 src/bootable/common/Makefile
                 src/bootable/mips/Makefile
                 src/bootable/mips64/Makefile
                 src/bootable/ppc/Makefile
                 src/bootable/ppc64/Makefile
                 src/bootable/sparc/Makefile
                 src/bootable/x86/Makefile
                 src/bootable/x86_64/Makefile
                 src/chroot/Makefile
                 src/chroot/common/Makefile
                 src/chroot/mips/Makefile
                 src/chroot/mips64/Makefile
                 src/chroot/mips64-64/Makefile
                 src/chroot/multilib/Makefile
                 src/chroot/ppc/Makefile
                 src/chroot/ppc64/Makefile
                 src/chroot/sparc/Makefile
                 src/chroot/sparc64/Makefile
                 src/chroot/sparc64-64/Makefile
                 src/chroot/x86/Makefile
                 src/chroot/x86_64/Makefile
                 src/chroot/x86_64-64/Makefile
                 src/cross-tools/Makefile
                 src/cross-tools/64/Makefile
                 src/cross-tools/common/Makefile
                 src/cross-tools/mips/Makefile
                 src/cross-tools/mips64/Makefile
                 src/cross-tools/mips64-64/Makefile
                 src/cross-tools/multilib/Makefile
                 src/cross-tools/ppc/Makefile
                 src/cross-tools/ppc64-64/Makefile
                 src/cross-tools/sparc/Makefile
                 src/cross-tools/sparc64/Makefile
                 src/cross-tools/sparc64-64/Makefile
                 src/cross-tools/x86/Makefile
                 src/cross-tools/x86_64/Makefile
                 src/final-preps/Makefile
                 src/final-preps/common/Makefile
                 src/final-preps/mips/Makefile
                 src/final-preps/mips64/Makefile
                 src/final-preps/mips64-64/Makefile
                 src/final-preps/ppc/Makefile
                 src/final-preps/ppc64/Makefile
                 src/final-preps/ppc64-64/Makefile
                 src/final-preps/sparc/Makefile
                 src/final-preps/sparc64/Makefile
                 src/final-preps/sparc64-64/Makefile
                 src/final-preps/x86/Makefile
                 src/final-preps/x86_64/Makefile
                 src/final-preps/x86_64-64/Makefile
                 src/final-system/Makefile
                 src/final-system/64/Makefile
                 src/final-system/common/Makefile
                 src/final-system/mips/Makefile
                 src/final-system/mips64/Makefile
                 src/final-system/mips64-64/Makefile
                 src/final-system/multilib/Makefile
                 src/final-system/ppc/Makefile
                 src/final-system/ppc64/Makefile
                 src/final-system/ppc64-64/Makefile
                 src/final-system/sparc/Makefile
                 src/final-system/sparc64/Makefile
                 src/final-system/sparc64-64/Makefile
                 src/final-system/x86/Makefile
                 src/final-system/x86_64/Makefile
                 src/final-system/x86_64-64/Makefile
                 src/introduction/Makefile
                 src/introduction/common/Makefile
                 src/introduction/mips/Makefile
                 src/introduction/mips64/Makefile
                 src/introduction/mips64-64/Makefile
                 src/introduction/ppc/Makefile
                 src/introduction/ppc64/Makefile
                 src/introduction/ppc64-64/Makefile
                 src/introduction/sparc/Makefile
                 src/introduction/sparc64/Makefile
                 src/introduction/sparc64-64/Makefile
                 src/introduction/x86/Makefile
                 src/introduction/x86_64/Makefile
                 src/introduction/x86_64-64/Makefile
                 src/materials/Makefile
                 src/materials/common/Makefile
                 src/materials/mips/Makefile
                 src/materials/mips64/Makefile
                 src/materials/mips64-64/Makefile
                 src/materials/ppc/Makefile
                 src/materials/ppc64/Makefile
                 src/materials/ppc64-64/Makefile
                 src/materials/sparc/Makefile
                 src/materials/sparc64/Makefile
                 src/materials/sparc64-64/Makefile
                 src/materials/x86/Makefile
                 src/materials/x86_64/Makefile
                 src/materials/x86_64-64/Makefile
                 src/network/Makefile
                 src/network/common/Makefile
                 src/network/multilib/Makefile
                 src/partitioning/Makefile
                 src/partitioning/common/Makefile
                 src/partitioning/mips/Makefile
                 src/partitioning/ppc/Makefile
                 src/partitioning/sparc/Makefile
                 src/prologue/Makefile
                 src/prologue/common/Makefile
                 src/prologue/mips/Makefile
                 src/prologue/mips64/Makefile
                 src/prologue/mips64-64/Makefile
                 src/prologue/ppc/Makefile
                 src/prologue/ppc64/Makefile
                 src/prologue/ppc64-64/Makefile
                 src/prologue/sparc/Makefile
                 src/prologue/sparc64/Makefile
                 src/prologue/sparc64-64/Makefile
                 src/prologue/x86/Makefile
                 src/prologue/x86_64/Makefile
                 src/prologue/x86_64-64/Makefile
                 src/schema/Makefile
                 src/schema/docbook/Makefile
                 src/schema/docbook/4.5/Makefile
                 src/schema/docbook/4.5/rng/Makefile
                 src/stylesheets/Makefile
                 src/stylesheets/lfs-xsl/Makefile
                 src/stylesheets/lfs-xsl/docbook-xsl-snapshot/Makefile
                 src/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/Makefile
                 src/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/Makefile
                 src/stylesheets/lfs-xsl/docbook-xsl-snapshot/highlighting/Makefile
                 src/stylesheets/lfs-xsl/docbook-xsl-snapshot/html/Makefile
                 src/stylesheets/lfs-xsl/docbook-xsl-snapshot/lib/Makefile
                 src/stylesheets/lfs-xsl/docbook-xsl-snapshot/profiling/Makefile
                 src/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/Makefile
                 src/stylesheets/lfs-xsl/pdf/Makefile
                 src/stylesheets/lfs-xsl/xhtml/Makefile
                 src/system-config/Makefile
                 src/system-config/common/Makefile
                 src/system-config/sparc/Makefile
                 src/temp-system/Makefile
                 src/temp-system/64/Makefile
                 src/temp-system/common/Makefile
                 src/temp-system/mips64/Makefile
                 src/temp-system/mips64-64/Makefile
                 src/temp-system/multilib/Makefile
                 src/temp-system/ppc/Makefile
                 src/temp-system/ppc64/Makefile
                 src/temp-system/ppc64-64/Makefile
                 src/testsuite-tools/Makefile
                 src/testsuite-tools/common/Makefile
                 src/testsuite-tools/multilib/Makefile
                 src/the-end/Makefile])
AC_OUTPUT
