dnl Process this file with autoconf to produce a configure script.
dnl ====================================================================
dnl
dnl     configure.in
dnl
dnl	configtool/standalone/common
dnl
dnl ====================================================================
dnl###COPYRIGHTBEGIN####
dnl                                                                          
dnl -------------------------------------------                              
dnl The contents of this file are subject to the Red Hat eCos Public License 
dnl Version 1.1 (the "License"); you may not use this file except in         
dnl compliance with the License.  You may obtain a copy of the License at    
dnl http://www.redhat.com/                                                   
dnl                                                                          
dnl Software distributed under the License is distributed on an "AS IS"      
dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
dnl License for the specific language governing rights and limitations under 
dnl the License.                                                             
dnl                                                                          
dnl The Original Code is eCos - Embedded Configurable Operating System,      
dnl released September 30, 1998.                                             
dnl                                                                          
dnl The Initial Developer of the Original Code is Red Hat.                   
dnl Portions created by Red Hat are                                          
dnl Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
dnl All Rights Reserved.                                                     
dnl -------------------------------------------                              
dnl                                                                          
dnl####COPYRIGHTEND####
dnl ====================================================================
dnl#####DESCRIPTIONBEGIN####
dnl
dnl Author(s):	bartv
dnl Contact(s):	bartv
dnl Date:	1999/11/10
dnl Version:	0.01
dnl
dnl####DESCRIPTIONEND####
dnl ====================================================================

AC_INIT(ecosconfig.cxx)

dnl Pick up the support files from the top-level of the host sources
AC_CONFIG_AUX_DIR(../../../..)

AM_INIT_AUTOMAKE(ecosconfig, 0.1)
AM_MAINTAINER_MODE

dnl Other standard options.
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CXX
AC_OBJEXT
AC_EXEEXT
CYG_AC_PROG_MSVC
CYG_AC_PROG_STANDARD_COMPILER_FLAGS

dnl ----------------------------------------------------------------------------
dnl Where can the Tcl library be found?
dnl There are command-line argument --with-tcl and --with-tcl-version.
dnl Otherwise assume that there is already a working installation
dnl in $(PREFIX)
CYG_AC_PATH_TCL

dnl Now for the host-side infrastructure and for libcdl
dnl The names and paths can just be hardwired, with a minimal
dnl sanity check. Note that for the infrastructure it is
dnl necessary to use the build tree for the include path,
dnl since header files from various places need to be
dnl gathered together.

AC_MSG_CHECKING(for host-side infrastructure)
cyg_ac_infra_incdir=../../../../infra
cyg_ac_infra_libdir=../../../../infra
if test "${MSVC}" = "yes" ; then
 cyg_ac_infra_libraries=cyginfra.lib
else
 cyg_ac_infra_libraries=cyginfra
fi
if test \! -d ${cyg_ac_infra_incdir} ; then
  AC_MSG_ERROR(unable to locate the infrastructure build directory)
fi
CYG_AC_MSVC_PATH(cyg_ac_infra_incdir)
CYG_AC_MSVC_PATH(cyg_ac_infra_libdir)
AC_SUBST(cyg_ac_infra_incdir)
AC_SUBST(cyg_ac_infra_libdir)
AC_SUBST(cyg_ac_infra_libraries)
AC_MSG_RESULT(-I${cyg_ac_infra_incdir} -L${cyg_ac_infra_libdir} libraries ${cyg_ac_infra_libraries})

AC_MSG_CHECKING(for libcdl)
cyg_ac_cdl_incdir=${srcdir}/../../../../libcdl
cyg_ac_cdl_libdir=../../../../libcdl
if test "${MSVC}" = "yes" ; then
  cyg_ac_cdl_libraries=cdl.lib
else
  cyg_ac_cdl_libraries=cdl
fi
if test \! -d ${cyg_ac_cdl_incdir} ; then
  AC_MSG_ERROR(unable to locate the libcdl source directory)
fi
if test \! -f ${cyg_ac_cdl_incdir}/cdl.hxx ; then
  AC_MSG_ERROR(unable to locate the libcdl header file cdl.hxx)
fi
if test \! -d ${cyg_ac_cdl_libdir} ; then
  AC_MSG_ERROR(unable to locate the libcdl build directory)
fi
CYG_AC_MSVC_PATH(cyg_ac_cdl_incdir)
CYG_AC_MSVC_PATH(cyg_ac_cdl_libdir)
AC_SUBST(cyg_ac_cdl_incdir)
AC_SUBST(cyg_ac_cdl_libdir)
AC_SUBST(cyg_ac_cdl_libraries)
AC_MSG_RESULT(-I${cyg_ac_cdl_incdir} -L${cyg_ac_cdl_libdir} libraries ${cyg_ac_cdl_libraries})

dnl Provide a VC++-friendly version of srcdir
win_srcdir=${srcdir}
CYG_AC_MSVC_PATH(win_srcdir)
AC_SUBST(win_srcdir)

AC_OUTPUT(Makefile)
