Find xdot or xdot.py.
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 8 Jul 2013 20:24:54 +0000 (20:24 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 8 Jul 2013 20:24:54 +0000 (20:24 +0000)
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

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

index 7137e29553294103a84b84d3fefc20d7875ca939..b54535e875e1fb3f200e665e5ecc7a18b90ec1ba 100644 (file)
@@ -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_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
   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
   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
 fi
 
 dnl Find the install program
index fdc2bcd92865c03926ace0befde52884875ac3d8..ae914d244f8e289b2ae4989f3f21dfcd9b5a854f 100755 (executable)
@@ -271,7 +271,7 @@ llvm_find_program(neato)
 llvm_find_program(fdp)
 llvm_find_program(dot)
 llvm_find_program(dotty)
 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 )
 llvm_find_program(Graphviz)
 
 if( LLVM_ENABLE_FFI )
index 83c3dc555c629ae95105edb0bf15d5bcadbf85fd..b7b26c92d02f9d7a80c77cf553a3088a24d0c726 100755 (executable)
--- a/configure
+++ b/configure
@@ -744,7 +744,7 @@ TWOPI
 CIRCO
 GV
 DOTTY
 CIRCO
 GV
 DOTTY
-XDOT_PY
+XDOT
 INSTALL_PROGRAM
 INSTALL_SCRIPT
 INSTALL_DATA
 INSTALL_PROGRAM
 INSTALL_SCRIPT
 INSTALL_DATA
@@ -7225,16 +7225,18 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 fi
 _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; }
 { 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
   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
   ;;
   *)
   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
   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
     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
 
 done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_XDOT_PY" && ac_cv_path_XDOT_PY="echo xdot.py"
   ;;
 esac
 fi
   ;;
 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
 
 
 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
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_XDOT_PY 1
+#define HAVE_XDOT 1
 _ACEOF
 
     if test "$llvm_cv_os_type" = "MingW" ; then
 _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
   fi
 
 cat >>confdefs.h <<_ACEOF
-#define LLVM_PATH_XDOT_PY "$XDOT_PY${EXEEXT}"
+#define LLVM_PATH_XDOT "$XDOT${EXEEXT}"
 _ACEOF
 
 fi
 _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
   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
 #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
 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
 INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
 INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
 INSTALL_DATA!$INSTALL_DATA$ac_delim
index 1f5b407961cc2e3db8f609a8577fdc29e911ae9a..a5dcc5b95d9e3757898189c7f8585a91b0d6f571 100644 (file)
 #cmakedefine HAVE_WRITEV ${HAVE_WRITEV}
 
 /* Define if the xdot.py program is available */
 #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}
 
 /* Define to 1 if you have the <zlib.h> header file. */
 #cmakedefine HAVE_ZLIB_H ${HAVE_ZLIB_H}
 /* Define to path to twopi program if found or 'echo twopi' otherwise */
 #cmakedefine LLVM_PATH_TWOPI "${LLVM_PATH_TWOPI}"
 
 /* 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}"
 
 /* Installation prefix directory */
 #cmakedefine LLVM_PREFIX "${LLVM_PREFIX}"
index 9ef70e171a7962f08e3d1b2e8230b83c9e21d9f4..3c6b58d7e7a9e67477b211e72636b37f501652b2 100644 (file)
 /* Define to 1 if you have the `writev' function. */
 #undef HAVE_WRITEV
 
 /* 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
 
 /* Define to 1 if you have the <zlib.h> header file. */
 #undef HAVE_ZLIB_H
 /* Define to path to twopi program if found or 'echo twopi' otherwise */
 #undef LLVM_PATH_TWOPI
 
 /* 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
 
 /* Installation prefix directory */
 #undef LLVM_PREFIX
index 64d21642e8ecacb859902fa49b01cd2b87e08f09..7a9400d28afa447718ce27ae8e4e2f10820365de 100644 (file)
@@ -115,9 +115,9 @@ void llvm::DisplayGraph(StringRef FilenameRef, bool wait,
   if (!ExecGraphViewer(Graphviz, args, Filename, wait, ErrMsg))
     return;
 
   if (!ExecGraphViewer(Graphviz, args, Filename, wait, ErrMsg))
     return;
 
-#elif HAVE_XDOT_PY
+#elif HAVE_XDOT
   std::vector<const char*> args;
   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) {
   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... ";
   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 || \
     return;
 
 #elif (HAVE_GV && (HAVE_DOT || HAVE_FDP || HAVE_NEATO || \