GraphWriter: detect graph viewer programs at runtime

Replace the crufty build-time configure checks for program paths with
equivalent runtime logic.

This lets users install graphing tools as needed without having to reconfigure
and rebuild LLVM, while eliminating a long chain of inappropriate compile
dependencies that included GUI programs and the windowing system.

Additional features:

 * Support the OS X 'open' command to view graphs generated by any of the
   Graphviz utilities. This is an alternative to the Graphviz OS X UI which is
   no longer available on Mountain Lion.

 * Produce informative log output upon failure to indicate which programs can
   be installed to view graphs.

Ping me if this doesn't work for your particular environment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210001 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alp Toker
2014-06-02 01:40:04 +00:00
parent df1913982b
commit 04de60e28f
9 changed files with 131 additions and 368 deletions

View File

@@ -45,9 +45,6 @@
/* Define to 1 if you have the `ceilf' function. */
#cmakedefine HAVE_CEILF ${HAVE_CEILF}
/* Define if the neat program is available */
#cmakedefine HAVE_CIRCO ${HAVE_CIRCO}
/* Define to 1 if you have the `closedir' function. */
#cmakedefine HAVE_CLOSEDIR ${HAVE_CLOSEDIR}
@@ -80,12 +77,6 @@
/* Define if dlopen() is available on this platform. */
#cmakedefine HAVE_DLOPEN ${HAVE_DLOPEN}
/* Define if the dot program is available */
#cmakedefine HAVE_DOT ${HAVE_DOT}
/* Define if the dotty program is available */
#cmakedefine HAVE_DOTTY ${HAVE_DOTTY}
/* Define if you have the _dyld_func_lookup function. */
#undef HAVE_DYLD
@@ -98,9 +89,6 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H ${HAVE_FCNTL_H}
/* Define if the neat program is available */
#cmakedefine HAVE_FDP ${HAVE_FDP}
/* Define to 1 if you have the <fenv.h> header file. */
#cmakedefine HAVE_FENV_H ${HAVE_FENV_H}
@@ -161,12 +149,6 @@
/* Define to 1 if you have the `gettimeofday' function. */
#cmakedefine HAVE_GETTIMEOFDAY ${HAVE_GETTIMEOFDAY}
/* Define if the Graphviz program is available */
#cmakedefine HAVE_GRAPHVIZ ${HAVE_GRAPHVIZ}
/* Define if the gv program is available */
#cmakedefine HAVE_GV ${HAVE_GV}
/* Define to 1 if the system has the type `int64_t'. */
#cmakedefine HAVE_INT64_T ${HAVE_INT64_T}
@@ -271,9 +253,6 @@
/* Define to 1 if you have the `nearbyintf' function. */
#cmakedefine HAVE_NEARBYINTF ${HAVE_NEARBYINTF}
/* Define if the neat program is available */
#cmakedefine HAVE_NEATO ${HAVE_NEATO}
/* Define to 1 if you have the `opendir' function. */
#cmakedefine HAVE_OPENDIR ${HAVE_OPENDIR}
@@ -417,9 +396,6 @@
/* Define to 1 if you have the <termios.h> header file. */
#cmakedefine HAVE_TERMIOS_H ${HAVE_TERMIOS_H}
/* Define if the neat program is available */
#cmakedefine HAVE_TWOPI ${HAVE_TWOPI}
/* Define to 1 if the system has the type `uint64_t'. */
#cmakedefine HAVE_UINT64_T ${HAVE_UINT64_T}
@@ -438,9 +414,6 @@
/* Define to 1 if you have the `writev' function. */
#cmakedefine HAVE_WRITEV ${HAVE_WRITEV}
/* Define if the xdot.py program is available */
#cmakedefine HAVE_XDOT ${HAVE_XDOT}
/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine HAVE_ZLIB_H ${HAVE_ZLIB_H}
@@ -567,33 +540,6 @@
/* Define if this is Win32ish platform */
#cmakedefine LLVM_ON_WIN32 ${LLVM_ON_WIN32}
/* Define to path to circo program if found or 'echo circo' otherwise */
#cmakedefine LLVM_PATH_CIRCO "${LLVM_PATH_CIRCO}"
/* Define to path to dot program if found or 'echo dot' otherwise */
#cmakedefine LLVM_PATH_DOT "${LLVM_PATH_DOT}"
/* Define to path to dotty program if found or 'echo dotty' otherwise */
#cmakedefine LLVM_PATH_DOTTY "${LLVM_PATH_DOTTY}"
/* Define to path to fdp program if found or 'echo fdp' otherwise */
#cmakedefine LLVM_PATH_FDP "${LLVM_PATH_FDP}"
/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
#cmakedefine LLVM_PATH_GRAPHVIZ "${LLVM_PATH_GRAPHVIZ}"
/* Define to path to gv program if found or 'echo gv' otherwise */
#cmakedefine LLVM_PATH_GV "${LLVM_PATH_GV}"
/* Define to path to neato program if found or 'echo neato' otherwise */
#cmakedefine LLVM_PATH_NEATO "${LLVM_PATH_NEATO}"
/* 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' otherwise */
#cmakedefine LLVM_PATH_XDOT "${LLVM_PATH_XDOT}"
/* Installation prefix directory */
#cmakedefine LLVM_PREFIX "${LLVM_PREFIX}"

