|
From: Ethan M. <merritt@u.washington.edu> - 2009-08-04 18:15:40
|
On Tuesday 04 August 2009 02:03:18 Shigeharu TAKENO wrote: > shige 08/04 2009 > ---------------- > > When I compiled gnuplot of CVS version with --enable-qt on > Solaris 9, I found some points: > > 1) a string "enable_qt = yes;" in configure.in may not have > spaces. OK. That's easy to fix. > 2) a function 'round()' is used in src/qtterminal/qt_term.cpp and > src/qtterminal/QtGnuplotScene.cpp, but Solaris 9 don't have it. round() is a C99 function. Its definition is slightly different from #define round(a) (floor((a)+.5)) because for negative numbers it shifts half-integral values towards zero rather than away from zero. See discussion at http://www-old.cae.wisc.edu/pipermail/help-octave/2008-April/008958.html Furthermore, testing for #if !defined(round) will return TRUE even if the local math library does contain round() as a function. So that is not the right test. Probably we can use an autoconf test for this: --- gnuplot/configure.in 2009-07-31 09:42:25.000000000 -0700 +++ gnuplot-cvs/configure.in 2009-08-04 11:09:29.000000000 -0700 @@ -79,6 +79,13 @@ dnl _instead_ of -lm ... AC_CHECK_FUNC(sin,,[AC_CHECK_LIB(m,sin)]) +dnl round() is a C99 math library function +AC_CHECK_LIB(m, round) +if test "$ac_cv_lib_m_round" = yes; then + AC_DEFINE(HAVE_ROUND,1, + [ Define if your platform provides a function round(). ])], +fi + dnl Header files. ANSI first dnl We prefer that the absense of a macro is the norm, so in syscfg.h dnl configure's HAVE_XXXX defines are translated into NO_XXXX for ANSI > So I needed the following patch. > > ----- From here ----- > diff -u configure.in.ORG configure.in > --- configure.in.ORG Mon Aug 3 13:47:39 2009 > +++ configure.in Tue Aug 4 17:05:24 2009 > @@ -1022,7 +1022,7 @@ > AC_ARG_ENABLE(qt,dnl > [ --enable-qt Qt terminal (default disabled)], > [if test "$enableval" = yes; then > - enable_qt = yes; > + enable_qt=yes; > fi]) > > if test "${enable_qt}" = yes ; then > diff -u src/qtterminal/QtGnuplotScene.h.ORG src/qtterminal/QtGnuplotScene.h > --- src/qtterminal/QtGnuplotScene.h.ORG Mon Aug 3 13:47:35 2009 > +++ src/qtterminal/QtGnuplotScene.h Tue Aug 4 16:50:52 2009 > @@ -49,6 +49,11 @@ > #include <QGraphicsScene> > #include <QTime> > > +/* for Solaris 9 */ > +#if !defined(round) > +# define round(a) (floor((a)+.5)) > +#endif > + > class QtGnuplotEnhanced; > class QtGnuplotWidget; > > diff -u src/qtterminal/qt_term.h.ORG src/qtterminal/qt_term.h > --- src/qtterminal/qt_term.h.ORG Mon Aug 3 13:47:36 2009 > +++ src/qtterminal/qt_term.h Tue Aug 4 16:51:00 2009 > @@ -49,6 +49,11 @@ > #ifndef GNUPLOT_QT_TERM_H > #define GNUPLOT_QT_TERM_H > > +/* for Solaris 9 */ > +#if !defined(round) > +# define round(a) (floor((a)+.5)) > +#endif > + > #ifdef __cplusplus > extern "C" { > #endif /*__cplusplus*/ > ----- To here ----- > > +========================================================+ > Shigeharu TAKENO NIigata Institute of Technology > kashiwazaki,Niigata 945-1195 JAPAN > sh...@ie... TEL(&FAX): +81-257-22-8161 > +========================================================+ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |