From: Matt Arsenault Date: Mon, 8 Jul 2013 20:24:54 +0000 (+0000) Subject: Find xdot or xdot.py. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=e1e7310749008a515ddd5bf6398df17644f53b33 Find xdot or xdot.py. Ubuntu installs this as xdot, so finding xdot.py would fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185860 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 7137e295532..b54535e875e 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1200,15 +1200,15 @@ if test "$DOTTY" != "echo dotty" ; then AC_DEFINE_UNQUOTED([LLVM_PATH_DOTTY],"$DOTTY${EXEEXT}", [Define to path to dotty program if found or 'echo dotty' otherwise]) fi -AC_PATH_PROG(XDOT_PY, [xdot.py], [echo xdot.py]) -if test "$XDOT_PY" != "echo xdot.py" ; then - AC_DEFINE([HAVE_XDOT_PY],[1],[Define if the xdot.py program is available]) +AC_PATH_PROGS(XDOT, [xdot, xdot.py], [echo xdot]) +if test "$XDOT" != "echo xdot" ; then + AC_DEFINE([HAVE_XDOT],[1],[Define if the xdot 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 - XDOT_PY=`echo $XDOT_PY | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` + XDOT=`echo $XDOT | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` fi - AC_DEFINE_UNQUOTED([LLVM_PATH_XDOT_PY],"$XDOT_PY${EXEEXT}", - [Define to path to xdot.py program if found or 'echo xdot.py' otherwise]) + AC_DEFINE_UNQUOTED([LLVM_PATH_XDOT],"$XDOT${EXEEXT}", + [Define to path to xdot program if found or 'echo xdot' otherwise]) fi dnl Find the install program diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index fdc2bcd9286..ae914d244f8 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -271,7 +271,7 @@ llvm_find_program(neato) llvm_find_program(fdp) llvm_find_program(dot) llvm_find_program(dotty) -llvm_find_program(xdot.py) +llvm_find_program(xdot xdot.py) llvm_find_program(Graphviz) if( LLVM_ENABLE_FFI ) diff --git a/configure b/configure index 83c3dc555c6..b7b26c92d02 100755 --- a/configure +++ b/configure @@ -744,7 +744,7 @@ TWOPI CIRCO GV DOTTY -XDOT_PY +XDOT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA @@ -7225,16 +7225,18 @@ cat >>confdefs.h <<_ACEOF _ACEOF fi -# Extract the first word of "xdot.py", so it can be a program name with args. -set dummy xdot.py; ac_word=$2 +for ac_prog in xdot, xdot.py +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_XDOT_PY+set}" = set; then +if test "${ac_cv_path_XDOT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $XDOT_PY in + case $XDOT in [\\/]* | ?:[\\/]*) - ac_cv_path_XDOT_PY="$XDOT_PY" # Let the user override the test with a path. + ac_cv_path_XDOT="$XDOT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7244,7 +7246,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_XDOT_PY="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_XDOT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7252,32 +7254,35 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_XDOT_PY" && ac_cv_path_XDOT_PY="echo xdot.py" ;; esac fi -XDOT_PY=$ac_cv_path_XDOT_PY -if test -n "$XDOT_PY"; then - { echo "$as_me:$LINENO: result: $XDOT_PY" >&5 -echo "${ECHO_T}$XDOT_PY" >&6; } +XDOT=$ac_cv_path_XDOT +if test -n "$XDOT"; then + { echo "$as_me:$LINENO: result: $XDOT" >&5 +echo "${ECHO_T}$XDOT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi -if test "$XDOT_PY" != "echo xdot.py" ; then + test -n "$XDOT" && break +done +test -n "$XDOT" || XDOT="echo xdot" + +if test "$XDOT" != "echo xdot" ; then cat >>confdefs.h <<\_ACEOF -#define HAVE_XDOT_PY 1 +#define HAVE_XDOT 1 _ACEOF if test "$llvm_cv_os_type" = "MingW" ; then - XDOT_PY=`echo $XDOT_PY | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` + XDOT=`echo $XDOT | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` fi cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_XDOT_PY "$XDOT_PY${EXEEXT}" +#define LLVM_PATH_XDOT "$XDOT${EXEEXT}" _ACEOF fi @@ -10546,7 +10551,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < header file. */ #cmakedefine HAVE_ZLIB_H ${HAVE_ZLIB_H} @@ -657,8 +657,8 @@ /* Define to path to twopi program if found or 'echo twopi' otherwise */ #cmakedefine LLVM_PATH_TWOPI "${LLVM_PATH_TWOPI}" -/* Define to path to xdot.py program if found or 'echo xdot.py' otherwise */ -#cmakedefine LLVM_PATH_XDOT_PY "${LLVM_PATH_XDOT_PY}" +/* Define to path to xdot.py program if found or 'echo xdot' otherwise */ +#cmakedefine LLVM_PATH_XDOT "${LLVM_PATH_XDOT}" /* Installation prefix directory */ #cmakedefine LLVM_PREFIX "${LLVM_PREFIX}" diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in index 9ef70e171a7..3c6b58d7e7a 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -512,8 +512,8 @@ /* Define to 1 if you have the `writev' function. */ #undef HAVE_WRITEV -/* Define if the xdot.py program is available */ -#undef HAVE_XDOT_PY +/* Define if the xdot program is available */ +#undef HAVE_XDOT /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H @@ -662,8 +662,8 @@ /* Define to path to twopi program if found or 'echo twopi' otherwise */ #undef LLVM_PATH_TWOPI -/* Define to path to xdot.py program if found or 'echo xdot.py' otherwise */ -#undef LLVM_PATH_XDOT_PY +/* Define to path to xdot program if found or 'echo xdot' otherwise */ +#undef LLVM_PATH_XDOT /* Installation prefix directory */ #undef LLVM_PREFIX diff --git a/lib/Support/GraphWriter.cpp b/lib/Support/GraphWriter.cpp index 64d21642e8e..7a9400d28af 100644 --- a/lib/Support/GraphWriter.cpp +++ b/lib/Support/GraphWriter.cpp @@ -115,9 +115,9 @@ void llvm::DisplayGraph(StringRef FilenameRef, bool wait, if (!ExecGraphViewer(Graphviz, args, Filename, wait, ErrMsg)) return; -#elif HAVE_XDOT_PY +#elif HAVE_XDOT std::vector args; - args.push_back(LLVM_PATH_XDOT_PY); + args.push_back(LLVM_PATH_XDOT); args.push_back(Filename.c_str()); switch (program) { @@ -131,7 +131,7 @@ void llvm::DisplayGraph(StringRef FilenameRef, bool wait, args.push_back(0); errs() << "Running 'xdot.py' program... "; - if (!ExecGraphViewer(LLVM_PATH_XDOT_PY, args, Filename, wait, ErrMsg)) + if (!ExecGraphViewer(LLVM_PATH_XDOT, args, Filename, wait, ErrMsg)) return; #elif (HAVE_GV && (HAVE_DOT || HAVE_FDP || HAVE_NEATO || \