summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbee4e3)
raw | patch | inline | side by side (parent: bbee4e3)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 5 Jul 2010 13:19:18 +0000 (13:19 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 5 Jul 2010 13:19:18 +0000 (13:19 +0000) |
* unify isinf isnan definitions for compilation and configuration
* replace round by rint if round is not available
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2103 a5681a0c-68f1-0310-ab6d-d61299d08faa
* replace round by rint if round is not available
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2103 a5681a0c-68f1-0310-ab6d-d61299d08faa
diff --git a/configure.ac b/configure.ac
index cfbeb1d1bef9f83b9c86f78d48fe8f2744b2dc81..d0fec6a26141a4e09a682764b1ae7f545ca40584 100644 (file)
--- a/configure.ac
+++ b/configure.ac
dnl which flags does the compiler support?
if test "x$GCC" = "xyes"; then
- for flag in -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W; do
+ for flag in -fno-strict-aliasing -Wall -std=gnu99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W; do
oCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $flag"
cachename=rd_cv_gcc_flag_`echo $flag|sed 's/[[^A-Za-z]]/_/g'`
diff --git a/doc/rrdbuild.pod b/doc/rrdbuild.pod
index dbcd5d31efdd9b381b7755b0ade7d1f2125eaedc..4159d5ab47a2407e217dba73e5817be548432c52 100644 (file)
--- a/doc/rrdbuild.pod
+++ b/doc/rrdbuild.pod
export PATH=/opt/SunStudioExpress/bin
-Since there does not seem to be a viable msgfmt tool on OpenSolaris (short
-of installing it yourself). You have to call configure with the
+=head2 Solaris 8/9
- --disable-libintl
+Getting NLS to work on old solaris is an open issue ... use
+
+ --disable-nls
option.
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
index ee2fc1b97ca466123b3450081c07939996269c6a..4ada91974bbb9dd25a6f883a18e4b6f4f770e55a 100644 (file)
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
AC_MSG_CHECKING([if IEEE math works $1])
AC_CACHE_VAL([rd_cv_ieee_$2],
[AC_RUN_IFELSE([AC_LANG_SOURCE([[$3
-
-#if HAVE_MATH_H
-# include <math.h>
-#endif
-
-#if HAVE_FLOAT_H
-# include <float.h>
-#endif
-
-#if HAVE_IEEEFP_H
-# include <ieeefp.h>
-#endif
-
-#if HAVE_FP_CLASS_H
-# include <fp_class.h>
-#endif
-
-/* Solaris */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
-# define HAVE_ISINF 1
-# define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
-#endif
-
-/* solaris 10 it defines isnan such that only forte can compile it ... bad bad */
-#if (defined(HAVE_ISNAN) && defined(isnan) && defined(HAVE_FPCLASS) && defined(FP_SNAN) && defined(FP_QNAN))
-# undef isnan
-# define isnan(a) (fpclass(a) == FP_SNAN || fpclass(a) == FP_QNAN)
-#endif
-
-/* Digital UNIX */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H) && defined(FP_NEG_INF) && defined( FP_POS_INF) )
-# define HAVE_ISINF 1
-# define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-
-/* AIX */
-#if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
-# define HAVE_ISINF 1
-# define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
-#endif
-
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
-# define HAVE_ISINF 1
-# define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
-# define HAVE_ISINF 1
-# define isinf(a) (fpclassify(a) == FP_INFINITE)
-#endif
-
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-
+#include "src/rrd_config_bottom.h"
#include <stdio.h>
int main(void){
double rrdnan,rrdinf,rrdc,rrdzero;
index 90ecc8e9f2b45a03200554dd0cbb97cd101b41ae..e7d0a38f6d1d8f28c5bcf49697de165ddf87782d 100644 (file)
--- a/src/rrd_config_bottom.h
+++ b/src/rrd_config_bottom.h
# define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
#endif
+/* solaris 8/9 has rint but not round */
+#if (! defined(HAVE_ROUND) && defined(HAVE_RINT))
+# define round rint
+#endif
+
/* solaris 10 it defines isnan such that only forte can compile it ... bad bad */
#if (defined(HAVE_ISNAN) && defined(isnan) && defined(HAVE_FPCLASS))
# undef isnan
diff --git a/src/rrd_getopt.c b/src/rrd_getopt.c
index a74ff88de7a6bcc140c492cd2da5d5158414d471..0556c86a82602e2a3ea5c413d4e17cbd56a8a181 100644 (file)
--- a/src/rrd_getopt.c
+++ b/src/rrd_getopt.c
const char *);
#endif
static const char* _getopt_initialize(int argc,
- char** argv,
+ char* const* argv,
const char* optstring)
{
/* Start processing options with ARGV-element 1 (since ARGV-element 0
long-named options. */
int _getopt_internal(int argc,
- char** argv,
+ char* const* argv,
const char *optstring,
const struct option *longopts,
int* longind,
}
}
-int getopt(
- int argc,
- char** argv,
- const char* optstring)
-{
- return _getopt_internal(argc, argv, optstring,
- (const struct option *) 0, (int *) 0, 0);
-}
-
#endif /* Not ELIDE_CODE. */
\f
#ifdef TEST
diff --git a/src/rrd_getopt1.c b/src/rrd_getopt1.c
index 1ace77e24c9157e5254a485d0866b417bc5411e8..32e54915debc31989234ca87b960230f569f4f3d 100644 (file)
--- a/src/rrd_getopt1.c
+++ b/src/rrd_getopt1.c
#endif
int getopt_long(int argc,
- char** argv,
+ char* const* argv,
const char* options,
const struct option* long_options,
int* opt_index)
instead. */
int getopt_long_only(int argc,
- char** argv,
+ char* const* argv,
const char* options,
const struct option* long_options,
int* opt_index)