[llvm] r185860 - Find xdot or xdot.py.

Matt Arsenault Matthew.Arsenault at amd.com
Mon Jul 8 13:24:54 PDT 2013


Author: arsenm
Date: Mon Jul  8 15:24:54 2013
New Revision: 185860

URL: http://llvm.org/viewvc/llvm-project?rev=185860&view=rev
Log:
Find xdot or xdot.py.

Ubuntu installs this as xdot, so finding xdot.py would fail.

Modified:
    llvm/trunk/autoconf/configure.ac
    llvm/trunk/cmake/config-ix.cmake
    llvm/trunk/configure
    llvm/trunk/include/llvm/Config/config.h.cmake
    llvm/trunk/include/llvm/Config/config.h.in
    llvm/trunk/lib/Support/GraphWriter.cpp

Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=185860&r1=185859&r2=185860&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Mon Jul  8 15:24:54 2013
@@ -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

Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=185860&r1=185859&r2=185860&view=diff
==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Mon Jul  8 15:24:54 2013
@@ -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 )

Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=185860&r1=185859&r2=185860&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Mon Jul  8 15:24:54 2013
@@ -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 <<EOF
-#line 10549 "configure"
+#line 10554 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -23588,7 +23593,7 @@ TWOPI!$TWOPI$ac_delim
 CIRCO!$CIRCO$ac_delim
 GV!$GV$ac_delim
 DOTTY!$DOTTY$ac_delim
-XDOT_PY!$XDOT_PY$ac_delim
+XDOT!$XDOT$ac_delim
 INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
 INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
 INSTALL_DATA!$INSTALL_DATA$ac_delim

Modified: llvm/trunk/include/llvm/Config/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.cmake?rev=185860&r1=185859&r2=185860&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/config.h.cmake Mon Jul  8 15:24:54 2013
@@ -508,7 +508,7 @@
 #cmakedefine HAVE_WRITEV ${HAVE_WRITEV}
 
 /* Define if the xdot.py program is available */
-#cmakedefine HAVE_XDOT_PY ${HAVE_XDOT_PY}
+#cmakedefine HAVE_XDOT ${HAVE_XDOT}
 
 /* Define to 1 if you have the <zlib.h> 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}"

Modified: llvm/trunk/include/llvm/Config/config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=185860&r1=185859&r2=185860&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.in (original)
+++ llvm/trunk/include/llvm/Config/config.h.in Mon Jul  8 15:24:54 2013
@@ -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 <zlib.h> 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

Modified: llvm/trunk/lib/Support/GraphWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/GraphWriter.cpp?rev=185860&r1=185859&r2=185860&view=diff
==============================================================================
--- llvm/trunk/lib/Support/GraphWriter.cpp (original)
+++ llvm/trunk/lib/Support/GraphWriter.cpp Mon Jul  8 15:24:54 2013
@@ -115,9 +115,9 @@ void llvm::DisplayGraph(StringRef Filena
   if (!ExecGraphViewer(Graphviz, args, Filename, wait, ErrMsg))
     return;
 
-#elif HAVE_XDOT_PY
+#elif HAVE_XDOT
   std::vector<const char*> 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 Filena
   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 || \





More information about the llvm-commits mailing list