AC_PREREQ(2.59)
AC_INIT(configure.in)

dnl
dnl Set the directory that contains support scripts such as install-sh and
dnl config.guess
dnl
AC_CONFIG_AUX_DIR(../../../../confdb)

dnl
dnl Definitions will be placed in this file rather than in the DEFS variable
dnl
AC_CONFIG_HEADER(mpidu_sock_conf.h)
AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*  
 *  (C) 2001 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */
#ifndef MPIDU_SOCK_CONF_H_INCLUDED
#define MPIDU_SOCK_CONF_H_INCLUDED
])
AH_BOTTOM([#endif])


echo "RUNNING CONFIGURE FOR THE SOCK INTERFACE"

dnl
dnl First check that we have a clean build if we are doing a VPATH build
PAC_VPATH_CHECK()

PAC_LOAD_BASE_CACHE

. ${master_top_srcdir}/src/mpid/common/sock/setup.args
export sock_name
AC_SUBST(sock_name)

PAC_PROG_MAKE

AC_SUBST(AR)
AC_SUBST(RANLIB)
AC_SUBST(MPILIBNAME)
AC_SUBST(CC)
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
PAC_CC_SUBDIR_SHLIBS
AC_SUBST(master_top_srcdir)
# Master_top_builddir is imported from the top; use it for the "top"
# (used for things like libtool)
if test -z "$master_top_builddir" ; then
    if test -s ../../../../.mpich2 ; then
        master_top_builddir=../../../..
    elif test -n "$LIBTOOL" ; then
        AC_MSG_ERROR([Panic! cannot find the top directory])
    fi
fi
AC_SUBST(master_top_builddir)
dnl
dnl Dependency handling
AC_SUBST(MAKE_DEPEND_C)
dnl
dnl Etags
AC_SUBST(ETAGS)
AC_SUBST(ETAGSADD)
export ETAGS
export ETAGSADD

PAC_SUBDIR_CACHE

AC_CONFIG_SUBDIRS(${sock_name})

AC_OUTPUT(Makefile localdefs)

PAC_SUBDIR_CACHE_CLEANUP
