summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b6ec677)
raw | patch | inline | side by side (parent: b6ec677)
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/branches/1.4/program@2103 a5681a0c-68f1-0310-ab6d-d61299d08faa
* replace round by rint if round is not available
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2103 a5681a0c-68f1-0310-ab6d-d61299d08faa
CHANGES | patch | blob | history | |
configure.ac | patch | blob | history | |
doc/rrdbuild.pod | patch | blob | history | |
m4/acinclude.m4 | patch | blob | history | |
src/rrd_config_bottom.h | patch | blob | history | |
src/rrd_getopt.c | patch | blob | history | |
src/rrd_getopt1.c | patch | blob | history |
index 424acb1836bcfe552906924d1baabe5217bfee44..5bd98dc80259ee1cbf40803124a0e95abead05a3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
Bugfixes:
* compile: multiple fixes isnan and isinf defines to make rrdtool compile
- on solaris ... -- Tobi
+ with gcc on solaris (with --disable-nls) -- Tobi
* rrd_client: fix potential segfaults -- Florian Forster
* rrd_client: resolve synmlinks properly -- Kevin Brintnall
* compile: fix libtool and libtoolize names for OSX compiles -- Antoine Musso
diff --git a/configure.ac b/configure.ac
index 29be00cacdb5c7b202f1f76c689bfb22ee787aba..9c5fa8a52eb23026e902f0d49f5a3cf031e22bc0 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'`
dnl for each function found we get a definition in config.h
dnl of the form HAVE_FUNCTION
-AC_CHECK_FUNCS(nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getuid strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday)
+AC_CHECK_FUNCS(nl_langinfo tzset round rint fsync mbstowcs opendir readdir chdir chroot getuid strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday)
AC_FUNC_STRERROR_R
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 ae072be1841c8577d2bc514b6c040d2058f5bcf0..c48a06f1a76f7532b6808802416d7af8f2687765 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)