dnl ------------------------------------------------------------
dnl   $Id: configure.in,v 1.2.2.1 2000/07/02 15:55:06 yamauchi Exp $
dnl 	configure.in for 1PE version
dnl	(C) Copyright 1999 By YAMAUCHI Hitoshi 山内斉
dnl   X を仮定しにくくなってきたので，環境に依存する部分を imake から 
dnl   configure へと移行する．山内 1999年10月16日(土)
dnl
dnl  autoheader を用いると，configure.in から config.h.in を作成してく
dnl  れる
dnl
dnl ------------------------------------------------------------

dnl ------------------------------------------------------------
dnl Process this file with autoconf to produce a configure script.
dnl ------------------------------------------------------------
AC_INIT(main.cc)

dnl ------------------------------------------------------------
dnl Use config.h for define stuffs
dnl ------------------------------------------------------------
AC_CONFIG_HEADER(config.h)

dnl ------------------------------------------------------------
dnl Checks for programs.
dnl ------------------------------------------------------------
dnl AC_PROG_CC
dnl AC_PROG_CPP
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_CHECK_PROG(RM, rm, rm)
AC_PATH_PROGS(TESTPROG, test, test)

dnl ------------------------------
dnl If I can use g++, set -Wall option
dnl ------------------------------
AC_MSG_CHECKING([Can we use -Wall flag (g++ or not)])
if test "X"${GXX} = "X""yes" ; then
   WALLFLAG="-Wall"
else
   WALLFLAG=""
fi
AC_MSG_RESULT(${WALLFLAG})
AC_SUBST(WALLFLAG)

dnl ------------------------------------------------------------
dnl Checks for libraries.
dnl ------------------------------------------------------------
AC_CHECK_LIB(m, sqrt)

dnl ------------------------------------------------------------
dnl Checks for header files.
dnl ------------------------------------------------------------
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h unistd.h)

dnl ------------------------------------------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ------------------------------------------------------------
dnl AC_C_CONST
dnl AC_C_INLINE

dnl ------------------------------------------------------------
dnl Checks for library functions.
dnl ------------------------------------------------------------
dnl AC_CHECK_FUNCS(strtod) これで今のところ困ったことはないな．．．
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(nanosleep)
AC_CHECK_FUNCS(usleep)

dnl ------------------------------------------------------------
dnl enable Profile Trace
dnl ------------------------------------------------------------
AC_MSG_CHECKING(if --enable-profile option specified)
AC_ARG_ENABLE(profile,
        [  --enable-profile	Build a profiling version.],
        [mpi2_profile_mon="yes"], [mpi2_profile_mon="no"])
if test "$mpi2_profile_mon" = yes; then
        AC_DEFINE(USE_PROFILE_MON)
fi
AC_MSG_RESULT($mpi2_profile_mon)


AC_MSG_CHECKING(if --enable-IBMpmarray option specified)
AC_ARG_ENABLE(IBMpmarray,
        [  --enable-IBMpmarray	Build a using IBM pmarray version.],
        [IBM_pmarray="yes"], [IBM_pmarray="no"])
if test "$IBM_pmarray" = yes; then
        AC_DEFINE(USE_IBM_PMARRAY)
fi
AC_MSG_RESULT($IBM_pmarray)

AC_MSG_CHECKING(if --enable-MPI2pmarray option specified)
AC_ARG_ENABLE(MPI2pmarray,
        [  --enable-MPI2pmarray	Build a using MPI2 pmarray version.],
        [MPI2_pmarray="yes"], [MPI2_pmarray="no"])
if test "$MPI2_pmarray" = yes; then
        AC_DEFINE(USE_MPI2_PMARRAY)
fi
AC_MSG_RESULT($MPI2_pmarray)

dnl ------------------------------------------------------------
dnl output result
dnl ------------------------------------------------------------
AC_OUTPUT(Makefile linkfor1PE.sh dellink.sh)
