dnl Process this file with automake/autoconf to produce a configure script.
dnl $Id: configure.in,v 1.3 2000/05/09 00:58:01 furukawa Exp $

AC_INIT(libtrain/portunix.h)
PACKAGE=libtrain
TRAIN_MAJOR_VERSION=0
TRAIN_MINOR_VERSION=9b
TRAIN_INTERFACE_AGE=1
TRAIN_REVISION_AGE=0
VERSION=$TRAIN_MAJOR_VERSION.$TRAIN_MINOR_VERSION

AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")

AC_SUBST(TRAIN_MAJOR_VERSION)
AC_SUBST(TRAIN_MINOR_VERSION)
AC_SUBST(TRAIN_INTERFACE_AGE)
AC_SUBST(TRAIN_REVISION_AGE)

# Specify a configuration file
AM_CONFIG_HEADER(config.h)

dnl Initialize maintainer mode
AM_MAINTAINER_MODE

dnl declare --enable-* args and collect ac_help strings
AC_ARG_ENABLE(debug, [  --enable-debug=[no/yes] turn on debugging [default=no]],,enable_debug=no)

dnl Checks for programs.
AC_ARG_PROGRAM
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB

dnl Libtool versioning
LT_CURRENT=$TRAIN_INTERFACE_AGE
LT_REVISION=$TRAIN_REVISION_AGE
LT_AGE=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

dnl Initialize libtool
AM_PROG_LIBTOOL

dnl Checks for header files.
AC_CHECK_HEADER(memory.h)
AC_CHECK_HEADER(unistd.h)

dnl Checks for typedefs, structures
AC_HEADER_TIME
AC_STRUCT_TM
AC_STRUCT_TIMEZONE

dnl Checks for library functions.

dnl Compiler stuff
AC_C_INLINE
if test x$CC = xgcc; then
  if test "x$enable_debug" = "xyes"; then
    CFLAGS="$CFLAGS -DDEBUG"
  fi
  CFLAGS="$CFLAGS -Wall"
fi

dnl Output
AC_OUTPUT([
Makefile
libtrain/Makefile
libtrain.spec
])