View File

@@ -39,9 +39,6 @@
/* Define to 1 if you have the `ceilf' function. */
#undef HAVE_CEILF
/* Define if the neat program is available */
#undef HAVE_CIRCO
/* Define to 1 if you have the <CrashReporterClient.h> header file. */
#undef HAVE_CRASHREPORTERCLIENT_H
@@ -77,12 +74,6 @@
/* Define if dlopen() is available on this platform. */
#undef HAVE_DLOPEN
/* Define if the dot program is available */
#undef HAVE_DOT
/* Define if the dotty program is available */
#undef HAVE_DOTTY
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
@@ -98,9 +89,6 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if the neat program is available */
#undef HAVE_FDP
/* Define to 1 if you have the <fenv.h> header file. */
#undef HAVE_FENV_H
@@ -143,12 +131,6 @@
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define if the Graphviz program is available */
#undef HAVE_GRAPHVIZ
/* Define if the gv program is available */
#undef HAVE_GV
/* Define to 1 if the system has the type `int64_t'. */
#undef HAVE_INT64_T
@@ -259,9 +241,6 @@
/* Define to 1 if you have the `nearbyintf' function. */
#undef HAVE_NEARBYINTF
/* Define if the neat program is available */
#undef HAVE_NEATO
/* Define to 1 if you have the `posix_spawn' function. */
#undef HAVE_POSIX_SPAWN
@@ -402,9 +381,6 @@
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define if the neat program is available */
#undef HAVE_TWOPI
/* Define to 1 if the system has the type `uint64_t'. */
#undef HAVE_UINT64_T
@@ -423,9 +399,6 @@
/* Define to 1 if you have the `writev' function. */
#undef HAVE_WRITEV
/* 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
@@ -549,33 +522,6 @@
/* Define if this is Win32ish platform */
#undef LLVM_ON_WIN32
/* Define to path to circo program if found or 'echo circo' otherwise */
#undef LLVM_PATH_CIRCO
/* Define to path to dot program if found or 'echo dot' otherwise */
#undef LLVM_PATH_DOT
/* Define to path to dotty program if found or 'echo dotty' otherwise */
#undef LLVM_PATH_DOTTY
/* Define to path to fdp program if found or 'echo fdp' otherwise */
#undef LLVM_PATH_FDP
/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
#undef LLVM_PATH_GRAPHVIZ
/* Define to path to gv program if found or 'echo gv' otherwise */
#undef LLVM_PATH_GV
/* Define to path to neato program if found or 'echo neato' otherwise */
#undef LLVM_PATH_NEATO
/* Define to path to twopi program if found or 'echo twopi' otherwise */
#undef LLVM_PATH_TWOPI
/* Define to path to xdot program if found or 'echo xdot' otherwise */
#undef LLVM_PATH_XDOT
/* Installation prefix directory */
#undef LLVM_PREFIX

View File

@@ -79,33 +79,6 @@
/* Define if this is Win32ish platform */
#cmakedefine LLVM_ON_WIN32 ${LLVM_ON_WIN32}
/* Define to path to circo program if found or 'echo circo' otherwise */
#cmakedefine LLVM_PATH_CIRCO "${LLVM_PATH_CIRCO}"
/* Define to path to dot program if found or 'echo dot' otherwise */
#cmakedefine LLVM_PATH_DOT "${LLVM_PATH_DOT}"
/* Define to path to dotty program if found or 'echo dotty' otherwise */
#cmakedefine LLVM_PATH_DOTTY "${LLVM_PATH_DOTTY}"
/* Define to path to fdp program if found or 'echo fdp' otherwise */
#cmakedefine LLVM_PATH_FDP "${LLVM_PATH_FDP}"
/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
#cmakedefine LLVM_PATH_GRAPHVIZ "${LLVM_PATH_GRAPHVIZ}"
/* Define to path to gv program if found or 'echo gv' otherwise */
#cmakedefine LLVM_PATH_GV "${LLVM_PATH_GV}"
/* Define to path to neato program if found or 'echo neato' otherwise */
#cmakedefine LLVM_PATH_NEATO "${LLVM_PATH_NEATO}"
/* 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}"
/* Installation prefix directory */
#cmakedefine LLVM_PREFIX "${LLVM_PREFIX}"

View File

@@ -79,33 +79,6 @@
/* Define if this is Win32ish platform */
#undef LLVM_ON_WIN32
/* Define to path to circo program if found or 'echo circo' otherwise */
#undef LLVM_PATH_CIRCO
/* Define to path to dot program if found or 'echo dot' otherwise */
#undef LLVM_PATH_DOT
/* Define to path to dotty program if found or 'echo dotty' otherwise */
#undef LLVM_PATH_DOTTY
/* Define to path to fdp program if found or 'echo fdp' otherwise */
#undef LLVM_PATH_FDP
/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
#undef LLVM_PATH_GRAPHVIZ
/* Define to path to gv program if found or 'echo gv' otherwise */
#undef LLVM_PATH_GV
/* Define to path to neato program if found or 'echo neato' otherwise */
#undef LLVM_PATH_NEATO
/* 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
/* Installation prefix directory */
#undef LLVM_PREFIX