#                                               -*- Autoconf -*-
#  Process this file with autoconf to produce a configure script.
#
#  $Id: configure.in 627 2009-09-24 17:27:59Z brian $
#
#  Copyright (c) 2005-2009 by Precision MicroControl Corp. All rights reserved.
#
AC_INIT(src/core_libs/mcapi/mcapi.cpp)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(mcapi, "4.1.2")
AC_CONFIG_SRCDIR(src/mcapi.h)
AC_CONFIG_HEADER(config.h)

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_LIBTOOL_DLOPEN
AC_LIBLTDL_CONVENIENCE
AC_PROG_LIBTOOL

# ltdl paths
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
AC_SUBST(LIBADD_DL)

# Checks for libraries.
# FIXME: Replace `main' with a function in `-ldl':
AC_CHECK_LIB([dl], [main])

# Checks for header files.mc	
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h memory.h stddef.h stdlib.h string.h unistd.h wchar.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_C_VOLATILE

# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_STRTOD
AC_CHECK_FUNCS([getcwd gethostbyaddr gethostbyname memset socket strcasecmp strchr strtol])

#
AC_CONFIG_SUBDIRS(libltdl)
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([src/core_libs/Makefile])
AC_CONFIG_FILES([src/core_libs/config/Makefile])
AC_CONFIG_FILES([src/core_libs/config/dcxpci100/Makefile])
AC_CONFIG_FILES([src/core_libs/config/dcxpci300/Makefile])
AC_CONFIG_FILES([src/core_libs/config/mfxpci1000/Makefile])
AC_CONFIG_FILES([src/core_libs/interface/Makefile])
AC_CONFIG_FILES([src/core_libs/interface/pmcbus/Makefile])
AC_CONFIG_FILES([src/core_libs/mcapi/Makefile])
AC_CONFIG_FILES([src/drivers/Makefile])
AC_CONFIG_FILES([src/dcxctrl/Makefile])
AC_CONFIG_FILES([src/microterm/Makefile])

AC_OUTPUT

echo -n \
"------------------------------------------------------------------------
Configuration:

  Motion Control API Version:  ${VERSION}
  Source code location:        "
pwd
echo \
"  Compiler:                    ${CC}
  Compiler flags:              ${CFLAGS}
  Host System Type:            ${host}
  Install path:                ${prefix}

  See config.h for further configuration information.
------------------------------------------------------------------------"


