|
From: Ethan A M. <merritt@u.washington.edu> - 2007-03-09 16:23:15
|
On Friday 09 March 2007 05:39, Allin Cottrell wrote:
>
> I may have misdescribed the outcome, but in the context of a
> configure check this is what I had in mind:
>
> echo "set term png" | gnuplot 2>/dev/null && echo "OK"
> echo "set term foo" | gnuplot 2>/dev/null && echo "OK"
>
> The first command echoes "OK", the second doesn't.
Can you point to any place in the documentation that supports
this idea? I have been looking, and can't find anything that
would give the impession that such a test would work.
It is true there is at least one code path that would
result in gnuplot exiting with an error status set, but the
path looks rather fragile to me. It depends on the current
input stream and on whether the "interactive" flag is set,
and anyhow it isn't initialized until the initial terminal
setup is already complete. So I guess I am surprised to
learn that such a test ever worked!
My recommendation for a configuration test is to use the
output of "show version long":
-READLINE +LIBREADLINE +HISTORY -BACKWARDS_COMPATIBILITY +BINARY_DATA
+GD_PNG +GD_JPEG +GD_TTF +GD_GIF +ANIMATION
-NOCWDRC +X11 +X11_POLYGON +MULTIBYTE +USE_MOUSE +HIDDEN3D_QUADTREE
+DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS +MACROS +IMAGE
You can even check these configuration option from inside a gnuplot
script. The current demos do this. For example, image.dem begins with
if ((GPVAL_VERSION == 4.3 || GPVAL_VERSION == 4.2) \
&& (!strstrt(GPVAL_COMPILE_OPTIONS,"+IMAGE"))) \
print ">>> Skipping demo <<<\n" ; \
print "This copy of gnuplot was built without support for plotting images" ; \
exit ;
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|