- Timestamp:
- Dec 20, 2008, 12:04:54 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r742 r743 82 82 AC_PATH_PROG([HELP2MAN], [help2man], [no]) 83 83 AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN != xno]) 84 AC_CHECK_PROG([GNUPLOT],[gnuplot],[ok]) 84 AC_PATH_PROG([GNUPLOT],[gnuplot],[no]) 85 AC_DEFINE_UNQUOTED([GNUPLOT_PATH], ["$GNUPLOT"], 86 [defined to gnuplot path (or no if gnuplot was not found)]) 85 87 86 88 # Save FLAGS … … 273 275 274 276 # Failure to locate gnuplot is not considered fatal 275 if (test " $GNUPLOT" != "ok") ; then277 if (test "x$GNUPLOT" = "xno") ; then 276 278 AC_MSG_WARN([Gnuplot was not found. svndigest will compile 277 279 without gnuplot but will throw an exception at run-time. Please -
trunk/lib/Gnuplot.cc
r727 r743 4 4 Copyright (C) 2006 Jari Häkkinen, Peter Johansson 5 5 Copyright (C) 2007 Peter Johansson 6 Copyright (C) 2008 Jari Häkkinen 6 Copyright (C) 2008 Jari Häkkinen, Peter Johansson 7 7 8 8 This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 21 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 22 */ 23 24 #include <config.h> 23 25 24 26 #include "Gnuplot.h" … … 58 60 void Gnuplot::acquire_program_path(const std::string& progname) 59 61 { 60 char* env_path=getenv("PATH"); 61 if (!env_path) 62 throw GnuplotException("Environment variable PATH is not set"); 63 64 std::list<std::string> paths; 65 tokenizer(env_path,paths); 66 for (std::list<std::string>::const_iterator i=paths.begin(); 67 i!=paths.end(); ++i) { 68 std::string tmp((*i) + '/' + progname); 69 if (!access(tmp.c_str(),X_OK)) { 70 gnuplot_binary_=tmp; 71 break; 72 } 62 std::string tmp = GNUPLOT_PATH; 63 if (tmp=="no") 64 throw GnuplotException("no gnuplot binary available"); 65 if (!access(tmp.c_str(),X_OK)) { 66 gnuplot_binary_=tmp; 73 67 } 74 68 75 69 if (gnuplot_binary_.empty()) 76 throw GnuplotException("Cannot find '" + progname + "' in PATH");70 throw GnuplotException("Cannot find '" + tmp); 77 71 } 78 72
Note: See TracChangeset
for help on using the changeset viewer.