Skip to content

Commit

Permalink
Find xdot or xdot.py.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
arsenm committed Jul 8, 2013
1 parent cffecb4 commit e1e7310
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 35 deletions.
12 changes: 6 additions & 6 deletions autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
41 changes: 23 additions & 18 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ TWOPI
CIRCO
GV
DOTTY
XDOT_PY
XDOT
INSTALL_PROGRAM
INSTALL_SCRIPT
INSTALL_DATA
Expand Down Expand Up @@ -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
Expand All @@ -7244,40 +7246,43 @@ 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
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions include/llvm/Config/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}"
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/Config/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/Support/GraphWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const char*> args;
args.push_back(LLVM_PATH_XDOT_PY);
args.push_back(LLVM_PATH_XDOT);
args.push_back(Filename.c_str());

switch (program) {
Expand All @@ -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 || \
Expand Down

0 comments on commit e1e7310

Please sign in to comment.