+AC_PATH_PROG(BINPWD,[pwd], [pwd])
+
+dnl Looking for misc. graph plotting software
+AC_PATH_PROG(GRAPHVIZ, [Graphviz], [echo Graphviz])
+if test "$GRAPHVIZ" != "echo Graphviz" ; then
+ AC_DEFINE([HAVE_GRAPHVIZ],[1],[Define if the Graphviz program is available])
+ dnl If we're targeting for mingw we should emit windows paths, not msys
+ if test "$llvm_cv_os_type" = "MingW" ; then
+ GRAPHVIZ=`echo $GRAPHVIZ | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
+ fi
+ AC_DEFINE_UNQUOTED([LLVM_PATH_GRAPHVIZ],"$GRAPHVIZ${EXEEXT}",
+ [Define to path to Graphviz program if found or 'echo Graphviz' otherwise])
+fi
+AC_PATH_PROG(DOT, [dot], [echo dot])
+if test "$DOT" != "echo dot" ; then
+ AC_DEFINE([HAVE_DOT],[1],[Define if the dot program is available])
+ dnl If we're targeting for mingw we should emit windows paths, not msys
+ if test "$llvm_cv_os_type" = "MingW" ; then
+ DOT=`echo $DOT | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
+ fi
+ AC_DEFINE_UNQUOTED([LLVM_PATH_DOT],"$DOT${EXEEXT}",
+ [Define to path to dot program if found or 'echo dot' otherwise])
+fi
+AC_PATH_PROGS(GV, [gv gsview32], [echo gv])
+if test "$GV" != "echo gv" ; then
+ AC_DEFINE([HAVE_GV],[1],[Define if the gv program is available])
+ dnl If we're targeting for mingw we should emit windows paths, not msys
+ if test "$llvm_cv_os_type" = "MingW" ; then
+ GV=`echo $GV | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
+ fi
+ AC_DEFINE_UNQUOTED([LLVM_PATH_GV],"$GV${EXEEXT}",
+ [Define to path to gv program if found or 'echo gv' otherwise])
+fi
+AC_PATH_PROG(DOTTY, [dotty], [echo dotty])
+if test "$DOTTY" != "echo dotty" ; then
+ AC_DEFINE([HAVE_DOTTY],[1],[Define if the dotty program is available])
+ dnl If we're targeting for mingw we should emit windows paths, not msys
+ if test "$llvm_cv_os_type" = "MingW" ; then
+ DOTTY=`echo $DOTTY | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
+ fi
+ AC_DEFINE_UNQUOTED([LLVM_PATH_DOTTY],"$DOTTY${EXEEXT}",
+ [Define to path to dotty program if found or 'echo dotty' otherwise])
+fi
+
+dnl Look for a sufficiently recent version of Perl.
+LLVM_PROG_PERL([5.006])
+AC_SUBST(PERL)
+if test x"$PERL" = xnone; then
+ AC_SUBST(HAVE_PERL,0)
+ AC_MSG_ERROR([perl is required but was not found, please install it])
+else
+ AC_SUBST(HAVE_PERL,1)
+fi