AC_INIT(pi.c)
            
dnl find and test the C compiler
AC_PROG_CC
AC_LANG_C
        
AC_PROG_MAKE_SET
               
AC_HEADER_STDC
AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?))
                  
VERSION="0.0.1"
AC_SUBST(VERSION)


 # Check for wide strings
AC_DEFUN([AC_CXX_WSTRING],[
 AC_CACHE_CHECK(whether the compiler supports wide strings,
 ac_cv_cxx_wstring,
 [AC_LANG_SAVE
  AC_LANG_CPLUSPLUS
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string>]],[[
std::wstring test = L"test";
  ]])],
  [ac_cv_cxx_wstring=yes], [ac_cv_cxx_wstring=no])
  AC_LANG_RESTORE
 ])
])

AC_CXX_WSTRING

if test "$ac_cv_cxx_wstring" = no
then
 AC_MSG_ERROR([Missing wide string support])
fi

dnl read Makefile.in and write Makefile
AC_OUTPUT(Makefile)

